Class: Fog::Google::Monitoring::MetricDescriptors
- Inherits:
-
Collection
- Object
- Collection
- Fog::Google::Monitoring::MetricDescriptors
- Defined in:
- lib/fog/google/models/monitoring/metric_descriptors.rb
Instance Method Summary collapse
-
#all(filter: nil, page_size: nil, page_token: nil) ⇒ Array<Fog::Google::Monitoring::MetricDescriptor>
Lists all Metric Descriptors.
-
#get(metric_type) ⇒ Fog::Google::Monitoring::MetricDescriptor
Get a Metric Descriptors.
Instance Method Details
#all(filter: nil, page_size: nil, page_token: nil) ⇒ Array<Fog::Google::Monitoring::MetricDescriptor>
Lists all Metric Descriptors.
18 19 20 21 22 23 24 25 26 |
# File 'lib/fog/google/models/monitoring/metric_descriptors.rb', line 18 def all(filter: nil, page_size: nil, page_token: nil) data = service.list_metric_descriptors( :filter => filter, :page_size => page_size, :page_token => page_token ).to_h[:metric_descriptors] || [] load(data) end |
#get(metric_type) ⇒ Fog::Google::Monitoring::MetricDescriptor
Get a Metric Descriptors.
33 34 35 36 37 38 39 |
# File 'lib/fog/google/models/monitoring/metric_descriptors.rb', line 33 def get(metric_type) data = service.get_metric_descriptor(metric_type).to_h new(data) rescue ::Google::Apis::ClientError => e raise e unless e.status_code == 404 nil end |