Updated on 2024-02-27 GMT+08:00

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

Table 1 Path Parameters

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.

Table 2 Query Parameters

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

Table 3 Request header 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

Table 4 Response body parameters

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.

Table 5 VolumeBody

Parameter

Type

Description

id

String

The disk ID.

links

Array of Link objects

The disk URI.

name

String

The disk name.

Status code: 400

Table 7 Response body parameters

Parameter

Type

Description

error

Error object

The error message returned if an error occurs.

Table 8 Error

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.