Skip to content

Commit

Permalink
Auto-generated API code
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine committed Aug 26, 2024
1 parent 4ee4650 commit f8bf402
Show file tree
Hide file tree
Showing 14 changed files with 502 additions and 352 deletions.
24 changes: 24 additions & 0 deletions elasticsearch/_async/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2714,6 +2714,7 @@ async def msearch(
human: t.Optional[bool] = None,
ignore_throttled: t.Optional[bool] = None,
ignore_unavailable: t.Optional[bool] = None,
include_named_queries_score: t.Optional[bool] = None,
max_concurrent_searches: t.Optional[int] = None,
max_concurrent_shard_requests: t.Optional[int] = None,
pre_filter_shard_size: t.Optional[int] = None,
Expand Down Expand Up @@ -2747,6 +2748,13 @@ async def msearch(
when frozen.
:param ignore_unavailable: If true, missing or closed indices are not included
in the response.
:param include_named_queries_score: Indicates whether hit.matched_queries should
be rendered as a map that includes the name of the matched query associated
with its score (true) or as an array containing the name of the matched queries
(false) This functionality reruns each named query on every hit in a search
response. Typically, this adds a small overhead to a request. However, using
computationally expensive named queries on a large number of hits may add
significant overhead.
:param max_concurrent_searches: Maximum number of concurrent searches the multi
search API can execute.
:param max_concurrent_shard_requests: Maximum number of concurrent shard requests
Expand Down Expand Up @@ -2796,6 +2804,8 @@ async def msearch(
__query["ignore_throttled"] = ignore_throttled
if ignore_unavailable is not None:
__query["ignore_unavailable"] = ignore_unavailable
if include_named_queries_score is not None:
__query["include_named_queries_score"] = include_named_queries_score
if max_concurrent_searches is not None:
__query["max_concurrent_searches"] = max_concurrent_searches
if max_concurrent_shard_requests is not None:
Expand Down Expand Up @@ -3709,6 +3719,7 @@ async def search(
human: t.Optional[bool] = None,
ignore_throttled: t.Optional[bool] = None,
ignore_unavailable: t.Optional[bool] = None,
include_named_queries_score: t.Optional[bool] = None,
indices_boost: t.Optional[t.Sequence[t.Mapping[str, float]]] = None,
knn: t.Optional[
t.Union[t.Mapping[str, t.Any], t.Sequence[t.Mapping[str, t.Any]]]
Expand Down Expand Up @@ -3836,6 +3847,13 @@ async def search(
be ignored when frozen.
:param ignore_unavailable: If `false`, the request returns an error if it targets
a missing or closed index.
:param include_named_queries_score: Indicates whether hit.matched_queries should
be rendered as a map that includes the name of the matched query associated
with its score (true) or as an array containing the name of the matched queries
(false) This functionality reruns each named query on every hit in a search
response. Typically, this adds a small overhead to a request. However, using
computationally expensive named queries on a large number of hits may add
significant overhead.
:param indices_boost: Boosts the _score of documents from specified indices.
:param knn: Defines the approximate kNN search to run.
:param lenient: If `true`, format-based query failures (such as providing text
Expand Down Expand Up @@ -4017,6 +4035,8 @@ async def search(
__query["ignore_throttled"] = ignore_throttled
if ignore_unavailable is not None:
__query["ignore_unavailable"] = ignore_unavailable
if include_named_queries_score is not None:
__query["include_named_queries_score"] = include_named_queries_score
if lenient is not None:
__query["lenient"] = lenient
if max_concurrent_shard_requests is not None:
Expand Down Expand Up @@ -4963,6 +4983,7 @@ async def update_by_query(
pipeline: t.Optional[str] = None,
preference: t.Optional[str] = None,
pretty: t.Optional[bool] = None,
q: t.Optional[str] = None,
query: t.Optional[t.Mapping[str, t.Any]] = None,
refresh: t.Optional[bool] = None,
request_cache: t.Optional[bool] = None,
Expand Down Expand Up @@ -5029,6 +5050,7 @@ async def update_by_query(
parameter.
:param preference: Specifies the node or shard the operation should be performed
on. Random by default.
:param q: Query in the Lucene query string syntax.
:param query: Specifies the documents to update using the Query DSL.
:param refresh: If `true`, Elasticsearch refreshes affected shards to make the
operation visible to search.
Expand Down Expand Up @@ -5113,6 +5135,8 @@ async def update_by_query(
__query["preference"] = preference
if pretty is not None:
__query["pretty"] = pretty
if q is not None:
__query["q"] = q
if refresh is not None:
__query["refresh"] = refresh
if request_cache is not None:
Expand Down
2 changes: 1 addition & 1 deletion elasticsearch/_async/client/cat.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ async def count(
) -> t.Union[ObjectApiResponse[t.Any], TextApiResponse]:
"""
Get a document count. Provides quick access to a document count for a data stream,
an index, or an entire cluster.n/ The document count only includes live documents,
an index, or an entire cluster. The document count only includes live documents,
not deleted documents which have not yet been removed by the merge process. CAT
APIs are only intended for human consumption using the command line or Kibana
console. They are not intended for use by applications. For application consumption,
Expand Down
6 changes: 3 additions & 3 deletions elasticsearch/_async/client/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,9 +427,9 @@ async def health(
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-health.html>`_
:param index: Comma-separated list of data streams, indices, and index aliases
used to limit the request. Wildcard expressions (*) are supported. To target
used to limit the request. Wildcard expressions (`*`) are supported. To target
all data streams and indices in a cluster, omit this parameter or use _all
or *.
or `*`.
:param expand_wildcards: Whether to expand wildcard expression to concrete indices
that are open, closed or both.
:param level: Can be one of cluster, indices or shards. Controls the details
Expand Down Expand Up @@ -703,7 +703,7 @@ async def put_component_template(
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html>`_
:param name: Name of the component template to create. Elasticsearch includes
the following built-in component templates: `logs-mappings`; 'logs-settings`;
the following built-in component templates: `logs-mappings`; `logs-settings`;
`metrics-mappings`; `metrics-settings`;`synthetics-mapping`; `synthetics-settings`.
Elastic Agent uses these templates to configure backing indices for its data
streams. If you use Elastic Agent and want to overwrite one of these templates,
Expand Down
46 changes: 46 additions & 0 deletions elasticsearch/_async/client/indices.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,9 @@ async def create_data_stream(
error_trace: t.Optional[bool] = None,
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
human: t.Optional[bool] = None,
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
pretty: t.Optional[bool] = None,
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
) -> ObjectApiResponse[t.Any]:
"""
Create a data stream. Creates a data stream. You must have a matching index template
Expand All @@ -574,6 +576,11 @@ async def create_data_stream(
`#`, `:`, or a space character; Cannot start with `-`, `_`, `+`, or `.ds-`;
Cannot be `.` or `..`; Cannot be longer than 255 bytes. Multi-byte characters
count towards this limit faster.
: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 timeout: Period to wait for a response. If no response is received before
the timeout expires, the request fails and returns an error.
"""
if name in SKIP_IN_PATH:
raise ValueError("Empty value passed for parameter 'name'")
Expand All @@ -586,8 +593,12 @@ async def create_data_stream(
__query["filter_path"] = filter_path
if human is not None:
__query["human"] = human
if master_timeout is not None:
__query["master_timeout"] = master_timeout
if pretty is not None:
__query["pretty"] = pretty
if timeout is not None:
__query["timeout"] = timeout
__headers = {"accept": "application/json"}
return await self.perform_request( # type: ignore[return-value]
"PUT",
Expand Down Expand Up @@ -869,6 +880,7 @@ async def delete_data_stream(
] = None,
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
human: t.Optional[bool] = None,
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
pretty: t.Optional[bool] = None,
) -> ObjectApiResponse[t.Any]:
"""
Expand All @@ -880,6 +892,9 @@ async def delete_data_stream(
are supported.
:param expand_wildcards: Type of data stream that wildcard patterns can match.
Supports comma-separated values,such as `open,hidden`.
: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.
"""
if name in SKIP_IN_PATH:
raise ValueError("Empty value passed for parameter 'name'")
Expand All @@ -894,6 +909,8 @@ async def delete_data_stream(
__query["filter_path"] = filter_path
if human is not None:
__query["human"] = human
if master_timeout is not None:
__query["master_timeout"] = master_timeout
if pretty is not None:
__query["pretty"] = pretty
__headers = {"accept": "application/json"}
Expand Down Expand Up @@ -1928,6 +1945,7 @@ async def get_data_lifecycle(
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
human: t.Optional[bool] = None,
include_defaults: t.Optional[bool] = None,
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
pretty: t.Optional[bool] = None,
) -> ObjectApiResponse[t.Any]:
"""
Expand All @@ -1943,6 +1961,9 @@ async def get_data_lifecycle(
Supports comma-separated values, such as `open,hidden`. Valid values are:
`all`, `open`, `closed`, `hidden`, `none`.
:param include_defaults: If `true`, return all default settings in the response.
: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.
"""
if name in SKIP_IN_PATH:
raise ValueError("Empty value passed for parameter 'name'")
Expand All @@ -1959,6 +1980,8 @@ async def get_data_lifecycle(
__query["human"] = human
if include_defaults is not None:
__query["include_defaults"] = include_defaults
if master_timeout is not None:
__query["master_timeout"] = master_timeout
if pretty is not None:
__query["pretty"] = pretty
__headers = {"accept": "application/json"}
Expand Down Expand Up @@ -1988,6 +2011,7 @@ async def get_data_stream(
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
human: t.Optional[bool] = None,
include_defaults: t.Optional[bool] = None,
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
pretty: t.Optional[bool] = None,
) -> ObjectApiResponse[t.Any]:
"""
Expand All @@ -2002,6 +2026,9 @@ async def get_data_stream(
Supports comma-separated values, such as `open,hidden`.
:param include_defaults: If true, returns all relevant default configurations
for the index 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.
"""
__path_parts: t.Dict[str, str]
if name not in SKIP_IN_PATH:
Expand All @@ -2021,6 +2048,8 @@ async def get_data_stream(
__query["human"] = human
if include_defaults is not None:
__query["include_defaults"] = include_defaults
if master_timeout is not None:
__query["master_timeout"] = master_timeout
if pretty is not None:
__query["pretty"] = pretty
__headers = {"accept": "application/json"}
Expand Down Expand Up @@ -2435,7 +2464,9 @@ async def migrate_to_data_stream(
error_trace: t.Optional[bool] = None,
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
human: t.Optional[bool] = None,
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
pretty: t.Optional[bool] = None,
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
) -> ObjectApiResponse[t.Any]:
"""
Convert an index alias to a data stream. Converts an index alias to a data stream.
Expand All @@ -2450,6 +2481,11 @@ async def migrate_to_data_stream(
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html>`_
:param name: Name of the index alias to convert to a data stream.
: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 timeout: Period to wait for a response. If no response is received before
the timeout expires, the request fails and returns an error.
"""
if name in SKIP_IN_PATH:
raise ValueError("Empty value passed for parameter 'name'")
Expand All @@ -2462,8 +2498,12 @@ async def migrate_to_data_stream(
__query["filter_path"] = filter_path
if human is not None:
__query["human"] = human
if master_timeout is not None:
__query["master_timeout"] = master_timeout
if pretty is not None:
__query["pretty"] = pretty
if timeout is not None:
__query["timeout"] = timeout
__headers = {"accept": "application/json"}
return await self.perform_request( # type: ignore[return-value]
"POST",
Expand Down Expand Up @@ -2620,6 +2660,7 @@ async def promote_data_stream(
error_trace: t.Optional[bool] = None,
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
human: t.Optional[bool] = None,
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
pretty: t.Optional[bool] = None,
) -> ObjectApiResponse[t.Any]:
"""
Expand All @@ -2629,6 +2670,9 @@ async def promote_data_stream(
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html>`_
:param name: The name of the data stream
: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.
"""
if name in SKIP_IN_PATH:
raise ValueError("Empty value passed for parameter 'name'")
Expand All @@ -2641,6 +2685,8 @@ async def promote_data_stream(
__query["filter_path"] = filter_path
if human is not None:
__query["human"] = human
if master_timeout is not None:
__query["master_timeout"] = master_timeout
if pretty is not None:
__query["pretty"] = pretty
__headers = {"accept": "application/json"}
Expand Down
Loading

0 comments on commit f8bf402

Please sign in to comment.