|
|
|
@ -18,12 +18,12 @@ var util = require('util'); |
|
|
|
* app_key: "app_key" |
|
|
|
* }; |
|
|
|
* dogapi.initialize(options); |
|
|
|
* dogapi.tag.get_all(function(err, results){ |
|
|
|
* dogapi.tag.getAll(function(err, results){ |
|
|
|
* console.dir(results); |
|
|
|
* }); |
|
|
|
* ```
|
|
|
|
*/ |
|
|
|
function get_all(source, callback){ |
|
|
|
function getAll(source, callback){ |
|
|
|
if(arguments.length < 2 && typeof arguments[0] === "function"){ |
|
|
|
callback = source; |
|
|
|
source = undefined; |
|
|
|
@ -205,14 +205,14 @@ function remove(hostname, source, callback){ |
|
|
|
|
|
|
|
module.exports = { |
|
|
|
_client: client, |
|
|
|
get_all: get_all, |
|
|
|
getAll: getAll, |
|
|
|
get: get, |
|
|
|
create: create, |
|
|
|
update: update, |
|
|
|
remove: remove, |
|
|
|
getUsage: function(){ |
|
|
|
return [ |
|
|
|
"${command} tag get_all [--source <source>]", |
|
|
|
"${command} tag getall [--source <source>]", |
|
|
|
"${command} tag get <host> [--source <source>] [--by-source]", |
|
|
|
"${command} tag remove <host> [--source <source>]", |
|
|
|
"${command} tag create <host> <tags> [--source <source>]", |
|
|
|
@ -223,7 +223,7 @@ module.exports = { |
|
|
|
return [ |
|
|
|
"Tag:", |
|
|
|
" Subcommands:", |
|
|
|
" get_all get all tags", |
|
|
|
" getall get all tags", |
|
|
|
" get <host> get all tags for a given host", |
|
|
|
" remove <host> delete tags for a given host", |
|
|
|
" create <host> <tags> add the comma separates \"tag:value\"'s from <tag> to <host>", |
|
|
|
@ -238,8 +238,8 @@ module.exports = { |
|
|
|
var source = args["source"]; |
|
|
|
var host = args._[4]; |
|
|
|
|
|
|
|
if(subcommand === "get_all"){ |
|
|
|
get_all(source, callback); |
|
|
|
if(subcommand === "getall"){ |
|
|
|
getAll(source, callback); |
|
|
|
} else if(subcommand === "get"){ |
|
|
|
var options = {}; |
|
|
|
if(source){ |
|
|
|
|