AOS-CX

The AOS-CX Developer Hub

Welcome to the AOS-CX developer hub. You'll find comprehensive guides and documentation to help you start working with AOS-CX as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    

Getting Started with pyaoscx

Overview of Python and pyaoscx

What is Python?

Python is a high-level programming language that is used widely across various disciplines. Highly regarded for its simplified syntax, beginner-friendliness, and abundance of third-party libraries, Python is among the most popular programming languages in the world. The networking community especially embraces Python due in no small part to extensive vendor support as well as a low barrier of entry for getting started with automation and scripting.

About the pyaoscx Library

The pyaoscx package contains Python modules that can be called upon to access the REST API and configure various features on the switches. In order to use pyaoscx, Python 3 must be installed on your system. You can download and install Python here.

The pyaoscx package is compatible with Python 3 only. Python 2 is not officially supported.

AOS-CX Module Support

Module⁺
8400
8325
8320
6400
6300

access_security.py

:x+:

:x+:

:x+:

:white-check-mark+:

:white-check-mark+:

acl.py

:white-check-mark+:

:white-check-mark+:

:white-check-mark+:

:white-check-mark+:

:white-check-mark+:

arp.py

:white-check-mark+:

:white-check-mark+:

:white-check-mark+:

:white-check-mark+:

:white-check-mark+:

bgp.py

:white-check-mark+:

:white-check-mark+:

:white-check-mark+:

:white-check-mark+:

:white-check-mark+:

config.py

:white-check-mark+:

:white-check-mark+:

:white-check-mark+:

:white-check-mark+:

:white-check-mark+:

dhcp.py

:white-check-mark+:

:white-check-mark+:

:white-check-mark+:

:white-check-mark+:

:white-check-mark+:

evpn.py

:white-check-mark+:

:white-check-mark+:

:white-check-mark+:

:white-check-mark+:

:white-check-mark+:

interface.py

:white-check-mark+:

:white-check-mark+:

:white-check-mark+:

:white-check-mark+:

:white-check-mark+:

lag.py

:white-check-mark+:

:white-check-mark+:

:white-check-mark+:

:white-check-mark+:

:white-check-mark+:

lldp.py

:white-check-mark+:

:white-check-mark+:

:white-check-mark+:

:white-check-mark+:

:white-check-mark+:

loop_protect.py

:white-check-mark+:

:white-check-mark+:

:white-check-mark+:

:white-check-mark+:

:white-check-mark+:

mac.py

:white-check-mark+:

:white-check-mark+:

:white-check-mark+:

:white-check-mark+:

:white-check-mark+:

ospf.py

:white-check-mark+:

:white-check-mark+:

:white-check-mark+:

:white-check-mark+:

:white-check-mark+:

port.py

:white-check-mark+:

:white-check-mark+:

:white-check-mark+:

:white-check-mark+:

:white-check-mark+:

qos.py

:white-check-mark+:

:white-check-mark+:

:white-check-mark+:

:white-check-mark+:

:white-check-mark+:

system.py

:white-check-mark+:

:white-check-mark+:

:white-check-mark+:

:white-check-mark+:

:white-check-mark+:

vlan.py

:white-check-mark+:

:white-check-mark+:

:white-check-mark+:

:white-check-mark+:

:white-check-mark+:

vrf.py

:white-check-mark+:

:white-check-mark+:

:white-check-mark+:

:white-check-mark+:

:white-check-mark+:

vsx.py

:white-check-mark+:

:white-check-mark+:

:white-check-mark+:

:x+:

:x+:

vxlan.py

:x+:

:white-check-mark+:

:x+:

:x+:

:white-check-mark+:

The modules common_ops.py and session.py are also in the package, but they don't correspond with features and have been omitted from this table.

Package Structure

pyaoscx
│   README.md
│   Contributing.md
│   ...
│
└───pyaoscx
│   │   access_security.py
│   │   acl.py
│   │   ...
│
└───docs
│   │   ...
│
└───workflows
    │   cleanup_l2_l3_vlans.py
    │   configure_l2_l3_vlans.py
    └───print_system_info.py

The pyaoscx package is a directory containing files and subdirectories. Contained directly within the top level pyaoscx directory are informative files such as the readme, licensing information, contribution guidelines, and release notes. Also contained directly within the top level directory are the relevant code-containing directories pyaoscx and workflows.

pyaoscx

The pyaoscx subfolder contains the AOS-CX Python modules. Each module contains function definitions which either make a single REST API call or multiple REST API calls. Each function that makes multiple REST API calls is written as such to perform a small logical low-level process (e.g. one call creates a VLAN and the next creates a corresponding VLAN interface). The REST API calls are performed using the Python requests library, which provides functions to make HTTP GET, PUT, POST, and DELETE requests. Information about the requests library can be found here.

workflows

Workflows are scripts that combine calls to functions in the pyaoscx modules to emulate large higher-level network configuration processes (e.g. create ACL and ACL entries, apply ACL on interface, and lastly enable interface). The workflows subfolder contains three example workflows. Each contains comments that describe step-by-step the operations being performed. If you'd like to try these out, you can make copies of these workflows in your own user directory and run them directly. In addition, you may find them to be useful references when creating your own workflows.

Updated 9 days ago



Getting Started with pyaoscx


Overview of Python and pyaoscx

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.