Skip to content

Instantly share code, notes, and snippets.

@koo04
Last active September 25, 2019 14:46
Show Gist options
  • Select an option

  • Save koo04/45f45f7100d1f2ac306a5dc07ada0f0e to your computer and use it in GitHub Desktop.

Select an option

Save koo04/45f45f7100d1f2ac306a5dc07ada0f0e to your computer and use it in GitHub Desktop.
Pingdom API - JS - Pause Domain
const https = require('https')
const body = JSON.stringify({
paused: true,
checkids: "{Check ID}"
})
const options = {
hostname: 'api.pingdom.com',
method: 'PUT',
path: '/api/3.1/checks',
headers: {
Authorization: 'Bearer {My Pingdom Token}',
'Content-Type': 'application/json',
'Content-Length': body.length
}
}
const req = https.request(options, (res) => {
let data = ""
res.on('data', (chunk) => {
data += chunk
})
res.on('end', () => {
console.log(data)
})
})
req.on('error', (e) => {
console.log(e)
})
req.write(body)
req.end()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment