Querying EVS Disks
Function
This API is used to query EVS disks.
Calling Method
For details, see Calling APIs.
URI
GET /v3/{project_id}/volumes
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
The project ID. For details about how to obtain the project ID, see Obtaining a Project ID. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
marker |
No |
String |
The ID of the resource from which the pagination query starts. It is the ID of the last resource on the previous page. |
name |
No |
String |
The disk name. You can enter up to 64 characters. |
limit |
No |
Integer |
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 you have more than 50 disks in total, use this parameter and set it to 50 to improve the query efficiency. Examples are provided as follows: Querying 1–50 disks: GET /v2/xxx/volumes?limit=50 Querying 51–100 disks: GET /v2/xxx/volumes?offset=50&limit=50 |
sort_dir |
No |
String |
The result sorting order. The default value is desc. desc: the descending order asc: the ascending order |
sort_key |
No |
String |
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. |
offset |
No |
Integer |
The query 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 |
No |
String |
The disk status. For details, see EVS Disk Status. |
metadata |
No |
String |
The disk metadata. |
availability_zone |
No |
String |
The AZ information. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
The user token. It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
volumes |
Array of VolumeBody objects |
The list of returned disks. |
volumes_links |
Array of Link objects |
The query position marker in the disk list. If only some disks are returned in this query, the URL of the last disk queried is returned. You can use this URL to continue to query the remaining disks in the next query. |
Parameter |
Type |
Description |
---|---|---|
id |
String |
The disk ID. |
links |
Array of Link objects |
The disk URI. |
name |
String |
The disk name. |
Parameter |
Type |
Description |
---|---|---|
href |
String |
The corresponding shortcut link. |
rel |
String |
The shortcut link marker name. Default: next |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error |
Error object |
The error message returned if an error occurs. |
Parameter |
Type |
Description |
---|---|---|
code |
String |
The error code returned if an error occurs. For details about error codes and their meanings, see Error Codes. |
message |
String |
The error message returned if an error occurs. |
Example Requests
GET https://{endpoint}/v3/{project_id}/volumes?status=available
Example Responses
Status code: 200
OK
{ "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" } ] }
Status code: 400
Bad Request
{ "error" : { "message" : "XXXX", "code" : "XXX" } }
Status Codes
Status Code |
Description |
---|---|
200 |
OK |
400 |
Bad Request |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot