F5Networks / f5-common-python

Python SDK for configuration and monitoring of F5® BIG-IP® devices via the iControl® REST API.
https://f5-sdk.readthedocs.org
Apache License 2.0
262 stars 135 forks source link

Licensing Pools with BIG-IQ v5.4 #1462

Open ArtiomL opened 6 years ago

ArtiomL commented 6 years ago

Hi,

When trying to get a licensing pool list from BIG-IQ v5.4 using the following command:

pools = mgmt_root.cm.shared.licensing.pools_s.get_collection()

as documented in test_pools.py, we're getting this response:

---------------------------------------------------------------------------
iControlUnexpectedHTTPError               Traceback (most recent call last)
<ipython-input-27-f2b12d0eb4dc> in <module>()
----> 1 test = mgmt_root.cm.shared.licensing.pools_s.get_collection()

c:\users\lab1\.virtualenvs\splatt\lib\site-packages\f5\bigip\resource.py in get_collection(self, **kwargs)
    781         """
    782         list_of_contents = []
--> 783         self.refresh(**kwargs)
    784         if 'items' in self.__dict__:
    785             for item in self.items:

c:\users\lab1\.virtualenvs\splatt\lib\site-packages\f5\bigip\resource.py in refresh(self, **kwargs)
    648         >>> print(resource_obj.raw)
    649         """
--> 650         self._refresh(**kwargs)
    651
    652     def load(self, **kwargs):

c:\users\lab1\.virtualenvs\splatt\lib\site-packages\f5\bigip\resource.py in _refresh(self, **kwargs)
    631             uri = self._meta_data['uri']
    632
--> 633         response = refresh_session.get(uri, **requests_params)
    634         self._local_update(response.json())
    635

c:\users\lab1\.virtualenvs\splatt\lib\site-packages\icontrol\session.py in wrapper(self, RIC_base_uri, **kwargs)
    282                              response.url,
    283                              response.text)
--> 284             raise iControlUnexpectedHTTPError(error_message, response=response)
    285         return response
    286     return wrapper

iControlUnexpectedHTTPError: 404 Unexpected Error: Not Found for uri: https://big-iq.example.com:443/mgmt/cm/shared/licensing/pools/
Text: '{"code":404,"message":"Public URI path not registered","referer":"10.10.10.10","restOperationId":227832145,"errorStack":[],"kind":":resterrorresponse"}'

This used to work with BIG-IQ v5.1 and f5-sdk v2.3.3

Getting the registration key list does work using:

pools = mgmt_root.cm.device.licensing.pool.regkey.licenses_s.get_collection()

Versions: f5-icontrol-rest v1.3.8 f5-sdk v3.0.14 python v3.6 BIG-IQ v5.4

Thanks.

wojtek0806 commented 6 years ago

@caphrim007 Can you look into this when you have time please ?