Defaults¶
Filter Elements¶
Filter element schema definitions
All member functions return a voluptuous.schema_builder.Schema
object
-
curator.defaults.filter_elements.
aliases
(**kwargs)¶ Returns: {Required('aliases'): Any(list, *string_types)}
-
curator.defaults.filter_elements.
allocation_type
(**kwargs)¶ Returns: {Optional('allocation_type', default='require'): All(Any(*string_types), Any('require', 'include', 'exclude'))}
-
curator.defaults.filter_elements.
count
(**kwargs)¶ This setting is only used with the count filtertype and is required
Returns: {Required('count'): All(Coerce(int), Range(min=1))}
-
curator.defaults.filter_elements.
date_from
(**kwargs)¶ This setting is only used with the period filtertype.
Returns: {Optional('date_from'): Any(*string_types)}
-
curator.defaults.filter_elements.
date_from_format
(**kwargs)¶ This setting is only used with the period filtertype.
Returns: {Optional('date_from_format'): Any(*string_types)}
-
curator.defaults.filter_elements.
date_to
(**kwargs)¶ This setting is only used with the period filtertype.
Returns: {Optional('date_to'): Any(*string_types)}
-
curator.defaults.filter_elements.
date_to_format
(**kwargs)¶ This setting is only used with the period filtertype.
Returns: {Optional('date_to_format'): Any(*string_types)}
-
curator.defaults.filter_elements.
direction
(**kwargs)¶ This setting is only used with the
age
filtertype.Returns: {Required('direction'): Any('older', 'younger')}
-
curator.defaults.filter_elements.
disk_space
(**kwargs)¶ This setting is only used with the
space
filtertype and is requiredReturns: {Required('disk_space'): Any(Coerce(float))}
-
curator.defaults.filter_elements.
epoch
(**kwargs)¶ This setting is only used with the
age
filtertype.Returns: {Optional('epoch', default=None): Any(Coerce(int), None)}
-
curator.defaults.filter_elements.
exclude
(**kwargs)¶ This setting is available in all filter types. The default
val
isTrue
ifexclude
inkwargs
, otherwiseFalse
Returns: {Optional('exclude', default=val): Any(bool, All(Any(*string_types), Boolean()))}
-
curator.defaults.filter_elements.
field
(**kwargs)¶ This setting is only used with the
age
filtertype.Returns: {Required('field'): Any(*string_types)}
ifkwargs['required']
isTrue
otherwise{Optional('field'): Any(*string_types)}
-
curator.defaults.filter_elements.
intersect
(**kwargs)¶ This setting is only used with the period filtertype when using field_stats, i.e. indices only.
Returns: {Optional('intersect', default=False): Any(bool, All(Any(*string_types), Boolean()))}
-
curator.defaults.filter_elements.
key
(**kwargs)¶ This setting is only used with the allocated filtertype.
Returns: {Required('key'): Any(*string_types)}
-
curator.defaults.filter_elements.
kind
(**kwargs)¶ This setting is only used with the pattern filtertype and is required
Returns: {Required('kind'): Any('prefix', 'suffix', 'timestring', 'regex')}
-
curator.defaults.filter_elements.
max_num_segments
(**kwargs)¶ Returns: {Required('max_num_segments'): All(Coerce(int), Range(min=1))}
-
curator.defaults.filter_elements.
number_of_shards
(**kwargs)¶ Returns: {Required('number_of_shards'): All(Coerce(int), Range(min=1))}
-
curator.defaults.filter_elements.
pattern
(**kwargs)¶ Returns: {Optional('pattern'): Any(*string_types)}
-
curator.defaults.filter_elements.
period_type
(**kwargs)¶ This setting is only used with the period filtertype.
Returns: {Optional('period_type', default='relative'): Any('relative', 'absolute')}
-
curator.defaults.filter_elements.
range_from
(**kwargs)¶ Returns: {Optional('range_from'): Coerce(int)}
-
curator.defaults.filter_elements.
range_to
(**kwargs)¶ Returns: {Optional('range_to'): Coerce(int)}
-
curator.defaults.filter_elements.
reverse
(**kwargs)¶ Only used with
space
filtertype. Should be ignored if`use_age`
is TrueReturns: {Optional('reverse', default=True): Any(bool, All(Any(*string_types), Boolean()))}
-
curator.defaults.filter_elements.
shard_filter_behavior
(**kwargs)¶ This setting is only used with the shards filtertype and defaults to ‘greater_than’.
Returns: {Optional('shard_filter_behavior', default='greater_than'): Any('greater_than', 'less_than', 'greater_than_or_equal', 'less_than_or_equal', 'equal')}
-
curator.defaults.filter_elements.
size_behavior
(**kwargs)¶ This setting is only used with the size filtertype and defaults to ‘primary’.
Returns: {Optional('size_behavior', default='primary'): Any('primary', 'total')}
-
curator.defaults.filter_elements.
size_threshold
(**kwargs)¶ This setting is only used with the size filtertype and is required
Returns: {Required('size_threshold'): Any(Coerce(float))}
-
curator.defaults.filter_elements.
source
(**kwargs)¶ This setting is only used with the
age
filtertype, or with thespace
filtertype whenuse_age
is set to True.Variables: valuelist – If kwargs['action']
is incurator.defaults.settings.snapshot_actions()
, then it isAny('name', 'creation_date')
, otherwiseAny('name', 'creation_date', 'field_stats')
Returns: {Required('source'): valuelist}
ifkwargs['required']
, else{Optional('source'): valuelist}
-
curator.defaults.filter_elements.
state
(**kwargs)¶ This setting is only used with the state filtertype.
Returns: {Optional('state', default='SUCCESS'): Any('SUCCESS', 'PARTIAL', 'FAILED', 'IN_PROGRESS')}
-
curator.defaults.filter_elements.
stats_result
(**kwargs)¶ This setting is only used with the
age
filtertype.Returns: {Optional('stats_result', default='min_value'): Any('min_value', 'max_value')}
-
curator.defaults.filter_elements.
threshold_behavior
(**kwargs)¶ This setting is only used with the space and size filtertype and defaults to ‘greater_than’.
Returns: {Optional('threshold_behavior', default='greater_than'): Any('greater_than', 'less_than')}
-
curator.defaults.filter_elements.
timestring
(**kwargs)¶ This setting is only used with the
age
filtertype, or with thespace
filtertype ifuse_age
is set toTrue
.Returns: {Required('timestring'): Any(*string_types)}
ifkwargs['required']
else{Optional('timestring', default=None): Any(None, *string_types)}
-
curator.defaults.filter_elements.
unit
(**kwargs)¶ This setting is only used with the
age
filtertype, or with thespace
filtertype ifuse_age
is set toTrue
.Returns: {Required('unit'): Any('seconds', 'minutes', 'hours', 'days', 'weeks', 'months', 'years')}
-
curator.defaults.filter_elements.
unit_count
(**kwargs)¶ This setting is only used with the
age
filtertype, or with thespace
filtertype ifuse_age
is set toTrue
.Returns: {Required('unit_count'): Coerce(int)}
-
curator.defaults.filter_elements.
unit_count_pattern
(**kwargs)¶ This setting is used with the
age
filtertype to define whether theunit_count
value is taken from the configuration or read from the index name via a regular expressionReturns: {Optional('unit_count_pattern'): Any(*string_types)}
-
curator.defaults.filter_elements.
use_age
(**kwargs)¶ Use of this setting requires the additional setting,
source
.Returns: {Optional('use_age', default=False): Any(bool, All(Any(*string_types), Boolean()))}
-
curator.defaults.filter_elements.
value
(**kwargs)¶ This setting is only used with the
pattern
filtertype and is a required setting. There is a separate value option associated with theAllocation
action, and theallocated
filtertype.Returns: {Required('value'): Any(*string_types)}
-
curator.defaults.filter_elements.
week_starts_on
(**kwargs)¶ Returns: {Optional('week_starts_on', default='sunday'): Any('Sunday', 'sunday', 'SUNDAY', 'Monday', 'monday', 'MONDAY', None)}
Filter Types¶
Filtertype schema definitions
-
curator.defaults.filtertypes.
age
(action, config)¶ Returns: Filter elements acceptable for IndexList
filter_by_age()
orSnapshotList
filter_by_age()
-
curator.defaults.filtertypes.
alias
(action, config)¶ Returns: Filter elements acceptable for filter_by_alias()
-
curator.defaults.filtertypes.
allocated
(action, config)¶ Returns: Filter elements acceptable for filter_allocated()
-
curator.defaults.filtertypes.
closed
(action, config)¶ Returns: Filter elements acceptable for filter_closed()
-
curator.defaults.filtertypes.
count
(action, config)¶ Returns: Filter elements acceptable for IndexList
filter_by_count()
orSnapshotList
filter_by_count()
-
curator.defaults.filtertypes.
empty
(action, config)¶ Returns: Filter elements acceptable for filter_empty()
-
curator.defaults.filtertypes.
forcemerged
(action, config)¶ Returns: Filter elements acceptable for filter_forceMerged()
-
curator.defaults.filtertypes.
ilm
(action, config)¶ Returns: Filter elements acceptable for filter_ilm()
-
curator.defaults.filtertypes.
kibana
(action, config)¶ Returns: Filter elements acceptable for filter_kibana()
-
curator.defaults.filtertypes.
none
(action, config)¶ Returns: Filter elements acceptable for IndexList
filter_none()
orSnapshotList
filter_none()
-
curator.defaults.filtertypes.
opened
(action, config)¶ Returns: Filter elements acceptable for filter_opened()
-
curator.defaults.filtertypes.
pattern
(action, config)¶ Returns: Filter elements acceptable for IndexList
filter_by_regex()
orSnapshotList
filter_by_regex()
-
curator.defaults.filtertypes.
period
(action, config)¶ Returns: Filter elements acceptable for IndexList
filter_period()
orSnapshotList
filter_period()
-
curator.defaults.filtertypes.
shards
(action, config)¶ Returns: Filter elements acceptable for filter_by_shards()
-
curator.defaults.filtertypes.
size
(action, config)¶ Returns: Filter elements acceptable for filter_by_size()
-
curator.defaults.filtertypes.
space
(action, config)¶ Returns: Filter elements acceptable for filter_by_space()
-
curator.defaults.filtertypes.
state
(action, config)¶ Returns: Filter elements acceptable for filter_by_state()
Logging Defaults¶
Define valid schemas for client configuration validation
Option Defaults¶
Action Option Schema definitions
-
curator.defaults.option_defaults.
allocation_type
()¶ Returns: {Optional('allocation_type', default='require'): All(Any(*string_types), Any('require', 'include', 'exclude'))}
-
curator.defaults.option_defaults.
allow_ilm_indices
()¶ Returns: {Optional('allow_ilm_indices', default=False): Any(bool, All(Any(*string_types), Boolean()))}
-
curator.defaults.option_defaults.
cluster_routing_setting
()¶ Returns: {Required('setting'): Any('enable')}
-
curator.defaults.option_defaults.
cluster_routing_value
()¶ Returns: {Required('value'): Any('all', 'primaries', 'none', 'new_primaries', 'replicas')}
-
curator.defaults.option_defaults.
conditions
()¶ Returns: {Optional('conditions'): {Optional('max_age'): Any(*string_types), Optional('max_docs'): Coerce(int), Optional('max_size'): Any(*string_types)}}
-
curator.defaults.option_defaults.
continue_if_exception
()¶ Returns: {Optional('continue_if_exception', default=False): Any(bool, All(Any(*string_types), Boolean()))}
-
curator.defaults.option_defaults.
copy_aliases
()¶ Returns: {Optional('copy_aliases', default=False): Any(bool, All(Any(*string_types), Boolean()))}
-
curator.defaults.option_defaults.
count
()¶ Returns: {Required('count'): All(Coerce(int), Range(min=0, max=10))}
-
curator.defaults.option_defaults.
delay
()¶ Returns: {Optional('delay', default=0): All(Coerce(float), Range(min=0.0, max=3600.0))}
-
curator.defaults.option_defaults.
delete_after
()¶ Returns: {Optional('delete_after', default=True): Any(bool, All(Any(*string_types), Boolean()))}
-
curator.defaults.option_defaults.
delete_aliases
()¶ Returns: {Optional('delete_aliases', default=False): Any(bool, All(Any(*string_types), Boolean()))}
-
curator.defaults.option_defaults.
disable_action
()¶ Returns: {Optional('disable_action', default=False): Any(bool, All(Any(*string_types), Boolean()))}
-
curator.defaults.option_defaults.
extra_settings
()¶ Returns: {Optional('extra_settings', default={}): dict}
-
curator.defaults.option_defaults.
ignore_empty_list
()¶ Returns: {Optional('ignore_empty_list', default=False): Any(bool, All(Any(*string_types), Boolean()))}
-
curator.defaults.option_defaults.
ignore_existing
()¶ Returns: {Optional('ignore_existing', default=False): Any(bool, All(Any(*string_types), Boolean()))}
Returns: {Optional('ignore_unavailable', default=False): Any(bool, All(Any(*string_types), Boolean()))}
-
curator.defaults.option_defaults.
include_aliases
()¶ Returns: {Optional('include_aliases', default=False): Any(bool, All(Any(*string_types), Boolean()))}
-
curator.defaults.option_defaults.
include_global_state
(action)¶ Returns: {Optional('include_global_state', default=default): Any(bool, All(Any(*string_types), Boolean()))}
-
curator.defaults.option_defaults.
index_settings
()¶ Returns: {Required('index_settings'): {'index': dict}}
-
curator.defaults.option_defaults.
indices
()¶ Returns: {Optional('indices', default=None): Any(None, list)}
-
curator.defaults.option_defaults.
key
()¶ Returns: {Required('key'): Any(*string_types)}
-
curator.defaults.option_defaults.
max_num_segments
()¶ Returns: {Required('max_num_segments'): All(Coerce(int), Range(min=1, max=32768))}
-
curator.defaults.option_defaults.
max_wait
(action)¶ Returns: {Optional('max_wait', default=defval): Any(-1, Coerce(int), None)}
-
curator.defaults.option_defaults.
migration_prefix
()¶ Returns: {Optional('migration_prefix', default=''): Any(None, *string_types)}
-
curator.defaults.option_defaults.
migration_suffix
()¶ Returns: {Optional('migration_suffix', default=''): Any(None, *string_types)}
-
curator.defaults.option_defaults.
name
(action)¶ Returns: The proper name based on what action it is: alias
,create_index
,rollover
:{Required('name'): Any(*string_types)}
snapshot
:{Optional('name', default='curator-%Y%m%d%H%M%S'): Any(*string_types)}
restore
:{Optional('name'): Any(*string_types)}
-
curator.defaults.option_defaults.
node_filters
()¶ Returns: A voluptuous.schema_builder.Schema
object. See code for more details.
-
curator.defaults.option_defaults.
number_of_replicas
()¶ Returns: {Optional('number_of_replicas', default=1): All(Coerce(int), Range(min=0, max=10))}
-
curator.defaults.option_defaults.
number_of_shards
()¶ Returns: {Optional('number_of_shards', default=1): All(Coerce(int), Range(min=1, max=99))}
-
curator.defaults.option_defaults.
partial
()¶ Returns: {Optional('partial', default=False): Any(bool, All(Any(*string_types), Boolean()))}
-
curator.defaults.option_defaults.
post_allocation
()¶ Returns: A voluptuous.schema_builder.Schema
object. See code for more details.
-
curator.defaults.option_defaults.
preserve_existing
()¶ Returns: {Optional('preserve_existing', default=False): Any(bool, All(Any(*string_types), Boolean()))}
-
curator.defaults.option_defaults.
refresh
()¶ Returns: {Optional('refresh', default=True): Any(bool, All(Any(*string_types), Boolean()))}
-
curator.defaults.option_defaults.
remote_certificate
()¶ Returns: {Optional('remote_certificate', default=None): Any(None, *string_types)}
-
curator.defaults.option_defaults.
remote_client_cert
()¶ Returns: {Optional('remote_client_cert', default=None): Any(None, *string_types)}
-
curator.defaults.option_defaults.
remote_client_key
()¶ Returns: {Optional('remote_client_key', default=None): Any(None, *string_types)}
-
curator.defaults.option_defaults.
remote_filters
()¶ Returns: A voluptuous.schema_builder.Schema
object. See code for more details.
-
curator.defaults.option_defaults.
rename_pattern
()¶ Returns: {Optional('rename_pattern'): Any(*string_types)}
-
curator.defaults.option_defaults.
rename_replacement
()¶ Returns: {Optional('rename_replacement'): Any(*string_types)}
-
curator.defaults.option_defaults.
repository
()¶ Returns: {Required('repository'): Any(*string_types)}
-
curator.defaults.option_defaults.
request_body
()¶ Returns: A voluptuous.schema_builder.Schema
object. See code for more details.
-
curator.defaults.option_defaults.
requests_per_second
()¶ Returns: {Optional('requests_per_second', default=-1): Any(-1, Coerce(int), None)}
-
curator.defaults.option_defaults.
retry_count
()¶ Returns: {Optional('retry_count', default=3): All(Coerce(int), Range(min=0, max=100))}
-
curator.defaults.option_defaults.
retry_interval
()¶ Returns: {Optional('retry_interval', default=120): All(Coerce(int), Range(min=1, max=600))}
-
curator.defaults.option_defaults.
routing_type
()¶ Returns: {Required('routing_type'): Any('allocation', 'rebalance')}
-
curator.defaults.option_defaults.
shrink_node
()¶ Returns: {Required('shrink_node'): Any(*string_types)}
-
curator.defaults.option_defaults.
shrink_prefix
()¶ Returns: {Optional('shrink_prefix', default=''): Any(None, *string_types)}
-
curator.defaults.option_defaults.
shrink_suffix
()¶ Returns: {Optional('shrink_suffix', default='-shrink'): Any(None, *string_types)}
-
curator.defaults.option_defaults.
skip_flush
()¶ Returns: {Optional('skip_flush', default=False): Any(bool, All(Any(*string_types), Boolean()))}
-
curator.defaults.option_defaults.
skip_repo_fs_check
()¶ Returns: {Optional('skip_repo_fs_check', default=True): Any(bool, All(Any(*string_types), Boolean()))}
-
curator.defaults.option_defaults.
slices
()¶ Returns: {Optional('slices', default=1): Any(All(Coerce(int), Range(min=1, max=500)), None)}
-
curator.defaults.option_defaults.
timeout
(action)¶ Returns: {Optional('timeout', default=defval): Any(Coerce(int), None)}
-
curator.defaults.option_defaults.
timeout_override
(action)¶ Returns: {Optional('timeout_override', default=defval): Any(Coerce(int), None)}
wheredefval
is determined by the action.['forcemerge', 'restore', 'snapshot']
=21600
close
=180
delete_snapshots
=300
-
curator.defaults.option_defaults.
value
()¶ Returns: {Required('value', default=None): Any(None, *string_types)}
-
curator.defaults.option_defaults.
wait_for_active_shards
(action)¶ Returns: {Optional('wait_for_active_shards', default=defval): Any(Coerce(int), 'all', None)}
wheredefval
defaults to 0, but changes to 1 for thereindex
andshrink
actions.
-
curator.defaults.option_defaults.
wait_for_completion
(action)¶ Returns: {Optional('wait_for_completion', default=defval): Any(bool, All(Any(*string_types), Boolean()))}
wheredefval
defaults to True, but changes to False if action isallocation
,cluster_routing
, orreplicas
.
-
curator.defaults.option_defaults.
wait_for_rebalance
()¶ Returns: {Optional('wait_for_rebalance', default=True): Any(bool, All(Any(*string_types), Boolean()))}
-
curator.defaults.option_defaults.
wait_interval
(action)¶ Returns: {Optional('wait_interval', default=defval): Any(All(Coerce(int), Range(min=minval, max=maxval)), None)}
whereminval
=1
,maxval
=30
, anddefval
is3
, unless the action is one of['restore', 'snapshot', 'reindex', 'shrink']
, and thendefval
is9
.
-
curator.defaults.option_defaults.
warn_if_no_indices
()¶ Returns: {Optional('warn_if_no_indices', default=False): Any(bool, All(Any(*string_types), Boolean()))}
Settings¶
Utilities/Helpers for defaults and schemas
-
curator.defaults.settings.
all_actions
()¶ Returns: A sorted list of all supported actions: cluster, index, and snapshot
-
curator.defaults.settings.
all_filtertypes
()¶ Returns: A sorted list of all supported filter types (both snapshot and index)
-
curator.defaults.settings.
cluster_actions
()¶ Returns: A list of supported cluster actions (right now, that’s only ['cluster_routing']
)
-
curator.defaults.settings.
config_file
()¶ Returns: The default configuration file location: path.join(path.expanduser('~'), '.curator', 'curator.yml')
-
curator.defaults.settings.
date_regex
()¶ Returns: A dictionary/map of the strftime string characters and their string lengths: {'Y':'4', 'G':'4', 'y':'2', 'm':'2', 'W':'2', 'V':'2', 'U':'2', 'd':'2', 'H':'2', 'M':'2', 'S':'2', 'j':'3'}
-
curator.defaults.settings.
default_filters
()¶ If no filters are set, add a ‘none’ filter
Returns: {‘filters’: [{‘filtertype’: ‘none’}]}
-
curator.defaults.settings.
default_options
()¶ Returns: The default values for these options: {'allow_ilm_indices': False, 'continue_if_exception': False, 'disable_action': False, 'ignore_empty_list': False, 'timeout_override': None}
-
curator.defaults.settings.
index_actions
()¶ Returns: The list of supported index actions: [ 'alias', 'allocation', 'close', 'create_index', 'delete_indices', 'forcemerge', 'index_settings', 'open', 'reindex', 'replicas', 'rollover', 'shrink', 'snapshot']
-
curator.defaults.settings.
index_filtertypes
()¶ Returns: The list of supported index filter types: ['alias', 'allocated', 'age', 'closed', 'count', 'empty', 'forcemerged', 'ilm', 'kibana', 'none', 'opened', 'pattern', 'period', 'space', 'shards', 'size']
-
curator.defaults.settings.
regex_map
()¶ Returns: A dictionary of pattern filter ‘kind’s with their associated regular expression: {'timestring': r'^.*{0}.*$', 'regex': r'{0}', 'prefix': r'^{0}.*$', 'suffix': r'^.*{0}$'}
-
curator.defaults.settings.
snapshot_actions
()¶ Returns: The list of supported snapshot actions: ['delete_snapshots', 'restore']
-
curator.defaults.settings.
snapshot_filtertypes
()¶ Returns: The list of supported snapshot filter types: ['age', 'count', 'none', 'pattern', 'period', 'state']
-
curator.defaults.settings.
structural_filter_elements
()¶ Returns: Barebones schemas for initial validation of filters
-
curator.defaults.settings.
version_max
()¶ Returns: The maximum Elasticsearch version Curator supports: (8, 99, 99)
-
curator.defaults.settings.
version_min
()¶ Returns: The minimum Elasticsearch version Curator supports: (8, 99, 99)