Advanced
Тема интерфейса

Querying a Snapshot List

Function

This API is used to query all the snapshots of a cluster.

URI

GET /v1.0/{project_id}/clusters/{cluster_id}/index_snapshots

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Parameter description:

The project ID. For details about how to obtain the project ID and name, see Obtaining the Project ID and Name.

Constraints:

N/A

Options:

For details about how to obtain the project ID and name, see Obtaining the Project ID and Name.

Default value:

N/A

cluster_id

Yes

String

Parameter description:

ID of the cluster whose snapshots you want to query.

Constraints:

N/A

Options:

For details about how to obtain the cluster ID, see Obtaining the Cluster ID.

Default value:

N/A

Request Parameters

None

Response Parameters

Status code: 200

Table 2 Response body parameters

Parameter

Type

Description

backups

Array of ListSnapshotBackupsResp objects

Parameter description:

Snapshot list.

Table 3 ListSnapshotBackupsResp

Parameter

Type

Description

created

String

Parameter description:

Snapshot creation time.

datastore

Parameter description:

Search engine.

description

String

Parameter description:

Snapshot description.

id

String

Parameter description:

Snapshot ID

clusterId

String

Parameter description:

Cluster ID

clusterName

String

Parameter description:

Cluster name.

name

String

Parameter description:

The snapshot name.

status

String

Parameter description:

Snapshot status.

Options:

  • **BUILDING": creating

  • COMPLETED: available

  • FAILED: unavailable

  • PART_FAILED: partially available

updated

String

Parameter description:

Time when the snapshot was updated. The format is ISO8601: CCYY-MM-DDThh:mm:ss.

backupType

String

Parameter description:

Snapshot type.

Options:

  • 0: Automatic creation.

  • 1: Manual creation.

backupMethod

String

Parameter description:

Snapshot creation mode.

Options:

  • auto: automatic creation.

  • manual: manual creation.

backupExpectedStartTime

String

Parameter description:

Snapshot start time.

backupKeepDay

Integer

Parameter description:

Snapshot retention period.

backupPeriod

String

Parameter description:

Time when a snapshot is executed every day.

indices

String

Parameter description:

Index you want to back up.

totalShards

Integer

Parameter description:

Total number of shards of the index you want to back up.

failedShards

Integer

Parameter description:

Number of shards that fail to be backed up.

version

String

Parameter description:

Snapshot version.

restoreStatus

String

Parameter description:

Snapshot restoration status.

Options:

  • restoring: restoration in progress.

  • success: successful restoration.

  • failed: restoration failed.

startTime

Long

Parameter description:

Snapshot start timestamp.

endTime

Long

Parameter description:

Snapshot end timestamp.

bucketName

String

Parameter description:

Name of the bucket that stores snapshot data.

Table 4 ListSnapshotBackupsDatastoreResp

Parameter

Type

Description

type

String

Parameter description:

Engine type. Currently, only Elasticsearch is supported.

version

String

Parameter description:

Elasticsearch engine version. For details, see the supported versions in Before You Start.

Example Requests

Query the cluster snapshot list.

GET https://{Endpoint}/v1.0/{project_id}/clusters/{cluster_id}/index_snapshots

Example Responses

Status code: 200

Request succeeded.

{
"backups" : [ {
"created" : "2018-03-07T07:34:47",
"datastore" : {
"type" : "elasticsearch",
"version" : "x.x.x"
},
"description" : "",
"id" : "e29d99c1-3d19-4ea4-ae8d-f252df76cbe9",
"clusterId" : "37cb1075-c38e-4cd8-81df-442d52df3786",
"clusterName" : "Es-xfx",
"name" : "snapshot-002",
"status" : "COMPLETED",
"updated" : "2018-03-07T07:40:12",
"backupType" : "1",
"backupMethod" : "manual",
"backupExpectedStartTime" : null,
"backupKeepDay" : null,
"backupPeriod" : null,
"indices" : ".kibanawebsite2",
"totalShards" : 6,
"failedShards" : 0,
"version" : "x.x.x",
"restoreStatus" : "success",
"startTime" : 1520408087099,
"endTime" : 1520408412219,
"bucketName" : "obs-b8ed"
}, {
"created" : "2018-03-06T15:42:37",
"datastore" : {
"type" : "elasticsearch",
"version" : "x.x.x"
},
"description" : "",
"id" : "29a2254e-947f-4463-b65a-5f0b17515fae",
"clusterId" : "37cb1075-c38e-4cd8-81df-442d52df3786",
"clusterName" : "Es-xfx",
"name" : "snapshot-001",
"status" : "COMPLETED",
"updated" : "2018-03-06T15:48:04",
"backupType" : "1",
"backupMethod" : "manual",
"backupExpectedStartTime" : null,
"backupKeepDay" : null,
"backupPeriod" : null,
"indices" : ".kibana",
"totalShards" : 1,
"failedShards" : 0,
"version" : "x.x.x",
"restoreStatus" : "none",
"startTime" : 1520350957275,
"endTime" : 1520351284357,
"bucketName" : "obs-b8ed"
} ]
}

Status Codes

Status Code

Description

200

Request succeeded.

406

The server could not fulfill the request according to the content characteristics of the request.

Error Codes