Skip to main content

AOS-CX Python Modules

Project description


These modules are written for AOS-CX API v1 and v10.04. These scripts are written for devices running AOS-CX firmware version 10.04.

For this initial release, it is recommended to use the v1 AOS-CX API. See the Release Notes for more information.


  • REST API call functions are found in the modules in /pyaoscx.
  • REST API call functions are combined into other functions that emulate low-level processes. These low-level process functions are also placed in files in /pyaoscx.
  • Functions from the /pyaoscx files (API functions and low-level functions) are combined to emulate larger network configuration processes (workflows). These workflow scripts stored in the /workflows folder.

How to contribute

Please see the accompanying file for guidelines on how to contribute to this repository.

Git Workflow

This repo adheres to the 'shared repo' git workflow:

  1. Clone the repo to a local machine:

    git clone <repo_URL>

  2. Checkout a local working branch:

    git checkout -b <local_working_branch_name>

  3. Add and amend files in the local working branch:

    git add <file_name>

  4. Commit regularly. Each commit should encompass a single logical change to the repo (e.g. adding a new function in /pyaoscx is one commit; writing docstrings for all functions in a module is another commit). Include an explanatory message with each commit:

    git commit -m "<Clear_explanation_of_commit_here>"

  5. Push commits to

    git push origin <local_working_branch_name>

  6. Merge changes using a Pull Request on Ensure the PR has a relevant title and additional comments if necessary. PRs should be raised regularly once code is tested and the user satisfied that it is ready for submission. Do not put off creaing a PR until a whole project is complete. The larger the PR, the difficult it is to successfully merge.


Before starting ensure the switch REST API is enabled. Instructions for checking and changing whether or not the REST API is enabled status are available in the ArubaOS-CX Rest API Guide. This includes making sure each device has an administrator account with a password, and each device has https-server rest access-mode read-write and enabled on the reachable vrf.

How to run this code

In order to run the workflow scripts, please complete the steps below:

  1. install virtual env (refer Make sure python version 3 is installed in system.

    $ python3 -m venv switchenv
  2. Activate the virtual env

    $ source switchenv/bin/activate
    in Windows:
    $ venv/Scripts/activate.bat
  3. Install the pyaoscx package

    (switchenv)$ pip install pyaoscx
  4. Now you can run different workflows from pyaoscx/workflows (e.g.

  5. Keep in mind that the workflows perform high-level configuration processes; they are highly dependent on the configuration already on the switch prior to running the workflows. For this reason, the comment at the top of each workflow script describes any necessary preconditions.

Troubleshooting Issues

  1. If you encounter module import errors, make sure that the package has been installed correctly.

Additionally, please read the file for the current release information and known issues.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyaoscx-0.1.1.tar.gz (53.7 kB view hashes)

Uploaded source

Built Distribution

pyaoscx-0.1.1-py3-none-any.whl (75.0 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page