| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 | [[cluster-state]]== Cluster StateThe cluster state API allows to get a comprehensive state information ofthe whole cluster.[source,js]--------------------------------------------------GET /_cluster/state--------------------------------------------------// CONSOLEThe response provides the cluster name, the total compressed sizeof the cluster state (its size when serialized for transmission overthe network), and the cluster state itself, which can be filtered toonly retrieve the parts of interest, as described below.The cluster's `cluster_uuid` is also returned as part of the top-levelresponse, in addition to the `metadata` section. added[6.4.0]NOTE: While the cluster is still forming, it is possible for the `cluster_uuid`      to be `_na_` as well as the cluster state's version to be `-1`.By default, the cluster state request is routed to the master node, toensure that the latest cluster state is returned.   For debugging purposes, you can retrieve the cluster state local to aparticular node by adding `local=true` to the  query string.[float]=== Response FiltersAs the cluster state can grow (depending on the number of shards and indices, your mapping, templates),it is possible to filter the cluster state response specifying the parts in the URL.[source,js]--------------------------------------------------GET /_cluster/state/{metrics}/{indices}--------------------------------------------------// CONSOLE`metrics` can be a comma-separated list of`version`::    Shows the cluster state version.`master_node`::    Shows the elected `master_node` part of the response`nodes`::    Shows the `nodes` part of the response`routing_table`::    Shows the `routing_table` part of the response. If you supply a comma separated list of indices, the returned output will only contain the indices listed.`metadata`::    Shows the `metadata` part of the response. If you supply a comma separated list of indices, the returned output will only contain the indices listed.`blocks`::    Shows the `blocks` part of the responseThe following example returns only `metadata` and `routing_table` data for the `foo` and `bar` indices:[source,js]--------------------------------------------------GET /_cluster/state/metadata,routing_table/foo,bar--------------------------------------------------// CONSOLEThe next example returns everything for the `foo` and `bar` indices:[source,js]--------------------------------------------------GET /_cluster/state/_all/foo,bar--------------------------------------------------// CONSOLEAnd this example return only `blocks` data:[source,js]--------------------------------------------------GET /_cluster/state/blocks--------------------------------------------------// CONSOLE
 |