Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
Copyright (c) 2015 Red Hat, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package org.ovirt.engine.sdk4.services;
import java.io.IOException;
import java.math.BigInteger;
import java.util.List;
import org.ovirt.engine.sdk4.Request;
import org.ovirt.engine.sdk4.Response;
import org.ovirt.engine.sdk4.Service;
import org.ovirt.engine.sdk4.builders.DiskBuilder;
import org.ovirt.engine.sdk4.types.Disk;
/**
* Manages the collection of disks available in the system.
*/
public interface DisksService extends Service {
/**
* Adds a new floating disk.
*
* There are three types of disks that can be added - disk image, direct LUN and
* https://wiki.openstack.org/wiki/Cinder[Cinder] disk.
*
* *Adding a new image disk:*
*
* When creating a new floating image <>, the API requires the `storage_domain`, `provisioned_size`
* and `format` attributes.
*
* To create a new floating image disk with specified `provisioned_size`, `format` and `name` on a storage domain
* with an id `123`, send a request as follows:
*
* [source]
* ----
* POST /ovirt-engine/api/disks
* ----
*
* With a request body as follows:
*
* [source,xml]
* ----
*
*
*
*
* mydisk
* 1048576
* cow
*
* ----
*
*
* *Adding a new direct LUN disk:*
*
* When adding a new floating direct LUN via the API, there are two flavors that can be used:
*
* . With a `host` element - in this case, the host is used for sanity checks (e.g., that the LUN is visible) and
* to retrieve basic information about the LUN (e.g., size and serial).
* . Without a `host` element - in this case, the operation is a database-only operation, and the storage is never
* accessed.
*
* To create a new floating direct LUN disk with a `host` element with an id `123`, specified `alias`, `type` and
* `logical_unit` with an id `456` (that has the attributes `address`, `port` and `target`),
* send a request as follows:
*
* [source]
* ----
* POST /ovirt-engine/api/disks
* ----
*
* With a request body as follows:
*
* [source,xml]
* ----
*
* mylun
*
*
* iscsi
*
*
* 10.35.10.20
* 3260
* iqn.2017-01.com.myhost:444
*
*
*
*
* ----
*
* To create a new floating direct LUN disk without using a host, remove the `host` element.
*
*
* *Adding a new Cinder disk:*
*
* To create a new floating Cinder disk, send a request as follows:
*
* [source]
* ----
* POST /ovirt-engine/api/disks
* ----
*
* With a request body as follows:
*
* [source,xml]
* ----
*
*
* myceph
*
*
*
* cinderDomain
*
*
* 1073741824
* virtio
* raw
*
* ----
*/
public interface AddRequest extends Request {
AddRequest disk(Disk disk);
/**
* The disk.
*/
AddRequest disk(DiskBuilder disk);
}
/**
* Adds a new floating disk.
*
* There are three types of disks that can be added - disk image, direct LUN and
* https://wiki.openstack.org/wiki/Cinder[Cinder] disk.
*
* *Adding a new image disk:*
*
* When creating a new floating image <>, the API requires the `storage_domain`, `provisioned_size`
* and `format` attributes.
*
* To create a new floating image disk with specified `provisioned_size`, `format` and `name` on a storage domain
* with an id `123`, send a request as follows:
*
* [source]
* ----
* POST /ovirt-engine/api/disks
* ----
*
* With a request body as follows:
*
* [source,xml]
* ----
*
*
*
*
* mydisk
* 1048576
* cow
*
* ----
*
*
* *Adding a new direct LUN disk:*
*
* When adding a new floating direct LUN via the API, there are two flavors that can be used:
*
* . With a `host` element - in this case, the host is used for sanity checks (e.g., that the LUN is visible) and
* to retrieve basic information about the LUN (e.g., size and serial).
* . Without a `host` element - in this case, the operation is a database-only operation, and the storage is never
* accessed.
*
* To create a new floating direct LUN disk with a `host` element with an id `123`, specified `alias`, `type` and
* `logical_unit` with an id `456` (that has the attributes `address`, `port` and `target`),
* send a request as follows:
*
* [source]
* ----
* POST /ovirt-engine/api/disks
* ----
*
* With a request body as follows:
*
* [source,xml]
* ----
*
* mylun
*
*
* iscsi
*
*
* 10.35.10.20
* 3260
* iqn.2017-01.com.myhost:444
*
*
*
*
* ----
*
* To create a new floating direct LUN disk without using a host, remove the `host` element.
*
*
* *Adding a new Cinder disk:*
*
* To create a new floating Cinder disk, send a request as follows:
*
* [source]
* ----
* POST /ovirt-engine/api/disks
* ----
*
* With a request body as follows:
*
* [source,xml]
* ----
*
*
* myceph
*
*
*
* cinderDomain
*
*
* 1073741824
* virtio
* raw
*
* ----
*/
public interface AddResponse extends Response {
/**
* The disk.
*/
Disk disk();
}
/**
* Adds a new floating disk.
*
* There are three types of disks that can be added - disk image, direct LUN and
* https://wiki.openstack.org/wiki/Cinder[Cinder] disk.
*
* *Adding a new image disk:*
*
* When creating a new floating image <>, the API requires the `storage_domain`, `provisioned_size`
* and `format` attributes.
*
* To create a new floating image disk with specified `provisioned_size`, `format` and `name` on a storage domain
* with an id `123`, send a request as follows:
*
* [source]
* ----
* POST /ovirt-engine/api/disks
* ----
*
* With a request body as follows:
*
* [source,xml]
* ----
*
*
*
*
* mydisk
* 1048576
* cow
*
* ----
*
*
* *Adding a new direct LUN disk:*
*
* When adding a new floating direct LUN via the API, there are two flavors that can be used:
*
* . With a `host` element - in this case, the host is used for sanity checks (e.g., that the LUN is visible) and
* to retrieve basic information about the LUN (e.g., size and serial).
* . Without a `host` element - in this case, the operation is a database-only operation, and the storage is never
* accessed.
*
* To create a new floating direct LUN disk with a `host` element with an id `123`, specified `alias`, `type` and
* `logical_unit` with an id `456` (that has the attributes `address`, `port` and `target`),
* send a request as follows:
*
* [source]
* ----
* POST /ovirt-engine/api/disks
* ----
*
* With a request body as follows:
*
* [source,xml]
* ----
*
* mylun
*
*
* iscsi
*
*
* 10.35.10.20
* 3260
* iqn.2017-01.com.myhost:444
*
*
*
*
* ----
*
* To create a new floating direct LUN disk without using a host, remove the `host` element.
*
*
* *Adding a new Cinder disk:*
*
* To create a new floating Cinder disk, send a request as follows:
*
* [source]
* ----
* POST /ovirt-engine/api/disks
* ----
*
* With a request body as follows:
*
* [source,xml]
* ----
*
*
* myceph
*
*
*
* cinderDomain
*
*
* 1073741824
* virtio
* raw
*
* ----
*/
AddRequest add();
/**
* Get list of disks.
*
* [source]
* ----
* GET /ovirt-engine/api/disks
* ----
*
* You will get a XML response which will look like this one:
*
* [source,xml]
* ----
*
*
* ...
* MyDisk
* MyDisk description
*
*
* 5345845248
* MyDisk alias
* ...
* ok
* image
* false
*
*
* ...
*
* ...
*
* ----
*/
public interface ListRequest extends Request {
/**
* Indicates if the search performed using the `search` parameter should be performed taking case into
* account. The default value is `true`, which means that case is taken into account. If you want to search
* ignoring case set it to `false`.
*/
ListRequest caseSensitive(Boolean caseSensitive);
/**
* Sets the maximum number of disks to return. If not specified all the disks are returned.
*/
ListRequest max(Integer max);
/**
* Sets the maximum number of disks to return. If not specified all the disks are returned.
*/
ListRequest max(Long max);
/**
* Sets the maximum number of disks to return. If not specified all the disks are returned.
*/
ListRequest max(BigInteger max);
/**
* A query string used to restrict the returned disks.
*/
ListRequest search(String search);
/**
* 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`.
*
* IMPORTANT: This parameter only applies to the `disks` sub-collection of attached storage domains, it
* does not apply to the top level `disks` collection.
*/
ListRequest unregistered(Boolean unregistered);
}
/**
* Get list of disks.
*
* [source]
* ----
* GET /ovirt-engine/api/disks
* ----
*
* You will get a XML response which will look like this one:
*
* [source,xml]
* ----
*
*
* ...
* MyDisk
* MyDisk description
*
*
* 5345845248
* MyDisk alias
* ...
* ok
* image
* false
*
*
* ...
*
* ...
*
* ----
*/
public interface ListResponse extends Response {
/**
* List of retrieved disks.
*/
List disks();
}
/**
* Get list of disks.
*
* [source]
* ----
* GET /ovirt-engine/api/disks
* ----
*
* You will get a XML response which will look like this one:
*
* [source,xml]
* ----
*
*
* ...
* MyDisk
* MyDisk description
*
*
* 5345845248
* MyDisk alias
* ...
* ok
* image
* false
*
*
* ...
*
* ...
*
* ----
*/
ListRequest list();
/**
* Reference to a service managing a specific disk.
*/
DiskService diskService(String id);
/**
* Service locator method, returns individual service on which the URI is dispatched.
*/
Service service(String path);
}