Skip to content

Commit

Permalink
"version 1.5.0"
Browse files Browse the repository at this point in the history
  • Loading branch information
vhowdhur committed Nov 8, 2024
1 parent 06cd3aa commit 96ea53b
Show file tree
Hide file tree
Showing 76 changed files with 8,562 additions and 735 deletions.
5 changes: 5 additions & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# Release Notes
### November 2024
* 1.5.0
* support for ixnetwork version 10.25.2406.6 (10.25 EA)
* corrected sample csv_snapshot.py for getting statistics
* added new sample: basic->nest_multivalue.py for configuring Nest Multivalue.
### August 2024
* 1.4.0
* support for ixnetwork version 10.00.2407.87 (10.00 Update-2)
Expand Down
57 changes: 57 additions & 0 deletions ixnetwork_restpy/samples/basic/nest_multivalue.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
"""
nest_Multivalue.py:
- Connect to the API server
- Configure one Topology
- Configure Device Group for topology
- Configure Network Group connected to Device Group
- From Network Group fetch all the nest for ipv4 prefix pools in multivalue network address
- Set different values for Nest multivalues
RestPy Doc:
https://www.openixia.github.io/ixnetwork_restpy/#/
Usage:
- Enter: python <script>
"""

from ixnetwork_restpy import SessionAssistant

session = SessionAssistant(
IpAddress="127.0.0.1",
RestPort=11009,
LogLevel=SessionAssistant.LOGLEVEL_INFO,
ClearConfig=True,
)

ixNetwork = session.Ixnetwork

ixNetwork.info("Creating vport")
vport = ixNetwork.Vport.add()

ixNetwork.info("Creating Topology")
topology1 = ixNetwork.Topology.add(Name="Topo1", Ports=vport)
deviceGroup1 = topology1.DeviceGroup.add(Name="DG1", Multiplier="1")
ethernet1 = deviceGroup1.Ethernet.add(Name="Eth1")
ethernet1.Mac.Increment(start_value="00:01:01:01:00:01", step_value="00:00:00:00:00:01")

ixNetwork.info("Configuring IPv4 on Topology")
ipv4 = ethernet1.Ipv4.add(Name="Ipv4")
ipv4.Address.Increment(start_value="1.1.1.1", step_value="0.0.0.1")
ipv4.GatewayIp.Increment(start_value="1.1.1.4", step_value="0.0.0.0")

ixNetwork.info("Configuring Network group behind Topology")
networkGroup1 = deviceGroup1.NetworkGroup.add(Name="NG1", Multiplier="4")
ipv4PrefixPool = networkGroup1.Ipv4PrefixPools.add(NumberOfAddresses="1")
ipv4PrefixPool.NetworkAddress.Increment(start_value="20.10.0.1", step_value="0.0.0.1")

# Fetching all the Nest for multivalue network address
steps = ipv4PrefixPool.NetworkAddress.Steps
ixNetwork.info(steps)

# Setting values for different Nest multivalue
steps[1].Enabled = "True"
steps[1].Step = "0.0.0.4"

steps[0].Enabled = "True"
steps[0].Step = "1.0.0.4"
8 changes: 5 additions & 3 deletions ixnetwork_restpy/samples/statistics/csv_snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
)
ixnetwork = session_assistant.Ixnetwork
session = session_assistant.Session
file_name = "StatisticsSnapshot"

ixnetwork.info(
"""
Expand All @@ -31,11 +32,11 @@
statistics = ixnetwork.Statistics
csvsnapshot = statistics.CsvSnapshot
csvsnapshot.update(
CsvName="StatisticsSnapshot",
CsvName=file_name,
CsvLocation=statistics.CsvFilePath,
SnapshotViewCsvGenerationMode="overwriteCSVFile",
SnapshotViewContents="allPages",
Views=statistics.View.find(Caption="Port Statistics"),
Views=statistics.View.find(Caption="^Port Statistics$"),
)

ixnetwork.info(csvsnapshot)
Expand All @@ -54,7 +55,8 @@
The snapshot API will always add a .csv extension
"""
)
file_name = csvsnapshot.CsvName + ".csv"
file_name = file_name + ".csv"

