As i understand it in the python sdk, api_query should return all objects and handle all the require API paging. This seems to work for show-host\show objects
"to": 45766,
"total": 45766
},
"status_code": 200
however for show-access-rules
client.api_query(command="show-access-rulebase",payload={"name" : "MyPolicy Security"})
This does not seem to work - it only returns objects up to the default page limit for that api call
"to": 50, client.api_query(command="show-access-rulebase",payload={"name" : sl})
"total": 52,
Do i misunderstand something here?
Also - include-container-key doesnt seem to have any affect - whether True or False it always returns a dict, never a list. Not a problem for me but the documentation is misleading?
"""
The APIs that return a list of objects are limited by the number of objects that they return.
To get the full list of objects, there's a need to make repeated API calls each time using a different offset
until all the objects are returned.
This API makes such repeated API calls and return the full list objects.
note: this function calls gen_api_query and iterates over the generator until it gets all the objects,
then returns.
:param command: name of API command. This command should be an API that returns an array of
objects (for example: show-hosts, show networks, ...)
:param details_level: query APIs always take a details-level argument.
possible values are "standard", "full", "uid"
:param container_key: name of the key that holds the objects in the JSON response (usually "objects").
:param include_container_key: If set to False the 'data' field of the APIResponse object
will be a list of the wanted objects.
Otherwise, the date field of the APIResponse will be a dictionary in the following
format: { container_key: [ List of the wanted objects], "total": size of the list}
:param payload: a JSON object (or a string representing a JSON object) with the command arguments
:return: if include-container-key is False:
an APIResponse object whose .data member contains a list of the objects requested: [ , , , ...]
if include-container-key is True:
an APIResponse object whose .data member contains a dict: { container_key: [...], "total": n }
"""