Documentation
¶
Overview ¶
Move to a lifecycle step. Manually move an index into a specific step in the lifecycle policy and run that step.
WARNING: This operation can result in the loss of data. Manually moving an index into a specific step runs that step even if it has already been performed. This is a potentially destructive action and this should be considered an expert level API.
You must specify both the current step and the step to be executed in the body of the request. The request will fail if the current step does not match the step currently running for the index This is to prevent the index from being moved from an unexpected step into the next step.
When specifying the target (`next_step`) to which the index will be moved, either the name or both the action and name fields are optional. If only the phase is specified, the index will move to the first step of the first action in the target phase. If the phase and action are specified, the index will move to the first step of the specified action in the specified phase. Only actions specified in the ILM policy are considered valid. An index cannot move to a step that is not part of its policy.
Index ¶
- Variables
- type MoveToStep
- func (r *MoveToStep) CurrentStep(currentstep *types.StepKey) *MoveToStep
- func (r MoveToStep) Do(providedCtx context.Context) (*Response, error)
- func (r *MoveToStep) ErrorTrace(errortrace bool) *MoveToStep
- func (r *MoveToStep) FilterPath(filterpaths ...string) *MoveToStep
- func (r *MoveToStep) Header(key, value string) *MoveToStep
- func (r *MoveToStep) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r *MoveToStep) Human(human bool) *MoveToStep
- func (r *MoveToStep) NextStep(nextstep *types.StepKey) *MoveToStep
- func (r MoveToStep) Perform(providedCtx context.Context) (*http.Response, error)
- func (r *MoveToStep) Pretty(pretty bool) *MoveToStep
- func (r *MoveToStep) Raw(raw io.Reader) *MoveToStep
- func (r *MoveToStep) Request(req *Request) *MoveToStep
- type NewMoveToStep
- type Request
- 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 MoveToStep ¶
type MoveToStep struct {
// contains filtered or unexported fields
}
func New ¶
func New(tp elastictransport.Interface) *MoveToStep
Move to a lifecycle step. Manually move an index into a specific step in the lifecycle policy and run that step.
WARNING: This operation can result in the loss of data. Manually moving an index into a specific step runs that step even if it has already been performed. This is a potentially destructive action and this should be considered an expert level API.
You must specify both the current step and the step to be executed in the body of the request. The request will fail if the current step does not match the step currently running for the index This is to prevent the index from being moved from an unexpected step into the next step.
When specifying the target (`next_step`) to which the index will be moved, either the name or both the action and name fields are optional. If only the phase is specified, the index will move to the first step of the first action in the target phase. If the phase and action are specified, the index will move to the first step of the specified action in the specified phase. Only actions specified in the ILM policy are considered valid. An index cannot move to a step that is not part of its policy.
https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-move-to-step.html
func (*MoveToStep) CurrentStep ¶ added in v8.9.0
func (r *MoveToStep) CurrentStep(currentstep *types.StepKey) *MoveToStep
API name: current_step
func (MoveToStep) Do ¶
func (r MoveToStep) Do(providedCtx context.Context) (*Response, error)
Do runs the request through the transport, handle the response and returns a movetostep.Response
func (*MoveToStep) ErrorTrace ¶ added in v8.14.0
func (r *MoveToStep) ErrorTrace(errortrace bool) *MoveToStep
ErrorTrace When set to `true` Elasticsearch will include the full stack trace of errors when they occur. API name: error_trace
func (*MoveToStep) FilterPath ¶ added in v8.14.0
func (r *MoveToStep) FilterPath(filterpaths ...string) *MoveToStep
FilterPath Comma-separated list of filters in dot notation which reduce the response returned by Elasticsearch. API name: filter_path
func (*MoveToStep) Header ¶
func (r *MoveToStep) Header(key, value string) *MoveToStep
Header set a key, value pair in the MoveToStep headers map.
func (*MoveToStep) HttpRequest ¶
HttpRequest returns the http.Request object built from the given parameters.
func (*MoveToStep) Human ¶ added in v8.14.0
func (r *MoveToStep) Human(human bool) *MoveToStep
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 (*MoveToStep) NextStep ¶ added in v8.9.0
func (r *MoveToStep) NextStep(nextstep *types.StepKey) *MoveToStep
API name: next_step
func (MoveToStep) Perform ¶ added in v8.7.0
Perform runs the http.Request through the provided transport and returns an http.Response.
func (*MoveToStep) Pretty ¶ added in v8.14.0
func (r *MoveToStep) Pretty(pretty bool) *MoveToStep
Pretty If set to `true` the returned JSON will be "pretty-formatted". Only use this option for debugging only. API name: pretty
func (*MoveToStep) Raw ¶
func (r *MoveToStep) Raw(raw io.Reader) *MoveToStep
Raw takes a json payload as input which is then passed to the http.Request If specified Raw takes precedence on Request method.
func (*MoveToStep) Request ¶
func (r *MoveToStep) Request(req *Request) *MoveToStep
Request allows to set the request property with the appropriate payload.
type NewMoveToStep ¶
type NewMoveToStep func(index string) *MoveToStep
NewMoveToStep type alias for index.
func NewMoveToStepFunc ¶
func NewMoveToStepFunc(tp elastictransport.Interface) NewMoveToStep
NewMoveToStepFunc returns a new instance of MoveToStep with the provided transport. Used in the index of the library this allows to retrieve every apis in once place.
type Request ¶
type Request struct { CurrentStep types.StepKey `json:"current_step"` NextStep types.StepKey `json:"next_step"` }
Request holds the request body struct for the package movetostep