Class: OvirtSDK4::Network

Inherits:
Identified show all
Defined in:
lib/ovirtsdk4/types.rb,
lib/ovirtsdk4/types.rb

Instance Method Summary collapse

Methods included from Type

#dig, #href, #href=

Constructor Details

#initialize(opts = {}) ⇒ Network

Creates a new instance of the OvirtSDK4::Network class.

Parameters:

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

    A hash containing the attributes of the object. The keys of the hash should be symbols corresponding to the names of the attributes. The values of the hash should be the values of the attributes.

Options Hash (opts):

  • :cluster (Cluster, Hash)

    The value of attribute cluster.

  • :comment (String)

    The value of attribute comment.

  • :data_center (DataCenter, Hash)

    The value of attribute data_center.

  • :description (String)

    The value of attribute description.

  • :display (Boolean)

    The value of attribute display.

  • :dns_resolver_configuration (DnsResolverConfiguration, Hash)

    The value of attribute dns_resolver_configuration.

  • :external_provider (OpenStackNetworkProvider, Hash)

    The value of attribute external_provider.

  • :external_provider_physical_network (Network, Hash)

    The value of attribute external_provider_physical_network.

  • :id (String)

    The value of attribute id.

  • :ip (Ip, Hash)

    The value of attribute ip.

  • :mtu (Integer)

    The value of attribute mtu.

  • :name (String)

    The value of attribute name.

  • :network_labels (Array<NetworkLabel>, Array<Hash>)

    The values of attribute network_labels.

  • :permissions (Array<Permission>, Array<Hash>)

    The values of attribute permissions.

  • :port_isolation (Boolean)

    The value of attribute port_isolation.

  • :profile_required (Boolean)

    The value of attribute profile_required.

  • :qos (Qos, Hash)

    The value of attribute qos.

  • :required (Boolean)

    The value of attribute required.

  • :status (NetworkStatus)

    The value of attribute status.

  • :stp (Boolean)

    The value of attribute stp.

  • :usages (Array<NetworkUsage>, Array<Hash>)

    The values of attribute usages.

  • :vdsm_name (String)

    The value of attribute vdsm_name.

  • :vlan (Vlan, Hash)

    The value of attribute vlan.

  • :vnic_profiles (Array<VnicProfile>, Array<Hash>)

    The values of attribute vnic_profiles.



10798
10799
10800
10801
10802
10803
10804
10805
10806
10807
10808
10809
10810
10811
10812
10813
10814
10815
10816
10817
10818
10819
10820
# File 'lib/ovirtsdk4/types.rb', line 10798

def initialize(opts = {})
  super(opts)
  self.cluster = opts[:cluster]
  self.data_center = opts[:data_center]
  self.display = opts[:display]
  self.dns_resolver_configuration = opts[:dns_resolver_configuration]
  self.external_provider = opts[:external_provider]
  self.external_provider_physical_network = opts[:external_provider_physical_network]
  self.ip = opts[:ip]
  self.mtu = opts[:mtu]
  self.network_labels = opts[:network_labels]
  self.permissions = opts[:permissions]
  self.port_isolation = opts[:port_isolation]
  self.profile_required = opts[:profile_required]
  self.qos = opts[:qos]
  self.required = opts[:required]
  self.status = opts[:status]
  self.stp = opts[:stp]
  self.usages = opts[:usages]
  self.vdsm_name = opts[:vdsm_name]
  self.vlan = opts[:vlan]
  self.vnic_profiles = opts[:vnic_profiles]
end

Instance Method Details

#==(other) ⇒ Object

Returns true if self and other have the same attributes and values.



10825
10826
10827
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
10844
10845
10846
10847
# File 'lib/ovirtsdk4/types.rb', line 10825

def ==(other)
  super &&
  @cluster == other.cluster &&
  @data_center == other.data_center &&
  @display == other.display &&
  @dns_resolver_configuration == other.dns_resolver_configuration &&
  @external_provider == other.external_provider &&
  @external_provider_physical_network == other.external_provider_physical_network &&
  @ip == other.ip &&
  @mtu == other.mtu &&
  @network_labels == other.network_labels &&
  @permissions == other.permissions &&
  @port_isolation == other.port_isolation &&
  @profile_required == other.profile_required &&
  @qos == other.qos &&
  @required == other.required &&
  @status == other.status &&
  @stp == other.stp &&
  @usages == other.usages &&
  @vdsm_name == other.vdsm_name &&
  @vlan == other.vlan &&
  @vnic_profiles == other.vnic_profiles
end

#clusterCluster

