Technical Forum
Ask questions. Discover Answers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Getting GTM Pool and Wideips with Python f5-sdk

A_J_
Altostratus
Altostratus

I am having trouble getting all the pools and wideips from the GTM with this (version 12). I was lucky enough to find an example of how to get the 'a' pools and wideips but nothing else:

pools_a = mgmt.tm.gtm.pools.a_s.get_collection()
wideips_a = mgmt.tm.gtm.wideips.a_s.get_collection()

I am unsure as to the use of a_s. This seems very unintuitive. Anyone know how I can grab cname/aaaa?

1 ACCEPTED SOLUTION

xuwen
MVP
MVP

from f5.bigip import ManagementRoot

mgmt = ManagementRoot('192.168.5.109', 'admin', 'xt32112300')

 

the code of gtm pool for type a, aaaa, cname

for i in mgmt.tm.gtm.pools.a_s.get_collection():

print(i.raw)

for i in mgmt.tm.gtm.pools.aaaas.get_collection():

print(i.raw)

for i in mgmt.tm.gtm.pools.cnames.get_collection():

print(i.raw)

 

 

the code of gtm wideip for type a, aaaa, cname

for i in mgmt.tm.gtm.wideips.a_s.get_collection():

print(i.raw)

for i in mgmt.tm.gtm.wideips.aaaas.get_collection():

print(i.raw)

for i in mgmt.tm.gtm.wideips.cnames.get_collection():

print(i.raw)

 

View solution in original post

3 REPLIES 3

xuwen
MVP
MVP

from f5.bigip import ManagementRoot

mgmt = ManagementRoot('192.168.5.109', 'admin', 'xt32112300')

 

the code of gtm pool for type a, aaaa, cname

for i in mgmt.tm.gtm.pools.a_s.get_collection():

print(i.raw)

for i in mgmt.tm.gtm.pools.aaaas.get_collection():

print(i.raw)

for i in mgmt.tm.gtm.pools.cnames.get_collection():

print(i.raw)

 

 

the code of gtm wideip for type a, aaaa, cname

for i in mgmt.tm.gtm.wideips.a_s.get_collection():

print(i.raw)

for i in mgmt.tm.gtm.wideips.aaaas.get_collection():

print(i.raw)

for i in mgmt.tm.gtm.wideips.cnames.get_collection():

print(i.raw)

 

This is exactly what I'm looking for. Thanks for taking the time to reply! I appreciate it! Will try this today.

Is it possible to get the servers inside of a pool? Much like a 'list gtm pool xxx' command? and likewise the pool(s) contained within a wideip?