Forum Discussion
janarthanan
Nimbostratus
Feb 20, 2022Enable/Disable GTM pool member by java Icontrol
Hi, I got java code to enable/disable LTM pool members and it is working as expected. Simplarly we want for GTM pool members as well. I tried to get pool members for particlur pool but it displayes ...
xuwen
Cumulonimbus
Feb 21, 2022i suggest you use python sdk: f5-sdk
here is the code to find which gtm pool member is be disabled:
from f5.bigip import ManagementRoot
mgmt = ManagementRoot('192.168.5.110', 'admin', 'xt32112300')
for i in mgmt.tm.gtm.pools.a_s.get_collection():
for j in mgmt.tm.gtm.pools.a_s.a.load(name=i.name, partition='Common').members_s.get_collection():
if hasattr(j, 'disabled'):
print('type A gtm pool name {} member name {} has already been disabled and its fullpath is {}'.format(
i.name, j.name, j.fullPath))
result:
type A gtm pool name gslb_pool_ctc_v4 member name vs_ctc has already been disabled and its fullpath is /Common/DC-2-GTM-ipv4:/Common/vs_ctc
Process finished with exit code 0
here is the code to enable or disable gtm pool member:
gtm_pool_obj = mgmt.tm.gtm.pools.a_s.a.load(name='gslb_pool_ctc_v4')
mem_ctc = gtm_pool_obj.members_s.member.load(name='/Common/DC-2-GTM-ipv4:/Common/vs_ctc')
"""enable gtm pool member vs_ctc"""
mem_ctc.disabled = False
mem_ctc.enabled = True
mem_ctc.update()
mem_cuc = gtm_pool_obj.members_s.member.load(name='/Common/DC-2-GTM-ipv4:/Common/vs_cuc')
"""disable gtm pool member vs_cuc"""
mem_cuc.enabled = False
mem_cuc.disabled = True
mem_cuc.update()
- janarthananFeb 23, 2022
Nimbostratus
Hi xuwen,
Thanks for looking into it . I am familier with java but will try with python. Can i get code for both LTM and GTM manipulation using python.
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
