Class: OCI::Mngdmac::Models::NodeConfig
- Inherits:
-
Object
- Object
- OCI::Mngdmac::Models::NodeConfig
- Defined in:
- lib/oci/mngdmac/models/node_config.rb
Overview
Represents a MacDevice resource.
Instance Attribute Summary collapse
-
#build_ip_address ⇒ String
[Required] The buildIpAddress.
-
#build_vlan_id ⇒ Integer
[Required] The buildVlanId.
-
#chip_set ⇒ String
[Required] The chipSetn.
-
#ip_kvm_hostname ⇒ String
[Required] The ipKvmHostname.
-
#ip_kvm_port_number ⇒ Integer
[Required] The ipKvmPortNumber.
-
#mac_address ⇒ String
[Required] The macAddress.
-
#mac_order_id ⇒ String
[Required] The macOrderId.
-
#os_version ⇒ String
[Required] The osVersion.
-
#pdu_hostname ⇒ String
[Required] The pduHostname.
-
#pdu_port ⇒ Integer
[Required] The pduPort.
-
#prod_ip_address ⇒ String
[Required] The prodIpAddress.
-
#prod_vlan_id ⇒ Integer
[Required] The prodVlanId.
-
#rack_location ⇒ String
[Required] The rackLocation.
-
#serial_number ⇒ String
[Required] The serial number of the MacDevice.
-
#switch_eth_port ⇒ String
[Required] The switchEthPort.
-
#switch_hostname ⇒ String
[Required] The switchHostname.
-
#tenancy_id ⇒ String
[Required] The tenancyId.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ NodeConfig
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Constructor Details
#initialize(attributes = {}) ⇒ NodeConfig
Initializes the object
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_address ⇒ String
[Required] The buildIpAddress.
49 50 51 |
# File 'lib/oci/mngdmac/models/node_config.rb', line 49 def build_ip_address @build_ip_address end |
#build_vlan_id ⇒ Integer
[Required] The buildVlanId.
45 46 47 |
# File 'lib/oci/mngdmac/models/node_config.rb', line 45 def build_vlan_id @build_vlan_id end |
#chip_set ⇒ String
[Required] The chipSetn.
65 66 67 |
# File 'lib/oci/mngdmac/models/node_config.rb', line 65 def chip_set @chip_set end |
#ip_kvm_hostname ⇒ String
[Required] The ipKvmHostname.
29 30 31 |
# File 'lib/oci/mngdmac/models/node_config.rb', line 29 def ip_kvm_hostname @ip_kvm_hostname end |
#ip_kvm_port_number ⇒ Integer
[Required] The ipKvmPortNumber.
33 34 35 |
# File 'lib/oci/mngdmac/models/node_config.rb', line 33 def ip_kvm_port_number @ip_kvm_port_number end |
#mac_address ⇒ String
[Required] The macAddress.
17 18 19 |
# File 'lib/oci/mngdmac/models/node_config.rb', line 17 def mac_address @mac_address end |
#mac_order_id ⇒ String
[Required] The macOrderId.
73 74 75 |
# File 'lib/oci/mngdmac/models/node_config.rb', line 73 def mac_order_id @mac_order_id end |
#os_version ⇒ String
[Required] The osVersion.
69 70 71 |
# File 'lib/oci/mngdmac/models/node_config.rb', line 69 def os_version @os_version end |
#pdu_hostname ⇒ String
[Required] The pduHostname.
37 38 39 |
# File 'lib/oci/mngdmac/models/node_config.rb', line 37 def pdu_hostname @pdu_hostname end |
#pdu_port ⇒ Integer
[Required] The pduPort.
41 42 43 |
# File 'lib/oci/mngdmac/models/node_config.rb', line 41 def pdu_port @pdu_port end |
#prod_ip_address ⇒ String
[Required] The prodIpAddress.
57 58 59 |
# File 'lib/oci/mngdmac/models/node_config.rb', line 57 def prod_ip_address @prod_ip_address end |
#prod_vlan_id ⇒ Integer
[Required] The prodVlanId.
53 54 55 |
# File 'lib/oci/mngdmac/models/node_config.rb', line 53 def prod_vlan_id @prod_vlan_id end |
#rack_location ⇒ String
[Required] The rackLocation.
61 62 63 |
# File 'lib/oci/mngdmac/models/node_config.rb', line 61 def rack_location @rack_location end |
#serial_number ⇒ String
[Required] The serial number of the MacDevice.
13 14 15 |
# File 'lib/oci/mngdmac/models/node_config.rb', line 13 def serial_number @serial_number end |
#switch_eth_port ⇒ String
[Required] The switchEthPort.
25 26 27 |
# File 'lib/oci/mngdmac/models/node_config.rb', line 25 def switch_eth_port @switch_eth_port end |
#switch_hostname ⇒ String
[Required] The switchHostname.
21 22 23 |
# File 'lib/oci/mngdmac/models/node_config.rb', line 21 def switch_hostname @switch_hostname end |
#tenancy_id ⇒ String
[Required] The tenancyId.
77 78 79 |
# File 'lib/oci/mngdmac/models/node_config.rb', line 77 def tenancy_id @tenancy_id end |
Class Method Details
.attribute_map ⇒ Object
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_types ⇒ Object
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.
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
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
294 295 296 |
# File 'lib/oci/mngdmac/models/node_config.rb', line 294 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
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_hash ⇒ 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_s ⇒ String
Returns the string representation of the object
341 342 343 |
# File 'lib/oci/mngdmac/models/node_config.rb', line 341 def to_s to_hash.to_s end |