Class: IntersightClient::VnicEthIf

Inherits:
MoBaseMo
  • Object
show all
Defined in:
lib/intersight_client/models/vnic_eth_if.rb

Overview

Virtual Ethernet Interface.

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Attributes inherited from MoBaseMo

#account_moid, #ancestors, #create_time, #display_names, #domain_group_moid, #mod_time, #moid, #owners, #parent, #permission_resources, #shared_scope, #tags, #version_context

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ VnicEthIf

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
# File 'lib/intersight_client/models/vnic_eth_if.rb', line 225

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `IntersightClient::VnicEthIf` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!self.class.acceptable_attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `#{self.class.name}`. Please check the name to make sure it's valid. List of attributes: " + self.class.acceptable_attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  # call parent's initialize
  super(attributes)

  if attributes.key?(:'class_id')
    self.class_id = attributes[:'class_id']
  else
    self.class_id = 'vnic.EthIf'
  end

  if attributes.key?(:'object_type')
    self.object_type = attributes[:'object_type']
  else
    self.object_type = 'vnic.EthIf'
  end

  if attributes.key?(:'cdn')
    self.cdn = attributes[:'cdn']
  end

  if attributes.key?(:'failover_enabled')
    self.failover_enabled = attributes[:'failover_enabled']
  else
    self.failover_enabled = false
  end

  if attributes.key?(:'iscsi_ip_v4_address_allocation_type')
    self.iscsi_ip_v4_address_allocation_type = attributes[:'iscsi_ip_v4_address_allocation_type']
  else
    self.iscsi_ip_v4_address_allocation_type = 'None'
  end

  if attributes.key?(:'iscsi_ip_v4_config')
    self.iscsi_ip_v4_config = attributes[:'iscsi_ip_v4_config']
  end

  if attributes.key?(:'iscsi_ipv4_address')
    self.iscsi_ipv4_address = attributes[:'iscsi_ipv4_address']
  end

  if attributes.key?(:'mac_address')
    self.mac_address = attributes[:'mac_address']
  end

  if attributes.key?(:'mac_address_type')
    self.mac_address_type = attributes[:'mac_address_type']
  else
    self.mac_address_type = 'POOL'
  end

  if attributes.key?(:'name')
    self.name = attributes[:'name']
  end

  if attributes.key?(:'order')
    self.order = attributes[:'order']
  end

  if attributes.key?(:'placement')
    self.placement = attributes[:'placement']
  end

  if attributes.key?(:'standby_vif_id')
    self.standby_vif_id = attributes[:'standby_vif_id']
  end

  if attributes.key?(:'static_mac_address')
    self.static_mac_address = attributes[:'static_mac_address']
  end

  if attributes.key?(:'usnic_settings')
    self.usnic_settings = attributes[:'usnic_settings']
  end

  if attributes.key?(:'vif_id')
    self.vif_id = attributes[:'vif_id']
  end

  if attributes.key?(:'vmq_settings')
    self.vmq_settings = attributes[:'vmq_settings']
  end

  if attributes.key?(:'eth_adapter_policy')
    self.eth_adapter_policy = attributes[:'eth_adapter_policy']
  end

  if attributes.key?(:'eth_network_policy')
    self.eth_network_policy = attributes[:'eth_network_policy']
  end

  if attributes.key?(:'eth_qos_policy')
    self.eth_qos_policy = attributes[:'eth_qos_policy']
  end

  if attributes.key?(:'fabric_eth_network_control_policy')
    self.fabric_eth_network_control_policy = attributes[:'fabric_eth_network_control_policy']
  end

  if attributes.key?(:'fabric_eth_network_group_policy')
    if (value = attributes[:'fabric_eth_network_group_policy']).is_a?(Array)
      self.fabric_eth_network_group_policy = value
    end
  end

  if attributes.key?(:'ip_lease')
    self.ip_lease = attributes[:'ip_lease']
  end

  if attributes.key?(:'iscsi_boot_policy')
    self.iscsi_boot_policy = attributes[:'iscsi_boot_policy']
  end

  if attributes.key?(:'lan_connectivity_policy')
    self.lan_connectivity_policy = attributes[:'lan_connectivity_policy']
  end

  if attributes.key?(:'lcp_vnic')
    self.lcp_vnic = attributes[:'lcp_vnic']
  end

  if attributes.key?(:'mac_lease')
    self.mac_lease = attributes[:'mac_lease']
  end

  if attributes.key?(:'mac_pool')
    self.mac_pool = attributes[:'mac_pool']
  end

  if attributes.key?(:'profile')
    self.profile = attributes[:'profile']
  end

  if attributes.key?(:'sp_vnics')
    if (value = attributes[:'sp_vnics']).is_a?(Array)
      self.sp_vnics = value
    end
  end
