Updated on 2022-02-22 GMT+08:00

Rolling Back a Snapshot to an EVS Disk

Function

This API is used to roll back a snapshot to an EVS disk.

Constraints

  • When you roll back a snapshot to a disk, you can only roll back the snapshot to the source disk. Rollback to a specified disk is not supported.
  • You can roll back a disk from a snapshot only when the disk is in the available or error_rollbacking state.
  • Snapshots whose names started with prefix autobk_snapshot_ are automatically created by the system during backup creations. Do not use these snapshots to roll back the disk data.

URI

  • URI format

    POST /v2/{project_id}/os-vendor-snapshots/{snapshot_id}/rollback

  • Parameter description

    Parameter

    Mandatory

    Description

    project_id

    Yes

    Specifies the project ID.

    For details about how to obtain the project ID, see Obtaining a Project ID.

    snapshot_id

    Yes

    Specifies the snapshot ID.

Request

  • Parameter description

    Parameter

    Type

    Mandatory

    Description

    rollback

    Object

    Yes

    Specifies the snapshot rollback information. For details, see Parameters in the rollback field.

  • Parameters in the rollback field

    Parameter

    Type

    Mandatory

    Description

    volume_id

    String

    Yes

    Specifies the ID of the target disk.

    name

    String

    No

    Specifies the name of the target disk. The value can contain a maximum of 255 bytes.

    NOTE:

    Parameter name cannot be used independently. When name is going to be used, volume_id must also be specified.

  • Example request
    {
        "rollback": {
            "name": "test-001",
            "volume_id": "5aa119a8-d25b-45a7-8d1b-88e127885635"
        }
    }

Response

  • Parameter description

    Parameter

    Type

    Description

    rollback

    Object

    Specifies the snapshot rollback information. For details, see Parameter in the rollback field.

    error

    Object

    Specifies the error message returned when an error occurs. For details, see Parameters in the error field.

  • Parameter in the rollback field

    Parameter

    Type

    Description

    volume_id

    String

    Specifies the ID of the target disk.

  • Parameters in the error field

    Parameter

    Type

    Description

    message

    String

    Specifies the error message returned when an error occurs.

    code

    String

    Specifies the error code returned when an error occurs.

    For details about the error code, see Error Codes.

  • Example response
    {
        "rollback": {
            "volume_id": "5aa119a8-d25b-45a7-8d1b-88e127885635"
        }
    }

    or

    {
        "error": {
            "message": "XXXX", 
            "code": "XXX"
        }
    }

    In the preceding example, error indicates a general error, for example, badRequest or itemNotFound. An example is provided as follows:

    {
        "badRequest": {
            "message": "XXXX", 
            "code": "XXX"
        }
    }

Status Codes

  • Normal

    202

Error Codes

For details, see Error Codes.