Documentation
¶
Overview ¶
Get the cluster state. Get comprehensive information about the state of the cluster.
The cluster state is an internal data structure which keeps track of a variety of information needed by every node, including the identity and attributes of the other nodes in the cluster; cluster-wide settings; index metadata, including the mapping and settings for each index; the location and status of every shard copy in the cluster.
The elected master node ensures that every node in the cluster has a copy of the same cluster state. This API lets you retrieve a representation of this internal state for debugging or diagnostic purposes. You may need to consult the Elasticsearch source code to determine the precise meaning of the response.
By default the API will route requests to the elected master node since this node is the authoritative source of cluster states. You can also retrieve the cluster state held on the node handling the API request by adding the `?local=true` query parameter.
Elasticsearch may need to expend significant effort to compute a response to this API in larger clusters, and the response may comprise a very large quantity of data. If you use this API repeatedly, your cluster may become unstable.
WARNING: The response is a representation of an internal data structure. Its format is not subject to the same compatibility guarantees as other more stable APIs and may change from version to version. Do not query this API using external monitoring tools. Instead, obtain the information you require using other more stable cluster APIs.
Index ¶
- Variables
- type NewState
- type Response
- type State
- func (r *State) AllowNoIndices(allownoindices bool) *State
- func (r State) Do(providedCtx context.Context) (Response, error)
- func (r *State) ErrorTrace(errortrace bool) *State
- func (r *State) ExpandWildcards(expandwildcards ...expandwildcard.ExpandWildcard) *State
- func (r *State) FilterPath(filterpaths ...string) *State
- func (r *State) FlatSettings(flatsettings bool) *State
- func (r *State) Header(key, value string) *State
- func (r *State) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r *State) Human(human bool) *State
- func (r *State) IgnoreUnavailable(ignoreunavailable bool) *State
- func (r *State) Index(index string) *State
- func (r State) IsSuccess(providedCtx context.Context) (bool, error)
- func (r *State) Local(local bool) *State
- func (r *State) MasterTimeout(duration string) *State
- func (r *State) Metric(metric string) *State
- func (r State) Perform(providedCtx context.Context) (*http.Response, error)
- func (r *State) Pretty(pretty bool) *State
- func (r *State) WaitForMetadataVersion(versionnumber string) *State
- func (r *State) WaitForTimeout(duration string) *State
Constants ¶
This section is empty.
Variables ¶
var ErrBuildPath = errors.New("cannot build path, check for missing path parameters")
ErrBuildPath is returned in case of missing parameters within the build of the request.
Functions ¶
This section is empty.
Types ¶
type NewState ¶
type NewState func() *State
NewState type alias for index.
func NewStateFunc ¶
func NewStateFunc(tp elastictransport.Interface) NewState
NewStateFunc returns a new instance of State with the provided transport. Used in the index of the library this allows to retrieve every apis in once place.
type Response ¶ added in v8.7.0
type Response = json.RawMessage
func NewResponse ¶ added in v8.7.1
func NewResponse() *Response
type State ¶
type State struct {
// contains filtered or unexported fields
}
func New ¶
func New(tp elastictransport.Interface) *State
Get the cluster state. Get comprehensive information about the state of the cluster.
The cluster state is an internal data structure which keeps track of a variety of information needed by every node, including the identity and attributes of the other nodes in the cluster; cluster-wide settings; index metadata, including the mapping and settings for each index; the location and status of every shard copy in the cluster.
The elected master node ensures that every node in the cluster has a copy of the same cluster state. This API lets you retrieve a representation of this internal state for debugging or diagnostic purposes. You may need to consult the Elasticsearch source code to determine the precise meaning of the response.
By default the API will route requests to the elected master node since this node is the authoritative source of cluster states. You can also retrieve the cluster state held on the node handling the API request by adding the `?local=true` query parameter.
Elasticsearch may need to expend significant effort to compute a response to this API in larger clusters, and the response may comprise a very large quantity of data. If you use this API repeatedly, your cluster may become unstable.
WARNING: The response is a representation of an internal data structure. Its format is not subject to the same compatibility guarantees as other more stable APIs and may change from version to version. Do not query this API using external monitoring tools. Instead, obtain the information you require using other more stable cluster APIs.
https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-state.html
func (*State) AllowNoIndices ¶
AllowNoIndices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) API name: allow_no_indices
func (State) Do ¶
Do runs the request through the transport, handle the response and returns a state.Response
func (*State) ErrorTrace ¶ added in v8.14.0
ErrorTrace When set to `true` Elasticsearch will include the full stack trace of errors when they occur. API name: error_trace
func (*State) ExpandWildcards ¶
func (r *State) ExpandWildcards(expandwildcards ...expandwildcard.ExpandWildcard) *State
ExpandWildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. API name: expand_wildcards
func (*State) FilterPath ¶ added in v8.14.0
FilterPath Comma-separated list of filters in dot notation which reduce the response returned by Elasticsearch. API name: filter_path
func (*State) FlatSettings ¶
FlatSettings Return settings in flat format (default: false) API name: flat_settings
func (*State) HttpRequest ¶
HttpRequest returns the http.Request object built from the given parameters.
func (*State) Human ¶ added in v8.14.0
Human When set to `true` will return statistics in a format suitable for humans. For example `"exists_time": "1h"` for humans and `"eixsts_time_in_millis": 3600000` for computers. When disabled the human readable values will be omitted. This makes sense for responses being consumed only by machines. API name: human
func (*State) IgnoreUnavailable ¶
IgnoreUnavailable Whether specified concrete indices should be ignored when unavailable (missing or closed) API name: ignore_unavailable
func (*State) Index ¶
Index A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices API Name: index
func (State) IsSuccess ¶
IsSuccess allows to run a query with a context and retrieve the result as a boolean. This only exists for endpoints without a request payload and allows for quick control flow.
func (*State) Local ¶
Local Return local information, do not retrieve the state from master node (default: false) API name: local
func (*State) MasterTimeout ¶
MasterTimeout Specify timeout for connection to master API name: master_timeout
func (*State) Metric ¶
Metric Limit the information returned to the specified metrics API Name: metric
func (State) Perform ¶ added in v8.7.0
Perform runs the http.Request through the provided transport and returns an http.Response.
func (*State) Pretty ¶ added in v8.14.0
Pretty If set to `true` the returned JSON will be "pretty-formatted". Only use this option for debugging only. API name: pretty
func (*State) WaitForMetadataVersion ¶
WaitForMetadataVersion Wait for the metadata version to be equal or greater than the specified metadata version API name: wait_for_metadata_version
func (*State) WaitForTimeout ¶
WaitForTimeout The maximum time to wait for wait_for_metadata_version before timing out API name: wait_for_timeout