Class: Dogapi::V1::EmbedService
- Inherits:
-
APIService
- Object
- APIService
- Dogapi::V1::EmbedService
- Defined in:
- lib/dogapi/v1/embed.rb
Overview
EMBED API
Constant Summary collapse
- API_VERSION =
'v1'
Instance Attribute Summary
Attributes inherited from APIService
Instance Method Summary collapse
-
#create_embed(graph_json, description = {}) ⇒ Object
Create an embeddable graph.
-
#enable_embed(embed_id) ⇒ Object
Enable a specific embed.
-
#get_all_embeds ⇒ Object
Get all embeds for the API user’s org.
-
#get_embed(embed_id, description = {}) ⇒ Object
Get a specific embed.
-
#revoke_embed(embed_id) ⇒ Object
Revoke a specific embed.
Methods inherited from APIService
#connect, #handle_redirect, #handle_response, #initialize, #prepare_params, #prepare_request, #request, #should_set_api_and_app_keys_in_params?, #suppress_error_if_silent
Constructor Details
This class inherits a constructor from Dogapi::APIService
Instance Method Details
#create_embed(graph_json, description = {}) ⇒ Object
Create an embeddable graph
:graph_json => JSON: graph definition :timeframe => String: representing the interval of the graph. Default is “1_hour” :size => String: representing the size of the graph. Default is “medium”. :legend => String: flag representing whether a legend is displayed. Default is “no”. :title => String: represents title of the graph. Default is “Embed created through API.”
37 38 39 40 41 42 43 |
# File 'lib/dogapi/v1/embed.rb', line 37 def (graph_json, description= {}) body = { :graph_json => graph_json, }.merge(description) request(Net::HTTP::Post, "/api/#{API_VERSION}/graph/embed", nil, body, true) end |
#enable_embed(embed_id) ⇒ Object
Enable a specific embed
:embed_id => String: embed token for a specific embed
48 49 50 |
# File 'lib/dogapi/v1/embed.rb', line 48 def () request(Net::HTTP::Get, "/api/#{API_VERSION}/graph/embed/#{}/enable", nil, nil, false) end |
#get_all_embeds ⇒ Object
Get all embeds for the API user’s org
16 17 18 |
# File 'lib/dogapi/v1/embed.rb', line 16 def () request(Net::HTTP::Get, "/api/#{API_VERSION}/graph/embed", nil, nil, false) end |
#get_embed(embed_id, description = {}) ⇒ Object
Get a specific embed
:embed_id => String: embed token for a specific embed :size => String: “small”, “medium”(defualt), “large”, or “xlarge”. :legend => String: “yes” or “no”(default) :template_vars => String: variable name => variable value (any number of template vars)
26 27 28 |
# File 'lib/dogapi/v1/embed.rb', line 26 def (, description= {}) request(Net::HTTP::Get, "/api/#{API_VERSION}/graph/embed/#{}", description, nil, false) end |
#revoke_embed(embed_id) ⇒ Object
Revoke a specific embed
:embed_id => String: embed token for a specific embed
55 56 57 |
# File 'lib/dogapi/v1/embed.rb', line 55 def () request(Net::HTTP::Get, "/api/#{API_VERSION}/graph/embed/#{}/revoke", nil, nil, false) end |