filter based on entityName

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.

@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

Regards,

Venkat

But with the metric query I pulled entityID data. If possible share me an sample url with entityName function

and entitySelector parameter

curl -L -X GET ‘https://{environmentid}.live.dynatrace.com/api/v2/metrics/query?metricSelector=builtin:host.cpu.(usage,idle)&entitySelector=type(%22dt.entity.host%22),entityId(%22HOST-0990886B7D39FE29%22,%22HOST-0956C3557E9109C1%22)&from=now-5m’ \
-H ‘Authorization: Api-Token abcdefjhij1234567890’ \
-H ‘Accept: application/json’
With the help of entityId i can retrive right