Class: OCI::LogAnalytics::Models::LogAnalyticsAssociation

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/log_analytics/models/log_analytics_association.rb

Overview

LogAnalyticsAssociation

Constant Summary collapse

LIFE_CYCLE_STATE_ENUM =
[
  LIFE_CYCLE_STATE_ACCEPTED = 'ACCEPTED'.freeze,
  LIFE_CYCLE_STATE_IN_PROGRESS = 'IN_PROGRESS'.freeze,
  LIFE_CYCLE_STATE_SUCCEEDED = 'SUCCEEDED'.freeze,
  LIFE_CYCLE_STATE_FAILED = 'FAILED'.freeze,
  LIFE_CYCLE_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 = {}) ⇒ LogAnalyticsAssociation

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



172
173
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
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
# File 'lib/oci/log_analytics/models/log_analytics_association.rb', line 172

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

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

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

  self.agent_id = attributes[:'agentId'] if attributes[:'agentId']

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

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

  self.time_last_attempted = attributes[:'timeLastAttempted'] if attributes[:'timeLastAttempted']

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

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

  self.retry_count = attributes[:'retryCount'] if attributes[:'retryCount']

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

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

  self.source_name = attributes[:'sourceName'] if attributes[:'sourceName']

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

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

  self.source_display_name = attributes[:'sourceDisplayName'] if attributes[:'sourceDisplayName']

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

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

  self.source_type_name = attributes[:'sourceTypeName'] if attributes[:'sourceTypeName']

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

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

  self.life_cycle_state = attributes[:'lifeCycleState'] if attributes[:'lifeCycleState']
  self.life_cycle_state = "SUCCEEDED" if life_cycle_state.nil? && !attributes.key?(:'lifeCycleState') # rubocop:disable Style/StringLiterals

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

  self.life_cycle_state = attributes[:'life_cycle_state'] if attributes[:'life_cycle_state']
  self.life_cycle_state = "SUCCEEDED" if life_cycle_state.nil? && !attributes.key?(:'lifeCycleState') && !attributes.key?(:'life_cycle_state') # rubocop:disable Style/StringLiterals

  self.entity_id = attributes[:'entityId'] if attributes[:'entityId']

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

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

  self.entity_name = attributes[:'entityName'] if attributes[:'entityName']

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

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

  self.entity_type_name = attributes[:'entityTypeName'] if attributes[:'entityTypeName']

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

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

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

  self.agent_entity_name = attributes[:'agentEntityName'] if attributes[:'agentEntityName']

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

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

  self.entity_type_display_name = attributes[:'entityTypeDisplayName'] if attributes[:'entityTypeDisplayName']

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

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

  self.log_group_id = attributes[:'logGroupId'] if attributes[:'logGroupId']

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

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

  self.log_group_name = attributes[:'logGroupName'] if attributes[:'logGroupName']

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

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

  self.log_group_compartment = attributes[:'logGroupCompartment'] if attributes[:'logGroupCompartment']

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

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

  self.association_properties = attributes[:'associationProperties'] if attributes[:'associationProperties']

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

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

Instance Attribute Details

#agent_entity_nameString

The name of the entity which contains the agent.

Returns:

  • (String)


74
75
76
# File 'lib/oci/log_analytics/models/log_analytics_association.rb', line 74

def agent_entity_name
  @agent_entity_name
end

#agent_idString

The agent unique identifier.

Returns:

  • (String)


26
27
28
# File 'lib/oci/log_analytics/models/log_analytics_association.rb', line 26

def agent_id
  @agent_id
end

#association_propertiesArray<OCI::LogAnalytics::Models::AssociationProperty>

A list of association properties.



94
95
96
# File 'lib/oci/log_analytics/models/log_analytics_association.rb', line 94

def association_properties
  @association_properties
end

#entity_idString

The entity unique identifier.

Returns:

  • (String)


58
59
60
# File 'lib/oci/log_analytics/models/log_analytics_association.rb', line 58

def entity_id
  @entity_id
end

#entity_nameString

The entity name.

Returns:

  • (String)


62
63
64
# File 'lib/oci/log_analytics/models/log_analytics_association.rb', line 62

def entity_name
  @entity_name
end

#entity_type_display_nameString

The entity type display name.

Returns:

  • (String)


78
79
80
# File 'lib/oci/log_analytics/models/log_analytics_association.rb', line 78

def entity_type_display_name
  @entity_type_display_name
end

#entity_type_nameString

The entity type internal name.

Returns:

  • (String)


66
67
68
# File 'lib/oci/log_analytics/models/log_analytics_association.rb', line 66

def entity_type_name
  @entity_type_name
end

#failure_messageString

The failure message.

Returns:

  • (String)


22
23
24
# File 'lib/oci/log_analytics/models/log_analytics_association.rb', line 22

def failure_message
  @failure_message
end

#hostString

The host name.

Returns:

  • (String)


70
71
72
# File 'lib/oci/log_analytics/models/log_analytics_association.rb', line 70

def host
  @host
end

#life_cycle_stateString

The lifecycle status. Valid values are ACCEPTED, IN_PROGRESS, SUCCEEDED or FAILED.

Returns:

  • (String)


54
55
56
# File 'lib/oci/log_analytics/models/log_analytics_association.rb', line 54

