OpenIxia / ixnetwork_restpy

The IxNetwork python client.
https://openixia.github.io/ixnetwork_restpy/#/
MIT License
30 stars 16 forks source link

How to change vlan_id #8

Closed skayres closed 5 years ago

skayres commented 5 years ago

Hi!

IxNetwork version: 8.50.1501.9 EA

I can't find how to change VlanId. Only get_attribute is available.

ethernet_1 = device_group_1.Ethernet.add(UseVlans=UseVlans, VlanCount=VlanCount)
ethernet_1.Mac.Increment(start_value=start_mac, step_value='00:00:00:00:00:01')

# not work:
ethernet_1.Vlan.VlanId = '1,2,3,4,5')
# No increment on VLAN:
ethernet_1.Vlan.Increment(start_value=1, step_value=1)
# Can't set attribute
setattr(ethernet_1.Vlan, 'VlanId', '1 2 3 4 5')
setattr(ethernet_1.Vlan, 'vlanId', '1, 2, 3, 4, 5')

Couldn't you provide some info please. ixnetwork_restpy_vlanid_trouble

Thank you!

ajbalogh commented 5 years ago

The Vlan class encapsulates a system managed vlan node in the ixnetwork hierarchy.

An instance of the class can be obtained by accessing the Vlan property from a parent instance.
The internal properties list will be empty when the property is accessed and is populated from the server by using the **find** method.
ethernet_1 = device_group_1.Ethernet.add(UseVlans=UseVlans, VlanCount=VlanCount)
ethernet_1.Mac.Increment(start_value=start_mac, step_value='00:00:00:00:00:01')
vlan = ethernet_1.Vlan.find()
vlan.VlanId.Increment(start_value= '1', step_value='1'')