Get shard recovery information
Generally available
All methods and paths for this operation:
Get information about ongoing and completed shard recoveries. Shard recovery is the process of initializing a shard copy, such as restoring a primary shard from a snapshot or syncing a replica shard from a primary shard. When a shard recovery completes, the recovered shard is available for search and indexing. For data streams, the API returns information about the stream’s backing indices. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the index recovery API.
Required authorization
- Index privileges:
monitor
- Cluster privileges:
monitor
Path parameters
-
A comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (
*
). To target all data streams and indices, omit this parameter or use*
or_all
.
Query parameters
-
If
true
, the response only includes ongoing shard recoveries. -
The unit used to display byte values.
Values are
b
,kb
,mb
,gb
,tb
, orpb
. -
If
true
, the response includes detailed information about shard recoveries. -
Comma-separated list or wildcard expression of index names to limit the returned information
-
A comma-separated list of columns names to display. It supports simple wildcards.
Supported values include:
index
(ori
,idx
): The index name.shard
(ors
,sh
): The shard name.start_time
(orstart
): The recovery start time.start_time_millis
(orstart_millis
): The recovery start time in epoch milliseconds.stop_time
(orstop
): The recovery stop time.stop_time_millis
(orstop_millis
): The recovery stop time in epoch milliseconds.time
(ort
,ti
): The recovery time.type
(orty
): The recovery type.stage
(orst
): The recovery stage.source_host
(orshost
): The source host.source_node
(orsnode
): The source node name.target_host
(orthost
): The target host.target_node
(ortnode
): The target node name.repository
(orrep
): The repository.snapshot
(orsnap
): The snapshot.files
(orf
): The number of files to recover.files_recovered
(orfr
): The files recovered.files_percent
(orfp
): The percent of files recovered.files_total
(ortf
): The total number of files.bytes
(orb
): The number of bytes to recover.bytes_recovered
(orbr
): The bytes recovered.bytes_percent
(orbp
): The percent of bytes recovered.bytes_total
(ortb
): The total number of bytes.translog_ops
(orto
): The number of translog ops to recover.translog_ops_recovered
(ortor
): The translog ops recovered.translog_ops_percent
(ortop
): The percent of translog ops recovered.
Values are
index
,i
,idx
,shard
,s
,sh
,start_time
,start
,start_time_millis
,start_millis
,stop_time
,stop
,stop_time_millis
,stop_millis
,time
,t
,ti
,type
,ty
,stage
,st
,source_host
,shost
,source_node
,snode
,target_host
,thost
,target_node
,tnode
,repository
,rep
,snapshot
,snap
,files
,f
,files_recovered
,fr
,files_percent
,fp
,files_total
,tf
,bytes
,b
,bytes_recovered
,br
,bytes_percent
,bp
,bytes_total
,tb
,translog_ops
,to
,translog_ops_recovered
,tor
,translog_ops_percent
, ortop
. -
A comma-separated list of column names or aliases that determines the sort order. Sorting defaults to ascending and can be changed by setting
:asc
or:desc
as a suffix to the column name. -
The unit used to display time values.
Values are
nanos
,micros
,ms
,s
,m
,h
, ord
.
GET _cat/recovery?v=true&format=json
resp = client.cat.recovery(
v=True,
format="json",
)
const response = await client.cat.recovery({
v: "true",
format: "json",
});
response = client.cat.recovery(
v: "true",
format: "json"
)
$resp = $client->cat()->recovery([
"v" => "true",
"format" => "json",
]);
curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_cat/recovery?v=true&format=json"
[
{
"index": "my-index-000001 ",
"shard": "0",
"time": "13ms",
"type": "store",
"stage": "done",
"source_host": "n/a",
"source_node": "n/a",
"target_host": "127.0.0.1",
"target_node": "node-0",
"repository": "n/a",
"snapshot": "n/a",
"files": "0",
"files_recovered": "0",
"files_percent": "100.0%",
"files_total": "13",
"bytes": "0b",
"bytes_recovered": "0b",
"bytes_percent": "100.0%",
"bytes_total": "9928b",
"translog_ops": "0",
"translog_ops_recovered": "0",
"translog_ops_percent": "100.0%"
}
]
[
{
"i": "my-index-000001",
"s": "0",
"t": "1252ms",
"ty": "peer",
"st": "done",
"shost": "192.168.1.1",
"thost": "192.168.1.1",
"f": "0",
"fp": "100.0%",
"b": "0b",
"bp": "100.0%",
}
]
[
{
"i": "my-index-000001",
"s": "0",
"t": "1978ms",
"ty": "snapshot",
"st": "done",
"rep": "my-repo",
"snap": "snap-1",
"f": "79",
"fp": "8.0%",
"b": "12086",
"bp": "9.0%"
}
]