IxNetwork REST API Python Client
Project description
IxNetwork REST API Client
This package is an IxNetwork object oriented pure python client package over a REST transport.
What's New!
- Nov 2018 - 1.0.10
-
Base class infrastructure to allow for getting a list of device ids using regex searches that can be used on NGPF class methods that require device ids.
# get device ids on two specific ports device_ids = ipv4_1.get_device_ids(PortNames='^(%s|%s)$' % (vport_1[0].Name, vport_1[2].Name)) # get device ids on two specific ports device_ids = ipv4_1.get_device_ids(PortNames='^(%s|%s)$' % (vport_1[0].Name, vport_1[2].Name)) # start only those ipv4 devices returned by get_device_ids ipv4_1.Start(device_ids)
-
Features
Static classes
- 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
- the main premise of the package is based around the
.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 that you are interested in
- some examples:
IxNetwork.Vport.find(Type='ethernet')
uses regex on the server to find and return all vports whose type is ethernetIxNetwork.Vport.find(Name='^Ethernet - 001$')
uses regex on the server to find and return a vport whose name exactly matches Ethernet - 001IxNetwork.Vport.find(ConnectionState='connectedLinkUp')
uses regex on the server to find and return all vports whose state is connectedLinkUp
Documentation
- 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
- samples are distributed with the package under the tests folder
- these samples are also used to sanity test the package before posting it to pypi
Limitations
- python support >= 2.7, 3.x
- IxNetwork support >= 8.42
Getting Started
Install the package (pip install -U ixnetwork-restpy) and review the samples under ixnetwork_restpy/tests/...
The samples demonstrate how to do the following:
- create a TestPlatform
- get an IxNetwork Sessions object and either find a session or add a new one
- get the root Ixnetwork object of the hierarchy
- add virtual ports, topologies, traffic
Finally visit the OpenIxia IxNetwork restpy site for in depth end-to-end samples that demonstrate the following:
- building a configuration
- from scratch
- from an existing IxNetwork configuration
- running the configuration
- connecting ports to hardware
- starting protocols
- starting traffic
- getting statistics
- port stats
- traffic stats
Change Log
"Mon Nov 26 14:06:45 2018 -0800: append change log to readme" "Mon Nov 26 13:31:24 2018 -0800: check for supported server version" "Fri Nov 16 10:46:13 2018 -0800: enhance resource manager test with additional use cases and asserts" "Wed Nov 14 16:16:59 2018 -0800: v1.0.6 fix file upload/create, added save, load config sample test case" "Wed Nov 14 10:59:04 2018 -0800: update version number" "Wed Nov 14 10:43:37 2018 -0800: fix for Sessions usage in 3.x" "Tue Nov 13 15:05:31 2018 -0800: use common name for logging" "Mon Nov 12 16:52:52 2018 -0800: updates" "Wed Oct 24 20:32:12 2018 -0700: new version posted" "Wed Oct 24 20:28:23 2018 -0700: hsl connection fix"
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
Built Distribution
Hashes for ixnetwork_restpy-1.0.10-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99c7dac54771702b3453e48eac8ad65c8a25c9fea610ffb83562fc99cf101f46 |
|
MD5 | a69736f78af793d59b43fed4adad15bd |
|
BLAKE2b-256 | 7c7862cc198c23bf13a1085900d7b0df1bb4d89b6e1c4fa705802819b13649f8 |