Last active
September 25, 2019 14:46
-
-
Save koo04/45f45f7100d1f2ac306a5dc07ada0f0e to your computer and use it in GitHub Desktop.
Pingdom API - JS - Pause Domain
This file contains hidden or 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
| 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