Unable to check if the GSLB pool member "exists" using SDK and get the member configuration using "load"
See original GitHub issueI am trying to check if the pool member exists in a GSLB pool using SDK.
I have created a GSLB pool with name - “gslb_pool” and have added and added LTM server with name and can see that all the vip’s in the LTM are being discovered.
url to make actual get call is - https://xx.x.xxx.xx:xxx/mgmt/tm/gtm/pool/a/~Common~gslb_pool/members/~Common~sanjoseltm:~Common~createdwetwo
By using the subPath option, I was able to provide all the details which SDK can use to construct the actual url but it misses to add the tilda sign (~) and also avoids me to add a tilda sign (~) in the subPath.
command used:
gslbpool.members_s.member.exists(name='createdwetwo',partition="Common", subPath="sanjoseltm:Common")
URL constructed:
https://xx.x.xxx.xx:xxx/mgmt/tm/gtm/pool/a/~Common~gslb_pool/members/~Common~sanjoseltm:Common~createdwetwo
Since we cannot use special characters in the subPath, the above method makes a service call to
~Common~sanjoseltm:Common~createdwetwo instead of
~Common~sanjoseltm:~Common~createdwetwo
Thus, there is no way we can use exists or load method for checking or getting the member details of a GSLB pool.
After debugging and going through the BIG IP f5-dns SDK, this is the only way to check weather the pool member exists:
workaround 1: Step 1. Get the collection using below code:
gslbpool = mgmt.tm.gtm.pools.a_s.a.load(name="gslb_pool",partition="Common")
Step 2. Iterate through the gslb pool collection and check whether it exists. Pass the path in the suffix while using exists or loads:
workaround 2: Instead of using the above steps other way to check is to pass the path of the member and pass it as suffix as below:
if gslbpool.members_s.member.exists(suffix="**/~Common~sanjoseltm:~Common~createdwetwo**", name=""):
I believe this is a bug and needs to be fixed so that developers can use the SDK for GSLB functions as well. Please let me know if I have missed something and there are other ways to do this.
In short:
With current version of SDK, we are not able to use “exists”, “load” methods to check if the GSLB pool member exists and get the configuration of a pool member.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6
Top GitHub Comments
Thank you Jason. I will test it out.
Regards Manoj
On Mon, Apr 1, 2019 at 5:20 PM Jason Rahm notifications@github.com wrote: