This API is used to query EVS disks.
Parameter |
Mandatory |
Description |
---|---|---|
project_id |
Yes |
Specifies the project ID. |
Parameter |
Type |
Mandatory |
Description |
---|---|---|---|
marker |
String |
No |
Specifies the ID of the last record on the previous page. The returned value is the value of the item after this one. |
name |
String |
No |
Specifies the disk name. The value can contain a maximum of 255 bytes. |
limit |
Integer |
No |
Specifies the maximum number of query results that can be returned. The value ranges from 1 to 1000, and the default value is 1000. The returned value cannot exceed this limit. If the tenant has more than 50 disks in total, you are advised to use this parameter and set its value to 50 to improve the query efficiency. Examples are provided as follows: GET /v2/xxx/volumes?limit=50: Queries the 1–50 disks. GET /v2/xxx/volumes?offset=50&limit=50: Queries the 51–100 disks. |
sort_key |
String |
No |
Specifies the keyword based on which the returned results are sorted. The value can be id, status, size, or created_at, and the default value is created_at. |
sort_dir |
String |
No |
Specifies the result sorting order. The default value is desc.
|
offset |
Integer |
No |
Specifies the offset. All disks after this offset will be queried. The value must be an integer greater than 0 but less than the number of disks. |
status |
String |
No |
Specifies the disk status. For details, see EVS Disk Status. |
metadata |
String |
No |
Specifies the disk metadata. |
availability_zone |
String |
No |
Specifies the AZ. |
The following example shows how to query the disks in the available state.
GET https://{endpoint}/v2/{project_id}/volumes?status=available
Parameter |
Type |
Description |
---|---|---|
volumes |
list |
Specifies the list of queried disks. For details, see Parameters in the volumes field. |
volumes_links |
list |
Specifies the query position marker in the disk list. If only some disks are returned in this query, the URL of the last disk queried will be returned. You can use this URL to continue to query the remaining disks in the next query. |
error |
Object |
Specifies the error message returned when an error occurs. For details, see Parameters in the error field. |
Parameter |
Type |
Description |
---|---|---|
id |
String |
Specifies the disk ID. |
links |
list<map<String, String>> |
Specifies the disk URI. For details, see Parameters in the links field. |
name |
String |
Specifies the disk name. The value can contain a maximum of 255 bytes. |
Parameter |
Type |
Description |
---|---|---|
href |
String |
Specifies the corresponding shortcut link. |
rel |
String |
Specifies the shortcut link marker name. |
Parameter |
Type |
Description |
---|---|---|
message |
String |
Specifies the error message returned when an error occurs. |
code |
String |
Specifies the error code returned when an error occurs. For details about the error code, see Error Codes. |
{ "volumes": [ { "id": "6b604cef-9bd8-4f5a-ae56-45839e6e1f0a", "links": [ { "href": "https://volume.localdomain.com:8776/v2/dd14c6ac581f40059e27f5320b60bf2f/volumes/6b604cef-9bd8-4f5a-ae56-45839e6e1f0a", "rel": "self" }, { "href": "https://volume.localdomain.com:8776/dd14c6ac581f40059e27f5320b60bf2f/volumes/6b604cef-9bd8-4f5a-ae56-45839e6e1f0a", "rel": "bookmark" } ], "name": "zjb_u25_test" }, { "id": "2bce4552-9a7d-48fa-8484-abbbf64b206e", "links": [ { "href": "https://volume.localdomain.com:8776/v2/dd14c6ac581f40059e27f5320b60bf2f/volumes/2bce4552-9a7d-48fa-8484-abbbf64b206e", "rel": "self" }, { "href": "https://volume.localdomain.com:8776/dd14c6ac581f40059e27f5320b60bf2f/volumes/2bce4552-9a7d-48fa-8484-abbbf64b206e", "rel": "bookmark" } ], "name": "zjb_u25_test" }, { "id": "3f1b98ec-a8b5-4e92-a727-88def62d5ad3", "links": [ { "href": "https://volume.localdomain.com:8776/v2/dd14c6ac581f40059e27f5320b60bf2f/volumes/3f1b98ec-a8b5-4e92-a727-88def62d5ad3", "rel": "self" }, { "href": "https://volume.localdomain.com:8776/dd14c6ac581f40059e27f5320b60bf2f/volumes/3f1b98ec-a8b5-4e92-a727-88def62d5ad3", "rel": "bookmark" } ], "name": "zjb_u25_test" } ], "volumes_links": [ { "href": "https://volume.localdomain.com:8776/v2/dd14c6ac581f40059e27f5320b60bf2f/volumes?limit=3&marker=3f1b98ec-a8b5-4e92-a727-88def62d5ad3", "rel": "next" } ] }
or
{ "error": { "message": "XXXX", "code": "XXX" } }
In the preceding example, error indicates a general error, for example, badRequest or itemNotFound. An example is provided as follows:
{ "badRequest": { "message": "XXXX", "code": "XXX" } }
For details, see Error Codes.