Configuration Hierarchy Report
Source Code
You can find the source code and documentation for this workflow, as well as several others, by visiting our central-python-workflows repository
This script simplifies the reporting of the configuration hierarchy from HPE Aruba Networking Central using new Central APIs. It retrieves hierarchical data—including sites, site collections, devices, & device groups and presents it in both a terminal summary table and a CSV file.
By visualizing the configuration hierarchy, network administrators can quickly understand the structure of their Central environment, and locate key attributes such as scope-id and persona. These attributes are essential for making configuration changes via the New Central APIs.
Caution
This script uses a beta version of the
pycentrallibrary and is designed for HPE Aruba New Central, which is also in Public Preview. Expect potential changes and updates to the API and functionality.
Prerequisites
- Python 3.8 or higher
- API credentials for HPE Aruba Networking Central (JSON or YAML format)
- There should be atleast 1 site created in the account to get new Central configuration attributes
Setup
-
Create a virtual environment (recommended):
python -m venv env source env/bin/activate # On Windows: env\Scripts\activate -
Clone the central-python-workflows and change into this workflow's repository:
-
git clone https://github.com/aruba/central-python-workflows.git cd central-python-workflows/troubleshooting-workflow/
-
-
Install required packages:
pip install -r requirements.txt
Input Files
Credentials File: Contains Central API credentials in JSON or YAML format.
Example (YAML):
central:
# Either `base_url` or `cluster_name` should be provided:
#
# base_url: <central-api-base-url>
# cluster_name: <central-cluster-name>
client_id: <central-client-id>
client_secret: <central-client-secret>
Note
- To obtain your API credentials, please refer to Generating and Managing Access Tokens
- To locate the
cluster_name(E.g. EU-1) orbase_url(E.g. de1.api.central.arubanetworks.com) of your New Central cluster refer to API Gateway Base URLs on our Developer Hub.
Usage
Run the script with the required arguments:
python hierarchy_report.py -c account_credentials.yaml
Optional arguments:
-o,--output-file-name: Specify the output CSV file name (default:hierarchy_report.csv).
Example:
python hierarchy_report.py -c account_credentials.yaml -o my_hierarchy.csv
Output
The script generates configuration hierarchy information in two formats:
- Terminal Table: Displays the hierarchy in a formatted table for immediate viewing
- CSV File: Saves the complete report to the specified CSV file (default:
hierarchy_report.csv)
Understanding the Output Table
Each row in the output(terminal table or csv file) represents a scope component in your Central configuration hierarchy. The table contains the following columns:
- Type: The hierarchical level - Global (top-level), Site Collection, Site, Device, or Device Group
- Name: The display name of the scope element as it appears in Central
- Scope-ID: The ID of the scope element. This is the unique identifier needed to identify the scope element for any new Central APIs.
- Serial: Device serial number (only for Devices)
- Device Function (Persona): Role of the device along with it's configuration persona in parentheses, which is needed for new Central APIs (only for Devices)
Troubleshooting
- Ensure your credentials file is valid and in JSON or YAML format.
- Make sure all required dependencies are installed.
- If you encounter issues, please reach out to Aruba Automation
Updated 2 months ago