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):



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

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.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

#bug_updates_availableInteger

Number of bug fix type updates available to be installed

Returns:

  • (Integer)


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

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



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

def child_software_sources
  @child_software_sources
end

#compartment_idString

[Required] OCID for the Compartment

Returns:

  • (String)


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

def compartment_id
  @compartment_id
end

#descriptionString

Information specified by the user about the managed instance

Returns:

  • (String)


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

def description
  @description
end

#display_nameString

[Required] Managed Instance identifier

Returns:

  • (String)


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

def display_name
  @display_name
end

#enhancement_updates_availableInteger

Number of enhancement type updates available to be installed

Returns:

  • (Integer)


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

def enhancement_updates_available
  @enhancement_updates_available
end

#idString

[Required] OCID for the managed instance

Returns:

  • (String)


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

def id
  @id
end

#is_reboot_requiredBOOLEAN

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

Returns:

  • (BOOLEAN)


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

def is_reboot_required
  @is_reboot_required
end

#last_bootString

Time at which the instance last booted

Returns:

  • (String)


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

def last_boot
  @last_boot
end

#last_checkinString

Time at which the instance last checked in

Returns:

  • (String)


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

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:

  • (Array<OCI::OsManagement::Models::Id>)


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

def managed_instance_groups
  @managed_instance_groups
end

#os_familyString

The Operating System type of the managed instance.

Returns:

  • (String)


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

def os_family
  @os_family
end

#os_kernel_versionString

Operating System Kernel Version

Returns:

  • (String)


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

def os_kernel_version
  @os_kernel_version
end

#os_nameString

Operating System Name

Returns:

  • (String)


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

def os_name
  @os_name
end

#os_versionString

Operating System Version

Returns:

  • (String)


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

def os_version
  @os_version
end

#other_updates_availableInteger

Number of non-classified updates available to be installed

Returns:

  • (Integer)


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

def other_updates_available
  @other_updates_available
end

#parent_software_sourceOCI::OsManagement::Models::SoftwareSourceId

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



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

def parent_software_source
  @parent_software_source
end

#scheduled_job_countInteger

Number of scheduled jobs associated with this instance

Returns:

  • (Integer)


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

def scheduled_job_count
  @scheduled_job_count
end

#security_updates_availableInteger

Number of security type updates available to be installed

Returns:

  • (Integer)


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

def security_updates_available
  @security_updates_available
end

#statusString

status of the managed instance.

Returns:

  • (String)


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

def status
  @status
end

#updates_availableInteger

Number of updates available to be installed

Returns:

  • (Integer)


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

def updates_available
  @updates_available
end

#work_request_countInteger

Number of work requests associated with this instance

Returns:

  • (Integer)


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

def work_request_count
  @work_request_count
end

Class Method Details

.attribute_mapObject

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



117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# File 'lib/oci/os_management/models/managed_instance.rb', line 117

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',
    '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.



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

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',
    '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



364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
# File 'lib/oci/os_management/models/managed_instance.rb', line 364

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 &&
    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



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

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


395
396
397
# File 'lib/oci/os_management/models/managed_instance.rb', line 395

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



404
405
406
# File 'lib/oci/os_management/models/managed_instance.rb', line 404

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, 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



448
449
450
451
452
453
454
455
456
457
# File 'lib/oci/os_management/models/managed_instance.rb', line 448

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



442
443
444
# File 'lib/oci/os_management/models/managed_instance.rb', line 442

def to_s
  to_hash.to_s
end