question

Scott J. avatar image
Scott J. asked ·

Use rest API to query for host by discoveredName?

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!

rest api
10 |2000000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

1 Answer

Sebastian K. avatar image
Sebastian K. answered ·

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-smartscape/hosts-api/get-all/

Sebastian

Share
10 |2000000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

Space Topics

mobile monitoring dotnet synthetic monitoring reports iis chat kubernetes servicenow amazon web services mysql mainframe rest api errors cassandra dashboard oneagent sdk cmc application monitoring openkit smartscape request attributes monitoring developer community user tagging log monitoring services ufo syntheticadvisory activegate ip addresses auto-detection high five award oracle hyperion webserver uem usql iib test automation license web performance monitoring ios news migration management zones index ibm mq web services custom event alerts notifications sso host monitoring knowledge sharing reports browser monitors java hybris sap vmware maintenance window user action naming javascript appmon ai synthetic classic availability tipstricks automation extensions diagnostic tools session replay permissions davis assistant faq documentation problem detection http monitors server easytravel apdex aws-quickstart network docker tags and metadata cloud foundry google cloud platform synthetic monitoring process groups account usability dynatrace saas gui paas openshift key user actions administration user actions postgresql synthetic locations oneagent security Dynatrace Managed user management custom python technologies mongodb openstack user session monitoring continuous delivery citrix configuration alerting NGINX timestamp action naming linux nam installation masking error reporting database mission control jmeter recorder apache mobileapp RUM php threshold azure purepath davis scripting agent aix nodejs android