unistra / python-glpi-api

Python module for interacting with GLPI using the API.
GNU General Public License v3.0
18 stars 10 forks source link

glpi.search method loads only first 20 rows #12

Closed godjan-st closed 1 year ago

godjan-st commented 2 years ago

GLPI API search method loads only first 20 rows, if you not specify more in range parameter. But range param is not implemented, sadly does the search method unusable for now. Anyway repo is very helpful, thank you! Maybe I'll try to implement it by myself.

fmenabe commented 1 year ago

Sorry for the late reply!

Range parameter is implemented:

In [1]: import glpi_api

In [2]: glpi = glpi_api.GLPI('https://**********/apirest.php/', '******', '******')

In [3]: len(glpi.search('Computer'))
Out[3]: 15

In [4]: len(glpi.search('Computer', range='0-99'))
Out[4]: 100

You can also find an example in the Ansible collection here.