Documentation ¶
Overview ¶
Returns basic information about the health of the cluster.
Index ¶
- Variables
- type Health
- func (r Health) Do(ctx context.Context) (*Response, error)
- func (r *Health) ExpandWildcards(v string) *Health
- func (r *Health) Header(key, value string) *Health
- func (r *Health) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r *Health) Index(v string) *Health
- func (r Health) IsSuccess(ctx context.Context) (bool, error)
- func (r *Health) Level(enum level.Level) *Health
- func (r *Health) Local(b bool) *Health
- func (r *Health) MasterTimeout(v string) *Health
- func (r Health) Perform(ctx context.Context) (*http.Response, error)
- func (r *Health) Timeout(v string) *Health
- func (r *Health) WaitForActiveShards(v string) *Health
- func (r *Health) WaitForEvents(enum waitforevents.WaitForEvents) *Health
- func (r *Health) WaitForNoInitializingShards(b bool) *Health
- func (r *Health) WaitForNoRelocatingShards(b bool) *Health
- func (r *Health) WaitForNodes(v string) *Health
- func (r *Health) WaitForStatus(enum healthstatus.HealthStatus) *Health
- type NewHealth
- type Response
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 Health ¶
type Health struct {
// contains filtered or unexported fields
}
func New ¶
func New(tp elastictransport.Interface) *Health
Returns basic information about the health of the cluster.
https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/cluster-health.html
func (Health) Do ¶
Do runs the request through the transport, handle the response and returns a health.Response
func (*Health) ExpandWildcards ¶
ExpandWildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. API name: expand_wildcards
func (*Health) HttpRequest ¶
HttpRequest returns the http.Request object built from the given parameters.
func (*Health) Index ¶
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 ¶
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 ¶
Level Can be one of cluster, indices or shards. Controls the details level of the health information returned. API name: level
func (*Health) Local ¶
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 ¶
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) Perform ¶
Perform runs the http.Request through the provided transport and returns an http.Response.
func (*Health) Timeout ¶
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 ¶
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 ¶
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 ¶
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 ¶
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.
type Response ¶
type Response struct { // ActivePrimaryShards The number of active primary shards. ActivePrimaryShards int `json:"active_primary_shards"` // ActiveShards The total number of active primary and replica shards. ActiveShards int `json:"active_shards"` // ActiveShardsPercentAsNumber The ratio of active shards in the cluster expressed as a percentage. ActiveShardsPercentAsNumber types.Percentage `json:"active_shards_percent_as_number"` // ClusterName The name of the cluster. ClusterName string `json:"cluster_name"` // DelayedUnassignedShards The number of shards whose allocation has been delayed by the timeout // settings. DelayedUnassignedShards int `json:"delayed_unassigned_shards"` Indices map[string]types.IndexHealthStats `json:"indices,omitempty"` // InitializingShards The number of shards that are under initialization. InitializingShards int `json:"initializing_shards"` // NumberOfDataNodes The number of nodes that are dedicated data nodes. NumberOfDataNodes int `json:"number_of_data_nodes"` // NumberOfInFlightFetch The number of unfinished fetches. NumberOfInFlightFetch int `json:"number_of_in_flight_fetch"` // NumberOfNodes The number of nodes within the cluster. NumberOfNodes int `json:"number_of_nodes"` // NumberOfPendingTasks The number of cluster-level changes that have not yet been executed. NumberOfPendingTasks int `json:"number_of_pending_tasks"` // RelocatingShards The number of shards that are under relocation. RelocatingShards int `json:"relocating_shards"` Status healthstatus.HealthStatus `json:"status"` // TaskMaxWaitingInQueue The time since the earliest initiated task is waiting for being performed. TaskMaxWaitingInQueue types.Duration `json:"task_max_waiting_in_queue,omitempty"` // TaskMaxWaitingInQueueMillis The time expressed in milliseconds since the earliest initiated task is // waiting for being performed. TaskMaxWaitingInQueueMillis int64 `json:"task_max_waiting_in_queue_millis"` // TimedOut If false the response returned within the period of time that is specified by // the timeout parameter (30s by default) TimedOut bool `json:"timed_out"` // UnassignedShards The number of shards that are not allocated. UnassignedShards int `json:"unassigned_shards"` }