• Native OpenStack API

noa
  1. Help Center
  2. Native OpenStack API
  3. API Reference
  4. OpenStack Cinder API v3
  5. EVS Snapshot
  6. Querying Details About EVS Snapshots

Querying Details About EVS Snapshots

Function

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

URI

  • URI format

    GET /v3/{project_id}/snapshots/detail

  • Parameter description

    Parameter

    Mandatory

    Description

    project_id

    Yes

    Specifies the project ID.

  • 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 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

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

    sort_dir

    string

    No

    Specifies the result sorting order. The default value is desc.
    • desc: indicates the descending order.
    • asc: indicates the ascending 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.

    metadata

    map<string,string>

    No

    Specifies the metadata filtered query in the {'key':'value'} format.

    This parameter is supported when the request version is 3.22 or later.

    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.

Request

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

  • Example request
    GET https://{endpoint}/v3/{project_id}/snapshots/detail?state=available

Response

  • Parameter description

    Parameter

    Type

    Description

    snapshots

    map

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

    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.

    count

    map

    Specifies the number of records returned in this query.

    error

    string

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

  • Parameters in the snapshots field

    Parameter

    Type

    Description

    id

    string

    Specifies the snapshot ID.

    status

    string

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

    name

    string

    Specifies the snapshot name.

    description

    string

    Specifies the snapshot description.

    created_at

    string

    Specifies the time when the snapshot was created.

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

    updated_at

    string

    Specifies the time when the snapshot was updated.

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

    metadata

    map

    Specifies the snapshot metadata.

    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 snapshot size, in GB.

    os-extended-snapshot-attributes:project_id

    string

    Specifies the tenant ID.

    os-extended-snapshot-attributes:progress

    string

    Specifies the snapshot creation progress.

    user_id

    String

    Reserved field

  • 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
    {
        "count": 2, 
        "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, 
                "user_id": "48d70679b8644035846b2cb53633c256"
            }, 
            {
                "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, 
                "user_id": "48d70679b8644035846b2cb53633c256"
            }
        ]
    }

    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.