putnode

package
v8.0.0-...-8970b63 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Adds a node to be shut down. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported.

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 NewPutNode

type NewPutNode func(nodeid string) *PutNode

NewPutNode type alias for index.

func NewPutNodeFunc

func NewPutNodeFunc(tp elastictransport.Interface) NewPutNode

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

type PutNode

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

func New

Adds a node to be shut down. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported.

https://www.elastic.co/guide/en/elasticsearch/reference/current

func (PutNode) Do

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

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

func (*PutNode) Header

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

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

func (*PutNode) HttpRequest

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

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

func (*PutNode) MasterTimeout

func (r *PutNode) MasterTimeout(enum timeunit.TimeUnit) *PutNode

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 (*PutNode) NodeId

func (r *PutNode) NodeId(v string) *PutNode

NodeId The node id of node to be shut down API Name: nodeid

func (PutNode) Perform

func (r PutNode) Perform(ctx context.Context) (*http.Response, error)

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

func (*PutNode) Raw

func (r *PutNode) Raw(raw io.Reader) *PutNode

Raw takes a json payload as input which is then passed to the http.Request If specified Raw takes precedence on Request method.

func (*PutNode) Request

func (r *PutNode) Request(req *Request) *PutNode

Request allows to set the request property with the appropriate payload.

func (*PutNode) Timeout

func (r *PutNode) Timeout(enum timeunit.TimeUnit) *PutNode

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

type Request

type Request struct {

	// AllocationDelay Only valid if type is restart.
	// Controls how long Elasticsearch will wait for the node to restart and join
	// the cluster before reassigning its shards to other nodes.
	// This works the same as delaying allocation with the
	// index.unassigned.node_left.delayed_timeout setting.
	// If you specify both a restart allocation delay and an index-level allocation
	// delay, the longer of the two is used.
	AllocationDelay *string `json:"allocation_delay,omitempty"`
	// Reason A human-readable reason that the node is being shut down.
	// This field provides information for other cluster operators; it does not
	// affect the shut down process.
	Reason string `json:"reason"`
	// TargetNodeName Only valid if type is replace.
	// Specifies the name of the node that is replacing the node being shut down.
	// Shards from the shut down node are only allowed to be allocated to the target
	// node, and no other data will be allocated to the target node.
	// During relocation of data certain allocation rules are ignored, such as disk
	// watermarks or user attribute filtering rules.
	TargetNodeName *string `json:"target_node_name,omitempty"`
	// Type Valid values are restart, remove, or replace.
	// Use restart when you need to temporarily shut down a node to perform an
	// upgrade, make configuration changes, or perform other maintenance.
	// Because the node is expected to rejoin the cluster, data is not migrated off
	// of the node.
	// Use remove when you need to permanently remove a node from the cluster.
	// The node is not marked ready for shutdown until data is migrated off of the
	// node Use replace to do a 1:1 replacement of a node with another node.
	// Certain allocation decisions will be ignored (such as disk watermarks) in the
	// interest of true replacement of the source node with the target node.
	// During a replace-type shutdown, rollover and index creation may result in
	// unassigned shards, and shrink may fail until the replacement is complete.
	Type type_.Type `json:"type"`
}

Request holds the request body struct for the package putnode

https://github.com/elastic/elasticsearch-specification/blob/1ad7fe36297b3a8e187b2259dedaf68a47bc236e/specification/shutdown/put_node/ShutdownPutNodeRequest.ts#L25-L77

func NewRequest

func NewRequest() *Request

NewRequest returns a Request

func (*Request) FromJSON

func (r *Request) FromJSON(data string) (*Request, error)

FromJSON allows to load an arbitrary json into the request structure

type Response

type Response struct {

	// Acknowledged For a successful response, this value is always true. On failure, an
	// exception is returned instead.
	Acknowledged bool `json:"acknowledged"`
}

func NewResponse

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