Class: OCI::Bds::Models::Node

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

Overview

Specific info about a node

Constant Summary collapse

LIFECYCLE_STATE_ENUM =
[
  LIFECYCLE_STATE_CREATING = 'CREATING'.freeze,
  LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze,
  LIFECYCLE_STATE_INACTIVE = 'INACTIVE'.freeze,
  LIFECYCLE_STATE_UPDATING = 'UPDATING'.freeze,
  LIFECYCLE_STATE_DELETING = 'DELETING'.freeze,
  LIFECYCLE_STATE_DELETED = 'DELETED'.freeze,
  LIFECYCLE_STATE_FAILED = 'FAILED'.freeze,
  LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
NODE_TYPE_ENUM =
[
  NODE_TYPE_MASTER = 'MASTER'.freeze,
  NODE_TYPE_EDGE = 'EDGE'.freeze,
  NODE_TYPE_UTILITY = 'UTILITY'.freeze,
  NODE_TYPE_WORKER = 'WORKER'.freeze,
  NODE_TYPE_BURSTING = 'BURSTING'.freeze,
  NODE_TYPE_CLOUD_SQL = 'CLOUD_SQL'.freeze,
  NODE_TYPE_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):

  • :instance_id (String)

    The value to assign to the #instance_id property

  • :display_name (String)

    The value to assign to the #display_name property

  • :lifecycle_state (String)

    The value to assign to the #lifecycle_state property

  • :node_type (String)

    The value to assign to the #node_type property

  • :shape (String)

    The value to assign to the #shape property

  • :attached_block_volumes (Array<OCI::Bds::Models::VolumeAttachmentDetail>)

    The value to assign to the #attached_block_volumes property

  • :subnet_id (String)

    The value to assign to the #subnet_id property

  • :ip_address (String)

    The value to assign to the #ip_address property

  • :hostname (String)

    The value to assign to the #hostname property

  • :image_id (String)

    The value to assign to the #image_id property

  • :ssh_fingerprint (String)

    The value to assign to the #ssh_fingerprint property

  • :availability_domain (String)

    The value to assign to the #availability_domain property

  • :fault_domain (String)

    The value to assign to the #fault_domain property

  • :time_created (DateTime)

    The value to assign to the #time_created property

  • :time_updated (DateTime)

    The value to assign to the #time_updated property



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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
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
# File 'lib/oci/bds/models/node.rb', line 159

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

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

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

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

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

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

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

  self.attached_block_volumes = attributes[:'attachedBlockVolumes'] if attributes[:'attachedBlockVolumes']

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

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

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

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

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

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

  self.image_id = attributes[:'imageId'] if attributes[:'imageId']

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

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

  self.ssh_fingerprint = attributes[:'sshFingerprint'] if attributes[:'sshFingerprint']

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

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

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

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

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

  self.time_updated = attributes[:'timeUpdated'] if attributes[:'timeUpdated']

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

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

Instance Attribute Details

#attached_block_volumesArray<OCI::Bds::Models::VolumeAttachmentDetail>

The list of block volumes attached to a given node.



54
55
56
# File 'lib/oci/bds/models/node.rb', line 54

def attached_block_volumes
  @attached_block_volumes
end

#availability_domainString

[Required] The name of the availability domain the node is running in

Returns:

  • (String)


78
79
80
# File 'lib/oci/bds/models/node.rb', line 78

def availability_domain
  @availability_domain
end

#display_nameString

[Required] The name of the node

Returns:

  • (String)


38
39
40
# File 'lib/oci/bds/models/node.rb', line 38

def display_name
  @display_name
end

#fault_domainString

[Required] The name of the fault domain the node is running in

Returns:

  • (String)


82
83
84
# File 'lib/oci/bds/models/node.rb', line 82

def fault_domain
  @fault_domain
end

#hostnameString

The fully-qualified hostname (FQDN) of the node

Returns:

  • (String)


66
67
68
# File 'lib/oci/bds/models/node.rb', line 66

def hostname
  @hostname
end

#image_idString

The OCID of the image from which the node was created

Returns:

  • (String)


70
71
72
# File 'lib/oci/bds/models/node.rb', line 70

def image_id
  @image_id
end

#instance_idString

[Required] The OCID of the underlying compute instance

Returns:

  • (String)


34
35
36
# File 'lib/oci/bds/models/node.rb', line 34

def instance_id
  @instance_id
end

#ip_addressString

[Required] IP address of the node

Returns:

  • (String)


62
63
64
# File 'lib/oci/bds/models/node.rb', line 62

def ip_address
  @ip_address
end

#lifecycle_stateString

[Required] The state of the node

Returns:

  • (String)


42
43
44
# File 'lib/oci/bds/models/node.rb', line 42

def lifecycle_state
  @lifecycle_state
end

#node_typeString

[Required] BDS instance node type

Returns:

  • (String)


46
47
48
# File 'lib/oci/bds/models/node.rb', line 46

def node_type
  @node_type
end

#shapeString

[Required] Shape of the node

Returns:

  • (String)


50
51
52
# File 'lib/oci/bds/models/node.rb', line 50

def shape
  @shape
end

#ssh_fingerprintString

[Required] The fingerprint of the SSH key used for node access

Returns:

  • (String)


74
75
76
# File 'lib/oci/bds/models/node.rb', line 74

def ssh_fingerprint
  @ssh_fingerprint
end

#subnet_idString

[Required] The OCID of the subnet in which the node should be created

Returns:

  • (String)


58
59
60
# File 'lib/oci/bds/models/node.rb', line 58

def subnet_id
  @subnet_id
end

#time_createdDateTime

[Required] The time the node was created. An RFC3339 formatted datetime string

Returns:

  • (DateTime)


86
87
88
# File 'lib/oci/bds/models/node.rb', line 86

def time_created
  @time_created
end

#time_updatedDateTime

The time the BDS instance was updated. An RFC3339 formatted datetime string

Returns:

  • (DateTime)


90
91
92
# File 'lib/oci/bds/models/node.rb', line 90

def time_updated
  @time_updated
end

Class Method Details

.attribute_mapObject

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



93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# File 'lib/oci/bds/models/node.rb', line 93

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'instance_id': :'instanceId',
    'display_name': :'displayName',
    'lifecycle_state': :'lifecycleState',
    'node_type': :'nodeType',
    'shape': :'shape',
    'attached_block_volumes': :'attachedBlockVolumes',
    'subnet_id': :'subnetId',
    'ip_address': :'ipAddress',
    'hostname': :'hostname',
    'image_id': :'imageId',
    'ssh_fingerprint': :'sshFingerprint',
    'availability_domain': :'availabilityDomain',
    'fault_domain': :'faultDomain',
    'time_created': :'timeCreated',
    'time_updated': :'timeUpdated'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# File 'lib/oci/bds/models/node.rb', line 116

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'instance_id': :'String',
    'display_name': :'String',
    'lifecycle_state': :'String',
    'node_type': :'String',
    'shape': :'String',
    'attached_block_volumes': :'Array<OCI::Bds::Models::VolumeAttachmentDetail>',
    'subnet_id': :'String',
    'ip_address': :'String',
    'hostname': :'String',
    'image_id': :'String',
    'ssh_fingerprint': :'String',
    'availability_domain': :'String',
    'fault_domain': :'String',
    'time_created': :'DateTime',
    'time_updated': :'DateTime'
    # 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



281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
# File 'lib/oci/bds/models/node.rb', line 281

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

  self.class == other.class &&
    instance_id == other.instance_id &&
    display_name == other.display_name &&
    lifecycle_state == other.lifecycle_state &&
    node_type == other.node_type &&
    shape == other.shape &&
    attached_block_volumes == other.attached_block_volumes &&
    subnet_id == other.subnet_id &&
    ip_address == other.ip_address &&
    hostname == other.hostname &&
    image_id == other.image_id &&
    ssh_fingerprint == other.ssh_fingerprint &&
    availability_domain == other.availability_domain &&
    fault_domain == other.fault_domain &&
    time_created == other.time_created &&
    time_updated == other.time_updated
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



325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
# File 'lib/oci/bds/models/node.rb', line 325

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


305
306
307
# File 'lib/oci/bds/models/node.rb', line 305

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



314
315
316
# File 'lib/oci/bds/models/node.rb', line 314

def hash
  [instance_id, display_name, lifecycle_state, node_type, shape, attached_block_volumes, subnet_id, ip_address, hostname, image_id, ssh_fingerprint, availability_domain, fault_domain, time_created, time_updated].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



358
359
360
361
362
363
364
365
366
367
# File 'lib/oci/bds/models/node.rb', line 358

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



352
353
354
# File 'lib/oci/bds/models/node.rb', line 352

def to_s
  to_hash.to_s
end