Class: OCI::Core::Models::ComputeHostConfigurationCheckDetails

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

Overview

Compute Host Group Configuration Details Check

Constant Summary collapse

TYPE_ENUM =
[
  TYPE_FIRMWARE = 'FIRMWARE'.freeze,
  TYPE_RECYCLE = 'RECYCLE'.freeze,
  TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
CONFIGURATION_STATE_ENUM =
[
  CONFIGURATION_STATE_CONFORMANT = 'CONFORMANT'.freeze,
  CONFIGURATION_STATE_NON_CONFORMANT = 'NON_CONFORMANT'.freeze,
  CONFIGURATION_STATE_CHECKING = 'CHECKING'.freeze,
  CONFIGURATION_STATE_PRE_APPLYING = 'PRE_APPLYING'.freeze,
  CONFIGURATION_STATE_APPLYING = 'APPLYING'.freeze,
  CONFIGURATION_STATE_UNKNOWN = 'UNKNOWN'.freeze,
  CONFIGURATION_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
RECYCLE_LEVEL_ENUM =
[
  RECYCLE_LEVEL_SKIP_RECYCLE = 'SKIP_RECYCLE'.freeze,
  RECYCLE_LEVEL_FULL_RECYCLE = 'FULL_RECYCLE'.freeze,
  RECYCLE_LEVEL_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ComputeHostConfigurationCheckDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :type (String)

    The value to assign to the #type property

  • :configuration_state (String)

    The value to assign to the #configuration_state property

  • :firmware_bundle_id (String)

    The value to assign to the #firmware_bundle_id property

  • :recycle_level (String)

    The value to assign to the #recycle_level property



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

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

  self.configuration_state = attributes[:'configurationState'] if attributes[:'configurationState']

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

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

  self.firmware_bundle_id = attributes[:'firmwareBundleId'] if attributes[:'firmwareBundleId']

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

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

  self.recycle_level = attributes[:'recycleLevel'] if attributes[:'recycleLevel']

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

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

Instance Attribute Details

#configuration_stateString

The current state of the host configuration. The Host is either | CONFORMANT - current state matches the desired configuration NON_CONFORMANT - current state does not match the desired configuration PRE_APPLYING, APPLYING, CHECKING- transitional states UNKNOWN - current state is unknown

Returns:

  • (String)


46
47
48
# File 'lib/oci/core/models/compute_host_configuration_check_details.rb', line 46

def configuration_state
  @configuration_state
end

#firmware_bundle_idString

The OCID for the Customer-unique firmware bundle associated with the Host Configuration.

Returns:

  • (String)


51
52
53
# File 'lib/oci/core/models/compute_host_configuration_check_details.rb', line 51

def firmware_bundle_id
  @firmware_bundle_id
end

#recycle_levelString

Preferred recycle level for hosts associated with the reservation config. * SKIP_RECYCLE - Skips host wipe. * FULL_RECYCLE - Does not skip host wipe. This is the default behavior.

Returns:

  • (String)


58
59
60
# File 'lib/oci/core/models/compute_host_configuration_check_details.rb', line 58

def recycle_level
  @recycle_level
end

#typeString

The type of configuration

Returns:

  • (String)


37
38
39
# File 'lib/oci/core/models/compute_host_configuration_check_details.rb', line 37

def type
  @type
end

Class Method Details

.attribute_mapObject

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



61
62
63
64
65
66
67
68
69
70
# File 'lib/oci/core/models/compute_host_configuration_check_details.rb', line 61

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'type': :'type',
    'configuration_state': :'configurationState',
    'firmware_bundle_id': :'firmwareBundleId',
    'recycle_level': :'recycleLevel'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



73
74
75
76
77
78
79
80
81
82
# File 'lib/oci/core/models/compute_host_configuration_check_details.rb', line 73

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'type': :'String',
    'configuration_state': :'String',
    'firmware_bundle_id': :'String',
    'recycle_level': :'String'
    # 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



167
168
169
170
171
172
173
174
175
# File 'lib/oci/core/models/compute_host_configuration_check_details.rb', line 167

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

  self.class == other.class &&
    type == other.type &&
    configuration_state == other.configuration_state &&
    firmware_bundle_id == other.firmware_bundle_id &&
    recycle_level == other.recycle_level
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



200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
# File 'lib/oci/core/models/compute_host_configuration_check_details.rb', line 200

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


180
181
182
# File 'lib/oci/core/models/compute_host_configuration_check_details.rb', line 180

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



189
190
191
# File 'lib/oci/core/models/compute_host_configuration_check_details.rb', line 189

def hash
  [type, configuration_state, firmware_bundle_id, recycle_level].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



233
234
235
236
237
238
239
240
241
242
# File 'lib/oci/core/models/compute_host_configuration_check_details.rb', line 233

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



227
228
229
# File 'lib/oci/core/models/compute_host_configuration_check_details.rb', line 227

def to_s
  to_hash.to_s
end