Class: OvirtSDK4::IscsiBond

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 = {}) ⇒ IscsiBond

Creates a new instance of the OvirtSDK4::IscsiBond 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):

  • :comment (String)

    The value of attribute comment.

  • :data_center (DataCenter, Hash)

    The value of attribute data_center.

  • :description (String)

    The value of attribute description.

  • :id (String)

    The value of attribute id.

  • :name (String)

    The value of attribute name.

  • :networks (Array<Network>, Array<Hash>)

    The values of attribute networks.

  • :storage_connections (Array<StorageConnection>, Array<Hash>)

    The values of attribute storage_connections.


6872
6873
6874
6875
6876
6877
# File 'lib/ovirtsdk4/types.rb', line 6872

def initialize(opts = {})
  super(opts)
  self.data_center = opts[:data_center]
  self.networks = opts[:networks]
  self.storage_connections = opts[:storage_connections]
end

Instance Method Details

#==(other) ⇒ Object

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


6882
6883
6884
6885
6886
6887
# File 'lib/ovirtsdk4/types.rb', line 6882

def ==(other)
  super &&
  @data_center == other.data_center &&
  @networks == other.networks &&
  @storage_connections == other.storage_connections
end

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)

6706
6707
6708
# File 'lib/ovirtsdk4/types.rb', line 6706

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)

6715
6716
6717
# File 'lib/ovirtsdk4/types.rb', line 6715

def comment=(value)
  @comment = value
end

#data_centerDataCenter

Returns the value of the data_center attribute.

Returns:


6724
6725
6726
# File 'lib/ovirtsdk4/types.rb', line 6724

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:


6737
6738
6739
6740
6741
6742
# File 'lib/ovirtsdk4/types.rb', line 6737

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)

6749
6750
6751
# File 'lib/ovirtsdk4/types.rb', line 6749

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)

6758
6759
6760
# File 'lib/ovirtsdk4/types.rb', line 6758

def description=(value)
  @description = value
end

#hashObject

Generates a hash value for this object.


6892
6893
6894
6895
6896
6897
# File 'lib/ovirtsdk4/types.rb', line 6892

def hash
  super +
  @data_center.hash +
  @networks.hash +
  @storage_connections.hash
end

#idString

Returns the value of the id attribute.

Returns:

  • (String)

6767
6768
6769
# File 'lib/ovirtsdk4/types.rb', line 6767

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)

6776
6777
6778
# File 'lib/ovirtsdk4/types.rb', line 6776

def id=(value)
  @id = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)

6785
6786
6787
# File 'lib/ovirtsdk4/types.rb', line 6785

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)

6794
6795
6796
# File 'lib/ovirtsdk4/types.rb', line 6794

def name=(value)
  @name = value
end

#networksArray<Network>

Returns the value of the networks attribute.

Returns:


6803
6804
6805
# File 'lib/ovirtsdk4/types.rb', line 6803

def networks
  @networks
end

#networks=(list) ⇒ Object

Sets the value of the networks attribute.

Parameters:


6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
# File 'lib/ovirtsdk4/types.rb', line 6812

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

#storage_connectionsArray<StorageConnection>

Returns the value of the storage_connections attribute.

Returns:


6829
6830
6831
# File 'lib/ovirtsdk4/types.rb', line 6829

def storage_connections
  @storage_connections
end

#storage_connections=(list) ⇒ Object

Sets the value of the storage_connections attribute.

Parameters:


6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
# File 'lib/ovirtsdk4/types.rb', line 6838

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