health

package
v8.15.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2024 License: Apache-2.0 Imports: 12 Imported by: 4

Documentation

Overview

Returns the health status of a cluster, similar to the cluster health API. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the cluster health API. This API is often used to check malfunctioning clusters. To help you track cluster health alongside log files and alerting systems, the API returns timestamps in two formats: `HH:MM:SS`, which is human-readable but includes no date information; `Unix epoch time`, which is machine-sortable and includes date information. The latter format is useful for cluster recoveries that take multiple days. You can use the cat health API to verify cluster health across multiple nodes. You also can use the API to track the recovery of a large cluster over a longer period of time.

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 the health status of a cluster, similar to the cluster health API. IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the cluster health API. This API is often used to check malfunctioning clusters. To help you track cluster health alongside log files and alerting systems, the API returns timestamps in two formats: `HH:MM:SS`, which is human-readable but includes no date information; `Unix epoch time`, which is machine-sortable and includes date information. The latter format is useful for cluster recoveries that take multiple days. You can use the cat health API to verify cluster health across multiple nodes. You also can use the API to track the recovery of a large cluster over a longer period of time.

https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-health.html

func (Health) Do

func (r Health) Do(providedCtx context.Context) (Response, error)

Do runs the request through the transport, handle the response and returns a health.Response

func (*Health) ErrorTrace added in v8.14.0

func (r *Health) ErrorTrace(errortrace bool) *Health

ErrorTrace When set to `true` Elasticsearch will include the full stack trace of errors when they occur. API name: error_trace

func (*Health) FilterPath added in v8.14.0

func (r *Health) FilterPath(filterpaths ...string) *Health

FilterPath Comma-separated list of filters in dot notation which reduce the response returned by Elasticsearch. API name: filter_path

func (*Health) Format added in v8.14.0

func (r *Health) Format(format string) *Health

Format Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. API name: format

func (*Health) H added in v8.14.0

func (r *Health) H(names ...string) *Health

H List of columns to appear in the response. Supports simple wildcards. API name: h

func (*Health) Header

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

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

func (*Health) Help added in v8.14.0

func (r *Health) Help(help bool) *Health

Help When set to `true` will output available columns. This option can't be combined with any other query string option. API name: help

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) Human added in v8.14.0

func (r *Health) Human(human bool) *Health

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 (Health) IsSuccess

func (r Health) IsSuccess(providedCtx 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) Local added in v8.14.0

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

Local If `true`, the request computes the list of selected nodes from the local cluster state. If `false` the 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. API name: local

func (*Health) MasterTimeout added in v8.14.0

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

MasterTimeout Period to wait for a connection to the master node. API name: master_timeout

func (Health) Perform added in v8.7.0

func (r Health) Perform(providedCtx context.Context) (*http.Response, error)

Perform runs the http.Request through the provided transport and returns an http.Response.

func (*Health) Pretty added in v8.14.0

func (r *Health) Pretty(pretty bool) *Health

Pretty If set to `true` the returned JSON will be "pretty-formatted". Only use this option for debugging only. API name: pretty

func (*Health) S added in v8.14.0

func (r *Health) S(names ...string) *Health

S List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting `:asc` or `:desc` as a suffix to the column name. API name: s

func (*Health) Time added in v8.9.0

func (r *Health) Time(time timeunit.TimeUnit) *Health

Time The unit used to display time values. API name: time

func (*Health) Ts

func (r *Health) Ts(ts bool) *Health

Ts If true, returns `HH:MM:SS` and Unix epoch timestamps. API name: ts

func (*Health) V added in v8.14.0

func (r *Health) V(v bool) *Health

V When set to `true` will enable verbose output. API name: v

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.

type Response added in v8.7.0

type Response []types.HealthRecord

func NewResponse added in v8.7.0

func NewResponse() Response

NewResponse returns a Response

Jump to

Keyboard shortcuts

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