Forum Discussion
caulfiedd_spurr
Cirrus
Apr 14, 2020any way get ltm pool member configuration with single rest api request instead of one by one
is there any way to get pool member configuration with single rest api request instead of one by one ,or if there any batch request of pool member configuration
Dario_Garrido
Noctilucent
Apr 14, 2020Hello caulfiedd spurred.
The next SDK command is equivalent to this REST query
pools = session.tm.ltm.pools.get_collection()
#REST query --> https:// <F5_mgmt_IP>/mgmt/tm/ltm/poolIf you check the REST query manually, you will see that the output is next:
{
"kind": "tm:ltm:pool:poolcollectionstate",
"selfLink": "https://localhost/mgmt/tm/ltm/pool?ver\u003d12.1.5",
"items": [
{
"kind": "tm:ltm:pool:poolstate",
"name": "P-AKIRA_80",
"partition": "Common",
"fullPath": "/Common/P-AKIRA_80",
"generation": 293,
"selfLink": "https://localhost/mgmt/tm/ltm/pool/~Common~P-AKIRA_80?ver\u003d12.1.5",
"allowNat": "yes",
"allowSnat": "yes",
"ignorePersistedWeight": "disabled",
"ipTosToClient": "pass-through",
"ipTosToServer": "pass-through",
"linkQosToClient": "pass-through",
"linkQosToServer": "pass-through",
"loadBalancingMode": "round-robin",
"minActiveMembers": 0,
"minUpMembers": 0,
"minUpMembersAction": "failover",
"minUpMembersChecking": "disabled",
"monitor": "/Common/gateway_icmp",
"queueDepthLimit": 0,
"queueOnConnectionLimit": "disabled",
"queueTimeLimit": 0,
"reselectTries": 0,
"serviceDownAction": "none",
"slowRampTime": 10,
"membersReference": {
"link": "https://localhost/mgmt/tm/ltm/pool/~Common~P-AKIRA_80/members?ver\u003d12.1.5",
"isSubcollection": true
}
},
...<REST OF POOL INSTANCES>
}As you can see above, you are collecting the whole information of the pool configuration, but not about the pool members, which is a subcollection and it should be gathered individualy
"membersReference": {
"link": "https://localhost/mgmt/tm/ltm/pool/~Common~P-AKIRA_80/members?ver\u003d12.1.5",
"isSubcollection": true
}If you want to know more about the pool members, you should query them using this next code (in the comment I show you the underlying REST query)
for pool in pools:
print("Pool: {}".format(pool.name))
for member in pool.members_s.get_collection():
#REST query --> https:// <F5_mgmt_IP>/mgmt/tm/ltm/pool/<pool_name>/members
print("Member: {}".format(member.name))Let me know if this is helpful.
KR,
Dario.
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
