Class: Google::Apis::CloudmonitoringV2beta2::MetricDescriptor

Inherits:
Object
  • Object
show all
Includes:
Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
Defined in:
generated/google/apis/cloudmonitoring_v2beta2/classes.rb,
generated/google/apis/cloudmonitoring_v2beta2/representations.rb,
generated/google/apis/cloudmonitoring_v2beta2/representations.rb

Overview

A metricDescriptor defines the name, label keys, and data type of a particular metric.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Google::Apis::Core::JsonObjectSupport

#to_json

Methods included from Google::Apis::Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ MetricDescriptor

Returns a new instance of MetricDescriptor.


263
264
265
# File 'generated/google/apis/cloudmonitoring_v2beta2/classes.rb', line 263

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#descriptionString

Description of this metric. Corresponds to the JSON property description

Returns:

  • (String)

240
241
242
# File 'generated/google/apis/cloudmonitoring_v2beta2/classes.rb', line 240

def description
  @description
end

#labelsArray<Google::Apis::CloudmonitoringV2beta2::MetricDescriptorLabelDescriptor>

Labels defined for this metric. Corresponds to the JSON property labels


245
246
247
# File 'generated/google/apis/cloudmonitoring_v2beta2/classes.rb', line 245

def labels
  @labels
end

#nameString

The name of this metric. Corresponds to the JSON property name

Returns:

  • (String)

250
251
252
# File 'generated/google/apis/cloudmonitoring_v2beta2/classes.rb', line 250

def name
  @name
end

#projectString

The project ID to which the metric belongs. Corresponds to the JSON property project

Returns:

  • (String)

255
256
257
# File 'generated/google/apis/cloudmonitoring_v2beta2/classes.rb', line 255

def project
  @project
end

#type_descriptorGoogle::Apis::CloudmonitoringV2beta2::MetricDescriptorTypeDescriptor

A type in a metric contains information about how the metric is collected and what its data points look like. Corresponds to the JSON property typeDescriptor


261
262
263
# File 'generated/google/apis/cloudmonitoring_v2beta2/classes.rb', line 261

def type_descriptor
  @type_descriptor
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object


268
269
270
271
272
273
274
# File 'generated/google/apis/cloudmonitoring_v2beta2/classes.rb', line 268

def update!(**args)
  @description = args[:description] if args.key?(:description)
  @labels = args[:labels] if args.key?(:labels)
  @name = args[:name] if args.key?(:name)
  @project = args[:project] if args.key?(:project)
  @type_descriptor = args[:type_descriptor] if args.key?(:type_descriptor)
end