diff --git a/elasticsearch/_async/client/cat.py b/elasticsearch/_async/client/cat.py index f45c87a06..6f5cda39d 100644 --- a/elasticsearch/_async/client/cat.py +++ b/elasticsearch/_async/client/cat.py @@ -1266,15 +1266,19 @@ async def ml_trained_models( ``_ - :param model_id: The ID of the trained models stats to fetch - :param allow_no_match: Whether to ignore if a wildcard expression matches no - trained models. (This includes `_all` string or when no trained models have - been specified) - :param bytes: The unit in which to display byte values + :param model_id: A unique identifier for the trained model. + :param allow_no_match: Specifies what to do when the request: contains wildcard + expressions and there are no models that match; contains the `_all` string + or no identifiers and there are no matches; contains wildcard expressions + and there are only partial matches. If `true`, the API returns an empty array + when there are no matches and the subset of results when there are partial + matches. If `false`, the API returns a 404 status code when there are no + matches or only partial matches. + :param bytes: The unit used to display byte values. :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. - :param from_: skips a number of trained models - :param h: Comma-separated list of column names to display + :param from_: Skips the specified number of transforms. + :param h: A comma-separated list of column names to display. :param help: When set to `true` will output available columns. This option can't be combined with any other query string option. :param local: If `true`, the request computes the list of selected nodes from @@ -1282,8 +1286,9 @@ async def ml_trained_models( from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node. :param master_timeout: Period to wait for a connection to the master node. - :param s: Comma-separated list of column names or column aliases to sort by - :param size: specifies a max number of trained models to get + :param s: A comma-separated list of column names or aliases used to sort the + response. + :param size: The maximum number of transforms to display. :param v: When set to `true` will enable verbose output. """ if model_id not in SKIP_IN_PATH: @@ -1807,8 +1812,10 @@ async def segments( ``_ - :param index: A comma-separated list of index names to limit the returned information - :param bytes: The unit in which to display byte values + :param index: A comma-separated list of data streams, indices, and aliases used + to limit the request. Supports wildcards (`*`). To target all data streams + and indices, omit this parameter or use `*` or `_all`. + :param bytes: The unit used to display byte values. :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. :param h: List of columns to appear in the response. Supports simple wildcards. @@ -1887,8 +1894,10 @@ async def shards( ``_ - :param index: A comma-separated list of index names to limit the returned information - :param bytes: The unit in which to display byte values + :param index: A comma-separated list of data streams, indices, and aliases used + to limit the request. Supports wildcards (`*`). To target all data streams + and indices, omit this parameter or use `*` or `_all`. + :param bytes: The unit used to display byte values. :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. :param h: List of columns to appear in the response. Supports simple wildcards. @@ -1967,13 +1976,16 @@ async def snapshots( ``_ - :param repository: Name of repository from which to fetch the snapshot information + :param repository: A comma-separated list of snapshot repositories used to limit + the request. Accepts wildcard expressions. `_all` returns all repositories. + If any repository fails during the request, Elasticsearch returns an error. :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. :param h: List of columns to appear in the response. Supports simple wildcards. :param help: When set to `true` will output available columns. This option can't be combined with any other query string option. - :param ignore_unavailable: Set to true to ignore unavailable snapshots + :param ignore_unavailable: If `true`, the response does not include information + from unavailable snapshots. :param local: If `true`, the request computes the list of selected nodes from the local cluster state. If `false` the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating @@ -2037,7 +2049,7 @@ async def tasks( t.Union["t.Literal[-1]", "t.Literal[0]", str] ] = None, node_id: t.Optional[t.Union[t.List[str], t.Tuple[str, ...]]] = None, - parent_task: t.Optional[int] = None, + parent_task_id: t.Optional[str] = None, pretty: t.Optional[bool] = None, s: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, v: t.Optional[bool] = None, @@ -2048,9 +2060,9 @@ async def tasks( ``_ - :param actions: A comma-separated list of actions that should be returned. Leave - empty to return all. - :param detailed: Return detailed task information (default: false) + :param actions: The task action names, which are used to limit the response. + :param detailed: If `true`, the response includes detailed information about + shard recoveries. :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. :param h: List of columns to appear in the response. Supports simple wildcards. @@ -2061,8 +2073,9 @@ async def tasks( from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node. :param master_timeout: Period to wait for a connection to the master node. - :param node_id: - :param parent_task: + :param node_id: Unique node identifiers, which are used to limit the response. + :param parent_task_id: The parent task identifier, which is used to limit the + response. :param s: List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting `:asc` or `:desc` as a suffix to the column name. @@ -2092,8 +2105,8 @@ async def tasks( __query["master_timeout"] = master_timeout if node_id is not None: __query["node_id"] = node_id - if parent_task is not None: - __query["parent_task"] = parent_task + if parent_task_id is not None: + __query["parent_task_id"] = parent_task_id if pretty is not None: __query["pretty"] = pretty if s is not None: @@ -2131,7 +2144,8 @@ async def templates( ``_ - :param name: A pattern that returned template names must match + :param name: The name of the template to return. Accepts wildcard expressions. + If omitted, all templates are returned. :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. :param h: List of columns to appear in the response. Supports simple wildcards. @@ -2211,8 +2225,8 @@ async def thread_pool( ``_ - :param thread_pool_patterns: List of thread pool names used to limit the request. - Accepts wildcard expressions. + :param thread_pool_patterns: A comma-separated list of thread pool names used + to limit the request. Accepts wildcard expressions. :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. :param h: List of columns to appear in the response. Supports simple wildcards. @@ -2226,7 +2240,7 @@ async def thread_pool( :param s: List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting `:asc` or `:desc` as a suffix to the column name. - :param time: Unit used to display time values. + :param time: The unit used to display time values. :param v: When set to `true` will enable verbose output. """ if thread_pool_patterns not in SKIP_IN_PATH: @@ -2341,14 +2355,19 @@ async def transforms( ``_ - :param transform_id: The id of the transform for which to get stats. '_all' or - '*' implies all transforms - :param allow_no_match: Whether to ignore if a wildcard expression matches no - transforms. (This includes `_all` string or when no transforms have been - specified) + :param transform_id: A transform identifier or a wildcard expression. If you + do not specify one of these options, the API returns information for all + transforms. + :param allow_no_match: Specifies what to do when the request: contains wildcard + expressions and there are no transforms that match; contains the `_all` string + or no identifiers and there are no matches; contains wildcard expressions + and there are only partial matches. If `true`, it returns an empty transforms + array when there are no matches and the subset of results when there are + partial matches. If `false`, the request returns a 404 status code when there + are no matches or only partial matches. :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. - :param from_: skips a number of transform configs, defaults to 0 + :param from_: Skips the specified number of transforms. :param h: Comma-separated list of column names to display. :param help: When set to `true` will output available columns. This option can't be combined with any other query string option. @@ -2359,8 +2378,8 @@ async def transforms( :param master_timeout: Period to wait for a connection to the master node. :param s: Comma-separated list of column names or column aliases used to sort the response. - :param size: specifies a max number of transforms to get, defaults to 100 - :param time: Unit used to display time values. + :param size: The maximum number of transforms to obtain. + :param time: The unit used to display time values. :param v: When set to `true` will enable verbose output. """ if transform_id not in SKIP_IN_PATH: diff --git a/elasticsearch/_async/client/cluster.py b/elasticsearch/_async/client/cluster.py index 50527b8e8..0d6fc9771 100644 --- a/elasticsearch/_async/client/cluster.py +++ b/elasticsearch/_async/client/cluster.py @@ -470,6 +470,62 @@ async def health( "GET", __path, params=__query, headers=__headers ) + @_rewrite_parameters() + async def info( + self, + *, + target: t.Union[ + t.Union[ + "t.Literal['_all', 'http', 'ingest', 'script', 'thread_pool']", str + ], + t.Union[ + t.List[ + t.Union[ + "t.Literal['_all', 'http', 'ingest', 'script', 'thread_pool']", + str, + ] + ], + t.Tuple[ + t.Union[ + "t.Literal['_all', 'http', 'ingest', 'script', 'thread_pool']", + str, + ], + ..., + ], + ], + ], + error_trace: t.Optional[bool] = None, + filter_path: t.Optional[ + t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] + ] = None, + human: t.Optional[bool] = None, + pretty: t.Optional[bool] = None, + ) -> ObjectApiResponse[t.Any]: + """ + Returns different information about the cluster. + + ``_ + + :param target: Limits the information returned to the specific target. Supports + a comma-separated list, such as http,ingest. + """ + if target in SKIP_IN_PATH: + raise ValueError("Empty value passed for parameter 'target'") + __path = f"/_info/{_quote(target)}" + __query: t.Dict[str, t.Any] = {} + if error_trace is not None: + __query["error_trace"] = error_trace + if filter_path is not None: + __query["filter_path"] = filter_path + if human is not None: + __query["human"] = human + if pretty is not None: + __query["pretty"] = pretty + __headers = {"accept": "application/json"} + return await self.perform_request( # type: ignore[return-value] + "GET", __path, params=__query, headers=__headers + ) + @_rewrite_parameters() async def pending_tasks( self, @@ -491,9 +547,11 @@ async def pending_tasks( ``_ - :param local: Return local information, do not retrieve the state from master - node (default: false) - :param master_timeout: Specify timeout for connection to master + :param local: If `true`, the request retrieves information from the local node + only. If `false`, information is retrieved from the master node. + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. """ __path = "/_cluster/pending_tasks" __query: t.Dict[str, t.Any] = {} diff --git a/elasticsearch/_sync/client/cat.py b/elasticsearch/_sync/client/cat.py index 3d83e09e1..b596cf4e1 100644 --- a/elasticsearch/_sync/client/cat.py +++ b/elasticsearch/_sync/client/cat.py @@ -1266,15 +1266,19 @@ def ml_trained_models( ``_ - :param model_id: The ID of the trained models stats to fetch - :param allow_no_match: Whether to ignore if a wildcard expression matches no - trained models. (This includes `_all` string or when no trained models have - been specified) - :param bytes: The unit in which to display byte values + :param model_id: A unique identifier for the trained model. + :param allow_no_match: Specifies what to do when the request: contains wildcard + expressions and there are no models that match; contains the `_all` string + or no identifiers and there are no matches; contains wildcard expressions + and there are only partial matches. If `true`, the API returns an empty array + when there are no matches and the subset of results when there are partial + matches. If `false`, the API returns a 404 status code when there are no + matches or only partial matches. + :param bytes: The unit used to display byte values. :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. - :param from_: skips a number of trained models - :param h: Comma-separated list of column names to display + :param from_: Skips the specified number of transforms. + :param h: A comma-separated list of column names to display. :param help: When set to `true` will output available columns. This option can't be combined with any other query string option. :param local: If `true`, the request computes the list of selected nodes from @@ -1282,8 +1286,9 @@ def ml_trained_models( from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node. :param master_timeout: Period to wait for a connection to the master node. - :param s: Comma-separated list of column names or column aliases to sort by - :param size: specifies a max number of trained models to get + :param s: A comma-separated list of column names or aliases used to sort the + response. + :param size: The maximum number of transforms to display. :param v: When set to `true` will enable verbose output. """ if model_id not in SKIP_IN_PATH: @@ -1807,8 +1812,10 @@ def segments( ``_ - :param index: A comma-separated list of index names to limit the returned information - :param bytes: The unit in which to display byte values + :param index: A comma-separated list of data streams, indices, and aliases used + to limit the request. Supports wildcards (`*`). To target all data streams + and indices, omit this parameter or use `*` or `_all`. + :param bytes: The unit used to display byte values. :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. :param h: List of columns to appear in the response. Supports simple wildcards. @@ -1887,8 +1894,10 @@ def shards( ``_ - :param index: A comma-separated list of index names to limit the returned information - :param bytes: The unit in which to display byte values + :param index: A comma-separated list of data streams, indices, and aliases used + to limit the request. Supports wildcards (`*`). To target all data streams + and indices, omit this parameter or use `*` or `_all`. + :param bytes: The unit used to display byte values. :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. :param h: List of columns to appear in the response. Supports simple wildcards. @@ -1967,13 +1976,16 @@ def snapshots( ``_ - :param repository: Name of repository from which to fetch the snapshot information + :param repository: A comma-separated list of snapshot repositories used to limit + the request. Accepts wildcard expressions. `_all` returns all repositories. + If any repository fails during the request, Elasticsearch returns an error. :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. :param h: List of columns to appear in the response. Supports simple wildcards. :param help: When set to `true` will output available columns. This option can't be combined with any other query string option. - :param ignore_unavailable: Set to true to ignore unavailable snapshots + :param ignore_unavailable: If `true`, the response does not include information + from unavailable snapshots. :param local: If `true`, the request computes the list of selected nodes from the local cluster state. If `false` the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating @@ -2037,7 +2049,7 @@ def tasks( t.Union["t.Literal[-1]", "t.Literal[0]", str] ] = None, node_id: t.Optional[t.Union[t.List[str], t.Tuple[str, ...]]] = None, - parent_task: t.Optional[int] = None, + parent_task_id: t.Optional[str] = None, pretty: t.Optional[bool] = None, s: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, v: t.Optional[bool] = None, @@ -2048,9 +2060,9 @@ def tasks( ``_ - :param actions: A comma-separated list of actions that should be returned. Leave - empty to return all. - :param detailed: Return detailed task information (default: false) + :param actions: The task action names, which are used to limit the response. + :param detailed: If `true`, the response includes detailed information about + shard recoveries. :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. :param h: List of columns to appear in the response. Supports simple wildcards. @@ -2061,8 +2073,9 @@ def tasks( from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node. :param master_timeout: Period to wait for a connection to the master node. - :param node_id: - :param parent_task: + :param node_id: Unique node identifiers, which are used to limit the response. + :param parent_task_id: The parent task identifier, which is used to limit the + response. :param s: List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting `:asc` or `:desc` as a suffix to the column name. @@ -2092,8 +2105,8 @@ def tasks( __query["master_timeout"] = master_timeout if node_id is not None: __query["node_id"] = node_id - if parent_task is not None: - __query["parent_task"] = parent_task + if parent_task_id is not None: + __query["parent_task_id"] = parent_task_id if pretty is not None: __query["pretty"] = pretty if s is not None: @@ -2131,7 +2144,8 @@ def templates( ``_ - :param name: A pattern that returned template names must match + :param name: The name of the template to return. Accepts wildcard expressions. + If omitted, all templates are returned. :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. :param h: List of columns to appear in the response. Supports simple wildcards. @@ -2211,8 +2225,8 @@ def thread_pool( ``_ - :param thread_pool_patterns: List of thread pool names used to limit the request. - Accepts wildcard expressions. + :param thread_pool_patterns: A comma-separated list of thread pool names used + to limit the request. Accepts wildcard expressions. :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. :param h: List of columns to appear in the response. Supports simple wildcards. @@ -2226,7 +2240,7 @@ def thread_pool( :param s: List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting `:asc` or `:desc` as a suffix to the column name. - :param time: Unit used to display time values. + :param time: The unit used to display time values. :param v: When set to `true` will enable verbose output. """ if thread_pool_patterns not in SKIP_IN_PATH: @@ -2341,14 +2355,19 @@ def transforms( ``_ - :param transform_id: The id of the transform for which to get stats. '_all' or - '*' implies all transforms - :param allow_no_match: Whether to ignore if a wildcard expression matches no - transforms. (This includes `_all` string or when no transforms have been - specified) + :param transform_id: A transform identifier or a wildcard expression. If you + do not specify one of these options, the API returns information for all + transforms. + :param allow_no_match: Specifies what to do when the request: contains wildcard + expressions and there are no transforms that match; contains the `_all` string + or no identifiers and there are no matches; contains wildcard expressions + and there are only partial matches. If `true`, it returns an empty transforms + array when there are no matches and the subset of results when there are + partial matches. If `false`, the request returns a 404 status code when there + are no matches or only partial matches. :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. - :param from_: skips a number of transform configs, defaults to 0 + :param from_: Skips the specified number of transforms. :param h: Comma-separated list of column names to display. :param help: When set to `true` will output available columns. This option can't be combined with any other query string option. @@ -2359,8 +2378,8 @@ def transforms( :param master_timeout: Period to wait for a connection to the master node. :param s: Comma-separated list of column names or column aliases used to sort the response. - :param size: specifies a max number of transforms to get, defaults to 100 - :param time: Unit used to display time values. + :param size: The maximum number of transforms to obtain. + :param time: The unit used to display time values. :param v: When set to `true` will enable verbose output. """ if transform_id not in SKIP_IN_PATH: diff --git a/elasticsearch/_sync/client/cluster.py b/elasticsearch/_sync/client/cluster.py index a245debd6..7fc034bcf 100644 --- a/elasticsearch/_sync/client/cluster.py +++ b/elasticsearch/_sync/client/cluster.py @@ -470,6 +470,62 @@ def health( "GET", __path, params=__query, headers=__headers ) + @_rewrite_parameters() + def info( + self, + *, + target: t.Union[ + t.Union[ + "t.Literal['_all', 'http', 'ingest', 'script', 'thread_pool']", str + ], + t.Union[ + t.List[ + t.Union[ + "t.Literal['_all', 'http', 'ingest', 'script', 'thread_pool']", + str, + ] + ], + t.Tuple[ + t.Union[ + "t.Literal['_all', 'http', 'ingest', 'script', 'thread_pool']", + str, + ], + ..., + ], + ], + ], + error_trace: t.Optional[bool] = None, + filter_path: t.Optional[ + t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] + ] = None, + human: t.Optional[bool] = None, + pretty: t.Optional[bool] = None, + ) -> ObjectApiResponse[t.Any]: + """ + Returns different information about the cluster. + + ``_ + + :param target: Limits the information returned to the specific target. Supports + a comma-separated list, such as http,ingest. + """ + if target in SKIP_IN_PATH: + raise ValueError("Empty value passed for parameter 'target'") + __path = f"/_info/{_quote(target)}" + __query: t.Dict[str, t.Any] = {} + if error_trace is not None: + __query["error_trace"] = error_trace + if filter_path is not None: + __query["filter_path"] = filter_path + if human is not None: + __query["human"] = human + if pretty is not None: + __query["pretty"] = pretty + __headers = {"accept": "application/json"} + return self.perform_request( # type: ignore[return-value] + "GET", __path, params=__query, headers=__headers + ) + @_rewrite_parameters() def pending_tasks( self, @@ -491,9 +547,11 @@ def pending_tasks( ``_ - :param local: Return local information, do not retrieve the state from master - node (default: false) - :param master_timeout: Specify timeout for connection to master + :param local: If `true`, the request retrieves information from the local node + only. If `false`, information is retrieved from the master node. + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. """ __path = "/_cluster/pending_tasks" __query: t.Dict[str, t.Any] = {}