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

extract host by applying filter for os by api

mahima_goel
Participant

need to extract the details of some host of one OS using API, how can this be done?

2 REPLIES 2

dave_mauney
Dynatrace Champion
Dynatrace Champion

You can either extract all hosts and filter after the fact, or create an OS tag and use that with the hosts OpenAPI endpoint to grab them. I did it in my Environment API page and the resulting curl looks like this:

curl -X GET "https://xxxxxxxx.live.dynatrace.com/api/v1/entity/infrastructure/hosts?tag=%5BCONTEXTLESS%5Dos%3AWindows%2010%20Pro%201909%2C%20ver.%2010.0.18362&includeDetails=true" -H "accept: application/json; charset=utf-8" -H "Authorization: Api-Token xxxxxxxx"

Note that I am using the full operating system. You could also set your tag to just "Windows" or "Linux" as you wish...




@Dave M. saves the day once again!

-Chad