This post is more than 5 years old
1 Rookie
•
8 Posts
0
3283
February 19th, 2018 00:00
OME - API Rest query many devices
Hello,
I'm using OME version since few days.
We have more than 1 hundred servers in it for a first try.
I want to use the API to get all the asset in it.
I use the following URL for this : "https://$OME_ip/api/GroupService/Groups(64)/Devices"
The "@odata.count" **bleep** is the good one (i see the exact number of servers i have in OME).
But the **bleep** part is limited to 50. I only have the 50 first servers data.
I dont find in the doc how to extend this pagination limitation ?
Thanks for your advice.
No Events found!



DELL-Rob C
3 Apprentice
•
2.8K Posts
0
February 19th, 2018 08:00
Hi Bruno thanks for the post.
https:// /api/GroupService/Groups(64)/AllLeafDevices?$top=10000&$skip=0
You can use the $top and $skip parameters to set the page size.
$top = the number of records to get per page (just set this really high if you want to get all in one page)
$skip = the number of records to skip (probably not needed in your case, unless you want to view the records 50 at a time for example, the you would increment this after each page of 50…)
Hope this helps,
Rob
BrunoC92
1 Rookie
•
8 Posts
0
February 20th, 2018 00:00
Thanks for reply Rob.
I have read the top & skip parameters before and doesnt work.
I will reply in this way & finalize see that i make a big mistake in my script.
I change like this (in powershell) :
$u = "https://$OME_ip/api/GroupService/Groups(64)/AllLeafDevices?$top=1000"
to
$u = "https://$OME_ip/" + 'api/GroupService/Groups(64)/AllLeafDevices?$top=1000'
And it's works more better now ;o
Thanks !