Skip to content

Commit

Permalink
Merge pull request #3 from cesan3/merge-downstream2
Browse files Browse the repository at this point in the history
Merge downstream2
  • Loading branch information
cesan3 authored Nov 17, 2023
2 parents 79bbbd2 + 4b778d5 commit 7fa9f37
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 55 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog


## [1.1.1](https://github.com/cesan3/salt-ext-elasticsearch/compare/1.1.0...1.1.1) - 2023-11-17
- fix: pass correct id attribute name by @cesan3 in https://github.com/cesan3/salt-ext-elasticsearch/pull/20

## [1.1.0](https://github.com/cesan3/salt-ext-elasticsearch/compare/1.0.0...1.1.0) - 2023-11-17
- Fix returner for ES8 by @cesan3 in https://github.com/cesan3/salt-ext-elasticsearch/pull/18

## [1.0.0](https://github.com/cesan3/salt-ext-elasticsearch/compare/0.0.8...1.0.0) - 2023-11-08
- Merge upstream by @cesan3 in https://github.com/cesan3/salt-ext-elasticsearch/pull/16

Expand Down
5 changes: 2 additions & 3 deletions docs/ref/modules/all.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@ Execution Modules
:toctree:

saltext.elasticsearch.modules.__init__
saltext.elasticsearch.modules.elasticsearch_mod
saltext.elasticsearch.modules.es_module_6
saltext.elasticsearch.modules.es_module_8
saltext.elasticsearch.modules.elasticsearch6_mod
saltext.elasticsearch.modules.elasticsearch8_mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

saltext.elasticsearch.modules.elasticsearch6_mod
================================================

.. automodule:: saltext.elasticsearch.modules.elasticsearch6_mod
:members:
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

saltext.elasticsearch.modules.elasticsearch8_mod
================================================

.. automodule:: saltext.elasticsearch.modules.elasticsearch8_mod
:members:

This file was deleted.

This file was deleted.

This file was deleted.

