# ######################## Configure VLAN IDs ################################ #
print ('# ######################## HOW TO set a multivalue attribute ########## #')
print ('\n\nChange VLAN IDs for both Ethernet layers...')
# print ixNet.help(eth1)  # desired attribute is not found on eth

vlan1 = ixNet.getList(eth1, 'vlan')[0]
vlan2 = ixNet.getList(eth2, 'vlan')[0]
# print ixNet.help(vlan1)  # desired attribute is '-vlanId'

# VLAN ID parameter is a multivalue object
vlanID1_mv      = ixNet.getAttribute(vlan1, '-vlanId')
vlanID2_mv      = ixNet.getAttribute(vlan2, '-vlanId')

print ('\nTo see childs and attributes of an object just type: "ixNet.help(current_object)". The output should be like this:')
print ixNet.help(vlanID1_mv)

print ('\nAvailable patterns for this multivalue can be found out by using getAttribute on the "-availablePatterns" attribute.')
print ("Output for:  ixNet.getAttribute(vlanID1_mv, '-availablePatterns')")
print ixNet.getAttribute(vlanID1_mv, '-availablePatterns')

print ('\nSelected pattern: counter. Set this pattern under "-pattern" attribute with setAttribute.')
print ("ixNet.setAttribute(vlanID1_mv, '-pattern', 'counter')")
ixNet.setAttribute(vlanID1_mv, '-pattern', 'counter')
ixNet.setAttribute(vlanID2_mv, '-pattern', 'counter')

print ('\nUse ixNet.commit() to commit changes made with setAttribute.')
ixNet.commit()

vlanID1_mv_counter = ixNet.getList(vlanID1_mv, 'counter')[0]
vlanID2_mv_counter = ixNet.getList(vlanID2_mv, 'counter')[0]
Ejemplo n.º 2
0
    '# ######################## HOW TO set a multivalue attribute ########## #'
)

print('\n\nChange outer IP address...')

# ixNet.help(ipV1)

# IP address parameter is a multivalue object

add_mv = ixNet.getAttribute(ipV1, '-address')

print(
    '\nTo see childs and attributes of an object just type: "ixNet.help(current_object)". The output should be like this:'
)

print ixNet.help(add_mv)

print(
    '\nAvailable patterns for this multivalue can be found out by using getAttribute on the "-availablePatterns" attribute.'
)

print("Output for:  ixNet.getAttribute(add_mv, '-availablePatterns')")

print ixNet.getAttribute(add_mv, '-availablePatterns')

print(
    '\nSelected pattern: counter. Set this pattern under "-pattern" attribute with setAttribute.'
)

print("Output for:  ixNet.setAttribute(add_mv, '-pattern', 'counter')")
Ejemplo n.º 3
0
ixNet.setAttribute(vlan_value[0], '-value', 'True')
ixNet.commit()

# #################### Enabled VLANs for ethernet layer  ###################### #
# ######################## Configure VLAN IDs ################################ #
print ('# ######################## HOW TO set a multivalue attribute ########## #')

print ('\n\nChange VLAN IDs for both Ethernet layers...')
# print ixNet.help(eth)  # desired attribute is not found on eth
vlan = ixNet.getList(eth, 'vlan')[0]
# print ixNet.help(vlan)  # desired attribute is '-vlanId'
# VLAN ID parameter is a multivalue object
vlanID_mv      = ixNet.getAttribute(vlan, '-vlanId')

print ('\nTo see childs and attributes of an object just type: "ixNet.help(current_object)". The output should be like this:')
print (ixNet.help(vlanID_mv))

print ('\nAvailable patterns for this multivalue can be found out by using getAttribute on the "-availablePatterns" attribute.')
print ("Output for:  ixNet.getAttribute(vlanID1_mv, '-availablePatterns')")
print (ixNet.getAttribute(vlanID_mv, '-availablePatterns'))

print ('\nSelected pattern: counter. Set this pattern under "-pattern" attribute with setAttribute.')
print ("ixNet.setAttribute(vlanID_mv, '-pattern', 'singleValue')")
ixNet.setAttribute(vlanID_mv, '-pattern', 'singleValue')

print ('\nUse ixNet.commit() to commit changes made with setAttribute.')
ixNet.commit()

vlanID_mv_value = ixNet.getList(vlanID_mv, 'singleValue')[0]

print ('Use setMultiAttribute to set more attributes at once.')
print(
    '# ######################## HOW TO set a multivalue attribute ########## #'
)
print('\n\nChange Start Pool Address for DHCP Server...')
# print ixNet.help(dhcpServer)  # desired attribute is not found on dhcpServer

serverSess = ixNet.getList(dhcpServer, 'dhcp6ServerSessions')[0]
# print ixNet.help(serverSess)  # desired attribute is '-ipAddressPD'

# IP address parameter is a multivalue object
add_mv = ixNet.getAttribute(serverSess, '-ipAddressPD')

print(
    '\nTo see childs and attributes of an object just type: "ixNet.help(current_object)". The output should be like this:'
)
print(ixNet.help(add_mv))

print(
    '\nAvailable patterns for this multivalue can be found out by using getAttribute on the "-availablePatterns" attribute.'
)
print("Output for:  ixNet.getAttribute(add_mv, '-availablePatterns')")
print(ixNet.getAttribute(add_mv, '-availablePatterns'))

print(
    '\nSelected pattern: counter. Set this pattern under "-pattern" attribute with setAttribute.'
)
print("ixNet.setAttribute(add_mv, '-pattern', 'counter')")
ixNet.setAttribute(add_mv, '-pattern', 'counter')

print('\nUse ixNet.commit() to commit changes made with setAttribute.')
ixNet.commit()