Turning off pagination in REST API call?

I’m able to query objects/types etc. according to the REST-API documentation.

BUT: I could NOT find a way to get ALL objects/types … WITHOUT pagination.

Yes I could get the pagination array, parse it out and iterate through all the pages.
In my opinion for getting all information this would create unnecessary traffic as Datagerry already has the full information internally.

In the source in the file “cmdb/interface/rest_api/responses/get_multi_response.py” the method export() is called with “export(self, pagination: bool=True)”.

As far as I could gather this means to ALWAYS use pagination - I found no EXTERNAL way to set this parameter via HTTP-URL-parameters :frowning:

Question:

Is there a way to have NO pagination in a web request like so:

http://myhost/rest/objects/?disable_pagination=1

meaning to get the FULL result without the need to query any other pages?

thx

SOLVED

I found a way to get ALL objects by simply looking at what Datagerry itself uses via Wireshark:

It uses a parameter “limit=x” that seems to be the number of objects to be returned.

So by setting this to a very high number (limit=21000 in the example below) I was able to get all the objects returned WITHOUT pagination :slight_smile:

#without filter expression
curl -v -k -L -s --request GET 'http://myhost/rest/objects/?limit=210000' -H 'Content-Type: application/json'

#with additional filter expression

curl -v -k -L -s --request GET 'http://myhost/rest/objects/?filter=%5B%7B%22$match%22:%7B%22type_id%22:42%7D%7D%5D&limit=210000' -H 'Content-Type: application/json'

I think this should be documented in the REST-API documentation pages for Datagerry.