Method: Fog::Google::Monitoring::MetricDescriptors#get

Defined in:
lib/fog/google/models/monitoring/metric_descriptors.rb

#get(metric_type) ⇒ Fog::Google::Monitoring::MetricDescriptor

Get a Metric Descriptors.

Parameters:

  • metric_type (String)

    Metric type. For example, “custom.googleapis.com/test-metric”

Returns:



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