
Jeffrey Fulmer (Customer) asked a question.
The API request:
GET /api/v1/device-groups/0/devices
Does not return all devices. It's not immediately clear why. What should I look for? It's missing some RedHat servers that I just added manually.
GET /api/v1/device-groups/0/devices
Does not return all devices. It's not immediately clear why. What should I look for? It's missing some RedHat servers that I just added manually.
What version of WUG are you using? I'm running on v23.0.1 when I run "/api/v1/device-groups/0/devices", which is a "GET" it returns all my devices using the SWAGGER UI.
Are you running that in the SWAGGER or via code in cURL or something else?
I'm running it with a python request but I've verified it from the browser. I can GET the missing devices if I add the search parameter, i.e., search=devicename
Version: 21.1.0.141
By default, the number of returned devices is 50 per page, are you going back and getting the next page worth of data?
Also, you should upgrade to v23.0.1 because of security updates.
We're aware of the vulnerability and we're updating to v23.0.1 Thanks.
Oddly, the number I'm getting back is 200. I even added limit=100000 to the query string and I still only receive 200 servers. In my version of the API, there does not appear to be a documented way to query from 201 to 400 (or some other range). Is that available in version 23.0.1?
No it is the same. In the return, does it have a "next page" value?
Yes it does:
"paging": {^M
"pageId": "0",^M
"nextPageId": "200",^M
"size": 200^M
},^M
I tried adding nextPageId=200 but that didn't give me any more devices.
Hmmm. What if you just try page 2
Same result
https://host.domain.com:9644/api/v1/device-groups/0/devices?page=2
{^M
"paging": {^M
"pageId": "0",^M
"nextPageId": "200",^M
"size": 200^M
},^M
If you try it in cURL, do you get the same result?
Exactly the same:
https://host.domain.com:9644/api/v1/device-groups/0/devices?page=2
{
"paging": {
"pageId": "0",
"nextPageId": "200",
"size": 200
},
And I searched the body to verify the missing servers.