Forum Discussion
kanchanjunga_57
Nimbostratus
May 04, 2009Networking.VLAN.create -- question
Hello,
I am trying to create a VLAN using iControl; I am using python as my scripting language. The code that I am using is as follows:
!/bin/env python
from optparse import OptionParser
import paramiko
import SOAPpy
import sys
import time
Funtion to pass values to variable at the time of executing the script
def parseargs():
"""
"""
parser = OptionParser(usage="%prog [options]")
parser.add_option("-i", "--dut-ip", dest='host',
help="DUT IP address.",
type="string", default='172.27.32.142')
parser.add_option("-p", "--host-passwd", dest='passwd',
help="Host password.",
type="string", default='default')
parser.add_option("-U", "--host-UI-username", dest='uiUsername',
help="Host GUI username.",
type="string", default='admin')
parser.add_option("-P", "--host-UI-passwd", dest='uiPasswd',
help="Host UI password.",
type="string", default='admin')
return parser
parser = parseargs()
(options, args) = parser.parse_args()
if not options.databaseip:
parser.error("Missing Sleuth results database IP.")
ICONTROL_URL = "https://%s:%s@%s/iControl/iControlPortal.cgi"%\
(options.uiUsername, options.uiPasswd, options.host)
ICONTROL_VLAN_NAMESPACE = "urn:iControl:Networking/VLAN"
ic_url = ICONTROL_URL
vlan_proxy = SOAPpy.SOAPProxy(ic_url, ICONTROL_VLAN_NAMESPACE)
print SOAPpy.Types.simplify(vlan_proxy.get_list())
creating a VLAN
import pdb;pdb.set_trace()
vlan_proxy.create( vlans=["ictrlVLan"],
vlan_ids=[3001],
members=[{'member_name': '1.8',
'member_type': 'MEMBER_INTERFACE',
'tag_state': 'MEMBER_TAGGED'}],
failsafe_states=['STATE_DISABLED'],
timeouts=[90],
mac_masquerade_addreses=['none'])
Unfortunately, when I try to execute the script I run into following:
Traceback (most recent call last):
File "/HostShare/pythonScripts/bigip/./subcaseBgp-bpIctrlCreate.py", line 75, in
mac_masquerade_addreses=['none'])
File "/usr/lib/python2.5/site-packages/SOAPpy/Client.py", line 470, in __call__
return self.__r_call(*args, **kw)
File "/usr/lib/python2.5/site-packages/SOAPpy/Client.py", line 492, in __r_call
self.__hd, self.__ma)
File "/usr/lib/python2.5/site-packages/SOAPpy/Client.py", line 406, in __call
raise p
SOAPpy.Types.faultType:
- The SDK was meant to be language neutral since we support so many toolkits out there with such different language semantics, it's hard to write an SDK for a Web Service API that accommodates all the variants out there.
- kanchanjunga_57
Nimbostratus
I do understand. I will post my code under code share and will also post my experience of tech tips. - L4L7_53191
Nimbostratus
K2 - this thread shows a patch that will help Soappy make sense of nested arrays: - fengzi_25496
Nimbostratus
learning
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