Class: OCI::Mngdmac::Models::NodeConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/mngdmac/models/node_config.rb

Overview

Represents a MacDevice resource.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ NodeConfig

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :serial_number (String)

    The value to assign to the #serial_number property

  • :mac_address (String)

    The value to assign to the #mac_address property

  • :switch_hostname (String)

    The value to assign to the #switch_hostname property

  • :switch_eth_port (String)

    The value to assign to the #switch_eth_port property

  • :ip_kvm_hostname (String)

    The value to assign to the #ip_kvm_hostname property

  • :ip_kvm_port_number (Integer)

    The value to assign to the #ip_kvm_port_number property

  • :pdu_hostname (String)

    The value to assign to the #pdu_hostname property

  • :pdu_port (Integer)

    The value to assign to the #pdu_port property

  • :build_vlan_id (Integer)

    The value to assign to the #build_vlan_id property

  • :build_ip_address (String)

    The value to assign to the #build_ip_address property

  • :prod_vlan_id (Integer)

    The value to assign to the #prod_vlan_id property

  • :prod_ip_address (String)

    The value to assign to the #prod_ip_address property

  • :rack_location (String)

    The value to assign to the #rack_location property

  • :chip_set (String)

    The value to assign to the #chip_set property

  • :os_version (String)

    The value to assign to the #os_version property

  • :mac_order_id (String)

    The value to assign to the #mac_order_id property

  • :tenancy_id (String)

    The value to assign to the #tenancy_id property



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
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
247
248
249
250
251
252
253
254
255
256
257
258
259
# File 'lib/oci/mngdmac/models/node_config.rb', line 152

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

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

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

  self.mac_address = attributes[:'macAddress'] if attributes[:'macAddress']

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

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

  self.switch_hostname = attributes[:'switchHostname'] if attributes[:'switchHostname']

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

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

  self.switch_eth_port = attributes[:'switchEthPort'] if attributes[:'switchEthPort']

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

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

  self.ip_kvm_hostname = attributes[:'ipKvmHostname'] if attributes[:'ipKvmHostname']

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

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

  self.ip_kvm_port_number = attributes[:'ipKvmPortNumber'] if attributes[:'ipKvmPortNumber']

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

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

  self.pdu_hostname = attributes[:'pduHostname'] if attributes[:'pduHostname']

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

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

  self.pdu_port = attributes[:'pduPort'] if attributes[:'pduPort']

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

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

  self.build_vlan_id = attributes[:'buildVlanId'] if attributes[:'buildVlanId']

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

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

  self.build_ip_address = attributes[:'buildIpAddress'] if attributes[:'buildIpAddress']

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

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

  self.prod_vlan_id = attributes[:'prodVlanId'] if attributes[:'prodVlanId']

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

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

  self.prod_ip_address = attributes[:'prodIpAddress'] if attributes[:'prodIpAddress']

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

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

  self.rack_location = attributes[:'rackLocation'] if attributes[:'rackLocation']

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

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

  self.chip_set = attributes[:'chipSet'] if attributes[:'chipSet']

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

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

  self.os_version = attributes[:'osVersion'] if attributes[:'osVersion']

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

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

  self.mac_order_id = attributes[:'macOrderId'] if attributes[:'macOrderId']

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

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

  self.tenancy_id = attributes[:'tenancyId'] if attributes[:'tenancyId']

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

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

Instance Attribute Details

#build_ip_addressString

[Required] The buildIpAddress.

Returns:

  • (String)


49
50
51
# File 'lib/oci/mngdmac/models/node_config.rb', line 49

def build_ip_address
  @build_ip_address
end

#build_vlan_idInteger

[Required] The buildVlanId.

Returns:

  • (Integer)


45
46
47
# File 'lib/oci/mngdmac/models/node_config.rb', line 45

def build_vlan_id
  @build_vlan_id
end

#chip_setString

[Required] The chipSetn.

Returns:

  • (String)


65
66
67
# File 'lib/oci/mngdmac/models/node_config.rb', line 65

def chip_set
  @chip_set
end

#ip_kvm_hostnameString

[Required] The ipKvmHostname.

Returns:

  • (String)


29
30
31
# File 'lib/oci/mngdmac/models/node_config.rb', line 29

def ip_kvm_hostname
  @ip_kvm_hostname
end

#ip_kvm_port_numberInteger

[Required] The ipKvmPortNumber.

Returns:

  • (Integer)


33
34
35
# File 'lib/oci/mngdmac/models/node_config.rb', line 33

def ip_kvm_port_number
  @ip_kvm_port_number
end

#mac_addressString

[Required] The macAddress.

Returns:

  • (String)


17
18
19
# File 'lib/oci/mngdmac/models/node_config.rb', line 17

def mac_address
  @mac_address
end

#mac_order_idString

[Required] The macOrderId.

Returns:

  • (String)


73
74
75
# File 'lib/oci/mngdmac/models/node_config.rb', line 73

def mac_order_id
  @mac_order_id
end

#os_versionString

[Required] The osVersion.

Returns:

  • (String)


69
70
71
# File 'lib/oci/mngdmac/models/node_config.rb', line 69

def os_version
  @os_version
end

#pdu_hostnameString

[Required] The pduHostname.

Returns:

  • (String)


