• Elastic Volume Service

evs
  1. Help Center
  2. Elastic Volume Service
  3. API Reference
  4. OpenStack Cinder API v3
  5. EVS Snapshot
  6. Querying EVS Snapshots

Querying EVS Snapshots

Function

This API is used to query the EVS snapshots.

URI

  • URI format

    GET /v3/{project_id}/snapshots

  • Parameter description

    Parameter

    Mandatory

    Description

    project_id

    Yes

    Specifies the project ID.

Request

  • Request filter parameters

    Parameter

    Type

    Mandatory

    Description

    marker

    string

    No

    Specifies the ID of the last record on the previous page. The returned value is the value of the item after this one.

    offset

    int

    No

    Specifies 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 queried snapshot starts from the twelfth snapshot, and at most 10 snapshots can be queried at a time.

    limit

    int

    No

    Specifies the maximum number of query results that can be returned. The value must be an integer greater than 0. The default value is 1000.

    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?limit=50: Queries the 1–50 snapshots. GET /v2/xxx/snapshots?offset=50&limit=50: Queries the 51–100 snapshots.

    name

    string

    No

    Specifies the name of the EVS snapshot. This parameter does not support fuzzy search. The value can contain a maximum of 255 bytes.

    sort_dir

    string

    No

    Specifies the result sorting order. The default value is desc (descending order).

    status

    string

    No

    Specifies the snapshot status. For details, see EVS Snapshot Status.

    volume_id

    string

    No

    Specifies the ID of the snapshot's source disk.

    name~

    string

    No

    Specifies the fuzzy search by disk name. This parameter is supported when the request version is 3.31 or later.

    status~

    string

    No

    Specifies the fuzzy search by disk status. This parameter is supported when the request version is 3.31 or later.

    volume_id~

    string

    No

    Specifies the fuzzy search by the ID of the disk that corresponds to the snapshot. This parameter is supported when the request version is 3.31 or later.

    sort_key

    string

    No

    Specifies the sorting query by name (sort_key=name). This parameter is supported when the request version is 3.30 or later. The default sorting order is the descending order.

    with_count

    boolean

    No

    Specifies to return parameter counts in the response. This parameter indicates the number of snapshots queried. This parameter is in the with_count=true format and is supported when the request version is 3.45 or later.

    This parameter can be used together with parameters marker, limit, sort_key, sort_dir, or offset in the table. It cannot be used with other filter parameters.

  • Example request

    None

Response

  • Parameter description

    Parameter

    Type

    Description

    snapshots_links

    list<map<string,string>>

    Specifies the query position marker in the snapshot list. This parameter is at the same level as parameter snapshots in the response body. 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.

    snapshots

    map

    Specifies the snapshot information.

    id

    string

    Specifies the ID of the EVS snapshot.

    status

    string

    Specifies the snapshot status. For details, see EVS Snapshot Status.

    name

    string

    Specifies the name of the EVS snapshot.

    description

    string

    Specifies the description of the EVS snapshot.

    created_at

    string

    Specifies the time when the EVS snapshot was created.

    metadata

    map

    Specifies the metadata of the EVS snapshot.

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

    volume_id

    string

    Specifies the disk to which the snapshot belongs.

    size

    int

    Specifies the size of the EVS snapshot.

    updated_at

    string

    Specifies the time when the snapshot was updated.

    count

    map

    Specifies the number of records returned in this query.

  • Example response
    {
        "count": 4, 
        "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
    }

    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"
        }
    }

Returned Values

  • Normal

    200

Error Codes

For details, see Error Codes.