Skip to content

IxNetwork Sample Scripts

Hubert Gee edited this page Jan 22, 2018 · 1 revision

For starters, use any of the following sample scripts. They're all conceptually the same, but using different protocols:

- l2l3RestNgpf.py 
- bgpRestNgpf.py
- ospfRestNgpf.py

Other sample scripts:

loadJsonConfigFile.py

- This sample script loads an exported JSON config file.
- Reassign chassis/ports if necessary so you could use the saved config file on any testbed.
- Start/verify protocols, start traffic and verify stats.
- Requires IxNetwork version 8.40.

Back to top

jsonConfigImportExportSamples.py

How to export a configuration into a JSON format file.
How to import/load a JSON config file.

How to import JSON data object.
    (This does not write to the JSON config file. This imports the data object.)
    - How to use XPATH to modify IxNetwork configurations.
    - How to modify multiple configurations simultaneously.
    - How to add a new Traffic Item by importing just the code fragments object.

How to write modifications on the JSON config file:
    - How to modify configurations using dictionary style.
    - How to write modications to the JSON config file.
    - How to add additional configurations to a JSON config file:
        - Such as adding additional Traffic Items.

Back to top

loadConfigFileRest.py

- This sample script loads a binary .ixncfg config file.
- Reassign chassis/ports if necessary so you could use the saved config file on any testbed.
- Start/verify protocols, start traffic and verify stats.

Back to top

addPacketHeaderRawTraffic.py

- This sample script shows you how to use ReST APIs to create raw Traffic Items.
- By adding individual packet headers such as Ethernet, IPv4, etc.
- Note: Raw traffic is supported on the Linux API server starting with version 8.40.

Back to top

egressTrackingRestNgpf.py

- This sample script shows you how to use ReST API to configure egress tracking.
- For example: Packet entering the DUT with VLAN ID 101, and coming out of the DUT as VLAN ID 203.

Back to top

loadQuickTestRestApi.py

This sample script demonstrates:
    - REST API configurations using two back-to-back Ixia ports.
    - Connecting to Windows IxNetwork API server or Linux API server.

- Verify port ownership.
- Load a saved NGPF Quick Test config file.
- Reassign Ports:  Exclude calling assignPorts if it's unecessary.
- Verify port states.
- Apply Quick Test
- Start Quick Test
- Monitor Quick Test progress
- Get stats

Back to top

l2l3RestNgpf.py

- Configures two Topology Groups with two Ixia ports back-to-back.
- Create IPv4 Device Groups.
- Start/verify protocols, start traffic and get stats.

Back to top

bgpRestNgpf.py

- Configures two Topology Groups with two Ixia ports back-to-back.
- Create BGP Device Groups.
- Start/verify protocols, start traffic and get stats.

Back to top

ospfRestNgpf.py

- Configures two Topology Groups with two Ixia ports back-to-back.
- Create OSPF Device Groups.
- Start/verify protocols, start traffic and get stats.

Back to top

vxlanRestNgpf.py

- Configures two Topology Groups with two Ixia ports back-to-back.
- Create VxLAN Device Groups.
- Start/verify protocols, start traffic and get stats.

Back to top

lacpOspfRest.py

- Configures two Topology Groups: LACP/IPv4/OSPF
- Start protocols
- Verify LACP protocol sessions
- Verify OSPF protocol sessions
- Create a Traffic Item
- Apply Traffic, start traffic and get stats

Back to top

Clone this wiki locally