Class: OCI::OsManagement::Models::ManagedInstance

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

Overview

Detail information for an OCI Compute instance that is being managed

Constant Summary collapse

STATUS_ENUM =
[
  STATUS_NORMAL = 'NORMAL'.freeze,
  STATUS_UNREACHABLE = 'UNREACHABLE'.freeze,
  STATUS_ERROR = 'ERROR'.freeze,
  STATUS_WARNING = 'WARNING'.freeze,
  STATUS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
OS_FAMILY_ENUM =
[
  OS_FAMILY_LINUX = 'LINUX'.freeze,
  OS_FAMILY_WINDOWS = 'WINDOWS'.freeze,
  OS_FAMILY_ALL = 'ALL'.freeze,
  OS_FAMILY_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ManagedInstance

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
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
# File 'lib/oci/os_management/models/managed_instance.rb', line 233

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

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

  self.last_checkin = attributes[:'lastCheckin'] if attributes[:'lastCheckin']

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

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

  self.last_boot = attributes[:'lastBoot'] if attributes[:'lastBoot']

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

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

  self.updates_available = attributes[:'updatesAvailable'] if attributes[:'updatesAvailable']

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

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

  self.os_name = attributes[:'osName'] if attributes[:'osName']

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

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

  self.os_version = attributes[:'osVersion'] if attributes[:'osVersion']

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

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

  self.os_kernel_version = attributes[:'osKernelVersion'] if attributes[:'osKernelVersion']

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

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

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

  self.parent_software_source = attributes[:'parentSoftwareSource'] if attributes[:'parentSoftwareSource']

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

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

  self.child_software_sources = attributes[:'childSoftwareSources'] if attributes[:'childSoftwareSources']

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

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

  self.managed_instance_groups = attributes[:'managedInstanceGroups'] if attributes[:'managedInstanceGroups']

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

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

  self.os_family = attributes[:'osFamily'] if attributes[:'osFamily']

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

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

  self.is_reboot_required = attributes[:'isRebootRequired'] unless attributes[:'isRebootRequired'].nil?

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

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

  self.notification_topic_id = attributes[:'notificationTopicId'] if attributes[:'notificationTopicId']

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

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

  self.ksplice_effective_kernel_version = attributes[:'kspliceEffectiveKernelVersion'] if attributes[:'kspliceEffectiveKernelVersion']

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

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

  self.is_data_collection_authorized = attributes[:'isDataCollectionAuthorized'] unless attributes[:'isDataCollectionAuthorized'].nil?

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

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

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

  self.security_updates_available = attributes[:'securityUpdatesAvailable'] if attributes[:'securityUpdatesAvailable']

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

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

  self.bug_updates_available = attributes[:'bugUpdatesAvailable'] if attributes[:'bugUpdatesAvailable']

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

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

  self.enhancement_updates_available = attributes[:'enhancementUpdatesAvailable'] if attributes[:'enhancementUpdatesAvailable']

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

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

  self.other_updates_available = attributes[:'otherUpdatesAvailable'] if attributes[:'otherUpdatesAvailable']

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

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

  self.scheduled_job_count = attributes[:'scheduledJobCount'] if attributes[:'scheduledJobCount']

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

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

  self.work_request_count = attributes[:'workRequestCount'] if attributes[:'workRequestCount']

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

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

Instance Attribute Details

#autonomousOCI::OsManagement::Models::AutonomousSettings

if present, indicates the Managed Instance is an autonomous instance. Holds all the Autonomous specific information



107
108
109
# File 'lib/oci/os_management/models/managed_instance.rb', line 107

def autonomous
  @autonomous
end

#bug_updates_availableInteger

Number of bug fix type updates available to be installed

Returns:

  • (Integer)


115
116
117
# File 'lib/oci/os_management/models/managed_instance.rb', line 115

def bug_updates_available
  @bug_updates_available
end

#child_software_sourcesArray<OCI::OsManagement::Models::SoftwareSourceId>

list of child Software Sources attached to the Managed Instance



77
78
79
# File 'lib/oci/os_management/models/managed_instance.rb', line 77

def child_software_sources
  @child_software_sources
end

#compartment_idString

[Required] OCID for the Compartment

Returns:

  • (String)


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

def compartment_id
  @compartment_id
end

#descriptionString

Information specified by the user about the managed instance

Returns:

  • (String)


37
38
39
# File 'lib/oci/os_management/models/managed_instance.rb', line 37

def description
  @description
end

#display_nameString

[Required] Managed Instance identifier

Returns:

  • (String)


29
30
31
# File 'lib/oci/os_management/models/managed_instance.rb', line 29

def display_name
  @display_name
end

#enhancement_updates_availableInteger

Number of enhancement type updates available to be installed

Returns:

  • (Integer)


119
120
121
# File 'lib/oci/os_management/models/managed_instance.rb', line 119

def enhancement_updates_available
  @enhancement_updates_available
end

#idString

[Required] OCID for the managed instance

Returns:

  • (String)


33
34
35
# File 'lib/oci/os_management/models/managed_instance.rb', line 33

def id
  @id
end

#is_data_collection_authorizedBOOLEAN

True if user allow data collection for this instance

Returns:

  • (BOOLEAN)


103
104
105
# File 'lib/oci/os_management/models/managed_instance.rb', line 103

def is_data_collection_authorized
  @is_data_collection_authorized
end

#is_reboot_requiredBOOLEAN

Indicates whether a reboot is required to complete installation of updates.

Returns:

  • (BOOLEAN)


91
92
93
# File 'lib/oci/os_management/models/managed_instance.rb', line 91

def is_reboot_required
  @is_reboot_required
end

#ksplice_effective_kernel_versionString

The ksplice effective kernel version

Returns:

  • (String)


99
100
101
# File 'lib/oci/os_management/models/managed_instance.rb', line 99

def ksplice_effective_kernel_version
  @ksplice_effective_kernel_version
end

#last_bootString

Time at which the instance last booted

Returns:

  • (String)


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

def last_boot
  @last_boot
end

#last_checkinString

Time at which the instance last checked in

Returns:

  • (String)


41
42
43
# File 'lib/oci/os_management/models/managed_instance.rb', line 41

def last_checkin
  @last_checkin
end

#managed_instance_groupsArray<OCI::OsManagement::Models::Id>

The ids of the managed instance groups of which this instance is a member.

Returns:



83
84
85
# File 'lib/oci/os_management/models/managed_instance.rb', line 83

def managed_instance_groups
  @managed_instance_groups
end

#notification_topic_idString

OCID of the ONS topic used to send notification to users

Returns:

  • (String)


95
96
97
# File 'lib/oci/os_management/models/managed_instance.rb', line 95

def notification_topic_id
  @notification_topic_id
end

#os_familyString

The Operating System type of the managed instance.

Returns:

  • (String)


87
88
89
# File 'lib/oci/os_management/models/managed_instance.rb', line 87

def os_family
  @os_family
end

#os_kernel_versionString

Operating System Kernel Version

Returns:

  • (String)


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

def os_kernel_version
  @os_kernel_version
end

#os_nameString

Operating System Name

Returns:

  • (String)


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

def os_name
  @os_name
end

#os_versionString

Operating System Version

Returns:

  • (String)


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

def os_version
  @os_version
end

#other_updates_availableInteger

Number of non-classified updates available to be installed

Returns:

  • (Integer)


123
124
125
# File 'lib/oci/os_management/models/managed_instance.rb', line 123

def other_updates_available
  @other_updates_available
end

#parent_software_sourceOCI::OsManagement::Models::SoftwareSourceId

the parent (base) Software Source attached to the Managed Instance



73
74
75
# File 'lib/oci/os_management/models/managed_instance.rb', line 73

def parent_software_source
  @parent_software_source
end

#scheduled_job_countInteger

Number of scheduled jobs associated with this instance

Returns:

  • (Integer)


127
128
129
# File 'lib/oci/os_management/models/managed_instance.rb', line 127

def scheduled_job_count
  @scheduled_job_count
end

#security_updates_availableInteger

Number of security type updates available to be installed

Returns:

  • (Integer)


111
112
113
# File 'lib/oci/os_management/models/managed_instance.rb', line 111

def security_updates_available
  @security_updates_available
end

#statusString

status of the managed instance.

Returns:

  • (String)


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

def status
  @status
end

#updates_availableInteger

Number of updates available to be installed

Returns:

  • (Integer)


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

def updates_available
  @updates_available
end

#work_request_countInteger

Number of work requests associated with this instance

Returns:

  • (Integer)


131
132
133
# File 'lib/oci/os_management/models/managed_instance.rb', line 131

def work_request_count
  @work_request_count
end

Class Method Details

.attribute_mapObject

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



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
159
160
161
162
163
164
165
# File 'lib/oci/os_management/models/managed_instance.rb', line 134

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'display_name': :'displayName',
    'id': :'id',
    'description': :'description',
    'last_checkin': :'lastCheckin',
    'last_boot': :'lastBoot',
    'updates_available': :'updatesAvailable',
    'os_name': :'osName',
    'os_version': :'osVersion',
    'os_kernel_version': :'osKernelVersion',
    'compartment_id': :'compartmentId',
    'status': :'status',
    'parent_software_source': :'parentSoftwareSource',
    'child_software_sources': :'childSoftwareSources',
    'managed_instance_groups': :'managedInstanceGroups',
    'os_family': :'osFamily',
    'is_reboot_required': :'isRebootRequired',
    'notification_topic_id': :'notificationTopicId',
    'ksplice_effective_kernel_version': :'kspliceEffectiveKernelVersion',
    'is_data_collection_authorized': :'isDataCollectionAuthorized',
    'autonomous': :'autonomous',
    'security_updates_available': :'securityUpdatesAvailable',
    'bug_updates_available': :'bugUpdatesAvailable',
    'enhancement_updates_available': :'enhancementUpdatesAvailable',
    'other_updates_available': :'otherUpdatesAvailable',
    'scheduled_job_count': :'scheduledJobCount',
    'work_request_count': :'workRequestCount'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



168
169
170
171
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
# File 'lib/oci/os_management/models/managed_instance.rb', line 168

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'display_name': :'String',
    'id': :'String',
    'description': :'String',
    'last_checkin': :'String',
    'last_boot': :'String',
    'updates_available': :'Integer',
    'os_name': :'String',
    'os_version': :'String',
    'os_kernel_version': :'String',
    'compartment_id': :'String',
    'status': :'String',
    'parent_software_source': :'OCI::OsManagement::Models::SoftwareSourceId',
    'child_software_sources': :'Array<OCI::OsManagement::Models::SoftwareSourceId>',
    'managed_instance_groups': :'Array<OCI::OsManagement::Models::Id>',
    'os_family': :'String',
    'is_reboot_required': :'BOOLEAN',
    'notification_topic_id': :'String',
    'ksplice_effective_kernel_version': :'String',
    'is_data_collection_authorized': :'BOOLEAN',
    'autonomous': :'OCI::OsManagement::Models::AutonomousSettings',
    'security_updates_available': :'Integer',
    'bug_updates_available': :'Integer',
    'enhancement_updates_available': :'Integer',
    'other_updates_available': :'Integer',
    'scheduled_job_count': :'Integer',
    'work_request_count': :'Integer'
    # 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
440
441
442
443
# File 'lib/oci/os_management/models/managed_instance.rb', line 413

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

  self.class == other.class &&
    display_name == other.display_name &&
    id == other.id &&
    description == other.description &&
    last_checkin == other.last_checkin &&
    last_boot == other.last_boot &&
    updates_available == other.updates_available &&
    os_name == other.os_name &&
    os_version == other.os_version &&
    os_kernel_version == other.os_kernel_version &&
    compartment_id == other.compartment_id &&
    status == other.status &&
    parent_software_source == other.parent_software_source &&
    child_software_sources == other.child_software_sources &&
    managed_instance_groups == other.managed_instance_groups &&
    os_family == other.os_family &&
    is_reboot_required == other.is_reboot_required &&
    notification_topic_id == other.notification_topic_id &&
    ksplice_effective_kernel_version == other.ksplice_effective_kernel_version &&
    is_data_collection_authorized == other.is_data_collection_authorized &&
    autonomous == other.autonomous &&
    security_updates_available == other.security_updates_available &&
    bug_updates_available == other.bug_updates_available &&
    enhancement_updates_available == other.enhancement_updates_available &&
    other_updates_available == other.other_updates_available &&
    scheduled_job_count == other.scheduled_job_count &&
    work_request_count == other.work_request_count
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



468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
# File 'lib/oci/os_management/models/managed_instance.rb', line 468

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


448
449
450
# File 'lib/oci/os_management/models/managed_instance.rb', line 448

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



457
458
459
# File 'lib/oci/os_management/models/managed_instance.rb', line 457

def hash
  [display_name, id, description, last_checkin, last_boot, updates_available, os_name, os_version, os_kernel_version, compartment_id, status, parent_software_source, child_software_sources, managed_instance_groups, os_family, is_reboot_required, notification_topic_id, ksplice_effective_kernel_version, is_data_collection_authorized, autonomous, security_updates_available, bug_updates_available, enhancement_updates_available, other_updates_available, scheduled_job_count, work_request_count].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



501
502
503
504
505
506
507
508
509
510
# File 'lib/oci/os_management/models/managed_instance.rb', line 501

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



495
496
497
# File 'lib/oci/os_management/models/managed_instance.rb', line 495

def to_s
  to_hash.to_s
end