From b2d3709967d8a7cbdcbf44e19a6dcd5708dbe5bf Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Tue, 11 Apr 2023 06:12:41 +0000 Subject: automatic import of python-ixnetwork-restpy --- python-ixnetwork-restpy.spec | 452 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 452 insertions(+) create mode 100644 python-ixnetwork-restpy.spec (limited to 'python-ixnetwork-restpy.spec') diff --git a/python-ixnetwork-restpy.spec b/python-ixnetwork-restpy.spec new file mode 100644 index 0000000..9c34d8d --- /dev/null +++ b/python-ixnetwork-restpy.spec @@ -0,0 +1,452 @@ +%global _empty_manifest_terminate_build 0 +Name: python-ixnetwork-restpy +Version: 1.1.8 +Release: 1 +Summary: The IxNetwork Python Client +License: MIT +URL: https://github.com/OpenIxia/ixnetwork_restpy +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/2e/73/bd66c25684e2fdde0952dd8ada329c11fab9864384e90a3a1770bc6f4ef6/ixnetwork_restpy-1.1.8.tar.gz +BuildArch: noarch + +Requires: python3-requests +Requires: python3-websocket-client + +%description +## The IxNetwork Python Client + +[![pypi](https://img.shields.io/pypi/v/ixnetwork-restpy.svg)](https://pypi.org/project/ixnetwork-restpy) +[![python](https://img.shields.io/pypi/pyversions/ixnetwork-restpy.svg)](https://pypi.python.org/pypi/ixnetwork-restpy) +[![license](https://img.shields.io/badge/license-MIT-green.svg)](https://en.wikipedia.org/wiki/MIT_License) +[![downloads](https://pepy.tech/badge/ixnetwork-restpy)](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). + + +%package -n python3-ixnetwork-restpy +Summary: The IxNetwork Python Client +Provides: python-ixnetwork-restpy +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-ixnetwork-restpy +## The IxNetwork Python Client + +[![pypi](https://img.shields.io/pypi/v/ixnetwork-restpy.svg)](https://pypi.org/project/ixnetwork-restpy) +[![python](https://img.shields.io/pypi/pyversions/ixnetwork-restpy.svg)](https://pypi.python.org/pypi/ixnetwork-restpy) +[![license](https://img.shields.io/badge/license-MIT-green.svg)](https://en.wikipedia.org/wiki/MIT_License) +[![downloads](https://pepy.tech/badge/ixnetwork-restpy)](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). + + +%package help +Summary: Development documents and examples for ixnetwork-restpy +Provides: python3-ixnetwork-restpy-doc +%description help +## The IxNetwork Python Client + +[![pypi](https://img.shields.io/pypi/v/ixnetwork-restpy.svg)](https://pypi.org/project/ixnetwork-restpy) +[![python](https://img.shields.io/pypi/pyversions/ixnetwork-restpy.svg)](https://pypi.python.org/pypi/ixnetwork-restpy) +[![license](https://img.shields.io/badge/license-MIT-green.svg)](https://en.wikipedia.org/wiki/MIT_License) +[![downloads](https://pepy.tech/badge/ixnetwork-restpy)](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). + + +%prep +%autosetup -n ixnetwork-restpy-1.1.8 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-ixnetwork-restpy -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Tue Apr 11 2023 Python_Bot - 1.1.8-1 +- Package Spec generated -- cgit v1.2.3