def life_cycle_state
  @life_cycle_state
end

#log_group_compartmentString

The log group compartment.

Returns:

  • (String)


90
91
92
# File 'lib/oci/log_analytics/models/log_analytics_association.rb', line 90

def log_group_compartment
  @log_group_compartment
end

#log_group_idString

The log group unique identifier.

Returns:

  • (String)


82
83
84
# File 'lib/oci/log_analytics/models/log_analytics_association.rb', line 82

def log_group_id
  @log_group_id
end

#log_group_nameString

The log group name.

Returns:

  • (String)


86
87
88
# File 'lib/oci/log_analytics/models/log_analytics_association.rb', line 86

def log_group_name
  @log_group_name
end

#retry_countInteger

The number of times the association will be attempted before failing.

Returns:

  • (Integer)


36
37
38
# File 'lib/oci/log_analytics/models/log_analytics_association.rb', line 36

def retry_count
  @retry_count
end

#source_display_nameString

The source display name.

Returns:

  • (String)


44
45
46
# File 'lib/oci/log_analytics/models/log_analytics_association.rb', line 44

def source_display_name
  @source_display_name
end

#source_nameString

The source name.

Returns:

  • (String)


40
41
42
# File 'lib/oci/log_analytics/models/log_analytics_association.rb', line 40

def source_name
  @source_name
end

#source_type_nameString

The source type internal name.

Returns:

  • (String)


48
49
50
# File 'lib/oci/log_analytics/models/log_analytics_association.rb', line 48

def source_type_name
  @source_type_name
end

#time_last_attemptedDateTime

The last attempt date.

Returns:

  • (DateTime)


30
31
32
# File 'lib/oci/log_analytics/models/log_analytics_association.rb', line 30

def time_last_attempted
  @time_last_attempted
end

Class Method Details

.attribute_mapObject

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



97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'lib/oci/log_analytics/models/log_analytics_association.rb', line 97

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'failure_message': :'failureMessage',
    'agent_id': :'agentId',
    'time_last_attempted': :'timeLastAttempted',
    'retry_count': :'retryCount',
    'source_name': :'sourceName',
    'source_display_name': :'sourceDisplayName',
    'source_type_name': :'sourceTypeName',
    'life_cycle_state': :'lifeCycleState',
    'entity_id': :'entityId',
    'entity_name': :'entityName',
    'entity_type_name': :'entityTypeName',
    'host': :'host',
    'agent_entity_name': :'agentEntityName',
    'entity_type_display_name': :'entityTypeDisplayName',
    'log_group_id': :'logGroupId',
    'log_group_name': :'logGroupName',
    'log_group_compartment': :'logGroupCompartment',
    'association_properties': :'associationProperties'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# File 'lib/oci/log_analytics/models/log_analytics_association.rb', line 123

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'failure_message': :'String',
    'agent_id': :'String',
    'time_last_attempted': :'DateTime',
    'retry_count': :'Integer',
    'source_name': :'String',
    'source_display_name': :'String',
    'source_type_name': :'String',
    'life_cycle_state': :'String',
    'entity_id': :'String',
    'entity_name': :'String',
    'entity_type_name': :'String',
    'host': :'String',
    'agent_entity_name': :'String',
    'entity_type_display_name': :'String',
    'log_group_id': :'String',
    'log_group_name': :'String',
    'log_group_compartment': :'String',
    'association_properties': :'Array<OCI::LogAnalytics::Models::AssociationProperty>'
    # 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



305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
# File 'lib/oci/log_analytics/models/log_analytics_association.rb', line 305

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

  self.class == other.class &&
    failure_message == other.failure_message &&
    agent_id == other.agent_id &&
    time_last_attempted == other.time_last_attempted &&
    retry_count == other.retry_count &&
    source_name == other.source_name &&
    source_display_name == other.source_display_name &&
    source_type_name == other.source_type_name &&
    life_cycle_state == other.life_cycle_state &&
    entity_id == other.entity_id &&
    entity_name == other.entity_name &&
    entity_type_name == other.entity_type_name &&
    host == other.host &&
    agent_entity_name == other.agent_entity_name &&
    entity_type_display_name == other.entity_type_display_name &&
    log_group_id == other.log_group_id &&
    log_group_name == other.log_group_name &&
    log_group_compartment == other.log_group_compartment &&
    association_properties == other.association_properties
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



352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
# File 'lib/oci/log_analytics/models/log_analytics_association.rb', line 352

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


332
333
334
# File 'lib/oci/log_analytics/models/log_analytics_association.rb', line 332

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



341
342
343
# File 'lib/oci/log_analytics/models/log_analytics_association.rb', line 341

def hash
  [failure_message, agent_id, time_last_attempted, retry_count, source_name, source_display_name, source_type_name, life_cycle_state, entity_id, entity_name, entity_type_name, host, agent_entity_name, entity_type_display_name, log_group_id, log_group_name, log_group_compartment, association_properties].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



385
386
387
388
389
390
391
392
393
394
# File 'lib/oci/log_analytics/models/log_analytics_association.rb', line 385

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



379
380
381
# File 'lib/oci/log_analytics/models/log_analytics_association.rb', line 379

def to_s
  to_hash.to_s
end