Last active
June 21, 2016 03:34
-
-
Save pawelpabich/8a9f09006a785c5e4959fc3f37a4bbc4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$OctopusURL = "http://localhost:8065" | |
$OctopusAPIKey = "API-XXXXXXXXXXXXX" | |
$environmentID = $OctopusParameters['Octopus.Environment.Id'] #Id of the environment where you want to run the health check. During a deployment you can use the variable $OctopusParameters['Octopus.Environment.Id'] to get this value. | |
Write-host "Env $environmentID" | |
$header = @{ "X-Octopus-ApiKey" = $OctopusAPIKey } | |
$body = @" | |
{ | |
"Name":"Health", | |
"Description":"Check Deployment Target health in Development", | |
"Arguments":{ | |
"Timeout":"00:05:00", | |
"EnvironmentId":`"$environmentID`" | |
} | |
} | |
"@ | |
Write-host "Body $body" | |
Invoke-WebRequest -Uri $OctopusURL/api/tasks -Body $body -Headers $header -Method Pos |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment