27 Aug 2023 10:18 AM - last edited on 20 Aug 2024 02:56 PM by Michal_Gebacki
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"?
Solved! Go to Solution.
05 Sep 2023 10:52 AM
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