cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

On demand synthetic execution via Powershell script

Vidhyasagar
Guide

Hello,

I am working on a requirement to an trigger automated on demand synthetic execution via powershell, invoke method works perfectly fine but I am struggling with request body where I need to change the "monitor id" based on a variable.

Rest API request invoke body

{
"failOnPerformanceIssue": false,
"monitors": [
{
"executionCount": 1,
"monitorId": "SYNTHETIC_TEST-0200ECC670458A61",
"repeatMode": "SEQUENTIAL"
}
],
"processingMode": "STANDARD",
"takeScreenshotsOnSuccess": true
}

Invoke-RestMethod -Uri "https://{environmentid}.live.dynatrace.com/api/v2/synthetic/executions/batch" -Method Post -Body $json -Headers $headers

Any suggestions/solutions will help

3 REPLIES 3

Miguel_RinconG
Dynatrace Advisor
Dynatrace Advisor

Hi,

I understand do you need use a template of body, and in your script set previously the value of monitorID.

Hello Miguel,

In the POST API request body, i want to input the synthetic ID dynamically instead of static value

Hi,

 

You can get synthetics use a tag filter.

Featured Posts