Returns the value of the cluster attribute.

Returns:



10235
10236
10237
# File 'lib/ovirtsdk4/types.rb', line 10235

def cluster
  @cluster
end

#cluster=(value) ⇒ Object

Sets the value of the cluster attribute.

The value parameter can be an instance of Cluster or a hash. If it is a hash then a new instance will be created passing the hash as the opts parameter to the constructor.

Parameters:



10248
10249
10250
10251
10252
10253
# File 'lib/ovirtsdk4/types.rb', line 10248

def cluster=(value)
  if value.is_a?(Hash)
    value = Cluster.new(value)
  end
  @cluster = value
end

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)


10260
10261
10262
# File 'lib/ovirtsdk4/types.rb', line 10260

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


10269
10270
10271
# File 'lib/ovirtsdk4/types.rb', line 10269

def comment=(value)
  @comment = value
end

#data_centerDataCenter

Returns the value of the data_center attribute.

Returns:



10278
10279
10280
# File 'lib/ovirtsdk4/types.rb', line 10278

def data_center
  @data_center
end

#data_center=(value) ⇒ Object

Sets the value of the data_center attribute.

The value parameter can be an instance of DataCenter or a hash. If it is a hash then a new instance will be created passing the hash as the opts parameter to the constructor.

Parameters:



10291
10292
10293
10294
10295
10296
# File 'lib/ovirtsdk4/types.rb', line 10291

def data_center=(value)
  if value.is_a?(Hash)
    value = DataCenter.new(value)
  end
  @data_center = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


10303
10304
10305
# File 'lib/ovirtsdk4/types.rb', line 10303

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


10312
10313
10314
# File 'lib/ovirtsdk4/types.rb', line 10312

def description=(value)
  @description = value
end

#displayBoolean

Returns the value of the display attribute.

Returns:

  • (Boolean)


10321
10322
10323
# File 'lib/ovirtsdk4/types.rb', line 10321

def display
  @display
end

#display=(value) ⇒ Object

Sets the value of the display attribute.

Parameters:

  • value (Boolean)


10330
10331
10332
# File 'lib/ovirtsdk4/types.rb', line 10330

def display=(value)
  @display = value
end

#dns_resolver_configurationDnsResolverConfiguration

Returns the value of the dns_resolver_configuration attribute.



10339
10340
10341
# File 'lib/ovirtsdk4/types.rb', line 10339

def dns_resolver_configuration
  @dns_resolver_configuration
end

#dns_resolver_configuration=(value) ⇒ Object

Sets the value of the dns_resolver_configuration attribute.

The value parameter can be an instance of DnsResolverConfiguration or a hash. If it is a hash then a new instance will be created passing the hash as the opts parameter to the constructor.

Parameters:



10352
10353
10354
10355
10356
10357
# File 'lib/ovirtsdk4/types.rb', line 10352

def dns_resolver_configuration=(value)
  if value.is_a?(Hash)
    value = DnsResolverConfiguration.new(value)
  end
  @dns_resolver_configuration = value
end

#external_providerOpenStackNetworkProvider

Returns the value of the external_provider attribute.



10364
10365
10366
# File 'lib/ovirtsdk4/types.rb', line 10364

def external_provider
  @external_provider
end

#external_provider=(value) ⇒ Object

Sets the value of the external_provider attribute.

The value parameter can be an instance of OpenStackNetworkProvider or a hash. If it is a hash then a new instance will be created passing the hash as the opts parameter to the constructor.

Parameters:



10377
10378
10379
10380
10381
10382
# File 'lib/ovirtsdk4/types.rb', line 10377

def external_provider=(value)
  if value.is_a?(Hash)
    value = OpenStackNetworkProvider.new(value)
  end
  @external_provider = value
end

#external_provider_physical_networkNetwork

Returns the value of the external_provider_physical_network attribute.

Returns:



10389
10390
10391
# File 'lib/ovirtsdk4/types.rb', line 10389

def external_provider_physical_network
  @external_provider_physical_network
end

#external_provider_physical_network=(value) ⇒ Object

Sets the value of the external_provider_physical_network attribute.

The value parameter can be an instance of OvirtSDK4::Network or a hash. If it is a hash then a new instance will be created passing the hash as the opts parameter to the constructor.

Parameters:



10402
10403
10404
10405
10406
10407
# File 'lib/ovirtsdk4/types.rb', line 10402

def external_provider_physical_network=(value)
  if value.is_a?(Hash)
    value = Network.new(value)
  end
  @external_provider_physical_network = value
end

#hashObject

Generates a hash value for this object.



