Skip to content

Latest commit

 

History

History

README.md

MSP Customer Deletion

This is a Python script that uses the Pycentral library to automate the following steps on an Aruba Central account with MSP mode-

  1. Unassigns all devices & licenses within the customer's Aruba Central Instance. The devices & licenses will be moved back to the MSP's inventory.
  2. Uninstall the customer's Aruba Central instance
  3. Delete the customer's Greenlake Instance

Demo Workflow

Installation Steps

In order to run the script, please complete the steps below:

  1. Clone this repository and cd into the workflow directory:

    git clone https://github.hpe.com/hpe/central-python-workflows
    cd central-python-workflows/msp_customer_deletion
  2. Install virtual environment (refer https://docs.python.org/3/library/venv.html). Make sure python version 3 is installed in system.

    python -m venv env
  3. Activate the virtual environment In Mac/Linux:

    source env/bin/activate

    In Windows:

    env/Scripts/activate.bat
  4. Install the packages required for the script

    python -m pip install -r requirements.txt
  5. Provide the Central API Gateway Base URL & Access Token in the central_token.json

    {
        "central_info": {
            "base_url": "<api-gateway-domain-url>",
            "token": {
                "access_token": "<api-gateway-access-token>"
            }
        },
        "ssl_verify": true
    }

    Note

  6. Fill up the workflow_variables.json file with the name or id of the customer(s) you would like to delete from the MSP account.

  7. Once central_token.json & workflow_variables.json are updated with the relevant information, you can execute the script with the following command:

     python msp_customer_deletion.py

    Note

    • This script takes the following optional parameters to overide default filenames for the script
      • central_auth - Path of Central Token File
      • workflow_variables - Path of Workflows Variables File
    • ou can run the following command to use the optional parameters -
    python msp_customer_onboarding.py --central_auth <central_token_file> --workflow_variables <workflow_variables_file>
  8. If the script runs successfully, your terminal output should look like this -

Central APIs used for this workflow -

  1. Get list of customers under the MSP account
  2. Un-assign all devices from Tenant/end-customer
  3. Delete a customer