class DogapiDemo::V1::DashService

Constants

API_VERSION

Public Instance Methods

create_dashboard(title, description, graphs, template_variables = nil) click to toggle source
   # File lib/dogapi-demo/v1/dash.rb
10 def create_dashboard(title, description, graphs, template_variables = nil)
11 
12   begin
13     params = {
14       :api_key => @api_key,
15       :application_key => @application_key
16     }
17 
18     body = {
19       :title => title,
20       :description => description,
21       :graphs => graphs,
22       :template_variables => (template_variables or [])
23     }
24 
25     request(Net::HTTP::Post, "/api/#{API_VERSION}/dash", params, body, true)
26   rescue Exception => e
27     suppress_error_if_silent e
28   end
29 end
delete_dashboard(dash_id) click to toggle source
   # File lib/dogapi-demo/v1/dash.rb
78 def delete_dashboard(dash_id)
79   begin
80     params = {
81       :api_key => @api_key,
82       :application_key => @application_key
83     }
84 
85     request(Net::HTTP::Delete, "/api/#{API_VERSION}/dash/#{dash_id}", params, nil, false)
86   rescue Exception => e
87     suppress_error_if_silent e
88   end
89 end
get_dashboard(dash_id) click to toggle source
   # File lib/dogapi-demo/v1/dash.rb
52 def get_dashboard(dash_id)
53   begin
54     params = {
55       :api_key => @api_key,
56       :application_key => @application_key
57     }
58 
59     request(Net::HTTP::Get, "/api/#{API_VERSION}/dash/#{dash_id}", params, nil, false)
60   rescue Exception => e
61     suppress_error_if_silent e
62   end
63 end
get_dashboards() click to toggle source
   # File lib/dogapi-demo/v1/dash.rb
65 def get_dashboards
66   begin
67     params = {
68       :api_key => @api_key,
69       :application_key => @application_key
70     }
71 
72     request(Net::HTTP::Get, "/api/#{API_VERSION}/dash", params, nil, false)
73   rescue Exception => e
74     suppress_error_if_silent e
75   end
76 end
update_dashboard(dash_id, title, description, graphs, template_variables=nil) click to toggle source
   # File lib/dogapi-demo/v1/dash.rb
31 def update_dashboard(dash_id, title, description, graphs, template_variables=nil)
32 
33   begin
34     params = {
35       :api_key => @api_key,
36       :application_key => @application_key
37     }
38 
39     body = {
40       :title => title,
41       :description => description,
42       :graphs => graphs,
43       :template_variables => (template_variables or [])
44     }
45 
46     request(Net::HTTP::Put, "/api/#{API_VERSION}/dash/#{dash_id}", params, body, true)
47   rescue Exception => e
48     suppress_error_if_silent e
49   end
50 end