Skip to content

Auto-generated code for main #3000

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
240 changes: 56 additions & 184 deletions elasticsearch/_async/client/__init__.py

Large diffs are not rendered by default.

698 changes: 667 additions & 31 deletions elasticsearch/_async/client/cat.py

Large diffs are not rendered by default.

23 changes: 17 additions & 6 deletions elasticsearch/_async/client/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ async def allocation_explain(
Get explanations for shard allocations in the cluster.
For unassigned shards, it provides an explanation for why the shard is unassigned.
For assigned shards, it provides an explanation for why the shard is remaining on its current node and has not moved or rebalanced to another node.
This API can be very useful when attempting to diagnose why a shard is unassigned or why a shard continues to remain on its current node when you might expect otherwise.</p>
This API can be very useful when attempting to diagnose why a shard is unassigned or why a shard continues to remain on its current node when you might expect otherwise.
Refer to the linked documentation for examples of how to troubleshoot allocation issues using this API.</p>


`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-allocation-explain>`_
Expand Down Expand Up @@ -290,6 +291,7 @@ async def get_component_template(
local: t.Optional[bool] = None,
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
pretty: t.Optional[bool] = None,
settings_filter: t.Optional[t.Union[str, t.Sequence[str]]] = None,
) -> ObjectApiResponse[t.Any]:
"""
.. raw:: html
Expand All @@ -310,6 +312,8 @@ async def get_component_template(
: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.
:param settings_filter: Filter out results, for example to filter out sensitive
information. Supports wildcards or full settings keys
"""
__path_parts: t.Dict[str, str]
if name not in SKIP_IN_PATH:
Expand All @@ -335,6 +339,8 @@ async def get_component_template(
__query["master_timeout"] = master_timeout
if pretty is not None:
__query["pretty"] = pretty
if settings_filter is not None:
__query["settings_filter"] = settings_filter
__headers = {"accept": "application/json"}
return await self.perform_request( # type: ignore[return-value]
"GET",
Expand All @@ -361,8 +367,8 @@ async def get_settings(
"""
.. raw:: html

<p>Get cluster-wide settings.
By default, it returns only settings that have been explicitly defined.</p>
<p>Get cluster-wide settings.</p>
<p>By default, it returns only settings that have been explicitly defined.</p>


`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-get-settings>`_
Expand Down Expand Up @@ -731,6 +737,7 @@ async def put_component_template(
*,
name: str,
template: t.Optional[t.Mapping[str, t.Any]] = None,
cause: t.Optional[str] = None,
create: t.Optional[bool] = None,
deprecated: t.Optional[bool] = None,
error_trace: t.Optional[bool] = None,
Expand Down Expand Up @@ -774,6 +781,7 @@ async def put_component_template(
update settings API.
:param template: The template to be applied which includes mappings, settings,
or aliases configuration.
:param cause: User defined reason for create the component template.
:param create: If `true`, this request cannot replace or update existing component
templates.
:param deprecated: Marks this index template as deprecated. When creating or
Expand All @@ -798,6 +806,8 @@ async def put_component_template(
__path = f'/_component_template/{__path_parts["name"]}'
__query: t.Dict[str, t.Any] = {}
__body: t.Dict[str, t.Any] = body if body is not None else {}
if cause is not None:
__query["cause"] = cause
if create is not None:
__query["create"] = create
if error_trace is not None:
Expand Down Expand Up @@ -870,9 +880,9 @@ async def put_settings(

:param flat_settings: Return settings in flat format (default: false)
:param master_timeout: Explicit operation timeout for connection to master node
:param persistent:
:param persistent: The settings that persist after the cluster restarts.
:param timeout: Explicit operation timeout
:param transient:
:param transient: The settings that do not persist after the cluster restarts.
"""
__path_parts: t.Dict[str, str] = {}
__path = "/_cluster/settings"
Expand Down Expand Up @@ -1109,7 +1119,8 @@ async def state(
when unavailable (missing or closed)
: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 master_timeout: Timeout for waiting for new cluster state in case it is
blocked
:param wait_for_metadata_version: Wait for the metadata version to be equal or
greater than the specified metadata version
:param wait_for_timeout: The maximum time to wait for wait_for_metadata_version
Expand Down
110 changes: 104 additions & 6 deletions elasticsearch/_async/client/esql.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ class EsqlClient(NamespacedClient):
"columnar",
"filter",
"include_ccs_metadata",
"keep_alive",
"keep_on_completion",
"locale",
"params",
"profile",
Expand Down Expand Up @@ -88,7 +90,9 @@ async def async_query(
parameter, runs it, and returns the results.
:param allow_partial_results: If `true`, partial results will be returned if
there are shard failures, but the query can continue to execute on other
clusters and shards.
clusters and shards. If `false`, the query will fail if there are any failures.
To override the default behavior, you can set the `esql.query.allow_partial_results`
cluster setting to `false`.
:param columnar: By default, ES|QL returns results as rows. For example, FROM
returns each individual document as one row. For the JSON, YAML, CBOR and
smile formats, ES|QL can return the results in a columnar fashion where one
Expand Down Expand Up @@ -151,10 +155,6 @@ async def async_query(
__query["format"] = format
if human is not None:
__query["human"] = human
if keep_alive is not None:
__query["keep_alive"] = keep_alive
if keep_on_completion is not None:
__query["keep_on_completion"] = keep_on_completion
if pretty is not None:
__query["pretty"] = pretty
if not __body:
Expand All @@ -166,6 +166,10 @@ async def async_query(
__body["filter"] = filter
if include_ccs_metadata is not None:
__body["include_ccs_metadata"] = include_ccs_metadata
if keep_alive is not None:
__body["keep_alive"] = keep_alive
if keep_on_completion is not None:
__body["keep_on_completion"] = keep_on_completion
if locale is not None:
__body["locale"] = locale
if params is not None:
Expand Down Expand Up @@ -248,6 +252,14 @@ async def async_query_get(
drop_null_columns: t.Optional[bool] = None,
error_trace: t.Optional[bool] = None,
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
format: t.Optional[
t.Union[
str,
t.Literal[
"arrow", "cbor", "csv", "json", "smile", "tsv", "txt", "yaml"
],
]
] = None,
human: t.Optional[bool] = None,
keep_alive: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
pretty: t.Optional[bool] = None,
Expand All @@ -273,6 +285,7 @@ async def async_query_get(
will be removed from the `columns` and `values` portion of the results. If
`true`, the response will include an extra section under the name `all_columns`
which has the name of all the columns.
:param format: A short version of the Accept header, for example `json` or `yaml`.
:param keep_alive: The period for which the query and its results are stored
in the cluster. When this period expires, the query and its results are deleted,
even if the query is still ongoing.
Expand All @@ -293,6 +306,8 @@ async def async_query_get(
__query["error_trace"] = error_trace
if filter_path is not None:
__query["filter_path"] = filter_path
if format is not None:
__query["format"] = format
if human is not None:
__query["human"] = human
if keep_alive is not None:
Expand Down Expand Up @@ -366,6 +381,87 @@ async def async_query_stop(
path_parts=__path_parts,
)

@_rewrite_parameters()
@_stability_warning(Stability.EXPERIMENTAL)
async def get_query(
self,
*,
id: str,
error_trace: t.Optional[bool] = None,
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
human: t.Optional[bool] = None,
pretty: t.Optional[bool] = None,
) -> ObjectApiResponse[t.Any]:
"""
.. raw:: html

<p>Get a specific running ES|QL query information.
Returns an object extended information about a running ES|QL query.</p>


:param id: The query ID
"""
if id in SKIP_IN_PATH:
raise ValueError("Empty value passed for parameter 'id'")
__path_parts: t.Dict[str, str] = {"id": _quote(id)}
__path = f'/_query/queries/{__path_parts["id"]}'
__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,
endpoint_id="esql.get_query",
path_parts=__path_parts,
)

@_rewrite_parameters()
@_stability_warning(Stability.EXPERIMENTAL)
async def list_queries(
self,
*,
error_trace: t.Optional[bool] = None,
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
human: t.Optional[bool] = None,
pretty: t.Optional[bool] = None,
) -> ObjectApiResponse[t.Any]:
"""
.. raw:: html

<p>Get running ES|QL queries information.
Returns an object containing IDs and other information about the running ES|QL queries.</p>

"""
__path_parts: t.Dict[str, str] = {}
__path = "/_query/queries"
__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,
endpoint_id="esql.list_queries",
path_parts=__path_parts,
)

@_rewrite_parameters(
body_fields=(
"query",
Expand Down Expand Up @@ -422,7 +518,9 @@ async def query(
parameter, runs it, and returns the results.
:param allow_partial_results: If `true`, partial results will be returned if
there are shard failures, but the query can continue to execute on other
clusters and shards.
clusters and shards. If `false`, the query will fail if there are any failures.
To override the default behavior, you can set the `esql.query.allow_partial_results`
cluster setting to `false`.
:param columnar: By default, ES|QL returns results as rows. For example, FROM
returns each individual document as one row. For the JSON, YAML, CBOR and
smile formats, ES|QL can return the results in a columnar fashion where one
Expand Down
Loading
Loading