EcoStruxure IT forum
Schneider Electric support forum about installation and configuration for DCIM including EcoStruxure IT Expert, IT Advisor, Data Center Expert, and NetBotz
Link copied. Please paste this link to share this article on your social media post.
Posted: 2022-08-09 01:06 AM
Hi:
I need to get the name of the servers that are on a particular rack.
I got from a colleague this get request:
<ip>/api/v8.1/assets/search?q=Rack%20C2" But it only returns partial results. When I put the server name in the same request it returns the results correctly.
Any help will be greatly appreciated, Thank you
Jerry
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2022-08-10 05:12 AM
Hello Jerry
Are you trying to search for the results like in your example or do you know the specific rack id and you're trying to list the servers in that specific rack.
If searching, you can add a type qualifier to your search to list only devices of type server. In my below example I searched by a specific rack name "Rack-1" and asked for only devices of type server be returned in the output.
https://<ITA-Server>/api/v8.1/assets/search?q=Rack-1&type=server
If you use the search api call to return the actual rack id. You can use get asset by id to get a list of the assets contained in the rack using this syntax which includes the "children" parameter. In this example my rack UUID is 3672a2ce-a174-4d90-88fe-790631242cf9
https://<ITA-Server>/api/v8.1/assets/3672a2ce-a174-4d90-88fe-790631242cf9?include=children
The above command returns all devices in the rack, so its not limited to servers, but you can parse that output
Regards
Greg Sterling
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2022-08-14 03:36 AM
Thanks,
Unfortunately, it didn't work for me.
I just looped through the hosts in the end in order to find which racks they are located. Not the most efficient but it can do.
Best regards,
Jerry
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2022-08-14 03:39 AM
Thanks for your reply.,
I don't have the rights in the DC to do that.
In the end, I just loop through the hosts and got the racks that way.
Best regards,
Jerry
Link copied. Please paste this link to share this article on your social media post.
Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.