Hello:
We are attempting to convert the curl command to a powershell Invoke-RestMethod command in the PIA v2 for GET /metrics/query
I am unclear as to why I do not get the data returned with Invoke-RestMethod but CURL works.
Information is returned, but not the data from the API.
What is happening and does anyone see what needs changed to retrieve the data?
Thank you,
Runatyr
$body = @{
“metricSelector” = “ext:cloud.azure.microsoft_sql.managedinstances.io_requests”
“resolution” = “1m”
“entitySelector” = “type(custom_device),entityName.equals(`“■■■-sqlmi-peachpoc`”)”
}
$headers = @{
“accept” = “application/json; charset=utf-8”
“Authorization” = “Api-Token dt0c01.xxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”
}
$response = Invoke-RestMethod -Uri “https://xnm19dypd01/e/52575bc0-1849-4837-8e18-8bc962f4407f/api/v2/metrics/query” -Body $body -Headers $headers
Invoke-RestMethod -Uri “https://xnm19dypd01/e/52575bc0-1849-4837-8e18-8bc962f4407f/api/v2/metrics/query” -Body $body -Headers $headers


