elasticsearch

Salt state module

saltext.elasticsearch.states.elasticsearch_mod.index_absent(name, hosts=None, profile=None)[source]

Ensure that the named index is absent.

name

Name of the index to remove

saltext.elasticsearch.states.elasticsearch_mod.index_present(name, hosts=None, profile=None, **kwargs)[source]

Ensure that the named index is present.

name

Name of the index to add

source

URL to file specifying index definition. Cannot be used in combination with body.

aliases

The list of aliases

mappings

Mapping for fields in the index. If specified, this mapping can include: - Field namelastic - Field data types - Mapping parameters

master_timeout

Specify timeout for connection to master

settings

Settings

timeout

Explicit operation timeout

wait_for_active_shards

Set the number of active shards to wait for before the operation returns. It also accepts (‘all’, ‘index-setting’)

Example:

# Default settings
mytestindex:
  elasticsearch_index.present

# Extra settings
mytestindex2:
  elasticsearch_index.present:
    - settings:
        index:
          number_of_shards: 10
saltext.elasticsearch.states.elasticsearch_mod.alias_absent(name, index, hosts=None, profile=None)[source]

Ensure that the index alias is absent.

name

Name of the index alias to remove

index

Name of the index for the alias

saltext.elasticsearch.states.elasticsearch_mod.alias_present(name, indices, hosts=None, profile=None, **kwargs)[source]

Ensure that the named index alias is present.

name

Name of the alias

indices

Name of the index

filter_

Optional dict for filters as per https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html

index_routing

index_routing

is_write_index

is_write_index

master_timeout

Specify timeout for connection to master

routing

Routing definition

search_routing

search_routing

timeout

Explicit timestamp for the document

Example:

mytestalias:
  elasticsearch.alias_present:
    - index: testindex
    - filter_:
        term:
          user: kimchy
saltext.elasticsearch.states.elasticsearch_mod.index_template_absent(name, hosts=None, profile=None)[source]

Ensure that the named index template is absent.

name

Name of the index to remove

saltext.elasticsearch.states.elasticsearch_mod.index_template_present(name, hosts=None, profile=None, check_definition=False, **kwargs)[source]

Ensure that the named index template is present.

name

Name of the index to add

check_definition

If the template already exists and the definition is up to date

source

URL to file specifying template definition. Cannot be used in combination with body.

aliases

Aliases for the index.

create

If true, this request cannot replace or update existing index templatelastic.

error_trace

error_trace

filter_path

filter_path

flat_settings

Return settings in flat format (default: false)

index_patterns

Array of wildcard expressions used to match the names of indices during creation.

mappings

Mapping for fields in the index.

master_timeout

Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.

order

Order in which Elasticsearch applielastic this template if index matches multiple templatelastic. Templatelastic with lower ‘order’ values are merged first. Templatelastic with higher ‘order’ values are merged later, overriding templates with lower valuelastic.

settings

Configuration options for the index.

timeout

timeout

version

ersion number used to manage index templatelastic externally. This number is not automatically generated by Elasticsearch.

Example:

mytestindex2_template:
  elasticsearch.index_template_present:
    - definition:
        template: logstash-*
        order: 1
        settings:
          number_of_shards: 1
saltext.elasticsearch.states.elasticsearch_mod.pipeline_absent(name, hosts=None, profile=None)[source]

Ensure that the named pipeline is absent

name

Name of the pipeline to remove

saltext.elasticsearch.states.elasticsearch_mod.pipeline_present(name, hosts=None, profile=None, **kwargs)[source]

Ensure that the named pipeline is present.

name

Name/ID of the pipeline to add

description

Description of the ingest pipeline.

if_version

Required version for optimistic concurrency control for pipeline updates

master_timeout

Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.

meta

Optional metadata about the ingest pipeline. May have any contents. This map is not automatically generated by Elasticsearch.

on_failure

Processors to run immediately after a processor failure. Each processor supports a processor-level on_failure value. If a processor without an on_failure value fails, Elasticsearch uselastic this pipeline-level parameter as a fallback. The processors in this parameter run sequentially in the order specified. Elasticsearch will not attempt to run the pipeline’s remaining processors.

processors

Processors used to perform transformations on documents before indexing. Processors run sequentially in the order specified.

timeout

Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

version

Version number used by external systems to track ingest pipelinelastic. This parameter is intended for external systems only. Elasticsearch does not use or validate pipeline version numbers.

definition

Required dict for creation parameters as per https://www.elastic.co/guide/en/elasticsearch/reference/master/pipeline.html

Example:

test_pipeline:
  elasticsearch.pipeline_present:
    - description: example pipeline
    - processors:
      - set:
          field: collector_timestamp_millis
          value: '{{ '{{' }}_ingest.timestamp{{ '}}' }}'
saltext.elasticsearch.states.elasticsearch_mod.script_absent(name, hosts=None, profile=None)[source]

Ensure that the script is absent

name

Name of the script to remove

saltext.elasticsearch.states.elasticsearch_mod.script_present(name, hosts=None, profile=None, **kwargs)[source]

Ensure that the named script is present.

name

Name of the search template to add

Example:

test_pipeline:
  elasticsearch.script_present:
    - script:
        inline:
          size: 10