Skip to content

Commit f247fc3

Browse files
committed
Merge branch '8.x' into 8.0
2 parents e819ecc + 942eb54 commit f247fc3

28 files changed

+1407
-953
lines changed

README.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ released, Curator 8.x will work with Elasticsearch 8.x.
1818

1919
Watch this space for updates when that is coming.
2020

21+
Additional support for Elasticsearch 7.14.0 - 7.17.x
22+
****************************************************
23+
24+
Starting with Curator 8.0.18, Curator 8 can execute against Elasticsearch versions
25+
7.14.0 - 7.17.x in addition to all versions of Elasticsearch 8.x.
26+
2127
New Client Configuration
2228
------------------------
2329

curator/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""Curator Version"""
22

3-
__version__ = '8.0.18'
3+
__version__ = '8.0.19'

curator/cli.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,18 +128,23 @@ def process_action(client, action_def, dry_run=False):
128128
mykwargs.update(prune_nones(action_def.options))
129129

130130
# Pop out the search_pattern option, if present.
131-
search_pattern = mykwargs.pop('search_pattern', '*')
131+
ptrn = mykwargs.pop('search_pattern', '*')
132+
hidn = mykwargs.pop('include_hidden', False)
132133

133134
logger.debug('Action kwargs: %s', mykwargs)
134-
logger.debug('Post search_pattern Action kwargs: %s', mykwargs)
135+
logger.debug('Post search_pattern & include_hidden Action kwargs: %s', mykwargs)
135136

136137
# Set up the action
137138
logger.debug('Running "%s"', action_def.action.upper())
138139
if action_def.action == 'alias':
139140
# Special behavior for this action, as it has 2 index lists
140141
action_def.instantiate('action_cls', **mykwargs)
141-
action_def.instantiate('alias_adds', client, search_pattern=search_pattern)
142-
action_def.instantiate('alias_removes', client, search_pattern=search_pattern)
142+
action_def.instantiate(
143+
'alias_adds', client, search_pattern=ptrn, include_hidden=hidn
144+
)
145+
action_def.instantiate(
146+
'alias_removes', client, search_pattern=ptrn, include_hidden=hidn
147+
)
143148
if 'remove' in action_def.action_dict:
144149
logger.debug('Removing indices from alias "%s"', action_def.options['name'])
145150
action_def.alias_removes.iterate_filters(action_def.action_dict['remove'])
@@ -163,7 +168,9 @@ def process_action(client, action_def, dry_run=False):
163168
'list_obj', client, repository=action_def.options['repository']
164169
)
165170
else:
166-
action_def.instantiate('list_obj', client, search_pattern=search_pattern)
171+
action_def.instantiate(
172+
'list_obj', client, search_pattern=ptrn, include_hidden=hidn
173+
)
167174
action_def.list_obj.iterate_filters({'filters': action_def.filters})
168175
logger.debug('Pre Instantiation Action kwargs: %s', mykwargs)
169176
action_def.instantiate('action_cls', action_def.list_obj, **mykwargs)

curator/cli_singletons/alias.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,22 @@
3636
default=False,
3737
show_default=True,
3838
)
39+
@click.option(
40+
'--include_hidden/--no-include_hidden',
41+
help='Allow Curator to operate on hidden indices (and data_streams).',
42+
default=False,
43+
show_default=True,
44+
)
3945
@click.pass_context
4046
def alias(
41-
ctx, name, add, remove, warn_if_no_indices, extra_settings, allow_ilm_indices
47+
ctx,
48+
name,
49+
add,
50+
remove,
51+
warn_if_no_indices,
52+
extra_settings,
53+
allow_ilm_indices,
54+
include_hidden,
4255
):
4356
"""
4457
Add/Remove Indices to/from Alias
@@ -48,6 +61,7 @@ def alias(
4861
'name': name,
4962
'extra_settings': extra_settings,
5063
'allow_ilm_indices': allow_ilm_indices,
64+
'include_hidden': include_hidden,
5165
}
5266
logger.debug('manual_options %s', manual_options)
5367
# ctx.info_name is the name of the function or name specified in

