1 Rookie
•
21 Posts
0
1983
November 16th, 2021 12:00
OME 3.8.0 API dropping devices
Apologies for cross-posting into "Support Assist Enterprise" board: OME API's DeviceService/Devices missing devices. Appreciate any pointers.
(For some reason I couldn't find this board, then found an old post in that board about SupportAssist not listing all devices from OME inventory. But that one was about UI and was fixed a long time ago.)



DELL-Charles R
Moderator
•
4.7K Posts
0
November 18th, 2021 12:00
Hello valley,
I actually used the search term: site:https://dell.to/3Cs3Gkh /api/DeviceService/Devices
I did see it was for Modular but matched what you are seeing. I thought it may be the same just not in the release notes for OEM for some reason.
What I have since found out, by default the Devices API shows the first 50 devices.
You can either query 50 at a time:
/api/DeviceService/Devices?$skip=50&$top=50
or query a larger number:
/api/DeviceService/Devices?$top=1000
OME RESTful API Guide shows Note 1 on page 305.
https://dell.to/3CuQ33K
DELL-Young E
Moderator
•
5.3K Posts
0
November 16th, 2021 18:00
Hi, thanks for choosing Dell. I'm wondering this may help:
Dell EMC OpenManage Enterprise RESTful API Guide
https://dell.to/3ozCv1Z
valley
1 Rookie
•
21 Posts
0
November 17th, 2021 11:00
Thanks for the reply. Yes, I have the reference guide. The document explains the programming interface, but does not contain information about diagnosing how a real OME instance can fail to deliver the expected response. The URI in question, /api/DeviceService/Devices, is explained in Chapter 8 - Device Services:GET method for Devices
"/api/DeviceService/Devices
This URI represents the devices.
GET method for Devices
This method returns a list of all the devices."
In my case, the method returns a list of select devices, not all the devices. As I updated in the other board, I have tested further that I can retrieve the ID of a missing device from query history that was ingested into Splunk, then use a different function in this interface, /api/DeviceService/Devices(Id), as explained in the same chapter:
"/api/DeviceService/Devices(Id)
"This URI represents a specific device within the collection."
I can confirm that /api/DeviceService/Devices(Id) does return the device once I supply the Id. But if /api/DeviceService/Devices only returns a partial device list, I cannot get the Id's of those that are missing from listing. The document does not indicate any other method that can be used to retrieve full list.
DELL-Charles R
Moderator
•
4.7K Posts
1
November 17th, 2021 13:00
Hello valley,
I think this may explain the issue.
Devices duplicated or missing in list fetched using /api/DeviceService/Devices
https://dell.to/3Dto7yL
valley
1 Rookie
•
21 Posts
0
November 18th, 2021 11:00
Thanks, Charles! Although I cannot relate how the document is under "PowerEdge MX7000", it definitely matches the symptom. Can you share your search strategy to land on this doco? (I am very new to Dell support site.)
The workaround described (adding orderby parameter) does not fix the problem I have. (We do not have MX series in our fleet.) But I want to update that the device returned from /api/DeviceService/Devices(Id) using the Id from historic record of a currently missing device is for a different device that have never been returned.
After review historic data and current data, I notice that the Id seems to be tied to serviceTag and/or IPMI. So, some colleague repurposed the server with a new name which /api/DeviceService/Devices will no longer return even though the Id exists, and built another server with the old name, which /api/DeviceService/Devices also does not return even though OME UI can see it.
Repurposing hardware is common in our environment. As devices are searchable in from UI, I'd consider this an OME API bug.
valley
1 Rookie
•
21 Posts
0
November 18th, 2021 12:00
To further diagnose, I looked up the current server with the old name by its serviceTag, and found the Id in historic data. That Id had been listed by /api/DeviceService/Devices as a yet older name until the hardware was rebuilt into its current name.
In conclusion, rebuilding a server with a new name always makes the Id stop being listed by /api/DeviceService/Devices.
valley
1 Rookie
•
21 Posts
0
November 18th, 2021 15:00
Great link, Charles! The file name is dell-openmanage-enterprise_reference-guide8_en-us.pdf, while I was using dell-openmanage-enterprise_Reference-Guide2_en-us.pdf which somehow landed on my search result. The same information is given on p241 in Guide2, although the page only contains one section note as compared to three in guide8. Obviously the latter is much improved.
On the other hand, the relevant info is an example of using $top parameter for pagination, not about default:
Pagination is under "Chapter 2 - Key integration concepts:Data pagination". (p31 in guide8) If the user chooses, $skip and $top can be used to retrieve items of absolute range in a query. My ingestion script actually takes advantage of this function.
This said, OME's /api/DeviceService/Devices listing does not perform pagination by default. I was very surprise to discover this when I started to use the REST API because default pagination is more common in listing functions in other products that I use.
In other words, whether or not pagination is used, /api/DeviceService/Devices will not list devices whose name have changed since initial inventory. Is there a place where I can submit a bug? Can you test the procedure in a lab?
Also, is there is a way to dissociate those devices whose names have changed, then rescan their inventory as new devices? I suspect that the new devices could then be listed by /api/DeviceService/Devices. Such a workaround, of course, will be extremely laborious as we have already lost hundreds of devices from the list; it also erases device history before name change.
DELL-Young E
Moderator
•
5.3K Posts
0
November 18th, 2021 21:00
Hi Valley, When it comes to OME, as long as it's not a bug, the monitor/admin usually studies, plays around and finds out what is good for them. I will try to ask around the if may take some time. Thank you. ^^
valley
1 Rookie
•
21 Posts
0
November 19th, 2021 09:00
For future reference: The search site tiny URL resolves to the company home page; if I search /api/DeviceService/Devices (quote or not), the search engine automatically strips off all slashes and converts everything to lower case. The correct place to search is by selecting "Support" on homepage, then enter "OpenManage Enterprise" as product. The interface then will not perform the "consumer-grade" manipulations. (Direct link is https://www.dell.com/support/home/en-us/product-support/product/dell-openmanage-enterprise/)
valley
1 Rookie
•
21 Posts
0
December 1st, 2021 17:00
The last statement is incorrect. @Dell -Charles R is correct that this method defaults to 50 per page, as I came to realize after lengthy troubleshooting with Support.
Because my script already handles pagination, I finally notice that my problem is not in retrieval, but in Splunk ingestion: if two JSON files with the same Id exist in the directory, the ingestion skips it.