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

Updating an EVS Snapshot

Function

This API is used to update an EVS snapshot.

Calling Method

For details, see Calling APIs.

URI

PUT /v2/{project_id}/snapshots/{snapshot_id}

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.

snapshot_id

Yes

String

The snapshot ID.

Request Parameters

Table 2 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.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

snapshot

Yes

CinderUpdateSnapshotOption object

The snapshot information to be updated.

Table 4 CinderUpdateSnapshotOption

Parameter

Mandatory

Type

Description

name

No

String

The snapshot name. You can enter up to 64 characters.

NOTE:

When a backup is created for a disk, a snapshot will also be created and named with the autobk_snapshot_ prefix. Operations cannot be performed on such snapshots. Therefore, you are advised not to use autobk_snapshot_ as the prefix of snapshot names to avoid any inconvenience.

description

No

String

The snapshot description. You can enter up to 85 characters.

Response Parameters

Status code: 200

Table 5 Response body parameters

Parameter

Type

Description

snapshot

SnapshotSummary object

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

Updating the EVS snapshot name and description

PUT https://{endpoint}/v2/{project_id}/snapshots/{snapshot_id}

{
  "snapshot" : {
    "name" : "name_xx3",
    "description" : "hello"
  }
}

Example Responses

Status code: 200

OK

{
  "snapshot" : {
    "status" : "available",
    "description" : "Daily backup",
    "created_at" : "2013-02-25T03:56:53.081642",
    "metadata" : { },
    "volume_id" : "5aa119a8-d25b-45a7-8d1b-88e127885635",
    "size" : 1,
    "id" : "f9faf7df-fdc1-4093-9ef3-5cba06eef995",
    "name" : "snap-001",
    "updated_at" : "2013-02-25T03:56:53.081642"
  }
}

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.