Skip to content
Merged
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
10 changes: 0 additions & 10 deletions elasticsearch/_async/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2234,7 +2234,6 @@ async def field_caps(
@_rewrite_parameters(
parameter_aliases={
"_source": "source",
"_source_exclude_vectors": "source_exclude_vectors",
"_source_excludes": "source_excludes",
"_source_includes": "source_includes",
},
Expand All @@ -2254,7 +2253,6 @@ async def get(
refresh: t.Optional[bool] = None,
routing: t.Optional[str] = None,
source: t.Optional[t.Union[bool, t.Union[str, t.Sequence[str]]]] = None,
source_exclude_vectors: t.Optional[bool] = None,
source_excludes: t.Optional[t.Union[str, t.Sequence[str]]] = None,
source_includes: t.Optional[t.Union[str, t.Sequence[str]]] = None,
stored_fields: t.Optional[t.Union[str, t.Sequence[str]]] = None,
Expand Down Expand Up @@ -2328,7 +2326,6 @@ async def get(
:param routing: A custom value used to route operations to a specific shard.
:param source: Indicates whether to return the `_source` field (`true` or `false`)
or lists the fields to return.
:param source_exclude_vectors: Whether vectors should be excluded from _source
:param source_excludes: A comma-separated list of source fields to exclude from
the response. You can also use this parameter to exclude fields from the
subset specified in `_source_includes` query parameter. If the `_source`
Expand Down Expand Up @@ -2374,8 +2371,6 @@ async def get(
__query["routing"] = routing
if source is not None:
__query["_source"] = source
if source_exclude_vectors is not None:
__query["_source_exclude_vectors"] = source_exclude_vectors
if source_excludes is not None:
__query["_source_excludes"] = source_excludes
if source_includes is not None:
Expand Down Expand Up @@ -4309,7 +4304,6 @@ async def scroll(
),
parameter_aliases={
"_source": "source",
"_source_exclude_vectors": "source_exclude_vectors",
"_source_excludes": "source_excludes",
"_source_includes": "source_includes",
"from": "from_",
Expand Down Expand Up @@ -4393,7 +4387,6 @@ async def search(
]
] = None,
source: t.Optional[t.Union[bool, t.Mapping[str, t.Any]]] = None,
source_exclude_vectors: t.Optional[bool] = None,
source_excludes: t.Optional[t.Union[str, t.Sequence[str]]] = None,
source_includes: t.Optional[t.Union[str, t.Sequence[str]]] = None,
stats: t.Optional[t.Sequence[str]] = None,
Expand Down Expand Up @@ -4588,7 +4581,6 @@ async def search(
fields are returned in the `hits._source` property of the search response.
If the `stored_fields` property is specified, the `_source` property defaults
to `false`. Otherwise, it defaults to `true`.
:param source_exclude_vectors: Whether vectors should be excluded from _source
:param source_excludes: A comma-separated list of source fields to exclude from
the response. You can also use this parameter to exclude fields from the
subset specified in `_source_includes` query parameter. If the `_source`
Expand Down Expand Up @@ -4713,8 +4705,6 @@ async def search(
__query["scroll"] = scroll
if search_type is not None:
__query["search_type"] = search_type
if source_exclude_vectors is not None:
__query["_source_exclude_vectors"] = source_exclude_vectors
if source_excludes is not None:
__query["_source_excludes"] = source_excludes
if source_includes is not None:
Expand Down
17 changes: 8 additions & 9 deletions elasticsearch/_async/client/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ async def allocation_explain(

<p>Explain the shard allocations.
Get explanations for shard allocations in the cluster.
This API accepts the current_node, index, primary and shard parameters in the request body or in query parameters, but not in both at the same time.
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.
Expand All @@ -58,16 +57,17 @@ async def allocation_explain(

`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-allocation-explain>`_

:param current_node: Explain a shard only if it is currently located on the specified
node name or node ID.
:param current_node: Specifies the node ID or the name of the node to only explain
a shard that is currently located on the specified node.
:param include_disk_info: If true, returns information about disk usage and shard
sizes.
:param include_yes_decisions: If true, returns YES decisions in explanation.
:param index: The name of the index that you would like an explanation for.
:param index: Specifies the name of the index that you would like an explanation
for.
:param master_timeout: Period to wait for a connection to the master node.
:param primary: If true, returns an explanation for the primary shard for the
specified shard ID.
:param shard: An identifier for the shard that you would like an explanation
:param primary: If true, returns explanation for the primary shard for the given
shard ID.
:param shard: Specifies the ID of the shard that you would like an explanation
for.
"""
__path_parts: t.Dict[str, str] = {}
Expand Down Expand Up @@ -1119,8 +1119,7 @@ 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: Timeout for waiting for new cluster state in case it is
blocked
:param master_timeout: Specify timeout for connection to master
: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
134 changes: 3 additions & 131 deletions elasticsearch/_async/client/indices.py
Original file line number Diff line number Diff line change
Expand Up @@ -1208,7 +1208,7 @@ async def delete_data_stream_options(
Removes the data stream options from a data stream.</p>


`<https://www.elastic.co/guide/en/elasticsearch/reference/master/index.html>`_
`<https://www.elastic.co/guide/en/elasticsearch/reference/9.1/index.html>`_

:param name: A comma-separated list of data streams of which the data stream
options will be deleted; use `*` to get all data streams
Expand Down Expand Up @@ -2542,57 +2542,6 @@ async def get_data_stream(
path_parts=__path_parts,
)

@_rewrite_parameters()
async def get_data_stream_mappings(
self,
*,
name: t.Union[str, t.Sequence[str]],
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]:
"""
.. raw:: html

<p>Get data stream mappings.</p>
<p>Get mapping information for one or more data streams.</p>


`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-data-stream-mappings>`_

:param name: A comma-separated list of data streams or data stream patterns.
Supports wildcards (`*`).
:param master_timeout: The 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'")
__path_parts: t.Dict[str, str] = {"name": _quote(name)}
__path = f'/_data_stream/{__path_parts["name"]}/_mappings'
__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 master_timeout is not None:
__query["master_timeout"] = master_timeout
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="indices.get_data_stream_mappings",
path_parts=__path_parts,
)

@_rewrite_parameters()
async def get_data_stream_options(
self,
Expand All @@ -2619,7 +2568,7 @@ async def get_data_stream_options(
<p>Get the data stream options configuration of one or more data streams.</p>


`<https://www.elastic.co/guide/en/elasticsearch/reference/master/index.html>`_
`<https://www.elastic.co/guide/en/elasticsearch/reference/9.1/index.html>`_

:param name: Comma-separated list of data streams to limit the request. Supports
wildcards (`*`). To target all data streams, omit this parameter or use `*`
Expand Down Expand Up @@ -3704,83 +3653,6 @@ async def put_data_lifecycle(
path_parts=__path_parts,
)

@_rewrite_parameters(
body_name="mappings",
)
async def put_data_stream_mappings(
self,
*,
name: t.Union[str, t.Sequence[str]],
mappings: t.Optional[t.Mapping[str, t.Any]] = None,
body: t.Optional[t.Mapping[str, t.Any]] = None,
dry_run: t.Optional[bool] = None,
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]:
"""
.. raw:: html

<p>Update data stream mappings.</p>
<p>This API can be used to override mappings on specific data streams. These overrides will take precedence over what
is specified in the template that the data stream matches. The mapping change is only applied to new write indices
that are created during rollover after this API is called. No indices are changed by this API.</p>


`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-data-stream-mappings>`_

:param name: A comma-separated list of data streams or data stream patterns.
:param mappings:
:param dry_run: If `true`, the request does not actually change the mappings
on any data streams. Instead, it simulates changing the settings and reports
back to the user what would have happened had these settings actually been
applied.
:param master_timeout: The 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: The 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'")
if mappings is None and body is None:
raise ValueError(
"Empty value passed for parameters 'mappings' and 'body', one of them should be set."
)
elif mappings is not None and body is not None:
raise ValueError("Cannot set both 'mappings' and 'body'")
__path_parts: t.Dict[str, str] = {"name": _quote(name)}
__path = f'/_data_stream/{__path_parts["name"]}/_mappings'
__query: t.Dict[str, t.Any] = {}
if dry_run is not None:
__query["dry_run"] = dry_run
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 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
__body = mappings if mappings is not None else body
__headers = {"accept": "application/json", "content-type": "application/json"}
return await self.perform_request( # type: ignore[return-value]
"PUT",
__path,
params=__query,
headers=__headers,
body=__body,
endpoint_id="indices.put_data_stream_mappings",
path_parts=__path_parts,
)

@_rewrite_parameters(
body_fields=("failure_store",),
)
Expand Down Expand Up @@ -3812,7 +3684,7 @@ async def put_data_stream_options(
Update the data stream options of the specified data streams.</p>


`<https://www.elastic.co/guide/en/elasticsearch/reference/master/index.html>`_
`<https://www.elastic.co/guide/en/elasticsearch/reference/9.1/index.html>`_

:param name: Comma-separated list of data streams used to limit the request.
Supports wildcards (`*`). To target all data streams use `*` or `_all`.
Expand Down
Loading