class Dogapi::V1::DashService

Constants

API_VERSION

Public Instance Methods

create_dashboard(title, description, graphs, template_variables = nil) click to toggle source
# File lib/dogapi/v1/dash.rb, line 10
def create_dashboard(title, description, graphs, template_variables = nil)

  begin
    params = {
      :api_key => @api_key,
      :application_key => @application_key
    }

    body = {
      :title => title,
      :description => description,
      :graphs => graphs,
      :template_variables => (template_variables or [])
    }

    request(Net::HTTP::Post, "/api/#{API_VERSION}/dash", params, body, true)
  rescue Exception => e
    suppress_error_if_silent e
  end
end
delete_dashboard(dash_id) click to toggle source
# File lib/dogapi/v1/dash.rb, line 78
def delete_dashboard(dash_id)
  begin
    params = {
      :api_key => @api_key,
      :application_key => @application_key
    }

    request(Net::HTTP::Delete, "/api/#{API_VERSION}/dash/#{dash_id}", params, nil, false)
  rescue Exception => e
    suppress_error_if_silent e
  end
end
get_dashboard(dash_id) click to toggle source
# File lib/dogapi/v1/dash.rb, line 52
def get_dashboard(dash_id)
  begin
    params = {
      :api_key => @api_key,
      :application_key => @application_key
    }

    request(Net::HTTP::Get, "/api/#{API_VERSION}/dash/#{dash_id}", params, nil, false)
  rescue Exception => e
    suppress_error_if_silent e
  end
end
get_dashboards() click to toggle source
# File lib/dogapi/v1/dash.rb, line 65
def get_dashboards
  begin
    params = {
      :api_key => @api_key,
      :application_key => @application_key
    }

    request(Net::HTTP::Get, "/api/#{API_VERSION}/dash", params, nil, false)
  rescue Exception => e
    suppress_error_if_silent e
  end
end
update_dashboard(dash_id, title, description, graphs, template_variables=nil) click to toggle source
# File lib/dogapi/v1/dash.rb, line 31
def update_dashboard(dash_id, title, description, graphs, template_variables=nil)

  begin
    params = {
      :api_key => @api_key,
      :application_key => @application_key
    }

    body = {
      :title => title,
      :description => description,
      :graphs => graphs,
      :template_variables => (template_variables or [])
    }

    request(Net::HTTP::Put, "/api/#{API_VERSION}/dash/#{dash_id}", params, body, true)
  rescue Exception => e
    suppress_error_if_silent e
  end
end