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 ¶
- Variables
- type NewRollover
- type Request
- type Response
- type Rollover
- func (r *Rollover) Alias(v string) *Rollover
- func (r Rollover) Do(ctx context.Context) (*Response, error)
- func (r *Rollover) DryRun(b bool) *Rollover
- func (r *Rollover) Header(key, value string) *Rollover
- func (r *Rollover) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r *Rollover) MasterTimeout(v string) *Rollover
- func (r *Rollover) NewIndex(v string) *Rollover
- func (r Rollover) Perform(ctx context.Context) (*http.Response, error)
- func (r *Rollover) Raw(raw io.Reader) *Rollover
- func (r *Rollover) Request(req *Request) *Rollover
- func (r *Rollover) Timeout(v string) *Rollover
- func (r *Rollover) WaitForActiveShards(v string) *Rollover
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 NewRollover ¶
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[string]types.Alias `json:"aliases,omitempty"` Conditions *types.RolloverConditions `json:"conditions,omitempty"` Mappings *types.TypeMapping `json:"mappings,omitempty"` Settings map[string]json.RawMessage `json:"settings,omitempty"` }
Request holds the request body struct for the package rollover
type Response ¶
type Response struct { Acknowledged bool `json:"acknowledged"` Conditions map[string]bool `json:"conditions"` DryRun bool `json:"dry_run"` NewIndex string `json:"new_index"` OldIndex string `json:"old_index"` RolledOver bool `json:"rolled_over"` ShardsAcknowledged bool `json:"shards_acknowledged"` }
type Rollover ¶
type Rollover struct {
// contains filtered or unexported fields
}
func New ¶
func New(tp elastictransport.Interface) *Rollover
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) Do ¶
Do runs the request through the transport, handle the response and returns a rollover.Response
func (*Rollover) DryRun ¶
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) HttpRequest ¶
HttpRequest returns the http.Request object built from the given parameters.
func (*Rollover) MasterTimeout ¶
MasterTimeout Specify timeout for connection to master API name: master_timeout
func (Rollover) Perform ¶
Perform runs the http.Request through the provided transport and returns an http.Response.
func (*Rollover) Raw ¶
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) WaitForActiveShards ¶
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