This is a Python script that uses the Pycentral library to automate the following steps on an Aruba Central account with MSP mode-
- Unassigns all devices & licenses within the customer's Aruba Central Instance. The devices & licenses will be moved back to the MSP's inventory.
- Uninstall the customer's Aruba Central instance
- Delete the customer's Greenlake Instance
In order to run the script, please complete the steps below:
-
Clone this repository and
cdinto the workflow directory:git clone https://github.hpe.com/hpe/central-python-workflows cd central-python-workflows/msp_customer_deletion -
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
-
Activate the virtual environment In Mac/Linux:
source env/bin/activateIn Windows:
env/Scripts/activate.bat
-
Install the packages required for the script
python -m pip install -r requirements.txt
-
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
-
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.
-
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>
- This script takes the following optional parameters to overide default filenames for the script
-
If the script runs successfully, your terminal output should look like this -
/Classic-Central/msp_customer_deletion/media/workflow_overview.png)
/Classic-Central/msp_customer_deletion/media/script_terminal_output.gif)