|
|
|
@ -184,12 +184,12 @@ function update(hostname, tags, source, callback){ |
|
|
|
* app_key: "app_key" |
|
|
|
* }; |
|
|
|
* dogapi.initialize(options); |
|
|
|
* dogapi.tag.delete("host.name", function(err, results){ |
|
|
|
* dogapi.tag.remove("host.name", function(err, results){ |
|
|
|
* console.dir(results); |
|
|
|
* }); |
|
|
|
* ```
|
|
|
|
*/ |
|
|
|
function delete_tags(hostname, source, callback){ |
|
|
|
function remove(hostname, source, callback){ |
|
|
|
if(arguments.length < 3 && typeof arguments[1] === "function"){ |
|
|
|
callback = source; |
|
|
|
source = undefined; |
|
|
|
@ -209,12 +209,12 @@ module.exports = { |
|
|
|
get: get, |
|
|
|
create: create, |
|
|
|
update: update, |
|
|
|
"delete": delete_tags, |
|
|
|
remove: remove, |
|
|
|
getUsage: function(){ |
|
|
|
return [ |
|
|
|
"${command} tag get_all [--source <source>]", |
|
|
|
"${command} tag get <host> [--source <source>] [--by-source]", |
|
|
|
"${command} tag delete <host> [--source <source>]", |
|
|
|
"${command} tag remove <host> [--source <source>]", |
|
|
|
"${command} tag create <host> <tags> [--source <source>]", |
|
|
|
"${command} tag update <host> <tags> [--source <source>]" |
|
|
|
]; |
|
|
|
@ -224,7 +224,7 @@ module.exports = { |
|
|
|
"Tag Commands:", |
|
|
|
" get_all get all tags", |
|
|
|
" get <host> get all tags for a given host", |
|
|
|
" delete <host> delete 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>", |
|
|
|
" update <host> <tags> update the comma separates \"tag:value\"'s from <tag> to <host>", |
|
|
|
"", |
|
|
|
@ -255,7 +255,7 @@ module.exports = { |
|
|
|
var tags = args._[5].split(","); |
|
|
|
update(host, tags, source, callback); |
|
|
|
} else if(subcommand === "delete"){ |
|
|
|
delete_tags(host, source, callback); |
|
|
|
remove(host, source, callback); |
|
|
|
} |
|
|
|
} |
|
|
|
} |