Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support 'searchText' parameter in get_all_items api call #17

Merged
merged 2 commits into from
Feb 22, 2023

Conversation

pniaps
Copy link
Contributor

@pniaps pniaps commented Feb 15, 2023

This change allows using the searchText parameter in Get all items api call.

You can use something like this

results = glpi.get_all_items(
            'Computer',
            get_hateoas=0,
            searchText = {'name':'server','comment':'critical'}
        )

Remember, the searchText parameter is used as LIKE condition on GLPI side, so the example before will return the computers whichs contains server in his name and critical in his comment.

Copy link
Member

@fmenabe fmenabe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

I made some comments. There are just coding style and not that important ;-) Would be nice if you make the changes but if not I'll just merge the PR and release a minor version (0.4.0) by the end of the week.

glpi_api.py Outdated Show resolved Hide resolved
glpi_api.py Outdated Show resolved Hide resolved
@pniaps
Copy link
Contributor Author

pniaps commented Feb 22, 2023

Thanks for your comments.

@fmenabe fmenabe merged commit 32edf44 into unistra:master Feb 22, 2023
@fmenabe
Copy link
Member

fmenabe commented Feb 22, 2023

version 0.4.0 has been released on Pypi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants