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

Fix location missing from API device list #10215

Merged
merged 1 commit into from May 13, 2019

Conversation

Projects
None yet
2 participants
@murrant
Copy link
Member

commented May 13, 2019

DO NOT DELETE THIS TEXT

Please note

Please read this information carefully. You can run ./scripts/pre-commit.php to check your code before submitting.

Testers

If you would like to test this pull request then please run: ./scripts/github-apply <pr_id>, i.e ./scripts/github-apply 5926
After you are done testing, you can remove the changes with ./scripts/github-remove. If there are schema changes, you can ask on discord how to revert.

@murrant murrant merged commit 882818d into librenms:master May 13, 2019

5 of 6 checks passed

codeclimate 3 issues to fix
Details
Inspection Summary
Details
Node: analysis
Details
Travis CI - Pull Request Build Passed
Details
WIP Ready for review
Details
license/cla Contributor License Agreement is signed.
Details

@murrant murrant deleted the murrant:fix-device-list-api-location branch May 13, 2019

@fluiddmotion

This comment has been minimized.

Copy link

commented May 17, 2019

This has not fixed the issue..

Any API experts on here?
If I run
curl -H 'X-Auth-Token: xxxxxxxxxxxx' http://localhost/api/v0/devices --- It returns 401 Devices

curl -H 'X-Auth-Token: xxxxxxxxxxxx' http://localhost/api/v0/devices?type=location --- It returns 358 Device (These all have locations)

curl -H 'X-Auth-Token: xxxxxxxxxxxx' http://localhost/api/v0/devices?type=location&query=538 ---- It still returns 358 Devices (It should only return 5)
Have i got the query correct?

@murrant

This comment has been minimized.

Copy link
Member Author

commented May 18, 2019

@fluiddmotion

This comment has been minimized.

Copy link

commented May 18, 2019

I have, there is no location example.. The example to query by mac is shown as

curl -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/devices?type=mac&query=00000c9ff013

So based on the documentation how am i wrong? Can you give me the correct way?

@murrant

This comment has been minimized.

Copy link
Member Author

commented May 18, 2019

Make sure you put quotes around your url & is a special character in the shell

@fluiddmotion

This comment has been minimized.

Copy link

commented May 18, 2019

Ok thank you for that Ive worked it out now.. Can I suggest that the documentation actually documents this correctly?

curl -H 'X-Auth-Token: 7c0922c69d8ed85ed4ea3a61ca25fbd8' 'http://localhost/api/v0/devices?type=location&query=%locationname%'

Also to note it does not work with the location ID only the actual text stored.

@murrant

This comment has been minimized.

Copy link
Member Author

commented May 19, 2019

Sure, click the edit button on the page. Yeah, it was never updated to support location_id.

spencerbutler added a commit to spencerbutler/librenms that referenced this pull request May 21, 2019

@lock lock bot locked as resolved and limited conversation to collaborators Jul 18, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.