Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
dogapi
Advanced tools
Readme
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
You will need your Datadog api key as well as an application key to use dogapi
.
Keys can be found at: https://app.datadoghq.com/account/settings#api
The keys can be provided either as constructor parameters when creating an instance of dogapi
as api_key
and app_key
or as the environment variables DD_API_KEY
and DD_APP_KEY
.
Constructor parameters:
var dogapi = require('dogapi');
var options = {
api_key: 'YOUR_KEY_HERE',
app_key: 'YOUR_KEY_HERE',
};
var app = new dogapi(options);
Environment Variables:
DD_API_KEY=YOUR_KEY_HERE DD_APP_KEY=YOUR_KEY_HERE node app.js
dogapi
implements all available functions in the official datadog api, http://docs.datadoghq.com/api/.
dogapi.constants.STATUSES
OK
, WARNING
, CRITICAL
, UNKNOWN
dogapi.stream(start, end, [[filter], callback])
dogapi.polling_stream(interval, [[filter], callback])
stream
for new eventsdogapi.get_event(event_id, callback)
dogapi.add_event(event, callback)
dogapi.add_comment(comment, [callback])
dogapi.update_comment(comment_id, comment, callback)
dogapi.delete_comment(comment_id, callback)
dogapi.add_alert(alert, [callback])
dogapi.update_alert(alert_id, alert, [callback])
dogapi.get_alert(alert_id, [callback])
dogapi.delete_alert(alert_id, [callback])
dogapi.get_all_alerts([callback])
dogapi.mute_alerts([callback])
dogapi.unmute_alerts([callback])
dogapi.get_dashboard(dash_id, [callback])
dogapi.get_all_dashboards([callback])
dogapi.create_dashboard(dashboard, [callback])
dogapi.update_dashboard(dash_id, dashboard, [callback])
dash_id
dogapi.delete_dashboard(dash_id, [callback])
dogapi.get_screenboard(screen_id, [callback])
dogapi.get_all_screenboards([callback])
dogapi.create_screenboard(screenboard, [callback])
dogapi.update_screenboard(screen_id, screenboard, [callback])
screen_id
dogapi.delete_screenboard(screen_id, [callback])
dogapi.search(query, [callback])
metrics
or hosts
dogapi.add_metric(metric, [callback])
dogapi.add_metrics(metrics, [callback])
dogapi.all_tags([[source], callback])
dogapi.host_tags(host, [[source], callback])
host
dogapi.host_tags_by_source(host, [[source], callback])
dogapi.add_tags(host, tags, [[source], callback])
host
dogapi.update_tags(host, tags, [[source], callback])
host
dogapi.detach_tags(host, [[source], callback])
host
dogapi.add_snapshot(snapshot, [callback])
dogapi.add_snapshot_from_def(snapshot, [callback])
dogapi.snapshot_status(snapshot_url, [callback])
dogapi.service_check(status, check, host, [[extra], [callback]])
dogapi.constants.STATUSES
)dogapi.schedule_downtime(scope, [options], [callback])
dogapi.update_downtime(downtime_id, [options], [callback])
dogapi.cancel_downtime(downtime_id, [callback])
dogapi.get_downtime(downtime_id, [callback])
dogapi.get_all_downtimes([current_only], [callback])
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']);
});
});
The MIT License (MIT) Copyright (c) 2013 Brett Langdon brett@blangdon.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
Datadog API Node.JS Client
The npm package dogapi receives a total of 904,918 weekly downloads. As such, dogapi popularity was classified as popular.
We found that dogapi demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.