Comparing version 2.3.1 to 2.4.0
@@ -9,10 +9,7 @@ var client = require("../client"); | ||
*params: | ||
* title: the name of the screenboard | ||
* description: description of the screenboard | ||
* graphs: | | ||
* an array of objects which required the following keys | ||
* * title: the name of the graph | ||
* * widgets: an array of widgets, see http://docs.datadoghq.com/api/screenboards/ for more info | ||
* boardTitle: the name of the screenboard | ||
* widgets: an array of widgets, see http://docs.datadoghq.com/api/screenboards/ for more info | ||
* options: | | ||
* optional, a object which can contain any of the following keys | ||
* * description: description of the screenboard | ||
* * templateVariables: | | ||
@@ -25,2 +22,3 @@ * an array of objects with the following keys | ||
* * height: the height of the screenboard in pixels | ||
* * readOnly: the read-only status of the screenboard | ||
* callback: function(err, res) | ||
@@ -35,5 +33,4 @@ *example: | | ||
* dogapi.initialize(options); | ||
* var title = "my screenboard"; | ||
* var description = "it is super awesome"; | ||
* var graphs = [ | ||
* var boardTitle = "my screenboard"; | ||
* var widgets = [ | ||
* { | ||
@@ -55,6 +52,7 @@ * type: "image", | ||
* } | ||
* ] | ||
* ], | ||
* description: "it is super awesome" | ||
* }; | ||
* dogapi.screenboard.create( | ||
* title, description, graphs, options, | ||
* boardTitle, widgets, options, | ||
* function(err, res){ | ||
@@ -66,3 +64,3 @@ * console.dir(res); | ||
*/ | ||
function create(title, description, graphs, options, callback){ | ||
function create(boardTitle, widgets, options, callback){ | ||
if(arguments.length < 5 && typeof arguments[3] === "function"){ | ||
@@ -78,8 +76,10 @@ callback = options; | ||
body: { | ||
title: title, | ||
description: description, | ||
graphs: graphs | ||
board_title: boardTitle, | ||
widgets: widgets | ||
} | ||
}; | ||
if(options.description){ | ||
params.body.description = options.description; | ||
} | ||
if(options.templateVariables){ | ||
@@ -94,2 +94,5 @@ params.body.template_variables = options.templateVariables; | ||
} | ||
if(options.readOnly){ | ||
params.body.read_only = options.readOnly; | ||
} | ||
@@ -195,3 +198,3 @@ client.request("POST", "/screen", params, callback); | ||
return [ | ||
" dogapi screenboard create <title> <description> <graphs> [--tmpvars <templateVariables>] [--width <width>] [--height <height>]", | ||
" dogapi screenboard create <boardTitle> <widgets> [--description <description>] [--tmpvars <templateVariables>] [--width <width>] [--height <height>]", | ||
" dogapi screenboard remove <boardId>", | ||
@@ -207,3 +210,3 @@ " dogapi screenboard get <boardId>", | ||
" Subcommands:", | ||
" create <title> <description> <graphs> create a new screenboard, <graphs> is a json of the graph definition", | ||
" create <boardTitle> <widgets> create a new screenboard, <widgets> is a json of the graph definition", | ||
" remove <boardId> remove an existing screenboard", | ||
@@ -214,2 +217,3 @@ " get <boardId> get an existing screenboard", | ||
" Options:", | ||
" --description <description> a description of the screenboard's content", | ||
" --tmpvars <templateVariables> json representation of the template variable definition", | ||
@@ -230,7 +234,9 @@ " --width <width> width of the screenboard in pixels", | ||
} else if(subcommand === "create"){ | ||
var title = args._[4]; | ||
var description = args._[5]; | ||
var graphs = json.parse(args._[6]); | ||
var boardTitle = args._[4]; | ||
var widgets = json.parse(args._[5]); | ||
var options = {}; | ||
if(args["description"]) { | ||
options.description = args["description"]; | ||
} | ||
if(args["tmpvars"]){ | ||
@@ -246,3 +252,3 @@ options.templateVariables = json.parse(args["tmpvars"]); | ||
create(title, description, graphs, options, callback); | ||
create(boardTitle, widgets, options, callback); | ||
} else { | ||
@@ -249,0 +255,0 @@ callback("unknown subcommand or arguments try `dogapi screenboard --help` for help", false); |
{ | ||
"name": "dogapi", | ||
"version": "2.3.1", | ||
"version": "2.4.0", | ||
"description": "Datadog API Node.JS Client", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
179476
3281