end

Instance Attribute Details

#cdnObject

Returns the value of attribute cdn.



25
26
27
# File 'lib/intersight_client/models/vnic_eth_if.rb', line 25

def cdn
  @cdn
end

#class_idObject

The fully-qualified name of the instantiated, concrete type. This property is used as a discriminator to identify the type of the payload when marshaling and unmarshaling data.



20
21
22
# File 'lib/intersight_client/models/vnic_eth_if.rb', line 20

def class_id
  @class_id
end

#eth_adapter_policyObject

Returns the value of attribute eth_adapter_policy.



65
66
67
# File 'lib/intersight_client/models/vnic_eth_if.rb', line 65

def eth_adapter_policy
  @eth_adapter_policy
end

#eth_network_policyObject

Returns the value of attribute eth_network_policy.



67
68
69
# File 'lib/intersight_client/models/vnic_eth_if.rb', line 67

def eth_network_policy
  @eth_network_policy
end

#eth_qos_policyObject

Returns the value of attribute eth_qos_policy.



69
70
71
# File 'lib/intersight_client/models/vnic_eth_if.rb', line 69

def eth_qos_policy
  @eth_qos_policy
end

#fabric_eth_network_control_policyObject

Returns the value of attribute fabric_eth_network_control_policy.



71
72
73
# File 'lib/intersight_client/models/vnic_eth_if.rb', line 71

def fabric_eth_network_control_policy
  @fabric_eth_network_control_policy
end

#fabric_eth_network_group_policyObject

An array of relationships to fabricEthNetworkGroupPolicy resources.



74
75
76
# File 'lib/intersight_client/models/vnic_eth_if.rb', line 74

def fabric_eth_network_group_policy
  @fabric_eth_network_group_policy
end

#failover_enabledObject

Enabling failover ensures that traffic from the vNIC automatically fails over to the secondary Fabric Interconnect, in case the specified Fabric Interconnect path goes down. Failover applies only to Cisco VICs that are connected to a Fabric Interconnect cluster.



28
29
30
# File 'lib/intersight_client/models/vnic_eth_if.rb', line 28

def failover_enabled
  @failover_enabled
end

#ip_leaseObject

Returns the value of attribute ip_lease.



76
77
78
# File 'lib/intersight_client/models/vnic_eth_if.rb', line 76

def ip_lease
  @ip_lease
end

#iscsi_boot_policyObject

Returns the value of attribute iscsi_boot_policy.



78
79
80
# File 'lib/intersight_client/models/vnic_eth_if.rb', line 78

def iscsi_boot_policy
  @iscsi_boot_policy
end

#iscsi_ip_v4_address_allocation_typeObject

Static/Pool/DHCP Type of IP address allocated to the vNIC. It is derived from iSCSI boot policy IP Address type. * None - Type indicates that there is no IP associated to an vnic. * DHCP - The IP address is assigned using DHCP, if available. * Static - Static IPv4 address is assigned to the iSCSI boot interface based on the information entered in this area. * Pool - An IPv4 address is assigned to the iSCSI boot interface from the management IP address pool.



31
32
33
# File 'lib/intersight_client/models/vnic_eth_if.rb', line 31

def iscsi_ip_v4_address_allocation_type
  @iscsi_ip_v4_address_allocation_type
end

#iscsi_ip_v4_configObject

Returns the value of attribute iscsi_ip_v4_config.



