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

Settings API - GET objects

Pooja_3
Frequent Guest

Hi Team,

I am trying to execute get objects API but not sure what to enter in schemaIds, how can I find schemaID to get list of one agent deployed list. 

Thanks and Regards

Pooja P

5 REPLIES 5

Naveen
Guide

Hi Pooja,

You can use v2 Settings API to get the list of all the available schemas.

API: https://{environmentid}.live.dynatrace.com/api/v2/settings/schemas

Response:

{
  "schemaId": "builtin:monitored-technologies.php",
  "displayName": "PHP",
  "latestSchemaVersion": "0.0.3"
}

You can use above schemaId to get or update the objects.

Reference: https://www.dynatrace.com/support/help/dynatrace-api/environment-api/settings/schemas/get-all

Mohamed_Hamdy
DynaMight Champion
DynaMight Champion

Hi @Pooja_3,

I don't know if you are looking for the list of deployed hosts or if you just need the OneAgent default version, if you are looking for the list of hosts, you need to use entity API not settings API.

entity API v2:

/api/v2/entities?entitySelector=type(host)&fields=+properties.osType,+properties.monitoringMode

or you can use API v1:

/api/v1/entity/infrastructure/hosts

 

as for settings API, you can find all the available schemas here

Certified Dynatrace Professional | Certified Dynatrace Services Delivery - Observability & CloudOps | Dynatrace Partner - yourcompass.ca

thanks @Naveen and @Mohamed_Hamdy - I am able to get the list of schema IDs. Basically, I am trying to get list of hosts on which one agents is deployed in last 3 months. From UI I can't option to save that list. My requirement is to block the traffic of certain IPs with same subnet but we have few ECS containers where one agent is deployed. We can block traffic at IP level but at API level it's quite difficult. If you have better solution for this, it would be helpful. 

Naveen
Guide

Hi @Pooja_3 ,

I am not sure what exactly you trying to do, but you can use api/v1/oneagents?includeDetails=false API to get the list of host where oneagent is installed and save it as a JSON file. Could you please share the API you are using.

Trying using script may be bash or powershell.

@Naveen , I think @Pooja_3 is looking for this, but for the last three months, so you can use the following as well:

/api/v1/oneagents?includeDetails=false&startTimestamp=1679097600000&endTimestamp=1684368000000

for more details check OneAgent on Host API

to convert timestamps to milliseconds use this

Certified Dynatrace Professional | Certified Dynatrace Services Delivery - Observability & CloudOps | Dynatrace Partner - yourcompass.ca

Featured Posts