10852
10853
10854
10855
10856
10857
10858
10859
10860
10861
10862
10863
10864
10865
10866
10867
10868
10869
10870
10871
10872
10873
10874
# File 'lib/ovirtsdk4/types.rb', line 10852

def hash
  super +
  @cluster.hash +
  @data_center.hash +
  @display.hash +
  @dns_resolver_configuration.hash +
  @external_provider.hash +
  @external_provider_physical_network.hash +
  @ip.hash +
  @mtu.hash +
  @network_labels.hash +
  @permissions.hash +
  @port_isolation.hash +
  @profile_required.hash +
  @qos.hash +
  @required.hash +
  @status.hash +
  @stp.hash +
  @usages.hash +
  @vdsm_name.hash +
  @vlan.hash +
  @vnic_profiles.hash
end

#idString

Returns the value of the id attribute.

Returns:

  • (String)


10414
10415
10416
# File 'lib/ovirtsdk4/types.rb', line 10414

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


10423
10424
10425
# File 'lib/ovirtsdk4/types.rb', line 10423

def id=(value)
  @id = value
end

#ipIp

Returns the value of the ip attribute.

Returns:



10432
10433
10434
# File 'lib/ovirtsdk4/types.rb', line 10432

def ip
  @ip
end

#ip=(value) ⇒ Object

Sets the value of the ip attribute.

The value parameter can be an instance of Ip or a hash. If it is a hash then a new instance will be created passing the hash as the opts parameter to the constructor.

Parameters:

  • value (Ip, Hash)


10445
10446
10447
10448
10449
10450
# File 'lib/ovirtsdk4/types.rb', line 10445

def ip=(value)
  if value.is_a?(Hash)
    value = Ip.new(value)
  end
  @ip = value
end

#mtuInteger

Returns the value of the mtu attribute.

Returns:

  • (Integer)


10457
10458
10459
# File 'lib/ovirtsdk4/types.rb', line 10457

def mtu
  @mtu
end

#mtu=(value) ⇒ Object

Sets the value of the mtu attribute.

Parameters:

  • value (Integer)


10466
10467
10468
# File 'lib/ovirtsdk4/types.rb', line 10466

def mtu=(value)
  @mtu = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


10475
10476
10477
# File 'lib/ovirtsdk4/types.rb', line 10475

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


10484
10485
10486
# File 'lib/ovirtsdk4/types.rb', line 10484

def name=(value)
  @name = value
end

#network_labelsArray<NetworkLabel>

Returns the value of the network_labels attribute.

Returns:



10493
10494
10495
# File 'lib/ovirtsdk4/types.rb', line 10493

def network_labels
  @network_labels
end

#network_labels=(list) ⇒ Object

Sets the value of the network_labels attribute.

Parameters:



10502
10503
10504
10505
10506
10507
10508
10509
10510
10511
10512
# File 'lib/ovirtsdk4/types.rb', line 10502

def network_labels=(list)
  if list.class == Array
    list = List.new(list)
    list.each_with_index do |value, index|
      if value.is_a?(Hash)
        list[index] = NetworkLabel.new(value)
      end
    end
  end
  @network_labels = list
end

#permissionsArray<Permission>

Returns the value of the permissions attribute.

Returns:



10519
10520
10521
# File 'lib/ovirtsdk4/types.rb', line 10519

def permissions
  @permissions
end

#permissions=(list) ⇒ Object

Sets the value of the permissions attribute.

Parameters:



10528
10529
10530
10531
10532
10533
10534
10535
10536
10537
10538
# File 'lib/ovirtsdk4/types.rb', line 10528

def permissions=(list)
  if list.class == Array
    list = List.new(list)
    list.each_with_index do |value, index|
      if value.is_a?(Hash)
        list[index] = Permission.new(value)
      end
    end
  end
  @permissions = list
end

#port_isolationBoolean

Returns the value of the port_isolation attribute.

Returns:

  • (Boolean)


10545
10546
10547
# File 'lib/ovirtsdk4/types.rb', line 10545

def port_isolation
  @port_isolation
end

#port_isolation=(value) ⇒ Object

Sets the value of the port_isolation attribute.

Parameters:

  • value (Boolean)


10554
10555
10556
# File 'lib/ovirtsdk4/types.rb', line 10554

def port_isolation=(value)
  @port_isolation = value
end

#profile_requiredBoolean

Returns the value of the profile_required attribute.

Returns:

  • (Boolean)


10563
10564
10565
# File 'lib/ovirtsdk4/types.rb', line 10563

def profile_required
  @profile_required
end

#profile_required=(value) ⇒ Object

Sets the value of the profile_required attribute.

Parameters:

  • value (Boolean)


10572
10573
10574
# File 'lib/ovirtsdk4/types.rb', line 10572

def profile_required=(value)
  @profile_required = value
end

#qosQos

Returns the value of the qos attribute.

Returns:



10581
10582
10583
# File 'lib/ovirtsdk4/types.rb', line 10581

def qos
  @qos
end

#qos=(value) ⇒ Object

Sets the value of the qos attribute.

The value parameter can be an instance of Qos or a hash. If it is a hash then a new instance will be created passing the hash as the opts parameter to the constructor.

Parameters:

  • value (Qos, Hash)


10594
10595
10596
10597
10598
10599
# File 'lib/ovirtsdk4/types.rb', line 10594

def qos=(value)
  if value.is_a?(Hash)
    value = Qos.new(value)
  end
  @qos = value
end

#requiredBoolean

Returns the value of the required attribute.

Returns:

  • (Boolean)


10606
10607
10608
# File 'lib/ovirtsdk4/types.rb', line 10606

def required
  @required
end

#required=(value) ⇒ Object

Sets the value of the required attribute.

Parameters:

  • value (Boolean)


10615
10616
10617
# File 'lib/ovirtsdk4/types.rb', line 10615

def required=(value)
  @required = value
end

#statusNetworkStatus

Returns the value of the status attribute.

Returns:



10624
10625
10626
# File 'lib/ovirtsdk4/types.rb', line 10624

def status
  @status
end

#status=(value) ⇒ Object

Sets the value of the status attribute.

Parameters:



10633
10634
10635
# File 'lib/ovirtsdk4/types.rb', line 10633

def status=(value)
  @status = value
end

#stpBoolean

Returns the value of the stp attribute.

Returns:

  • (Boolean)


10642
10643
10644
# File 'lib/ovirtsdk4/types.rb', line 10642

def stp
  @stp
end

#stp=(value) ⇒ Object

Sets the value of the stp attribute.

Parameters:

  • value (Boolean)


10651
10652
10653
# File 'lib/ovirtsdk4/types.rb', line 10651

def stp=(value)
  @stp = value
end

#usagesArray<NetworkUsage>

Returns the value of the usages attribute.

Returns:



10660
10661
10662
# File 'lib/ovirtsdk4/types.rb', line 10660

def usages
  @usages
end

#usages=(list) ⇒ Object

Sets the value of the usages attribute.

Parameters:



10669
10670
10671
# File 'lib/ovirtsdk4/types.rb', line 10669

def usages=(list)
  @usages = list
end

#vdsm_nameString

Returns the value of the vdsm_name attribute.

Returns:

  • (String)


10678
10679
10680
# File 'lib/ovirtsdk4/types.rb', line 10678

def vdsm_name
  @vdsm_name
end

#vdsm_name=(value) ⇒ Object

Sets the value of the vdsm_name attribute.

Parameters:

  • value (String)


10687
10688
10689
# File 'lib/ovirtsdk4/types.rb', line 10687

def vdsm_name=(value)
  @vdsm_name = value
end

#vlanVlan

Returns the value of the vlan attribute.

Returns:



10696
10697
10698
# File 'lib/ovirtsdk4/types.rb', line 10696

def vlan
  @vlan
end

#vlan=(value) ⇒ Object

Sets the value of the vlan attribute.

The value parameter can be an instance of Vlan or a hash. If it is a hash then a new instance will be created passing the hash as the opts parameter to the constructor.

Parameters:

  • value (Vlan, Hash)


10709
10710
10711
10712
10713
10714
# File 'lib/ovirtsdk4/types.rb', line 10709

def vlan=(value)
  if value.is_a?(Hash)
    value = Vlan.new(value)
  end
  @vlan = value
end

#vnic_profilesArray<VnicProfile>

Returns the value of the vnic_profiles attribute.

Returns:



10721
10722
10723
# File 'lib/ovirtsdk4/types.rb', line 10721

def vnic_profiles
  @vnic_profiles
end

#vnic_profiles=(list) ⇒ Object

Sets the value of the vnic_profiles attribute.

Parameters:



10730
10731
10732
10733
10734
10735
10736
10737
10738
10739
10740
# File 'lib/ovirtsdk4/types.rb', line 10730

def vnic_profiles=(list)
  if list.class == Array
    list = List.new(list)
    list.each_with_index do |value, index|
      if value.is_a?(Hash)
        list[index] = VnicProfile.new(value)
      end
    end
  end
  @vnic_profiles = list
end