Class: OCI::ManagementAgent::Models::ManagementAgent

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

Overview

The details of the Management Agent inventory including the associated plugins.

Constant Summary collapse

PLATFORM_TYPE_ENUM =
[
  PLATFORM_TYPE_LINUX = 'LINUX'.freeze,
  PLATFORM_TYPE_WINDOWS = 'WINDOWS'.freeze,
  PLATFORM_TYPE_SOLARIS = 'SOLARIS'.freeze,
  PLATFORM_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
AVAILABILITY_STATUS_ENUM =
[
  AVAILABILITY_STATUS_ACTIVE = 'ACTIVE'.freeze,
  AVAILABILITY_STATUS_SILENT = 'SILENT'.freeze,
  AVAILABILITY_STATUS_NOT_AVAILABLE = 'NOT_AVAILABLE'.freeze,
  AVAILABILITY_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_INACTIVE = 'INACTIVE'.freeze,
  LIFECYCLE_STATE_TERMINATED = 'TERMINATED'.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
INSTALL_TYPE_ENUM =
[
  INSTALL_TYPE_AGENT = 'AGENT'.freeze,
  INSTALL_TYPE_GATEWAY = 'GATEWAY'.freeze,
  INSTALL_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ManagementAgent

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
# File 'lib/oci/management_agent/models/management_agent.rb', line 242

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

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

  self.install_key_id = attributes[:'install_key_id'] if attributes[:'install_key_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.platform_type = attributes[:'platformType'] if attributes[:'platformType']

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

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

  self.platform_name = attributes[:'platformName'] if attributes[:'platformName']

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

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

  self.platform_version = attributes[:'platformVersion'] if attributes[:'platformVersion']

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

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

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

  self.resource_artifact_version = attributes[:'resourceArtifactVersion'] if attributes[:'resourceArtifactVersion']

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

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

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

  self.host_id = attributes[:'hostId'] if attributes[:'hostId']

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

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

  self.install_path = attributes[:'installPath'] if attributes[:'installPath']

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

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

  self.plugin_list = attributes[:'pluginList'] if attributes[:'pluginList']

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

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

  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.is_agent_auto_upgradable = attributes[:'isAgentAutoUpgradable'] unless attributes[:'isAgentAutoUpgradable'].nil?

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

  self.is_agent_auto_upgradable = attributes[:'is_agent_auto_upgradable'] unless attributes[:'is_agent_auto_upgradable'].nil?

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

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

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

  self.availability_status = attributes[:'availabilityStatus'] if attributes[:'availabilityStatus']

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

  self.availability_status = attributes[:'availability_status'] if attributes[:'availability_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.lifecycle_details = attributes[:'lifecycleDetails'] if attributes[:'lifecycleDetails']

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

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

  self.is_customer_deployed = attributes[:'isCustomerDeployed'] unless attributes[:'isCustomerDeployed'].nil?

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

  self.is_customer_deployed = attributes[:'is_customer_deployed'] unless attributes[:'is_customer_deployed'].nil?

  self.install_type = attributes[:'installType'] if attributes[:'installType']

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

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

  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']
end

Instance Attribute Details

#availability_statusString

The current availability status of managementAgent

Returns:

  • (String)


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

def availability_status
  @availability_status
end

#compartment_idString

**[Required]** Compartment Identifier

Returns:

  • (String)


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

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. Example: `{"bar-key": "value"}`

Returns:

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


146
147
148
# File 'lib/oci/management_agent/models/management_agent.rb', line 146

def defined_tags
  @defined_tags
end

#display_nameString

Management Agent Name

Returns:

  • (String)


53
54
55
# File 'lib/oci/management_agent/models/management_agent.rb', line 53

def display_name
  @display_name
end

#freeform_tagsHash<String, String>

Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `"value"`

Returns:

  • (Hash<String, String>)


140
141
142
# File 'lib/oci/management_agent/models/management_agent.rb', line 140

def freeform_tags
  @freeform_tags
end

#hostString

Management Agent host machine name

Returns:

  • (String)


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

def host
  @host
end

#host_idString

Host resource ocid

Returns:

  • (String)


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

def host_id
  @host_id
end

#idString

**[Required]** agent identifier

Returns:

  • (String)


45
46
47
# File 'lib/oci/management_agent/models/management_agent.rb', line 45

def id
  @id
end

#install_key_idString

agent install key identifier

Returns:

  • (String)


49
50
51
# File 'lib/oci/management_agent/models/management_agent.rb', line 49

def install_key_id
  @install_key_id
end

#install_pathString

Path where Management Agent is installed

Returns:

  • (String)


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

def install_path
  @install_path
end

#install_typeString

The install type, either AGENT or GATEWAY

Returns:

  • (String)


134
135
136
# File 'lib/oci/management_agent/models/management_agent.rb', line 134

def install_type
  @install_type
end

#is_agent_auto_upgradableBOOLEAN

true if the agent can be upgraded automatically; false if it must be upgraded manually. This flag is derived from the tenancy level auto upgrade preference.

Returns:

  • (BOOLEAN)


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

def is_agent_auto_upgradable
  @is_agent_auto_upgradable
end

#is_customer_deployedBOOLEAN

true, if the agent image is manually downloaded and installed. false, if the agent is deployed as a plugin in Oracle Cloud Agent.

Returns:

  • (BOOLEAN)


130
131
132
# File 'lib/oci/management_agent/models/management_agent.rb', line 130

def is_customer_deployed
  @is_customer_deployed
end

#lifecycle_detailsString

A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in Failed state.

Returns:

  • (String)


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

def lifecycle_details
  @lifecycle_details
end

#lifecycle_stateString

The current state of managementAgent

Returns:

  • (String)


122
123
124
# File 'lib/oci/management_agent/models/management_agent.rb', line 122

def lifecycle_state
  @lifecycle_state
end

#platform_nameString

Platform Name

Returns:

  • (String)


61
62
63
# File 'lib/oci/management_agent/models/management_agent.rb', line 61

def platform_name
  @platform_name
end

#platform_typeString

Platform Type

Returns:

  • (String)


57
58
59
# File 'lib/oci/management_agent/models/management_agent.rb', line 57

def platform_type
  @platform_type
end

#platform_versionString

Platform Version

Returns:

  • (String)


65
66
67
# File 'lib/oci/management_agent/models/management_agent.rb', line 65

def platform_version
  @platform_version
end

#plugin_listArray<OCI::ManagementAgent::Models::ManagementAgentPluginDetails>

list of managementAgentPlugins associated with the agent



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

def plugin_list
  @plugin_list
end

#resource_artifact_versionString

Version of the deployment artifact instantiated by this Management Agent. The format for Standalone resourceMode is YYMMDD.HHMM, and the format for other modes (whose artifacts are based upon Standalone but can advance independently) is YYMMDD.HHMM.VVVVVVVVVVVV. VVVVVVVVVVVV is always a numeric value between 000000000000 and 999999999999

Returns:

  • (String)


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

def resource_artifact_version
  @resource_artifact_version
end

#time_createdDateTime

The time the Management Agent was created. An RFC3339 formatted datetime string

Returns:

  • (DateTime)


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

def time_created
  @time_created
end

#time_last_heartbeatDateTime

The time the Management Agent has last recorded its health status in telemetry. This value will be null if the agent has not recorded its health status in last 7 days. An RFC3339 formatted datetime string

Returns:

  • (DateTime)


114
115
116
# File 'lib/oci/management_agent/models/management_agent.rb', line 114

def time_last_heartbeat
  @time_last_heartbeat
end

#time_updatedDateTime

The time the Management Agent was updated. An RFC3339 formatted datetime string

Returns:

  • (DateTime)


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

def time_updated
  @time_updated
end

#versionString

**[Required]** Management Agent Version

Returns:

  • (String)


69
70
71
# File 'lib/oci/management_agent/models/management_agent.rb', line 69

def version
  @version
end

Class Method Details

.attribute_mapObject

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



149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# File 'lib/oci/management_agent/models/management_agent.rb', line 149

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'install_key_id': :'installKeyId',
    'display_name': :'displayName',
    'platform_type': :'platformType',
    'platform_name': :'platformName',
    'platform_version': :'platformVersion',
    'version': :'version',
    'resource_artifact_version': :'resourceArtifactVersion',
    'host': :'host',
    'host_id': :'hostId',
    'install_path': :'installPath',
    'plugin_list': :'pluginList',
    'compartment_id': :'compartmentId',
    'is_agent_auto_upgradable': :'isAgentAutoUpgradable',
    'time_created': :'timeCreated',
    'time_updated': :'timeUpdated',
    'time_last_heartbeat': :'timeLastHeartbeat',
    'availability_status': :'availabilityStatus',
    'lifecycle_state': :'lifecycleState',
    'lifecycle_details': :'lifecycleDetails',
    'is_customer_deployed': :'isCustomerDeployed',
    'install_type': :'installType',
    'freeform_tags': :'freeformTags',
    'defined_tags': :'definedTags'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



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
# File 'lib/oci/management_agent/models/management_agent.rb', line 181

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'install_key_id': :'String',
    'display_name': :'String',
    'platform_type': :'String',
    'platform_name': :'String',
    'platform_version': :'String',
    'version': :'String',
    'resource_artifact_version': :'String',
    'host': :'String',
    'host_id': :'String',
    'install_path': :'String',
    'plugin_list': :'Array<OCI::ManagementAgent::Models::ManagementAgentPluginDetails>',
    'compartment_id': :'String',
    'is_agent_auto_upgradable': :'BOOLEAN',
    'time_created': :'DateTime',
    'time_updated': :'DateTime',
    'time_last_heartbeat': :'DateTime',
    'availability_status': :'String',
    'lifecycle_state': :'String',
    'lifecycle_details': :'String',
    'is_customer_deployed': :'BOOLEAN',
    'install_type': :'String',
    'freeform_tags': :'Hash<String, String>',
    'defined_tags': :'Hash<String, Hash<String, Object>>'
    # 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



440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
# File 'lib/oci/management_agent/models/management_agent.rb', line 440

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

  self.class == other.class &&
    id == other.id &&
    install_key_id == other.install_key_id &&
    display_name == other.display_name &&
    platform_type == other.platform_type &&
    platform_name == other.platform_name &&
    platform_version == other.platform_version &&
    version == other.version &&
    resource_artifact_version == other.resource_artifact_version &&
    host == other.host &&
    host_id == other.host_id &&
    install_path == other.install_path &&
    plugin_list == other.plugin_list &&
    compartment_id == other.compartment_id &&
    is_agent_auto_upgradable == other.is_agent_auto_upgradable &&
    time_created == other.time_created &&
    time_updated == other.time_updated &&
    time_last_heartbeat == other.time_last_heartbeat &&
    availability_status == other.availability_status &&
    lifecycle_state == other.lifecycle_state &&
    lifecycle_details == other.lifecycle_details &&
    is_customer_deployed == other.is_customer_deployed &&
    install_type == other.install_type &&
    freeform_tags == other.freeform_tags &&
    defined_tags == other.defined_tags
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



493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
# File 'lib/oci/management_agent/models/management_agent.rb', line 493

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


473
474
475
# File 'lib/oci/management_agent/models/management_agent.rb', line 473

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



482
483
484
# File 'lib/oci/management_agent/models/management_agent.rb', line 482

def hash
  [id, install_key_id, display_name, platform_type, platform_name, platform_version, version, resource_artifact_version, host, host_id, install_path, plugin_list, compartment_id, is_agent_auto_upgradable, time_created, time_updated, time_last_heartbeat, availability_status, lifecycle_state, lifecycle_details, is_customer_deployed, install_type, freeform_tags, defined_tags].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



526
527
528
529
530
531
532
533
534
535
# File 'lib/oci/management_agent/models/management_agent.rb', line 526

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



520
521
522
# File 'lib/oci/management_agent/models/management_agent.rb', line 520

def to_s
  to_hash.to_s
end