|
|
13 years ago | |
|---|---|---|
| lib | 13 years ago | |
| .gitignore | 13 years ago | |
| README.md | 13 years ago | |
| package.json | 13 years ago | |
Datadog API Node.JS Client modeled after Datadog/dogapi python client.
Official API Documentation: http://docs.datadoghq.com/api/
From NPM:
[sudo] npm install dogapi
From source:
git clone git://github.com/brettlangdon/node-dogapi.git
cd ./node-dogapi
npm install
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']);
});
});