Skip to content
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
146 changes: 77 additions & 69 deletions elasticsearch/_async/client/__init__.py

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions elasticsearch/_async/client/async_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ async def status(
"pit",
"post_filter",
"profile",
"project_routing",
"query",
"rescore",
"runtime_mappings",
Expand Down Expand Up @@ -295,7 +296,7 @@ async def submit(
t.Union[t.Mapping[str, t.Any], t.Sequence[t.Mapping[str, t.Any]]]
] = None,
rest_total_hits_as_int: t.Optional[bool] = None,
routing: t.Optional[str] = None,
routing: t.Optional[t.Union[str, t.Sequence[str]]] = None,
runtime_mappings: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
script_fields: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
search_after: t.Optional[
Expand Down Expand Up @@ -533,8 +534,6 @@ async def submit(
__query["preference"] = preference
if pretty is not None:
__query["pretty"] = pretty
if project_routing is not None:
__query["project_routing"] = project_routing
if q is not None:
__query["q"] = q
if request_cache is not None:
Expand Down Expand Up @@ -592,6 +591,8 @@ async def submit(
__body["post_filter"] = post_filter
if profile is not None:
__body["profile"] = profile
if project_routing is not None:
__body["project_routing"] = project_routing
if query is not None:
__body["query"] = query
if rescore is not None:
Expand Down
181 changes: 181 additions & 0 deletions elasticsearch/_async/client/cat.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,149 @@ async def allocation(
path_parts=__path_parts,
)

@_rewrite_parameters()
async def circuit_breaker(
self,
*,
circuit_breaker_patterns: t.Optional[t.Union[str, t.Sequence[str]]] = None,
bytes: t.Optional[
t.Union[str, t.Literal["b", "gb", "kb", "mb", "pb", "tb"]]
] = None,
error_trace: t.Optional[bool] = None,
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
format: t.Optional[str] = None,
h: t.Optional[
t.Union[
t.Sequence[
t.Union[
str,
t.Literal[
"breaker",
"estimated",
"estimated_bytes",
"limit",
"limit_bytes",
"node_id",
"node_name",
"overhead",
"tripped",
],
]
],
t.Union[
str,
t.Literal[
"breaker",
"estimated",
"estimated_bytes",
"limit",
"limit_bytes",
"node_id",
"node_name",
"overhead",
"tripped",
],
],
]
] = None,
help: t.Optional[bool] = None,
human: t.Optional[bool] = None,
local: t.Optional[bool] = None,
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
pretty: t.Optional[bool] = None,
s: t.Optional[t.Union[str, t.Sequence[str]]] = None,
time: t.Optional[
t.Union[str, t.Literal["d", "h", "m", "micros", "ms", "nanos", "s"]]
] = None,
v: t.Optional[bool] = None,
) -> t.Union[ObjectApiResponse[t.Any], TextApiResponse]:
"""
.. raw:: html

<p>Get circuit breakers statistics.</p>
<p>IMPORTANT: CAT APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications.</p>


`<https://www.elastic.co/docs/api/doc/elasticsearch#TODO>`_

:param circuit_breaker_patterns: A comma-separated list of regular-expressions
to filter the circuit breakers in the output
:param bytes: Sets the units for columns that contain a byte-size value. Note
that byte-size value units work in terms of powers of 1024. For instance
`1kb` means 1024 bytes, not 1000 bytes. If omitted, byte-size values are
rendered with a suffix such as `kb`, `mb`, or `gb`, chosen such that the
numeric value of the column is as small as possible whilst still being at
least `1.0`. If given, byte-size values are rendered as an integer with no
suffix, representing the value of the column in the chosen unit. Values that
are not an exact multiple of the chosen unit are rounded down.
:param format: Specifies the format to return the columnar data in, can be set
to `text`, `json`, `cbor`, `yaml`, or `smile`.
:param h: A comma-separated list of columns names to display. It 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 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
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: 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: Sets the units for columns that contain a time duration. If omitted,
time duration values are rendered with a suffix such as `ms`, `s`, `m` or
`h`, chosen such that the numeric value of the column is as small as possible
whilst still being at least `1.0`. If given, time duration values are rendered
as an integer with no suffix. Values that are not an exact multiple of the
chosen unit are rounded down.
:param v: When set to `true` will enable verbose output.
"""
__path_parts: t.Dict[str, str]
if circuit_breaker_patterns not in SKIP_IN_PATH:
__path_parts = {
"circuit_breaker_patterns": _quote(circuit_breaker_patterns)
}
__path = f'/_cat/circuit_breaker/{__path_parts["circuit_breaker_patterns"]}'
else:
__path_parts = {}
__path = "/_cat/circuit_breaker"
__query: t.Dict[str, t.Any] = {}
if bytes is not None:
__query["bytes"] = bytes
if error_trace is not None:
__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 h is not None:
__query["h"] = h
if help is not None:
__query["help"] = help
if human is not None:
__query["human"] = human
if local is not None:
__query["local"] = local
if master_timeout is not None:
__query["master_timeout"] = master_timeout
if pretty is not None:
__query["pretty"] = pretty
if s is not None:
__query["s"] = s
if time is not None:
__query["time"] = time
if v is not None:
__query["v"] = v
__headers = {"accept": "text/plain,application/json"}
return await self.perform_request( # type: ignore[return-value]
"GET",
__path,
params=__query,
headers=__headers,
endpoint_id="cat.circuit_breaker",
path_parts=__path_parts,
)

@_rewrite_parameters()
async def component_templates(
self,
Expand Down Expand Up @@ -3310,10 +3453,20 @@ async def segments(
self,
*,
index: t.Optional[t.Union[str, t.Sequence[str]]] = None,
allow_closed: t.Optional[bool] = None,
allow_no_indices: t.Optional[bool] = None,
bytes: t.Optional[
t.Union[str, t.Literal["b", "gb", "kb", "mb", "pb", "tb"]]
] = None,
error_trace: t.Optional[bool] = None,
expand_wildcards: t.Optional[
t.Union[
t.Sequence[
t.Union[str, t.Literal["all", "closed", "hidden", "none", "open"]]
],
t.Union[str, t.Literal["all", "closed", "hidden", "none", "open"]],
]
] = None,
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
format: t.Optional[str] = None,
h: t.Optional[
Expand Down Expand Up @@ -3364,6 +3517,8 @@ async def segments(
] = None,
help: t.Optional[bool] = None,
human: t.Optional[bool] = None,
ignore_throttled: t.Optional[bool] = None,
ignore_unavailable: t.Optional[bool] = None,
local: t.Optional[bool] = None,
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
pretty: t.Optional[bool] = None,
Expand All @@ -3387,6 +3542,14 @@ async def segments(
: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 allow_closed: If true, allow closed indices to be returned in the response
otherwise if false, keep the legacy behaviour of throwing an exception if
index pattern matches closed indices
:param allow_no_indices: If false, the request returns an error if any wildcard
expression, index alias, or _all value targets only missing or closed indices.
This behavior applies even if the request targets other open indices. For
example, a request targeting foo*,bar* returns an error if an index starts
with foo but no index starts with bar.
:param bytes: Sets the units for columns that contain a byte-size value. Note
that byte-size value units work in terms of powers of 1024. For instance
`1kb` means 1024 bytes, not 1000 bytes. If omitted, byte-size values are
Expand All @@ -3395,12 +3558,20 @@ async def segments(
least `1.0`. If given, byte-size values are rendered as an integer with no
suffix, representing the value of the column in the chosen unit. Values that
are not an exact multiple of the chosen unit are rounded down.
:param expand_wildcards: Type of index that wildcard expressions can match. If
the request can target data streams, this argument determines whether wildcard
expressions match hidden data streams. Supports comma-separated values, such
as open,hidden.
:param format: Specifies the format to return the columnar data in, can be set
to `text`, `json`, `cbor`, `yaml`, or `smile`.
:param h: A comma-separated list of columns names to display. It 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_throttled: If true, concrete, expanded or aliased indices are ignored
when frozen.
:param ignore_unavailable: If true, missing or closed indices are not included
in the response.
: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
Expand All @@ -3425,10 +3596,16 @@ async def segments(
__path_parts = {}
__path = "/_cat/segments"
__query: t.Dict[str, t.Any] = {}
if allow_closed is not None:
__query["allow_closed"] = allow_closed
if allow_no_indices is not None:
__query["allow_no_indices"] = allow_no_indices
if bytes is not None:
__query["bytes"] = bytes
if error_trace is not None:
__query["error_trace"] = error_trace
if expand_wildcards is not None:
__query["expand_wildcards"] = expand_wildcards
if filter_path is not None:
__query["filter_path"] = filter_path
if format is not None:
Expand All @@ -3439,6 +3616,10 @@ async def segments(
__query["help"] = help
if human is not None:
__query["human"] = human
if ignore_throttled is not None:
__query["ignore_throttled"] = ignore_throttled
if ignore_unavailable is not None:
__query["ignore_unavailable"] = ignore_unavailable
if local is not None:
__query["local"] = local
if master_timeout is not None:
Expand Down
16 changes: 8 additions & 8 deletions elasticsearch/_async/client/ccr.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ async def follow(
"""
.. raw:: html

<p>Create a follower.
Create a cross-cluster replication follower index that follows a specific leader index.
<p>Create a follower.</p>
<p>Create a cross-cluster replication follower index that follows a specific leader index.
When the API returns, the follower index exists and cross-cluster replication starts replicating operations from the leader index to the follower index.</p>


Expand Down Expand Up @@ -368,8 +368,8 @@ async def forget_follower(
"""
.. raw:: html

<p>Forget a follower.
Remove the cross-cluster replication follower retention leases from the leader.</p>
<p>Forget a follower.</p>
<p>Remove the cross-cluster replication follower retention leases from the leader.</p>
<p>A following index takes out retention leases on its leader index.
These leases are used to increase the likelihood that the shards of the leader index retain the history of operations that the shards of the following index need to run replication.
When a follower index is converted to a regular index by the unfollow API (either by directly calling the API or by index lifecycle management tasks), these leases are removed.
Expand Down Expand Up @@ -640,8 +640,8 @@ async def put_auto_follow_pattern(
"""
.. raw:: html

<p>Create or update auto-follow patterns.
Create a collection of cross-cluster replication auto-follow patterns for a remote cluster.
<p>Create or update auto-follow patterns.</p>
<p>Create a collection of cross-cluster replication auto-follow patterns for a remote cluster.
Newly created indices on the remote cluster that match any of the patterns are automatically configured as follower indices.
Indices on the remote cluster that were created before the auto-follow pattern was created will not be auto-followed even if they match the pattern.</p>
<p>This API can also be used to update auto-follow patterns.
Expand Down Expand Up @@ -853,8 +853,8 @@ async def resume_follow(
"""
.. raw:: html

<p>Resume a follower.
Resume a cross-cluster replication follower index that was paused.
<p>Resume a follower.</p>
<p>Resume a cross-cluster replication follower index that was paused.
The follower index could have been paused with the pause follower API.
Alternatively it could be paused due to replication that cannot be retried due to failures during following tasks.
When this API returns, the follower index will resume fetching operations from the leader index.</p>
Expand Down
Loading
Loading