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

Querying EVS Snapshots

Function

Querying EVS Snapshots

Calling Method

For details, see Calling APIs.

URI

GET /v2/{project_id}/snapshots

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.

offset

No

Integer

The offset.

NOTE:

This parameter is used when snapshots are queried by page and is used together with the limit parameter. For example, there are a total of 30 snapshots. If you set offset to 11 and limit to 10, the query starts from the twelfth snapshot, and a maximum of 10 snapshots can be queried at a time.

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 the tenant has more than 50 snapshots 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:

Querying 1–50 snapshots: GET /v2/xxx/snapshots?limit=50; Querying 51–100 snapshots: GET /v2/xxx/snapshots?offset=50&limit=50

name

No

String

The snapshot name. This parameter does not support fuzzy match. You can enter up to 255 characters.

status

No

String

The snapshot status. For details, see EVS Snapshot Status.

volume_id

No

String

The ID of the snapshot's source disk.

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

snapshots_links

Array of Link objects

The query position marker in the snapshot list. This field is returned only when limit is specified in the request, and this field indicates that only some snapshots are returned in this query.

snapshots

Array of SnapshotSummary objects

The snapshot information.

Table 6 SnapshotSummary

Parameter

Type

Description

created_at

String

The time when the snapshot was created.

Time format: UTC YYYY-MM-DDTHH:MM:SS.XXXXXX

description

String

The snapshot description.

id

String

The snapshot ID.

metadata

Map<String,String>

The snapshot metadata.

If metadata contains the __system__enableActive field, the snapshot is auto-generated snapshot created during a server backup.

name

String

The snapshot name.

size

Integer

The snapshot size, in GiB.

status

String

The snapshot status. For details, see EVS Snapshot Status.

updated_at

String

The time when the snapshot was updated.

Time format: UTC YYYY-MM-DDTHH:MM:SS.XXXXXX

volume_id

String

The ID of the snapshot's source disk.

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}/v2/{project_id}/snapshots

Example Responses

Status code: 200

OK

{
  "snapshots" : [ {
    "created_at" : "2016-02-16T16:54:14.981520",
    "description" : null,
    "id" : "b836dc3d-4e10-4ea4-a34c-8f6b0460a583",
    "metadata" : { },
    "name" : "test01",
    "size" : 1,
    "status" : "available",
    "volume_id" : "ba5730ea-8621-4ae8-b702-ff0ffc12c209",
    "updated_at" : null
  }, {
    "created_at" : "2016-02-16T16:54:19.475397",
    "description" : null,
    "id" : "83be494d-329e-4a78-8ac5-9af900f48b95",
    "metadata" : { },
    "name" : "test02",
    "size" : 1,
    "status" : "available",
    "volume_id" : "ba5730ea-8621-4ae8-b702-ff0ffc12c209",
    "updated_at" : null
  }, {
    "created_at" : "2016-02-16T16:54:24.367414",
    "description" : null,
    "id" : "dd360f46-7593-4d35-8f2c-5566fd0bd79e",
    "metadata" : { },
    "name" : "test03",
    "size" : 1,
    "status" : "available",
    "volume_id" : "ba5730ea-8621-4ae8-b702-ff0ffc12c209",
    "updated_at" : null
  }, {
    "created_at" : "2016-02-16T16:54:29.766740",
    "description" : null,
    "id" : "4c29796a-8cf4-4482-9afc-e66da9a81240",
    "metadata" : { },
    "name" : "test04",
    "size" : 1,
    "status" : "available",
    "volume_id" : "ba5730ea-8621-4ae8-b702-ff0ffc12c209",
    "updated_at" : null
  } ],
  "snapshots_links" : null
}

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.