## The IxNetwork Python Client
[](https://pypi.org/project/ixnetwork-restpy)
[](https://pypi.python.org/pypi/ixnetwork-restpy)
[](https://en.wikipedia.org/wiki/MIT_License)
[](https://pepy.tech/project/ixnetwork-restpy)
## Install the client
```
pip install --upgrade ixnetwork-restpy
```
## Import the package
Import a package based on your product:
```python
# The ixnetwork_restpy package is the superset of all IxNetwork products
from ixnetwork_restpy import SessionAssistant
```
```python
# The uhd_restpy package is a subset of the ixnetwork_restpy package for the UHD appliance
from uhd_restpy import SessionAssistant
```
## Start scripting
```python
"""This script demonstrates how to get started with ixnetwork_restpy scripting.
The script demonstrates the following:
- connect to an IxNetwork test platform, authenticate, add a new session and clear the config
- create 1 tx port and 1 rx port
- create traffic from the tx port to the rx port
- start traffic
- print statistics
- stop traffic
"""
from ixnetwork_restpy import SessionAssistant
# create a test tool session
session_assistant = SessionAssistant(IpAddress='127.0.0.1',
LogLevel=SessionAssistant.LOGLEVEL_INFO,
ClearConfig=True)
ixnetwork = session_assistant.Ixnetwork
# create tx and rx port resources
port_map = session_assistant.PortMapAssistant()
port_map.Map('10.36.74.26', 2, 13, Name='Tx')
port_map.Map('10.36.74.26', 2, 14, Name='Rx')
# create a TrafficItem resource
# TrafficItem acts a a high level container for ConfigElement resources
# ConfigElement is a high level container for individual HighLevelStream resources
traffic_item = ixnetwork.Traffic.TrafficItem.add(Name='Traffic Test', TrafficType='raw')
traffic_item.EndpointSet.add(
Sources=ixnetwork.Vport.find(Name='^Tx').Protocols.find(),
Destinations=ixnetwork.Vport.find(Name='^Rx').Protocols.find())
# using the traffic ConfigElement resource
# update the frame rate
# update the transmission control
traffic_config = traffic_item.ConfigElement.find()
traffic_config.FrameRate.update(Type='percentLineRate', Rate='100')
traffic_config.TransmissionControl.update(Type='continuous')
# adjust Ethernet stack fields
destination_mac = traffic_config.Stack.find(StackTypeId='ethernet').Field.find(FieldTypeId='ethernet.header.destinationAddress')
destination_mac.update(ValueType='valueList', ValueList=['00:00:fa:ce:fa:ce', '00:00:de:ad:be:ef'], TrackingEnabled=True)
# push ConfigElement settings down to HighLevelStream resources
traffic_item.Generate()
# connect ports to hardware test ports
# apply traffic to hardware
# start traffic
port_map.Connect(ForceOwnership=True)
ixnetwork.Traffic.Apply()
ixnetwork.Traffic.StartStatelessTrafficBlocking()
# print statistics
print(session_assistant.StatViewAssistant('Port Statistics'))
print(session_assistant.StatViewAssistant('Traffic Item Statistics'))
print(session_assistant.StatViewAssistant('Flow Statistics'))
# stop traffic
ixnetwork.Traffic.StopStatelessTrafficBlocking()
```
## Supported Server Versions
This client package supports versions 8.52 and up of the following servers:
* Linux IxNetwork API Server
* Windows IxNetwork GUI
* Windows IxNetwork Connection Manager
## Documentation
Documentation is available using the following methods:
* [Online web based documentation](https://openixia.github.io/ixnetwork_restpy/#/overview)
* [Samples](https://openixia.github.io/ixnetwork_restpy/#/samples)
* [API Reference](https://openixia.github.io/ixnetwork_restpy/#/reference)
* Documentation available in the online doc browser is also inlined in each class, property and method and can be viewed using the python help command
```python
from ixnetwork_restpy import SessionAssistant
help(SessionAssistant)
```
## Additional Samples
Visit the [OpenIxia ixnetwork-restpy sample site maintained by solution architects](https://github.com/OpenIxia/IxNetwork/tree/master/RestPy) 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
## Contributing
The purpose of this repository is to allow users to clone the auto generated code. We do not accept pull requests in this repository.
Feedback such as bugs/enhancements/questions regarding the ixnetwork-restpy package is welcomed by opening a [GitHub issue](https://github.com/OpenIxia/ixnetwork_restpy/issues).
Raw data
{
"_id": null,
"home_page": "https://github.com/jgroom33/ixnetwork_restpy",
"name": "ixnetwork-restpy-jgroom33",
"maintainer": null,
"docs_url": null,
"requires_python": "<4,>=2.7",
"maintainer_email": null,
"keywords": "ixnetwork performance traffic generator real world ixia automation",
"author": "Ciena Corporation",
"author_email": "jgroom@ciena.com",
"download_url": "https://files.pythonhosted.org/packages/bf/c0/6440346f91fc399307c77551b8f7e98483cb847a33f1c408cb9727ad65f8/ixnetwork_restpy_jgroom33-0.0.1.tar.gz",
"platform": null,
"description": "## The IxNetwork Python Client \n\n[](https://pypi.org/project/ixnetwork-restpy)\n[](https://pypi.python.org/pypi/ixnetwork-restpy)\n[](https://en.wikipedia.org/wiki/MIT_License)\n[](https://pepy.tech/project/ixnetwork-restpy)\n\n\n## Install the client\n```\npip install --upgrade ixnetwork-restpy\n```\n\n\n## Import the package\nImport a package based on your product:\n```python\n# The ixnetwork_restpy package is the superset of all IxNetwork products\nfrom ixnetwork_restpy import SessionAssistant\n```\n```python\n# The uhd_restpy package is a subset of the ixnetwork_restpy package for the UHD appliance\nfrom uhd_restpy import SessionAssistant\n```\n\n\n## Start scripting\n```python\n\"\"\"This script demonstrates how to get started with ixnetwork_restpy scripting.\n\nThe script demonstrates the following:\n - connect to an IxNetwork test platform, authenticate, add a new session and clear the config\n - create 1 tx port and 1 rx port\n - create traffic from the tx port to the rx port\n - start traffic\n - print statistics\n - stop traffic\n\"\"\"\nfrom ixnetwork_restpy import SessionAssistant\n\n\n# create a test tool session\nsession_assistant = SessionAssistant(IpAddress='127.0.0.1', \n LogLevel=SessionAssistant.LOGLEVEL_INFO, \n ClearConfig=True)\nixnetwork = session_assistant.Ixnetwork\n\n# create tx and rx port resources\nport_map = session_assistant.PortMapAssistant()\nport_map.Map('10.36.74.26', 2, 13, Name='Tx')\nport_map.Map('10.36.74.26', 2, 14, Name='Rx')\n\n# create a TrafficItem resource\n# TrafficItem acts a a high level container for ConfigElement resources\n# ConfigElement is a high level container for individual HighLevelStream resources\ntraffic_item = ixnetwork.Traffic.TrafficItem.add(Name='Traffic Test', TrafficType='raw')\ntraffic_item.EndpointSet.add(\n Sources=ixnetwork.Vport.find(Name='^Tx').Protocols.find(), \n Destinations=ixnetwork.Vport.find(Name='^Rx').Protocols.find())\n\n# using the traffic ConfigElement resource\n# update the frame rate\n# update the transmission control\ntraffic_config = traffic_item.ConfigElement.find()\ntraffic_config.FrameRate.update(Type='percentLineRate', Rate='100')\ntraffic_config.TransmissionControl.update(Type='continuous')\n\n# adjust Ethernet stack fields\ndestination_mac = traffic_config.Stack.find(StackTypeId='ethernet').Field.find(FieldTypeId='ethernet.header.destinationAddress')\ndestination_mac.update(ValueType='valueList', ValueList=['00:00:fa:ce:fa:ce', '00:00:de:ad:be:ef'], TrackingEnabled=True)\n\n# push ConfigElement settings down to HighLevelStream resources\ntraffic_item.Generate()\n\n# connect ports to hardware test ports\n# apply traffic to hardware\n# start traffic\nport_map.Connect(ForceOwnership=True)\nixnetwork.Traffic.Apply()\nixnetwork.Traffic.StartStatelessTrafficBlocking()\n\n# print statistics\nprint(session_assistant.StatViewAssistant('Port Statistics'))\nprint(session_assistant.StatViewAssistant('Traffic Item Statistics'))\nprint(session_assistant.StatViewAssistant('Flow Statistics'))\n\n# stop traffic\nixnetwork.Traffic.StopStatelessTrafficBlocking()\n```\n\n## Supported Server Versions\nThis client package supports versions 8.52 and up of the following servers:\n* Linux IxNetwork API Server\n* Windows IxNetwork GUI\n* Windows IxNetwork Connection Manager\n\n## Documentation\nDocumentation is available using the following methods:\n* [Online web based documentation](https://openixia.github.io/ixnetwork_restpy/#/overview)\n * [Samples](https://openixia.github.io/ixnetwork_restpy/#/samples)\n * [API Reference](https://openixia.github.io/ixnetwork_restpy/#/reference)\n\n* Documentation available in the online doc browser is also inlined in each class, property and method and can be viewed using the python help command\n ```python\n from ixnetwork_restpy import SessionAssistant\n \n help(SessionAssistant)\n ```\n\n## Additional Samples\nVisit the [OpenIxia ixnetwork-restpy sample site maintained by solution architects](https://github.com/OpenIxia/IxNetwork/tree/master/RestPy) for in-depth end-to-end samples that demonstrate the following:\n* building a configuration\n * from scratch\n * from an existing IxNetwork configuration\n* running the configuration\n * connecting ports to hardware\n * starting protocols\n * starting traffic\n* getting statistics\n * port stats\n * traffic stats\n\n## Contributing\nThe purpose of this repository is to allow users to clone the auto generated code. We do not accept pull requests in this repository.\n\nFeedback such as bugs/enhancements/questions regarding the ixnetwork-restpy package is welcomed by opening a [GitHub issue](https://github.com/OpenIxia/ixnetwork_restpy/issues).\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "The IxNetwork Python Client",
"version": "0.0.1",
"project_urls": {
"Homepage": "https://github.com/jgroom33/ixnetwork_restpy"
},
"split_keywords": [
"ixnetwork",
"performance",
"traffic",
"generator",
"real",
"world",
"ixia",
"automation"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "1a3b9f327549cb1990b304000804fb54a465eba1df6338c86f2af4026db9be13",
"md5": "6d91a5a73fa19fd47ee258796ee0133b",
"sha256": "45a69c9e005d37b7eafaf80de09da10d9177921f3027c450f5218b091e7cad7f"
},
"downloads": -1,
"filename": "ixnetwork_restpy_jgroom33-0.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6d91a5a73fa19fd47ee258796ee0133b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4,>=2.7",
"size": 12225784,
"upload_time": "2025-08-12T01:15:04",
"upload_time_iso_8601": "2025-08-12T01:15:04.757562Z",
"url": "https://files.pythonhosted.org/packages/1a/3b/9f327549cb1990b304000804fb54a465eba1df6338c86f2af4026db9be13/ixnetwork_restpy_jgroom33-0.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "bfc06440346f91fc399307c77551b8f7e98483cb847a33f1c408cb9727ad65f8",
"md5": "f19c90c3223620f209f5c8e7c1caa986",
"sha256": "b14a6364864d4b30d8f7c8dfbb07d07b9c8beac90976ee07a45f14b59bef5522"
},
"downloads": -1,
"filename": "ixnetwork_restpy_jgroom33-0.0.1.tar.gz",
"has_sig": false,
"md5_digest": "f19c90c3223620f209f5c8e7c1caa986",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4,>=2.7",
"size": 5684013,
"upload_time": "2025-08-12T01:16:16",
"upload_time_iso_8601": "2025-08-12T01:16:16.691094Z",
"url": "https://files.pythonhosted.org/packages/bf/c0/6440346f91fc399307c77551b8f7e98483cb847a33f1c408cb9727ad65f8/ixnetwork_restpy_jgroom33-0.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-12 01:16:16",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "jgroom33",
"github_project": "ixnetwork_restpy",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "ixnetwork-restpy-jgroom33"
}