remote_filename = os.path.normpath(os.path.join(csvsnapshot.CsvLocation, file_name))
local_filename = os.path.normpath(os.path.join("c:/temp", file_name))
session.DownloadFile(remote_filename, local_filename)
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ class Globals(Base):
"CommandArgs": "commandArgs",
"ConfigFileName": "configFileName",
"ConfigSummary": "configSummary",
"IsQuickTestMode": "isQuickTestMode",
"IxosBuildNumber": "ixosBuildNumber",
"PersistencePath": "persistencePath",
"ProductVersion": "productVersion",
Expand Down Expand Up @@ -384,16 +383,6 @@ def ConfigSummary(self):
"""
return self._get_attribute(self._SDM_ATT_MAP["ConfigSummary"])

@property
def IsQuickTestMode(self):
# type: () -> bool
"""
Returns
-------
- bool:
"""
return self._get_attribute(self._SDM_ATT_MAP["IsQuickTestMode"])

@property
def IxosBuildNumber(self):
# type: () -> str
Expand Down Expand Up @@ -481,7 +470,6 @@ def find(
CommandArgs=None,
ConfigFileName=None,
ConfigSummary=None,
IsQuickTestMode=None,
IxosBuildNumber=None,
PersistencePath=None,
ProductVersion=None,
Expand All @@ -504,7 +492,6 @@ def find(
- CommandArgs (str):
- ConfigFileName (str): The name of the configuration file.
- ConfigSummary (list(dict(arg1:str,arg2:str,arg3:list[dict(arg1:str,arg2:str)]))): A high level summary description of the currently loaded configuration
- IsQuickTestMode (bool):
- IxosBuildNumber (str): The IxOS software build number.
- PersistencePath (str): This attribute returns a directory of the IxNetwork API server machine, where users can drop their files from the client scripts using IxNetwork APIs. To Put files in this directory, users do not require to run IxNetwork API server in administrative mode
- ProductVersion (str):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class Preferences(Base):
"ResourceManagerLocation": "resourceManagerLocation",
"ScriptgenTextEditorPath": "scriptgenTextEditorPath",
"SelectDGOnCreation": "selectDGOnCreation",
"SequenceCheckingWhenNoTxRxSync": "sequenceCheckingWhenNoTxRxSync",
"ShortenScenarioObjectNameInMiddle": "shortenScenarioObjectNameInMiddle",
"StreamLogsToSyslogServer": "streamLogsToSyslogServer",
"SyslogHost": "syslogHost",
Expand Down Expand Up @@ -586,6 +587,21 @@ def SelectDGOnCreation(self, value):
# type: (bool) -> None
self._set_attribute(self._SDM_ATT_MAP["SelectDGOnCreation"], value)

@property
def SequenceCheckingWhenNoTxRxSync(self):
# type: () -> bool
"""
Returns
-------
- bool: When true, advanced sequence checking is preferred if Tx-Rx Sync is unavailable on any port.
"""
return self._get_attribute(self._SDM_ATT_MAP["SequenceCheckingWhenNoTxRxSync"])

@SequenceCheckingWhenNoTxRxSync.setter
def SequenceCheckingWhenNoTxRxSync(self, value):
# type: (bool) -> None
self._set_attribute(self._SDM_ATT_MAP["SequenceCheckingWhenNoTxRxSync"], value)

@property
def ShortenScenarioObjectNameInMiddle(self):
# type: () -> bool
Expand Down Expand Up @@ -697,13 +713,14 @@ def update(
ResourceManagerLocation=None,
ScriptgenTextEditorPath=None,
SelectDGOnCreation=None,
SequenceCheckingWhenNoTxRxSync=None,
ShortenScenarioObjectNameInMiddle=None,
StreamLogsToSyslogServer=None,
SyslogHost=None,
SyslogPort=None,
TransmitMode=None,
):
# type: (bool, bool, int, str, str, str, bool, int, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, int, int, str, bool, bool, bool, bool, str, List[str], str, str, bool, bool, bool, str, int, str) -> Preferences
# type: (bool, bool, int, str, str, str, bool, int, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, int, int, str, bool, bool, bool, bool, str, List[str], str, str, bool, bool, bool, bool, str, int, str) -> Preferences
"""Updates preferences resource on the server.
Args
Expand Down Expand Up @@ -738,6 +755,7 @@ def update(
- ResourceManagerLocation (str): Set the Resource Manager resources location
- ScriptgenTextEditorPath (str): Set the text editor path for Scriptgen
- SelectDGOnCreation (bool): When true, Device Group will be auto selected in Scenario on a new Topology creation
- SequenceCheckingWhenNoTxRxSync (bool): When true, advanced sequence checking is preferred if Tx-Rx Sync is unavailable on any port.
- ShortenScenarioObjectNameInMiddle (bool): Shorten Topology/DG/NG names in the middle. If this is true, Topology/Device Group/Network Group names are shortened in the middle (with .), otherwise at the end
- StreamLogsToSyslogServer (bool): Enables streaming Logs To Syslog Server
- SyslogHost (str): syslog host
Expand Down Expand Up @@ -783,13 +801,14 @@ def find(
ResourceManagerLocation=None,
ScriptgenTextEditorPath=None,
SelectDGOnCreation=None,
SequenceCheckingWhenNoTxRxSync=None,
ShortenScenarioObjectNameInMiddle=None,
StreamLogsToSyslogServer=None,
SyslogHost=None,
SyslogPort=None,
TransmitMode=None,
):
# type: (bool, bool, int, str, str, str, bool, int, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, int, int, str, bool, bool, bool, bool, str, List[str], List[str], str, str, bool, bool, bool, str, int, str) -> Preferences
# type: (bool, bool, int, str, str, str, bool, int, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, int, int, str, bool, bool, bool, bool, str, List[str], List[str], str, str, bool, bool, bool, bool, str, int, str) -> Preferences
"""Finds and retrieves preferences resources from the server.
All named parameters are evaluated on the server using regex. The named parameters can be used to selectively retrieve preferences resources from the server.
Expand Down Expand Up @@ -829,6 +848,7 @@ def find(
- ResourceManagerLocation (str): Set the Resource Manager resources location
- ScriptgenTextEditorPath (str): Set the text editor path for Scriptgen
- SelectDGOnCreation (bool): When true, Device Group will be auto selected in Scenario on a new Topology creation
- SequenceCheckingWhenNoTxRxSync (bool): When true, advanced sequence checking is preferred if Tx-Rx Sync is unavailable on any port.
- ShortenScenarioObjectNameInMiddle (bool): Shorten Topology/DG/NG names in the middle. If this is true, Topology/Device Group/Network Group names are shortened in the middle (with .), otherwise at the end
- StreamLogsToSyslogServer (bool): Enables streaming Logs To Syslog Server
- SyslogHost (str): syslog host
Expand Down
Loading

0 comments on commit 96ea53b

Please sign in to comment.