Browse Source

Merge pull request #55 from mousavian/master

Supporting tags for monitors
pull/37/merge
Brett Langdon 9 years ago
committed by GitHub
parent
commit
309c5d92ea
1 changed files with 12 additions and 0 deletions
  1. +12
    -0
      lib/api/monitor.js

+ 12
- 0
lib/api/monitor.js View File

@ -10,6 +10,7 @@ var util = require("util");
* optional, an object containing any of the following
* * name: the name of the monitor
* * message: the message for the monitor
* * tags: a list of strings as tags to associate with the monitor
* * options: an object, to see available options please see the [monitor create](http://docs.datadoghq.com/api/#monitor-create) docs
* callback: function(err, res)
*example: |
@ -47,6 +48,9 @@ function create(type, query, properties, callback){
if(properties.message){
params.body.message = properties.message;
}
if(properties.tags){
params.body.tags = properties.tags;
}
if(typeof properties.options === "object"){
params.body.options = properties.options;
}
@ -96,6 +100,7 @@ function get(monitorId, groupStates, callback){
* optional, an object containing any of the following
* * group_states: an array containing any of the following "all", "alert", "warn", or "no data"
* * tags: an array of "tag:value"'s to filter on
* * monitor_tags: a comma separated list indicating what service and/or custom tags
* callback: function(err, res)
*example: |
* ```javascript
@ -124,6 +129,9 @@ function getAll(options, callback){
if(options.tags){
params.query.tags = options.tags.join(",");
}
if(options.monitor_tags){
params.query.monitor_tags = options.monitor_tags.join(",");
}
}
client.request("GET", "/monitor", params, callback);
}
@ -137,6 +145,7 @@ function getAll(options, callback){
* optional, an object containing any of the following
* * name: the name of the monitor
* * message: the message for the monitor
* * tags: a list of strings as tags to associate with the monitor
* * options: an object, to see available options please see the [monitor create](http://docs.datadoghq.com/api/#monitor-create) docs
* callback: function(err, res)
*example: |
@ -172,6 +181,9 @@ function update(monitorId, query, properties, callback){
if(properties.message){
params.body.message = properties.message;
}
if(properties.tags){
params.body.tags = properties.tags;
}
if(typeof properties.options === "object"){
params.body.options = properties.options;
}


Loading…
Cancel
Save