Skip to content

Latest commit

 

History

History
77 lines (67 loc) · 1.74 KB

DASHBOARD.md

File metadata and controls

77 lines (67 loc) · 1.74 KB

Dashboard Related API Methods


The following methods are all relating to dashboards

Get a dashboard:
g.get_dashboard('Main Dashboard') # converted to 'main-dashboard' automatically
Get a dashboard list:
g.get_dashboard_list() # No parameter is required
Creating a dashboard:
g.create_dashboard({
  "title" => "API Created Dashboard",
  "from" => "now-30m",
  "to" => "now",
  "panels" => [
    {
      "datasource" => "cloudwatch_production_us-east-1",
      "graph_title" => "EC2 Instance CPU",
      "targets" => [
        {
          "metric_name" => "CPUUtilization",
          "namespace" => "AWS/EC2",
          "dimension_name" => "InstanceId",
          "dimension_value" => "i-07abc123",
          "region" => "us-east-1",
          "legend_alias" => "Instance #1 {{metric}} {{stat}}"
        },
        {
          "metric_name" => "CPUUtilization",
          "namespace" => "AWS/EC2",
          "dimension_name" => "InstanceId",
          "dimension_value" => "i-07abc124",
          "region" => "us-east-1",
          "legend_alias" => "Instance #2 {{metric}} {{stat}}"
        },
        {
          "metric_name" => "CPUUtilization",
          "namespace" => "AWS/EC2",
          "dimension_name" => "InstanceId",
          "dimension_value" => "i-07abc125",
          "region" => "us-east-1",
          "legend_alias" => "Instance #3 {{metric}} {{stat}}"
        }
      ]
    }
  ]
})
Delete a dashboard:
g.delete_dashboard('Main Dashboard')
Get the home dashboard:
g.get_home_dashboard()
Get dashboard tags:
g.get_dashboard_tags()
Search for dashboard:
g.search_dashboards({"query" => "My Dashboard", "tags" => 'test'})