rollover

package
v8.4.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2022 License: Apache-2.0 Imports: 11 Imported by: 5

Documentation

Overview

Updates an alias to point to a new index when the existing index is considered to be too large or too old.

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 NewRollover

type NewRollover func(alias string) *Rollover

NewRollover type alias for index.

func NewRolloverFunc

func NewRolloverFunc(tp elastictransport.Interface) NewRollover

NewRolloverFunc returns a new instance of Rollover 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 {
	Aliases map[types.IndexName]types.Alias `json:"aliases,omitempty"`

	Conditions *types.RolloverConditions `json:"conditions,omitempty"`

	Mappings *types.TypeMapping `json:"mappings,omitempty"`

	Settings map[string]interface{} `json:"settings,omitempty"`
}

Request holds the request body struct for the package rollover

https://github.com/elastic/elasticsearch-specification/blob/1b56d7e58f5c59f05d1641c6d6a8117c5e01d741/specification/indices/rollover/IndicesRolloverRequest.ts#L29-L51

type RequestBuilder

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

RequestBuilder is the builder API for the rollover.Request

func NewRequestBuilder

func NewRequestBuilder() *RequestBuilder

NewRequest returns a RequestBuilder which can be chained and built to retrieve a RequestBuilder

func (*RequestBuilder) Aliases

func (rb *RequestBuilder) Aliases(values map[types.IndexName]*types.AliasBuilder) *RequestBuilder

func (*RequestBuilder) Build

func (rb *RequestBuilder) Build() *Request

Build finalize the chain and returns the Request struct.

func (*RequestBuilder) Conditions

func (rb *RequestBuilder) Conditions(conditions *types.RolloverConditionsBuilder) *RequestBuilder

func (*RequestBuilder) FromJSON

func (rb *RequestBuilder) FromJSON(data string) (*Request, error)

FromJSON allows to load an arbitrary json into the request structure

func (*RequestBuilder) Mappings

func (rb *RequestBuilder) Mappings(mappings *types.TypeMappingBuilder) *RequestBuilder

func (*RequestBuilder) Settings

func (rb *RequestBuilder) Settings(value map[string]interface{}) *RequestBuilder

type Rollover

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

func New

Updates an alias to point to a new index when the existing index is considered to be too large or too old.

https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-rollover-index.html

func (*Rollover) Alias

func (r *Rollover) Alias(v string) *Rollover

Alias The name of the alias to rollover API Name: alias

func (Rollover) Do

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

Do runs the http.Request through the provided transport.

func (*Rollover) DryRun

func (r *Rollover) DryRun(b bool) *Rollover

DryRun If set to true the rollover action will only be validated but not actually performed even if a condition matches. The default is false API name: dry_run

func (*Rollover) Header

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

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

func (*Rollover) HttpRequest

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

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

func (*Rollover) MasterTimeout

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

MasterTimeout Specify timeout for connection to master API name: master_timeout

func (*Rollover) NewIndex

func (r *Rollover) NewIndex(v string) *Rollover

NewIndex The name of the rollover index API Name: newindex

func (*Rollover) Raw

func (r *Rollover) Raw(raw json.RawMessage) *Rollover

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

func (*Rollover) Request

func (r *Rollover) Request(req *Request) *Rollover

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

func (*Rollover) Timeout

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

Timeout Explicit operation timeout API name: timeout

func (*Rollover) WaitForActiveShards

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

WaitForActiveShards Set the number of active shards to wait for on the newly created rollover index before the operation returns. API name: wait_for_active_shards

Jump to

Keyboard shortcuts

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