cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Use rest API to query for host by discoveredName?

scott_johnson
Newcomer

I need a way to query for a host by discoveredName, in order to retrieve the EntityID. Upon examining the api/v1/entity/infrastructure/hosts endpoint documentation, I don't see a way to specify discoveredName as a filter criteria. I'm pretty new to this API, so I may be missing something.

If this is the incorrect forum, please direct me to a proper destination.

Thank you for any assistance!


1 REPLY 1

skrystosik
DynaMight Guru
DynaMight Guru

You have to options in my opinion. First would be downloading full list of hosts, and look through whole list. In such case you can create local cache of pairs hostName : hostID in system that is fetching data from API.

Second option you can consider is creating tag rule, that will assign to all hosts tag with DetectedHostName as value.

https://www.dynatrace.com/support/help/shortlink/tagging#how-to-define-an-automatically-applied-tag

Than you will be able to filter list of hosts by tag:

https://www.dynatrace.com/support/help/extend-dynatrace/dynatrace-api/environment-api/topology-and-s...

Sebastian


Regards, Sebastian

Featured Posts