mirror of
https://codeberg.org/scip/esctl.git
synced 2026-08-24 07:54:17 +02:00
@@ -245,7 +245,7 @@ func IlmCreate(conf *cfg.Config, policyname string) error {
|
||||
haveroll = true
|
||||
}
|
||||
|
||||
if cfg.HotRolloverMaxPrimaryShardSize != 0 {
|
||||
if cfg.HotRolloverMaxPrimaryShardSize != "" {
|
||||
rollover.MaxPrimaryShardSize = &cfg.HotRolloverMaxPrimaryShardSize
|
||||
}
|
||||
|
||||
@@ -281,16 +281,50 @@ func IlmCreate(conf *cfg.Config, policyname string) error {
|
||||
phases.PhasesCaster().Warm = &warm
|
||||
}
|
||||
|
||||
if cfg.HaveCold() {
|
||||
cold := types.Phase{}
|
||||
var actions types.IlmActionsVariant = esdsl.NewIlmActions()
|
||||
|
||||
if cfg.ColdForceMerge != 0 {
|
||||
actions.IlmActionsCaster().Forcemerge = &types.ForceMergeAction{MaxNumSegments: cfg.ColdForceMerge}
|
||||
}
|
||||
|
||||
if cfg.ColdMinAge != "" {
|
||||
cold.MinAge = cfg.ColdMinAge
|
||||
}
|
||||
|
||||
if cfg.ColdPriority != 0 {
|
||||
actions.IlmActionsCaster().SetPriority = &types.SetPriorityAction{Priority: &cfg.ColdPriority}
|
||||
}
|
||||
|
||||
if cfg.ColdSearchableSnapshotRepo != "" {
|
||||
actions.IlmActionsCaster().SearchableSnapshot =
|
||||
&types.SearchableSnapshotAction{SnapshotRepository: cfg.ColdSearchableSnapshotRepo}
|
||||
}
|
||||
|
||||
cold.Actions = actions.IlmActionsCaster()
|
||||
phases.PhasesCaster().Cold = &cold
|
||||
}
|
||||
|
||||
if cfg.HaveFrozen() {
|
||||
froze := phases.PhasesCaster().Frozen
|
||||
froze := types.Phase{}
|
||||
var actions types.IlmActionsVariant = esdsl.NewIlmActions()
|
||||
|
||||
if cfg.FrozenMinAge != "" {
|
||||
froze.MinAge = cfg.FrozenMinAge
|
||||
}
|
||||
|
||||
if cfg.FrozenSearchableSnapshotRepo != "" {
|
||||
actions.IlmActionsCaster().SearchableSnapshot =
|
||||
&types.SearchableSnapshotAction{SnapshotRepository: cfg.FrozenSearchableSnapshotRepo}
|
||||
}
|
||||
|
||||
froze.Actions = actions.IlmActionsCaster()
|
||||
phases.PhasesCaster().Frozen = &froze
|
||||
}
|
||||
|
||||
if cfg.HaveDelete() {
|
||||
del := phases.PhasesCaster().Delete
|
||||
del := types.Phase{}
|
||||
delete := types.DeleteAction{}
|
||||
var actions types.IlmActionsVariant = esdsl.NewIlmActions()
|
||||
|
||||
@@ -304,7 +338,7 @@ func IlmCreate(conf *cfg.Config, policyname string) error {
|
||||
|
||||
actions.IlmActionsCaster().Delete = &delete
|
||||
del.Actions = actions.IlmActionsCaster()
|
||||
phases.PhasesCaster().Delete = del
|
||||
phases.PhasesCaster().Delete = &del
|
||||
}
|
||||
|
||||
put := &putlifecycle.Request{}
|
||||
|
||||
Reference in New Issue
Block a user