Querying Details About EVS Snapshots

Function

This API is used to query details about the EVS snapshots.

URI

  • URI format

    GET /v2/{project_id}/snapshots/detail

  • Parameter description

    Parameter

    Mandatory

    Description

    project_id

    Yes

    The project ID.

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

  • Request filter parameters

    Parameter

    Type

    Mandatory

    Description

    marker

    String

    No

    The ID of the resource from which pagination query starts. It is the ID of the last resource on the previous page.

    offset

    Integer

    No

    The query 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

    Integer

    No

    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:

    GET /v2/xxx/snapshots/detail?limit=50: Queries the 1-50 snapshots. GET /v2/xxx/snapshots/detail?offset=50&limit=50: Queries the 51-100 snapshots.

    name

    String

    No

    The snapshot name, which can contain a maximum of 255 bytes.

    status

    String

    No

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

    volume_id

    String

    No

    The ID of the snapshot's source disk.

    availability_zone

    String

    No

    The AZ where the snapshot's source disk belongs.

Request

The following example shows how to query details of the snapshots in the available state.

  • Example request

    GET https://{endpoint}/v2/{project_id}/snapshots/detail?status=available
    

Response

  • Response parameters

    Parameter

    Type

    Description

    snapshots

    Object

    The snapshot information. For details, see Parameters in the snapshots field.

    snapshots_links

    list<map<String,String>>

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

    error

    Object

    The error message returned if an error occurs. For details, see Parameters in the error field.

  • Parameters in the snapshots field

    Parameter

    Type

    Description

    id

    String

    The snapshot ID.

    status

    String

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

    name

    String

    The snapshot name.

    description

    String

    The snapshot description.

    created_at

    String

    The time when the snapshot was created.

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

    updated_at

    String

    The time when the snapshot was updated.

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

    metadata

    Object

    The snapshot metadata.

    If metadata contains the __system__enableActive field, the snapshot is automatically created during the backup of a server.

    volume_id

    String

    The ID of the snapshot's source disk.

    size

    Integer

    The snapshot size, in GB.

    os-extended-snapshot-attributes:project_id

    String

    The tenant ID, which is the same as the project ID.

    os-extended-snapshot-attributes:progress

    String

    The reserved field.

  • Parameters in the error field

    Parameter

    Type

    Description

    message

    String

    The error message returned if an error occurs.

    code

    String

    The error code returned if an error occurs.

    For details about the error code, see Error Codes.

  • Example response

    {
        "snapshots": [
            {
                "status": "available",
                "os-extended-snapshot-attributes:progress": "100%",
                "description": null,
                "created_at": "2013-06-19T07:15:29.000000",
                "metadata": { },
                "volume_id": "ae11e59c-bd56-434a-a00c-04757e1c066d",
                "os-extended-snapshot-attributes:project_id": "d6c277ba8820452e83df36f33c9fa561",
                "size": 5,
                "id": "6cd26877-3ca3-4f4e-ae2a-38cc3d6183fa",
                "name": "name_xx2-snap",
                "updated_at": null
            },
            {
                "status": "available",
                "os-extended-snapshot-attributes:progress": "100%",
                "description": null,
                "created_at": "2013-06-19T09:08:08.000000",
                "metadata": { },
                "volume_id": "ae11e59c-bd56-434a-a00c-04757e1c066d",
                "os-extended-snapshot-attributes:project_id": "d6c277ba8820452e83df36f33c9fa561",
                "size": 5,
                "id": "b3253e26-5c37-48dd-8bf2-8795dd1e848f",
                "name": "name_xx2-snap",
                "updated_at": null
            }
        ]
    }
    

    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:

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

Status Codes

  • Normal

    200

Error Codes

For details, see Error Codes.