Class: NutanixClustermgmt::ClustermgmtV40ConfigNetworkSwitchInterface
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- NutanixClustermgmt::ClustermgmtV40ConfigNetworkSwitchInterface
- Defined in:
- lib/nutanix_clustermgmt/models/clustermgmt_v40_config_network_switch_interface.rb
Overview
Network switch interface details.
Instance Attribute Summary collapse
-
#attached_host_nic_uuids ⇒ Object
List of host NIC UUIDs connected to this interface.
-
#attached_host_uuid ⇒ Object
UUID of the host connected to the interface.
-
#ext_id ⇒ Object
A globally unique identifier of an instance that is suitable for external consumption.
-
#index ⇒ Object
Network switch interface index.
-
#last_change_time ⇒ Object
Timestamp when the interface state was last changed or modified.
-
#links ⇒ Object
A HATEOAS style link for the response.
-
#mac_address ⇒ Object
Host Mac address.
-
#mtu_in_bytes ⇒ Object
Maximum transmission unit in bytes.
-
#port ⇒ Object
Network switch interface port number.
-
#speed_in_kbps ⇒ Object
Network switch interface link speed in Kbps.
-
#switch_interface_description ⇒ Object
Network switch interface description.
-
#switch_interface_name ⇒ Object
Network switch interface name.
-
#switch_interface_type ⇒ Object
Network switch interface type.
-
#switch_management_address ⇒ Object
Returns the value of attribute switch_management_address.
-
#switch_uuid ⇒ Object
UUID of the switch.
-
#tenant_id ⇒ Object
A globally unique identifier that represents the tenant that owns this entity.
Class Method Summary collapse
-
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about.
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_all_of ⇒ Object
List of class defined in allOf (OpenAPI v3).
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ ClustermgmtV40ConfigNetworkSwitchInterface
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Methods inherited from ApiModelBase
_deserialize, #_to_hash, #to_body, #to_s
Constructor Details
#initialize(attributes = {}) ⇒ ClustermgmtV40ConfigNetworkSwitchInterface
Initializes the object
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 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 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_network_switch_interface.rb', line 136 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `NutanixClustermgmt::ClustermgmtV40ConfigNetworkSwitchInterface` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `NutanixClustermgmt::ClustermgmtV40ConfigNetworkSwitchInterface`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'tenant_id') self.tenant_id = attributes[:'tenant_id'] end if attributes.key?(:'ext_id') self.ext_id = attributes[:'ext_id'] end if attributes.key?(:'links') if (value = attributes[:'links']).is_a?(Array) self.links = value end end if attributes.key?(:'port') self.port = attributes[:'port'] end if attributes.key?(:'switch_interface_name') self.switch_interface_name = attributes[:'switch_interface_name'] end if attributes.key?(:'switch_interface_description') self.switch_interface_description = attributes[:'switch_interface_description'] end if attributes.key?(:'switch_interface_type') self.switch_interface_type = attributes[:'switch_interface_type'] end if attributes.key?(:'index') self.index = attributes[:'index'] end if attributes.key?(:'speed_in_kbps') self.speed_in_kbps = attributes[:'speed_in_kbps'] end if attributes.key?(:'mtu_in_bytes') self.mtu_in_bytes = attributes[:'mtu_in_bytes'] end if attributes.key?(:'mac_address') self.mac_address = attributes[:'mac_address'] end if attributes.key?(:'last_change_time') self.last_change_time = attributes[:'last_change_time'] end if attributes.key?(:'switch_management_address') self.switch_management_address = attributes[:'switch_management_address'] end if attributes.key?(:'attached_host_uuid') self.attached_host_uuid = attributes[:'attached_host_uuid'] end if attributes.key?(:'attached_host_nic_uuids') if (value = attributes[:'attached_host_nic_uuids']).is_a?(Array) self.attached_host_nic_uuids = value end end if attributes.key?(:'switch_uuid') self.switch_uuid = attributes[:'switch_uuid'] end end |
Instance Attribute Details
#attached_host_nic_uuids ⇒ Object
List of host NIC UUIDs connected to this interface.
61 62 63 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_network_switch_interface.rb', line 61 def attached_host_nic_uuids @attached_host_nic_uuids end |
#attached_host_uuid ⇒ Object
UUID of the host connected to the interface.
58 59 60 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_network_switch_interface.rb', line 58 def attached_host_uuid @attached_host_uuid end |
#ext_id ⇒ Object
A globally unique identifier of an instance that is suitable for external consumption.
23 24 25 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_network_switch_interface.rb', line 23 def ext_id @ext_id end |
#index ⇒ Object
Network switch interface index.
41 42 43 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_network_switch_interface.rb', line 41 def index @index end |
#last_change_time ⇒ Object
Timestamp when the interface state was last changed or modified.
53 54 55 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_network_switch_interface.rb', line 53 def last_change_time @last_change_time end |
#links ⇒ Object
A HATEOAS style link for the response. Each link contains a user-friendly name identifying the link and an address for retrieving the particular resource.
26 27 28 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_network_switch_interface.rb', line 26 def links @links end |
#mac_address ⇒ Object
Host Mac address.
50 51 52 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_network_switch_interface.rb', line 50 def mac_address @mac_address end |
#mtu_in_bytes ⇒ Object
Maximum transmission unit in bytes.
47 48 49 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_network_switch_interface.rb', line 47 def mtu_in_bytes @mtu_in_bytes end |
#port ⇒ Object
Network switch interface port number.
29 30 31 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_network_switch_interface.rb', line 29 def port @port end |
#speed_in_kbps ⇒ Object
Network switch interface link speed in Kbps.
44 45 46 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_network_switch_interface.rb', line 44 def speed_in_kbps @speed_in_kbps end |
#switch_interface_description ⇒ Object
Network switch interface description.
35 36 37 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_network_switch_interface.rb', line 35 def switch_interface_description @switch_interface_description end |
#switch_interface_name ⇒ Object
Network switch interface name.
32 33 34 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_network_switch_interface.rb', line 32 def switch_interface_name @switch_interface_name end |
#switch_interface_type ⇒ Object
Network switch interface type.
38 39 40 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_network_switch_interface.rb', line 38 def switch_interface_type @switch_interface_type end |
#switch_management_address ⇒ Object
Returns the value of attribute switch_management_address.
55 56 57 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_network_switch_interface.rb', line 55 def switch_management_address @switch_management_address end |
#switch_uuid ⇒ Object
UUID of the switch.
64 65 66 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_network_switch_interface.rb', line 64 def switch_uuid @switch_uuid end |
#tenant_id ⇒ Object
A globally unique identifier that represents the tenant that owns this entity. The system automatically assigns it, and it and is immutable from an API consumer perspective (some use cases may cause this Id to change - For instance, a use case may require the transfer of ownership of the entity, but these cases are handled automatically on the server).
20 21 22 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_network_switch_interface.rb', line 20 def tenant_id @tenant_id end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
89 90 91 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_network_switch_interface.rb', line 89 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
94 95 96 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_network_switch_interface.rb', line 94 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
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 84 85 86 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_network_switch_interface.rb', line 67 def self.attribute_map { :'tenant_id' => :'tenantId', :'ext_id' => :'extId', :'links' => :'links', :'port' => :'port', :'switch_interface_name' => :'switchInterfaceName', :'switch_interface_description' => :'switchInterfaceDescription', :'switch_interface_type' => :'switchInterfaceType', :'index' => :'index', :'speed_in_kbps' => :'speedInKbps', :'mtu_in_bytes' => :'mtuInBytes', :'mac_address' => :'macAddress', :'last_change_time' => :'lastChangeTime', :'switch_management_address' => :'switchManagementAddress', :'attached_host_uuid' => :'attachedHostUuid', :'attached_host_nic_uuids' => :'attachedHostNicUuids', :'switch_uuid' => :'switchUuid' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_network_switch_interface.rb', line 448 def self.build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) transformed_hash = {} openapi_types.each_pair do |key, type| if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[attribute_map[key]].is_a?(Array) transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end elsif !attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end new(transformed_hash) end |
.openapi_all_of ⇒ Object
List of class defined in allOf (OpenAPI v3)
128 129 130 131 132 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_network_switch_interface.rb', line 128 def self.openapi_all_of [ :'CommonV10ResponseExternalizableAbstractModel' ] end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
121 122 123 124 125 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_network_switch_interface.rb', line 121 def self.openapi_nullable Set.new([ :'ext_id', ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_network_switch_interface.rb', line 99 def self.openapi_types { :'tenant_id' => :'String', :'ext_id' => :'String', :'links' => :'Array<CommonV10ResponseApiLink>', :'port' => :'Integer', :'switch_interface_name' => :'String', :'switch_interface_description' => :'String', :'switch_interface_type' => :'String', :'index' => :'Integer', :'speed_in_kbps' => :'Integer', :'mtu_in_bytes' => :'Integer', :'mac_address' => :'String', :'last_change_time' => :'Time', :'switch_management_address' => :'CommonV10ConfigIPAddress', :'attached_host_uuid' => :'String', :'attached_host_nic_uuids' => :'Array<String>', :'switch_uuid' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_network_switch_interface.rb', line 412 def ==(o) return true if self.equal?(o) self.class == o.class && tenant_id == o.tenant_id && ext_id == o.ext_id && links == o.links && port == o.port && switch_interface_name == o.switch_interface_name && switch_interface_description == o.switch_interface_description && switch_interface_type == o.switch_interface_type && index == o.index && speed_in_kbps == o.speed_in_kbps && mtu_in_bytes == o.mtu_in_bytes && mac_address == o.mac_address && last_change_time == o.last_change_time && switch_management_address == o.switch_management_address && attached_host_uuid == o.attached_host_uuid && attached_host_nic_uuids == o.attached_host_nic_uuids && switch_uuid == o.switch_uuid end |
#eql?(o) ⇒ Boolean
435 436 437 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_network_switch_interface.rb', line 435 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
441 442 443 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_network_switch_interface.rb', line 441 def hash [tenant_id, ext_id, links, port, switch_interface_name, switch_interface_description, switch_interface_type, index, speed_in_kbps, mtu_in_bytes, mac_address, last_change_time, switch_management_address, attached_host_uuid, attached_host_nic_uuids, switch_uuid].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
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 260 261 262 263 264 265 266 267 268 269 270 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_network_switch_interface.rb', line 221 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new pattern = Regexp.new(/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/) if !@tenant_id.nil? && @tenant_id !~ pattern invalid_properties.push("invalid value for \"tenant_id\", must conform to the pattern #{pattern}.") end pattern = Regexp.new(/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/) if !@ext_id.nil? && @ext_id !~ pattern invalid_properties.push("invalid value for \"ext_id\", must conform to the pattern #{pattern}.") end if !@links.nil? && @links.length > 20 invalid_properties.push('invalid value for "links", number of items must be less than or equal to 20.') end if !@links.nil? && @links.length < 0 invalid_properties.push('invalid value for "links", number of items must be greater than or equal to 0.') end if !@switch_interface_name.nil? && @switch_interface_name.to_s.length > 64 invalid_properties.push('invalid value for "switch_interface_name", the character length must be smaller than or equal to 64.') end pattern = Regexp.new(/^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$/) if !@mac_address.nil? && @mac_address !~ pattern invalid_properties.push("invalid value for \"mac_address\", must conform to the pattern #{pattern}.") end pattern = Regexp.new(/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/) if !@attached_host_uuid.nil? && @attached_host_uuid !~ pattern invalid_properties.push("invalid value for \"attached_host_uuid\", must conform to the pattern #{pattern}.") end if !@attached_host_nic_uuids.nil? && @attached_host_nic_uuids.length > 1024 invalid_properties.push('invalid value for "attached_host_nic_uuids", number of items must be less than or equal to 1024.') end if !@attached_host_nic_uuids.nil? && @attached_host_nic_uuids.length < 0 invalid_properties.push('invalid value for "attached_host_nic_uuids", number of items must be greater than or equal to 0.') end pattern = Regexp.new(/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/) if !@switch_uuid.nil? && @switch_uuid !~ pattern invalid_properties.push("invalid value for \"switch_uuid\", must conform to the pattern #{pattern}.") end invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
470 471 472 473 474 475 476 477 478 479 480 481 482 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_network_switch_interface.rb', line 470 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
274 275 276 277 278 279 280 281 282 283 284 285 286 287 |
# File 'lib/nutanix_clustermgmt/models/clustermgmt_v40_config_network_switch_interface.rb', line 274 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if !@tenant_id.nil? && @tenant_id !~ Regexp.new(/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/) return false if !@ext_id.nil? && @ext_id !~ Regexp.new(/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/) return false if !@links.nil? && @links.length > 20 return false if !@links.nil? && @links.length < 0 return false if !@switch_interface_name.nil? && @switch_interface_name.to_s.length > 64 return false if !@mac_address.nil? && @mac_address !~ Regexp.new(/^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$/) return false if !@attached_host_uuid.nil? && @attached_host_uuid !~ Regexp.new(/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/) return false if !@attached_host_nic_uuids.nil? && @attached_host_nic_uuids.length > 1024 return false if !@attached_host_nic_uuids.nil? && @attached_host_nic_uuids.length < 0 return false if !@switch_uuid.nil? && @switch_uuid !~ Regexp.new(/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/) true end |