ilm

package
v0.52.1 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package ilm contains wrappers that help with creating ILM policies.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewILMAction

func NewILMAction(options ...Option[*types.IlmActions]) *types.IlmActions

NewILMAction creates a new ILM action for with the given options.

Types

type ILMPolicy

type ILMPolicy struct {
	*putlifecycle.Request

	Name string
}

ILMPolicy represents an index lifecycle management policy.

func NewILMPolicy

func NewILMPolicy(name string, options ...Option[*types.IlmPolicy]) *ILMPolicy

NewILMPolicy creates a new ILM policy with the given options and encapsulates it in an appropriate request object.

func (*ILMPolicy) Put

Put will send a request to create the index template in the cluster.

type Option

type Option[T any] func(T)

Option is a reusable generic function for applying options to a type.

func WithActions

func WithActions(options ...Option[*types.IlmActions]) Option[*types.Phase]

WithActions adds the given actions to the phase.

https://www.elastic.co/docs/reference/elasticsearch/index-lifecycle-actions/

func WithDelete

func WithDelete() Option[*types.IlmActions]

WithDelete will add a delete action to the phase.

func WithForceMergeSegments

func WithForceMergeSegments(segments int) Option[*types.IlmActions]

WithForceMergeSegments will apply a force merge action to the phase that will force merge indices to the given number of segments.

func WithMinAge

func WithMinAge(age string) Option[*types.Phase]

WithMinAge defines the minimum age at which this phase applies.

func WithPhase

func WithPhase(name string, options ...Option[*types.Phase]) Option[*types.IlmPolicy]

WithPhase adds a phase to the ILM policy with the given phase options.

func WithRolloverMaxAge

func WithRolloverMaxAge(duration string) Option[*types.IlmActions]

WithRolloverMaxAge will apply a rollover action to the phase that will rollover indices older than the given duration.

func WithRolloverMaxSize

func WithRolloverMaxSize(size string) Option[*types.IlmActions]

WithRolloverMaxSize will apply a rollover action to the phase that will rollover indices larger than the given size.

func WithShrinkToShards

func WithShrinkToShards(shards int) Option[*types.IlmActions]

WithShrinkToShards will apply a shrink action to the phase that will shrink indices to the given number of shards.

Jump to

Keyboard shortcuts

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