Updated on 2025-07-14 GMT+08:00

Querying Snapshots

Function

Queries snapshots.

Debugging

You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.

URI

GET /v2/{project_id}/snapshots

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

desktop_id

No

String

Desktop ID.

desktop_name

No

String

Desktop name.

snapshot_name

No

String

Snapshot name.

disk_type

No

String

Snapshot type:

  • SYSTEM_DISK: system disk

  • DATA_DISKS: data disk

  • ALL: system disk and data disk

create_type

No

String

Snapshot creation method:

  • AUTO: automatically created in a scheduled task

  • MANUALLY: manually created

status

No

String

Snapshot status:

  • creating: being created

  • restoring: being restored

  • create_success: created

  • create_failed: creation failed

  • restore_success: restored

  • restore_failed: restoration failed

sort_field

No

String

Sorting field, which must be used together with sort_type.

  • create_time: creation time

  • snapshot_name: snapshot name

sort_type

No

String

Sorting type, which defaults to ascending order. This parameter must be used together with sort_field.

  • ASC: ascending order

  • DESC: descending order

offset

No

Integer

Where the pagination query starts. The value starts from 0.

limit

No

Integer

Used for pagination query. The value ranges from 1 to 1,000 (default).

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

No

String

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

desktop_snapshots

Array of DesktopSnapshotDetailInfo objects

Desktop snapshot detail list.

total_count

Integer

Total number of desktop snapshots.

Table 5 DesktopSnapshotDetailInfo

Parameter

Type

Description

snapshot_id

String

Desktop snapshot ID.

snapshot_name

String

Desktop snapshot record name.

desktop_id

String

ID of the desktop corresponding to the snapshot.

desktop_name

String

Name of the desktop corresponding to the snapshot.

desktop_sid

String

SID of the desktop corresponding to the snapshot.

desktop_pool_id

String

ID of the desktop pool corresponding to the snapshot.

is_system_disk

Boolean

Disk type corresponding to the snapshot. The value true indicates the system disk, and the value false indicates the data disk.

status

String

Snapshot status:

  • creating: being created

  • restoring: being restored

  • create_success: created

  • create_failed: creation failed

  • restore_success: restored

  • restore_failed: restoration failed

process

Integer

Snapshot task progress. The value ranges from 0 to 100, or is null. null indicates that there is no task on the snapshot. The value from 0 to 100 indicates the task progress percentage.

description

String

Snapshot description.

create_time

String

Snapshot creation time (UTC time, yyyy-MM-dd'T'HH:mm:ss'Z).'

create_type

String

Snapshot creation method:

  • AUTO: automatically created in a scheduled task

  • MANUALLY: manually created

last_restore_time

String

Latest snapshot restoration time (UTC time, yyyy-MM-dd'T'HH:mm:ss'Z). '

restore_fail_reason

String

Snapshot restoration failure cause.

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code, which is returned upon failure.

error_msg

String

Error description.

error_detail

String

Error details.

encoded_authorization_message

String

Encrypted detailed reason for rejection. You can call the API decode-authorization-message of STS to decrypt the reason.

Status code: 403

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code, which is returned upon failure.

error_msg

String

Error description.

error_detail

String

Error details.

encoded_authorization_message

String

Encrypted detailed reason for rejection. You can call the API decode-authorization-message of STS to decrypt the reason.

Status code: 404

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error code, which is returned upon failure.

error_msg

String

Error description.

error_detail

String

Error details.

encoded_authorization_message

String

Encrypted detailed reason for rejection. You can call the API decode-authorization-message of STS to decrypt the reason.

Status code: 500

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Error code, which is returned upon failure.

error_msg

String

Error description.

error_detail

String

Error details.

encoded_authorization_message

String

Encrypted detailed reason for rejection. You can call the API decode-authorization-message of STS to decrypt the reason.

Status code: default

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Error code, which is returned upon failure.

error_msg

String

Error description.

error_detail

String

Error details.

encoded_authorization_message

String

Encrypted detailed reason for rejection. You can call the API decode-authorization-message of STS to decrypt the reason.

Example Requests

/v2/bcae3e673fd04716a3b9dacdf58ca336/snapshots

Example Responses

Status code: 200

OK.

{
  "total_count" : 2,
  "desktop_snapshots" : [ {
    "snapshot_id" : "eed156d9-02a5-46f5-8eb1-54f09ab9fbae",
    "snapshot_name" : "sys0420_xzx03_1713602176593",
    "desktop_id" : "7163a7ba-fc09-4238-ab73-0689ea7f54c3",
    "desktop_name" : "xzx03",
    "desktop_sid" : "22ad6780-3236-4838-b509-8068d254e9de",
    "is_system_disk" : true,
    "status" : "create_success",
    "description" : "Description.",
    "create_time" : "2024-04-20T08:36:16Z",
    "create_type" : "MANUALLY"
  }, {
    "snapshot_id" : "a7e996da-20db-4de8-8aff-4c8e4c6d5ed3",
    "snapshot_name" : "AUTOCREATED_AA_1713595811910",
    "desktop_id" : "a3e8d0d0-79df-413d-a327-d702a4fb2e15",
    "desktop_name" : "AA",
    "desktop_sid" : "1346b13d-d3e4-4965-bfb4-5bb880bf7dbf",
    "is_system_disk" : false,
    "status" : "create_success",
    "description" : "Description.",
    "create_time" : "2024-04-20T06:50:11Z",
    "create_type" : "AUTO"
  } ]
}

Status Codes

Status Code

Description

200

OK.

400

The request cannot be understood by the server due to malformed syntax.

403

No operation permissions.

404

No resources found.

500

An internal service error occurred. For details, see the error code description.

default

Default response to a failure.

Error Codes

See Error Codes.