33
34
35
# File 'lib/intersight_client/models/vnic_eth_if.rb', line 33

def iscsi_ip_v4_config
  @iscsi_ip_v4_config
end

#iscsi_ipv4_addressObject

IP address associated to the vNIC.



36
37
38
# File 'lib/intersight_client/models/vnic_eth_if.rb', line 36

def iscsi_ipv4_address
  @iscsi_ipv4_address
end

#lan_connectivity_policyObject

Returns the value of attribute lan_connectivity_policy.



80
81
82
# File 'lib/intersight_client/models/vnic_eth_if.rb', line 80

def lan_connectivity_policy
  @lan_connectivity_policy
end

#lcp_vnicObject

Returns the value of attribute lcp_vnic.



82
83
84
# File 'lib/intersight_client/models/vnic_eth_if.rb', line 82

def lcp_vnic
  @lcp_vnic
end

#mac_addressObject

The MAC address that is assigned to the vNIC based on the MAC pool that has been assigned to the LAN Connectivity Policy.



39
40
41
# File 'lib/intersight_client/models/vnic_eth_if.rb', line 39

def mac_address
  @mac_address
end

#mac_address_typeObject

Type of allocation selected to assign a MAC address for the vnic. * POOL - The user selects a pool from which the mac/wwn address will be leased for the Virtual Interface. * STATIC - The user assigns a static mac/wwn address for the Virtual Interface.



42
43
44
# File 'lib/intersight_client/models/vnic_eth_if.rb', line 42

def mac_address_type
  @mac_address_type
end

#mac_leaseObject

Returns the value of attribute mac_lease.



84
85
86
# File 'lib/intersight_client/models/vnic_eth_if.rb', line 84

def mac_lease
  @mac_lease
end

#mac_poolObject

Returns the value of attribute mac_pool.



86
87
88
# File 'lib/intersight_client/models/vnic_eth_if.rb', line 86

def mac_pool
  @mac_pool
end

#nameObject

Name of the virtual ethernet interface.



45
46
47
# File 'lib/intersight_client/models/vnic_eth_if.rb', line 45

def name
  @name
end

#object_typeObject

The fully-qualified name of the instantiated, concrete type. The value should be the same as the ‘ClassId’ property.



23
24
25
# File 'lib/intersight_client/models/vnic_eth_if.rb', line 23

def object_type
  @object_type
end

#orderObject

The order in which the virtual interface is brought up. The order assigned to an interface should be unique for all the Ethernet and Fibre-Channel interfaces on each PCI link on a VIC adapter. The maximum value of PCI order is limited by the number of virtual interfaces (Ethernet and Fibre-Channel) on each PCI link on a VIC adapter. All VIC adapters have a single PCI link except VIC 1385 which has two.



48
49
50
# File 'lib/intersight_client/models/vnic_eth_if.rb', line 48

def order
  @order
end

#placementObject

Returns the value of attribute placement.



50
51
52
# File 'lib/intersight_client/models/vnic_eth_if.rb', line 50

def placement
  @placement
end

#profileObject

Returns the value of attribute profile.



88
89
90
# File 'lib/intersight_client/models/vnic_eth_if.rb', line 88

def profile
  @profile
end

#sp_vnicsObject

An array of relationships to vnicEthIf resources.



91
92
93
# File 'lib/intersight_client/models/vnic_eth_if.rb', line 91

def sp_vnics
  @sp_vnics
end

#standby_vif_idObject

The Standby VIF Id is applicable for failover enabled vNICS. It should be the same as the channel number of the standby vethernet created on switch in order to set up the standby data path.



53
54
55
# File 'lib/intersight_client/models/vnic_eth_if.rb', line 53

def standby_vif_id
  @standby_vif_id
end

#static_mac_addressObject

The MAC address must be in hexadecimal format xx:xx:xx:xx:xx:xx. To ensure uniqueness of MACs in the LAN fabric, you are strongly encouraged to use the following MAC prefix 00:25:B5:xx:xx:xx.



56
57
58
# File 'lib/intersight_client/models/vnic_eth_if.rb', line 56

def static_mac_address
  @static_mac_address
end

