IxNetwork REST API Python Client
Project description
IxNetwork REST API Client
This is an alpha build and is subject to change!
Features
- classes are generated from the latest released version of IxNetwork
- the only class that can be directly instantiated is the TestPlatform class
- all other classes are accessed via a child property on the parent class
- classes have helper methods depending on the type of class
- classes that represent a required node are automatically populated with one and only one instance of the node's data
- classes that represent a user managed list have
add, remove, find
helper methods - classes that represent a system managed list have a
find
helper method
- every instantiated class encapsulates instances retrieved from the server
- encapsulated instances can be accessed using iterators or indexes
- class iterator/index support includes:
__iter__ __next__ __getitem__ __len__
find
method- offers named parameters for all properties in the class
- named parameters can be populated with regex to allow for finding specific instances
- allows the encapsulated data to be reduced to specific instances
- e.g., to find all virtual ports that have a type of ethernet, the following
IxNetwork.Vport.find(type='ethernet')
returns a single vport instance that encapsulates all the those vport instances on the server that have type ethernet
- installs via pip
- pip install -U ixnetwork-restpy
- documentation is inlined in all generated classes
- documentation is also available via a static documentation browser distributed with the package under the docs folder
- there is no need to connect to a running instance of IxNetwork to get API documentation
- samples distributed with the package under the tests folder
- these samples are also used to sanity test the package before posting it to pypi
Limitations
- minimum IxNetwork support is 8.42
Getting Started
from ixnetwork_restpy.testplatform.testplatform import TestPlatform
# create the connection to a test platform
test_platform = TestPlatform('127.0.0.1')
test_platform.Authenticate('admin', 'admin')
# add a session
sessions = test_platform.Sessions.add()
# get the root node of the IxNetwork hierarchy
ixnetwork = sessions.Ixnetwork
# add 3 virtual ports
vports = ixnetwork.Vport.add().add().add()
# create a raw traffic item with the 3 virtual ports
traffic_item = ixnetwork.Traffic.TrafficItem.add(name='Raw Traffic')
endpoint_set = traffic_item.EndpointSet.add(sources=vports)
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for ixnetwork_restpy-0.1.26-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc644d4dd61f5a7b91678b6b9727144e158a39f7d46b10ff40afff53df8901f7 |
|
MD5 | 9551b190be38bc481b08653156049938 |
|
BLAKE2b-256 | 08848dcf8fb907b660dfd061971404e25e205198d18467e4e95ff0d895e68021 |