class OvirtSDK4::StorageDomainDisksService
Constants
- ADD
- LIST
Public Instance Methods
Adds or registers a disk.
IMPORTANT: Since version 4.2 of the {engine-name} this operation is deprecated, and preserved only for backwards compatibility. It will be removed in the future. To add a new disk use the xref:services-disks-methods-add operation of the service that manages the disks of the system. To register an unregistered disk use the xref:services-attached_storage_domain_disk-methods-register operation of the service that manages that disk.
@param disk [Disk] The disk to add or register.
@param opts [Hash] Additional options.
@option opts [Boolean] :unregistered Indicates if a new disk should be added or if an existing unregistered disk should be registered. If the
value is `true` then the identifier of the disk to register needs to be provided. For example, to register the disk with ID `456` send a request like this: .... POST /ovirt-engine/api/storagedomains/123/disks?unregistered=true .... With a request body like this: [source,xml] ---- <disk id="456"/> ---- If the value is `false` then a new disk will be created in the storage domain. In that case the `provisioned_size`, `format`, and `name` attributes are mandatory. For example, to create a new _copy on write_ disk of 1 GiB, send a request like this: .... POST /ovirt-engine/api/storagedomains/123/disks .... With a request body like this: [source,xml] ---- <disk> <name>mydisk</name> <format>cow</format> <provisioned_size>1073741824</provisioned_size> </disk> ---- The default value is `false`. This parameter has been deprecated since version 4.2 of the {engine-name}.
@option opts [Hash] :headers ({}) Additional HTTP headers.
@option opts [Hash] :query ({}) Additional URL query parameters.
@option opts [Integer] :timeout (nil) The timeout for this request, in seconds. If no value is explicitly
given then the timeout set globally for the connection will be used.
@option opts [Boolean] :wait (true) If `true` wait for the response.
@return [Disk]
# File lib/ovirtsdk4/services.rb, line 23283 def add(disk, opts = {}) internal_add(disk, Disk, ADD, opts) end
A reference to the service that manages a specific disk.
@param id [String] The identifier of the `disk`.
@return [StorageDomainDiskService] A reference to the `disk` service.
# File lib/ovirtsdk4/services.rb, line 23340 def disk_service(id) StorageDomainDiskService.new(self, id) end
Retrieves the list of disks that are available in the storage domain.
The order of the returned list of disks is not guaranteed.
@param opts [Hash] Additional options.
@option opts [String] :follow Indicates which inner links should be followed. The objects referenced by these links will be fetched as part
of the current request. See <<documents/003_common_concepts/follow, here>> for details.
@option opts [Integer] :max Sets the maximum number of disks to return. If not specified, all the disks are returned.
@option opts [Boolean] :unregistered Indicates whether to retrieve a list of registered or unregistered disks in the storage domain.
To get a list of unregistered disks in the storage domain the call should indicate the unregistered flag. For example, to get a list of unregistered disks the REST API call should look like this: .... GET /ovirt-engine/api/storagedomains/123/disks?unregistered=true .... The default value of the unregistered flag is `false`. The request only applies to storage domains that are attached.
@option opts [Hash] :headers ({}) Additional HTTP headers.
@option opts [Hash] :query ({}) Additional URL query parameters.
@option opts [Integer] :timeout (nil) The timeout for this request, in seconds. If no value is explicitly
given then the timeout set globally for the connection will be used.
@option opts [Boolean] :wait (true) If `true` wait for the response.
@return [Array<Disk>]
# File lib/ovirtsdk4/services.rb, line 23329 def list(opts = {}) internal_get(LIST, opts) end
Locates the service corresponding to the given path.
@param path [String] The path of the service.
@return [Service] A reference to the service.
# File lib/ovirtsdk4/services.rb, line 23351 def service(path) if path.nil? || path == '' return self end index = path.index('/') if index.nil? return disk_service(path) end return disk_service(path[0..(index - 1)]).service(path[(index + 1)..-1]) end