class OvirtSDK4::Disk
Public Class Methods
Creates a new instance of the {Disk} class.
@param opts [Hash] 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.
@option opts [Boolean] :active The value of attribute `active`.
@option opts [Integer] :actual_size The value of attribute `actual_size`.
@option opts [String] :alias_ The value of attribute `alias_`.
@option opts [DiskBackup] :backup The value of attribute `backup`.
@option opts [DiskBackupMode] :backup_mode The value of attribute `backup_mode`.
@option opts [Boolean] :bootable The value of attribute `bootable`.
@option opts [String] :comment The value of attribute `comment`.
@option opts [DiskContentType] :content_type The value of attribute `content_type`.
@option opts [String] :description The value of attribute `description`.
@option opts [DiskProfile, Hash] :disk_profile The value of attribute `disk_profile`.
@option opts [Array<DiskSnapshot>, Array<Hash>] :disk_snapshots The values of attribute `disk_snapshots`.
@option opts [String] :external_disk The value of attribute `external_disk`.
@option opts [DiskFormat] :format The value of attribute `format`.
@option opts [String] :id The value of attribute `id`.
@option opts [String] :image_id The value of attribute `image_id`.
@option opts [Integer] :initial_size The value of attribute `initial_size`.
@option opts [InstanceType, Hash] :instance_type The value of attribute `instance_type`.
@option opts [DiskInterface] :interface The value of attribute `interface`.
@option opts [String] :logical_name The value of attribute `logical_name`.
@option opts [HostStorage, Hash] :lun_storage The value of attribute `lun_storage`.
@option opts [String] :name The value of attribute `name`.
@option opts [OpenStackVolumeType, Hash] :openstack_volume_type The value of attribute `openstack_volume_type`.
@option opts [Array<Permission>, Array<Hash>] :permissions The values of attribute `permissions`.
@option opts [Boolean] :propagate_errors The value of attribute `propagate_errors`.
@option opts [Integer] :provisioned_size The value of attribute `provisioned_size`.
@option opts [QcowVersion] :qcow_version The value of attribute `qcow_version`.
@option opts [Quota, Hash] :quota The value of attribute `quota`.
@option opts [Boolean] :read_only The value of attribute `read_only`.
@option opts [ScsiGenericIO] :sgio The value of attribute `sgio`.
@option opts [Boolean] :shareable The value of attribute `shareable`.
@option opts [Snapshot, Hash] :snapshot The value of attribute `snapshot`.
@option opts [Boolean] :sparse The value of attribute `sparse`.
@option opts [Array<Statistic>, Array<Hash>] :statistics The values of attribute `statistics`.
@option opts [DiskStatus] :status The value of attribute `status`.
@option opts [StorageDomain, Hash] :storage_domain The value of attribute `storage_domain`.
@option opts [Array<StorageDomain>, Array<Hash>] :storage_domains The values of attribute `storage_domains`.
@option opts [DiskStorageType] :storage_type The value of attribute `storage_type`.
@option opts [Template, Hash] :template The value of attribute `template`.
@option opts [Integer] :total_size The value of attribute `total_size`.
@option opts [Boolean] :uses_scsi_reservation The value of attribute `uses_scsi_reservation`.
@option opts [Vm, Hash] :vm The value of attribute `vm`.
@option opts [Array<Vm>, Array<Hash>] :vms The values of attribute `vms`.
@option opts [Boolean] :wipe_after_delete The value of attribute `wipe_after_delete`.
OvirtSDK4::Device::new
# File lib/ovirtsdk4/types.rb, line 36193 def initialize(opts = {}) super(opts) self.active = opts[:active] self.actual_size = opts[:actual_size] self.alias_ = opts[:alias_] self.backup = opts[:backup] self.backup_mode = opts[:backup_mode] self.bootable = opts[:bootable] self.content_type = opts[:content_type] self.disk_profile = opts[:disk_profile] self.disk_snapshots = opts[:disk_snapshots] self.external_disk = opts[:external_disk] self.format = opts[:format] self.image_id = opts[:image_id] self.initial_size = opts[:initial_size] self.interface = opts[:interface] self.logical_name = opts[:logical_name] self.lun_storage = opts[:lun_storage] self.openstack_volume_type = opts[:openstack_volume_type] self.permissions = opts[:permissions] self.propagate_errors = opts[:propagate_errors] self.provisioned_size = opts[:provisioned_size] self.qcow_version = opts[:qcow_version] self.quota = opts[:quota] self.read_only = opts[:read_only] self.sgio = opts[:sgio] self.shareable = opts[:shareable] self.snapshot = opts[:snapshot] self.sparse = opts[:sparse] self.statistics = opts[:statistics] self.status = opts[:status] self.storage_domain = opts[:storage_domain] self.storage_domains = opts[:storage_domains] self.storage_type = opts[:storage_type] self.total_size = opts[:total_size] self.uses_scsi_reservation = opts[:uses_scsi_reservation] self.wipe_after_delete = opts[:wipe_after_delete] end
Public Instance Methods
Returns `true` if `self` and `other` have the same attributes and values.
# File lib/ovirtsdk4/types.rb, line 36235 def ==(other) super && @active == other.active && @actual_size == other.actual_size && @alias_ == other.alias_ && @backup == other.backup && @backup_mode == other.backup_mode && @bootable == other.bootable && @content_type == other.content_type && @disk_profile == other.disk_profile && @disk_snapshots == other.disk_snapshots && @external_disk == other.external_disk && @format == other.format && @image_id == other.image_id && @initial_size == other.initial_size && @interface == other.interface && @logical_name == other.logical_name && @lun_storage == other.lun_storage && @openstack_volume_type == other.openstack_volume_type && @permissions == other.permissions && @propagate_errors == other.propagate_errors && @provisioned_size == other.provisioned_size && @qcow_version == other.qcow_version && @quota == other.quota && @read_only == other.read_only && @sgio == other.sgio && @shareable == other.shareable && @snapshot == other.snapshot && @sparse == other.sparse && @statistics == other.statistics && @status == other.status && @storage_domain == other.storage_domain && @storage_domains == other.storage_domains && @storage_type == other.storage_type && @total_size == other.total_size && @uses_scsi_reservation == other.uses_scsi_reservation && @wipe_after_delete == other.wipe_after_delete end
Returns the value of the `active` attribute.
@return [Boolean]
# File lib/ovirtsdk4/types.rb, line 35227 def active @active end
Sets the value of the `active` attribute.
@param value [Boolean]
# File lib/ovirtsdk4/types.rb, line 35236 def active=(value) @active = value end
Returns the value of the `actual_size` attribute.
@return [Integer]
# File lib/ovirtsdk4/types.rb, line 35245 def actual_size @actual_size end
Sets the value of the `actual_size` attribute.
@param value [Integer]
# File lib/ovirtsdk4/types.rb, line 35254 def actual_size=(value) @actual_size = value end
Returns the value of the `alias_` attribute.
@return [String]
# File lib/ovirtsdk4/types.rb, line 35263 def alias_ @alias_ end
Sets the value of the `alias_` attribute.
@param value [String]
# File lib/ovirtsdk4/types.rb, line 35272 def alias_=(value) @alias_ = value end
Returns the value of the `backup` attribute.
@return [DiskBackup]
# File lib/ovirtsdk4/types.rb, line 35281 def backup @backup end
Sets the value of the `backup` attribute.
@param value [DiskBackup]
# File lib/ovirtsdk4/types.rb, line 35290 def backup=(value) @backup = value end
Returns the value of the `backup_mode` attribute.
@return [DiskBackupMode]
# File lib/ovirtsdk4/types.rb, line 35299 def backup_mode @backup_mode end
Sets the value of the `backup_mode` attribute.
@param value [DiskBackupMode]
# File lib/ovirtsdk4/types.rb, line 35308 def backup_mode=(value) @backup_mode = value end
Returns the value of the `bootable` attribute.
@return [Boolean]
# File lib/ovirtsdk4/types.rb, line 35317 def bootable @bootable end
Sets the value of the `bootable` attribute.
@param value [Boolean]
# File lib/ovirtsdk4/types.rb, line 35326 def bootable=(value) @bootable = value end
Returns the value of the `comment` attribute.
@return [String]
# File lib/ovirtsdk4/types.rb, line 35335 def comment @comment end
Sets the value of the `comment` attribute.
@param value [String]
# File lib/ovirtsdk4/types.rb, line 35344 def comment=(value) @comment = value end
Returns the value of the `content_type` attribute.
@return [DiskContentType]
# File lib/ovirtsdk4/types.rb, line 35353 def content_type @content_type end
Sets the value of the `content_type` attribute.
@param value [DiskContentType]
# File lib/ovirtsdk4/types.rb, line 35362 def content_type=(value) @content_type = value end
Returns the value of the `description` attribute.
@return [String]
# File lib/ovirtsdk4/types.rb, line 35371 def description @description end
Sets the value of the `description` attribute.
@param value [String]
# File lib/ovirtsdk4/types.rb, line 35380 def description=(value) @description = value end
Returns the value of the `disk_profile` attribute.
@return [DiskProfile]
# File lib/ovirtsdk4/types.rb, line 35389 def disk_profile @disk_profile end
Sets the value of the `disk_profile` attribute.
@param value [DiskProfile, Hash]
The `value` parameter can be an instance of {OvirtSDK4::DiskProfile} 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.
# File lib/ovirtsdk4/types.rb, line 35402 def disk_profile=(value) if value.is_a?(Hash) value = DiskProfile.new(value) end @disk_profile = value end
Returns the value of the `disk_snapshots` attribute.
@return [Array<DiskSnapshot>]
# File lib/ovirtsdk4/types.rb, line 35414 def disk_snapshots @disk_snapshots end
Sets the value of the `disk_snapshots` attribute.
@param list [Array<DiskSnapshot>]
# File lib/ovirtsdk4/types.rb, line 35423 def disk_snapshots=(list) if list.class == Array list = List.new(list) list.each_with_index do |value, index| if value.is_a?(Hash) list[index] = DiskSnapshot.new(value) end end end @disk_snapshots = list end
Returns the value of the `external_disk` attribute.
@return [String]
# File lib/ovirtsdk4/types.rb, line 35440 def external_disk @external_disk end
Sets the value of the `external_disk` attribute.
@param value [String]
# File lib/ovirtsdk4/types.rb, line 35449 def external_disk=(value) @external_disk = value end
Returns the value of the `format` attribute.
@return [DiskFormat]
# File lib/ovirtsdk4/types.rb, line 35458 def format @format end
Sets the value of the `format` attribute.
@param value [DiskFormat]
# File lib/ovirtsdk4/types.rb, line 35467 def format=(value) @format = value end
Generates a hash value for this object.
OvirtSDK4::Device#hash
# File lib/ovirtsdk4/types.rb, line 36277 def hash super + @active.hash + @actual_size.hash + @alias_.hash + @backup.hash + @backup_mode.hash + @bootable.hash + @content_type.hash + @disk_profile.hash + @disk_snapshots.hash + @external_disk.hash + @format.hash + @image_id.hash + @initial_size.hash + @interface.hash + @logical_name.hash + @lun_storage.hash + @openstack_volume_type.hash + @permissions.hash + @propagate_errors.hash + @provisioned_size.hash + @qcow_version.hash + @quota.hash + @read_only.hash + @sgio.hash + @shareable.hash + @snapshot.hash + @sparse.hash + @statistics.hash + @status.hash + @storage_domain.hash + @storage_domains.hash + @storage_type.hash + @total_size.hash + @uses_scsi_reservation.hash + @wipe_after_delete.hash end
Returns the value of the `id` attribute.
@return [String]
# File lib/ovirtsdk4/types.rb, line 35476 def id @id end
Sets the value of the `id` attribute.
@param value [String]
# File lib/ovirtsdk4/types.rb, line 35485 def id=(value) @id = value end
Returns the value of the `image_id` attribute.
@return [String]
# File lib/ovirtsdk4/types.rb, line 35494 def image_id @image_id end
Sets the value of the `image_id` attribute.
@param value [String]
# File lib/ovirtsdk4/types.rb, line 35503 def image_id=(value) @image_id = value end
Returns the value of the `initial_size` attribute.
@return [Integer]
# File lib/ovirtsdk4/types.rb, line 35512 def initial_size @initial_size end
Sets the value of the `initial_size` attribute.
@param value [Integer]
# File lib/ovirtsdk4/types.rb, line 35521 def initial_size=(value) @initial_size = value end
Returns the value of the `instance_type` attribute.
@return [InstanceType]
# File lib/ovirtsdk4/types.rb, line 35530 def instance_type @instance_type end
Sets the value of the `instance_type` attribute.
@param value [InstanceType, Hash]
The `value` parameter can be an instance of {OvirtSDK4::InstanceType} 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.
# File lib/ovirtsdk4/types.rb, line 35543 def instance_type=(value) if value.is_a?(Hash) value = InstanceType.new(value) end @instance_type = value end
Returns the value of the `interface` attribute.
@return [DiskInterface]
# File lib/ovirtsdk4/types.rb, line 35555 def interface @interface end
Sets the value of the `interface` attribute.
@param value [DiskInterface]
# File lib/ovirtsdk4/types.rb, line 35564 def interface=(value) @interface = value end
Returns the value of the `logical_name` attribute.
@return [String]
# File lib/ovirtsdk4/types.rb, line 35573 def logical_name @logical_name end
Sets the value of the `logical_name` attribute.
@param value [String]
# File lib/ovirtsdk4/types.rb, line 35582 def logical_name=(value) @logical_name = value end
Returns the value of the `lun_storage` attribute.
@return [HostStorage]
# File lib/ovirtsdk4/types.rb, line 35591 def lun_storage @lun_storage end
Sets the value of the `lun_storage` attribute.
@param value [HostStorage, Hash]
The `value` parameter can be an instance of {OvirtSDK4::HostStorage} 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.
# File lib/ovirtsdk4/types.rb, line 35604 def lun_storage=(value) if value.is_a?(Hash) value = HostStorage.new(value) end @lun_storage = value end
Returns the value of the `name` attribute.
@return [String]
# File lib/ovirtsdk4/types.rb, line 35616 def name @name end
Sets the value of the `name` attribute.
@param value [String]
# File lib/ovirtsdk4/types.rb, line 35625 def name=(value) @name = value end
Returns the value of the `openstack_volume_type` attribute.
@return [OpenStackVolumeType]
# File lib/ovirtsdk4/types.rb, line 35634 def openstack_volume_type @openstack_volume_type end
Sets the value of the `openstack_volume_type` attribute.
@param value [OpenStackVolumeType, Hash]
The `value` parameter can be an instance of {OvirtSDK4::OpenStackVolumeType} 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.
# File lib/ovirtsdk4/types.rb, line 35647 def openstack_volume_type=(value) if value.is_a?(Hash) value = OpenStackVolumeType.new(value) end @openstack_volume_type = value end
Returns the value of the `permissions` attribute.
@return [Array<Permission>]
# File lib/ovirtsdk4/types.rb, line 35659 def permissions @permissions end
Sets the value of the `permissions` attribute.
@param list [Array<Permission>]
# File lib/ovirtsdk4/types.rb, line 35668 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
Returns the value of the `propagate_errors` attribute.
@return [Boolean]
# File lib/ovirtsdk4/types.rb, line 35685 def propagate_errors @propagate_errors end
Sets the value of the `propagate_errors` attribute.
@param value [Boolean]
# File lib/ovirtsdk4/types.rb, line 35694 def propagate_errors=(value) @propagate_errors = value end
Returns the value of the `provisioned_size` attribute.
@return [Integer]
# File lib/ovirtsdk4/types.rb, line 35703 def provisioned_size @provisioned_size end
Sets the value of the `provisioned_size` attribute.
@param value [Integer]
# File lib/ovirtsdk4/types.rb, line 35712 def provisioned_size=(value) @provisioned_size = value end
Returns the value of the `qcow_version` attribute.
@return [QcowVersion]
# File lib/ovirtsdk4/types.rb, line 35721 def qcow_version @qcow_version end
Sets the value of the `qcow_version` attribute.
@param value [QcowVersion]
# File lib/ovirtsdk4/types.rb, line 35730 def qcow_version=(value) @qcow_version = value end
Returns the value of the `quota` attribute.
@return [Quota]
# File lib/ovirtsdk4/types.rb, line 35739 def quota @quota end
Sets the value of the `quota` attribute.
@param value [Quota, Hash]
The `value` parameter can be an instance of {OvirtSDK4::Quota} 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.
# File lib/ovirtsdk4/types.rb, line 35752 def quota=(value) if value.is_a?(Hash) value = Quota.new(value) end @quota = value end
Returns the value of the `read_only` attribute.
@return [Boolean]
# File lib/ovirtsdk4/types.rb, line 35764 def read_only @read_only end
Sets the value of the `read_only` attribute.
@param value [Boolean]
# File lib/ovirtsdk4/types.rb, line 35773 def read_only=(value) @read_only = value end
Returns the value of the `sgio` attribute.
@return [ScsiGenericIO]
# File lib/ovirtsdk4/types.rb, line 35782 def sgio @sgio end
Sets the value of the `sgio` attribute.
@param value [ScsiGenericIO]
# File lib/ovirtsdk4/types.rb, line 35791 def sgio=(value) @sgio = value end
Returns the value of the `snapshot` attribute.
@return [Snapshot]
# File lib/ovirtsdk4/types.rb, line 35818 def snapshot @snapshot end
Sets the value of the `snapshot` attribute.
@param value [Snapshot, Hash]
The `value` parameter can be an instance of {OvirtSDK4::Snapshot} 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.
# File lib/ovirtsdk4/types.rb, line 35831 def snapshot=(value) if value.is_a?(Hash) value = Snapshot.new(value) end @snapshot = value end
Returns the value of the `sparse` attribute.
@return [Boolean]
# File lib/ovirtsdk4/types.rb, line 35843 def sparse @sparse end
Sets the value of the `sparse` attribute.
@param value [Boolean]
# File lib/ovirtsdk4/types.rb, line 35852 def sparse=(value) @sparse = value end
Returns the value of the `statistics` attribute.
@return [Array<Statistic>]
# File lib/ovirtsdk4/types.rb, line 35861 def statistics @statistics end
Sets the value of the `statistics` attribute.
@param list [Array<Statistic>]
# File lib/ovirtsdk4/types.rb, line 35870 def statistics=(list) if list.class == Array list = List.new(list) list.each_with_index do |value, index| if value.is_a?(Hash) list[index] = Statistic.new(value) end end end @statistics = list end
Returns the value of the `status` attribute.
@return [DiskStatus]
# File lib/ovirtsdk4/types.rb, line 35887 def status @status end
Sets the value of the `status` attribute.
@param value [DiskStatus]
# File lib/ovirtsdk4/types.rb, line 35896 def status=(value) @status = value end
Returns the value of the `storage_domain` attribute.
@return [StorageDomain]
# File lib/ovirtsdk4/types.rb, line 35905 def storage_domain @storage_domain end
Sets the value of the `storage_domain` attribute.
@param value [StorageDomain, Hash]
The `value` parameter can be an instance of {OvirtSDK4::StorageDomain} 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.
# File lib/ovirtsdk4/types.rb, line 35918 def storage_domain=(value) if value.is_a?(Hash) value = StorageDomain.new(value) end @storage_domain = value end
Returns the value of the `storage_domains` attribute.
@return [Array<StorageDomain>]
# File lib/ovirtsdk4/types.rb, line 35930 def storage_domains @storage_domains end
Sets the value of the `storage_domains` attribute.
@param list [Array<StorageDomain>]
# File lib/ovirtsdk4/types.rb, line 35939 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
Returns the value of the `storage_type` attribute.
@return [DiskStorageType]
# File lib/ovirtsdk4/types.rb, line 35956 def storage_type @storage_type end
Sets the value of the `storage_type` attribute.
@param value [DiskStorageType]
# File lib/ovirtsdk4/types.rb, line 35965 def storage_type=(value) @storage_type = value end
Returns the value of the `template` attribute.
@return [Template]
# File lib/ovirtsdk4/types.rb, line 35974 def template @template end
Sets the value of the `template` attribute.
@param value [Template, Hash]
The `value` parameter can be an instance of {OvirtSDK4::Template} 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.
# File lib/ovirtsdk4/types.rb, line 35987 def template=(value) if value.is_a?(Hash) value = Template.new(value) end @template = value end
Returns the value of the `total_size` attribute.
@return [Integer]
# File lib/ovirtsdk4/types.rb, line 35999 def total_size @total_size end
Sets the value of the `total_size` attribute.
@param value [Integer]
# File lib/ovirtsdk4/types.rb, line 36008 def total_size=(value) @total_size = value end
Returns the value of the `uses_scsi_reservation` attribute.
@return [Boolean]
# File lib/ovirtsdk4/types.rb, line 36017 def uses_scsi_reservation @uses_scsi_reservation end
Sets the value of the `uses_scsi_reservation` attribute.
@param value [Boolean]
# File lib/ovirtsdk4/types.rb, line 36026 def uses_scsi_reservation=(value) @uses_scsi_reservation = value end
Returns the value of the `vm` attribute.
@return [Vm]
# File lib/ovirtsdk4/types.rb, line 36035 def vm @vm end
Sets the value of the `vm` attribute.
@param value [Vm, Hash]
The `value` parameter can be an instance of {OvirtSDK4::Vm} 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.
# File lib/ovirtsdk4/types.rb, line 36048 def vm=(value) if value.is_a?(Hash) value = Vm.new(value) end @vm = value end
Returns the value of the `vms` attribute.
@return [Array<Vm>]
# File lib/ovirtsdk4/types.rb, line 36060 def vms @vms end
Sets the value of the `vms` attribute.
@param list [Array<Vm>]
# File lib/ovirtsdk4/types.rb, line 36069 def vms=(list) if list.class == Array list = List.new(list) list.each_with_index do |value, index| if value.is_a?(Hash) list[index] = Vm.new(value) end end end @vms = list end
Returns the value of the `wipe_after_delete` attribute.
@return [Boolean]
# File lib/ovirtsdk4/types.rb, line 36086 def wipe_after_delete @wipe_after_delete end
Sets the value of the `wipe_after_delete` attribute.
@param value [Boolean]
# File lib/ovirtsdk4/types.rb, line 36095 def wipe_after_delete=(value) @wipe_after_delete = value end