All methods and paths for this operation:
Get a snapshot of the number of shards allocated to each data node and their disk space.
IMPORTANT: CAT APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications.
Required authorization
- Cluster privileges:
monitor
Path parameters
-
A comma-separated list of node identifiers or names used to limit the returned information.
Query parameters
-
A comma-separated list of columns names to display. It supports simple wildcards.
Supported values include:
shards(ors): The number of shards on the node.shards.undesired: The number of shards scheduled to be moved elsewhere in the cluster.write_load.forecast(orwlf,writeLoadForecast): The sum of index write load forecasts.disk.indices.forecast(ordif,diskIndicesForecast): The sum of shard size forecasts.disk.indices(ordi,diskIndices): The disk space used by Elasticsearch indices.disk.used(ordu,diskUsed): The total disk space used on the node.disk.avail(orda,diskAvail): The available disk space on the node.disk.total(ordt,diskTotal): The total disk capacity of all volumes on the node.disk.percent(ordp,diskPercent): The percentage of disk space used on the node.host(orh): IThe host of the node.ip: The IP address of the node.node(orn): The name of the node.node.role(orr,role,nodeRole): The roles assigned to the node.
Values are
shards,s,shards.undesired,write_load.forecast,wlf,writeLoadForecast,disk.indices.forecast,dif,diskIndicesForecast,disk.indices,di,diskIndices,disk.used,du,diskUsed,disk.avail,da,diskAvail,disk.total,dt,diskTotal,disk.percent,dp,diskPercent,host,h,ip,node,n,node.role,r,role, ornodeRole. -
List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting
:ascor:descas a suffix to the column name. -
If
true, the request computes the list of selected nodes from the local cluster state. Iffalsethe list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node.Default value is
false. -
Period to wait for a connection to the master node.
Default value is
30s. -
Specifies the format to return the columnar data in, can be set to
text,json,cbor,yaml, orsmile.Default value is
text. -
When set to
truewill output available columns. This option can't be combined with any other query string option.Default value is
false. -
When set to
truewill enable verbose output.Default value is
false. -
Sets the units for columns that contain a byte-size value. Note that byte-size value units work in terms of powers of 1024. For instance
1kbmeans 1024 bytes, not 1000 bytes. If omitted, byte-size values are rendered with a suffix such askb,mb, orgb, chosen such that the numeric value of the column is as small as possible whilst still being at least1.0. If given, byte-size values are rendered as an integer with no suffix, representing the value of the column in the chosen unit. Values that are not an exact multiple of the chosen unit are rounded down.Values are
b,kb,mb,gb,tb, orpb. -
Sets the units for columns that contain a time duration. If omitted, time duration values are rendered with a suffix such as
ms,s,morh, chosen such that the numeric value of the column is as small as possible whilst still being at least1.0. If given, time duration values are rendered as an integer with no suffix. Values that are not an exact multiple of the chosen unit are rounded down.Values are
nanos,micros,ms,s,m,h, ord.
GET /_cat/allocation?v=true&format=json
resp = client.cat.allocation(
v=True,
format="json",
)
const response = await client.cat.allocation({
v: "true",
format: "json",
});
response = client.cat.allocation(
v: "true",
format: "json"
)
$resp = $client->cat()->allocation([
"v" => "true",
"format" => "json",
]);
curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_cat/allocation?v=true&format=json"
client.cat().allocation(a -> a);
[
{
"shards": "1",
"shards.undesired": "0",
"write_load.forecast": "0.0",
"disk.indices.forecast": "260b",
"disk.indices": "260b",
"disk.used": "47.3gb",
"disk.avail": "43.4gb",
"disk.total": "100.7gb",
"disk.percent": "46",
"host": "127.0.0.1",
"ip": "127.0.0.1",
"node": "CSUXak2",
"node.role": "himrst"
}
]