#usnic_settingsObject

Returns the value of attribute usnic_settings.



58
59
60
# File 'lib/intersight_client/models/vnic_eth_if.rb', line 58

def usnic_settings
  @usnic_settings
end

#vif_idObject

The Vif Id should be same as the channel number of the vethernet created on switch in order to set up the data path. The property is applicable only for FI attached servers where a vethernet is created on the switch for every vNIC.



61
62
63
# File 'lib/intersight_client/models/vnic_eth_if.rb', line 61

def vif_id
  @vif_id
end

#vmq_settingsObject

Returns the value of attribute vmq_settings.



63
64
65
# File 'lib/intersight_client/models/vnic_eth_if.rb', line 63

def vmq_settings
  @vmq_settings
end

Class Method Details

.acceptable_attribute_mapObject

Returns the key-value map of all the JSON attributes this model knows about, including the ones defined in its parent(s)



157
158
159
# File 'lib/intersight_client/models/vnic_eth_if.rb', line 157

def self.acceptable_attribute_map
  attribute_map.merge(superclass.acceptable_attribute_map)
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about, including the ones defined in its parent(s)



152
153
154
# File 'lib/intersight_client/models/vnic_eth_if.rb', line 152

def self.acceptable_attributes
  attribute_map.values.concat(superclass.acceptable_attributes)
end

.attribute_mapObject

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



116
117
118
119
120
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
# File 'lib/intersight_client/models/vnic_eth_if.rb', line 116

def self.attribute_map
  {
    :'class_id' => :'ClassId',
    :'object_type' => :'ObjectType',
    :'cdn' => :'Cdn',
    :'failover_enabled' => :'FailoverEnabled',
    :'iscsi_ip_v4_address_allocation_type' => :'IscsiIpV4AddressAllocationType',
    :'iscsi_ip_v4_config' => :'IscsiIpV4Config',
    :'iscsi_ipv4_address' => :'IscsiIpv4Address',
    :'mac_address' => :'MacAddress',
    :'mac_address_type' => :'MacAddressType',
    :'name' => :'Name',
    :'order' => :'Order',
    :'placement' => :'Placement',
    :'standby_vif_id' => :'StandbyVifId',
    :'static_mac_address' => :'StaticMacAddress',
    :'usnic_settings' => :'UsnicSettings',
    :'vif_id' => :'VifId',
    :'vmq_settings' => :'VmqSettings',
    :'eth_adapter_policy' => :'EthAdapterPolicy',
    :'eth_network_policy' => :'EthNetworkPolicy',
    :'eth_qos_policy' => :'EthQosPolicy',
    :'fabric_eth_network_control_policy' => :'FabricEthNetworkControlPolicy',
    :'fabric_eth_network_group_policy' => :'FabricEthNetworkGroupPolicy',
    :'ip_lease' => :'IpLease',
    :'iscsi_boot_policy' => :'IscsiBootPolicy',
    :'lan_connectivity_policy' => :'LanConnectivityPolicy',
    :'lcp_vnic' => :'LcpVnic',
    :'mac_lease' => :'MacLease',
    :'mac_pool' => :'MacPool',
    :'profile' => :'Profile',
    :'sp_vnics' => :'SpVnics'
  }
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



542
543
544
# File 'lib/intersight_client/models/vnic_eth_if.rb', line 542

def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end

.openapi_all_ofObject

List of class defined in allOf (OpenAPI v3)



211
212
213
214
215
216
# File 'lib/intersight_client/models/vnic_eth_if.rb', line 211

def self.openapi_all_of
  [
  :'MoBaseMo',
  :'VnicEthIfAllOf'
  ]
end

.openapi_discriminator_nameObject

discriminator’s property name in OpenAPI v3



219
220
221
# File 'lib/intersight_client/models/vnic_eth_if.rb', line 219

def self.openapi_discriminator_name
  :'ClassId'
end

.openapi_nullableObject

List of attributes with nullable: true



198
199
200
201
202
203
204
205
206
207
208
# File 'lib/intersight_client/models/vnic_eth_if.rb', line 198

