Skip to main content

AOS-CX Python Modules

Project description

pyaoscx

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

See the Release Notes for more information.

Please note that pyaoscx v2 is not backwards compatible for pyaoscx v1 and earlier, so please specify the correct version when using pyaoscx in requirements.txt files

It is also important to note that the latest code commits on the Master branch in Git are usually ahead of the official releases and tags, so please be aware of this when cloning the repo versus doing a pip install pyaoscx

Structure

Detailed information about the structure and design can be found in the Design document.

  • 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 CONTRIBUTING.md 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 github.hpe.com:

    git push origin <local_working_branch_name>

  6. Merge changes using a Pull Request on github.hpe.com. 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.

Setup

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 https://docs.python.org/3/library/venv.html). 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. print_system_info.py)

  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 RELEASE-NOTES.md 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-2.2.1.tar.gz (103.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyaoscx-2.2.1-py3-none-any.whl (161.3 kB view details)

Uploaded Python 3

File details

Details for the file pyaoscx-2.2.1.tar.gz.

File metadata

  • Download URL: pyaoscx-2.2.1.tar.gz
  • Upload date:
  • Size: 103.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/29.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.61.0 importlib-metadata/4.5.0 keyring/23.0.1 rfc3986/1.5.0 colorama/0.4.3 CPython/3.8.5

File hashes

Hashes for pyaoscx-2.2.1.tar.gz
Algorithm Hash digest
SHA256 d84da2c6c8be634e4b0752c49fc34fcb9ae07b081d4b72c200442c9c6a9b5c8f
MD5 6d4668b7d3cccb8538499dd1dcc9a43f
BLAKE2b-256 062ebc7b2f8a792657d926cd7903106cb2d2ab6f51cd1a7847f2d982044d503b

See more details on using hashes here.

File details

Details for the file pyaoscx-2.2.1-py3-none-any.whl.

File metadata

  • Download URL: pyaoscx-2.2.1-py3-none-any.whl
  • Upload date:
  • Size: 161.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/29.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.61.0 importlib-metadata/4.5.0 keyring/23.0.1 rfc3986/1.5.0 colorama/0.4.3 CPython/3.8.5

File hashes

Hashes for pyaoscx-2.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 db2dfb3f3a9e23f008d56d740b44952523852945d90849531a2f65b42eb21e1f
MD5 e54c7c23cb1fbddd45bd1de0979b96e3
BLAKE2b-256 1860c372f82a390b05eed1b1f969c825d168858ee8749f75d4d5a47b84f161c6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page