Пример #1
0
# Connect to IxNet client
################################################################################

ixNet.connect(py.ixTclServer, '-port', py.ixTclPort, '-version', '7.40')

################################################################################
# Cleaning up IxNetwork
################################################################################
print("Cleaning up IxNetwork...")
ixNet.execute('newConfig')

################################################################################
# Adding ports to configuration
################################################################################
print("Adding ports to configuration")
root = ixNet.getRoot()
ixNet.add(root, 'vport')
ixNet.add(root, 'vport')
ixNet.commit()
vPorts = ixNet.getList(root, 'vport')
vport1 = vPorts[0]
vport2 = vPorts[1]

################################################################################
# Configuring IPv6 Autoconfiguration
################################################################################
print("Add topologies")
ixNet.add(root, 'topology')
ixNet.add(root, 'topology')
ixNet.commit()
# Connect to IxNet client
################################################################################

ixNet.connect(py.ixTclServer, '-port', py.ixTclPort, '-version', '7.40')

################################################################################
# Cleaning up IxNetwork
################################################################################
print "Cleaning up IxNetwork..."
ixNet.execute('newConfig')

################################################################################
# Adding ports to configuration
################################################################################
print "Adding ports to configuration"
root = ixNet.getRoot()
ixNet.add(root, 'vport')
ixNet.add(root, 'vport')
ixNet.commit()
vPorts = ixNet.getList(root, 'vport')
vport1 = vPorts[0]
vport2 = vPorts[1]

################################################################################
# Adding IPv4 endpoints to configuration
################################################################################
print "Add topologies"
ixNet.add(root, 'topology')
ixNet.add(root, 'topology')
ixNet.commit()
import time
import os
from IxNetwork import IxNet

# create an instance of the IxNet class
ixNet = IxNet()

# create absolute path for the config and load it
print("Connecting to server: localhost")
ixNet.connect('localhost', '-port', 8009, '-version', '7.30')

print("Cleaning up IxNetwork...")
ixNet.execute('newConfig')

# all objects are under root
root = ixNet.getRoot()

print("\nAdd virtual ports to configuration...")
vports = []
vports.append(ixNet.add(root, 'vport'))
vports.append(ixNet.add(root, 'vport'))
ixNet.commit()

# get virtual ports
vports = ixNet.getList(ixNet.getRoot(), 'vport')

print('Add chassis in IxNetwork...')
chassis = '10.205.15.184'
availableHardwareId = ixNet.getRoot() + 'availableHardware'
ixNet.add(availableHardwareId, 'chassis', '-hostname', chassis)
ixNet.commit()
Пример #4
0
################################################################################

import time
import os
from IxNetwork import IxNet

ixNet = IxNet()

print("Connecting to the server")
ixNet.connect('10.39.65.1', '-setAttribute', 'strict', '-port', 9863,
              '-version', '9.00')

print("Cleaning up IxNetwork...")
ixNet.execute('newConfig')

root = ixNet.getRoot()

print("\nAdd virtual ports to configuration...")
vports = ixNet.getList(ixNet.getRoot(), 'vport')

print('Add chassis in IxNetwork...')
chassis = '10.39.64.117'
availableHardwareId = ixNet.getRoot() + 'availableHardware'
ixNet.add(availableHardwareId, 'chassis', '-hostname', chassis)
ixNet.commit()
time.sleep(5)

###############################################################################
# 1. Adding ports to configuration
################################################################################
print "Adding ports to configuration"
Пример #5
0
PFCriteria_Lower = ['Flows Failed', '40']
# statistic from Application Traffic item Statistics view that has to be lower than given value

#---------------------------------------------------------
# Connecting to TCL Server and loading required packages
#---------------------------------------------------------

from IxNetwork import IxNet

ixNet = IxNet()
import time

print("Connecting to TCL Server...")
ixNet.connect('127.0.0.1', '-version', applicationVersion, '-port', '8449')
ixNet.execute('newConfig')
root = ixNet.getRoot()
availableHW = ixNet.getRoot() + 'availableHardware'

#------------------------------------
# Adding chassis
#------------------------------------

print("Adding chassis to the configuration")
chassis1 = ixNet.add(availableHW, 'chassis')
chassis1ID = ixNet.remapIds(chassis1)[0]

ixNet.setAttribute(chassis1ID, '-hostname', chassisIP)
ixNet.commit()

#------------------------------------
# Adding 2 ports
Пример #6
0
    return flag


print("Connecting to the server")
ixNet.connect('10.39.65.1', '-setAttribute', 'strict', '-port', 9862,
              '-version', '9.00')

print("Cleaning up IxNetwork...")
ixNet.execute('newConfig')

config_file = "bonded_gre_sample_script.ixncfg"

print("Loading sample configuration " + config_file + "...")
ixNet.execute('loadConfig', ixNet.readFrom(config_file))
print("Successfully loaded .ixncfg file !!!")
root = ixNet.getRoot()

# get virtual ports
vports = ixNet.getList(ixNet.getRoot(), 'vport')
print('Add chassis in IxNetwork...')
chassis = '10.39.64.117'
availableHardwareId = ixNet.getRoot() + 'availableHardware'
ixNet.add(availableHardwareId, 'chassis', '-hostname', chassis)
ixNet.commit()
vport1 = vports[0]
vport2 = vports[1]
print("Assigning ports from " + chassis + " to " + str(vports) + " ...")
ixNet.setAttribute(vports[0], '-connectedTo',
                   '/availableHardware/chassis:"10.39.64.117"/card:2/port:5')
ixNet.setAttribute(vports[1], '-connectedTo',
                   '/availableHardware/chassis:"10.39.64.117"/card:2/port:6')