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.



33738
33739
33740
33741
33742
33743
33744
33745
33746
33747
33748
33749
33750
33751
33752
33753
33754
# File 'lib/ovirtsdk4/types.rb', line 33738

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.



33759
33760
33761
33762
33763
33764
33765
33766
33767
33768
33769
33770
33771
33772
33773
33774
33775
# File 'lib/ovirtsdk4/types.rb', line 33759

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:



33297
33298
33299
# File 'lib/ovirtsdk4/types.rb', line 33297

def clusters
  @clusters
end

#clusters=(list) ⇒ Object

Sets the value of the clusters attribute.

Parameters:



33306
33307
33308
33309
33310
33311
33312
33313
33314
33315
33316
# File 'lib/ovirtsdk4/types.rb', line 33306

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)


33323
33324
33325
# File 'lib/ovirtsdk4/types.rb', line 33323

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


33332
33333
33334
# File 'lib/ovirtsdk4/types.rb', line 33332

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


33341
33342
33343
# File 'lib/ovirtsdk4/types.rb', line 33341

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


33350
33351
33352
# File 'lib/ovirtsdk4/types.rb', line 33350

def description=(value)
  @description = value
end

#hashObject

Generates a hash value for this object.



33780
33781
33782
33783
33784
33785
33786
33787
33788
33789
33790
33791
33792
33793
33794
33795
33796
# File 'lib/ovirtsdk4/types.rb', line 33780

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)


33359
33360
33361
# File 'lib/ovirtsdk4/types.rb', line 33359

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


33368
33369
33370
# File 'lib/ovirtsdk4/types.rb', line 33368

def id=(value)
  @id = value
end

#iscsi_bondsArray<IscsiBond>

Returns the value of the iscsi_bonds attribute.

Returns:



33377
33378
33379
# File 'lib/ovirtsdk4/types.rb', line 33377

def iscsi_bonds
  @iscsi_bonds
end

#iscsi_bonds=(list) ⇒ Object

Sets the value of the iscsi_bonds attribute.

Parameters:



33386
33387
33388
33389
33390
33391
33392
33393
33394
33395
33396
# File 'lib/ovirtsdk4/types.rb', line 33386

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)


33403
33404
33405
# File 'lib/ovirtsdk4/types.rb', line 33403

def local
  @local
end

#local=(value) ⇒ Object

Sets the value of the local attribute.

Parameters:

  • value (Boolean)


33412
33413
33414
# File 'lib/ovirtsdk4/types.rb', line 33412

def local=(value)
  @local = value
end

#mac_poolMacPool

Returns the value of the mac_pool attribute.

Returns:



33421
33422
33423
# File 'lib/ovirtsdk4/types.rb', line 33421

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:



33434
33435
33436
33437
33438
33439
# File 'lib/ovirtsdk4/types.rb', line 33434

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)


33446
33447
33448
# File 'lib/ovirtsdk4/types.rb', line 33446

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


33455
33456
33457
# File 'lib/ovirtsdk4/types.rb', line 33455

def name=(value)
  @name = value
end

#networksArray<Network>

Returns the value of the networks attribute.

Returns:



33464
33465
33466
# File 'lib/ovirtsdk4/types.rb', line 33464

def networks
  @networks
end

#networks=(list) ⇒ Object

Sets the value of the networks attribute.

Parameters:



33473
33474
33475
33476
33477
33478
33479
33480
33481
33482
33483
# File 'lib/ovirtsdk4/types.rb', line 33473

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:



33490
33491
33492
# File 'lib/ovirtsdk4/types.rb', line 33490

def permissions
  @permissions
end

#permissions=(list) ⇒ Object

Sets the value of the permissions attribute.

Parameters:



33499
33500
33501
33502
33503
33504
33505
33506
33507
33508
33509
# File 'lib/ovirtsdk4/types.rb', line 33499

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:



33516
33517
33518
# File 'lib/ovirtsdk4/types.rb', line 33516

def qoss
  @qoss
end

#qoss=(list) ⇒ Object

Sets the value of the qoss attribute.

Parameters:

  • list (Array<Qos>)


33525
33526
33527
33528
33529
33530
33531
33532
33533
33534
33535
# File 'lib/ovirtsdk4/types.rb', line 33525

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:



33542
33543
33544
# File 'lib/ovirtsdk4/types.rb', line 33542

def quota_mode
  @quota_mode
end

#quota_mode=(value) ⇒ Object

Sets the value of the quota_mode attribute.

Parameters:



33551
33552
33553
# File 'lib/ovirtsdk4/types.rb', line 33551

def quota_mode=(value)
  @quota_mode = value
end

#quotasArray<Quota>

Returns the value of the quotas attribute.

Returns:



33560
33561
33562
# File 'lib/ovirtsdk4/types.rb', line 33560

def quotas
  @quotas
end

#quotas=(list) ⇒ Object

Sets the value of the quotas attribute.

Parameters:



33569
33570
33571
33572
33573
33574
33575
33576
33577
33578
33579
# File 'lib/ovirtsdk4/types.rb', line 33569

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:



33586
33587
33588
# File 'lib/ovirtsdk4/types.rb', line 33586

def status
  @status
end

#status=(value) ⇒ Object

Sets the value of the status attribute.

Parameters:



33595
33596
33597
# File 'lib/ovirtsdk4/types.rb', line 33595

def status=(value)
  @status = value
end

#storage_domainsArray<StorageDomain>

Returns the value of the storage_domains attribute.

Returns:



33604
33605
33606
# File 'lib/ovirtsdk4/types.rb', line 33604

def storage_domains
  @storage_domains
end

#storage_domains=(list) ⇒ Object

Sets the value of the storage_domains attribute.

Parameters:



33613
33614
33615
33616
33617
33618
33619
33620
33621
33622
33623
# File 'lib/ovirtsdk4/types.rb', line 33613

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:



33630
33631
33632
# File 'lib/ovirtsdk4/types.rb', line 33630

def storage_format
  @storage_format
end

#storage_format=(value) ⇒ Object

Sets the value of the storage_format attribute.

Parameters:



33639
33640
33641
# File 'lib/ovirtsdk4/types.rb', line 33639

def storage_format=(value)
  @storage_format = value
end

#supported_versionsArray<Version>

Returns the value of the supported_versions attribute.

Returns:



33648
33649
33650
# File 'lib/ovirtsdk4/types.rb', line 33648

def supported_versions
  @supported_versions
end

#supported_versions=(list) ⇒ Object

Sets the value of the supported_versions attribute.

Parameters:



33657
33658
33659
33660
33661
33662
33663
33664
33665
33666
33667
# File 'lib/ovirtsdk4/types.rb', line 33657

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:



33674
33675
33676
# File 'lib/ovirtsdk4/types.rb', line 33674

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:



33687
33688
33689
33690
33691
33692
# File 'lib/ovirtsdk4/types.rb', line 33687

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