Datadog API Node.JS Client
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Brett Langdon 7f2f25f88b added polling_stream to event api 13 years ago
lib added polling_stream to event api 13 years ago
.gitignore remove node_modules dir from git, add node_modules to .gitignore 13 years ago
README.md Update README.md 13 years ago
package.json rename package to dogapi in package.json 13 years ago

README.md

node-dogapi

Datadog API Node.JS Client modeled after Datadog/dogapi python client.

Official API Documentation: http://docs.datadoghq.com/api/

Installation

From NPM:

[sudo] npm install dogapi

From source:

git clone git://github.com/brettlangdon/node-dogapi.git
cd ./node-dogapi
npm install

Sample Usage:

Example: get all events since this time yesterday:

var dogapi = require('dogapi');

var options = {
  api_key: 'YOUR_KEY_HERE',
  app_key: 'YOUR KEY_HERE',
};

var api = new dogapi(options);

var end = parseInt(new Date().getTime() / 1000);
var start = end - 86400;

api.stream(start, end, function(error, result, status_code){
  if(error){
    console.log('Error: ', error);
    console.log('Status Code: ', status_code);
    return;
  }
  
  result['events'].forEach(function(event){
    console.log(event['id'] + ': ' + event['title']);
  });
});