Class: OCI::OsManagement::Models::ManagedInstanceSummary

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

Overview

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 = {}) ⇒ ManagedInstanceSummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :display_name (String)

    The value to assign to the #display_name property

  • :id (String)

    The value to assign to the #id property

  • :last_checkin (String)

    The value to assign to the #last_checkin property

  • :last_boot (String)

    The value to assign to the #last_boot property

  • :updates_available (Integer)

    The value to assign to the #updates_available property

  • :compartment_id (String)

    The value to assign to the #compartment_id property

  • :description (String)

    The value to assign to the #description property

  • :status (String)

    The value to assign to the #status property

  • :os_family (String)

    The value to assign to the #os_family property

  • :is_reboot_required (BOOLEAN)

    The value to assign to the #is_reboot_required property



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

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

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

  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?
end

Instance Attribute Details

#compartment_idString

[Required] OCID for the Compartment

Returns:

  • (String)


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

def compartment_id
  @compartment_id
end

#descriptionString

Information specified by the user about the managed instance

Returns:

  • (String)


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

def description
  @description
end

#display_nameString

[Required] user settable name

Returns:

  • (String)


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

def display_name
  @display_name
end

#idString

[Required] OCID for the managed instance

Returns:

  • (String)


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

def id
  @id
end

#is_reboot_requiredBOOLEAN

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

Returns:

  • (BOOLEAN)


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

def is_reboot_required
  @is_reboot_required
end

#last_bootString

Time at which the instance last booted

Returns:

  • (String)


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

def last_boot
  @last_boot
end

#last_checkinString

Time at which the instance last checked in

Returns:

  • (String)


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

def last_checkin
  @last_checkin
end

#os_familyString

The Operating System type of the managed instance.

Returns:

  • (String)


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

def os_family
  @os_family
end

#statusString

status of the managed instance.

Returns:

  • (String)


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

def status
  @status
end

#updates_availableInteger

Number of updates available to be installed

Returns:

  • (Integer)


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

def updates_available
  @updates_available
end

Class Method Details

.attribute_mapObject

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



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/oci/os_management/models/managed_instance_summary.rb', line 68

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'display_name': :'displayName',
    'id': :'id',
    'last_checkin': :'lastCheckin',
    'last_boot': :'lastBoot',
    'updates_available': :'updatesAvailable',
    'compartment_id': :'compartmentId',
    'description': :'description',
    'status': :'status',
    'os_family': :'osFamily',
    'is_reboot_required': :'isRebootRequired'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/oci/os_management/models/managed_instance_summary.rb', line 86

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'display_name': :'String',
    'id': :'String',
    'last_checkin': :'String',
    'last_boot': :'String',
    'updates_available': :'Integer',
    'compartment_id': :'String',
    'description': :'String',
    'status': :'String',
    'os_family': :'String',
    'is_reboot_required': :'BOOLEAN'
    # 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



207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
# File 'lib/oci/os_management/models/managed_instance_summary.rb', line 207

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

  self.class == other.class &&
    display_name == other.display_name &&
    id == other.id &&
    last_checkin == other.last_checkin &&
    last_boot == other.last_boot &&
    updates_available == other.updates_available &&
    compartment_id == other.compartment_id &&
    description == other.description &&
    status == other.status &&
    os_family == other.os_family &&
    is_reboot_required == other.is_reboot_required
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



246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
# File 'lib/oci/os_management/models/managed_instance_summary.rb', line 246

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


226
227
228
# File 'lib/oci/os_management/models/managed_instance_summary.rb', line 226

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



235
236
237
# File 'lib/oci/os_management/models/managed_instance_summary.rb', line 235

def hash
  [display_name, id, last_checkin, last_boot, updates_available, compartment_id, description, status, os_family, is_reboot_required].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



279
280
281
282
283
284
285
286
287
288
# File 'lib/oci/os_management/models/managed_instance_summary.rb', line 279

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



273
274
275
# File 'lib/oci/os_management/models/managed_instance_summary.rb', line 273

def to_s
  to_hash.to_s
end