Class: OvirtSDK4::DataCenter

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

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

  • :clusters (Array<Cluster>, Array<Hash>)

    The values of attribute clusters.

  • :comment (String)

    The value of attribute comment.

  • :description (String)

    The value of attribute description.

  • :id (String)

    The value of attribute id.

  • :iscsi_bonds (Array<IscsiBond>, Array<Hash>)

    The values of attribute iscsi_bonds.

  • :local (Boolean)

    The value of attribute local.

  • :mac_pool (MacPool, Hash)

    The value of attribute mac_pool.

  • :name (String)

    The value of attribute name.

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

    The values of attribute networks.

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

    The values of attribute permissions.

  • :qoss (Array<Qos>, Array<Hash>)

    The values of attribute qoss.

  • :quota_mode (QuotaModeType)

    The value of attribute quota_mode.

  • :quotas (Array<Quota>, Array<Hash>)

    The values of attribute quotas.

  • :status (DataCenterStatus)

    The value of attribute status.

  • :storage_domains (Array<StorageDomain>, Array<Hash>)

    The values of attribute storage_domains.

  • :storage_format (StorageFormat)

    The value of attribute storage_format.

  • :supported_versions (Array<Version>, Array<Hash>)

    The values of attribute supported_versions.

  • :version (Version, Hash)

    The value of attribute version.



36075
36076
36077
36078
36079
36080
36081
36082
36083
36084
36085
36086
36087
36088
36089
36090
36091
# File 'lib/ovirtsdk4/types.rb', line 36075

def initialize(opts = {})
  super(opts)
  self.clusters = opts[:clusters]
  self.iscsi_bonds = opts[:iscsi_bonds]
  self.local = opts[:local]
  self.mac_pool = opts[:mac_pool]
  self.networks = opts[:networks]
  self.permissions = opts[:permissions]
  self.qoss = opts[:qoss]
  self.quota_mode = opts[:quota_mode]
  self.quotas = opts[:quotas]
  self.status = opts[:status]
  self.storage_domains = opts[:storage_domains]
  self.storage_format = opts[:storage_format]
  self.supported_versions = opts[:supported_versions]
  self.version = opts[:version]
end

Instance Method Details

#==(other) ⇒ Object

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



36096
36097
36098
36099
36100
36101
36102
36103
36104
36105
36106
36107
36108
36109
36110
36111
36112
# File 'lib/ovirtsdk4/types.rb', line 36096

def ==(other)
  super &&
  @clusters == other.clusters &&
  @iscsi_bonds == other.iscsi_bonds &&
  @local == other.local &&
  @mac_pool == other.mac_pool &&
  @networks == other.networks &&
  @permissions == other.permissions &&
  @qoss == other.qoss &&
  @quota_mode == other.quota_mode &&
  @quotas == other.quotas &&
  @status == other.status &&
  @storage_domains == other.storage_domains &&
  @storage_format == other.storage_format &&
  @supported_versions == other.supported_versions &&
  @version == other.version
end

#clustersArray<Cluster>

Returns the value of the clusters attribute.

Returns:



35634
35635
35636
# File 'lib/ovirtsdk4/types.rb', line 35634

def clusters
  @clusters
end

#clusters=(list) ⇒ Object

Sets the value of the clusters attribute.

Parameters:



35643
35644
35645
35646
35647
35648
35649
35650
35651
35652
35653
# File 'lib/ovirtsdk4/types.rb', line 35643

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

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)


35660
35661
35662
# File 'lib/ovirtsdk4/types.rb', line 35660

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


35669
35670
35671
# File 'lib/ovirtsdk4/types.rb', line 35669

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


35678
35679
35680
# File 'lib/ovirtsdk4/types.rb', line 35678

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


35687
35688
35689
# File 'lib/ovirtsdk4/types.rb', line 35687

def description=(value)
  @description = value
end

#hashObject

Generates a hash value for this object.



36117
36118
36119
36120
36121
36122
36123
36124
36125
36126
36127
36128
36129
36130
36131
36132
36133
# File 'lib/ovirtsdk4/types.rb', line 36117

def hash
  super +
  @clusters.hash +
  @iscsi_bonds.hash +
  @local.hash +
  @mac_pool.hash +
  @networks.hash +
  @permissions.hash +
  @qoss.hash +
  @quota_mode.hash +
  @quotas.hash +
  @status.hash +
  @storage_domains.hash +
  @storage_format.hash +
  @supported_versions.hash +
  @version.hash
end

#idString

Returns the value of the id attribute.

Returns:

  • (String)


35696
35697
35698
# File 'lib/ovirtsdk4/types.rb', line 35696

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


35705
35706
35707
# File 'lib/ovirtsdk4/types.rb', line 35705

def id=(value)
  @id = value
end

#iscsi_bondsArray<IscsiBond>

Returns the value of the iscsi_bonds attribute.

Returns:



35714
35715
35716
# File 'lib/ovirtsdk4/types.rb', line 35714

def iscsi_bonds
  @iscsi_bonds
end

#iscsi_bonds=(list) ⇒ Object

Sets the value of the iscsi_bonds attribute.

Parameters:



35723
35724
35725
35726
35727
35728
35729
35730
35731
35732
35733
# File 'lib/ovirtsdk4/types.rb', line 35723

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

#localBoolean

Returns the value of the local attribute.

Returns:

  • (Boolean)


35740
35741
35742
# File 'lib/ovirtsdk4/types.rb', line 35740

def local
  @local
end

#local=(value) ⇒ Object

Sets the value of the local attribute.

Parameters:

  • value (Boolean)


35749
35750
35751
# File 'lib/ovirtsdk4/types.rb', line 35749

def local=(value)
  @local = value
end

#mac_poolMacPool

Returns the value of the mac_pool attribute.

Returns:



35758
35759
35760
# File 'lib/ovirtsdk4/types.rb', line 35758

def mac_pool
  @mac_pool
end

#mac_pool=(value) ⇒ Object

Sets the value of the mac_pool attribute.

The value parameter can be an instance of MacPool 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:



35771
35772
35773
35774
35775
35776
# File 'lib/ovirtsdk4/types.rb', line 35771

def mac_pool=(value)
  if value.is_a?(Hash)
    value = MacPool.new(value)
  end
  @mac_pool = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


35783
35784
35785
# File 'lib/ovirtsdk4/types.rb', line 35783

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


35792
35793
35794
# File 'lib/ovirtsdk4/types.rb', line 35792

def name=(value)
  @name = value
end

#networksArray<Network>

Returns the value of the networks attribute.

Returns:



35801
35802
35803
# File 'lib/ovirtsdk4/types.rb', line 35801

def networks
  @networks
end

#networks=(list) ⇒ Object

Sets the value of the networks attribute.

Parameters:



35810
35811
35812
35813
35814
35815
35816
35817
35818
35819
35820
# File 'lib/ovirtsdk4/types.rb', line 35810

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

#permissionsArray<Permission>

Returns the value of the permissions attribute.

Returns:



35827
35828
35829
# File 'lib/ovirtsdk4/types.rb', line 35827

def permissions
  @permissions
end

#permissions=(list) ⇒ Object

Sets the value of the permissions attribute.

Parameters:



35836
35837
35838
35839
35840
35841
35842
35843
35844
35845
35846
# File 'lib/ovirtsdk4/types.rb', line 35836

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

#qossArray<Qos>

Returns the value of the qoss attribute.

Returns:



35853
35854
35855
# File 'lib/ovirtsdk4/types.rb', line 35853

def qoss
  @qoss
end

#qoss=(list) ⇒ Object

Sets the value of the qoss attribute.

Parameters:

  • list (Array<Qos>)


35862
35863
35864
35865
35866
35867
35868
35869
35870
35871
35872
# File 'lib/ovirtsdk4/types.rb', line 35862

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

#quota_modeQuotaModeType

Returns the value of the quota_mode attribute.

Returns:



35879
35880
35881
# File 'lib/ovirtsdk4/types.rb', line 35879

def quota_mode
  @quota_mode
end

#quota_mode=(value) ⇒ Object

Sets the value of the quota_mode attribute.

Parameters:



35888
35889
35890
# File 'lib/ovirtsdk4/types.rb', line 35888

def quota_mode=(value)
  @quota_mode = value
end

#quotasArray<Quota>

Returns the value of the quotas attribute.

Returns:



35897
35898
35899
# File 'lib/ovirtsdk4/types.rb', line 35897

def quotas
  @quotas
end

#quotas=(list) ⇒ Object

Sets the value of the quotas attribute.

Parameters:



35906
35907
35908
35909
35910
35911
35912
35913
35914
35915
35916
# File 'lib/ovirtsdk4/types.rb', line 35906

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

#statusDataCenterStatus

Returns the value of the status attribute.

Returns:



35923
35924
35925
# File 'lib/ovirtsdk4/types.rb', line 35923

def status
  @status
end

#status=(value) ⇒ Object

Sets the value of the status attribute.

Parameters:



35932
35933
35934
# File 'lib/ovirtsdk4/types.rb', line 35932

def status=(value)
  @status = value
end

#storage_domainsArray<StorageDomain>

Returns the value of the storage_domains attribute.

Returns:



35941
35942
35943
# File 'lib/ovirtsdk4/types.rb', line 35941

def storage_domains
  @storage_domains
end

#storage_domains=(list) ⇒ Object

Sets the value of the storage_domains attribute.

Parameters:



35950
35951
35952
35953
35954
35955
35956
35957
35958
35959
35960
# File 'lib/ovirtsdk4/types.rb', line 35950

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

#storage_formatStorageFormat

Returns the value of the storage_format attribute.

Returns:



35967
35968
35969
# File 'lib/ovirtsdk4/types.rb', line 35967

def storage_format
  @storage_format
end

#storage_format=(value) ⇒ Object

Sets the value of the storage_format attribute.

Parameters:



35976
35977
35978
# File 'lib/ovirtsdk4/types.rb', line 35976

def storage_format=(value)
  @storage_format = value
end

#supported_versionsArray<Version>

Returns the value of the supported_versions attribute.

Returns:



35985
35986
35987
# File 'lib/ovirtsdk4/types.rb', line 35985

def supported_versions
  @supported_versions
end

#supported_versions=(list) ⇒ Object

Sets the value of the supported_versions attribute.

Parameters:



35994
35995
35996
35997
35998
35999
36000
36001
36002
36003
36004
# File 'lib/ovirtsdk4/types.rb', line 35994

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

#versionVersion

Returns the value of the version attribute.

Returns:



36011
36012
36013
# File 'lib/ovirtsdk4/types.rb', line 36011

def version
  @version
end

#version=(value) ⇒ Object

Sets the value of the version attribute.

The value parameter can be an instance of Version 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:



36024
36025
36026
36027
36028
36029
# File 'lib/ovirtsdk4/types.rb', line 36024

def version=(value)
  if value.is_a?(Hash)
    value = Version.new(value)
  end
  @version = value
end