state
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
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 avariety of information needed by every node, including the identity andattributes of the other nodes in the cluster; cluster-wide settings; indexmetadata, including the mapping and settings for each index; the location andstatus of every shard copy in the cluster.
The elected master node ensures that every node in the cluster has a copy ofthe same cluster state.This API lets you retrieve a representation of this internal state fordebugging or diagnostic purposes.You may need to consult the Elasticsearch source code to determine theprecise meaning of the response.
By default the API will route requests to the elected master node since thisnode is the authoritative source of cluster states.You can also retrieve the cluster state held on the node handling the APIrequest by adding the `?local=true` query parameter.
Elasticsearch may need to expend significant effort to compute a response tothis API in larger clusters, and the response may comprise a very largequantity 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 morestable 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 clusterAPIs.
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¶
typeNewState¶
type NewState func() *State
NewState type alias for index.
funcNewStateFunc¶
func NewStateFunc(tpelastictransport.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.
typeResponse¶added inv8.7.0
type Response =json.RawMessage
funcNewResponse¶added inv8.7.1
func NewResponse() *Response
typeState¶
type State struct {// contains filtered or unexported fields}funcNew¶
func New(tpelastictransport.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 avariety of information needed by every node, including the identity andattributes of the other nodes in the cluster; cluster-wide settings; indexmetadata, including the mapping and settings for each index; the location andstatus of every shard copy in the cluster.
The elected master node ensures that every node in the cluster has a copy ofthe same cluster state.This API lets you retrieve a representation of this internal state fordebugging or diagnostic purposes.You may need to consult the Elasticsearch source code to determine theprecise meaning of the response.
By default the API will route requests to the elected master node since thisnode is the authoritative source of cluster states.You can also retrieve the cluster state held on the node handling the APIrequest by adding the `?local=true` query parameter.
Elasticsearch may need to expend significant effort to compute a response tothis API in larger clusters, and the response may comprise a very largequantity 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 morestable 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 clusterAPIs.
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 concreteindices. (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 inv8.14.0
ErrorTrace When set to `true` Elasticsearch will include the full stack trace of errorswhen 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 inv8.14.0
FilterPath Comma-separated list of filters in dot notation which reduce the responsereturned 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 thegiven parameters.
func (*State)Human¶added inv8.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 humanreadable values will be omitted. This makes sense for responses beingconsumedonly 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 performthe operation on all indicesAPI 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 masterAPI name: master_timeout
func (State)Perform¶added inv8.7.0
Perform runs the http.Request through the provided transport and returns an http.Response.
func (*State)Pretty¶added inv8.14.0
Pretty If set to `true` the returned JSON will be "pretty-formatted". Only usethis option for debugging only.API name: pretty
func (*State)WaitForMetadataVersion¶
WaitForMetadataVersion Wait for the metadata version to be equal or greater than the specifiedmetadata versionAPI name: wait_for_metadata_version
func (*State)WaitForTimeout¶
WaitForTimeout The maximum time to wait for wait_for_metadata_version before timing outAPI name: wait_for_timeout