Skip to content

Instantly share code, notes, and snippets.

@ryanhoskin
Last active February 11, 2016 17:03
Show Gist options
  • Save ryanhoskin/786c6b7b9df6d7373cec to your computer and use it in GitHub Desktop.
Save ryanhoskin/786c6b7b9df6d7373cec to your computer and use it in GitHub Desktop.
$pd_headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$pd_headers.Add("Authorization", 'Token token=<rest_api_token>')
$pd_url = "https://<subdomain>.pagerduty.com/api/v1"
$requester_id = "<requester_id>"
$incident_id = "<incident_id>"
$duration = "900" //in seconds
$data = @{
requester_id="$requester_id"
duration="$duration"
}
$json = $data | ConvertTo-Json
Invoke-RestMethod -Uri "$pd_url/incidents/$incident_id/snooze" -Headers $pd_headers -Method Put -Body $json -ContentType application/json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment