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.



35782
35783
35784
35785
35786
35787
35788
35789
35790
35791
35792
35793
35794
35795
35796
35797
35798
# File 'lib/ovirtsdk4/types.rb', line 35782

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.



35803
35804
35805
35806
35807
35808
35809
35810
35811
35812
35813
35814
35815
35816
35817
35818
35819
# File 'lib/ovirtsdk4/types.rb', line 35803

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:



35341
35342
35343
# File 'lib/ovirtsdk4/types.rb', line 35341

def clusters
  @clusters
end

#clusters=(list) ⇒ Object

Sets the value of the clusters attribute.

Parameters:



35350
35351
35352
35353
35354
35355
35356
35357
35358
35359
35360
# File 'lib/ovirtsdk4/types.rb', line 35350

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)


35367
35368
35369
# File 'lib/ovirtsdk4/types.rb', line 35367

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


35376
35377
35378
# File 'lib/ovirtsdk4/types.rb', line 35376

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


35385
35386
35387
# File 'lib/ovirtsdk4/types.rb', line 35385

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


35394
35395
35396
# File 'lib/ovirtsdk4/types.rb', line 35394

def description=(value)
  @description = value
end

#hashObject

Generates a hash value for this object.



35824
35825
35826
35827
35828
35829
35830
35831
35832
35833
35834
35835
35836
35837
35838
35839
35840
# File 'lib/ovirtsdk4/types.rb', line 35824

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)


35403
35404
35405
# File 'lib/ovirtsdk4/types.rb', line 35403

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


35412
35413
35414
# File 'lib/ovirtsdk4/types.rb', line 35412

def id=(value)
  @id = value
end

#iscsi_bondsArray<IscsiBond>

Returns the value of the iscsi_bonds attribute.

Returns:



35421
35422
35423
# File 'lib/ovirtsdk4/types.rb', line 35421

def iscsi_bonds
  @iscsi_bonds
end

#iscsi_bonds=(list) ⇒ Object

Sets the value of the iscsi_bonds attribute.

Parameters:



35430
35431
35432
35433
35434
35435
35436
35437
35438
35439
35440
# File 'lib/ovirtsdk4/types.rb', line 35430

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)


35447
35448
35449
# File 'lib/ovirtsdk4/types.rb', line 35447

def local
  @local
end

#local=(value) ⇒ Object

Sets the value of the local attribute.

Parameters:

  • value (Boolean)


35456
35457
35458
# File 'lib/ovirtsdk4/types.rb', line 35456

def local=(value)
  @local = value
end

#mac_poolMacPool

Returns the value of the mac_pool attribute.

Returns:



35465
35466
35467
# File 'lib/ovirtsdk4/types.rb', line 35465

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:



35478
35479
35480
35481
35482
35483
# File 'lib/ovirtsdk4/types.rb', line 35478

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)


35490
35491
35492
# File 'lib/ovirtsdk4/types.rb', line 35490

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


35499
35500
35501
# File 'lib/ovirtsdk4/types.rb', line 35499

def name=(value)
  @name = value
end

#networksArray<Network>

Returns the value of the networks attribute.

Returns:



35508
35509
35510
# File 'lib/ovirtsdk4/types.rb', line 35508

def networks
  @networks
end

#networks=(list) ⇒ Object

Sets the value of the networks attribute.

Parameters:



35517
35518
35519
35520
35521
35522
35523
35524
35525
35526
35527
# File 'lib/ovirtsdk4/types.rb', line 35517

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:



35534
35535
35536
# File 'lib/ovirtsdk4/types.rb', line 35534

def permissions
  @permissions
end

#permissions=(list) ⇒ Object

Sets the value of the permissions attribute.

Parameters:



35543
35544
35545
35546
35547
35548
35549
35550
35551
35552
35553
# File 'lib/ovirtsdk4/types.rb', line 35543

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:



35560
35561
35562
# File 'lib/ovirtsdk4/types.rb', line 35560

def qoss
  @qoss
end

#qoss=(list) ⇒ Object

Sets the value of the qoss attribute.

Parameters:

  • list (Array<Qos>)


35569
35570
35571
35572
35573
35574
35575
35576
35577
35578
35579
# File 'lib/ovirtsdk4/types.rb', line 35569

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:



35586
35587
35588
# File 'lib/ovirtsdk4/types.rb', line 35586

def quota_mode
  @quota_mode
end

#quota_mode=(value) ⇒ Object

Sets the value of the quota_mode attribute.

Parameters:



35595
35596
35597
# File 'lib/ovirtsdk4/types.rb', line 35595

def quota_mode=(value)
  @quota_mode = value
end

#quotasArray<Quota>

Returns the value of the quotas attribute.

Returns:



35604
35605
35606
# File 'lib/ovirtsdk4/types.rb', line 35604

def quotas
  @quotas
end

#quotas=(list) ⇒ Object

Sets the value of the quotas attribute.

Parameters:



35613
35614
35615
35616
35617
35618
35619
35620
35621
35622
35623
# File 'lib/ovirtsdk4/types.rb', line 35613

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:



35630
35631
35632
# File 'lib/ovirtsdk4/types.rb', line 35630

def status
  @status
end

#status=(value) ⇒ Object

Sets the value of the status attribute.

Parameters:



35639
35640
35641
# File 'lib/ovirtsdk4/types.rb', line 35639

def status=(value)
  @status = value
end

#storage_domainsArray<StorageDomain>

Returns the value of the storage_domains attribute.

Returns:



35648
35649
35650
# File 'lib/ovirtsdk4/types.rb', line 35648

def storage_domains
  @storage_domains
end

#storage_domains=(list) ⇒ Object

Sets the value of the storage_domains attribute.

Parameters:



35657
35658
35659
35660
35661
35662
35663
35664
35665
35666
35667
# File 'lib/ovirtsdk4/types.rb', line 35657

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:



35674
35675
35676
# File 'lib/ovirtsdk4/types.rb', line 35674

def storage_format
  @storage_format
end

#storage_format=(value) ⇒ Object

Sets the value of the storage_format attribute.

Parameters:



35683
35684
35685
# File 'lib/ovirtsdk4/types.rb', line 35683

def storage_format=(value)
  @storage_format = value
end

#supported_versionsArray<Version>

Returns the value of the supported_versions attribute.

Returns:



35692
35693
35694
# File 'lib/ovirtsdk4/types.rb', line 35692

def supported_versions
  @supported_versions
end

#supported_versions=(list) ⇒ Object

Sets the value of the supported_versions attribute.

Parameters:



35701
35702
35703
35704
35705
35706
35707
35708
35709
35710
35711
# File 'lib/ovirtsdk4/types.rb', line 35701

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:



35718
35719
35720
# File 'lib/ovirtsdk4/types.rb', line 35718

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:



35731
35732
35733
35734
35735
35736
# File 'lib/ovirtsdk4/types.rb', line 35731

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