Getting started with the python SDK part 4: working with request parameters
In the previous article in this series, we looked at how to work with statistics. In this article, we’ll mirror some of the naked query parameters covered in the Demystifying iControl REST part 3 art...
Updated Jun 06, 2023
Version 2.0JRahm
Admin
Joined January 20, 2005
aj1
Dec 03, 2020Nimbostratus
Hi Jason,
The articles have been super helpful. Thank you.
I'm trying to retrieve the connection table using the final example but it fails. It does appear to work with load() but the returned data is unstructured. I was hoping the raw output would be a dict, similar to other get_collection() results.
f5-icontrol-rest==1.3.13
f5-sdk==3.0.21
In [26]: ssconns = b.tm.sys.connection.get_collection(requests_params={'params': '$top=5&options=ss-server-addr+5.5.5.5'})
---------------------------------------------------------------------------
LazyAttributesRequired Traceback (most recent call last)
<ipython-input-26-24ce13bb2114> in <module>
----> 1 ssconns = b.tm.sys.connection.get_collection(requests_params={'params': '$top=5&options=ss-server-addr+5.5.5.5'})
~/.virtualenvs/venv/lib/python3.8/site-packages/f5/bigip/mixins.py in __getattr__(container, name)
93 error_message = ('"allowed_lazy_attributes" not in',
94 'container._meta_data for class %s' % cls_name)
---> 95 raise LazyAttributesRequired(error_message)
96
97 # ensure the requested attr is present
LazyAttributesRequired: ('"allowed_lazy_attributes" not in', 'container._meta_data for class Connection')
Getting rid of request_params altogether doesn't help either.
In [27]: ssconns = b.tm.sys.connection.get_collection()
---------------------------------------------------------------------------
LazyAttributesRequired Traceback (most recent call last)
<ipython-input-27-5e104dde24cc> in <module>
----> 1 ssconns = b.tm.sys.connection.get_collection()
~/.virtualenvs/venv/lib/python3.8/site-packages/f5/bigip/mixins.py in __getattr__(container, name)
93 error_message = ('"allowed_lazy_attributes" not in',
94 'container._meta_data for class %s' % cls_name)
---> 95 raise LazyAttributesRequired(error_message)
96
97 # ensure the requested attr is present
LazyAttributesRequired: ('"allowed_lazy_attributes" not in', 'container._meta_data for class Connection')
Please let me know if I'm missing something in the query or if this is the expected behavior.
Thank you.