health

package
v8.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 11, 2023 License: Apache-2.0 Imports: 14 Imported by: 4

Documentation

Overview

Returns basic information about the health of the cluster.

Index

Constants

This section is empty.

Variables

View Source
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 Health

type Health struct {
	// contains filtered or unexported fields
}

func New

Returns basic information about the health of the cluster.

https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/cluster-health.html

func (Health) Do

func (r Health) Do(ctx context.Context) (*http.Response, error)

Do runs the http.Request through the provided transport.

func (*Health) ExpandWildcards

func (r *Health) ExpandWildcards(value string) *Health

ExpandWildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. API name: expand_wildcards

func (*Health) Header

func (r *Health) Header(key, value string) *Health

Header set a key, value pair in the Health headers map.

func (*Health) HttpRequest

func (r *Health) HttpRequest(ctx context.Context) (*http.Request, error)

HttpRequest returns the http.Request object built from the given parameters.

func (*Health) Index

func (r *Health) Index(v string) *Health

Index Comma-separated list of data streams, indices, and index aliases used to limit the request. Wildcard expressions (*) are supported. To target all data streams and indices in a cluster, omit this parameter or use _all or *. API Name: index

func (Health) IsSuccess

func (r Health) IsSuccess(ctx context.Context) (bool, error)

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 (*Health) Level

func (r *Health) Level(enum level.Level) *Health

Level Can be one of cluster, indices or shards. Controls the details level of the health information returned. API name: level

func (*Health) Local

func (r *Health) Local(b bool) *Health

Local If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node. API name: local

func (*Health) MasterTimeout

func (r *Health) MasterTimeout(value string) *Health

MasterTimeout Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. API name: master_timeout

func (*Health) Timeout

func (r *Health) Timeout(value string) *Health

Timeout Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. API name: timeout

func (*Health) WaitForActiveShards

func (r *Health) WaitForActiveShards(value string) *Health

WaitForActiveShards A number controlling to how many active shards to wait for, all to wait for all shards in the cluster to be active, or 0 to not wait. API name: wait_for_active_shards

func (*Health) WaitForEvents

func (r *Health) WaitForEvents(enum waitforevents.WaitForEvents) *Health

WaitForEvents Can be one of immediate, urgent, high, normal, low, languid. Wait until all currently queued events with the given priority are processed. API name: wait_for_events

func (*Health) WaitForNoInitializingShards

func (r *Health) WaitForNoInitializingShards(b bool) *Health

WaitForNoInitializingShards A boolean value which controls whether to wait (until the timeout provided) for the cluster to have no shard initializations. Defaults to false, which means it will not wait for initializing shards. API name: wait_for_no_initializing_shards

func (*Health) WaitForNoRelocatingShards

func (r *Health) WaitForNoRelocatingShards(b bool) *Health

WaitForNoRelocatingShards A boolean value which controls whether to wait (until the timeout provided) for the cluster to have no shard relocations. Defaults to false, which means it will not wait for relocating shards. API name: wait_for_no_relocating_shards

func (*Health) WaitForNodes

func (r *Health) WaitForNodes(value string) *Health

WaitForNodes The request waits until the specified number N of nodes is available. It also accepts >=N, <=N, >N and <N. Alternatively, it is possible to use ge(N), le(N), gt(N) and lt(N) notation. API name: wait_for_nodes

func (*Health) WaitForStatus

func (r *Health) WaitForStatus(enum healthstatus.HealthStatus) *Health

WaitForStatus One of green, yellow or red. Will wait (until the timeout provided) until the status of the cluster changes to the one provided or better, i.e. green > yellow > red. By default, will not wait for any status. API name: wait_for_status

type NewHealth

type NewHealth func() *Health

NewHealth type alias for index.

func NewHealthFunc

func NewHealthFunc(tp elastictransport.Interface) NewHealth

NewHealthFunc returns a new instance of Health with the provided transport. Used in the index of the library this allows to retrieve every apis in once place.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL