HPE Aruba Networking Central Python Package
Project description
PyCentral (Python SDK for HPE Aruba Networking Central)
⚠️ Pre-release Notice
This is a pre-release version of PyCentral-v2, and the features are constantly being updated as the APIs evolve. This version of the SDK allows you to make API calls to New Central, GLP, and Classic Central.
If you are looking for the stable version of PyCentral (v1), it is still available and fully supported. PyCentral-v1, which only supports Classic Central, can be found here.
A Python SDK for interacting with HPE Aruba Networking Central via REST APIs.
Automate onboarding, configuration, monitoring, and management for:
- New Central
- HPE GreenLake Platform (GLP)
- Classic Central (via the
classicmodule for backward compatibility)
Upgrading to this pre-release version will not break PyCentral-v1 code. All the PyCentral-v1 code has been moved to the classic folder within the PyCentral directory, ensuring backward compatibility. You can find Classic Central PyCentral Documentation here.
Install
To install the latest pre-release version of PyCentral, use the following command:
pip3 install --pre pycentral
If you already have PyCentral-v1 and would like to upgrade to the pre-release version, use the following command:
pip3 install --upgrade --pre pycentral
Authentication
New Central
You will need:
- Base URL or Cluster Name: Base URL is the API Gateway URL for your New Central account based on the geographical cluster of your account on the HPE GreenLake Platform. You can find the base URL or cluster name of your New Central account's API Gateway from the table here.
- Client ID and Client Secret: These credentials are required to generate an access token to authenticate API requests. You can obtain them by creating a Personal API Client for your New Central Account. Follow the detailed steps in the Create Client Credentials documentation.
new_central:
base_url: <api-base-url>
client_id: <client-id>
client_secret: <client-secret>
HPE GreenLake Platform (GLP)
If you are working with HPE GreenLake APIs, authentication is slightly different:
- GLP does not require a Base URL.
- You only need the Client ID & Client Secret for the HPE GreenLake Platform.
glp:
client_id: <client-id>
client_secret: <client-secret>
Example
Before running the script, create a token.yaml file in the same directory and populate it with the required credentials as follows:
new_central:
base_url: <api-base-url>
client_id: <client-id>
client_secret: <client-secret>
glp:
client_id: <client-id>
client_secret: <client-secret>
Once you have the token.yaml file ready, you can run the following Python script:
import os
from pycentral import NewCentralBase
# Validate token file exists
token_file = "token.yaml"
if not os.path.exists(token_file):
raise FileNotFoundError(
f"Token file '{token_file}' not found. Please provide a valid token file."
)
# Initialize NewCentralBase class with the token credentials for New Central/GLP
new_central_conn = NewCentralBase(
token_info=token_file,
)
# New Central API Call
new_central_resp = new_central_conn.command(
api_method="GET", api_path="network-monitoring/v1alpha1/aps"
)
print(new_central_resp)
print()
# GLP API Call
glp_resp = new_central_conn.command(
api_method="GET", api_path="devices/v1/devices", app_name="glp"
)
print(glp_resp)
Run the script using the following command:
python3 demo.py
Compatibility
- v2 supports New Central and GLP.
- Classic Central (v1) remains in the
classicmodule for backward compatibility. - Existing v1 code will continue to work without changes.
Documentation
Classic Central
The Classic Central functionality is still fully supported by the SDK and has been moved to a dedicated documentation page. For information on using the SDK with Classic Central, including authentication methods, API calls, and workflow examples, please see the Classic Central Documentation.
Documentation
Use-Cases and Workflows
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pycentral-2.0a14.tar.gz.
File metadata
- Download URL: pycentral-2.0a14.tar.gz
- Upload date:
- Size: 125.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
37ca4245a3626467036073c06c983a33606f1b6c377f0f96dbee1624b18eb697
|
|
| MD5 |
dbcaf291f223e015727db23a663d45de
|
|
| BLAKE2b-256 |
577416d33aad4be7014d94e1b1da9a39c974b30aab7509924f31759cfa7a7848
|
Provenance
The following attestation bundles were made for pycentral-2.0a14.tar.gz:
Publisher:
release.yaml on aruba/pycentral
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pycentral-2.0a14.tar.gz -
Subject digest:
37ca4245a3626467036073c06c983a33606f1b6c377f0f96dbee1624b18eb697 - Sigstore transparency entry: 1003355050
- Sigstore integration time:
-
Permalink:
aruba/pycentral@8c40d73c48846791af726e03b5fb41ceb7a4c2ec -
Branch / Tag:
refs/tags/v2.0a14 - Owner: https://github.com/aruba
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@8c40d73c48846791af726e03b5fb41ceb7a4c2ec -
Trigger Event:
release
-
Statement type:
File details
Details for the file pycentral-2.0a14-py3-none-any.whl.
File metadata
- Download URL: pycentral-2.0a14-py3-none-any.whl
- Upload date:
- Size: 166.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
380dfb5095674ec1ba82ca9247f4cebfc3aeb0db26b2b8890d601160b14c5178
|
|
| MD5 |
f39f112a94895f80ee263209bd171347
|
|
| BLAKE2b-256 |
fec5dbcddc94029edecbf800fa09a5ee5b00c2a3c49d648d0f104a3e5a2811bd
|
Provenance
The following attestation bundles were made for pycentral-2.0a14-py3-none-any.whl:
Publisher:
release.yaml on aruba/pycentral
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pycentral-2.0a14-py3-none-any.whl -
Subject digest:
380dfb5095674ec1ba82ca9247f4cebfc3aeb0db26b2b8890d601160b14c5178 - Sigstore transparency entry: 1003355057
- Sigstore integration time:
-
Permalink:
aruba/pycentral@8c40d73c48846791af726e03b5fb41ceb7a4c2ec -
Branch / Tag:
refs/tags/v2.0a14 - Owner: https://github.com/aruba
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@8c40d73c48846791af726e03b5fb41ceb7a4c2ec -
Trigger Event:
release
-
Statement type: