class OvirtSDK4::Network

Public Class Methods

new(opts = {}) click to toggle source

Creates a new instance of the {Network} class.

@param opts [Hash] 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.

@option opts [Cluster, Hash] :cluster The value of attribute `cluster`.

@option opts [String] :comment The value of attribute `comment`.

@option opts [DataCenter, Hash] :data_center The value of attribute `data_center`.

@option opts [String] :description The value of attribute `description`.

@option opts [Boolean] :display The value of attribute `display`.

@option opts [DnsResolverConfiguration, Hash] :dns_resolver_configuration The value of attribute `dns_resolver_configuration`.

@option opts [OpenStackNetworkProvider, Hash] :external_provider The value of attribute `external_provider`.

@option opts [Network, Hash] :external_provider_physical_network The value of attribute `external_provider_physical_network`.

@option opts [String] :id The value of attribute `id`.

@option opts [Ip, Hash] :ip The value of attribute `ip`.

@option opts [Integer] :mtu The value of attribute `mtu`.

@option opts [String] :name The value of attribute `name`.

@option opts [Array<NetworkLabel>, Array<Hash>] :network_labels The values of attribute `network_labels`.

@option opts [Array<Permission>, Array<Hash>] :permissions The values of attribute `permissions`.

@option opts [Boolean] :profile_required The value of attribute `profile_required`.

@option opts [Qos, Hash] :qos The value of attribute `qos`.

@option opts [Boolean] :required The value of attribute `required`.

@option opts [NetworkStatus] :status The value of attribute `status`.

@option opts [Boolean] :stp The value of attribute `stp`.

@option opts [Array<NetworkUsage>, Array<Hash>] :usages The values of attribute `usages`.

@option opts [String] :vdsm_name The value of attribute `vdsm_name`.

@option opts [Vlan, Hash] :vlan The value of attribute `vlan`.

@option opts [Array<VnicProfile>, Array<Hash>] :vnic_profiles The values of attribute `vnic_profiles`.

Calls superclass method OvirtSDK4::Identified.new
# File lib/ovirtsdk4/types.rb, line 10268
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.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

Public Instance Methods

==(other) click to toggle source

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

Calls superclass method OvirtSDK4::Identified#==
# File lib/ovirtsdk4/types.rb, line 10294
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 &&
  @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
cluster() click to toggle source

Returns the value of the `cluster` attribute.

@return [Cluster]

# File lib/ovirtsdk4/types.rb, line 9725
def cluster
  @cluster
end
cluster=(value) click to toggle source

Sets the value of the `cluster` attribute.

@param value [Cluster, Hash]

The `value` parameter can be an instance of {OvirtSDK4::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.

# File lib/ovirtsdk4/types.rb, line 9738
def cluster=(value)
  if value.is_a?(Hash)
    value = Cluster.new(value)
  end
  @cluster = value
end
comment() click to toggle source

Returns the value of the `comment` attribute.

@return [String]

# File lib/ovirtsdk4/types.rb, line 9750
def comment
  @comment
end
comment=(value) click to toggle source

Sets the value of the `comment` attribute.

@param value [String]

# File lib/ovirtsdk4/types.rb, line 9759
def comment=(value)
  @comment = value
end
data_center() click to toggle source

Returns the value of the `data_center` attribute.

@return [DataCenter]

# File lib/ovirtsdk4/types.rb, line 9768
def data_center
  @data_center
end
data_center=(value) click to toggle source

Sets the value of the `data_center` attribute.

@param value [DataCenter, Hash]

The `value` parameter can be an instance of {OvirtSDK4::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.

# File lib/ovirtsdk4/types.rb, line 9781
def data_center=(value)
  if value.is_a?(Hash)
    value = DataCenter.new(value)
  end
  @data_center = value
end
description() click to toggle source

Returns the value of the `description` attribute.

@return [String]

# File lib/ovirtsdk4/types.rb, line 9793
def description
  @description
end
description=(value) click to toggle source

Sets the value of the `description` attribute.

@param value [String]

# File lib/ovirtsdk4/types.rb, line 9802
def description=(value)
  @description = value
end
display() click to toggle source

Returns the value of the `display` attribute.

@return [Boolean]

# File lib/ovirtsdk4/types.rb, line 9811
def display
  @display
end
display=(value) click to toggle source

Sets the value of the `display` attribute.

@param value [Boolean]

# File lib/ovirtsdk4/types.rb, line 9820
def display=(value)
  @display = value
end
dns_resolver_configuration() click to toggle source

Returns the value of the `dns_resolver_configuration` attribute.

@return [DnsResolverConfiguration]

# File lib/ovirtsdk4/types.rb, line 9829
def dns_resolver_configuration
  @dns_resolver_configuration
end
dns_resolver_configuration=(value) click to toggle source

Sets the value of the `dns_resolver_configuration` attribute.

@param value [DnsResolverConfiguration, Hash]

The `value` parameter can be an instance of {OvirtSDK4::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.

# File lib/ovirtsdk4/types.rb, line 9842
def dns_resolver_configuration=(value)
  if value.is_a?(Hash)
    value = DnsResolverConfiguration.new(value)
  end
  @dns_resolver_configuration = value
end
external_provider() click to toggle source

Returns the value of the `external_provider` attribute.

@return [OpenStackNetworkProvider]

# File lib/ovirtsdk4/types.rb, line 9854
def external_provider
  @external_provider
end
external_provider=(value) click to toggle source

Sets the value of the `external_provider` attribute.

@param value [OpenStackNetworkProvider, Hash]

The `value` parameter can be an instance of {OvirtSDK4::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.

# File lib/ovirtsdk4/types.rb, line 9867
def external_provider=(value)
  if value.is_a?(Hash)
    value = OpenStackNetworkProvider.new(value)
  end
  @external_provider = value
end
external_provider_physical_network() click to toggle source

Returns the value of the `external_provider_physical_network` attribute.

@return [Network]

# File lib/ovirtsdk4/types.rb, line 9879
def external_provider_physical_network
  @external_provider_physical_network
end
external_provider_physical_network=(value) click to toggle source

Sets the value of the `external_provider_physical_network` attribute.

@param value [Network, Hash]

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.

# File lib/ovirtsdk4/types.rb, line 9892
def external_provider_physical_network=(value)
  if value.is_a?(Hash)
    value = Network.new(value)
  end
  @external_provider_physical_network = value
end
hash() click to toggle source

Generates a hash value for this object.

Calls superclass method OvirtSDK4::Identified#hash
# File lib/ovirtsdk4/types.rb, line 10320
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 +
  @profile_required.hash +
  @qos.hash +
  @required.hash +
  @status.hash +
  @stp.hash +
  @usages.hash +
  @vdsm_name.hash +
  @vlan.hash +
  @vnic_profiles.hash
end
id() click to toggle source

Returns the value of the `id` attribute.

@return [String]

# File lib/ovirtsdk4/types.rb, line 9904
def id
  @id
end
id=(value) click to toggle source

Sets the value of the `id` attribute.

@param value [String]

# File lib/ovirtsdk4/types.rb, line 9913
def id=(value)
  @id = value
end
ip() click to toggle source

Returns the value of the `ip` attribute.

@return [Ip]

# File lib/ovirtsdk4/types.rb, line 9922
def ip
  @ip
end
ip=(value) click to toggle source

Sets the value of the `ip` attribute.

@param value [Ip, Hash]

The `value` parameter can be an instance of {OvirtSDK4::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.

# File lib/ovirtsdk4/types.rb, line 9935
def ip=(value)
  if value.is_a?(Hash)
    value = Ip.new(value)
  end
  @ip = value
end
mtu() click to toggle source

Returns the value of the `mtu` attribute.

@return [Integer]

# File lib/ovirtsdk4/types.rb, line 9947
def mtu
  @mtu
end
mtu=(value) click to toggle source

Sets the value of the `mtu` attribute.

@param value [Integer]

# File lib/ovirtsdk4/types.rb, line 9956
def mtu=(value)
  @mtu = value
end
name() click to toggle source

Returns the value of the `name` attribute.

@return [String]

# File lib/ovirtsdk4/types.rb, line 9965
def name
  @name
end
name=(value) click to toggle source

Sets the value of the `name` attribute.

@param value [String]

# File lib/ovirtsdk4/types.rb, line 9974
def name=(value)
  @name = value
end
network_labels() click to toggle source

Returns the value of the `network_labels` attribute.

@return [Array<NetworkLabel>]

# File lib/ovirtsdk4/types.rb, line 9983
def network_labels
  @network_labels
end
network_labels=(list) click to toggle source

Sets the value of the `network_labels` attribute.

@param list [Array<NetworkLabel>]

# File lib/ovirtsdk4/types.rb, line 9992
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
permissions() click to toggle source

Returns the value of the `permissions` attribute.

@return [Array<Permission>]

# File lib/ovirtsdk4/types.rb, line 10009
def permissions
  @permissions
end
permissions=(list) click to toggle source

Sets the value of the `permissions` attribute.

@param list [Array<Permission>]

# File lib/ovirtsdk4/types.rb, line 10018
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
profile_required() click to toggle source

Returns the value of the `profile_required` attribute.

@return [Boolean]

# File lib/ovirtsdk4/types.rb, line 10035
def profile_required
  @profile_required
end
profile_required=(value) click to toggle source

Sets the value of the `profile_required` attribute.

@param value [Boolean]

# File lib/ovirtsdk4/types.rb, line 10044
def profile_required=(value)
  @profile_required = value
end
qos() click to toggle source

Returns the value of the `qos` attribute.

@return [Qos]

# File lib/ovirtsdk4/types.rb, line 10053
def qos
  @qos
end
qos=(value) click to toggle source

Sets the value of the `qos` attribute.

@param value [Qos, Hash]

The `value` parameter can be an instance of {OvirtSDK4::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.

# File lib/ovirtsdk4/types.rb, line 10066
def qos=(value)
  if value.is_a?(Hash)
    value = Qos.new(value)
  end
  @qos = value
end
required() click to toggle source

Returns the value of the `required` attribute.

@return [Boolean]

# File lib/ovirtsdk4/types.rb, line 10078
def required
  @required
end
required=(value) click to toggle source

Sets the value of the `required` attribute.

@param value [Boolean]

# File lib/ovirtsdk4/types.rb, line 10087
def required=(value)
  @required = value
end
status() click to toggle source

Returns the value of the `status` attribute.

@return [NetworkStatus]

# File lib/ovirtsdk4/types.rb, line 10096
def status
  @status
end
status=(value) click to toggle source

Sets the value of the `status` attribute.

@param value [NetworkStatus]

# File lib/ovirtsdk4/types.rb, line 10105
def status=(value)
  @status = value
end
stp() click to toggle source

Returns the value of the `stp` attribute.

@return [Boolean]

# File lib/ovirtsdk4/types.rb, line 10114
def stp
  @stp
end
stp=(value) click to toggle source

Sets the value of the `stp` attribute.

@param value [Boolean]

# File lib/ovirtsdk4/types.rb, line 10123
def stp=(value)
  @stp = value
end
usages() click to toggle source

Returns the value of the `usages` attribute.

@return [Array<NetworkUsage>]

# File lib/ovirtsdk4/types.rb, line 10132
def usages
  @usages
end
usages=(list) click to toggle source

Sets the value of the `usages` attribute.

@param list [Array<NetworkUsage>]

# File lib/ovirtsdk4/types.rb, line 10141
def usages=(list)
  @usages = list
end
vdsm_name() click to toggle source

Returns the value of the `vdsm_name` attribute.

@return [String]

# File lib/ovirtsdk4/types.rb, line 10150
def vdsm_name
  @vdsm_name
end
vdsm_name=(value) click to toggle source

Sets the value of the `vdsm_name` attribute.

@param value [String]

# File lib/ovirtsdk4/types.rb, line 10159
def vdsm_name=(value)
  @vdsm_name = value
end
vlan() click to toggle source

Returns the value of the `vlan` attribute.

@return [Vlan]

# File lib/ovirtsdk4/types.rb, line 10168
def vlan
  @vlan
end
vlan=(value) click to toggle source

Sets the value of the `vlan` attribute.

@param value [Vlan, Hash]

The `value` parameter can be an instance of {OvirtSDK4::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.

# File lib/ovirtsdk4/types.rb, line 10181
def vlan=(value)
  if value.is_a?(Hash)
    value = Vlan.new(value)
  end
  @vlan = value
end
vnic_profiles() click to toggle source

Returns the value of the `vnic_profiles` attribute.

@return [Array<VnicProfile>]

# File lib/ovirtsdk4/types.rb, line 10193
def vnic_profiles
  @vnic_profiles
end
vnic_profiles=(list) click to toggle source

Sets the value of the `vnic_profiles` attribute.

@param list [Array<VnicProfile>]

# File lib/ovirtsdk4/types.rb, line 10202
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