This is the repository for Node.js SDK of OpsGenie.
OpsGenie Node.js SDK aims to access OpsGenie Web API through HTTP calls from Node.js applications.
OpsGenie Node.js SDK covers:
Future releases are subject to be delivered for packing more APIs soon.
Node.js version >=0.6.x is required.
npm install opsgenie-sdk
var opsgenie = require("opsgenie-sdk");
opsgenie.configure({
api_key: "your_api_key",
});
Those using the European Service Region should set the EU endpooint in the configuration along with the API key.
opsgenie.configure({
'api_key': 'your_api_key',
'host': 'https://api.eu.opsgenie.com',
});
var get_alert_identifier = {
identifier: "alert_id",
identifierType: "id",
};
opsgenie.alertV2.get(get_alert_identifier, function (error, alert) {
if (error) {
// handle error
} else {
console.log("Alert data received", alert);
}
});
More samples can be found under /samples
directory
Also, checkout "Node.js SDK page" for detailed documentation