Forum Discussion
Antonio_Varni
Nimbostratus
Jun 26, 2010any way to set_active_partition 'all' or 'any' ?
I want to read all pool and virtual services into a mysql database. Now that I've started moving objects into their own partitions, I'm trying to find a way to get these objects 'all in 1 pass' instea...
ives_39316
Nimbostratus
May 30, 2012... UPDATE ...
In playing around with the Python interface, and hoping to find a view similar to the web UI that shows information about all partitions, I found you can set the partition to "[All]".
For example, the following will...
1) print a list of partitions
2) set active partition to "[All]"
3) confirm active partition
4) print a list of all virtual servers found under the "[All]" partition view (which is presumably read-only.
import suds
import pycontrol.pycontrol as pc
print "Initialize LTM object..."
ltm = pc.BIGIP(
hostname = 'x.x.x.x',
username = 'wintermute',
password = 'ice',
fromurl = True,
wsdls = [
'Management.Partition',
'GlobalLB.VirtualServer',
'LocalLB.VirtualServer',
'GlobalLB.Pool',
'LocalLB.Pool'
])
print "Listing all partitions..."
partitions = ltm.Management.Partition.get_partition_list()
for partition in partitions:
print "\t%s" % partition.partition_name
partition = '[All]'
print "Attempting to set active partition to '%s'" % partition
try:
ltm.Management.Partition.set_active_partition(partition)
except:
print "error"
raise
print "Current Partition: " + ltm.Management.Partition.get_active_partition()
print "List of GlobalLB VirtualServer objects..."
g_vservers = ltm.GlobalLB.VirtualServer.get_list()
for server in g_vservers:
print "\t%s" % server
print "List of LocalLB VirtualServer objects..."
l_vservers = ltm.LocalLB.VirtualServer.get_list()
for server in l_vservers:
print "\t%s" % server
exit()
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