mirror of
https://codeberg.org/scip/esctl.git
synced 2026-08-24 06:34:18 +02:00
add ilm management support (#43)
This commit is contained in:
@@ -110,6 +110,8 @@ type Config struct {
|
||||
DryRun bool // rollover: -n
|
||||
|
||||
Tag string // api ls: -t
|
||||
|
||||
Ilm Ilm // ilm create
|
||||
}
|
||||
|
||||
func NewConfig() *Config {
|
||||
|
||||
72
pkg/cfg/ilm.go
Normal file
72
pkg/cfg/ilm.go
Normal file
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
Copyright © 2026 Thomas von Dein
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package cfg
|
||||
|
||||
type Ilm struct {
|
||||
Description string
|
||||
|
||||
HotMinAge string
|
||||
HotRolloverMaxAge string
|
||||
HotRolloverMaxPrimaryShardSize int64
|
||||
HotRolloverMaxDocs int64
|
||||
HotReadonly bool
|
||||
|
||||
WarmMinAge string
|
||||
WarmForceMerge int
|
||||
WarmShrinkShards int
|
||||
WarmPriority int
|
||||
|
||||
ColdMinAge string
|
||||
ColdSearchableSnapshotRepo string
|
||||
ColdForceMerge int
|
||||
ColdPriority int
|
||||
|
||||
FrozenMinAge string
|
||||
|
||||
DeleteMinAge string
|
||||
DeleteSearchableSnapshots bool
|
||||
}
|
||||
|
||||
func (cfg *Ilm) HaveHot() bool {
|
||||
return cfg.HotMinAge != "" ||
|
||||
cfg.HotRolloverMaxAge != "" ||
|
||||
cfg.HotRolloverMaxDocs > 0 ||
|
||||
cfg.HotRolloverMaxPrimaryShardSize > 0 ||
|
||||
cfg.HotReadonly
|
||||
}
|
||||
|
||||
func (cfg *Ilm) HaveWarm() bool {
|
||||
return cfg.WarmMinAge != "" ||
|
||||
cfg.WarmForceMerge > 0 ||
|
||||
cfg.WarmShrinkShards > 0 ||
|
||||
cfg.WarmPriority > 0
|
||||
}
|
||||
|
||||
func (cfg *Ilm) HaveCold() bool {
|
||||
return cfg.ColdMinAge != "" ||
|
||||
cfg.ColdSearchableSnapshotRepo != "" ||
|
||||
cfg.ColdForceMerge > 0 ||
|
||||
cfg.ColdPriority > 0
|
||||
}
|
||||
|
||||
func (cfg *Ilm) HaveFrozen() bool {
|
||||
return cfg.FrozenMinAge != ""
|
||||
}
|
||||
|
||||
func (cfg *Ilm) HaveDelete() bool {
|
||||
return cfg.DeleteSearchableSnapshots || cfg.DeleteMinAge != ""
|
||||
}
|
||||
Reference in New Issue
Block a user