62 changes: 31 additions & 31 deletions src/saltext/elasticsearch/modules/elasticsearch8_mod.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Module to provide Elasticsearch compatibility to Salt
(compatible with Elasticsearch version 8+). Copied from elasticsearch.py module and updated.
.. versionadded:: 3005.1-4
.. versionadded:: 3005.1
:codeauthor: Cesar Sanchez <[email protected]>
Expand Down Expand Up @@ -171,7 +171,7 @@ def ping(
allow_failure=False,
):
"""
.. versionadded:: 3005.1-4
.. versionadded:: 3005.1
Test connection to Elasticsearch instance. This method does not fail if not explicitly specified.
Expand Down Expand Up @@ -237,7 +237,7 @@ def node_info(
timeout=None,
):
"""
.. versionadded:: 3005.1-4
.. versionadded:: 3005.1
Return Elasticsearch node information.
Expand Down Expand Up @@ -306,7 +306,7 @@ def cluster_health(
"""
# pylint: disable=line-too-long
.. versionadded:: 3005.1-4
.. versionadded:: 3005.1
Return Elasticsearch cluster health.
Expand Down Expand Up @@ -405,7 +405,7 @@ def cluster_allocation_explain(
shard=None,
):
"""
.. versionadded:: 3005.1-4
.. versionadded:: 3005.1
Return Elasticsearch cluster allocation explain
Expand Down Expand Up @@ -465,7 +465,7 @@ def cluster_pending_tasks(
pretty=None,
):
"""
.. versionadded:: 3005.1-4
.. versionadded:: 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.
Expand Down Expand Up @@ -512,7 +512,7 @@ def cluster_stats(
timeout=None,
):
"""
.. versionadded:: 3005.1-4
.. versionadded:: 3005.1
Return Elasticsearch cluster stats.
Expand Down Expand Up @@ -564,7 +564,7 @@ def cluster_get_settings(
timeout=None,
):
"""
.. versionadded:: 3005.1-4
.. versionadded:: 3005.1
Return Elasticsearch cluster settings.
Expand Down Expand Up @@ -1600,7 +1600,7 @@ def index_open(
wait_for_active_shards=None,
):
"""
.. versionadded:: 3005.1-4
.. versionadded:: 3005.1
Open specified index.
Expand Down Expand Up @@ -2356,7 +2356,7 @@ def index_template_get(
pretty=None,
):
"""
.. versionadded:: 3005.1-4
.. versionadded:: 3005.1
Retrieve template definition of index or index/type
Expand Down Expand Up @@ -2406,7 +2406,7 @@ def geo_ip_stats(
pretty=None,
):
"""
.. versionadded:: 3005.1-4
.. versionadded:: 3005.1
Returns statistical information about geoip databases
Expand Down Expand Up @@ -2442,7 +2442,7 @@ def processor_grok(
pretty=None,
):
"""
.. versionadded:: 3005.1-4
.. versionadded:: 3005.1
Returns a list of built-in patterns
Expand Down Expand Up @@ -2481,7 +2481,7 @@ def pipeline_get(
summary=None,
):
"""
.. versionadded:: 3005.1-4
.. versionadded:: 3005.1
Retrieve Ingest pipeline definition. Available since Elasticsearch 5.0.
Expand Down Expand Up @@ -2532,7 +2532,7 @@ def pipeline_delete(
timeout=None,
):
"""
.. versionadded:: 3005.1-4
.. versionadded:: 3005.1
Delete Ingest pipeline. Available since Elasticsearch 5.0.
Expand Down Expand Up @@ -2591,7 +2591,7 @@ def pipeline_create(
):
"""
# pylint: disable=line-too-long
.. versionadded:: 3005.1-4
.. versionadded:: 3005.1
Create Ingest pipeline by supplied definition. Available since Elasticsearch 5.0.
Expand Down Expand Up @@ -2674,7 +2674,7 @@ def pipeline_simulate(
):
"""
# pylint: disable=line-too-long
.. versionadded:: 3005.1-4
.. versionadded:: 3005.1
Simulate existing Ingest pipeline on provided data. Available since Elasticsearch 5.0.
Expand Down Expand Up @@ -2726,7 +2726,7 @@ def script_get(
pretty=None,
):
"""
.. versionadded:: 3005.1-4
.. versionadded:: 3005.1
Obtain existing script definition.
Expand Down Expand Up @@ -2776,7 +2776,7 @@ def script_create(
"""
Create cript by supplied script definition
.. versionadded:: 3005.1-4
.. versionadded:: 3005.1
script
Script definition
Expand Down Expand Up @@ -2822,7 +2822,7 @@ def script_delete(
timeout=None,
):
"""
.. versionadded:: 3005.1-4
.. versionadded:: 3005.1
Delete existing script.
Expand Down Expand Up @@ -2872,7 +2872,7 @@ def repository_get(
pretty=None,
):
"""
.. versionadded:: 3005.1-4
.. versionadded:: 3005.1
Get existing repository details.
Expand Down Expand Up @@ -2921,7 +2921,7 @@ def repository_cleanup(
timeout=None,
):
"""
.. versionadded:: 3005.1-4
.. versionadded:: 3005.1
Removelastic stale data from repository
Expand Down Expand Up @@ -2978,7 +2978,7 @@ def repository_create(
):
"""
# pylint: disable=line-too-long
.. versionadded:: 3005.1-4
.. versionadded:: 3005.1
Create repository for storing snapshots. Note that shared repository paths have to be specified in path.repo
Elasticsearch configuration option.
Expand Down Expand Up @@ -3051,7 +3051,7 @@ def repository_delete(
timeout=None,
):
"""
.. versionadded:: 3005.1-4
.. versionadded:: 3005.1
Delete existing repository.
Expand Down Expand Up @@ -3101,7 +3101,7 @@ def repository_verify(
timeout=None,
):
"""
.. versionadded:: 3005.1-4
.. versionadded:: 3005.1
Obtain list of cluster nodes which successfully verified this repository.
Expand Down Expand Up @@ -3151,7 +3151,7 @@ def snapshot_status(
pretty=None,
):
"""
.. versionadded:: 3005.1-4
.. versionadded:: 3005.1
Obtain status of all currently running snapshots.
Expand Down Expand Up @@ -3205,7 +3205,7 @@ def snapshot_clone(
timeout=None,
):
"""
.. versionadded:: 3005.1-4
.. versionadded:: 3005.1
Clonelastic indices from one snapshot into another snapshot in the same repository.
Expand Down Expand Up @@ -3272,7 +3272,7 @@ def snapshot_get(
verbose=None,
):
"""
.. versionadded:: 3005.1-4
.. versionadded:: 3005.1
Obtain snapshot residing in specified repository.
Expand Down Expand Up @@ -3391,7 +3391,7 @@ def snapshot_create(
):
"""
# pylint: disable=line-too-long
.. versionadded:: 3005.1-4
.. versionadded:: 3005.1
Create snapshot in specified repository by supplied definition.
Expand Down Expand Up @@ -3492,7 +3492,7 @@ def snapshot_restore(
):
"""
# pylint: disable=line-too-long
.. versionadded:: 3005.1-4
.. versionadded:: 3005.1
Restore existing snapshot in specified repository by supplied definition.
Expand Down Expand Up @@ -3571,7 +3571,7 @@ def snapshot_delete(
pretty=None,
):
"""
.. versionadded:: 3005.1-4
.. versionadded:: 3005.1
Delete snapshot from specified repository.
Expand Down Expand Up @@ -3625,7 +3625,7 @@ def flush(
):
"""
# pylint: disable=line-too-long
.. versionadded:: 3005.1-4
.. versionadded:: 3005.1
index: A comma-separated list of index names; use _all or empty string
for all indices
Expand Down
4 changes: 2 additions & 2 deletions src/saltext/elasticsearch/returners/elasticsearch8_mod.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ def event_return(events):

ret = __salt__["elasticsearch.document_create"](
index=index,
id=uuid.uuid4(),
id_=uuid.uuid4(),
document=salt.utils.json.dumps(data),
)

Expand Down Expand Up @@ -396,7 +396,7 @@ def save_load(jid, load, minions=None):
}

ret = __salt__["elasticsearch.document_create"](
index=index, id=jid, document=salt.utils.json.dumps(data)
index=index, id_=jid, document=salt.utils.json.dumps(data)
)


Expand Down
1 change: 0 additions & 1 deletion tests/unit/modules/test_elasticsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -1829,4 +1829,3 @@ def test_template_exists_failure(self):
pytest.raises(
CommandExecutionError, elasticsearch_module.template_exists, "foo"
)

0 comments on commit 7fa9f37

Please sign in to comment.