Class: OCI::StackMonitoring::Models::MetricExtension

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/stack_monitoring/models/metric_extension.rb

Overview

Detailed information of the Metric Extension resource

Constant Summary collapse

STATUS_ENUM =
[
  STATUS_DRAFT = 'DRAFT'.freeze,
  STATUS_PUBLISHED = 'PUBLISHED'.freeze,
  STATUS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
LIFECYCLE_STATE_ENUM =
[
  LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze,
  LIFECYCLE_STATE_DELETED = 'DELETED'.freeze,
  LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ MetricExtension

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash

Options Hash (attributes):



186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
# File 'lib/oci/stack_monitoring/models/metric_extension.rb', line 186

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  self.id = attributes[:'id'] if attributes[:'id']

  self.name = attributes[:'name'] if attributes[:'name']

  self.display_name = attributes[:'displayName'] if attributes[:'displayName']

  raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')

  self.display_name = attributes[:'display_name'] if attributes[:'display_name']

  self.description = attributes[:'description'] if attributes[:'description']

  self.resource_type = attributes[:'resourceType'] if attributes[:'resourceType']

  raise 'You cannot provide both :resourceType and :resource_type' if attributes.key?(:'resourceType') && attributes.key?(:'resource_type')

  self.resource_type = attributes[:'resource_type'] if attributes[:'resource_type']

  self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']

  raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')

  self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']

  self.tenant_id = attributes[:'tenantId'] if attributes[:'tenantId']

  raise 'You cannot provide both :tenantId and :tenant_id' if attributes.key?(:'tenantId') && attributes.key?(:'tenant_id')

  self.tenant_id = attributes[:'tenant_id'] if attributes[:'tenant_id']

  self.collection_method = attributes[:'collectionMethod'] if attributes[:'collectionMethod']

  raise 'You cannot provide both :collectionMethod and :collection_method' if attributes.key?(:'collectionMethod') && attributes.key?(:'collection_method')

  self.collection_method = attributes[:'collection_method'] if attributes[:'collection_method']

  self.status = attributes[:'status'] if attributes[:'status']

  self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState']

  raise 'You cannot provide both :lifecycleState and :lifecycle_state' if attributes.key?(:'lifecycleState') && attributes.key?(:'lifecycle_state')

  self.lifecycle_state = attributes[:'lifecycle_state'] if attributes[:'lifecycle_state']

  self.created_by = attributes[:'createdBy'] if attributes[:'createdBy']

  raise 'You cannot provide both :createdBy and :created_by' if attributes.key?(:'createdBy') && attributes.key?(:'created_by')

  self.created_by = attributes[:'created_by'] if attributes[:'created_by']

  self.last_updated_by = attributes[:'lastUpdatedBy'] if attributes[:'lastUpdatedBy']

  raise 'You cannot provide both :lastUpdatedBy and :last_updated_by' if attributes.key?(:'lastUpdatedBy') && attributes.key?(:'last_updated_by')

  self.last_updated_by = attributes[:'last_updated_by'] if attributes[:'last_updated_by']

  self.time_created = attributes[:'timeCreated'] if attributes[:'timeCreated']

  raise 'You cannot provide both :timeCreated and :time_created' if attributes.key?(:'timeCreated') && attributes.key?(:'time_created')

  self.time_created = attributes[:'time_created'] if attributes[:'time_created']

  self.time_updated = attributes[:'timeUpdated'] if attributes[:'timeUpdated']

  raise 'You cannot provide both :timeUpdated and :time_updated' if attributes.key?(:'timeUpdated') && attributes.key?(:'time_updated')

  self.time_updated = attributes[:'time_updated'] if attributes[:'time_updated']

  self.collection_recurrences = attributes[:'collectionRecurrences'] if attributes[:'collectionRecurrences']

  raise 'You cannot provide both :collectionRecurrences and :collection_recurrences' if attributes.key?(:'collectionRecurrences') && attributes.key?(:'collection_recurrences')

  self.collection_recurrences = attributes[:'collection_recurrences'] if attributes[:'collection_recurrences']

  self.metric_list = attributes[:'metricList'] if attributes[:'metricList']

  raise 'You cannot provide both :metricList and :metric_list' if attributes.key?(:'metricList') && attributes.key?(:'metric_list')

  self.metric_list = attributes[:'metric_list'] if attributes[:'metric_list']

  self.query_properties = attributes[:'queryProperties'] if attributes[:'queryProperties']

  raise 'You cannot provide both :queryProperties and :query_properties' if attributes.key?(:'queryProperties') && attributes.key?(:'query_properties')

  self.query_properties = attributes[:'query_properties'] if attributes[:'query_properties']

  self.enabled_on_resources = attributes[:'enabledOnResources'] if attributes[:'enabledOnResources']

  raise 'You cannot provide both :enabledOnResources and :enabled_on_resources' if attributes.key?(:'enabledOnResources') && attributes.key?(:'enabled_on_resources')

  self.enabled_on_resources = attributes[:'enabled_on_resources'] if attributes[:'enabled_on_resources']

  self.enabled_on_resources_count = attributes[:'enabledOnResourcesCount'] if attributes[:'enabledOnResourcesCount']

  raise 'You cannot provide both :enabledOnResourcesCount and :enabled_on_resources_count' if attributes.key?(:'enabledOnResourcesCount') && attributes.key?(:'enabled_on_resources_count')

  self.enabled_on_resources_count = attributes[:'enabled_on_resources_count'] if attributes[:'enabled_on_resources_count']

  self.resource_uri = attributes[:'resourceUri'] if attributes[:'resourceUri']

  raise 'You cannot provide both :resourceUri and :resource_uri' if attributes.key?(:'resourceUri') && attributes.key?(:'resource_uri')

  self.resource_uri = attributes[:'resource_uri'] if attributes[:'resource_uri']
end

Instance Attribute Details

#collection_methodString

[Required] Collection Method Metric Extension applies

Returns:

  • (String)


54
55
56
# File 'lib/oci/stack_monitoring/models/metric_extension.rb', line 54

def collection_method
  @collection_method
end

#collection_recurrencesString

[Required] Schedule of metric extension should use RFC 5545 format -> recur-rule-part = "FREQ";"INTERVAL" where FREQ rule part identifies the type of recurrence rule. Valid values are "MINUTELY","HOURLY","DAILY" to specify repeating events based on an interval of a minute, an hour and a day or more. Example- FREQ=DAILY;INTERVAL=1

Returns:

  • (String)


82
83
84
# File 'lib/oci/stack_monitoring/models/metric_extension.rb', line 82

def collection_recurrences
  @collection_recurrences
end

#compartment_idString

[Required] Compartment Identifier OCID

Returns:

  • (String)


46
47
48
# File 'lib/oci/stack_monitoring/models/metric_extension.rb', line 46

def compartment_id
  @compartment_id
end

#created_byString

Created by user

Returns:

  • (String)


66
67
68
# File 'lib/oci/stack_monitoring/models/metric_extension.rb', line 66

def created_by
  @created_by
end

#descriptionString

Description of the metric extension.

Returns:

  • (String)


38
39
40
# File 'lib/oci/stack_monitoring/models/metric_extension.rb', line 38

def description
  @description
end

#display_nameString

[Required] Metric Extension resource display name

Returns:

  • (String)


34
35
36
# File 'lib/oci/stack_monitoring/models/metric_extension.rb', line 34

def display_name
  @display_name
end

#enabled_on_resourcesArray<OCI::StackMonitoring::Models::EnabledResourceDetails>

List of resource objects on which this metric extension is enabled.



94
95
96
# File 'lib/oci/stack_monitoring/models/metric_extension.rb', line 94

def enabled_on_resources
  @enabled_on_resources
end

#enabled_on_resources_countInteger

Count of resources on which this metric extension is enabled.

Returns:

  • (Integer)


98
99
100
# File 'lib/oci/stack_monitoring/models/metric_extension.rb', line 98

def enabled_on_resources_count
  @enabled_on_resources_count
end

#idString

[Required] The OCID of Metric Extension resource

Returns:

  • (String)


26
27
28
# File 'lib/oci/stack_monitoring/models/metric_extension.rb', line 26

def id
  @id
end

#last_updated_byString

Last updated by user

Returns:

  • (String)


70
71
72
# File 'lib/oci/stack_monitoring/models/metric_extension.rb', line 70

def last_updated_by
  @last_updated_by
end

#lifecycle_stateString

The current lifecycle state of the metric extension

Returns:

  • (String)


62
63
64
# File 'lib/oci/stack_monitoring/models/metric_extension.rb', line 62

def lifecycle_state
  @lifecycle_state
end

#metric_listArray<OCI::StackMonitoring::Models::Metric>

[Required] List of metrics which are part of this metric extension



86
87
88
# File 'lib/oci/stack_monitoring/models/metric_extension.rb', line 86

def metric_list
  @metric_list
end

#nameString

[Required] Metric Extension resource name

Returns:

  • (String)


30
31
32
# File 'lib/oci/stack_monitoring/models/metric_extension.rb', line 30

def name
  @name
end

#query_propertiesOCI::StackMonitoring::Models::MetricExtensionQueryProperties

This attribute is required.



90
91
92
# File 'lib/oci/stack_monitoring/models/metric_extension.rb', line 90

def query_properties
  @query_properties
end

#resource_typeString

[Required] Resource type to which Metric Extension applies

Returns:

  • (String)


42
43
44
# File 'lib/oci/stack_monitoring/models/metric_extension.rb', line 42

def resource_type
  @resource_type
end

#resource_uriString

The URI path that the user can do a GET on to access the metric extension metadata

Returns:

  • (String)


102
103
104
# File 'lib/oci/stack_monitoring/models/metric_extension.rb', line 102

def resource_uri
  @resource_uri
end

#statusString

[Required] The current status of the metric extension i.e. whether it is Draft or Published

Returns:

  • (String)


58
59
60
# File 'lib/oci/stack_monitoring/models/metric_extension.rb', line 58

def status
  @status
end

#tenant_idString

[Required] Tenant Identifier OCID

Returns:

  • (String)


50
51
52
# File 'lib/oci/stack_monitoring/models/metric_extension.rb', line 50

def tenant_id
  @tenant_id
end

#time_createdDateTime

Metric Extension creation time. An RFC3339 formatted datetime string.

Returns:

  • (DateTime)


74
75
76
# File 'lib/oci/stack_monitoring/models/metric_extension.rb', line 74

def time_created
  @time_created
end

#time_updatedDateTime

Metric Extension update time. An RFC3339 formatted datetime string.

Returns:

  • (DateTime)


78
79
80
# File 'lib/oci/stack_monitoring/models/metric_extension.rb', line 78

def time_updated
  @time_updated
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# File 'lib/oci/stack_monitoring/models/metric_extension.rb', line 105

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'name': :'name',
    'display_name': :'displayName',
    'description': :'description',
    'resource_type': :'resourceType',
    'compartment_id': :'compartmentId',
    'tenant_id': :'tenantId',
    'collection_method': :'collectionMethod',
    'status': :'status',
    'lifecycle_state': :'lifecycleState',
    'created_by': :'createdBy',
    'last_updated_by': :'lastUpdatedBy',
    'time_created': :'timeCreated',
    'time_updated': :'timeUpdated',
    'collection_recurrences': :'collectionRecurrences',
    'metric_list': :'metricList',
    'query_properties': :'queryProperties',
    'enabled_on_resources': :'enabledOnResources',
    'enabled_on_resources_count': :'enabledOnResourcesCount',
    'resource_uri': :'resourceUri'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/oci/stack_monitoring/models/metric_extension.rb', line 133

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'name': :'String',
    'display_name': :'String',
    'description': :'String',
    'resource_type': :'String',
    'compartment_id': :'String',
    'tenant_id': :'String',
    'collection_method': :'String',
    'status': :'String',
    'lifecycle_state': :'String',
    'created_by': :'String',
    'last_updated_by': :'String',
    'time_created': :'DateTime',
    'time_updated': :'DateTime',
    'collection_recurrences': :'String',
    'metric_list': :'Array<OCI::StackMonitoring::Models::Metric>',
    'query_properties': :'OCI::StackMonitoring::Models::MetricExtensionQueryProperties',
    'enabled_on_resources': :'Array<OCI::StackMonitoring::Models::EnabledResourceDetails>',
    'enabled_on_resources_count': :'Integer',
    'resource_uri': :'String'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object)

    the other object to be compared



330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
# File 'lib/oci/stack_monitoring/models/metric_extension.rb', line 330

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    id == other.id &&
    name == other.name &&
    display_name == other.display_name &&
    description == other.description &&
    resource_type == other.resource_type &&
    compartment_id == other.compartment_id &&
    tenant_id == other.tenant_id &&
    collection_method == other.collection_method &&
    status == other.status &&
    lifecycle_state == other.lifecycle_state &&
    created_by == other.created_by &&
    last_updated_by == other.last_updated_by &&
    time_created == other.time_created &&
    time_updated == other.time_updated &&
    collection_recurrences == other.collection_recurrences &&
    metric_list == other.metric_list &&
    query_properties == other.query_properties &&
    enabled_on_resources == other.enabled_on_resources &&
    enabled_on_resources_count == other.enabled_on_resources_count &&
    resource_uri == other.resource_uri
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
# File 'lib/oci/stack_monitoring/models/metric_extension.rb', line 379

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)

  self.class.swagger_types.each_pair do |key, type|
    if type =~ /^Array<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        public_method("#{key}=").call(
          attributes[self.class.attribute_map[key]]
            .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
        )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      public_method("#{key}=").call(
        OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
      )
    end
    # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(other) ⇒ Boolean

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


359
360
361
# File 'lib/oci/stack_monitoring/models/metric_extension.rb', line 359

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



368
369
370
# File 'lib/oci/stack_monitoring/models/metric_extension.rb', line 368

def hash
  [id, name, display_name, description, resource_type, compartment_id, tenant_id, collection_method, status, lifecycle_state, created_by, last_updated_by, time_created, time_updated, collection_recurrences, metric_list, query_properties, enabled_on_resources, enabled_on_resources_count, resource_uri].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



412
413
414
415
416
417
418
419
420
421
# File 'lib/oci/stack_monitoring/models/metric_extension.rb', line 412

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = public_method(attr).call
    next if value.nil? && !instance_variable_defined?("@#{attr}")

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



406
407
408
# File 'lib/oci/stack_monitoring/models/metric_extension.rb', line 406

def to_s
  to_hash.to_s
end