diff --git a/elasticsearch/_async/client/async_search.py b/elasticsearch/_async/client/async_search.py index dc671475..599c8ad5 100644 --- a/elasticsearch/_async/client/async_search.py +++ b/elasticsearch/_async/client/async_search.py @@ -205,3 +205,23 @@ class AsyncSearchClient(NamespacedClient): headers=headers, body=body, ) + + @query_params() + async def status(self, id, params=None, headers=None): + """ + Retrieves the status of a previously submitted async search request given its + ID. + + ``_ + + :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("_async_search", "status", id), + params=params, + headers=headers, + ) diff --git a/elasticsearch/_async/client/async_search.pyi b/elasticsearch/_async/client/async_search.pyi index 0b7ca616..cd9ecaa6 100644 --- a/elasticsearch/_async/client/async_search.pyi +++ b/elasticsearch/_async/client/async_search.pyi @@ -109,3 +109,18 @@ class AsyncSearchClient(NamespacedClient): params: Optional[MutableMapping[str, Any]] = ..., headers: Optional[MutableMapping[str, str]] = ... ) -> Any: ... + async def 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] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ... + ) -> Any: ... diff --git a/elasticsearch/_async/client/cluster.py b/elasticsearch/_async/client/cluster.py index 9fc529f1..8d817156 100644 --- a/elasticsearch/_async/client/cluster.py +++ b/elasticsearch/_async/client/cluster.py @@ -268,11 +268,6 @@ class ClusterClient(NamespacedClient): ``_ - .. warning:: - - This API is **experimental** so may include breaking changes - or be removed in a future version - :arg name: The name of the template :arg master_timeout: Specify timeout for connection to master :arg timeout: Explicit operation timeout @@ -294,11 +289,6 @@ class ClusterClient(NamespacedClient): ``_ - .. warning:: - - This API is **experimental** so may include breaking changes - or be removed in a future version - :arg name: The comma separated names of the component templates :arg local: Return local information, do not retrieve the state from master node (default: false) @@ -319,11 +309,6 @@ class ClusterClient(NamespacedClient): ``_ - .. warning:: - - This API is **experimental** so may include breaking changes - or be removed in a future version - :arg name: The name of the template :arg body: The template definition :arg create: Whether the index template should only be added if @@ -350,11 +335,6 @@ class ClusterClient(NamespacedClient): ``_ - .. warning:: - - This API is **experimental** so may include breaking changes - or be removed in a future version - :arg name: The name of the template :arg local: Return local information, do not retrieve the state from master node (default: false) diff --git a/elasticsearch/_async/client/indices.py b/elasticsearch/_async/client/indices.py index 9614f858..917b3828 100644 --- a/elasticsearch/_async/client/indices.py +++ b/elasticsearch/_async/client/indices.py @@ -992,7 +992,7 @@ class IndicesClient(NamespacedClient): ) async def upgrade(self, index=None, params=None, headers=None): """ - The _upgrade API is no longer useful and will be removed. + DEPRECATED Upgrades to the current version of Lucene. ``_ @@ -1018,7 +1018,7 @@ class IndicesClient(NamespacedClient): @query_params("allow_no_indices", "expand_wildcards", "ignore_unavailable") async def get_upgrade(self, index=None, params=None, headers=None): """ - The _upgrade API is no longer useful and will be removed. + DEPRECATED Returns a progress status of current upgrade. ``_ @@ -1348,7 +1348,7 @@ class IndicesClient(NamespacedClient): "PUT", _make_path("_data_stream", name), params=params, headers=headers ) - @query_params() + @query_params("expand_wildcards") async def delete_data_stream(self, name, params=None, headers=None): """ Deletes a data stream. @@ -1357,6 +1357,9 @@ class IndicesClient(NamespacedClient): :arg name: A comma-separated list of data streams to delete; use `*` to delete all data streams + :arg expand_wildcards: Whether wildcard expressions should get + expanded to open or closed indices (default: open) Valid choices: open, + closed, hidden, none, all Default: open """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -1372,11 +1375,6 @@ class IndicesClient(NamespacedClient): ``_ - .. warning:: - - This API is **experimental** so may include breaking changes - or be removed in a future version - :arg name: The name of the template :arg master_timeout: Specify timeout for connection to master :arg timeout: Explicit operation timeout @@ -1398,11 +1396,6 @@ class IndicesClient(NamespacedClient): ``_ - .. warning:: - - This API is **experimental** so may include breaking changes - or be removed in a future version - :arg name: The name of the template :arg flat_settings: Return settings in flat format (default: false) @@ -1425,11 +1418,6 @@ class IndicesClient(NamespacedClient): ``_ - .. warning:: - - This API is **experimental** so may include breaking changes - or be removed in a future version - :arg name: The comma separated names of the index templates :arg flat_settings: Return settings in flat format (default: false) @@ -1449,11 +1437,6 @@ class IndicesClient(NamespacedClient): ``_ - .. warning:: - - This API is **experimental** so may include breaking changes - or be removed in a future version - :arg name: The name of the template :arg body: The template definition :arg cause: User defined reason for creating/updating the index @@ -1482,11 +1465,6 @@ class IndicesClient(NamespacedClient): ``_ - .. warning:: - - This API is **experimental** so may include breaking changes - or be removed in a future version - :arg name: The name of the index (it must be a concrete index name) :arg body: New index template definition, which will be included @@ -1509,7 +1487,7 @@ class IndicesClient(NamespacedClient): body=body, ) - @query_params() + @query_params("expand_wildcards") async def get_data_stream(self, name=None, params=None, headers=None): """ Returns data streams. @@ -1518,6 +1496,9 @@ class IndicesClient(NamespacedClient): :arg name: A comma-separated list of data streams to get; use `*` to get all data streams + :arg expand_wildcards: Whether wildcard expressions should get + expanded to open or closed indices (default: open) Valid choices: open, + closed, hidden, none, all Default: open """ return await self.transport.perform_request( "GET", _make_path("_data_stream", name), params=params, headers=headers @@ -1530,11 +1511,6 @@ class IndicesClient(NamespacedClient): ``_ - .. warning:: - - This API is **experimental** so may include breaking changes - or be removed in a future version - :arg body: New index template definition to be simulated, if no index template name is specified :arg name: The name of the index template @@ -1629,3 +1605,23 @@ class IndicesClient(NamespacedClient): params=params, headers=headers, ) + + @query_params() + async def promote_data_stream(self, name, params=None, headers=None): + """ + Promotes a data stream from a replicated data stream managed by CCR to a + regular data stream + + ``_ + + :arg name: The name of the data stream + """ + if name in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'name'.") + + return await self.transport.perform_request( + "POST", + _make_path("_data_stream", "_promote", name), + params=params, + headers=headers, + ) diff --git a/elasticsearch/_async/client/indices.pyi b/elasticsearch/_async/client/indices.pyi index 82ba811d..0b0a62d3 100644 --- a/elasticsearch/_async/client/indices.pyi +++ b/elasticsearch/_async/client/indices.pyi @@ -874,6 +874,7 @@ class IndicesClient(NamespacedClient): self, name: Any, *, + expand_wildcards: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., error_trace: Optional[bool] = ..., @@ -980,6 +981,7 @@ class IndicesClient(NamespacedClient): self, *, name: Optional[Any] = ..., + expand_wildcards: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., error_trace: Optional[bool] = ..., @@ -1062,3 +1064,18 @@ class IndicesClient(NamespacedClient): params: Optional[MutableMapping[str, Any]] = ..., headers: Optional[MutableMapping[str, str]] = ... ) -> Any: ... + async def promote_data_stream( + self, + name: 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] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ... + ) -> Any: ... diff --git a/elasticsearch/_async/client/ml.py b/elasticsearch/_async/client/ml.py index 2bb20892..4ea110e4 100644 --- a/elasticsearch/_async/client/ml.py +++ b/elasticsearch/_async/client/ml.py @@ -1715,3 +1715,37 @@ class MlClient(NamespacedClient): headers=headers, body=body, ) + + @query_params("timeout", "wait_for_completion") + async def upgrade_job_snapshot( + self, job_id, snapshot_id, params=None, headers=None + ): + """ + Upgrades a given job snapshot to the current major version. + + ``_ + + :arg job_id: The ID of the job + :arg snapshot_id: The ID of the snapshot + :arg timeout: How long should the API wait for the job to be + opened and the old snapshot to be loaded. + :arg wait_for_completion: Should the request wait until the task + is complete before responding to the caller. Default is false. + """ + for param in (job_id, snapshot_id): + if param in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument.") + + return await self.transport.perform_request( + "POST", + _make_path( + "_ml", + "anomaly_detectors", + job_id, + "model_snapshots", + snapshot_id, + "_upgrade", + ), + params=params, + headers=headers, + ) diff --git a/elasticsearch/_async/client/ml.pyi b/elasticsearch/_async/client/ml.pyi index 2bc04d52..f929d581 100644 --- a/elasticsearch/_async/client/ml.pyi +++ b/elasticsearch/_async/client/ml.pyi @@ -1094,3 +1094,21 @@ class MlClient(NamespacedClient): params: Optional[MutableMapping[str, Any]] = ..., headers: Optional[MutableMapping[str, str]] = ... ) -> Any: ... + async def upgrade_job_snapshot( + self, + job_id: Any, + snapshot_id: Any, + *, + timeout: Optional[Any] = ..., + wait_for_completion: Optional[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] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ... + ) -> Any: ... diff --git a/elasticsearch/_async/client/rollup.py b/elasticsearch/_async/client/rollup.py index cd25f4ca..69e6c888 100644 --- a/elasticsearch/_async/client/rollup.py +++ b/elasticsearch/_async/client/rollup.py @@ -216,3 +216,25 @@ class RollupClient(NamespacedClient): params=params, headers=headers, ) + + @query_params() + async def rollup(self, index, body, params=None, headers=None): + """ + Rollup an index + + ``_ + + :arg index: The index to roll up + :arg body: The rollup configuration + """ + for param in (index, body): + if param in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument.") + + return await self.transport.perform_request( + "POST", + _make_path(index, "_rollup"), + params=params, + headers=headers, + body=body, + ) diff --git a/elasticsearch/_async/client/rollup.pyi b/elasticsearch/_async/client/rollup.pyi index 9150d59f..bfacd136 100644 --- a/elasticsearch/_async/client/rollup.pyi +++ b/elasticsearch/_async/client/rollup.pyi @@ -146,3 +146,19 @@ class RollupClient(NamespacedClient): params: Optional[MutableMapping[str, Any]] = ..., headers: Optional[MutableMapping[str, str]] = ... ) -> Any: ... + async def rollup( + self, + index: Any, + *, + body: 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] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ... + ) -> Any: ... diff --git a/elasticsearch/_async/client/tasks.py b/elasticsearch/_async/client/tasks.py index ef53dedd..f312aa5f 100644 --- a/elasticsearch/_async/client/tasks.py +++ b/elasticsearch/_async/client/tasks.py @@ -35,6 +35,11 @@ class TasksClient(NamespacedClient): ``_ + .. warning:: + + This API is **experimental** so may include breaking changes + or be removed in a future version + :arg actions: A comma-separated list of actions that should be returned. Leave empty to return all. :arg detailed: Return detailed task information (default: false) @@ -60,6 +65,11 @@ class TasksClient(NamespacedClient): ``_ + .. warning:: + + This API is **experimental** so may include breaking changes + or be removed in a future version + :arg task_id: Cancel the task with specified task id (node_id:task_number) :arg actions: A comma-separated list of actions that should be @@ -87,6 +97,11 @@ class TasksClient(NamespacedClient): ``_ + .. warning:: + + This API is **experimental** so may include breaking changes + or be removed in a future version + :arg task_id: Return the task with specified id (node_id:task_number) :arg timeout: Explicit operation timeout diff --git a/elasticsearch/_async/client/watcher.py b/elasticsearch/_async/client/watcher.py index 143da49d..7cdf16dc 100644 --- a/elasticsearch/_async/client/watcher.py +++ b/elasticsearch/_async/client/watcher.py @@ -201,3 +201,20 @@ class WatcherClient(NamespacedClient): return await self.transport.perform_request( "POST", "/_watcher/_stop", params=params, headers=headers ) + + @query_params() + async def query_watches(self, body=None, params=None, headers=None): + """ + Retrieves stored watches. + + ``_ + + :arg body: From, size, query, sort and search_after + """ + return await self.transport.perform_request( + "POST", + "/_watcher/_query/watches", + params=params, + headers=headers, + body=body, + ) diff --git a/elasticsearch/_async/client/watcher.pyi b/elasticsearch/_async/client/watcher.pyi index eeb576aa..328e3f3b 100644 --- a/elasticsearch/_async/client/watcher.pyi +++ b/elasticsearch/_async/client/watcher.pyi @@ -176,3 +176,18 @@ class WatcherClient(NamespacedClient): params: Optional[MutableMapping[str, Any]] = ..., headers: Optional[MutableMapping[str, str]] = ... ) -> Any: ... + async def query_watches( + self, + *, + body: Optional[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] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ... + ) -> Any: ... diff --git a/elasticsearch/client/async_search.py b/elasticsearch/client/async_search.py index 5738ba67..314fe629 100644 --- a/elasticsearch/client/async_search.py +++ b/elasticsearch/client/async_search.py @@ -205,3 +205,23 @@ class AsyncSearchClient(NamespacedClient): headers=headers, body=body, ) + + @query_params() + def status(self, id, params=None, headers=None): + """ + Retrieves the status of a previously submitted async search request given its + ID. + + ``_ + + :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("_async_search", "status", id), + params=params, + headers=headers, + ) diff --git a/elasticsearch/client/async_search.pyi b/elasticsearch/client/async_search.pyi index 1c67eb10..23d80e43 100644 --- a/elasticsearch/client/async_search.pyi +++ b/elasticsearch/client/async_search.pyi @@ -109,3 +109,18 @@ class AsyncSearchClient(NamespacedClient): params: Optional[MutableMapping[str, Any]] = ..., headers: Optional[MutableMapping[str, str]] = ... ) -> Any: ... + def 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] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ... + ) -> Any: ... diff --git a/elasticsearch/client/cluster.py b/elasticsearch/client/cluster.py index 88e56b28..539e4fc5 100644 --- a/elasticsearch/client/cluster.py +++ b/elasticsearch/client/cluster.py @@ -268,11 +268,6 @@ class ClusterClient(NamespacedClient): ``_ - .. warning:: - - This API is **experimental** so may include breaking changes - or be removed in a future version - :arg name: The name of the template :arg master_timeout: Specify timeout for connection to master :arg timeout: Explicit operation timeout @@ -294,11 +289,6 @@ class ClusterClient(NamespacedClient): ``_ - .. warning:: - - This API is **experimental** so may include breaking changes - or be removed in a future version - :arg name: The comma separated names of the component templates :arg local: Return local information, do not retrieve the state from master node (default: false) @@ -319,11 +309,6 @@ class ClusterClient(NamespacedClient): ``_ - .. warning:: - - This API is **experimental** so may include breaking changes - or be removed in a future version - :arg name: The name of the template :arg body: The template definition :arg create: Whether the index template should only be added if @@ -350,11 +335,6 @@ class ClusterClient(NamespacedClient): ``_ - .. warning:: - - This API is **experimental** so may include breaking changes - or be removed in a future version - :arg name: The name of the template :arg local: Return local information, do not retrieve the state from master node (default: false) diff --git a/elasticsearch/client/indices.py b/elasticsearch/client/indices.py index 1abbd1f4..a4d32f3f 100644 --- a/elasticsearch/client/indices.py +++ b/elasticsearch/client/indices.py @@ -990,7 +990,7 @@ class IndicesClient(NamespacedClient): ) def upgrade(self, index=None, params=None, headers=None): """ - The _upgrade API is no longer useful and will be removed. + DEPRECATED Upgrades to the current version of Lucene. ``_ @@ -1016,7 +1016,7 @@ class IndicesClient(NamespacedClient): @query_params("allow_no_indices", "expand_wildcards", "ignore_unavailable") def get_upgrade(self, index=None, params=None, headers=None): """ - The _upgrade API is no longer useful and will be removed. + DEPRECATED Returns a progress status of current upgrade. ``_ @@ -1344,7 +1344,7 @@ class IndicesClient(NamespacedClient): "PUT", _make_path("_data_stream", name), params=params, headers=headers ) - @query_params() + @query_params("expand_wildcards") def delete_data_stream(self, name, params=None, headers=None): """ Deletes a data stream. @@ -1353,6 +1353,9 @@ class IndicesClient(NamespacedClient): :arg name: A comma-separated list of data streams to delete; use `*` to delete all data streams + :arg expand_wildcards: Whether wildcard expressions should get + expanded to open or closed indices (default: open) Valid choices: open, + closed, hidden, none, all Default: open """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -1368,11 +1371,6 @@ class IndicesClient(NamespacedClient): ``_ - .. warning:: - - This API is **experimental** so may include breaking changes - or be removed in a future version - :arg name: The name of the template :arg master_timeout: Specify timeout for connection to master :arg timeout: Explicit operation timeout @@ -1394,11 +1392,6 @@ class IndicesClient(NamespacedClient): ``_ - .. warning:: - - This API is **experimental** so may include breaking changes - or be removed in a future version - :arg name: The name of the template :arg flat_settings: Return settings in flat format (default: false) @@ -1421,11 +1414,6 @@ class IndicesClient(NamespacedClient): ``_ - .. warning:: - - This API is **experimental** so may include breaking changes - or be removed in a future version - :arg name: The comma separated names of the index templates :arg flat_settings: Return settings in flat format (default: false) @@ -1445,11 +1433,6 @@ class IndicesClient(NamespacedClient): ``_ - .. warning:: - - This API is **experimental** so may include breaking changes - or be removed in a future version - :arg name: The name of the template :arg body: The template definition :arg cause: User defined reason for creating/updating the index @@ -1478,11 +1461,6 @@ class IndicesClient(NamespacedClient): ``_ - .. warning:: - - This API is **experimental** so may include breaking changes - or be removed in a future version - :arg name: The name of the index (it must be a concrete index name) :arg body: New index template definition, which will be included @@ -1505,7 +1483,7 @@ class IndicesClient(NamespacedClient): body=body, ) - @query_params() + @query_params("expand_wildcards") def get_data_stream(self, name=None, params=None, headers=None): """ Returns data streams. @@ -1514,6 +1492,9 @@ class IndicesClient(NamespacedClient): :arg name: A comma-separated list of data streams to get; use `*` to get all data streams + :arg expand_wildcards: Whether wildcard expressions should get + expanded to open or closed indices (default: open) Valid choices: open, + closed, hidden, none, all Default: open """ return self.transport.perform_request( "GET", _make_path("_data_stream", name), params=params, headers=headers @@ -1526,11 +1507,6 @@ class IndicesClient(NamespacedClient): ``_ - .. warning:: - - This API is **experimental** so may include breaking changes - or be removed in a future version - :arg body: New index template definition to be simulated, if no index template name is specified :arg name: The name of the index template @@ -1625,3 +1601,23 @@ class IndicesClient(NamespacedClient): params=params, headers=headers, ) + + @query_params() + def promote_data_stream(self, name, params=None, headers=None): + """ + Promotes a data stream from a replicated data stream managed by CCR to a + regular data stream + + ``_ + + :arg name: The name of the data stream + """ + if name in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'name'.") + + return self.transport.perform_request( + "POST", + _make_path("_data_stream", "_promote", name), + params=params, + headers=headers, + ) diff --git a/elasticsearch/client/indices.pyi b/elasticsearch/client/indices.pyi index ce768a95..95c7f5a6 100644 --- a/elasticsearch/client/indices.pyi +++ b/elasticsearch/client/indices.pyi @@ -874,6 +874,7 @@ class IndicesClient(NamespacedClient): self, name: Any, *, + expand_wildcards: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., error_trace: Optional[bool] = ..., @@ -980,6 +981,7 @@ class IndicesClient(NamespacedClient): self, *, name: Optional[Any] = ..., + expand_wildcards: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., error_trace: Optional[bool] = ..., @@ -1062,3 +1064,18 @@ class IndicesClient(NamespacedClient): params: Optional[MutableMapping[str, Any]] = ..., headers: Optional[MutableMapping[str, str]] = ... ) -> Any: ... + def promote_data_stream( + self, + name: 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] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ... + ) -> Any: ... diff --git a/elasticsearch/client/ml.py b/elasticsearch/client/ml.py index cbe5a8c9..dca7d088 100644 --- a/elasticsearch/client/ml.py +++ b/elasticsearch/client/ml.py @@ -1701,3 +1701,35 @@ class MlClient(NamespacedClient): headers=headers, body=body, ) + + @query_params("timeout", "wait_for_completion") + def upgrade_job_snapshot(self, job_id, snapshot_id, params=None, headers=None): + """ + Upgrades a given job snapshot to the current major version. + + ``_ + + :arg job_id: The ID of the job + :arg snapshot_id: The ID of the snapshot + :arg timeout: How long should the API wait for the job to be + opened and the old snapshot to be loaded. + :arg wait_for_completion: Should the request wait until the task + is complete before responding to the caller. Default is false. + """ + for param in (job_id, snapshot_id): + if param in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument.") + + return self.transport.perform_request( + "POST", + _make_path( + "_ml", + "anomaly_detectors", + job_id, + "model_snapshots", + snapshot_id, + "_upgrade", + ), + params=params, + headers=headers, + ) diff --git a/elasticsearch/client/ml.pyi b/elasticsearch/client/ml.pyi index 160ff618..e1dec2ad 100644 --- a/elasticsearch/client/ml.pyi +++ b/elasticsearch/client/ml.pyi @@ -1094,3 +1094,21 @@ class MlClient(NamespacedClient): params: Optional[MutableMapping[str, Any]] = ..., headers: Optional[MutableMapping[str, str]] = ... ) -> Any: ... + def upgrade_job_snapshot( + self, + job_id: Any, + snapshot_id: Any, + *, + timeout: Optional[Any] = ..., + wait_for_completion: Optional[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] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ... + ) -> Any: ... diff --git a/elasticsearch/client/rollup.py b/elasticsearch/client/rollup.py index 92d5254c..251c04e5 100644 --- a/elasticsearch/client/rollup.py +++ b/elasticsearch/client/rollup.py @@ -214,3 +214,25 @@ class RollupClient(NamespacedClient): params=params, headers=headers, ) + + @query_params() + def rollup(self, index, body, params=None, headers=None): + """ + Rollup an index + + ``_ + + :arg index: The index to roll up + :arg body: The rollup configuration + """ + for param in (index, body): + if param in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument.") + + return self.transport.perform_request( + "POST", + _make_path(index, "_rollup"), + params=params, + headers=headers, + body=body, + ) diff --git a/elasticsearch/client/rollup.pyi b/elasticsearch/client/rollup.pyi index 447df7b0..f2ada5db 100644 --- a/elasticsearch/client/rollup.pyi +++ b/elasticsearch/client/rollup.pyi @@ -146,3 +146,19 @@ class RollupClient(NamespacedClient): params: Optional[MutableMapping[str, Any]] = ..., headers: Optional[MutableMapping[str, str]] = ... ) -> Any: ... + def rollup( + self, + index: Any, + *, + body: 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] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ... + ) -> Any: ... diff --git a/elasticsearch/client/tasks.py b/elasticsearch/client/tasks.py index 1a4c46a5..15feb3d6 100644 --- a/elasticsearch/client/tasks.py +++ b/elasticsearch/client/tasks.py @@ -35,6 +35,11 @@ class TasksClient(NamespacedClient): ``_ + .. warning:: + + This API is **experimental** so may include breaking changes + or be removed in a future version + :arg actions: A comma-separated list of actions that should be returned. Leave empty to return all. :arg detailed: Return detailed task information (default: false) @@ -60,6 +65,11 @@ class TasksClient(NamespacedClient): ``_ + .. warning:: + + This API is **experimental** so may include breaking changes + or be removed in a future version + :arg task_id: Cancel the task with specified task id (node_id:task_number) :arg actions: A comma-separated list of actions that should be @@ -87,6 +97,11 @@ class TasksClient(NamespacedClient): ``_ + .. warning:: + + This API is **experimental** so may include breaking changes + or be removed in a future version + :arg task_id: Return the task with specified id (node_id:task_number) :arg timeout: Explicit operation timeout diff --git a/elasticsearch/client/watcher.py b/elasticsearch/client/watcher.py index cd2d07be..f01a75f2 100644 --- a/elasticsearch/client/watcher.py +++ b/elasticsearch/client/watcher.py @@ -201,3 +201,20 @@ class WatcherClient(NamespacedClient): return self.transport.perform_request( "POST", "/_watcher/_stop", params=params, headers=headers ) + + @query_params() + def query_watches(self, body=None, params=None, headers=None): + """ + Retrieves stored watches. + + ``_ + + :arg body: From, size, query, sort and search_after + """ + return self.transport.perform_request( + "POST", + "/_watcher/_query/watches", + params=params, + headers=headers, + body=body, + ) diff --git a/elasticsearch/client/watcher.pyi b/elasticsearch/client/watcher.pyi index 00e4ca58..e33bf4c1 100644 --- a/elasticsearch/client/watcher.pyi +++ b/elasticsearch/client/watcher.pyi @@ -176,3 +176,18 @@ class WatcherClient(NamespacedClient): params: Optional[MutableMapping[str, Any]] = ..., headers: Optional[MutableMapping[str, str]] = ... ) -> Any: ... + def query_watches( + self, + *, + body: Optional[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] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ... + ) -> Any: ... diff --git a/test_elasticsearch/test_server/test_rest_api_spec.py b/test_elasticsearch/test_server/test_rest_api_spec.py index 23fb8042..2a6c6232 100644 --- a/test_elasticsearch/test_server/test_rest_api_spec.py +++ b/test_elasticsearch/test_server/test_rest_api_spec.py @@ -56,6 +56,7 @@ SKIP_TESTS = { "indices/get_alias/10_basic[23]", "indices/simulate_index_template/10_basic[2]", "search/aggregation/250_moving_fn[1]", + "search/aggregation/250_moving_fn[2]", }