diff --git a/index.html b/index.html index 2ded8c3..1936402 100644 --- a/index.html +++ b/index.html @@ -455,6 +455,7 @@ dogapi.downtime.getAll(function(err, res){

graph

snapshot(query, from, to, eventQuery, callback)

@@ -495,6 +496,66 @@ dogapi.graph.snapshot(query, from, to, function(err, res){
+
+

createEmbed(graph_json, options, options["timeframe"], options["size"], options["legend"], options["title"], callback)

+
+

create an embed graph of a metric query

+

Parameters:

+
+
graph_json
+

The request array to pass create in the embed

+
+
options
+

optional, object of extra parameters to pass to the embed create (see options[*] params)

+
+
options["timeframe"]
+

optional, one of ("1_hour", "4_hours", "1_day", "2_days", and "1_week")

+
+
options["size"]
+

optional, one of ("small", "medium", "large", "xlarge")

+
+
options["legend"]
+

optional, "yes" or "no"

+
+
options["title"]
+

optional, the title of the embed

+
+
callback
+

function(err, res)

+
+
+
+
+
var dogapi = require("dogapi");
+var options = {
+  api_key: "api_key",
+  app_key: "app_key"
+};
+dogapi.initialize(options);
+var query = "system.cpu.idle{*}";
+var graphJSON = {
+       viz: "timeseries",
+       requests: [
+         {
+           q: query,
+           aggregator: "avg",
+           conditional_formats: [],
+           type: "area"
+         }
+       ]
+     }
+var options = {
+    timeframe: "1_hour",
+    size: "xlarge",
+    legend: "yes",
+    title: "my awesome embed"
+};
+dogapi.graph.createEmbed(graphJSON, options, function(err, res){
+  console.dir(res);
+});
+
+
+