f5-common-python icon indicating copy to clipboard operation
f5-common-python copied to clipboard

sdk error in

Open treygauche opened this issue 4 years ago • 1 comments

I am getting an error when trying to retrieve the web-acceleration collection, that i have not seen in previous calls:

Here is the code:

mgmt = ManagementRoot(ip, usr, pwd)
f5Data = mgmt.tm.ltm.profile.web_accelerations.get_collection()
for profile in f5Data:
      comps = profile.web_compressions.get_collection()
      for comp in comps:
         print (f"{comp.raw}")

And here is the error i'm getting:

Traceback (most recent call last): File "/Users/ttait/Documents/Networks/f5scraper/mytest.py", line 14, in f5Data = mgmt.tm.ltm.profile.web_accelerations.get_collection() File "/usr/local/lib/python3.9/site-packages/f5/bigip/resource.py", line 818, in get_collection raise UnregisteredKind(error_message) f5.sdk_exception.UnregisteredKind: 'tm:ltm:profile:web-acceleration:web-accelerationstate' is not registered!

i have successfully done many other calls using the sdk, so i know it connects, and has the ability to work properly. but i am unable to get the web_accelerations due to this error.

thank you, -timothy

this seems to be a similar issue to #1533

treygauche avatar Aug 12 '21 17:08 treygauche

i wonder if the dash in the kind is the problem as that is similar in both issues. I can load the profiles by name just fine.

We are no longer putting development effort in this library, feel free to fork it and make changes if necessary. For imperative operations like this with the rest interface, I'd recommend the bigrest library developed by one of our MVPs. The wa profile load works fine with that:

from bigrest.bigip import BIGIP
b = BIGIP('ltm3.test.local', 'admin', 'admin')
wa_profiles = b.load('/mgmt/tm/ltm/profile/web-acceleration')
for p in wa_profiles:
    print(p.properties.get('name'))

f5-rahm avatar Aug 13 '21 16:08 f5-rahm