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.


34927
34928
34929
34930
34931
34932
34933
34934
34935
34936
34937
34938
34939
34940
34941
34942
34943
# File 'lib/ovirtsdk4/types.rb', line 34927

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.


34948
34949
34950
34951
34952
34953
34954
34955
34956
34957
34958
34959
34960
34961
34962
34963
34964
# File 'lib/ovirtsdk4/types.rb', line 34948

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:


34486
34487
34488
# File 'lib/ovirtsdk4/types.rb', line 34486

def clusters
  @clusters
end

#clusters=(list) ⇒ Object

Sets the value of the clusters attribute.

Parameters:


34495
34496
34497
34498
34499
34500
34501
34502
34503
34504
34505
# File 'lib/ovirtsdk4/types.rb', line 34495

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)

34512
34513
34514
# File 'lib/ovirtsdk4/types.rb', line 34512

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)

34521
34522
34523
# File 'lib/ovirtsdk4/types.rb', line 34521

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)

34530
34531
34532
# File 'lib/ovirtsdk4/types.rb', line 34530

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)

34539
34540
34541
# File 'lib/ovirtsdk4/types.rb', line 34539

def description=(value)
  @description = value
end

#hashObject

Generates a hash value for this object.


34969
34970
34971
34972
34973
34974
34975
34976
34977
34978
34979
34980
34981
34982
34983
34984
34985
# File 'lib/ovirtsdk4/types.rb', line 34969

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)

34548
34549
34550
# File 'lib/ovirtsdk4/types.rb', line 34548

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)

34557
34558
34559
# File 'lib/ovirtsdk4/types.rb', line 34557

def id=(value)
  @id = value
end

#iscsi_bondsArray<IscsiBond>

Returns the value of the iscsi_bonds attribute.

Returns:


34566
34567
34568
# File 'lib/ovirtsdk4/types.rb', line 34566

def iscsi_bonds
  @iscsi_bonds
end

#iscsi_bonds=(list) ⇒ Object

Sets the value of the iscsi_bonds attribute.

Parameters:


34575
34576
34577
34578
34579
34580
34581
34582
34583
34584
34585
# File 'lib/ovirtsdk4/types.rb', line 34575

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)

34592
34593
34594
# File 'lib/ovirtsdk4/types.rb', line 34592

def local
  @local
end

#local=(value) ⇒ Object

Sets the value of the local attribute.

Parameters:

  • value (Boolean)

34601
34602
34603
# File 'lib/ovirtsdk4/types.rb', line 34601

def local=(value)
  @local = value
end

#mac_poolMacPool

Returns the value of the mac_pool attribute.

Returns:


34610
34611
34612
# File 'lib/ovirtsdk4/types.rb', line 34610

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:


34623
34624
34625
34626
34627
34628
# File 'lib/ovirtsdk4/types.rb', line 34623

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)

34635
34636
34637
# File 'lib/ovirtsdk4/types.rb', line 34635

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)

34644
34645
34646
# File 'lib/ovirtsdk4/types.rb', line 34644

def name=(value)
  @name = value
end

#networksArray<Network>

Returns the value of the networks attribute.

Returns:


34653
34654
34655
# File 'lib/ovirtsdk4/types.rb', line 34653

def networks
  @networks
end

#networks=(list) ⇒ Object

Sets the value of the networks attribute.

Parameters:


34662
34663
34664
34665
34666
34667
34668
34669
34670
34671
34672
# File 'lib/ovirtsdk4/types.rb', line 34662

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:


34679
34680
34681
# File 'lib/ovirtsdk4/types.rb', line 34679

def permissions
  @permissions
end

#permissions=(list) ⇒ Object

Sets the value of the permissions attribute.

Parameters:


34688
34689
34690
34691
34692
34693
34694
34695
34696
34697
34698
# File 'lib/ovirtsdk4/types.rb', line 34688

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:


34705
34706
34707
# File 'lib/ovirtsdk4/types.rb', line 34705

def qoss
  @qoss
end

#qoss=(list) ⇒ Object

Sets the value of the qoss attribute.

Parameters:

  • list (Array<Qos>)

34714
34715
34716
34717
34718
34719
34720
34721
34722
34723
34724
# File 'lib/ovirtsdk4/types.rb', line 34714

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:


34731
34732
34733
# File 'lib/ovirtsdk4/types.rb', line 34731

def quota_mode
  @quota_mode
end

#quota_mode=(value) ⇒ Object

Sets the value of the quota_mode attribute.

Parameters:


34740
34741
34742
# File 'lib/ovirtsdk4/types.rb', line 34740

def quota_mode=(value)
  @quota_mode = value
end

#quotasArray<Quota>

Returns the value of the quotas attribute.

Returns:


34749
34750
34751
# File 'lib/ovirtsdk4/types.rb', line 34749

def quotas
  @quotas
end

#quotas=(list) ⇒ Object

Sets the value of the quotas attribute.

Parameters:


34758
34759
34760
34761
34762
34763
34764
34765
34766
34767
34768
# File 'lib/ovirtsdk4/types.rb', line 34758

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:


34775
34776
34777
# File 'lib/ovirtsdk4/types.rb', line 34775

def status
  @status
end

#status=(value) ⇒ Object

Sets the value of the status attribute.

Parameters:


34784
34785
34786
# File 'lib/ovirtsdk4/types.rb', line 34784

def status=(value)
  @status = value
end

#storage_domainsArray<StorageDomain>

Returns the value of the storage_domains attribute.

Returns:


34793
34794
34795
# File 'lib/ovirtsdk4/types.rb', line 34793

def storage_domains
  @storage_domains
end

#storage_domains=(list) ⇒ Object

Sets the value of the storage_domains attribute.

Parameters:


34802
34803
34804
34805
34806
34807
34808
34809
34810
34811
34812
# File 'lib/ovirtsdk4/types.rb', line 34802

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:


34819
34820
34821
# File 'lib/ovirtsdk4/types.rb', line 34819

def storage_format
  @storage_format
end

#storage_format=(value) ⇒ Object

Sets the value of the storage_format attribute.

Parameters:


34828
34829
34830
# File 'lib/ovirtsdk4/types.rb', line 34828

def storage_format=(value)
  @storage_format = value
end

#supported_versionsArray<Version>

Returns the value of the supported_versions attribute.

Returns:


34837
34838
34839
# File 'lib/ovirtsdk4/types.rb', line 34837

def supported_versions
  @supported_versions
end

#supported_versions=(list) ⇒ Object

Sets the value of the supported_versions attribute.

Parameters:


34846
34847
34848
34849
34850
34851
34852
34853
34854
34855
34856
# File 'lib/ovirtsdk4/types.rb', line 34846

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:


34863
34864
34865
# File 'lib/ovirtsdk4/types.rb', line 34863

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:


34876
34877
34878
34879
34880
34881
# File 'lib/ovirtsdk4/types.rb', line 34876

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