All Products
Search
Document Center

Elasticsearch:ListShardRecoveries

更新時間:Sep 21, 2023

Queries the information about shards that are being restored or shards that are restored. By default, this operation returns only the information about shards that are being restored after you call this operation.

Note Shard restoration is the process of synchronizing from a primary shard to a secondary shard. After the restoration is complete, the secondary shards are available for search.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request headers

This operation uses only common request headers. For more information, see Common request headers.

Request syntax

GET /openapi/instances/{InstanceId}/cat-recovery HTTP/1.1

Request parameters

Element

Type

Position

Required

Example

Description

InstanceId String Path Yes es-cn-7mz293m9a003j****

The instance ID.

activeOnly Boolean Query No true

Specifies whether to return information about data restoration of shards. Valid values:

  • true: returns information about data restoration of shards that are being restored.
  • false: returns information about data restoration of all shards.

Response parameters

Element

Type

Example

Description

RequestId String F99407AB-2FA9-489E-A259-40CF6DCC47D9

The request ID.

Result Array of Result

The response parameters.

index String my-index-000001

The name of the index in the Elasticsearch cluster.

sourceHost String 192.168.XX.XX

The IP address of the source node.

sourceNode String 2Kni3dJ

The name of the source node.

filesTotal Long 79

The total number of files.

bytesPercent String 80%

The data restoration progress.

translogOps Long 12086

The number of translog operations to be restored.

translogOpsPercent String 80%

The restoration progress of translog operations.

bytesTotal Long 12086

The total amount of data that is restored.

targetHost String 192.168.XX.XX

The IP address of the destination node.

targetNode String YVVKLmW

The name of the destination node.

filesPercent String 80.0%

The file execution progress.

stage String done

The data restoration status. Indicates that whether the request was successful. Valid values:

  • done: Data restoration is complete.
  • finalize: Data is being cleared.
  • index: Index metadata is being read, and bytes are being copied from source to destination.
  • init: Data restoration is not started.
  • start: Data restoration is started.
  • translog: Translogs are being redone.

Examples

Sample requests

GET /openapi/instances/es-cn-7mz293m9a003j****/cat-recovery HTTP/1.1

Sample success responses

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "F99407AB-2FA9-489E-A259-40CF6DCC47D9",
  "Result" : [ {
    "index" : "my-index-000001",
    "sourceHost" : "192.168.XX.XX",
    "sourceNode" : "2Kni3dJ",
    "targetHost" : "192.168.XX.XX",
    "targetNode" : "YVVKLmW",
    "stage" : "index",
    "filesTotal" : 79,
    "filesPercent" : "80.0%",
    "bytesTotal" : 12086,
    "bytesPercent" : "80%",
    "translogOps" : 12086,
    "translogOpsPercent" : "80%"
  }, {
    "index" : "my-index-000002",
    "sourceHost" : "192.168.XX.XX",
    "sourceNode" : "2Kni3dJ",
    "targetHost" : "192.168.XX.XX",
    "targetNode" : "YVVKLmW",
    "stage" : "index",
    "filesTotal" : 56,
    "filesPercent" : "100%",
    "bytesTotal" : 11086,
    "bytesPercent" : "100%",
    "translogOps" : 11086,
    "translogOpsPercent" : "100%"
  } ]
}

Error code

For a list of error codes, see Service error codes.