Class: OCI::ContainerEngine::Models::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/container_engine/models/node.rb

Overview

The properties that define a node.

Constant Summary collapse

LIFECYCLE_STATE_ENUM =
[
  LIFECYCLE_STATE_CREATING = 'CREATING'.freeze,
  LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze,
  LIFECYCLE_STATE_UPDATING = 'UPDATING'.freeze,
  LIFECYCLE_STATE_DELETING = 'DELETING'.freeze,
  LIFECYCLE_STATE_DELETED = 'DELETED'.freeze,
  LIFECYCLE_STATE_FAILING = 'FAILING'.freeze,
  LIFECYCLE_STATE_INACTIVE = 'INACTIVE'.freeze,
  LIFECYCLE_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 = {}) ⇒ Node

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :id (String)

    The value to assign to the #id property

  • :name (String)

    The value to assign to the #name property

  • :availability_domain (String)

    The value to assign to the #availability_domain property

  • :subnet_id (String)

    The value to assign to the #subnet_id property

  • :node_pool_id (String)

    The value to assign to the #node_pool_id property

  • :fault_domain (String)

    The value to assign to the #fault_domain property

  • :private_ip (String)

    The value to assign to the #private_ip property

  • :public_ip (String)

    The value to assign to the #public_ip property

  • :node_error (OCI::ContainerEngine::Models::NodeError)

    The value to assign to the #node_error property

  • :lifecycle_state (String)

    The value to assign to the #lifecycle_state property

  • :lifecycle_details (String)

    The value to assign to the #lifecycle_details property



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
173
174
175
176
177
178
179
180
181
182
183
184
# File 'lib/oci/container_engine/models/node.rb', line 121

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

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

  self.availability_domain = attributes[:'availabilityDomain'] if attributes[:'availabilityDomain']

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

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

  self.subnet_id = attributes[:'subnetId'] if attributes[:'subnetId']

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

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

  self.node_pool_id = attributes[:'nodePoolId'] if attributes[:'nodePoolId']

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

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

  self.fault_domain = attributes[:'faultDomain'] if attributes[:'faultDomain']

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

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

  self.private_ip = attributes[:'privateIp'] if attributes[:'privateIp']

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

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

  self.public_ip = attributes[:'publicIp'] if attributes[:'publicIp']

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

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

  self.node_error = attributes[:'nodeError'] if attributes[:'nodeError']

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

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

  self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState']

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

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

  self.lifecycle_details = attributes[:'lifecycleDetails'] if attributes[:'lifecycleDetails']

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

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

Instance Attribute Details

#availability_domainString

The name of the availability domain in which this node is placed.

Returns:

  • (String)


32
33
34
# File 'lib/oci/container_engine/models/node.rb', line 32

def availability_domain
  @availability_domain
end

#fault_domainString

The fault domain of this node.

Returns:

  • (String)


44
45
46
# File 'lib/oci/container_engine/models/node.rb', line 44

def fault_domain
  @fault_domain
end

#idString

The OCID of the compute instance backing this node.

Returns:

  • (String)


24
25
26
# File 'lib/oci/container_engine/models/node.rb', line 24

def id
  @id
end

#lifecycle_detailsString

Details about the state of the node.

Returns:

  • (String)


64
65
66
# File 'lib/oci/container_engine/models/node.rb', line 64

def lifecycle_details
  @lifecycle_details
end

#lifecycle_stateString

The state of the node.

Returns:

  • (String)


60
61
62
# File 'lib/oci/container_engine/models/node.rb', line 60

def lifecycle_state
  @lifecycle_state
end

#nameString

The name of the node.

Returns:

  • (String)


28
29
30
# File 'lib/oci/container_engine/models/node.rb', line 28

def name
  @name
end

#node_errorOCI::ContainerEngine::Models::NodeError

An error that may be associated with the node.



56
57
58
# File 'lib/oci/container_engine/models/node.rb', line 56

def node_error
  @node_error
end

#node_pool_idString

The OCID of the node pool to which this node belongs.

Returns:

  • (String)


40
41
42
# File 'lib/oci/container_engine/models/node.rb', line 40

def node_pool_id
  @node_pool_id
end

#private_ipString

The private IP address of this node.

Returns:

  • (String)


48
49
50
# File 'lib/oci/container_engine/models/node.rb', line 48

def private_ip
  @private_ip
end

#public_ipString

The public IP address of this node.

Returns:

  • (String)


52
53
54
# File 'lib/oci/container_engine/models/node.rb', line 52

def public_ip
  @public_ip
end

#subnet_idString

The OCID of the subnet in which this node is placed.

Returns:

  • (String)


36
37
38
# File 'lib/oci/container_engine/models/node.rb', line 36

def subnet_id
  @subnet_id
end

Class Method Details

.attribute_mapObject

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



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

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'name': :'name',
    'availability_domain': :'availabilityDomain',
    'subnet_id': :'subnetId',
    'node_pool_id': :'nodePoolId',
    'fault_domain': :'faultDomain',
    'private_ip': :'privateIp',
    'public_ip': :'publicIp',
    'node_error': :'nodeError',
    'lifecycle_state': :'lifecycleState',
    'lifecycle_details': :'lifecycleDetails'
    # 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
102
# File 'lib/oci/container_engine/models/node.rb', line 86

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'name': :'String',
    'availability_domain': :'String',
    'subnet_id': :'String',
    'node_pool_id': :'String',
    'fault_domain': :'String',
    'private_ip': :'String',
    'public_ip': :'String',
    'node_error': :'OCI::ContainerEngine::Models::NodeError',
    'lifecycle_state': :'String',
    'lifecycle_details': :'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



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

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

  self.class == other.class &&
    id == other.id &&
    name == other.name &&
    availability_domain == other.availability_domain &&
    subnet_id == other.subnet_id &&
    node_pool_id == other.node_pool_id &&
    fault_domain == other.fault_domain &&
    private_ip == other.private_ip &&
    public_ip == other.public_ip &&
    node_error == other.node_error &&
    lifecycle_state == other.lifecycle_state &&
    lifecycle_details == other.lifecycle_details
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/container_engine/models/node.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/container_engine/models/node.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/container_engine/models/node.rb', line 235

def hash
  [id, name, availability_domain, subnet_id, node_pool_id, fault_domain, private_ip, public_ip, node_error, lifecycle_state, lifecycle_details].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/container_engine/models/node.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/container_engine/models/node.rb', line 273

def to_s
  to_hash.to_s
end