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

How to query multiple entityTypes in a single api call?

NavenduGupta
Participant

How can I query for multiple entityTypes in a single call?

e.g. I want to query for all the entities which are either type (HOST) or type(PROCESS_GROUP_INSTANCE) for an environment?

GET /e/<env-id>/api/v2/entities?pageSIze=500&entitySelector=tag("TAGABCD"),type(HOST)&fields=firstSeenTms,lastSeenTms,properties,tags,managementZones,fromRelationships,toRelationships

in the above query, I can only entities of type HOST? can I query for multiple entity types e.g. give me the list of all the entities with are either "HOST" or "PROCESS_GROUP_INSTANCE"?

1 REPLY 1

mark_bley
Dynatrace Champion
Dynatrace Champion

Hi 

If you are looking to e.g. find the process group instances (PGI) for a specific host you can use the relationships.

e.g. to get the PGIs of host(s) tagged with "CF Tag" you can use following entititySelector

type(process_group_instance),fromRelationships.isProcessOf(type(host),tag("CF Tag"))

 Or directly from a specific host using it's own ID

type(process_group_instance),fromRelationships.isProcessOf(type(host),entityId(HOST-EA50C80CC9354652))

Atm it is not possible to query multiple entity types in one call.

Hope it helps.

Best,

Mark

Featured Posts