03 Jul 2023 05:21 AM - last edited on 13 Jul 2023 05:48 PM by AgataWlodarczyk
Hello!
Does anyone know how to fetch Consumed Host Units for a given host, using the Monitored Entities API?
I have a script which uses the Environment API V1 to grab Consumed Host Units for my hosts, but am looking to migrate to V2.
My script has been working fine for a while now, but I'm concerned it might stop working one day seeing as it utilises the Topology and Smartscape API.
**According to this link, this API was Deprecated in v1.263. Given the API hasn't yet broken (as of writing this 03JULY2023), my script is working on borrowed time.
The Official Dynatrace DOC has a page to help with migrating from the Topology and Smartscape API to the Monitored Entities API.
As can be seen here on the Page, Host Unit Consumption is definitely reported on with Topology and Smartscape API, but I'm struggling to see the same value reported with the Monitored Entities API.
Does anyone know where I can find Host Unit Consumption using the new Monitored Entities API?
Thanks!
Solved! Go to Solution.
18 Jul 2023 04:11 AM - last edited on 18 Jul 2023 09:19 AM by MaciejNeumann
https://{environmentid}.live.dynatrace.com/api/v1/entity/infrastructure/hosts?relativeTime=2hours&includeDetails=true&API-TOKEN=
18 Jul 2023 04:38 AM - edited 18 Jul 2023 04:39 AM
Hi @chakrit,
That's the exact API I am looking to pivot away from due to its Deprecated Status.
I have found however, that I can get all the same information provided by v1/entity/infrastructure/hosts in V1 Oneagents on a host.
So am using that instead 😄