curator/cli_singletons/allocation.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@
4343
default=False,
4444
show_default=True,
4545
)
46+
@click.option(
47+
'--include_hidden/--no-include_hidden',
48+
help='Allow Curator to operate on hidden indices (and data_streams).',
49+
default=False,
50+
show_default=True,
51+
)
4652
@click.option(
4753
'--filter_list',
4854
callback=validate_filter_json,
@@ -61,6 +67,7 @@ def allocation(
6167
wait_interval,
6268
ignore_empty_list,
6369
allow_ilm_indices,
70+
include_hidden,
6471
filter_list,
6572
):
6673
"""
@@ -75,6 +82,7 @@ def allocation(
7582
'max_wait': max_wait,
7683
'wait_interval': wait_interval,
7784
'allow_ilm_indices': allow_ilm_indices,
85+
'include_hidden': include_hidden,
7886
}
7987
# ctx.info_name is the name of the function or name specified in
8088
# @click.command decorator

curator/cli_singletons/close.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@
2828
default=False,
2929
show_default=True,
3030
)
31+
@click.option(
32+
'--include_hidden/--no-include_hidden',
33+
help='Allow Curator to operate on hidden indices (and data_streams).',
34+
default=False,
35+
show_default=True,
36+
)
3137
@click.option(
3238
'--filter_list',
3339
callback=validate_filter_json,
@@ -42,6 +48,7 @@ def close(
4248
skip_flush,
4349
ignore_empty_list,
4450
allow_ilm_indices,
51+
include_hidden,
4552
filter_list,
4653
):
4754
"""
@@ -52,6 +59,7 @@ def close(
5259
'skip_flush': skip_flush,
5360
'delete_aliases': delete_aliases,
5461
'allow_ilm_indices': allow_ilm_indices,
62+
'include_hidden': include_hidden,
5563
}
5664
# ctx.info_name is the name of the function or name specified in
5765
# @click.command decorator

curator/cli_singletons/delete.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ def delete_indices(
6767
default=False,
6868
show_default=True,
6969
)
70+
@click.option(
71+
'--include_hidden/--no-include_hidden',
72+
help='Allow Curator to operate on hidden indices (and data_streams).',
73+
default=False,
74+
show_default=True,
75+
)
7076
@click.option(
7177
'--filter_list',
7278
callback=validate_filter_json,
@@ -81,6 +87,7 @@ def delete_snapshots(
8187
retry_interval,
8288
ignore_empty_list,
8389
allow_ilm_indices,
90+
include_hidden,
8491
filter_list,
8592
):
8693
"""
@@ -90,6 +97,7 @@ def delete_snapshots(
9097
'retry_count': retry_count,
9198
'retry_interval': retry_interval,
9299
'allow_ilm_indices': allow_ilm_indices,
100+
'include_hidden': include_hidden,
93101
}
94102
# ctx.info_name is the name of the function or name specified in @click.command
95103
# decorator

curator/cli_singletons/forcemerge.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@
3131
default=False,
3232
show_default=True,
3333
)
34+
@click.option(
35+
'--include_hidden/--no-include_hidden',
36+
help='Allow Curator to operate on hidden indices (and data_streams).',
37+
default=False,
38+
show_default=True,
39+
)
3440
@click.option(
3541
'--filter_list',
3642
callback=validate_filter_json,
@@ -45,6 +51,7 @@ def forcemerge(
4551
delay,
4652
ignore_empty_list,
4753
allow_ilm_indices,
54+
include_hidden,
4855
filter_list,
4956
):
5057
"""
@@ -55,6 +62,7 @@ def forcemerge(
5562
'max_num_segments': max_num_segments,
5663
'delay': delay,
5764
'allow_ilm_indices': allow_ilm_indices,
65+
'include_hidden': include_hidden,
5866
}
5967
# ctx.info_name is the name of the function or name specified in
6068
# @click.command decorator

curator/cli_singletons/object_class.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ def __init__(
100100
self.options = option_dict
101101

102102
self.search_pattern = self.options.pop('search_pattern', '*')
103+
self.include_hidden = self.options.pop('include_hidden', False)
103104

104105
# Extract allow_ilm_indices so it can be handled separately.
105106
if 'allow_ilm_indices' in self.options:
@@ -214,7 +215,9 @@ def get_list_object(self):
214215
self.list_object = SnapshotList(self.client, repository=self.repository)
215216
else:
216217
self.list_object = IndexList(
217-
self.client, search_pattern=self.search_pattern
218+
self.client,
219+
search_pattern=self.search_pattern,
220+
include_hidden=self.include_hidden,
218221
)
219222

220223
def get_alias_obj(self):
@@ -230,7 +233,9 @@ def get_alias_obj(self):
230233
)
231234
self.logger.debug(msg)
232235
self.alias[k]['ilo'] = IndexList(
233-
self.client, search_pattern=self.search_pattern
236+
self.client,
237+
search_pattern=self.search_pattern,
238+
include_hidden=self.include_hidden,
234239
)
235240
self.alias[k]['ilo'].iterate_filters(
236241
{'filters': self.alias[k]['filters']}

curator/cli_singletons/open_indices.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@
2020
default=False,
2121
show_default=True,
2222
)
23+
@click.option(
24+
'--include_hidden/--no-include_hidden',
25+
help='Allow Curator to operate on hidden indices (and data_streams).',
26+
default=False,
27+
show_default=True,
28+
)
2329
@click.option(
2430
'--filter_list',
2531
callback=validate_filter_json,
@@ -28,7 +34,12 @@
2834
)
2935
@click.pass_context
3036
def open_indices(
31-
ctx, search_pattern, ignore_empty_list, allow_ilm_indices, filter_list
37+
ctx,
38+
search_pattern,
39+
ignore_empty_list,
40+
allow_ilm_indices,
41+
include_hidden,
42+
filter_list,
3243
):
3344
"""
3445
Open Indices
@@ -38,7 +49,11 @@ def open_indices(
3849
action = CLIAction(
3950
ctx.info_name,
4051
ctx.obj['configdict'],
41-
{'search_pattern': search_pattern, 'allow_ilm_indices': allow_ilm_indices},
52+
{
53+
'search_pattern': search_pattern,
54+
'allow_ilm_indices': allow_ilm_indices,
55+
'include_hidden': include_hidden,
56+
},
4257
filter_list,
4358
ignore_empty_list,
4459
)

0 commit comments

Comments
 (0)