Forum Discussion
Tim_18689
Cirrus
Jan 08, 2013bigsuds-1.01 Need help creating self IP using SelfIPV2.create
I am trying to create a self IP using bigsuds-1.01 and cannot figure the syntax. Here is what I have come up with but I cannot figure out how to specify the 'floating_states' or what I am doing wrong here.
Here is the command I am using and below is the result of running it:
b.Networking.SelfIPV2.create(['self_ips' 'ext-self'], ['vlan_names' 'ext-esnet'], ['addresses' '10.1.214.70'], ['netmasks' '255.255.0.0'], ['traffic_groups' 'none'], ['floating_states', 'STATE_DISABLED'])
>>> import bigsuds
>>> b = bigsuds.BIGIP('10.3.214.70')
>>> b.Networking.VLAN.get_list()
['/Common/ext-esnet']
>>>
>>> b.Networking.SelfIPV2.create(['self_ips' 'ext-self'], ['vlan_names' 'ext-esnet'], ['addresses' '10.1.214.70'], ['netmasks' '255.255.0.0'], ['traffic_groups' 'none'], ['floating_states', 'STATE_DISABLED'])
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.7/dist-packages/bigsuds-1.0.1-py2.7.egg/bigsuds.py", line 412, in wrapped_method
args, kwargs = arg_processor.process(args, kwargs)
File "/usr/local/lib/python2.7/dist-packages/bigsuds-1.0.1-py2.7.egg/bigsuds.py", line 472, in process
return (self._process_args(args), self._process_kwargs(kwargs))
File "/usr/local/lib/python2.7/dist-packages/bigsuds-1.0.1-py2.7.egg/bigsuds.py", line 478, in _process_args
newargs.append(self._process_arg(self._argspec[1], arg))
File "/usr/local/lib/python2.7/dist-packages/bigsuds-1.0.1-py2.7.egg/bigsuds.py", line 540, in _process_arg
obj.items = [self._process_arg(array_type, x) for x in value]
File "/usr/local/lib/python2.7/dist-packages/bigsuds-1.0.1-py2.7.egg/bigsuds.py", line 559, in _process_arg
valid_values))
bigsuds.ArgumentError: "floating_states" is not a valid value for Common.EnabledState, expecting: STATE_DISABLED, STATE_ENABLED
2 Replies
- Tim_18689
Cirrus
I had the syntax completely wrong. I now have a working example:
b.Networking.VLAN.create_v2(vlans = ['ext-esnet'], vlan_ids = [1101], members = [[{'member_name': '1.1', 'member_type': 'MEMBER_INTERFACE', 'tag_state': 'MEMBER_UNTAGGED'}]], failsafe_states = ['STATE_DISABLED'], timeouts = [90]) - Tim_18689
Cirrus
Here it is a lot more readable as I used it in script:
!/usr/bin/python
import bigsuds
set target system and supply login info
b = bigsuds.BIGIP(
hostname = '10.3.214.70',
username = 'admin',
password = 'admin',
)
make a self IP
b.Networking.SelfIPV2.create(
self_ips = ['ext-self'],
vlan_names = ['ext-esnet'],
addresses = ['10.1.214.70'],
netmasks = ['255.255.0.0'],
traffic_groups = ['traffic-group-local-only'],
floating_states = ['STATE_DISABLED']
)
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects