Browse Source

make some arguments to graph create_embed optional

dev/test.graph.create
Brett Langdon 10 years ago
parent
commit
6a7176bfa6
1 changed files with 14 additions and 14 deletions
  1. +14
    -14
      lib/api/graph.js

+ 14
- 14
lib/api/graph.js View File

@ -48,10 +48,10 @@ function snapshot(query, from, to, eventQuery, callback){
*comment: create an embed graph of a metric query
*params:
* graph_json: The request array to pass create in the embed
* timeframe: (1_hour, 4_hours, 1_day, 2_days, and 1_week)
* size: (small, medium, large, xlarge)
* legend: yes or no
* title: The title of the embed
* timeframe: optional, one of ("1_hour", "4_hours", "1_day", "2_days", and "1_week")
* size: optional, one of ("small", "medium", "large", "xlarge")
* legend: optional, "yes" or "no"
* title: optional, the title of the embed
* callback: function(err, res)
*example: |
* ```javascript
@ -103,7 +103,8 @@ module.exports = {
createEmbed: createEmbed,
getUsage: function(){
return [
" dogapi graph snapshot <query> <from> <to> [--events <event-query>]"
" dogapi graph snapshot <query> <from> <to> [--events <event-query>]",
" dogapi graph create_embed <graph_json> [--timeframe <timeframe>] [--size <size>] [--legend <legend>] [--title <title>]"
];
},
getHelp: function(){
@ -111,14 +112,13 @@ module.exports = {
"Graph:",
" Subcommands:",
" snapshot <query> <from> <to> --events <event-query> | take a snapshot of a graph",
" create_embed --graph_json <graph_json> --timeframe <timeframe> --size <size> --legend <legend> --title <title> | create a new graph embed",
" create_embed <graph_json> --timeframe <timeframe> --size <size> --legend <legend> --title <title> | create a new graph embed",
" Options:",
" --events <event-query> a query for event bands to add to the snapshot",
" --graph_json <graph_json> <required> The json object to send to the DataDog",
" --timeframe <timeframe> <required> The timeframe for the embed (1_hour, 4_hours, 1_day, 2_days, and 1_week)",
" --size <size> <required> The size of the graph to create (small, medium, large, xlarge)",
" --legend <legend> <required> Whether or not to have a legend (yes, no)",
" --title <title> <required> The title of the embed to create"
" --events <event-query> a query for event bands to add to the snapshot",
" --timeframe <timeframe> The timeframe for the embed (1_hour, 4_hours, 1_day, 2_days, and 1_week)",
" --size <size> The size of the graph to create (small, medium, large, xlarge)",
" --legend <legend> Whether or not to have a legend (yes, no)",
" --title <title> The title of the embed to create"
];
},
@ -129,8 +129,8 @@ module.exports = {
var to = parseInt(args._[6]);
var eventQuery = args["events"];
snapshot(query, from, to, eventQuery, callback);
} else if (subcommand === "create_embed") {
var graph_json = json.parse(args["graph_json"]);
} else if (args._.length > 4 && subcommand === "create_embed") {
var graph_json = json.parse(args._[4]);
var timeframe = args["timeframe"];
var size = args["size"];
var legend = args["legend"];


Loading…
Cancel
Save