Class: Fog::Google::Monitoring::Real
- Inherits:
-
Object
- Object
- Fog::Google::Monitoring::Real
- Includes:
- Shared
- Defined in:
- lib/fog/google/requests/monitoring/list_timeseries.rb,
lib/fog/google/monitoring.rb,
lib/fog/google/requests/monitoring/list_metric_descriptors.rb,
lib/fog/google/requests/monitoring/list_timeseries_descriptors.rb
Overview
List the descriptors of the time series that match the metric and labels values and that have data points in the interval.
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
-
#monitoring ⇒ Object
readonly
Returns the value of attribute monitoring.
Attributes included from Shared
#api_url, #api_version, #project
Instance Method Summary collapse
-
#initialize(options) ⇒ Real
constructor
A new instance of Real.
- #list_metric_descriptors(options = {}) ⇒ Object
- #list_timeseries(metric, youngest, options = {}) ⇒ Object
- #list_timeseries_descriptors(metric, youngest, options = {}) ⇒ Object
Methods included from Shared
#build_excon_response, #initialize_google_client, #new_pk12_google_client, #request, #shared_initialize
Constructor Details
#initialize(options) ⇒ Real
Returns a new instance of Real.
79 80 81 82 83 84 85 |
# File 'lib/fog/google/monitoring.rb', line 79 def initialize() shared_initialize([:google_project], GOOGLE_MONITORING_API_VERSION, GOOGLE_MONITORING_BASE_URL) .merge!(:google_api_scope_url => GOOGLE_MONITORING_API_SCOPE_URLS.join(' ')) @client = initialize_google_client() @monitoring = @client.discovered_api('cloudmonitoring', api_version) end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
76 77 78 |
# File 'lib/fog/google/monitoring.rb', line 76 def client @client end |
#monitoring ⇒ Object (readonly)
Returns the value of attribute monitoring.
77 78 79 |
# File 'lib/fog/google/monitoring.rb', line 77 def monitoring @monitoring end |
Instance Method Details
#list_metric_descriptors(options = {}) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/fog/google/requests/monitoring/list_metric_descriptors.rb', line 10 def list_metric_descriptors( = {}) api_method = @monitoring.metric_descriptors.list parameters = { 'project' => @project, } parameters['count'] = [:count] if .key?(:count) parameters['pageToken'] = [:page_token] if .key?(:page_token) parameters['query'] = [:query] if .key?(:query) request(api_method, parameters) end |
#list_timeseries(metric, youngest, options = {}) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/fog/google/requests/monitoring/list_timeseries.rb', line 10 def list_timeseries(metric, youngest, = {}) api_method = @monitoring.timeseries.list parameters = { 'project' => @project, 'metric' => metric, 'youngest' => youngest, } parameters['count'] = [:count] if .key?(:count) parameters['labels'] = [:labels] if .key?(:labels) parameters['oldest'] = [:oldest] if .key?(:oldest) parameters['pageToken'] = [:page_token] if .key?(:page_token) parameters['timespan'] = [:timespan] if .key?(:timespan) request(api_method, parameters) end |
#list_timeseries_descriptors(metric, youngest, options = {}) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/fog/google/requests/monitoring/list_timeseries_descriptors.rb', line 10 def list_timeseries_descriptors(metric, youngest, = {}) api_method = @monitoring.timeseries_descriptors.list parameters = { 'project' => @project, 'metric' => metric, 'youngest' => youngest, } parameters['count'] = [:count] if .key?(:count) parameters['labels'] = [:labels] if .key?(:labels) parameters['oldest'] = [:oldest] if .key?(:oldest) parameters['pageToken'] = [:page_token] if .key?(:page_token) parameters['timespan'] = [:timespan] if .key?(:timespan) request(api_method, parameters) end |