Closed manojk011 closed 5 years ago
can you put your code specifics in a code block? Some stuff is being rendered incorrectly, making it difficult to figure out what your problem is @manojk011
can you put your code specifics in a code block? Some stuff is being rendered incorrectly, making it difficult to figure out what your problem is @manojk011
@manojk011 this looks to be a problem with the underlying icontrol rest library the SDK uses. If I tweak the subPath it works fine, but provided as is, I get the error where the folder "/" is not translated to a "~".
Need to research what my options are, I'll dig in to this tomorrow when I get back from vacation.
gp.members_s.member.exists(name='v1', subPath='ltm3.test.local:~part1', partition='Common')
True
gp.members_s.member.exists(name='v1', subPath='ltm3.test.local:/part1', partition='Common')
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/Users/rahm/Documents/PycharmProjects/f5-common-python/f5/bigip/tm/gtm/pool.py", line 316, in exists
return self._exists(**kwargs)
File "/Users/rahm/Documents/PycharmProjects/f5-common-python/f5/bigip/resource.py", line 1187, in _exists
session.get(base_uri, **kwargs)
File "/Users/rahm/Documents/PycharmProjects/f5-common-python/f5py3/lib/python3.7/site-packages/icontrol/session.py", line 284, in wrapper
raise iControlUnexpectedHTTPError(error_message, response=response)
icontrol.exceptions.iControlUnexpectedHTTPError: 400 Unexpected Error: Bad Request for uri: https://ltm3.test.local:443/mgmt/tm/gtm/pool/a/~part1~p1/members/~Common~ltm3.test.local:/part1~v1
Text: '{"code":400,"message":"Found unexpected URI tmapi_mapper/gtm/pool/a/~part1~p1/members/~Common~ltm3.test.local:/part1~v1.","errorStack":[],"apiError":1}'
This issue belongs to the underlying f5-icontrol-rest-python module. I opened an issue there you can track.
@manojk011, I released 1.3.12 of the icontrol library, so if you upgrade that sdk dependency, you can now use transform_subpath=True and exists should work for you.
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:
@manojk011 https://github.com/manojk011, I released 1.3.12 of the icontrol library, so if you upgrade that sdk dependency, you can now use transform_subpath=True and exists should work for you.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/F5Networks/f5-common-python/issues/1522#issuecomment-478794365, or mute the thread https://github.com/notifications/unsubscribe-auth/AoxlmcuVq2eDmrsDYUVnoAG8gvRDlQ5Lks5vcqJJgaJpZM4bpe7g .
I 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.
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.
Since we cannot use special characters in the subPath, the above method makes a service call to
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:
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:
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.