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.



33258
33259
33260
33261
33262
33263
33264
33265
33266
33267
33268
33269
33270
33271
33272
33273
33274
# File 'lib/ovirtsdk4/types.rb', line 33258

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.



33279
33280
33281
33282
33283
33284
33285
33286
33287
33288
33289
33290
33291
33292
33293
33294
33295
# File 'lib/ovirtsdk4/types.rb', line 33279

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:



32817
32818
32819
# File 'lib/ovirtsdk4/types.rb', line 32817

def clusters
  @clusters
end

#clusters=(list) ⇒ Object

Sets the value of the clusters attribute.

Parameters:



32826
32827
32828
32829
32830
32831
32832
32833
32834
32835
32836
# File 'lib/ovirtsdk4/types.rb', line 32826

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)


32843
32844
32845
# File 'lib/ovirtsdk4/types.rb', line 32843

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


32852
32853
32854
# File 'lib/ovirtsdk4/types.rb', line 32852

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


32861
32862
32863
# File 'lib/ovirtsdk4/types.rb', line 32861

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


32870
32871
32872
# File 'lib/ovirtsdk4/types.rb', line 32870

def description=(value)
  @description = value
end

#hashObject

Generates a hash value for this object.



33300
33301
33302
33303
33304
33305
33306
33307
33308
33309
33310
33311
33312
33313
33314
33315
33316
# File 'lib/ovirtsdk4/types.rb', line 33300

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)


32879
32880
32881
# File 'lib/ovirtsdk4/types.rb', line 32879

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


32888
32889
32890
# File 'lib/ovirtsdk4/types.rb', line 32888

def id=(value)
  @id = value
end

#iscsi_bondsArray<IscsiBond>

Returns the value of the iscsi_bonds attribute.

Returns:



32897
32898
32899
# File 'lib/ovirtsdk4/types.rb', line 32897

def iscsi_bonds
  @iscsi_bonds
end

#iscsi_bonds=(list) ⇒ Object

Sets the value of the iscsi_bonds attribute.

Parameters:



32906
32907
32908
32909
32910
32911
32912
32913
32914
32915
32916
# File 'lib/ovirtsdk4/types.rb', line 32906

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)


32923
32924
32925
# File 'lib/ovirtsdk4/types.rb', line 32923

def local
  @local
end

#local=(value) ⇒ Object

Sets the value of the local attribute.

Parameters:

  • value (Boolean)


32932
32933
32934
# File 'lib/ovirtsdk4/types.rb', line 32932

def local=(value)
  @local = value
end

#mac_poolMacPool

Returns the value of the mac_pool attribute.

Returns:



32941
32942
32943
# File 'lib/ovirtsdk4/types.rb', line 32941

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:



32954
32955
32956
32957
32958
32959
# File 'lib/ovirtsdk4/types.rb', line 32954

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)


32966
32967
32968
# File 'lib/ovirtsdk4/types.rb', line 32966

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


32975
32976
32977
# File 'lib/ovirtsdk4/types.rb', line 32975

def name=(value)
  @name = value
end

#networksArray<Network>

Returns the value of the networks attribute.

Returns:



32984
32985
32986
# File 'lib/ovirtsdk4/types.rb', line 32984

def networks
  @networks
end

#networks=(list) ⇒ Object

Sets the value of the networks attribute.

Parameters:



32993
32994
32995
32996
32997
32998
32999
33000
33001
33002
33003
# File 'lib/ovirtsdk4/types.rb', line 32993

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:



33010
33011
33012
# File 'lib/ovirtsdk4/types.rb', line 33010

def permissions
  @permissions
end

#permissions=(list) ⇒ Object

Sets the value of the permissions attribute.

Parameters:



33019
33020
33021
33022
33023
33024
33025
33026
33027
33028
33029
# File 'lib/ovirtsdk4/types.rb', line 33019

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:



33036
33037
33038
# File 'lib/ovirtsdk4/types.rb', line 33036

def qoss
  @qoss
end

#qoss=(list) ⇒ Object

Sets the value of the qoss attribute.

Parameters:

  • list (Array<Qos>)


33045
33046
33047
33048
33049
33050
33051
33052
33053
33054
33055
# File 'lib/ovirtsdk4/types.rb', line 33045

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:



33062
33063
33064
# File 'lib/ovirtsdk4/types.rb', line 33062

def quota_mode
  @quota_mode
end

#quota_mode=(value) ⇒ Object

Sets the value of the quota_mode attribute.

Parameters:



33071
33072
33073
# File 'lib/ovirtsdk4/types.rb', line 33071

def quota_mode=(value)
  @quota_mode = value
end

#quotasArray<Quota>

Returns the value of the quotas attribute.

Returns:



33080
33081
33082
# File 'lib/ovirtsdk4/types.rb', line 33080

def quotas
  @quotas
end

#quotas=(list) ⇒ Object

Sets the value of the quotas attribute.

Parameters:



33089
33090
33091
33092
33093
33094
33095
33096
33097
33098
33099
# File 'lib/ovirtsdk4/types.rb', line 33089

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:



33106
33107
33108
# File 'lib/ovirtsdk4/types.rb', line 33106

def status
  @status
end

#status=(value) ⇒ Object

Sets the value of the status attribute.

Parameters:



33115
33116
33117
# File 'lib/ovirtsdk4/types.rb', line 33115

def status=(value)
  @status = value
end

#storage_domainsArray<StorageDomain>

Returns the value of the storage_domains attribute.

Returns:



33124
33125
33126
# File 'lib/ovirtsdk4/types.rb', line 33124

def storage_domains
  @storage_domains
end

#storage_domains=(list) ⇒ Object

Sets the value of the storage_domains attribute.

Parameters:



33133
33134
33135
33136
33137
33138
33139
33140
33141
33142
33143
# File 'lib/ovirtsdk4/types.rb', line 33133

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:



33150
33151
33152
# File 'lib/ovirtsdk4/types.rb', line 33150

def storage_format
  @storage_format
end

#storage_format=(value) ⇒ Object

Sets the value of the storage_format attribute.

Parameters:



33159
33160
33161
# File 'lib/ovirtsdk4/types.rb', line 33159

def storage_format=(value)
  @storage_format = value
end

#supported_versionsArray<Version>

Returns the value of the supported_versions attribute.

Returns:



33168
33169
33170
# File 'lib/ovirtsdk4/types.rb', line 33168

def supported_versions
  @supported_versions
end

#supported_versions=(list) ⇒ Object

Sets the value of the supported_versions attribute.

Parameters:



33177
33178
33179
33180
33181
33182
33183
33184
33185
33186
33187
# File 'lib/ovirtsdk4/types.rb', line 33177

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:



33194
33195
33196
# File 'lib/ovirtsdk4/types.rb', line 33194

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:



33207
33208
33209
33210
33211
33212
# File 'lib/ovirtsdk4/types.rb', line 33207

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