diff --git a/elasticsearch/_async/client/__init__.pyi b/elasticsearch/_async/client/__init__.pyi index 1dda5afb..50d54623 100644 --- a/elasticsearch/_async/client/__init__.pyi +++ b/elasticsearch/_async/client/__init__.pyi @@ -45,6 +45,7 @@ from .remote import RemoteClient from .rollup import RollupClient from .searchable_snapshots import SearchableSnapshotsClient from .security import SecurityClient +from .shutdown import ShutdownClient from .slm import SlmClient from .snapshot import SnapshotClient from .sql import SqlClient @@ -89,6 +90,7 @@ class AsyncElasticsearch(object): rollup: RollupClient searchable_snapshots: SearchableSnapshotsClient security: SecurityClient + shutdown: ShutdownClient slm: SlmClient sql: SqlClient ssl: SslClient diff --git a/elasticsearch/_async/client/indices.py b/elasticsearch/_async/client/indices.py index c94a4fc6..cbf7da77 100644 --- a/elasticsearch/_async/client/indices.py +++ b/elasticsearch/_async/client/indices.py @@ -1646,3 +1646,80 @@ class IndicesClient(NamespacedClient): params=params, headers=headers, ) + + @query_params( + "allow_no_indices", + "expand_wildcards", + "flush", + "ignore_unavailable", + "run_expensive_tasks", + ) + async def disk_usage(self, index, params=None, headers=None): + """ + Analyzes the disk usage of each field of an index or data stream + + ``_ + + .. warning:: + + This API is **experimental** so may include breaking changes + or be removed in a future version + + :arg index: Comma-separated list of indices or data streams to + analyze the disk usage + :arg allow_no_indices: Whether to ignore if a wildcard indices + expression resolves into no concrete indices. (This includes `_all` + string or when no indices have been specified) + :arg expand_wildcards: Whether to expand wildcard expression to + concrete indices that are open, closed or both. Valid choices: open, + closed, hidden, none, all Default: open + :arg flush: Whether flush or not before analyzing the index disk + usage. Defaults to true + :arg ignore_unavailable: Whether specified concrete indices + should be ignored when unavailable (missing or closed) + :arg run_expensive_tasks: Must be set to [true] in order for the + task to be performed. Defaults to false. + """ + if index in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'index'.") + + return await self.transport.perform_request( + "POST", _make_path(index, "_disk_usage"), params=params, headers=headers + ) + + @query_params( + "allow_no_indices", "expand_wildcards", "fields", "ignore_unavailable" + ) + async def field_usage_stats(self, index, params=None, headers=None): + """ + Returns the field usage stats for each field of an index + + ``_ + + .. warning:: + + This API is **experimental** so may include breaking changes + or be removed in a future version + + :arg index: A comma-separated list of index names; use `_all` or + empty string to perform the operation on all indices + :arg allow_no_indices: Whether to ignore if a wildcard indices + expression resolves into no concrete indices. (This includes `_all` + string or when no indices have been specified) + :arg expand_wildcards: Whether to expand wildcard expression to + concrete indices that are open, closed or both. Valid choices: open, + closed, hidden, none, all Default: open + :arg fields: A comma-separated list of fields to include in the + stats if only a subset of fields should be returned (supports wildcards) + :arg ignore_unavailable: Whether specified concrete indices + should be ignored when unavailable (missing or closed) + """ + if index in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'index'.") + + return await self.transport.perform_request( + "GET", + _make_path(index, "_field_usage_stats"), + params=params, + headers=headers, + ) diff --git a/elasticsearch/_async/client/indices.pyi b/elasticsearch/_async/client/indices.pyi index 26e4aefe..e8f3a9fe 100644 --- a/elasticsearch/_async/client/indices.pyi +++ b/elasticsearch/_async/client/indices.pyi @@ -1205,3 +1205,46 @@ class IndicesClient(NamespacedClient): params: Optional[MutableMapping[str, Any]] = ..., headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... + async def disk_usage( + self, + index: Any, + *, + allow_no_indices: Optional[Any] = ..., + expand_wildcards: Optional[Any] = ..., + flush: Optional[Any] = ..., + ignore_unavailable: Optional[Any] = ..., + run_expensive_tasks: 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] = ..., + 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 field_usage_stats( + self, + index: Any, + *, + allow_no_indices: Optional[Any] = ..., + expand_wildcards: Optional[Any] = ..., + fields: Optional[Any] = ..., + ignore_unavailable: 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] = ..., + 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: ... diff --git a/elasticsearch/_async/client/ml.py b/elasticsearch/_async/client/ml.py index 5d932ff6..93d056cb 100644 --- a/elasticsearch/_async/client/ml.py +++ b/elasticsearch/_async/client/ml.py @@ -945,7 +945,9 @@ class MlClient(NamespacedClient): body=body, ) - @query_params() + @query_params( + "allow_no_indices", "expand_wildcards", "ignore_throttled", "ignore_unavailable" + ) async def put_job(self, job_id, body, params=None, headers=None): """ Instantiates an anomaly detection job. @@ -954,6 +956,17 @@ class MlClient(NamespacedClient): :arg job_id: The ID of the job to create :arg body: The job + :arg allow_no_indices: Ignore if the source indices expressions + resolves to no concrete indices (default: true). Only set if + datafeed_config is provided. + :arg expand_wildcards: Whether source index expressions should + get expanded to open or closed indices (default: open). Only set if + datafeed_config is provided. Valid choices: open, closed, hidden, none, + all + :arg ignore_throttled: Ignore indices that are marked as + throttled (default: true). Only set if datafeed_config is provided. + :arg ignore_unavailable: Ignore unavailable indexes (default: + false). Only set if datafeed_config is provided. """ for param in (job_id, body): if param in SKIP_IN_PATH: diff --git a/elasticsearch/_async/client/ml.pyi b/elasticsearch/_async/client/ml.pyi index 8524ce85..997fb46a 100644 --- a/elasticsearch/_async/client/ml.pyi +++ b/elasticsearch/_async/client/ml.pyi @@ -712,6 +712,10 @@ class MlClient(NamespacedClient): job_id: Any, *, body: Any, + allow_no_indices: Optional[Any] = ..., + expand_wildcards: Optional[Any] = ..., + ignore_throttled: Optional[Any] = ..., + ignore_unavailable: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., error_trace: Optional[bool] = ..., diff --git a/elasticsearch/client/__init__.pyi b/elasticsearch/client/__init__.pyi index 31d2728b..95a8315b 100644 --- a/elasticsearch/client/__init__.pyi +++ b/elasticsearch/client/__init__.pyi @@ -45,6 +45,7 @@ from .remote import RemoteClient from .rollup import RollupClient from .searchable_snapshots import SearchableSnapshotsClient from .security import SecurityClient +from .shutdown import ShutdownClient from .slm import SlmClient from .snapshot import SnapshotClient from .sql import SqlClient @@ -89,6 +90,7 @@ class Elasticsearch(object): rollup: RollupClient searchable_snapshots: SearchableSnapshotsClient security: SecurityClient + shutdown: ShutdownClient slm: SlmClient sql: SqlClient ssl: SslClient diff --git a/elasticsearch/client/indices.py b/elasticsearch/client/indices.py index 477d5402..69424813 100644 --- a/elasticsearch/client/indices.py +++ b/elasticsearch/client/indices.py @@ -1642,3 +1642,80 @@ class IndicesClient(NamespacedClient): params=params, headers=headers, ) + + @query_params( + "allow_no_indices", + "expand_wildcards", + "flush", + "ignore_unavailable", + "run_expensive_tasks", + ) + def disk_usage(self, index, params=None, headers=None): + """ + Analyzes the disk usage of each field of an index or data stream + + ``_ + + .. warning:: + + This API is **experimental** so may include breaking changes + or be removed in a future version + + :arg index: Comma-separated list of indices or data streams to + analyze the disk usage + :arg allow_no_indices: Whether to ignore if a wildcard indices + expression resolves into no concrete indices. (This includes `_all` + string or when no indices have been specified) + :arg expand_wildcards: Whether to expand wildcard expression to + concrete indices that are open, closed or both. Valid choices: open, + closed, hidden, none, all Default: open + :arg flush: Whether flush or not before analyzing the index disk + usage. Defaults to true + :arg ignore_unavailable: Whether specified concrete indices + should be ignored when unavailable (missing or closed) + :arg run_expensive_tasks: Must be set to [true] in order for the + task to be performed. Defaults to false. + """ + if index in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'index'.") + + return self.transport.perform_request( + "POST", _make_path(index, "_disk_usage"), params=params, headers=headers + ) + + @query_params( + "allow_no_indices", "expand_wildcards", "fields", "ignore_unavailable" + ) + def field_usage_stats(self, index, params=None, headers=None): + """ + Returns the field usage stats for each field of an index + + ``_ + + .. warning:: + + This API is **experimental** so may include breaking changes + or be removed in a future version + + :arg index: A comma-separated list of index names; use `_all` or + empty string to perform the operation on all indices + :arg allow_no_indices: Whether to ignore if a wildcard indices + expression resolves into no concrete indices. (This includes `_all` + string or when no indices have been specified) + :arg expand_wildcards: Whether to expand wildcard expression to + concrete indices that are open, closed or both. Valid choices: open, + closed, hidden, none, all Default: open + :arg fields: A comma-separated list of fields to include in the + stats if only a subset of fields should be returned (supports wildcards) + :arg ignore_unavailable: Whether specified concrete indices + should be ignored when unavailable (missing or closed) + """ + if index in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'index'.") + + return self.transport.perform_request( + "GET", + _make_path(index, "_field_usage_stats"), + params=params, + headers=headers, + ) diff --git a/elasticsearch/client/indices.pyi b/elasticsearch/client/indices.pyi index 1fb58973..41f6fa5c 100644 --- a/elasticsearch/client/indices.pyi +++ b/elasticsearch/client/indices.pyi @@ -1205,3 +1205,46 @@ class IndicesClient(NamespacedClient): params: Optional[MutableMapping[str, Any]] = ..., headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... + def disk_usage( + self, + index: Any, + *, + allow_no_indices: Optional[Any] = ..., + expand_wildcards: Optional[Any] = ..., + flush: Optional[Any] = ..., + ignore_unavailable: Optional[Any] = ..., + run_expensive_tasks: 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] = ..., + 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 field_usage_stats( + self, + index: Any, + *, + allow_no_indices: Optional[Any] = ..., + expand_wildcards: Optional[Any] = ..., + fields: Optional[Any] = ..., + ignore_unavailable: 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] = ..., + 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: ... diff --git a/elasticsearch/client/ml.py b/elasticsearch/client/ml.py index 131e1c80..f83e7be2 100644 --- a/elasticsearch/client/ml.py +++ b/elasticsearch/client/ml.py @@ -931,7 +931,9 @@ class MlClient(NamespacedClient): body=body, ) - @query_params() + @query_params( + "allow_no_indices", "expand_wildcards", "ignore_throttled", "ignore_unavailable" + ) def put_job(self, job_id, body, params=None, headers=None): """ Instantiates an anomaly detection job. @@ -940,6 +942,17 @@ class MlClient(NamespacedClient): :arg job_id: The ID of the job to create :arg body: The job + :arg allow_no_indices: Ignore if the source indices expressions + resolves to no concrete indices (default: true). Only set if + datafeed_config is provided. + :arg expand_wildcards: Whether source index expressions should + get expanded to open or closed indices (default: open). Only set if + datafeed_config is provided. Valid choices: open, closed, hidden, none, + all + :arg ignore_throttled: Ignore indices that are marked as + throttled (default: true). Only set if datafeed_config is provided. + :arg ignore_unavailable: Ignore unavailable indexes (default: + false). Only set if datafeed_config is provided. """ for param in (job_id, body): if param in SKIP_IN_PATH: diff --git a/elasticsearch/client/ml.pyi b/elasticsearch/client/ml.pyi index 9ebbedfe..edd9343b 100644 --- a/elasticsearch/client/ml.pyi +++ b/elasticsearch/client/ml.pyi @@ -712,6 +712,10 @@ class MlClient(NamespacedClient): job_id: Any, *, body: Any, + allow_no_indices: Optional[Any] = ..., + expand_wildcards: Optional[Any] = ..., + ignore_throttled: Optional[Any] = ..., + ignore_unavailable: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., error_trace: Optional[bool] = ..., diff --git a/elasticsearch/client/sql.py b/elasticsearch/client/sql.py index e8ddcdd3..96e2511c 100644 --- a/elasticsearch/client/sql.py +++ b/elasticsearch/client/sql.py @@ -15,7 +15,7 @@ # specific language governing permissions and limitations # under the License. -from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params +from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params class SqlClient(NamespacedClient):