elasticsearch
¶
Salt execution module
Elasticsearch - A distributed RESTful search and analytics server for Elasticsearch 8 Module to provide Elasticsearch compatibility to Salt (compatible with Elasticsearch version 8+). Copied from elasticsearch.py module and updated.
Added in version 3005.1.
- codeauthor:
Cesar Sanchez <cesan3@gmail.com>
- depends:
elasticsearch-py <https://elasticsearch-py.readthedocs.io/en/latest/>
- configuration:
This module accepts connection configuration details either as parameters or as configuration settings in /etc/salt/minion on the relevant minions:
elasticsearch:
host: '10.10.10.100:9200'
elasticsearch-cluster:
hosts:
- '10.10.10.100:9200'
- '10.10.10.101:9200'
- '10.10.10.102:9200'
elasticsearch-extra:
hosts:
- '10.10.10.100:9200'
use_ssl: True
verify_certs: True
ca_certs: /path/to/custom_ca_bundle.pem
number_of_shards: 1
number_of_replicas: 0
functions_blacklist:
- 'saltutil.find_job'
- 'pillar.items'
- 'grains.items'
proxies:
- http: http://proxy:3128
- https: http://proxy:1080
When specifying proxies the requests backend will be used and the ‘proxies’ data structure is passed as-is to that module.
This data can also be passed into pillar. Options passed into opts will overwrite options passed into pillar.
Some functionality might be limited by elasticsearch-py and Elasticsearch server versions.
- saltext.elasticsearch.modules.elasticsearch8_mod.__virtual__()[source]¶
Only load if elasticsearch librarielastic exist and ES version is 8+.
- saltext.elasticsearch.modules.elasticsearch8_mod.ping(hosts=None, profile=None, allow_failure=False)[source]¶
Added in version 3005.1.
Test connection to Elasticsearch instance. This method does not fail if not explicitly specified.
- allow_failure
Throw exception if ping fails
CLI Example:
salt myminion elasticsearch.ping allow_failure=True salt myminion elasticsearch.ping profile=elasticsearch-extra
- saltext.elasticsearch.modules.elasticsearch8_mod.info(hosts=None, profile=None, error_trace=None, filter_path=None, human=None, pretty=None)[source]¶
Added in version 2017.7.0.
Return Elasticsearch information.
CLI Example:
salt myminion elasticsearch.info salt myminion elasticsearch.info profile=elasticsearch-extra
- saltext.elasticsearch.modules.elasticsearch8_mod.node_info(hosts=None, profile=None, node_id=None, metric=None, error_trace=None, filter_path=None, flat_settings=False, human=None, master_timeout=None, pretty=None, timeout=None)[source]¶
Added in version 3005.1.
Return Elasticsearch node information.
- node_id
Comma-separated list of node IDs or namelastic used to limit returned information.
- metric
Limits the information returned to the specific metrics. Supports a comma-separated list, such as http,ingest.
- flat_settings
If true, returns settings in flat format.
- 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.
- timeout
Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.
CLI Example:
salt myminion elasticsearch.node_info flat_settings=True
- saltext.elasticsearch.modules.elasticsearch8_mod.cluster_health(index=None, level='cluster', local=False, hosts=None, profile=None, error_trace=None, expand_wildcards=None, filter_path=None, human=None, master_timeout=None, pretty=None, timeout=None, wait_for_active_shards=None, wait_for_events=None, wait_for_no_initializing_shards=None, wait_for_no_relocating_shards=None, wait_for_nodes=None, wait_for_status=None)[source]¶
# pylint: disable=line-too-long
Added in version 3005.1.
Return Elasticsearch cluster health.
- index
Comma-separated list of data streams, indices, and index aliases used to limit the request. Wildcard expressions (*) are supported. To target all data streams and indices in a cluster, omit this parameter or use _all or ‘*’.
- expand_wildcards
Whether to expand wildcard expression to concrete indices that are open, closed or both. Valuelastic can be ‘all’, ‘closed’, ‘hidden’, ‘none’, ‘open’
- level
Can be one of cluster, indices or shards. Controls the details level of the health information returned.
- local
If true, the request retrievelastic information from the local node only. Defaults to false, which means information is retrieved from the master node.
- 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.
- timeout
Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.
- wait_for_active_shards
A number controlling to how many active shards to wait for, all to wait for all shards in the cluster to be active, or 0 to not wait.
- wait_for_events
Can be one of immediate, urgent, high, normal, low, languid. Wait until all currently queued events with the given priority are processed.
- wait_for_no_initializing_shards
A boolean value which controls whether to wait (until the timeout provided) for the cluster to have no shard initializations. Defaults to false, which means it will not wait for initializing shards.
- wait_for_no_relocating_shards
A boolean value which controls whether to wait (until the timeout provided) for the cluster to have no shard relocations. Defaults to false, which means it will not wait for relocating shards.
- wait_for_nodes
The request waits until the specified number N of nodes is available. It also accepts >=N, <=N, >N and <N. Alternatively, it is possible to use ge(N), le(N), gt(N) and lt(N) notation.
- wait_for_status
One of green, yellow or red. Will wait (until the timeout provided) until the status of the cluster changelastic to the one provided or better, i.e. green > yellow > red. By default, will not wait for any status.
CLI Example:
salt myminion elasticsearch.cluster_health
- saltext.elasticsearch.modules.elasticsearch8_mod.cluster_allocation_explain(hosts=None, profile=None, current_node=None, error_trace=None, filter_path=None, human=None, include_disk_info=None, include_yes_decisions=None, index=None, pretty=None, primary=None, shard=None)[source]¶
Added in version 3005.1.
Return Elasticsearch cluster allocation explain
- current_node
Specifielastic the node ID or the name of the node to only explain a shard that is currently located on the specified node.
- include_disk_info
If true, returns information about disk usage and shard sizelastic.
- include_yes_decisions
If true, returns YES decisions in explanation.
- index
Specifielastic the name of the index that you would like an explanation for.
- primary
If true, returns explanation for the primary shard for the given shard ID.
- shard
Specifielastic the ID of the shard that you would like an explanation for.
CLI Example:
salt myminion elasticsearch.cluster_allocation_explain
- saltext.elasticsearch.modules.elasticsearch8_mod.cluster_pending_tasks(hosts=None, profile=None, error_trace=None, filter_path=None, human=None, local=None, master_timeout=None, pretty=None)[source]¶
Added in version 3005.1.
Returns a list of any cluster-level changelastic (e.g. create index, update mapping, allocate or fail shard) which have not yet been executed.
- local
Return local information, do not retrieve the state from master node (default: false)
- master_timeout
Specify timeout for connection to master
CLI Example:
salt myminion elasticsearch.cluster_pending_tasks
- saltext.elasticsearch.modules.elasticsearch8_mod.cluster_stats(node_id=None, hosts=None, profile=None, error_trace=None, filter_path=None, flat_settings=None, human=None, pretty=None, timeout=None)[source]¶
Added in version 3005.1.
Return Elasticsearch cluster stats.
- node_id
Comma-separated list of node filters used to limit returned information. Defaults to all nodes in the cluster.
- flat_settings
Return settings in flat format (default: false)
- timeout
Period to wait for each node to respond. If a node does not respond before its timeout expires, the response does not include its stats. However, timed out nodes are included in the response’s _nodes.failed property. Defaults to no timeout.
CLI Example:
salt myminion elasticsearch.cluster_stats
- saltext.elasticsearch.modules.elasticsearch8_mod.cluster_get_settings(hosts=None, profile=None, error_trace=None, filter_path=None, flat_settings=False, human=None, include_defaults=False, master_timeout=None, pretty=None, timeout=None)[source]¶
Added in version 3005.1.
Return Elasticsearch cluster settings.
- flat_settings
Return settings in flat format (default: false)
- include_defaults
Whether to return all default clusters setting.
- master_timeout
Explicit operation timeout for connection to master node
- timeout
Explicit operation timeout
CLI Example:
salt myminion elasticsearch.cluster_get_settings
- saltext.elasticsearch.modules.elasticsearch8_mod.cluster_put_settings(body=None, hosts=None, profile=None, error_trace=None, filter_path=None, flat_settings=False, human=None, master_timeout=None, persistent=None, pretty=None, timeout=None, transient=None)[source]¶
# pylint: disable=line-too-long .. versionadded:: 3000
Set Elasticsearch cluster settings.
- body
The settings to be updated. Can be either ‘transient’ or ‘persistent’ (survives cluster restart) https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-update-settings.html
- flat_settings
Return settings in flat format.
CLI Example:
salt myminion elasticsearch.cluster_put_settings '{"persistent": {"indices.recovery.max_bytes_per_sec": "50mb"}}' salt myminion elasticsearch.cluster_put_settings '{"transient": {"indices.recovery.max_bytes_per_sec": "50mb"}}'
- saltext.elasticsearch.modules.elasticsearch8_mod.alias_create(indices, alias, hosts=None, profile=None, error_trace=None, filter_=None, filter_path=None, human=None, index_routing=None, is_write_index=None, master_timeout=None, pretty=None, routing=None, search_routing=None, timeout=None)[source]¶
Create an alias for a specific index/indices
- indices
A comma-separated list of index namelastic the alias should point to (supports wildcards); use _all to perform the operation on all indices.
- alias
The name of the alias to be created or updated
- filter
Filter definittion
- 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
CLI Example:
salt myminion elasticsearch.alias_create testindex_v1 testindex
- saltext.elasticsearch.modules.elasticsearch8_mod.alias_delete(indices, aliases, hosts=None, profile=None, error_trace=None, filter_path=None, human=None, master_timeout=None, pretty=None, timeout=None)[source]¶
Delete an alias of an index
- indices
Single or multiple indices separated by comma, use _all to perform the operation on all indices.
- aliases
Alias namelastic separated by comma
CLI Example:
salt myminion elasticsearch.alias_delete testindex_v1 testindex
- saltext.elasticsearch.modules.elasticsearch8_mod.alias_exists(aliases, indices=None, hosts=None, profile=None, allow_no_indices=None, error_trace=None, expand_wildcards=None, filter_path=None, human=None, ignore_unavailable=None, local=None, pretty=None)[source]¶
Return a boolean indicating whether given alias exists
- indices
A comma-separated list of index namelastic to filter aliases
- aliases
A comma-separated list of alias namelastic to return
- allow_no_indices
Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includelastic _all string or when no indices have been specified)
- expand_wildcards
Whether to expand wildcard expression to concrete indices that are open, closed or both. Valid valuelastic are ‘all’, ‘closed’, ‘hidden’, ‘none’, ‘open’
- ignore_unavailable
Whether specified concrete indices should be ignored when unavailable (missing or closed)
- local
Return local information, do not retrieve the state from master node (default: false)
CLI Example:
salt myminion elasticsearch.alias_exists None testindex
- saltext.elasticsearch.modules.elasticsearch8_mod.alias_get(aliases, indices=None, hosts=None, profile=None, allow_no_indices=None, error_trace=None, expand_wildcards=None, filter_path=None, human=None, ignore_unavailable=None, local=None, pretty=None)[source]¶
Check for the existence of an alias and if it exists, return it
- indices
A comma-separated list of index namelastic to filter aliases
- aliases
A comma-separated list of alias namelastic to return
- allow_no_indices
Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includelastic _all string or when no indices have been specified)
- expand_wildcards
Whether to expand wildcard expression to concrete indices that are open, closed or both. Valid valuelastic are ‘all’, ‘closed’, ‘hidden’, ‘none’, ‘open’
- ignore_unavailable
Whether specified concrete indices should be ignored when unavailable (missing or closed)
- local
Return local information, do not retrieve the state from master node (default: false)
CLI Example:
salt myminion elasticsearch.alias_get testindex
- saltext.elasticsearch.modules.elasticsearch8_mod.document_create(index, body=None, hosts=None, profile=None, source=None, document=None, id_=None, error_trace=None, filter_path=None, human=None, if_primary_term=None, if_seq_no=None, op_type=None, pipeline=None, pretty=None, refresh=None, require_alias=None, routing=None, timeout=None, version=None, version_type=None, wait_for_active_shards=None)[source]¶
Create a document in a specified index
- index
Index name where the document should reside
- body
Document to store
- source
URL of file specifying document to store. Cannot be used in combination with body.
- document
Document to store. If body doesn’t exist, this is the dictionary with the document contents
- if_primary_term
only perform the index operation if the last operation that has changed the document has the specified primary term
- if_seq_no
only perform the index operation if the last operation that has changed the document has the specified sequence number
- op_type
Explicit operation type. Defaults to index for requests with an explicit document ID, and to createfor requests without an explicit document ID
- pipeline
The pipeline id to preprocess incoming documents with
- refresh
If true then refresh the affected shards to make this operation visible to search, if wait_for then wait for a refresh to make this operation visible to search, if false (the default) then do nothing with refreshelastic.
- require_alias
When true, requirelastic destination to be an alias. Default is false
- routing
Specific routing value
- timeout
Explicit operation timeout
- version
Explicit version number for concurrency control
- version_type
Specific version type
- wait_for_active_shards
Sets the number of shard copielastic that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to all for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copielastic for the shard (number of replicas + 1)
CLI Example:
salt myminion elasticsearch.document_create testindex doctype1 '{}'
- saltext.elasticsearch.modules.elasticsearch8_mod.document_delete(index, id_, hosts=None, profile=None, error_trace=None, filter_path=None, human=None, if_primary_term=None, if_seq_no=None, pretty=None, refresh=None, routing=None, timeout=None, version=None, version_type=None, wait_for_active_shards=None)[source]¶
Delete a document from an index
- index
The name of the index
- if_primary_term
only perform the delete operation if the last operation that has changed the document has the specified primary term
- if_seq_no
only perform the delete operation if the last operation that has changed the document has the specified sequence number
- refresh
If true then refresh the affected shards to make this operation visible to search, if wait_for then wait for a refresh to make this operation visible to search, if false (the default) then do nothing with refreshelastic.
- routing
Specific routing value
- timeout
Explicit operation timeout
- version
Explicit version number for concurrency control
- version_type
Specific version type
- wait_for_active_shards
Sets the number of shard copielastic that must be active before proceeding with the delete operation. Defaults to 1, meaning the primary shard only. Set to all for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copielastic for the shard (number of replicas + 1)
CLI Example:
salt myminion elasticsearch.document_delete testindex doctype1 AUx-384m0Bug_8U80wQZ
- saltext.elasticsearch.modules.elasticsearch8_mod.document_exists(index, id_, hosts=None, profile=None, error_trace=None, filter_path=None, human=None, preference=None, pretty=None, realtime=None, refresh=None, routing=None, source=None, source_excludes=None, source_includes=None, stored_fields=None, version=None, version_type=None)[source]¶
Return a boolean indicating whether given document exists
- index
The name of the index
- preference
Specify the node or shard the operation should be performed on (default: random)
- realtime
Specify whether to perform the operation in realtime or search mode
- refresh
Refresh the shard containing the document before performing the operation
- routing
Specific routing value
- source
True or false to return the _source field or not, or a list of fields to return
- source_excludes
A list of fields to exclude from the returned _source field
- source_includes
A list of fields to extract and return from the _source field
- stored_fields
A comma-separated list of stored fields to return in the response
- version
Explicit version number for concurrency control
- version_type
Specific version type. version_type must be one of (‘external’, ‘external_gte’, ‘force’, ‘internal’)
CLI Example:
salt myminion elasticsearch.document_exists testindex AUx-384m0Bug_8U80wQZ
- saltext.elasticsearch.modules.elasticsearch8_mod.document_get(index, id_, hosts=None, profile=None, error_trace=None, filter_path=None, human=None, preference=None, pretty=None, realtime=None, refresh=None, routing=None, source=None, source_excludes=None, source_includes=None, stored_fields=None, version=None, version_type=None)[source]¶
Check for the existence of a document and if it exists, return it
- index
Index name where the document resides
- doc_type
Type of the document, use _all to fetch the first document matching the ID across all types
CLI Example:
salt myminion elasticsearch.document_get testindex AUx-384m0Bug_8U80wQZ
- saltext.elasticsearch.modules.elasticsearch8_mod.index_create(index, hosts=None, profile=None, source=None, aliases=None, error_trace=None, filter_path=None, human=None, mappings=None, master_timeout=None, pretty=None, settings=None, timeout=None, wait_for_active_shards=None)[source]¶
# pylint: disable=line-too-long Create an index
- index
Index name
- source
URL to file specifying index definition. Cannot be used in combination with body.
- index
The name of the index
- 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’)
CLI Example:
salt myminion elasticsearch.index_create testindex salt myminion elasticsearch.index_create testindex2 '{"settings" : {"index" : {"number_of_shards" : 3, "number_of_replicas" : 2}}}'
- saltext.elasticsearch.modules.elasticsearch8_mod.index_delete(index, hosts=None, profile=None, allow_no_indices=None, error_trace=None, expand_wildcards=None, filter_path=None, human=None, ignore_unavailable=None, master_timeout=None, pretty=None, timeout=None)[source]¶
Delete an index
- index
A comma-separated list of indices to delete; use _all or * string to delete all indices
- allow_no_indices
Ignore if a wildcard expression resolvelastic to no concrete indices (default: false)
- expand_wildcards
Whether wildcard expressions should get expanded to open, closed, or hidden indices. Accetps: (‘all’, ‘closed’, ‘hidden’, ‘none’, ‘open’)
- ignore_unavailable
Ignore unavailable indexelastic (default: false)
- master_timeout
Specify timeout for connection to master
- timeout
Explicit operation timeout
CLI Example:
salt myminion elasticsearch.index_delete testindex
- saltext.elasticsearch.modules.elasticsearch8_mod.index_exists(index, hosts=None, profile=None, allow_no_indices=None, error_trace=None, expand_wildcards=None, filter_path=None, flat_settings=False, human=None, ignore_unavailable=False, include_defaults=False, local=False, pretty=None)[source]¶
Return a boolean indicating whether given index exists
- index
A comma-separated list of index names
- allow_no_indices
Ignore if a wildcard expression resolvelastic to no concrete indices (default: false)
- expand_wildcards
Whether wildcard expressions should get expanded to open or closed indices (default: open) Accepts values: (‘all’, ‘closed’, ‘hidden’, ‘none’, ‘open’)
- flat_settings
Return settings in flat format (default: false)
- ignore_unavailable
Ignore unavailable indexelastic (default: false)
- include_defaults
Whether to return all default setting for each of the indices.
- local
Return local information, do not retrieve the state from master node (default: false)
CLI Example:
salt myminion elasticsearch.index_exists testindex
- saltext.elasticsearch.modules.elasticsearch8_mod.index_get(index, hosts=None, profile=None, allow_no_indices=None, error_trace=None, expand_wildcards=None, features=None, filter_path=None, flat_settings=False, human=None, ignore_unavailable=None, include_defaults=False, local=False, master_timeout=None, pretty=None)[source]¶
Returns information about one or more indices.
- index
Comma-separated list of data streams, indices, and index aliases used to limit the request. Wildcard expressions (*) are supported.
- allow_no_indices
If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applielastic even if the request targets other open indices. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.
- expand_wildcards
Type of index that wildcard expressions can match. If the request can target data streams, this argument determinelastic whether wildcard expressions match hidden data streams. Supports comma-separated values, such as ‘all’, ‘closed’, ‘hidden’, ‘none’, ‘open’
- features
Return only information on specified index featurelastic. Support valuelastic such as ‘aliases’, ‘mappings’, ‘settings’
- flat_settings
If true, returns settings in flat format.
- ignore_unavailable
If false, requests that target a missing index return an error.
- include_defaults
If true, return all default settings in the response.
- local
If true, the request retrievelastic information from the local node only. Defaults to false, which means information is retrieved from the master node.
- 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.
CLI Example:
salt myminion elasticsearch.index_get testindex
- saltext.elasticsearch.modules.elasticsearch8_mod.index_open(index, allow_no_indices=True, expand_wildcards='closed', ignore_unavailable=True, hosts=None, profile=None, error_trace=None, filter_path=None, human=None, master_timeout=None, pretty=None, timeout=None, wait_for_active_shards=None)[source]¶
Added in version 3005.1.
Open specified index.
- index
A comma separated list of indices to open
- allow_no_indices
Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includelastic _all string or when no indices have been specified)
- expand_wildcards
Whether to expand wildcard expression to concrete indices that are open, closed or both. Valid choicelastic are (‘all’, ‘closed’, ‘hidden’, ‘none’, ‘open’)
- ignore_unavailable
Whether specified concrete indices should be ignored when unavailable (missing or closed)
- master_timeout
Specify timeout for connection to master
- timeout
Explicit operation timeout
- wait_for_active_shards
Sets the number of active shards to wait for before the operation returns. Valid choicelastic are an integer or ‘all’, ‘index-setting’ strings
CLI Example:
salt myminion elasticsearch.index_open testindex
- saltext.elasticsearch.modules.elasticsearch8_mod.index_close(index, allow_no_indices=True, expand_wildcards='open', ignore_unavailable=True, hosts=None, profile=None, error_trace=None, filter_path=None, human=None, master_timeout=None, pretty=None, timeout=None, wait_for_active_shards=None)[source]¶
Added in version 2017.7.0.
Close specified index.
- index
A comma separated list of indices to close
- allow_no_indices
Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includelastic _all string or when no indices have been specified)
- expand_wildcards
Whether to expand wildcard expression to concrete indices that are open, closed or both. Valid choicelastic are (‘all’, ‘closed’, ‘hidden’, ‘none’, ‘open’)
- ignore_unavailable
Whether specified concrete indices should be ignored when unavailable (missing or closed)
- master_timeout
Specify timeout for connection to master
- timeout
Explicit operation timeout
- wait_for_active_shards
Sets the number of active shards to wait for before the operation returns. Valid choicelastic are an integer or ‘all’, ‘index-setting’ strings
CLI Example:
salt myminion elasticsearch.index_close testindex
- saltext.elasticsearch.modules.elasticsearch8_mod.index_get_settings(hosts=None, profile=None, index=None, name=None, allow_no_indices=None, error_trace=None, expand_wildcards=None, filter_path=None, flat_settings=None, human=None, ignore_unavailable=None, include_defaults=None, local=None, master_timeout=None, pretty=None)[source]¶
# pylint: disable=line-too-long .. versionadded:: 3000
Check for the existence of an index and if it exists, return its settings https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-settings.html
- index
(Optional, string) A comma-separated list of index names; use _all or empty string for all indices. Defaults to ‘_all’.
- name
(Optional, string) The name of the settings that should be included
- allow_no_indices
(Optional, boolean) Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includelastic _all string or when no indices have been specified)
- expand_wildcards
(Optional, string) Whether to expand wildcard expression to concrete indices that are open, closed or both. Valid choicelastic are: open closed, none, all, hidden
- flat_settings
(Optional, boolean) Return settings in flat format
- ignore_unavailable
(Optional, boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed)
- include_defaults
(Optional, boolean) Whether to return all default setting for each of the indices.
- local
(Optional, boolean) Return local information, do not retrieve the state from master node
The defaults settings for the above parameters depend on the API version being used.
CLI Example:
salt myminion elasticsearch.index_get_settings index=testindex
- saltext.elasticsearch.modules.elasticsearch8_mod.index_put_settings(hosts=None, profile=None, source=None, settings=None, index=None, allow_no_indices=None, error_trace=None, expand_wildcards=None, filter_path=None, flat_settings=None, human=None, ignore_unavailable=None, master_timeout=None, preserve_existing=None, pretty=None, timeout=None)[source]¶
# pylint: disable=line-too-long .. versionadded:: 3000
Update existing index settings https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-update-settings.html
- source
URL to file specifying index definition. Cannot be used in combination with body.
- settings:
The index settings to be updated
- index
A comma-separated list of index names; use _all or empty string to perform the operation on all indices
- allow_no_indices
Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includelastic _all string or when no indices have been specified)
- expand_wildcards
Whether to expand wildcard expression to concrete indices that are open, closed or both. Valuelastic can be ‘all’, ‘closed’, ‘hidden’, ‘none’, ‘open’
- flat_settings
Return settings in flat format (default: false)
- ignore_unavailable
Whether specified concrete indices should be ignored when unavailable (missing or closed)
- master_timeout
Specify timeout for connection to master
- preserve_existing
Whether to update existing settings. If set to true existing settings on an index remain unchanged, the default is false
- timeout
Explicit operation timeout
The defaults settings for the above parameters depend on the API version being used.
Note
Elasticsearch time units can be found here:
CLI Example:
salt myminion elasticsearch.index_put_settings index=testindex body='{"settings" : {"index" : {"number_of_replicas" : 2}}}'
- saltext.elasticsearch.modules.elasticsearch8_mod.mapping_create(index, hosts=None, profile=None, source=None, allow_no_indices=None, date_detection=None, dynamic=None, dynamic_date_formats=None, dynamic_templates=None, error_trace=None, expand_wildcards=None, field_names=None, filter_path=None, human=None, ignore_unavailable=None, master_timeout=None, meta=None, numeric_detection=None, pretty=None, properties=None, routing=None, runtime=None, source_=None, timeout=None, write_index_only=None)[source]¶
# pylint: disable=line-too-long Create a mapping in a given index
- index
A comma-separated list of index namelastic the mapping should be added to (supports wildcards); use _all or omit to add the mapping on all indices.
- source
URL to file specifying mapping definition. Cannot be used in combination with body.
- allow_no_indices
Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includelastic _all string or when no indices have been specified)
- date_detection
Controls whether dynamic date detection is enabled.
- dynamic
Controls whether new fields are added dynamically.
- dynamic_date_formats
If date detection is enabled then new string fields are checked against ‘dynamic_date_formats’ and if the value matchelastic then a new date field is added instead of string.
- dynamic_templates
Specify dynamic templatelastic for the mapping.
- expand_wildcards
Whether to expand wildcard expression to concrete indices that are open, closed or both.
- field_names
Control whether field namelastic are enabled for the index.
- ignore_unavailable
Whether specified concrete indices should be ignored when unavailable (missing or closed)
- master_timeout
Specify timeout for connection to master
- meta
A mapping type can have custom meta data associated with it. These are not used at all by Elasticsearch, but can be used to store application-specific metadata.
- numeric_detection
Automatically map strings into numeric data typelastic for all fields.
- properties
Mapping for a field. For new fields, this mapping can include: - Field name - Field data type - Mapping parameters
- routing
Enable making a routing value required on indexed documents.
- runtime
Mapping of runtime fields for the index.
- source_
Control whether the _source field is enabled on the index.
- timeout
Explicit operation timeout
- write_index_only
When true, applielastic mappings only to the write index of an alias or data stream
CLI Example:
salt myminion elasticsearch.mapping_create testindex user '{ "user" : { "properties" : { "message" : {"type" : "string", "store" : true } } } }'
- saltext.elasticsearch.modules.elasticsearch8_mod.mapping_get(index, hosts=None, profile=None, allow_no_indices=None, error_trace=None, expand_wildcards=None, filter_path=None, human=None, ignore_unavailable=None, local=None, master_timeout=None, pretty=None)[source]¶
Retrieve mapping definition of index
- index
A comma-separated list of index names
- allow_no_indices
Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includelastic _all string or when no indices have been specified)
- expand_wildcards
Whether to expand wildcard expression to concrete indices that are open, closed or both.
- ignore_unavailable
Whether specified concrete indices should be ignored when unavailable (missing or closed)
- local
Return local information, do not retrieve the state from master node (default: false)
- master_timeout
Specify timeout for connection to master
CLI Example:
salt myminion elasticsearch.mapping_get testindex user
- saltext.elasticsearch.modules.elasticsearch8_mod.index_template_create(name, hosts=None, profile=None, source=None, aliases=None, create=None, error_trace=None, filter_path=None, flat_settings=False, human=None, index_patterns=None, mappings=None, master_timeout=None, order=None, pretty=None, settings=None, timeout=None, version=None)[source]¶
# pylint: disable=line-too-long Create an index template
- name
The name of the template
- source
URL to file specifying template definition. Cannot be used in combination with settings or mappings.
- 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.
CLI Example:
salt myminion elasticsearch.index_template_create testindex_templ '{ "template": "logstash-*", "order": 1, "settings": { "number_of_shards": 1 } }'
- saltext.elasticsearch.modules.elasticsearch8_mod.index_template_delete(name, hosts=None, profile=None, error_trace=None, filter_path=None, human=None, master_timeout=None, pretty=None, timeout=None)[source]¶
Delete an index template (type) along with its data
- name
The name of the template
- master_timeout
Specify timeout for connection to master
- timeout
Explicit operation timeout
CLI Example:
salt myminion elasticsearch.index_template_delete testindex_templ user
- saltext.elasticsearch.modules.elasticsearch8_mod.index_template_exists(name, hosts=None, profile=None, error_trace=None, filter_path=None, human=None, master_timeout=None, pretty=None)[source]¶
Return a boolean indicating whether given index template exists
- name
Comma-separated list of index template namelastic used to limit the request. Wildcard (*) expressions are supported.
- 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.
CLI Example:
salt myminion elasticsearch.index_template_exists testindex_templ
- saltext.elasticsearch.modules.elasticsearch8_mod.template_exists(name, hosts=None, profile=None, error_trace=None, filter_path=None, flat_settings=False, human=None, local=False, master_timeout=None, pretty=None)[source]¶
Return a boolean indicating whether given index template exists
- name
Comma-separated list of index template namelastic used to limit the request. Wildcard (*) expressions are supported.
- flat_settings
Return settings in flat format (default: false)
- local
Return local information, do not retrieve the state from master node (default: false)
- 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.
CLI Example:
salt myminion elasticsearch.index_template_exists testindex_templ
- saltext.elasticsearch.modules.elasticsearch8_mod.index_template_get(name=None, hosts=None, profile=None, error_trace=None, filter_path=None, flat_settings=None, human=None, local=None, master_timeout=None, pretty=None)[source]¶
Added in version 3005.1.
Retrieve template definition of index or index/type
- name
The comma separated namelastic of the index templates
- flat_settings
Return settings in flat format (default: false)
- local
Return local information, do not retrieve the state from master node (default: false)
- master_timeout
Explicit operation timeout for connection to master node
CLI Example:
salt myminion elasticsearch.index_template_get testindex_templ
- saltext.elasticsearch.modules.elasticsearch8_mod.geo_ip_stats(hosts=None, profile=None, error_trace=None, filter_path=None, human=None, pretty=None)[source]¶
Added in version 3005.1.
Returns statistical information about geoip databases
https://www.elastic.co/guide/en/elasticsearch/reference/master/geoip-stats-api.html
CLI Example:
salt myminion elasticsearch.geo_ip_stats
- saltext.elasticsearch.modules.elasticsearch8_mod.processor_grok(hosts=None, profile=None, error_trace=None, filter_path=None, human=None, pretty=None)[source]¶
Added in version 3005.1.
Returns a list of built-in patterns
CLI Example:
salt myminion elasticsearch.processor_grok
- saltext.elasticsearch.modules.elasticsearch8_mod.pipeline_get(id_, hosts=None, profile=None, error_trace=None, filter_path=None, human=None, master_timeout=None, pretty=None, summary=None)[source]¶
Added in version 3005.1.
Retrieve Ingest pipeline definition. Available since Elasticsearch 5.0.
- id_
Comma separated list of pipeline ids. Wildcards supported
- master_timeout
Explicit operation timeout for connection to master node
- summary
Return pipelinelastic without their definitions (default: false)
CLI Example:
salt myminion elasticsearch.pipeline_get mypipeline
- saltext.elasticsearch.modules.elasticsearch8_mod.pipeline_delete(id_, hosts=None, profile=None, error_trace=None, filter_path=None, human=None, master_timeout=None, pretty=None, timeout=None)[source]¶
Added in version 3005.1.
Delete Ingest pipeline. Available since Elasticsearch 5.0.
- id_
Pipeline ID
- master_timeout
Explicit operation timeout for connection to master node
- timeout
Explicit operation timeout
CLI Example:
salt myminion elasticsearch.pipeline_delete mypipeline
- saltext.elasticsearch.modules.elasticsearch8_mod.pipeline_create(id_, hosts=None, profile=None, description=None, error_trace=None, filter_path=None, human=None, if_version=None, master_timeout=None, meta=None, on_failure=None, pretty=None, processors=None, timeout=None, version=None)[source]¶
# pylint: disable=line-too-long .. versionadded:: 3005.1
Create Ingest pipeline by supplied definition. Available since Elasticsearch 5.0.
- id_
Pipeline id
- 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.
CLI Example:
salt myminion elasticsearch.pipeline_create mypipeline '{"description": "my custom pipeline", "processors": [{"set" : {"field": "collector_timestamp_millis", "value": "{{_ingest.timestamp}}"}}]}'
- saltext.elasticsearch.modules.elasticsearch8_mod.pipeline_simulate(id_=None, hosts=None, profile=None, docs=None, error_trace=None, filter_path=None, human=None, pipeline=None, pretty=None, verbose=False)[source]¶
# pylint: disable=line-too-long .. versionadded:: 3005.1
Simulate existing Ingest pipeline on provided data. Available since Elasticsearch 5.0.
- id_
Pipeline id
- docs:
Documents
- verbose
Specify if the output should be more verbose
CLI Example:
salt myminion elasticsearch.pipeline_simulate mypipeline '{"docs":[{"_index":"index","_type":"type","_id":"id","_source":{"foo":"bar"}}, {"_index":"index","_type":"type","_id":"id","_source":{"foo":"rab"}}]}' verbose=True
- saltext.elasticsearch.modules.elasticsearch8_mod.script_get(id_, hosts=None, profile=None, error_trace=None, filter_path=None, human=None, master_timeout=None, pretty=None)[source]¶
Added in version 3005.1.
Obtain existing script definition.
- id_
Script ID
- master_timeout
Specify timeout for connection to master
CLI Example:
salt myminion elasticsearch.script_template_get mytemplate
- saltext.elasticsearch.modules.elasticsearch8_mod.script_create(id_, script=None, hosts=None, profile=None, context=None, error_trace=None, filter_path=None, human=None, master_timeout=None, pretty=None, timeout=None)[source]¶
Create cript by supplied script definition
Added in version 3005.1.
- script
Script definition
CLI Example:
salt myminion elasticsearch.script_create mytemplate '{"template":{"query":{"match":{"title":"{{query_string}}"}}}}'
- saltext.elasticsearch.modules.elasticsearch8_mod.script_delete(id_, hosts=None, profile=None, error_trace=None, filter_path=None, human=None, master_timeout=None, pretty=None, timeout=None)[source]¶
Added in version 3005.1.
Delete existing script.
- id_
Script ID
- master_timeout
Specify timeout for connection to master
- timeout
Explicit operation timeout
CLI Example:
salt myminion elasticsearch.script_delete id=id
- saltext.elasticsearch.modules.elasticsearch8_mod.repository_get(name, hosts=None, profile=None, error_trace=None, filter_path=None, human=None, local=False, master_timeout=None, pretty=None)[source]¶
Added in version 3005.1.
Get existing repository details.
- name
comma-separated list of repository names
- local
Return local information, do not retrieve the state from master node (default: false)
- master_timeout
Explicit operation timeout for connection to master node
CLI Example:
salt myminion elasticsearch.repository_get testrepo
- saltext.elasticsearch.modules.elasticsearch8_mod.repository_cleanup(name, hosts=None, profile=None, error_trace=None, filter_path=None, human=None, master_timeout=None, pretty=None, timeout=None)[source]¶
Added in version 3005.1.
Removelastic stale data from repository
- name
comma-separated list of repository names
- local
Return local information, do not retrieve the state from master node (default: false)
- master_timeout
Explicit operation timeout for connection to master node
- timeout
Period to wait for a response.
CLI Example:
salt myminion elasticsearch.repository_get testrepo
- saltext.elasticsearch.modules.elasticsearch8_mod.repository_create(name, hosts=None, profile=None, type_=None, settings=None, error_trace=None, filter_path=None, human=None, master_timeout=None, pretty=None, repository=None, timeout=None, verify=None, body=None)[source]¶
# pylint: disable=line-too-long .. versionadded:: 3005.1
Create repository for storing snapshots. Note that shared repository paths have to be specified in path.repo Elasticsearch configuration option.
- name
A repository name
- hosts
List of hosts to connect
- profile
Security profile to use
- settings:
Repository settings definition
- type_:
Repository type
- master_timeout
Explicit operation timeout for connection to master node
- repository
Repository
- timeout
Explicit operation timeout
- verify
Whether to verify the repository after creation
- body
Repository definition as in https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html The use of body is deprecated and it will be disabled in a coming release
CLI Example:
salt myminion elasticsearch.repository_create testrepo '{"type":"fs","settings":{"location":"/tmp/test","compress":true}}'
- saltext.elasticsearch.modules.elasticsearch8_mod.repository_delete(name, hosts=None, profile=None, error_trace=None, filter_path=None, human=None, master_timeout=None, pretty=None, timeout=None)[source]¶
Added in version 3005.1.
Delete existing repository.
- name
Name of the snapshot repository to unregister. Wildcard (*) patterns are supported.
- master_timeout
Explicit operation timeout for connection to master node
- timeout
Explicit operation timeout
CLI Example:
salt myminion elasticsearch.repository_delete testrepo
- saltext.elasticsearch.modules.elasticsearch8_mod.repository_verify(name, hosts=None, profile=None, error_trace=None, filter_path=None, human=None, master_timeout=None, pretty=None, timeout=None)[source]¶
Added in version 3005.1.
Obtain list of cluster nodes which successfully verified this repository.
- name
Repository name
- master_timeout
Explicit operation timeout for connection to master node
- timeout
Explicit operation timeout
CLI Example:
salt myminion elasticsearch.repository_verify testrepo
- saltext.elasticsearch.modules.elasticsearch8_mod.snapshot_status(hosts=None, profile=None, repository=None, snapshot=None, error_trace=None, filter_path=None, human=None, ignore_unavailable=None, master_timeout=None, pretty=None)[source]¶
Added in version 3005.1.
Obtain status of all currently running snapshots.
- repository
Particular repository to look for snapshots
- snapshot
A comma-separated list of snapshot names
- ignore_unavailable
Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown
- master_timeout
Explicit operation timeout for connection to master node
CLI Example:
salt myminion elasticsearch.snapshot_status ignore_unavailable=True
- saltext.elasticsearch.modules.elasticsearch8_mod.snapshot_clone(hosts=None, profile=None, repository=None, indices=None, target_snapshot=None, snapshot=None, error_trace=None, filter_path=None, human=None, master_timeout=None, pretty=None, timeout=None)[source]¶
Added in version 3005.1.
Clonelastic indices from one snapshot into another snapshot in the same repository.
- repository
Particular repository to look for snapshots
- indices
List of indices to snapshot
- snapshot
The name of the snapshot to clone from
- target_snapshot
The name of the cloned snapshot to create
- master_timeout
Explicit operation timeout for connection to master node
CLI Example:
salt myminion elasticsearch.snapshot_status ignore_unavailable=True
- saltext.elasticsearch.modules.elasticsearch8_mod.snapshot_get(repository, snapshot, hosts=None, profile=None, after=None, error_trace=None, filter_path=None, from_sort_value=None, human=None, ignore_unavailable=False, include_repository=None, index_details=None, index_names=None, master_timeout=None, offset=None, order=None, pretty=None, size=None, slm_policy_filter=None, sort=None, verbose=None)[source]¶
Added in version 3005.1.
Obtain snapshot residing in specified repository.
- repository
Comma-separated list of snapshot repository namelastic used to limit the request. Wildcard (*) expressions are supported.
- snapshot
Comma-separated list of snapshot namelastic to retrieve. Also accepts wildcards (*). - To get information about all snapshots in a registered repository, use a wildcard (*) or _all. - To get information about any snapshots that are currently running, use _current.
- after
Offset identifier to start pagination from as returned by the next field in the response body.
- from_sort_value
Value of the current sort column at which to start retrieval. Can either be a string snapshot- or repository name when sorting by snapshot or repository name, a millisecond time value or a number when sorting by index- or shard count.
- ignore_unavailable
If false, the request returns an error for any snapshots that are unavailable.
- include_repository
If true, returns the repository name in each snapshot.
- index_details
If true, returns additional information about each index in the snapshot comprising the number of shards in the index, the total size of the index in bytes, and the maximum number of segments per shard in the index. Defaults to false, meaning that this information is omitted.
- index_names
If true, returns the name of each index in each snapshot.
- 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.
- offset
Numeric offset to start pagination from based on the snapshots matching this request. Using a non-zero value for this parameter is mutually exclusive with using the after parameter. Defaults to 0.
- order
Sort order. Valid valuelastic are asc for ascending and desc for descending order. Defaults to asc, meaning ascending order.
- size
Maximum number of snapshots to return. Defaults to 0 which means return all that match the request without limit.
- slm_policy_filter
Filter snapshots by a comma-separated list of SLM policy namelastic that snapshots belong to. Also accepts wildcards (*) and combinations of wildcards followed by exclude patterns starting with -. To include snapshots not created by an SLM policy you can use the special pattern _none that will match all snapshots without an SLM policy.
- sort
Allows setting a sort order for the result. Defaults to start_time, i.e. sorting by snapshot start time stamp.
- verbose
If true, returns additional information about each snapshot such as the version of Elasticsearch which took the snapshot, the start and end timelastic of the snapshot, and the number of shards snapshotted.
CLI Example:
salt myminion elasticsearch.snapshot_get testrepo testsnapshot
- saltext.elasticsearch.modules.elasticsearch8_mod.snapshot_create(repository, snapshot, hosts=None, profile=None, error_trace=None, feature_states=None, filter_path=None, human=None, ignore_unavailable=None, include_global_state=None, indices=None, master_timeout=None, metadata=None, partial=None, pretty=None, wait_for_completion=None)[source]¶
# pylint: disable=line-too-long .. versionadded:: 3005.1
Create snapshot in specified repository by supplied definition.
- repository
Repository name
- snapshot
Snapshot name
- feature_states
Feature statelastic to include in the snapshot. Each feature state includelastic one or more system indices containing related data. You can view a list of eligible featurelastic using the get features API. If include_global_state is true, all current feature statelastic are included by default. If include_global_state is false, no feature statelastic are included by default.
- ignore_unavailable
If true, the request ignorelastic data streams and indices in indices that are missing or closed. If false, the request returns an error for any data stream or index that is missing or closed.
- include_global_state
If true, the current cluster state is included in the snapshot. The cluster state includelastic persistent cluster settings, composable index templates, legacy index templates, ingest pipelines, and ILM policielastic. It also includelastic data stored in system indices, such as Watches and task records (configurable via feature_states).
- indices
Data streams and indices to include in the snapshot. Supports multi-target syntax. Includelastic all data streams and indices by default.
- 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.
- metadata
Optional metadata for the snapshot. May have any contents. Must be less than 1024 bytelastic. This map is not automatically generated by Elasticsearch.
- partial
If true, allows restoring a partial snapshot of indices with unavailable shards. Only shards that were successfully included in the snapshot will be restored. All missing shards will be recreated as empty. If false, the entire restore operation will fail if one or more indices included in the snapshot do not have all primary shards available.
- wait_for_completion
If true, the request returns a response when the snapshot is complete. If false, the request returns a response when the snapshot initializelastic.
CLI Example:
salt myminion elasticsearch.snapshot_create testrepo testsnapshot '{"indices":"index_1,index_2","ignore_unavailable":true,"include_global_state":false}'
- saltext.elasticsearch.modules.elasticsearch8_mod.snapshot_restore(repository, snapshot, hosts=None, profile=None, error_trace=None, filter_path=None, human=None, ignore_index_settings=None, ignore_unavailable=None, include_aliases=None, include_global_state=None, index_settings=None, indices=None, master_timeout=None, partial=None, pretty=None, rename_pattern=None, rename_replacement=None, wait_for_completion=None)[source]¶
# pylint: disable=line-too-long .. versionadded:: 3005.1
Restore existing snapshot in specified repository by supplied definition.
- repository
Repository name
- snapshot
Snapshot name
- ignore_index_settings
ignore_index_settings
- ignore_unavailable
ignore_unavailable
- include_aliases
include_aliases
- include_global_state
include_global_state
- index_settings
index_settings
- indices
A list of indices to restore
- master_timeout
Explicit operation timeout for connection to master node
- partial
partial
- rename_pattern
rename_pattern
- rename_replacement
rename_replacement
- wait_for_completion
Should this request wait until the operation has completed before returning
CLI Example:
salt myminion elasticsearch.snapshot_restore testrepo testsnapshot '{"indices":"index_1,index_2","ignore_unavailable":true,"include_global_state":true}'
- saltext.elasticsearch.modules.elasticsearch8_mod.snapshot_delete(repository, snapshot, hosts=None, profile=None, error_trace=None, filter_path=None, human=None, master_timeout=None, pretty=None)[source]¶
Added in version 3005.1.
Delete snapshot from specified repository.
- repository
Repository name
- snapshot
Snapshot name
- master_timeout
Explicit operation timeout for connection to master node
CLI Example:
salt myminion elasticsearch.snapshot_delete testrepo testsnapshot
- saltext.elasticsearch.modules.elasticsearch8_mod.flush(hosts=None, profile=None, index=None, allow_no_indices=None, error_trace=None, expand_wildcards=None, filter_path=None, force=None, human=None, ignore_unavailable=None, pretty=None, wait_if_ongoing=None)[source]¶
# pylint: disable=line-too-long .. versionadded:: 3005.1
- index: A comma-separated list of index names; use _all or empty string
for all indices
- allow_no_indices: Whether to ignore if a wildcard indices expression resolves
into no concrete indices. (This includelastic _all string or when no indices have been specified)
- expand_wildcards: Whether to expand wildcard expression to concrete indices
that are open, closed or both. Valid valuelastic are:
all - Expand to open and closed indices. open - Expand only to open indices. closed - Expand only to closed indices. none - Wildcard expressions are not accepted.
- force: Whether a flush should be forced even if it is not necessarily
needed ie. if no changelastic will be committed to the index. This is useful if transaction log IDs should be incremented even if no uncommitted changes are present. (This setting can be considered as internal)
- ignore_unavailable: Whether specified concrete indices should be ignored
when unavailable (missing or closed)
- wait_if_ongoing: If set to true the flush operation will block until the
flush can be executed if another flush operation is already executing. The default is true. If set to false the flush will be skipped iff if another flush operation is already running.
The defaults settings for the above parameters depend on the API being used.
CLI Example:
salt myminion elasticsearch.flush index='index1,index2' ignore_unavailable=True allow_no_indices=True expand_wildcards='all'