def self.openapi_nullable
  Set.new([
    :'cdn',
    :'iscsi_ip_v4_config',
    :'placement',
    :'usnic_settings',
    :'vmq_settings',
    :'fabric_eth_network_group_policy',
    :'sp_vnics'
  ])
end

.openapi_typesObject

Attribute type mapping.



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
# File 'lib/intersight_client/models/vnic_eth_if.rb', line 162

def self.openapi_types
  {
    :'class_id' => :'String',
    :'object_type' => :'String',
    :'cdn' => :'VnicCdn',
    :'failover_enabled' => :'Boolean',
    :'iscsi_ip_v4_address_allocation_type' => :'String',
    :'iscsi_ip_v4_config' => :'IppoolIpV4Config',
    :'iscsi_ipv4_address' => :'String',
    :'mac_address' => :'String',
    :'mac_address_type' => :'String',
    :'name' => :'String',
    :'order' => :'Integer',
    :'placement' => :'VnicPlacementSettings',
    :'standby_vif_id' => :'Integer',
    :'static_mac_address' => :'String',
    :'usnic_settings' => :'VnicUsnicSettings',
    :'vif_id' => :'Integer',
    :'vmq_settings' => :'VnicVmqSettings',
    :'eth_adapter_policy' => :'VnicEthAdapterPolicyRelationship',
    :'eth_network_policy' => :'VnicEthNetworkPolicyRelationship',
    :'eth_qos_policy' => :'VnicEthQosPolicyRelationship',
    :'fabric_eth_network_control_policy' => :'FabricEthNetworkControlPolicyRelationship',
    :'fabric_eth_network_group_policy' => :'Array<FabricEthNetworkGroupPolicyRelationship>',
    :'ip_lease' => :'IppoolIpLeaseRelationship',
    :'iscsi_boot_policy' => :'VnicIscsiBootPolicyRelationship',
    :'lan_connectivity_policy' => :'VnicLanConnectivityPolicyRelationship',
    :'lcp_vnic' => :'VnicEthIfRelationship',
    :'mac_lease' => :'MacpoolLeaseRelationship',
    :'mac_pool' => :'MacpoolPoolRelationship',
    :'profile' => :'PolicyAbstractConfigProfileRelationship',
    :'sp_vnics' => :'Array<VnicEthIfRelationship>'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
# File 'lib/intersight_client/models/vnic_eth_if.rb', line 492

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      class_id == o.class_id &&
      object_type == o.object_type &&
      cdn == o.cdn &&
      failover_enabled == o.failover_enabled &&
      iscsi_ip_v4_address_allocation_type == o.iscsi_ip_v4_address_allocation_type &&
      iscsi_ip_v4_config == o.iscsi_ip_v4_config &&
      iscsi_ipv4_address == o.iscsi_ipv4_address &&
      mac_address == o.mac_address &&
      mac_address_type == o.mac_address_type &&
      name == o.name &&
      order == o.order &&
      placement == o.placement &&
      standby_vif_id == o.standby_vif_id &&
      static_mac_address == o.static_mac_address &&
      usnic_settings == o.usnic_settings &&
      vif_id == o.vif_id &&
      vmq_settings == o.vmq_settings &&
      eth_adapter_policy == o.eth_adapter_policy &&
      eth_network_policy == o.eth_network_policy &&
      eth_qos_policy == o.eth_qos_policy &&
      fabric_eth_network_control_policy == o.fabric_eth_network_control_policy &&
      fabric_eth_network_group_policy == o.fabric_eth_network_group_policy &&
      ip_lease == o.ip_lease &&
      iscsi_boot_policy == o.iscsi_boot_policy &&
      lan_connectivity_policy == o.lan_connectivity_policy &&
      lcp_vnic == o.lcp_vnic &&
      mac_lease == o.mac_lease &&
      mac_pool == o.mac_pool &&
      profile == o.profile &&
      sp_vnics == o.sp_vnics && super(o)
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
# File 'lib/intersight_client/models/vnic_eth_if.rb', line 573

def _deserialize(type, value)
  case type.to_sym
  when :Time
    Time.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    # models (e.g. Pet) or oneOf
    klass = IntersightClient.const_get(type)
    klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



644
645
646
647
648
649
650
651
652
653
654
655
656
# File 'lib/intersight_client/models/vnic_eth_if.rb', line 644

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
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



549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
# File 'lib/intersight_client/models/vnic_eth_if.rb', line 549

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  super(attributes)
  VnicEthIf.openapi_types.each_pair do |key, type|
    if attributes[VnicEthIf.attribute_map[key]].nil? && VnicEthIf.openapi_nullable.include?(key)
      self.send("#{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[VnicEthIf.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[VnicEthIf.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[VnicEthIf.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[VnicEthIf.attribute_map[key]]))
    end
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


529
530
531
# File 'lib/intersight_client/models/vnic_eth_if.rb', line 529

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



535
536
537
# File 'lib/intersight_client/models/vnic_eth_if.rb', line 535

def hash
  [class_id, object_type, cdn, failover_enabled, iscsi_ip_v4_address_allocation_type, iscsi_ip_v4_config, iscsi_ipv4_address, mac_address, mac_address_type, name, order, placement, standby_vif_id, static_mac_address, usnic_settings, vif_id, vmq_settings, eth_adapter_policy, eth_network_policy, eth_qos_policy, fabric_eth_network_control_policy, fabric_eth_network_group_policy, ip_lease, iscsi_boot_policy, lan_connectivity_policy, lcp_vnic, mac_lease, mac_pool, profile, sp_vnics].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
# File 'lib/intersight_client/models/vnic_eth_if.rb', line 378

def list_invalid_properties
  invalid_properties = super
  if @class_id.nil?
    invalid_properties.push('invalid value for "class_id", class_id cannot be nil.')
  end

  if @object_type.nil?
    invalid_properties.push('invalid value for "object_type", object_type cannot be nil.')
  end

  pattern = Regexp.new(/^$|^([1-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$/)
  if !@iscsi_ipv4_address.nil? && @iscsi_ipv4_address !~ pattern
    invalid_properties.push("invalid value for \"iscsi_ipv4_address\", must conform to the pattern #{pattern}.")
  end

  if !@name.nil? && @name.to_s.length > 31
    invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 31.')
  end

  pattern = Regexp.new(/^[a-zA-Z0-9\-._:]+$/)
  if !@name.nil? && @name !~ pattern
    invalid_properties.push("invalid value for \"name\", must conform to the pattern #{pattern}.")
  end

  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



620
621
622
# File 'lib/intersight_client/models/vnic_eth_if.rb', line 620

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



626
627
628
629
630
631
632
633
634
635
636
637
638
# File 'lib/intersight_client/models/vnic_eth_if.rb', line 626

def to_hash
  hash = super
  VnicEthIf.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = VnicEthIf.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



614
615
616
# File 'lib/intersight_client/models/vnic_eth_if.rb', line 614

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
# File 'lib/intersight_client/models/vnic_eth_if.rb', line 407

def valid?
  return false if @class_id.nil?
  class_id_validator = EnumAttributeValidator.new('String', ["vnic.EthIf"])
  return false unless class_id_validator.valid?(@class_id)
  return false if @object_type.nil?
  object_type_validator = EnumAttributeValidator.new('String', ["vnic.EthIf"])
  return false unless object_type_validator.valid?(@object_type)
  iscsi_ip_v4_address_allocation_type_validator = EnumAttributeValidator.new('String', ["None", "DHCP", "Static", "Pool"])
  return false unless iscsi_ip_v4_address_allocation_type_validator.valid?(@iscsi_ip_v4_address_allocation_type)
  return false if !@iscsi_ipv4_address.nil? && @iscsi_ipv4_address !~ Regexp.new(/^$|^([1-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$/)
  mac_address_type_validator = EnumAttributeValidator.new('String', ["POOL", "STATIC"])
  return false unless mac_address_type_validator.valid?(@mac_address_type)
  return false if !@name.nil? && @name.to_s.length > 31
  return false if !@name.nil? && @name !~ Regexp.new(/^[a-zA-Z0-9\-._:]+$/)
  true && super
end