19 Aug 2024 10:28 AM
While I trying to filter the entities based on entityName I'm not able to fetch with https://{your-environment}/api/v2/metrics/query?entitySelector=entityname.equals(%22{entityname}%22). with this api I'm not able to fetch the entites so help me out to fetch the entites on base of entityName.
19 Aug 2024 10:43 AM
@Cky007 , your trying use metric query API, where you pull the metric values.
To Fetch Entitles and entity details you may need to use below APIs
https://docs.dynatrace.com/docs/shortlink/api-entities-v2-get-all-entities-list
https://docs.dynatrace.com/docs/shortlink/api-entities-v2-get-entity
Regards,
Venkat
19 Aug 2024 10:56 AM
But with the metric query I pulled entityID data. If possible share me an sample url with entityName function
and entitySelector parameter
19 Aug 2024 11:01 AM
curl -L -X GET 'https://{environmentid}.live.dynatrace.com/api/v2/metrics/query?metricSelector=builtin:host.cpu.(usa...' \
-H 'Authorization: Api-Token abcdefjhij1234567890' \
-H 'Accept: application/json'
With the help of entityId i can retrive right