18 Oct 2024 01:25 PM
Hi Dynatrace Community,
I’m trying to retrieve a list of workloads along with their entity IDs under a specific Kubernetes cluster using the Dynatrace API. I've encountered some issues while working with the entity selector, specifically regarding the correct filters to use for workloads.
Here’s what I’ve tried so far:
params = { "entitySelector": ( "type(KUBERNETES_WORKLOAD)," "isClusterOfWorkload(type(KUBERNETES_CLUSTER),entityName.equals(\"{cluster_name}\"))" ) }
However, I believe that isClusterOfWorkload is not the correct filter. Could anyone please guide me on which entity selector I should use to get the workloads associated with a particular cluster?
Thanks in advance for your help!
Solved! Go to Solution.
07 Nov 2024 07:15 PM
Kubernetes workload have the type of CLOUD_APPLICATION and the relationship to a cluster of isClusterOfCa.
Try following selector:
type(cloud_application),toRelationships.isClusterOfCa(type(kubernetes_cluster),entityName.equals(<k8_cluster_name>))
08 Nov 2024 06:16 AM
Hello @vignesh179
In addition to the response provided by @mark_bley
PFA similar case
using entity selector guidance:
BR,
Peter