37
38
39
# File 'lib/oci/mngdmac/models/node_config.rb', line 37

def pdu_hostname
  @pdu_hostname
end

#pdu_portInteger

[Required] The pduPort.

Returns:

  • (Integer)


41
42
43
# File 'lib/oci/mngdmac/models/node_config.rb', line 41

def pdu_port
  @pdu_port
end

#prod_ip_addressString

[Required] The prodIpAddress.

Returns:

  • (String)


57
58
59
# File 'lib/oci/mngdmac/models/node_config.rb', line 57

def prod_ip_address
  @prod_ip_address
end

#prod_vlan_idInteger

[Required] The prodVlanId.

Returns:

  • (Integer)


53
54
55
# File 'lib/oci/mngdmac/models/node_config.rb', line 53

def prod_vlan_id
  @prod_vlan_id
end

#rack_locationString

[Required] The rackLocation.

Returns:

  • (String)


61
62
63
# File 'lib/oci/mngdmac/models/node_config.rb', line 61

def rack_location
  @rack_location
end

#serial_numberString

[Required] The serial number of the MacDevice.

Returns:

  • (String)


13
14
15
# File 'lib/oci/mngdmac/models/node_config.rb', line 13

def serial_number
  @serial_number
end

#switch_eth_portString

[Required] The switchEthPort.

Returns:

  • (String)


25
26
27
# File 'lib/oci/mngdmac/models/node_config.rb', line 25

def switch_eth_port
  @switch_eth_port
end

#switch_hostnameString

[Required] The switchHostname.

Returns:

  • (String)


21
22
23
# File 'lib/oci/mngdmac/models/node_config.rb', line 21

def switch_hostname
  @switch_hostname
end

#tenancy_idString

[Required] The tenancyId.

Returns:

  • (String)


77
78
79
# File 'lib/oci/mngdmac/models/node_config.rb', line 77

def tenancy_id
  @tenancy_id
end

Class Method Details

.attribute_mapObject

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



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/oci/mngdmac/models/node_config.rb', line 80

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'serial_number': :'serialNumber',
    'mac_address': :'macAddress',
    'switch_hostname': :'switchHostname',
    'switch_eth_port': :'switchEthPort',
    'ip_kvm_hostname': :'ipKvmHostname',
    'ip_kvm_port_number': :'ipKvmPortNumber',
    'pdu_hostname': :'pduHostname',
    'pdu_port': :'pduPort',
    'build_vlan_id': :'buildVlanId',
    'build_ip_address': :'buildIpAddress',
    'prod_vlan_id': :'prodVlanId',
    'prod_ip_address': :'prodIpAddress',
    'rack_location': :'rackLocation',
    'chip_set': :'chipSet',
    'os_version': :'osVersion',
    'mac_order_id': :'macOrderId',
    'tenancy_id': :'tenancyId'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# File 'lib/oci/mngdmac/models/node_config.rb', line 105

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'serial_number': :'String',
    'mac_address': :'String',
    'switch_hostname': :'String',
    'switch_eth_port': :'String',
    'ip_kvm_hostname': :'String',
    'ip_kvm_port_number': :'Integer',
    'pdu_hostname': :'String',
    'pdu_port': :'Integer',
    'build_vlan_id': :'Integer',
    'build_ip_address': :'String',
    'prod_vlan_id': :'Integer',
    'prod_ip_address': :'String',
    'rack_location': :'String',
    'chip_set': :'String',
    'os_version': :'String',
    'mac_order_id': :'String',
    'tenancy_id': :'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



268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
# File 'lib/oci/mngdmac/models/node_config.rb', line 268

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

  self.class == other.class &&
    serial_number == other.serial_number &&
    mac_address == other.mac_address &&
    switch_hostname == other.switch_hostname &&
    switch_eth_port == other.switch_eth_port &&
    ip_kvm_hostname == other.ip_kvm_hostname &&
    ip_kvm_port_number == other.ip_kvm_port_number &&
    pdu_hostname == other.pdu_hostname &&
    pdu_port == other.pdu_port &&
    build_vlan_id == other.build_vlan_id &&
    build_ip_address == other.build_ip_address &&
    prod_vlan_id == other.prod_vlan_id &&
    prod_ip_address == other.prod_ip_address &&
    rack_location == other.rack_location &&
    chip_set == other.chip_set &&
    os_version == other.os_version &&
    mac_order_id == other.mac_order_id &&
    tenancy_id == other.tenancy_id
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



314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
# File 'lib/oci/mngdmac/models/node_config.rb', line 314

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


294
295
296
# File 'lib/oci/mngdmac/models/node_config.rb', line 294

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



303
304
305
# File 'lib/oci/mngdmac/models/node_config.rb', line 303

def hash
  [serial_number, mac_address, switch_hostname, switch_eth_port, ip_kvm_hostname, ip_kvm_port_number, pdu_hostname, pdu_port, build_vlan_id, build_ip_address, prod_vlan_id, prod_ip_address, rack_location, chip_set, os_version, mac_order_id, tenancy_id].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



347
348
349
350
351
352
353
354
355
356
# File 'lib/oci/mngdmac/models/node_config.rb', line 347

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



341
342
343
# File 'lib/oci/mngdmac/models/node_config.rb', line 341

def to_s
  to_hash.to_s
end