Class: OCI::Core::Models::HostGroupConfiguration

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

Overview

Host group configuration

Constant Summary collapse

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
STATE_ENUM =
[
  STATE_VALID = 'VALID'.freeze,
  STATE_INVALID = 'INVALID'.freeze,
  STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ HostGroupConfiguration

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :target (String)

    The value to assign to the #target 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

  • :state (String)

    The value to assign to the #state property



77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/oci/core/models/host_group_configuration.rb', line 77

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

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

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

Instance Attribute Details

#firmware_bundle_idString

The OCID for firmware bundle

Returns:

  • (String)


30
31
32
# File 'lib/oci/core/models/host_group_configuration.rb', line 30

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)


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

def recycle_level
  @recycle_level
end

#stateString

The state of the host group configuration.

Returns:

  • (String)


41
42
43
# File 'lib/oci/core/models/host_group_configuration.rb', line 41

def state
  @state
end

#targetString

Either the platform name or compute shape that the configuration is targeting

Returns:

  • (String)


26
27
28
# File 'lib/oci/core/models/host_group_configuration.rb', line 26

def target
  @target
end

Class Method Details

.attribute_mapObject

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



44
45
46
47
48
49
50
51
52
53
# File 'lib/oci/core/models/host_group_configuration.rb', line 44

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

.swagger_typesObject

Attribute type mapping.



56
57
58
59
60
61
62
63
64
65
# File 'lib/oci/core/models/host_group_configuration.rb', line 56

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



133
134
135
136
137
138
139
140
141
# File 'lib/oci/core/models/host_group_configuration.rb', line 133

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

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



166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
# File 'lib/oci/core/models/host_group_configuration.rb', line 166

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


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

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



155
156
157
# File 'lib/oci/core/models/host_group_configuration.rb', line 155

def hash
  [target, firmware_bundle_id, recycle_level, state].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



199
200
201
202
203
204
205
206
207
208
# File 'lib/oci/core/models/host_group_configuration.rb', line 199

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



193
194
195
# File 'lib/oci/core/models/host_group_configuration.rb', line 193

def to_s
  to_hash.to_s
end