Update to 7.x-SNAPSHOT

This commit is contained in:
Seth Michael Larson
2021-07-13 19:57:03 -05:00
parent b56fbcb155
commit ef913450c7
16 changed files with 280 additions and 10 deletions
+1 -1
View File
@@ -1460,7 +1460,7 @@ class AsyncElasticsearch(object):
"""
Allows to use the Mustache language to pre-render a search definition.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/search-template.html#_validating_templates>`_
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/render-search-template-api.html>`_
:arg body: The search definition template and its params
:arg id: The id of the stored search template
+4 -1
View File
@@ -184,7 +184,7 @@ class IlmClient(NamespacedClient):
"POST", "/_ilm/stop", params=params, headers=headers
)
@query_params()
@query_params("dry_run")
async def migrate_to_data_tiers(self, body=None, params=None, headers=None):
"""
Migrates the indices and ILM policies away from custom node attribute
@@ -195,6 +195,9 @@ class IlmClient(NamespacedClient):
:arg body: Optionally specify a legacy index template name to
delete and optionally specify a node attribute name used for index shard
routing (defaults to "data")
:arg dry_run: If set to true it will simulate the migration,
providing a way to retrieve the ILM policies and indices that need to be
migrated. The default is false
"""
return await self.transport.perform_request(
"POST",
+1
View File
@@ -195,6 +195,7 @@ class IlmClient(NamespacedClient):
self,
*,
body: Optional[Any] = ...,
dry_run: Optional[Any] = ...,
pretty: Optional[bool] = ...,
human: Optional[bool] = ...,
error_trace: Optional[bool] = ...,
+6 -1
View File
@@ -222,7 +222,12 @@ class RollupClient(NamespacedClient):
"""
Rollup an index
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/rollup-api.html>`_
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/xpack-rollup.html>`_
.. warning::
This API is **experimental** so may include breaking changes
or be removed in a future version
:arg index: The index to roll up
:arg rollup_index: The name of the rollup index to create
+9 -1
View File
@@ -69,7 +69,13 @@ class SnapshotClient(NamespacedClient):
headers=headers,
)
@query_params("ignore_unavailable", "index_details", "master_timeout", "verbose")
@query_params(
"ignore_unavailable",
"include_repository",
"index_details",
"master_timeout",
"verbose",
)
async def get(self, repository, snapshot, params=None, headers=None):
"""
Returns information about a snapshot.
@@ -81,6 +87,8 @@ class SnapshotClient(NamespacedClient):
:arg ignore_unavailable: Whether to ignore unavailable
snapshots, defaults to false which means a SnapshotMissingException is
thrown
:arg include_repository: Whether to include the repository name
in the snapshot info. Defaults to true.
:arg index_details: Whether to include details of each index in
the snapshot, if those details are available. Defaults to false.
:arg master_timeout: Explicit operation timeout for connection
+1
View File
@@ -66,6 +66,7 @@ class SnapshotClient(NamespacedClient):
snapshot: Any,
*,
ignore_unavailable: Optional[Any] = ...,
include_repository: Optional[Any] = ...,
index_details: Optional[Any] = ...,
master_timeout: Optional[Any] = ...,
verbose: Optional[Any] = ...,
+64 -1
View File
@@ -15,7 +15,7 @@
# specific language governing permissions and limitations
# under the License.
from .utils import SKIP_IN_PATH, NamespacedClient, query_params
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
class SqlClient(NamespacedClient):
@@ -70,3 +70,66 @@ class SqlClient(NamespacedClient):
return await self.transport.perform_request(
"POST", "/_sql/translate", params=params, headers=headers, body=body
)
@query_params()
async def delete_async(self, id, params=None, headers=None):
"""
Deletes an async SQL search or a stored synchronous SQL search. If the search
is still running, the API cancels it.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/delete-async-sql-search-api.html>`_
:arg id: The async search ID
"""
if id in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'id'.")
return await self.transport.perform_request(
"DELETE",
_make_path("_sql", "async", "delete", id),
params=params,
headers=headers,
)
@query_params("delimiter", "format", "keep_alive", "wait_for_completion_timeout")
async def get_async(self, id, params=None, headers=None):
"""
Returns the current status and available results for an async SQL search or
stored synchronous SQL search
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/get-async-sql-search-api.html>`_
:arg id: The async search ID
:arg delimiter: Separator for CSV results Default: ,
:arg format: Short version of the Accept header, e.g. json, yaml
:arg keep_alive: Retention period for the search and its results
Default: 5d
:arg wait_for_completion_timeout: Duration to wait for complete
results
"""
if id in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'id'.")
return await self.transport.perform_request(
"GET", _make_path("_sql", "async", id), params=params, headers=headers
)
@query_params()
async def get_async_status(self, id, params=None, headers=None):
"""
Returns the current status of an async SQL search or a stored synchronous SQL
search
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/get-async-sql-search-status-api.html>`_
:arg id: The async search ID
"""
if id in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'id'.")
return await self.transport.perform_request(
"GET",
_make_path("_sql", "async", "status", id),
params=params,
headers=headers,
)
+54
View File
@@ -71,3 +71,57 @@ class SqlClient(NamespacedClient):
params: Optional[MutableMapping[str, Any]] = ...,
headers: Optional[MutableMapping[str, str]] = ...,
) -> Any: ...
async def delete_async(
self,
id: Any,
*,
pretty: Optional[bool] = ...,
human: Optional[bool] = ...,
error_trace: Optional[bool] = ...,
format: Optional[str] = ...,
filter_path: Optional[Union[str, Collection[str]]] = ...,
request_timeout: Optional[Union[int, float]] = ...,
ignore: Optional[Union[int, Collection[int]]] = ...,
opaque_id: Optional[str] = ...,
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
params: Optional[MutableMapping[str, Any]] = ...,
headers: Optional[MutableMapping[str, str]] = ...,
) -> Any: ...
async def get_async(
self,
id: Any,
*,
delimiter: Optional[Any] = ...,
format: Optional[Any] = ...,
keep_alive: Optional[Any] = ...,
wait_for_completion_timeout: Optional[Any] = ...,
pretty: Optional[bool] = ...,
human: Optional[bool] = ...,
error_trace: Optional[bool] = ...,
filter_path: Optional[Union[str, Collection[str]]] = ...,
request_timeout: Optional[Union[int, float]] = ...,
ignore: Optional[Union[int, Collection[int]]] = ...,
opaque_id: Optional[str] = ...,
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
params: Optional[MutableMapping[str, Any]] = ...,
headers: Optional[MutableMapping[str, str]] = ...,
) -> Any: ...
async def get_async_status(
self,
id: Any,
*,
pretty: Optional[bool] = ...,
human: Optional[bool] = ...,
error_trace: Optional[bool] = ...,
format: Optional[str] = ...,
filter_path: Optional[Union[str, Collection[str]]] = ...,
request_timeout: Optional[Union[int, float]] = ...,
ignore: Optional[Union[int, Collection[int]]] = ...,
opaque_id: Optional[str] = ...,
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
params: Optional[MutableMapping[str, Any]] = ...,
headers: Optional[MutableMapping[str, str]] = ...,
) -> Any: ...
+1 -1
View File
@@ -1450,7 +1450,7 @@ class Elasticsearch(object):
"""
Allows to use the Mustache language to pre-render a search definition.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/search-template.html#_validating_templates>`_
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/render-search-template-api.html>`_
:arg body: The search definition template and its params
:arg id: The id of the stored search template
+4 -1
View File
@@ -184,7 +184,7 @@ class IlmClient(NamespacedClient):
"POST", "/_ilm/stop", params=params, headers=headers
)
@query_params()
@query_params("dry_run")
def migrate_to_data_tiers(self, body=None, params=None, headers=None):
"""
Migrates the indices and ILM policies away from custom node attribute
@@ -195,6 +195,9 @@ class IlmClient(NamespacedClient):
:arg body: Optionally specify a legacy index template name to
delete and optionally specify a node attribute name used for index shard
routing (defaults to "data")
:arg dry_run: If set to true it will simulate the migration,
providing a way to retrieve the ILM policies and indices that need to be
migrated. The default is false
"""
return self.transport.perform_request(
"POST",
+1
View File
@@ -195,6 +195,7 @@ class IlmClient(NamespacedClient):
self,
*,
body: Optional[Any] = ...,
dry_run: Optional[Any] = ...,
pretty: Optional[bool] = ...,
human: Optional[bool] = ...,
error_trace: Optional[bool] = ...,
+6 -1
View File
@@ -220,7 +220,12 @@ class RollupClient(NamespacedClient):
"""
Rollup an index
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/rollup-api.html>`_
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/xpack-rollup.html>`_
.. warning::
This API is **experimental** so may include breaking changes
or be removed in a future version
:arg index: The index to roll up
:arg rollup_index: The name of the rollup index to create
+9 -1
View File
@@ -69,7 +69,13 @@ class SnapshotClient(NamespacedClient):
headers=headers,
)
@query_params("ignore_unavailable", "index_details", "master_timeout", "verbose")
@query_params(
"ignore_unavailable",
"include_repository",
"index_details",
"master_timeout",
"verbose",
)
def get(self, repository, snapshot, params=None, headers=None):
"""
Returns information about a snapshot.
@@ -81,6 +87,8 @@ class SnapshotClient(NamespacedClient):
:arg ignore_unavailable: Whether to ignore unavailable
snapshots, defaults to false which means a SnapshotMissingException is
thrown
:arg include_repository: Whether to include the repository name
in the snapshot info. Defaults to true.
:arg index_details: Whether to include details of each index in
the snapshot, if those details are available. Defaults to false.
:arg master_timeout: Explicit operation timeout for connection
+1
View File
@@ -66,6 +66,7 @@ class SnapshotClient(NamespacedClient):
snapshot: Any,
*,
ignore_unavailable: Optional[Any] = ...,
include_repository: Optional[Any] = ...,
index_details: Optional[Any] = ...,
master_timeout: Optional[Any] = ...,
verbose: Optional[Any] = ...,
+64 -1
View File
@@ -15,7 +15,7 @@
# specific language governing permissions and limitations
# under the License.
from .utils import SKIP_IN_PATH, NamespacedClient, query_params
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
class SqlClient(NamespacedClient):
@@ -70,3 +70,66 @@ class SqlClient(NamespacedClient):
return self.transport.perform_request(
"POST", "/_sql/translate", params=params, headers=headers, body=body
)
@query_params()
def delete_async(self, id, params=None, headers=None):
"""
Deletes an async SQL search or a stored synchronous SQL search. If the search
is still running, the API cancels it.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/delete-async-sql-search-api.html>`_
:arg id: The async search ID
"""
if id in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'id'.")
return self.transport.perform_request(
"DELETE",
_make_path("_sql", "async", "delete", id),
params=params,
headers=headers,
)
@query_params("delimiter", "format", "keep_alive", "wait_for_completion_timeout")
def get_async(self, id, params=None, headers=None):
"""
Returns the current status and available results for an async SQL search or
stored synchronous SQL search
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/get-async-sql-search-api.html>`_
:arg id: The async search ID
:arg delimiter: Separator for CSV results Default: ,
:arg format: Short version of the Accept header, e.g. json, yaml
:arg keep_alive: Retention period for the search and its results
Default: 5d
:arg wait_for_completion_timeout: Duration to wait for complete
results
"""
if id in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'id'.")
return self.transport.perform_request(
"GET", _make_path("_sql", "async", id), params=params, headers=headers
)
@query_params()
def get_async_status(self, id, params=None, headers=None):
"""
Returns the current status of an async SQL search or a stored synchronous SQL
search
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/get-async-sql-search-status-api.html>`_
:arg id: The async search ID
"""
if id in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'id'.")
return self.transport.perform_request(
"GET",
_make_path("_sql", "async", "status", id),
params=params,
headers=headers,
)
+54
View File
@@ -71,3 +71,57 @@ class SqlClient(NamespacedClient):
params: Optional[MutableMapping[str, Any]] = ...,
headers: Optional[MutableMapping[str, str]] = ...,
) -> Any: ...
def delete_async(
self,
id: Any,
*,
pretty: Optional[bool] = ...,
human: Optional[bool] = ...,
error_trace: Optional[bool] = ...,
format: Optional[str] = ...,
filter_path: Optional[Union[str, Collection[str]]] = ...,
request_timeout: Optional[Union[int, float]] = ...,
ignore: Optional[Union[int, Collection[int]]] = ...,
opaque_id: Optional[str] = ...,
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
params: Optional[MutableMapping[str, Any]] = ...,
headers: Optional[MutableMapping[str, str]] = ...,
) -> Any: ...
def get_async(
self,
id: Any,
*,
delimiter: Optional[Any] = ...,
format: Optional[Any] = ...,
keep_alive: Optional[Any] = ...,
wait_for_completion_timeout: Optional[Any] = ...,
pretty: Optional[bool] = ...,
human: Optional[bool] = ...,
error_trace: Optional[bool] = ...,
filter_path: Optional[Union[str, Collection[str]]] = ...,
request_timeout: Optional[Union[int, float]] = ...,
ignore: Optional[Union[int, Collection[int]]] = ...,
opaque_id: Optional[str] = ...,
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
params: Optional[MutableMapping[str, Any]] = ...,
headers: Optional[MutableMapping[str, str]] = ...,
) -> Any: ...
def get_async_status(
self,
id: Any,
*,
pretty: Optional[bool] = ...,
human: Optional[bool] = ...,
error_trace: Optional[bool] = ...,
format: Optional[str] = ...,
filter_path: Optional[Union[str, Collection[str]]] = ...,
request_timeout: Optional[Union[int, float]] = ...,
ignore: Optional[Union[int, Collection[int]]] = ...,
opaque_id: Optional[str] = ...,
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
params: Optional[MutableMapping[str, Any]] = ...,
headers: Optional[MutableMapping[str, str]] = ...,
) -> Any: ...