Forum Discussion
AllanM1
Nimbostratus
Jan 29, 2019iControl show all detail
Regarding gtm and ltm pools and members, how does one request "all" from iControl rest api, rather than having to request each pool/member/virtual?
With tmsh, this is possible - tmsh show gtm wideip ...
PeteWhite
Employee
Jan 30, 2019First off, use the iCR python module and secondly, retrieve pools with expandSubCollections set which will retrieve the pool member data. See below an example script to copy pools from one device to another.:
!/usr/bin/env python
from iCR import iCR
s = iCR("172.24.9.132","admin","admin")
t = iCR("10.128.1.245","admin","admin")
pools = s.get("ltm/pool?expandSubcollections=true")['items']
for pool in pools:
Remove stat and session from membersReference => items
for member in pool['membersReference']['items']:
del member['state']
del member['session']
POST to the target device
if t.create("ltm/pool",pool):
print "Created " + pool['name']
else:
print "Error creating " + pool['name']
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