# 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, str)}

curator.defaults.filter_elements.allocation_type(**kwargs)
  Returns:

    {Optional(‘allocation_type’, default=’require’): All(Any(str), 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(str)}

curator.defaults.filter_elements.date_from_format(**kwargs)

  This setting is only used with the period filtertype.

  Returns:

    {Optional(‘date_from_format’): Any(str)}

curator.defaults.filter_elements.date_to(**kwargs)

  This setting is only used with the period filtertype.

  Returns:

    {Optional(‘date_to’): Any(str)}

curator.defaults.filter_elements.date_to_format(**kwargs)

  This setting is only used with the period filtertype.

  Returns:

    {Optional(‘date_to_format’): Any(str)}

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 required

  Returns:

    {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` is `True` if `exclude` in `kwargs`, otherwise `False`

  Returns:

    {Optional(‘exclude’, default=val): Any(bool, All(Any(str), Boolean()))}

curator.defaults.filter_elements.field(**kwargs)

  This setting is only used with the `age` filtertype.

  Returns:

    {Required(‘field’): Any(str)} if `kwargs['required']` is `True` otherwise {Optional(‘field’): Any(str)}

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(str), Boolean()))}

curator.defaults.filter_elements.key(**kwargs)

  This setting is only used with the allocated filtertype.

  Returns:

    {Required(‘key’): Any(str)}

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(str)}

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 True

  Returns:

    {Optional(‘reverse’, default=True): Any(bool, All(Any(str), 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 the `space` filtertype when `use_age` is set to True.

  Variables:

    valuelist – If `kwargs['action']` is in `curator.defaults.settings.snapshot_actions()`, then it is `Any('name', 'creation_date')`, otherwise `Any('name', 'creation_date', 'field_stats')`

  Returns:

    {Required(‘source’): valuelist} if `kwargs['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 the `space` filtertype if `use_age` is set to `True`.

  Returns:

    {Required(‘timestring’): Any(str)} if `kwargs['required']` else {Optional(‘timestring’, default=None): Any(None, str)}

curator.defaults.filter_elements.unit(**kwargs)

  This setting is only used with the `age` filtertype, or with the `space` filtertype if `use_age` is set to `True`.

  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 the `space` filtertype if `use_age` is set to `True`.

  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 the `unit_count` value is taken from the configuration or read from the index name via a regular expression

  Returns:

    {Optional(‘unit_count_pattern’): Any(str)}

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(str), 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 the `Allocation` action, and the `allocated` filtertype.

  Returns:

    {Required(‘value’): Any(str)}

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()` or `SnapshotList` `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()` or `SnapshotList` `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()` or `SnapshotList` `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()` or `SnapshotList` `filter_by_regex()`

curator.defaults.filtertypes.period(action, config)
  Returns:

    Filter elements acceptable for `IndexList` `filter_period()` or `SnapshotList` `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()`

## Option Defaults

Action Option Schema definitions

curator.defaults.option_defaults.allocation_type()
  Returns:

    {Optional(‘allocation_type’, default=’require’):

      All(Any(str), Any(‘require’, ‘include’, ‘exclude’))}

curator.defaults.option_defaults.allow_ilm_indices()
  Returns:

    {Optional(‘allow_ilm_indices’, default=False):

      Any(bool, All(Any(str), Boolean()))}

curator.defaults.option_defaults.c2f_ignore_index_settings()

  Only for the `Cold2Frozen` action

  Returns:

    {Optional(‘ignore_index_settings’): Any(None, list)}

curator.defaults.option_defaults.c2f_index_settings()

  Only for the `Cold2Frozen` action

  Returns:

    {Optional(‘index_settings’): Any(None, dict)}

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(str), Optional(‘max_docs’):

        Coerce(int), Optional(‘max_size’): Any(str)}}

curator.defaults.option_defaults.continue_if_exception()
  Returns:

    {Optional(‘continue_if_exception’, default=False):

      Any(bool, All(Any(str), Boolean()))}

curator.defaults.option_defaults.copy_aliases()
  Returns:

    {Optional(‘copy_aliases’, default=False):

      Any(bool, All(Any(str), 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(str), Boolean()))}

curator.defaults.option_defaults.delete_aliases()
  Returns:

    {Optional(‘delete_aliases’, default=False):

      Any(bool, All(Any(str), Boolean()))}

curator.defaults.option_defaults.disable_action()
  Returns:

    {Optional(‘disable_action’, default=False):

      Any(bool, All(Any(str), 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(str), Boolean()))}

curator.defaults.option_defaults.ignore_existing()
  Returns:

    {Optional(‘ignore_existing’, default=False):

      Any(bool, All(Any(str), Boolean()))}

curator.defaults.option_defaults.ignore_unavailable()
  Returns:

    {Optional(‘ignore_unavailable’, default=False):

      Any(bool, All(Any(str), Boolean()))}

curator.defaults.option_defaults.include_aliases()
  Returns:

    {Optional(‘include_aliases’, default=False):

      Any(bool, All(Any(str), Boolean()))}

curator.defaults.option_defaults.include_global_state(action)
  Returns:

    {Optional(‘include_global_state’, default=default):

      Any(bool, All(Any(str), Boolean()))}

curator.defaults.option_defaults.include_hidden()
  Returns:

    {Optional(‘include_hidden’, default=False):

      Any(bool, All(Any(str), 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(str)}

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, str)}

curator.defaults.option_defaults.migration_suffix()
  Returns:

    {Optional(‘migration_suffix’, default=’’): Any(None, str)}

curator.defaults.option_defaults.name(action)
  Returns:

    The proper name based on what action it is: `alias`, `create_index`, `rollover`: {Required(‘name’): Any(str)} `snapshot`: {Optional(‘name’, default=’curator-%Y%m%d%H%M%S’): Any(str)} `restore`: {Optional(‘name’): Any(str)}

curator.defaults.option_defaults.new_index()
  Returns:

    {Optional(‘new_index’, default=None): Any(None, str)}

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(str), 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(str), Boolean()))}

curator.defaults.option_defaults.refresh()
  Returns:

    {Optional(‘refresh’, default=True): Any(bool, All(Any(str), Boolean()))}

curator.defaults.option_defaults.remote_certificate()
  Returns:

    {Optional(‘remote_certificate’, default=None): Any(None, str)}

curator.defaults.option_defaults.remote_client_cert()
  Returns:

    {Optional(‘remote_client_cert’, default=None): Any(None, str)}

curator.defaults.option_defaults.remote_client_key()
  Returns:

    {Optional(‘remote_client_key’, default=None): Any(None, str)}

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(str)}

curator.defaults.option_defaults.rename_replacement()
  Returns:

    {Optional(‘rename_replacement’): Any(str)}

curator.defaults.option_defaults.repository()
  Returns:

    {Required(‘repository’): Any(str)}

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.search_pattern()
  Returns:

    {Optional(‘search_pattern’, default=’*’): Any(str)}

curator.defaults.option_defaults.shrink_node()
  Returns:

    {Required(‘shrink_node’): Any(str)}

curator.defaults.option_defaults.shrink_prefix()
  Returns:

    {Optional(‘shrink_prefix’, default=’’): Any(None, str)}

curator.defaults.option_defaults.shrink_suffix()
  Returns:

    {Optional(‘shrink_suffix’, default=’-shrink’): Any(None, str)}

curator.defaults.option_defaults.skip_flush()
  Returns:

    {Optional(‘skip_flush’, default=False):

      Any(bool, All(Any(str), Boolean()))}

curator.defaults.option_defaults.skip_repo_fs_check()
  Returns:

    {Optional(‘skip_repo_fs_check’, default=True):

      Any(bool, All(Any(str), 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)} where `defval` 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, str)}

curator.defaults.option_defaults.wait_for_active_shards(action)
  Returns:

    {Optional(‘wait_for_active_shards’, default=defval):

      Any(Coerce(int), ‘all’, None)} where `defval` defaults to 0, but changes to 1 for the `reindex` and `shrink` actions.

curator.defaults.option_defaults.wait_for_completion(action)
  Returns:

    {Optional(‘wait_for_completion’, default=defval):

      Any(bool, All(Any(str), Boolean()))} where `defval` defaults to True, but changes to False if action is `allocation`, `cluster_routing`, or `replicas`.

curator.defaults.option_defaults.wait_for_rebalance()
  Returns:

    {Optional(‘wait_for_rebalance’, default=True):

      Any(bool, All(Any(str), Boolean()))}

curator.defaults.option_defaults.wait_interval(action)
  Returns:

    {Optional(‘wait_interval’, default=defval):

      Any(All(Coerce(int), Range(min=minval, max=maxval)), None)} where `minval` = `1`, `maxval` = `30`, and `defval` is `3`, unless the action is one of `['restore', 'snapshot', 'reindex', 'shrink']`, and then `defval` is `9`.

curator.defaults.option_defaults.warn_if_no_indices()
  Returns:

    {Optional(‘warn_if_no_indices’, default=False):

      Any(bool, All(Any(str), 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.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_config_file()
  Returns:

    The default configuration file location: path.join(path.expanduser(‘~’), ‘.curator’, ‘curator.yml’)

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, ‘include_hidden’: False, ‘timeout_override’: None}

curator.defaults.settings.footer(version, tail='index.html')

  Generate a footer linking to Curator docs based on Curator version

  Parameters:

    version (str) – The Curator version

  Returns:

    An epilog/footer suitable for Click

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