Skip to content

Commit

Permalink
Update 7.9 APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
sethmlarson committed Aug 6, 2020
1 parent 21a4a73 commit af84f8a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 22 deletions.
2 changes: 1 addition & 1 deletion elasticsearch/_async/client/__init__.py
Expand Up @@ -455,7 +455,7 @@ async def bulk(self, body, index=None, doc_type=None, params=None, headers=None)
async def clear_scroll(self, body=None, scroll_id=None, params=None, headers=None):
"""
Explicitly clears the search context for a scroll.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.9/search-request-body.html#_clear_scroll_api>`_
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.9/clear-scroll-api.html>`_
:arg body: A comma-separated list of scroll IDs to clear if none
was specified via the scroll_id parameter
Expand Down
15 changes: 5 additions & 10 deletions elasticsearch/_async/client/indices.py
Expand Up @@ -1292,23 +1292,18 @@ async def reload_search_analyzers(self, index, params=None, headers=None):
)

@query_params()
async def create_data_stream(self, name, body=None, params=None, headers=None):
async def create_data_stream(self, name, params=None, headers=None):
"""
Creates or updates a data stream
Creates a data stream
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.9/data-streams.html>`_
:arg name: The name of the data stream
:arg body: The data stream definition
"""
if name in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'name'.")

return await self.transport.perform_request(
"PUT",
_make_path("_data_stream", name),
params=params,
headers=headers,
body=body,
"PUT", _make_path("_data_stream", name), params=params, headers=headers
)

@query_params()
Expand Down Expand Up @@ -1482,7 +1477,7 @@ async def simulate_template(self, body=None, name=None, params=None, headers=Non
async def resolve_index(self, name, params=None, headers=None):
"""
Returns information about any matching indices, aliases, and data streams
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-resolve-index.html>`_
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.9/indices-resolve-index-api.html>`_
:arg name: A comma-separated list of names or wildcard
expressions
Expand All @@ -1507,7 +1502,7 @@ async def resolve_index(self, name, params=None, headers=None):
async def add_block(self, index, block, params=None, headers=None):
"""
Adds a block to an index.
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-blocks.html>`_
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.9/index-modules-blocks.html>`_
:arg index: A comma separated list of indices to add a block to
:arg block: The block to add (one of read, write, read_only or
Expand Down
2 changes: 1 addition & 1 deletion elasticsearch/client/__init__.py
Expand Up @@ -453,7 +453,7 @@ def bulk(self, body, index=None, doc_type=None, params=None, headers=None):
def clear_scroll(self, body=None, scroll_id=None, params=None, headers=None):
"""
Explicitly clears the search context for a scroll.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.9/search-request-body.html#_clear_scroll_api>`_
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.9/clear-scroll-api.html>`_
:arg body: A comma-separated list of scroll IDs to clear if none
was specified via the scroll_id parameter
Expand Down
15 changes: 5 additions & 10 deletions elasticsearch/client/indices.py
Expand Up @@ -1288,23 +1288,18 @@ def reload_search_analyzers(self, index, params=None, headers=None):
)

@query_params()
def create_data_stream(self, name, body=None, params=None, headers=None):
def create_data_stream(self, name, params=None, headers=None):
"""
Creates or updates a data stream
Creates a data stream
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.9/data-streams.html>`_
:arg name: The name of the data stream
:arg body: The data stream definition
"""
if name in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'name'.")

return self.transport.perform_request(
"PUT",
_make_path("_data_stream", name),
params=params,
headers=headers,
body=body,
"PUT", _make_path("_data_stream", name), params=params, headers=headers
)

@query_params()
Expand Down Expand Up @@ -1478,7 +1473,7 @@ def simulate_template(self, body=None, name=None, params=None, headers=None):
def resolve_index(self, name, params=None, headers=None):
"""
Returns information about any matching indices, aliases, and data streams
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-resolve-index.html>`_
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.9/indices-resolve-index-api.html>`_
:arg name: A comma-separated list of names or wildcard
expressions
Expand All @@ -1503,7 +1498,7 @@ def resolve_index(self, name, params=None, headers=None):
def add_block(self, index, block, params=None, headers=None):
"""
Adds a block to an index.
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-blocks.html>`_
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.9/index-modules-blocks.html>`_
:arg index: A comma separated list of indices to add a block to
:arg block: The block to add (one of read, write, read_only or
Expand Down

0 comments on commit af84f8a

Please sign in to comment.