Class: OCI::Multicloud::Models::MulticloudAlert

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/multicloud/models/multicloud_alert.rb

Overview

A multicloud Alert

Constant Summary collapse

SEVERITY_ENUM =
[
  SEVERITY_LOW = 'LOW'.freeze,
  SEVERITY_MEDIUM = 'MEDIUM'.freeze,
  SEVERITY_HIGH = 'HIGH'.freeze,
  SEVERITY_CRITICAL = 'CRITICAL'.freeze,
  SEVERITY_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
SUBSCRIPTION_TYPE_ENUM =
[
  SUBSCRIPTION_TYPE_ORACLEDBATAZURE = 'ORACLEDBATAZURE'.freeze,
  SUBSCRIPTION_TYPE_ORACLEDBATGOOGLE = 'ORACLEDBATGOOGLE'.freeze,
  SUBSCRIPTION_TYPE_ORACLEDBATAWS = 'ORACLEDBATAWS'.freeze,
  SUBSCRIPTION_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
ALERT_STATUS_ENUM =
[
  ALERT_STATUS_UNACKNOWLEDGED = 'UNACKNOWLEDGED'.freeze,
  ALERT_STATUS_ACKNOWLEDGED = 'ACKNOWLEDGED'.freeze,
  ALERT_STATUS_RESOLVED = 'RESOLVED'.freeze,
  ALERT_STATUS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
LIFECYCLE_STATE_ENUM =
[
  LIFECYCLE_STATE_CREATING = 'CREATING'.freeze,
  LIFECYCLE_STATE_UPDATING = 'UPDATING'.freeze,
  LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze,
  LIFECYCLE_STATE_DELETING = 'DELETING'.freeze,
  LIFECYCLE_STATE_DELETED = 'DELETED'.freeze,
  LIFECYCLE_STATE_FAILED = 'FAILED'.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 = {}) ⇒ MulticloudAlert

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :id (String)

    The value to assign to the #id property

  • :display_name (String)

    The value to assign to the #display_name property

  • :description (String)

    The value to assign to the #description property

  • :alert_type (String)

    The value to assign to the #alert_type property

  • :severity (String)

    The value to assign to the #severity property

  • :subscription_id (String)

    The value to assign to the #subscription_id property

  • :subscription_type (String)

    The value to assign to the #subscription_type property

  • :alert_status (String)

    The value to assign to the #alert_status property

  • :time_created (DateTime)

    The value to assign to the #time_created property

  • :time_updated (DateTime)

    The value to assign to the #time_updated property

  • :resource_id (String)

    The value to assign to the #resource_id property

  • :resource_type (String)

    The value to assign to the #resource_type property

  • :compartment_id (String)

    The value to assign to the #compartment_id property

  • :function_type (String)

    The value to assign to the #function_type property

  • :source (String)

    The value to assign to the #source property

  • :alert_id (String)

    The value to assign to the #alert_id property

  • :lifecycle_state (String)

    The value to assign to the #lifecycle_state property

  • :freeform_tags (Hash<String, String>)

    The value to assign to the #freeform_tags property

  • :defined_tags (Hash<String, Hash<String, Object>>)

    The value to assign to the #defined_tags property

  • :system_tags (Hash<String, Hash<String, Object>>)

    The value to assign to the #system_tags property

  • :source_region (String)

    The value to assign to the #source_region property

  • :additional_parameters (Hash<String, String>)

    The value to assign to the #additional_parameters property



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
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
# File 'lib/oci/multicloud/models/multicloud_alert.rb', line 231

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.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.alert_type = attributes[:'alertType'] if attributes[:'alertType']

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

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

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

  self.subscription_id = attributes[:'subscriptionId'] if attributes[:'subscriptionId']

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

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

  self.subscription_type = attributes[:'subscriptionType'] if attributes[:'subscriptionType']

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

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

  self.alert_status = attributes[:'alertStatus'] if attributes[:'alertStatus']

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

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

  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.resource_id = attributes[:'resourceId'] if attributes[:'resourceId']

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

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

  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.function_type = attributes[:'functionType'] if attributes[:'functionType']

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

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

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

  self.alert_id = attributes[:'alertId'] if attributes[:'alertId']

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

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

  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.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']

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

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

  self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']

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

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

  self.system_tags = attributes[:'systemTags'] if attributes[:'systemTags']

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

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

  self.source_region = attributes[:'sourceRegion'] if attributes[:'sourceRegion']

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

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

  self.additional_parameters = attributes[:'additionalParameters'] if attributes[:'additionalParameters']

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

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

Instance Attribute Details

#additional_parametersHash<String, String>

Alert-specific contextual parameters.

Returns:

  • (Hash<String, String>)


141
142
143
# File 'lib/oci/multicloud/models/multicloud_alert.rb', line 141

def additional_parameters
  @additional_parameters
end

#alert_idString

External or human-friendly alert identifier.

Returns:

  • (String)


106
107
108
# File 'lib/oci/multicloud/models/multicloud_alert.rb', line 106

def alert_id
  @alert_id
end

#alert_statusString

[Required] Current acknowledgment status of the alert.

Returns:

  • (String)


74
75
76
# File 'lib/oci/multicloud/models/multicloud_alert.rb', line 74

def alert_status
  @alert_status
end

#alert_typeString

[Required] Type/category of the alert (e.g. IAM_POLICY_GAP, TAG_INCONSISTENCY).

Returns:

  • (String)


58
59
60
# File 'lib/oci/multicloud/models/multicloud_alert.rb', line 58

def alert_type
  @alert_type
end

#compartment_idString

Root Compartment The OCID (TenantId) associated with the alert.

Returns:

  • (String)


94
95
96
# File 'lib/oci/multicloud/models/multicloud_alert.rb', line 94

def compartment_id
  @compartment_id
end

#defined_tagsHash<String, Hash<String, Object>>

Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags.

Example: {\"Operations\": {\"CostCenter\": \"42\"}}

Returns:

  • (Hash<String, Hash<String, Object>>)


126
127
128
# File 'lib/oci/multicloud/models/multicloud_alert.rb', line 126

def defined_tags
  @defined_tags
end

#descriptionString

Description of the alert and its purpose.

Returns:

  • (String)


54
55
56
# File 'lib/oci/multicloud/models/multicloud_alert.rb', line 54

def description
  @description
end

#display_nameString

[Required] Human-readable name of the alert.

Returns:

  • (String)


50
51
52
# File 'lib/oci/multicloud/models/multicloud_alert.rb', line 50

def display_name
  @display_name
end

#freeform_tagsHash<String, String>

Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags.

Example: {\"Department\": \"Finance\"}

Returns:

  • (Hash<String, String>)


118
119
120
# File 'lib/oci/multicloud/models/multicloud_alert.rb', line 118

def freeform_tags
  @freeform_tags
end

#function_typeString

[Required] Internal service or function type generating the alert (e.g. ORP, ODBG_NETWORK, BILLING, OBSERVABILITY).

Returns:

  • (String)


98
99
100
# File 'lib/oci/multicloud/models/multicloud_alert.rb', line 98

def function_type
  @function_type
end

#idString

[Required] The OCID of the multicloud alert.

Returns:

  • (String)


46
47
48
# File 'lib/oci/multicloud/models/multicloud_alert.rb', line 46

def id
  @id
end

#lifecycle_stateString

The current state of the Multicloud Network Alert.

Returns:

  • (String)


110
111
112
# File 'lib/oci/multicloud/models/multicloud_alert.rb', line 110

def lifecycle_state
  @lifecycle_state
end

#resource_idString

The OCID of the affected resource.

Returns:

  • (String)


86
87
88
# File 'lib/oci/multicloud/models/multicloud_alert.rb', line 86

def resource_id
  @resource_id
end

#resource_typeString

Type of the affected resource (e.g. ADBD).

Returns:

  • (String)


90
91
92
# File 'lib/oci/multicloud/models/multicloud_alert.rb', line 90

def resource_type
  @resource_type
end

#severityString

[Required] Severity of the alert.

Returns:

  • (String)


62
63
64
# File 'lib/oci/multicloud/models/multicloud_alert.rb', line 62

def severity
  @severity
end

#sourceString

Source subsystem that generated the alert. (Azure Tag Validation)

Returns:

  • (String)


102
103
104
# File 'lib/oci/multicloud/models/multicloud_alert.rb', line 102

def source
  @source
end

#source_regionString

OCI region where the alert originated (e.g. us-phoenix-1)

Returns:

  • (String)


137
138
139
# File 'lib/oci/multicloud/models/multicloud_alert.rb', line 137

def source_region
  @source_region
end

#subscription_idString

The OCID of the multicloud subscription.

Returns:

  • (String)


66
67
68
# File 'lib/oci/multicloud/models/multicloud_alert.rb', line 66

def subscription_id
  @subscription_id
end

#subscription_typeString

Oracle Cloud Infrastructure Subscription Type.

Returns:

  • (String)


70
71
72
# File 'lib/oci/multicloud/models/multicloud_alert.rb', line 70

def subscription_type
  @subscription_type
end

#system_tagsHash<String, Hash<String, Object>>

System tags for this resource. Each key is predefined and scoped to a namespace.

Example: {\"orcl-cloud\": {\"free-tier-retained\": \"true\"}}

Returns:

  • (Hash<String, Hash<String, Object>>)


133
134
135
# File 'lib/oci/multicloud/models/multicloud_alert.rb', line 133

def system_tags
  @system_tags
end

#time_createdDateTime

[Required] Timestamp when the alert was created.

Returns:

  • (DateTime)


78
79
80
# File 'lib/oci/multicloud/models/multicloud_alert.rb', line 78

def time_created
  @time_created
end

#time_updatedDateTime

Timestamp when the alert was last updated.

Returns:

  • (DateTime)


82
83
84
# File 'lib/oci/multicloud/models/multicloud_alert.rb', line 82

def time_updated
  @time_updated
end

Class Method Details

.attribute_mapObject

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



144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# File 'lib/oci/multicloud/models/multicloud_alert.rb', line 144

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'display_name': :'displayName',
    'description': :'description',
    'alert_type': :'alertType',
    'severity': :'severity',
    'subscription_id': :'subscriptionId',
    'subscription_type': :'subscriptionType',
    'alert_status': :'alertStatus',
    'time_created': :'timeCreated',
    'time_updated': :'timeUpdated',
    'resource_id': :'resourceId',
    'resource_type': :'resourceType',
    'compartment_id': :'compartmentId',
    'function_type': :'functionType',
    'source': :'source',
    'alert_id': :'alertId',
    'lifecycle_state': :'lifecycleState',
    'freeform_tags': :'freeformTags',
    'defined_tags': :'definedTags',
    'system_tags': :'systemTags',
    'source_region': :'sourceRegion',
    'additional_parameters': :'additionalParameters'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
# File 'lib/oci/multicloud/models/multicloud_alert.rb', line 174

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'display_name': :'String',
    'description': :'String',
    'alert_type': :'String',
    'severity': :'String',
    'subscription_id': :'String',
    'subscription_type': :'String',
    'alert_status': :'String',
    'time_created': :'DateTime',
    'time_updated': :'DateTime',
    'resource_id': :'String',
    'resource_type': :'String',
    'compartment_id': :'String',
    'function_type': :'String',
    'source': :'String',
    'alert_id': :'String',
    'lifecycle_state': :'String',
    'freeform_tags': :'Hash<String, String>',
    'defined_tags': :'Hash<String, Hash<String, Object>>',
    'system_tags': :'Hash<String, Hash<String, Object>>',
    'source_region': :'String',
    'additional_parameters': :'Hash<String, 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



413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
# File 'lib/oci/multicloud/models/multicloud_alert.rb', line 413

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

  self.class == other.class &&
    id == other.id &&
    display_name == other.display_name &&
    description == other.description &&
    alert_type == other.alert_type &&
    severity == other.severity &&
    subscription_id == other.subscription_id &&
    subscription_type == other.subscription_type &&
    alert_status == other.alert_status &&
    time_created == other.time_created &&
    time_updated == other.time_updated &&
    resource_id == other.resource_id &&
    resource_type == other.resource_type &&
    compartment_id == other.compartment_id &&
    function_type == other.function_type &&
    source == other.source &&
    alert_id == other.alert_id &&
    lifecycle_state == other.lifecycle_state &&
    freeform_tags == other.freeform_tags &&
    defined_tags == other.defined_tags &&
    system_tags == other.system_tags &&
    source_region == other.source_region &&
    additional_parameters == other.additional_parameters
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



464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
# File 'lib/oci/multicloud/models/multicloud_alert.rb', line 464

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


444
445
446
# File 'lib/oci/multicloud/models/multicloud_alert.rb', line 444

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



453
454
455
# File 'lib/oci/multicloud/models/multicloud_alert.rb', line 453

def hash
  [id, display_name, description, alert_type, severity, subscription_id, subscription_type, alert_status, time_created, time_updated, resource_id, resource_type, compartment_id, function_type, source, alert_id, lifecycle_state, freeform_tags, defined_tags, system_tags, source_region, additional_parameters].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



497
498
499
500
501
502
503
504
505
506
# File 'lib/oci/multicloud/models/multicloud_alert.rb', line 497

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



491
492
493
# File 'lib/oci/multicloud/models/multicloud_alert.rb', line 491

def to_s
  to_hash.to_s
end