Pause or Resume Pingdom check

Octopus.Script exported 2015-07-31 by timorzadir belongs to ‘Pingdom’ category.

Parameters

When steps based on the template are included in a project’s deployment process, the parameters below can be set.

User Name

UserName

Pingdom Password

Password

null

Application Key

AppKey

You generate your application key inside the Pingdom control panel.

Check Id

CheckId

Check Id to be paused or resumed

null

Action

null

Script body

Steps based on this template will execute the following PowerShell script.

$webclient = New-Object System.Net.WebClient
$webclient.Credentials = New-Object System.Net.NetworkCredential($UserName, $Password)
$webClient.Headers.add('App-Key',$AppKey)
$url = "https://api.pingdom.com/api/2.0/checks/$CheckId"
$actionBody = "paused=" + ($Action -eq "Pause").tostring().tolower()

$checkResult = $webclient.DownloadString($url) | ConvertFrom-Json
Write-Host "Attempting to" $Action.tolower() "check" $CheckId "-" $checkResult.check.name

$result = $webclient.UploadString($url, "PUT", $actionBody) | ConvertFrom-Json

Write-Host $result.message

Provided under the Apache License version 2.0.

Report an issue

To use this template in Octopus Deploy, copy the JSON below and paste it into the Library → Step templates → Import dialog.

{
  "Id": "a2d3b49a-84aa-4dc4-8da1-fbb3d8ff205b",
  "Name": "Pause or Resume Pingdom check",
  "Description": null,
  "Version": 1,
  "ExportedAt": "2015-07-31T12:23:52.329+00:00",
  "ActionType": "Octopus.Script",
  "Author": "timorzadir",
  "Parameters": [
    {
      "Name": "UserName",
      "Label": "User Name",
      "HelpText": "",
      "DisplaySettings": {
        "Octopus.ControlType": "SingleLineText"
      }
    },
    {
      "Name": "Password",
      "Label": "Pingdom Password",
      "HelpText": null,
      "DisplaySettings": {
        "Octopus.ControlType": "Sensitive"
      }
    },
    {
      "Name": "AppKey",
      "Label": "Application Key",
      "HelpText": "You generate your application key inside the Pingdom control panel.",
      "DisplaySettings": {
        "Octopus.ControlType": "Sensitive"
      }
    },
    {
      "Name": "CheckId",
      "Label": "Check Id",
      "HelpText": "Check Id to be paused or resumed",
      "DefaultValue": null,
      "DisplaySettings": {
        "Octopus.ControlType": "SingleLineText"
      }
    },
    {
      "Name": "Action",
      "Label": null,
      "HelpText": null,
      "DefaultValue": null,
      "DisplaySettings": {
        "Octopus.ControlType": "Select",
        "Octopus.SelectOptions": "Pause\nResume"
      }
    }
  ],
  "Properties": {
    "Octopus.Action.Script.Syntax": "PowerShell",
    "Octopus.Action.Script.ScriptBody": "$webclient = New-Object System.Net.WebClient\n$webclient.Credentials = New-Object System.Net.NetworkCredential($UserName, $Password)\n$webClient.Headers.add('App-Key',$AppKey)\n$url = \"https://api.pingdom.com/api/2.0/checks/$CheckId\"\n$actionBody = \"paused=\" + ($Action -eq \"Pause\").tostring().tolower()\n\n$checkResult = $webclient.DownloadString($url) | ConvertFrom-Json\nWrite-Host \"Attempting to\" $Action.tolower() \"check\" $CheckId \"-\" $checkResult.check.name\n\n$result = $webclient.UploadString($url, \"PUT\", $actionBody) | ConvertFrom-Json\n\nWrite-Host $result.message"
  },
  "Category": "Pingdom",
  "HistoryUrl": "https://github.com/OctopusDeploy/Library/commits/master/step-templates//opt/buildagent/work/75443764cd38076d/step-templates/pause-resume-pingdom-check.json",
  "Website": "/step-templates/a2d3b49a-84aa-4dc4-8da1-fbb3d8ff205b",
  "Logo": "iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAMAAACahl6sAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADBQTFRFGxsa/////veBsKMC5N2GxbYB//AA8uMAUEwOzb4A/vq+4tMB+/nk//Q/hn4JzsNEZBIFNAAABylJREFUeNrsnYuWmyAQhkkQGOT2/m9bMMlGDepABEkPs910zzamfv5zQUAgt//ESAfpIB2kg3SQDtJBOkgH6SAdpIN0kA7SQTpIB+kgHeRHQbTWox5PMf9BWlcH0ePdGF7EjLnfdRWQAMFLWwZMIshYHuIlzb0gyL0axgNFlwEZeXW7FwDRhl9gZjwbZOQX2f1ckDvnjZOQ1jm8e50HcikHkoS0z4EjIT/AgSIh7earuY3fg2jOf4LkEMS0AWK+BRl5I3b/EoQ3Y9+BfCeIUEpJbyy8+J9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ABJRU5ErkJggg==",
  "$Meta": {
    "Type": "ActionTemplate"
  }
}

History

Page updated on Friday, July 31, 2015