Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

statuspage-api

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

statuspage-api

A wrapper for select statuspage.io API commands

  • 0.3.1
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

statuspage-api

GET and POST for select StatusPage.io API elements.

Installation

npm install statuspage-api

Usage

var StatusPageAPI = require('./../lib/statuspage/index').StatusPageAPI;

/*
 * Initialize object
 */
var statuspage = new StatusPageAPI({
  pageid: "<ADD YOUR OWN PAGE ID>",
  apikey: "<ADD YOUR OWN API KEY>",
  host: "api.statuspage.io",      // Override the default host  
  port: 443,                // Override the default port
  // useragent: "statuspage-node",  // Override the default useragent
  debuglevel: "warn"      // Set debug levele: debug, info, warn, error
});

/*
 * Define callback to print API result
 */
var printAll = function(result) {
  console.log("Status: ", result.status);
  if (result.error != null) {
    console.log("Error: ", result.error);   
  }
  if (result.status == "success"){
    console.log("Data: ", result.data);
  }
}

/*
 * GET page contents using printAll callback
 */
 statuspage.get("pages", printAll);

/*
 * POST a scheduled incident and print the result
 */
var args = { 
    "incident[name]": "Testing API components",
    "incident[status]": "scheduled",
    "incident[scheduled_for]":  "2015-04-03T18:30:05+00:00",
    "incident[scheduled_until]": "2015-04-03T18:35:05+00:00",
    "incident[message]": "This is only a test.\n Really, it's only a test.",
    "incident[scheduled_remind_prior]": "t",
    "incident[scheduled_auto_in_progress]": "t",
    "incident[scheduled_auto_completed]": "t",
    "incident[impact_override]": "minor",
    "incident[component_ids]": ["tblsw29xd923","tvb8cjnr022n"]
}
statuspage.post("incidents", args, printAll);

For more information see example

Supported calls:

Accepts a subset of StatusPage.io collections or elements.

  • GET

    • pages
    • components
    • incidents, incidents/unresolved, incidents/scheduled
    • subscribers
  • POST:

    • incidents
    • subscribers

Read more about the statuspage.io API here

Influences

Heavily drawn from jammus's lastfm-node and DynectEmail-Node

Keywords

FAQs

Package last updated on 16 Apr 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc