From fb8802e57aad35deed45d9858cfafefd8b08bb8e Mon Sep 17 00:00:00 2001 From: brettlangdon Date: Thu, 26 Mar 2015 07:27:19 -0400 Subject: [PATCH] update documentation --- index.html | 234 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 233 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index c7bdd33..2b0a6a5 100644 --- a/index.html +++ b/index.html @@ -36,6 +36,8 @@ document.addEventListener("DOMContentLoaded", function(){hljs.initHighlightingOn
  • tag
  • +
  • timeboard +
  • user
  • client @@ -332,7 +334,7 @@ dogapi.downtime.getAll(function(err, res){

    the body of the event

    properties
    -

    an optional object continaing any of the following additional optional properties

    +

    an optional object continaing any of the following additional optional properties

    • date_happened: POSIX timestamp of when it happened
    • priority: "normal" or "low" [defualt: "normal"]
    • @@ -1241,6 +1243,236 @@ dogapi.tag.remove("host.name", function(err, results){ +
      +
      +

      timeboard

      + +
      +

      create(title, description, graphs, templateVariables, callback)

      +
      +

      add a new timeboard

      +

      Parameters:

      +
      +
      title
      +

      the title of the timeboard

      +
      +
      description
      +

      the description of the timeboard

      +
      +
      graphs
      +

      an array of objects with the following keys

      +
        +
      • title: the name of the graph
      • +
      • definition: an object containing the graph definition, e.g. {"requests": [{"q": "system.cpu.idle{*} by {host}"}
      • +
      +
      +
      templateVariables
      +

      optional, an array of objects with the following keys

      +
        +
      • name: the name of the variable
      • +
      • prefix: optional, the tag prefix for this variable
      • +
      • default: optional, the default value for this tag
      • +
      +
      +
      callback
      +

      function(err, res)

      +
      +
      +
      +
      +
      var dogapi = require("dogapi");
      +var options = {
      +  api_key: "api_key",
      +  app_key: "app_key"
      +};
      +dogapi.initialize(options);
      +var title = "Time Keeps on Slipping";
      +var description = "Into the Future";
      +var graphs = [
      +  {
      +    definition: {
      +      events: [],
      +      requests: [
      +        {q: "avg:system.mem.free{*}"}
      +      ],
      +      viz: "timeseries"
      +    },
      +    title: "Average Memory Free"
      +  }
      +];
      +var templateVariables = [
      +  {
      +    name: "host1",
      +    prefix: "host",
      +    default: "host:my-host"
      +  }
      +];
      +dogapi.timeboard.create(
      +  title, description, graphs, templateVariables,
      +  function(err, res){
      +    console.dir(res);
      +  }
      +);
      +
      +
      +
      +
      +

      update(dashId, title, description, graphs, templateVariables, callback)

      +
      +

      update an existing timeboard

      +

      Parameters:

      +
      +
      dashId
      +

      the id of the timeboard to update

      +
      +
      title
      +

      the title of the timeboard

      +
      +
      description
      +

      the description of the timeboard

      +
      +
      graphs
      +

      an array of objects with the following keys

      +
        +
      • title: the name of the graph
      • +
      • definition: an object containing the graph definition, e.g. {"requests": [{"q": "system.cpu.idle{*} by {host}"}
      • +
      +
      +
      templateVariables
      +

      optional, an array of objects with the following keys

      +
        +
      • name: the name of the variable
      • +
      • prefix: optional, the tag prefix for this variable
      • +
      • default: optional, the default value for this tag
      • +
      +
      +
      callback
      +

      function(err, res)

      +
      +
      +
      +
      +
      var dogapi = require("dogapi");
      +var options = {
      +  api_key: "api_key",
      +  app_key: "app_key"
      +};
      +dogapi.initialize(options);
      +var title = "Time Keeps on Slipping";
      +var description = "Into the Future";
      +var graphs = [
      +  {
      +    definition: {
      +      events: [],
      +      requests: [
      +        {q: "avg:system.mem.free{*}"}
      +      ],
      +      viz: "timeseries"
      +    },
      +    title: "Average Memory Free"
      +  }
      +];
      +var templateVariables = [
      +  {
      +    name: "host1",
      +    prefix: "host",
      +    default: "host:my-host"
      +  }
      +];
      +dogapi.timeboard.update(
      +  1234, title, description, graphs, templateVariables,
      +  function(err, res){
      +    console.dir(res);
      +  }
      +);
      +
      +
      +
      +
      +

      remove(dashId, callback)

      +
      +

      remove an existing timeboard

      +

      Parameters:

      +
      +
      dashId
      +

      the id of the timeboard to remove

      +
      +
      callback
      +

      function(err, res)

      +
      +
      +
      +
      +
      var dogapi = require("dogapi");
      +var options = {
      +  api_key: "api_key",
      +  app_key: "app_key"
      +};
      +dogapi.initialize(options);
      +dogapi.timeboard.remove(1234, function(err, res){
      +  console.dir(res);
      +});
      +
      +
      +
      +
      +

      getAll(callback)

      +
      +

      get all existing timeboards

      +

      Parameters:

      +
      +
      callback
      +

      function(err, res)

      +
      +
      +
      +
      +
      var dogapi = require("dogapi");
      +var options = {
      +  api_key: "api_key",
      +  app_key: "app_key"
      +};
      +dogapi.initialize(options);
      +dogapi.timeboard.getAll(1234, function(err, res){
      +  console.dir(res);
      +});
      +
      +
      +
      +
      +

      get(dashId, callback)

      +
      +

      get an existing timeboard

      +

      Parameters:

      +
      +
      dashId
      +

      the id of the timeboard to get

      +
      +
      callback
      +

      function(err, res)

      +
      +
      +
      +
      +
      var dogapi = require("dogapi");
      +var options = {
      +  api_key: "api_key",
      +  app_key: "app_key"
      +};
      +dogapi.initialize(options);
      +dogapi.timeboard.get(1234, function(err, res){
      +  console.dir(res);
      +});
      +
      +
      +
      +

      user