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: 2024-06-13 02:10 PM
Hi,
I've been trying to use the ITA API to automate the collection of data (specifically the /assets/search route), but I realized that the data that I retrieve is outdated; is there any way that I can trigger a recache to update the data? I need the data to be accurate and up-to-date, but I'd like to avoid manually extracting it all if possible.
I appreciate any help or information you can give me.
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: 2024-06-21 03:17 AM
Hello Zander.
The search tool is meant to find assets, but if you are trying to inventory specific items like racks you will want to execute a get asset by id providing he asset id (uuid) of the rack and using the children parameter. I pasted an example of the api call. The below call will return all of the asset contained inside the rack with uuid 7ee1d749-376a-4650-9484-03afbd2c8acd
https://<ita-server>/api/v8.1/assets/7ee1d749-376a-4650-9484-03afbd2c8acd?include=children
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: 2024-06-20 04:45 AM
Hello @xander,
I was able to do some quick testing in the web client and desktop client and the updates were available automatically within the API after around 20-30 seconds in my environment. This is likely due to the time it takes to update the indexing. My environment is small, so a larger environment may take more time to re-index depending on how many changes you save.
Web client changes are saved automatically and were available for me very soon after. Just remember if you are working in the desktop client you must save before the changes are committed back to the server and available for re-indexing.
Regards,
Cory
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: 2024-06-20 07:32 AM
Hello @Cory_McDonald,
Thank you for the response! I was cross-checking assets found using the /assets/search route against assets found in the equipment browser and saw older assets in the web API, so I jumped to the conclusion that it was a caching problem; in hindsight, I think the equipment browser in the native version of ITA might automatically filter out retired assets whereas the /assets/search API endpoint does not which would explain the discrepancy. I'm still very new to ITA, so I apologize about any misunderstanding that may have caused.
I think my underlying problem is that I'm not entirely sure how to query the API; I just want to pull any assets associated with a cabinet by that cabinet's name so it mirrors what I see in the equipment browser in the native version of ITA, but when I query the /assets/search endpoint with the cabinet name, the response seems to include retired assets and the /equipment-browser/results endpoint seems to give me unrelated assets. I see the documentation for the model schema and I'm able to parse the output just fine, but I haven't been able to find anything to help me understand the query parameters. My current queries are:
curl -X GET --header 'Accept: application/json' 'https://<serverip>/api/v8.1/assets/search?q=cj093'
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d 'cj093' 'https://<serverip>/api/v8.1/equipment-browser/results?lastSeenOffset=0&limit=10'
but neither of them matches the result that I get by typing the name of the cabinet into the search input for the equipment browser.
Can you help me out?
Best,
Xander
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: 2024-06-21 03:17 AM
Hello Zander.
The search tool is meant to find assets, but if you are trying to inventory specific items like racks you will want to execute a get asset by id providing he asset id (uuid) of the rack and using the children parameter. I pasted an example of the api call. The below call will return all of the asset contained inside the rack with uuid 7ee1d749-376a-4650-9484-03afbd2c8acd
https://<ita-server>/api/v8.1/assets/7ee1d749-376a-4650-9484-03afbd2c8acd?include=children
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: 2024-06-21 07:03 AM
Hi Gsterling,
Thank you for the example command, that cleared up a bit of my confusion about the API! A quick follow up; ideally, I can search by the name property (our cabinets all share the same naming convention and each name is unique); is there a way I can search by name instead of by id? I can use /assets/search and query by name to get the id of the cabinet, but that's two API calls so I'm just wondering if there's a way to do it in one.
Also, I'm still struggling on figuring out how to retrieve Power Consumers from breaker panels; they aren't considered children and that information didn't seem to be available in any of the power routes. It would be very useful to be able to retrieve that information using the API!
Thanks,
Xander
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: 2024-06-24 06:02 AM
Hi Xander,
Using the 'GET /assets/search' reset api, I can/could use the rack name as a search key,
Request URL
https://<ITA server>/api/v8.1/assets/search?q=Rackx
(searching for Rackx)
the response in my case was info about the searched rack and its content.
And regarding how to retrieve Power Consumers from breaker panels, I don't think this is exposed via the rest api calls.
Kind regards,
Jef
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.