Class: Dogapi::V1::SnapshotService

Inherits:
APIService show all
Defined in:
lib/dogapi/v1/snapshot.rb

Constant Summary collapse

API_VERSION =
'v1'

Instance Attribute Summary

Attributes inherited from APIService

#api_key, #application_key

Instance Method Summary collapse

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

#snapshot(metric_query, start_ts, end_ts, event_query = nil) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/dogapi/v1/snapshot.rb', line 12

def snapshot(metric_query, start_ts, end_ts, event_query=nil)
  extra_params = {
    :metric_query => metric_query,
    :start => start_ts,
    :end => end_ts,
  }

  extra_params[:event_query] = event_query if event_query

  request(Net::HTTP::Get, "/api/#{API_VERSION}/graph/snapshot", extra_params, nil, false)
end