Skip to content

Commit af27870

Browse files
Auto-generated API code
1 parent bbca81a commit af27870

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+4238
-1497
lines changed

elasticsearch/_async/client/__init__.py

Lines changed: 249 additions & 70 deletions
Large diffs are not rendered by default.

elasticsearch/_async/client/async_search.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ async def status(
213213
"pit",
214214
"post_filter",
215215
"profile",
216+
"project_routing",
216217
"query",
217218
"rescore",
218219
"runtime_mappings",
@@ -295,7 +296,7 @@ async def submit(
295296
t.Union[t.Mapping[str, t.Any], t.Sequence[t.Mapping[str, t.Any]]]
296297
] = None,
297298
rest_total_hits_as_int: t.Optional[bool] = None,
298-
routing: t.Optional[str] = None,
299+
routing: t.Optional[t.Union[str, t.Sequence[str]]] = None,
299300
runtime_mappings: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
300301
script_fields: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
301302
search_after: t.Optional[
@@ -533,8 +534,6 @@ async def submit(
533534
__query["preference"] = preference
534535
if pretty is not None:
535536
__query["pretty"] = pretty
536-
if project_routing is not None:
537-
__query["project_routing"] = project_routing
538537
if q is not None:
539538
__query["q"] = q
540539
if request_cache is not None:
@@ -592,6 +591,8 @@ async def submit(
592591
__body["post_filter"] = post_filter
593592
if profile is not None:
594593
__body["profile"] = profile
594+
if project_routing is not None:
595+
__body["project_routing"] = project_routing
595596
if query is not None:
596597
__body["query"] = query
597598
if rescore is not None:

elasticsearch/_async/client/autoscaling.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
class AutoscalingClient(NamespacedClient):
3434

3535
@_rewrite_parameters()
36-
@_availability_warning(Stability.STABLE, Visibility.PRIVATE)
3736
async def delete_autoscaling_policy(
3837
self,
3938
*,
@@ -89,7 +88,6 @@ async def delete_autoscaling_policy(
8988
)
9089

9190
@_rewrite_parameters()
92-
@_availability_warning(Stability.STABLE, Visibility.PRIVATE)
9391
async def get_autoscaling_capacity(
9492
self,
9593
*,
@@ -143,7 +141,6 @@ async def get_autoscaling_capacity(
143141
)
144142

145143
@_rewrite_parameters()
146-
@_availability_warning(Stability.STABLE, Visibility.PRIVATE)
147144
async def get_autoscaling_policy(
148145
self,
149146
*,
@@ -196,7 +193,6 @@ async def get_autoscaling_policy(
196193
@_rewrite_parameters(
197194
body_name="policy",
198195
)
199-
@_availability_warning(Stability.STABLE, Visibility.PRIVATE)
200196
async def put_autoscaling_policy(
201197
self,
202198
*,

elasticsearch/_async/client/cat.py

Lines changed: 182 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,149 @@ async def allocation(
328328
path_parts=__path_parts,
329329
)
330330

331+
@_rewrite_parameters()
332+
async def circuit_breaker(
333+
self,
334+
*,
335+
circuit_breaker_patterns: t.Optional[t.Union[str, t.Sequence[str]]] = None,
336+
bytes: t.Optional[
337+
t.Union[str, t.Literal["b", "gb", "kb", "mb", "pb", "tb"]]
338+
] = None,
339+
error_trace: t.Optional[bool] = None,
340+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
341+
format: t.Optional[str] = None,
342+
h: t.Optional[
343+
t.Union[
344+
t.Sequence[
345+
t.Union[
346+
str,
347+
t.Literal[
348+
"breaker",
349+
"estimated",
350+
"estimated_bytes",
351+
"limit",
352+
"limit_bytes",
353+
"node_id",
354+
"node_name",
355+
"overhead",
356+
"tripped",
357+
],
358+
]
359+
],
360+
t.Union[
361+
str,
362+
t.Literal[
363+
"breaker",
364+
"estimated",
365+
"estimated_bytes",
366+
"limit",
367+
"limit_bytes",
368+
"node_id",
369+
"node_name",
370+
"overhead",
371+
"tripped",
372+
],
373+
],
374+
]
375+
] = None,
376+
help: t.Optional[bool] = None,
377+
human: t.Optional[bool] = None,
378+
local: t.Optional[bool] = None,
379+
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
380+
pretty: t.Optional[bool] = None,
381+
s: t.Optional[t.Union[str, t.Sequence[str]]] = None,
382+
time: t.Optional[
383+
t.Union[str, t.Literal["d", "h", "m", "micros", "ms", "nanos", "s"]]
384+
] = None,
385+
v: t.Optional[bool] = None,
386+
) -> t.Union[ObjectApiResponse[t.Any], TextApiResponse]:
387+
"""
388+
.. raw:: html
389+
390+
<p>Get circuit breakers statistics.</p>
391+
<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>
392+
393+
394+
`<https://www.elastic.co/docs/api/doc/elasticsearch#TODO>`_
395+
396+
:param circuit_breaker_patterns: A comma-separated list of regular-expressions
397+
to filter the circuit breakers in the output
398+
:param bytes: Sets the units for columns that contain a byte-size value. Note
399+
that byte-size value units work in terms of powers of 1024. For instance
400+
`1kb` means 1024 bytes, not 1000 bytes. If omitted, byte-size values are
401+
rendered with a suffix such as `kb`, `mb`, or `gb`, chosen such that the
402+
numeric value of the column is as small as possible whilst still being at
403+
least `1.0`. If given, byte-size values are rendered as an integer with no
404+
suffix, representing the value of the column in the chosen unit. Values that
405+
are not an exact multiple of the chosen unit are rounded down.
406+
:param format: Specifies the format to return the columnar data in, can be set
407+
to `text`, `json`, `cbor`, `yaml`, or `smile`.
408+
:param h: A comma-separated list of columns names to display. It supports simple
409+
wildcards.
410+
:param help: When set to `true` will output available columns. This option can't
411+
be combined with any other query string option.
412+
:param local: If `true`, the request computes the list of selected nodes from
413+
the local cluster state. If `false` the list of selected nodes are computed
414+
from the cluster state of the master node. In both cases the coordinating
415+
node will send requests for further information to each selected node.
416+
:param master_timeout: Period to wait for a connection to the master node.
417+
:param s: List of columns that determine how the table should be sorted. Sorting
418+
defaults to ascending and can be changed by setting `:asc` or `:desc` as
419+
a suffix to the column name.
420+
:param time: Sets the units for columns that contain a time duration. If omitted,
421+
time duration values are rendered with a suffix such as `ms`, `s`, `m` or
422+
`h`, chosen such that the numeric value of the column is as small as possible
423+
whilst still being at least `1.0`. If given, time duration values are rendered
424+
as an integer with no suffix. Values that are not an exact multiple of the
425+
chosen unit are rounded down.
426+
:param v: When set to `true` will enable verbose output.
427+
"""
428+
__path_parts: t.Dict[str, str]
429+
if circuit_breaker_patterns not in SKIP_IN_PATH:
430+
__path_parts = {
431+
"circuit_breaker_patterns": _quote(circuit_breaker_patterns)
432+
}
433+
__path = f'/_cat/circuit_breaker/{__path_parts["circuit_breaker_patterns"]}'
434+
else:
435+
__path_parts = {}
436+
__path = "/_cat/circuit_breaker"
437+
__query: t.Dict[str, t.Any] = {}
438+
if bytes is not None:
439+
__query["bytes"] = bytes
440+
if error_trace is not None:
441+
__query["error_trace"] = error_trace
442+
if filter_path is not None:
443+
__query["filter_path"] = filter_path
444+
if format is not None:
445+
__query["format"] = format
446+
if h is not None:
447+
__query["h"] = h
448+
if help is not None:
449+
__query["help"] = help
450+
if human is not None:
451+
__query["human"] = human
452+
if local is not None:
453+
__query["local"] = local
454+
if master_timeout is not None:
455+
__query["master_timeout"] = master_timeout
456+
if pretty is not None:
457+
__query["pretty"] = pretty
458+
if s is not None:
459+
__query["s"] = s
460+
if time is not None:
461+
__query["time"] = time
462+
if v is not None:
463+
__query["v"] = v
464+
__headers = {"accept": "text/plain,application/json"}
465+
return await self.perform_request( # type: ignore[return-value]
466+
"GET",
467+
__path,
468+
params=__query,
469+
headers=__headers,
470+
endpoint_id="cat.circuit_breaker",
471+
path_parts=__path_parts,
472+
)
473+
331474
@_rewrite_parameters()
332475
async def component_templates(
333476
self,
@@ -3310,10 +3453,20 @@ async def segments(
33103453
self,
33113454
*,
33123455
index: t.Optional[t.Union[str, t.Sequence[str]]] = None,
3456+
allow_closed: t.Optional[bool] = None,
3457+
allow_no_indices: t.Optional[bool] = None,
33133458
bytes: t.Optional[
33143459
t.Union[str, t.Literal["b", "gb", "kb", "mb", "pb", "tb"]]
33153460
] = None,
33163461
error_trace: t.Optional[bool] = None,
3462+
expand_wildcards: t.Optional[
3463+
t.Union[
3464+
t.Sequence[
3465+
t.Union[str, t.Literal["all", "closed", "hidden", "none", "open"]]
3466+
],
3467+
t.Union[str, t.Literal["all", "closed", "hidden", "none", "open"]],
3468+
]
3469+
] = None,
33173470
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
33183471
format: t.Optional[str] = None,
33193472
h: t.Optional[
@@ -3364,6 +3517,8 @@ async def segments(
33643517
] = None,
33653518
help: t.Optional[bool] = None,
33663519
human: t.Optional[bool] = None,
3520+
ignore_throttled: t.Optional[bool] = None,
3521+
ignore_unavailable: t.Optional[bool] = None,
33673522
local: t.Optional[bool] = None,
33683523
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
33693524
pretty: t.Optional[bool] = None,
@@ -3387,6 +3542,14 @@ async def segments(
33873542
:param index: A comma-separated list of data streams, indices, and aliases used
33883543
to limit the request. Supports wildcards (`*`). To target all data streams
33893544
and indices, omit this parameter or use `*` or `_all`.
3545+
:param allow_closed: If true, allow closed indices to be returned in the response
3546+
otherwise if false, keep the legacy behaviour of throwing an exception if
3547+
index pattern matches closed indices
3548+
:param allow_no_indices: If false, the request returns an error if any wildcard
3549+
expression, index alias, or _all value targets only missing or closed indices.
3550+
This behavior applies even if the request targets other open indices. For
3551+
example, a request targeting foo*,bar* returns an error if an index starts
3552+
with foo but no index starts with bar.
33903553
:param bytes: Sets the units for columns that contain a byte-size value. Note
33913554
that byte-size value units work in terms of powers of 1024. For instance
33923555
`1kb` means 1024 bytes, not 1000 bytes. If omitted, byte-size values are
@@ -3395,12 +3558,20 @@ async def segments(
33953558
least `1.0`. If given, byte-size values are rendered as an integer with no
33963559
suffix, representing the value of the column in the chosen unit. Values that
33973560
are not an exact multiple of the chosen unit are rounded down.
3561+
:param expand_wildcards: Type of index that wildcard expressions can match. If
3562+
the request can target data streams, this argument determines whether wildcard
3563+
expressions match hidden data streams. Supports comma-separated values, such
3564+
as open,hidden.
33983565
:param format: Specifies the format to return the columnar data in, can be set
33993566
to `text`, `json`, `cbor`, `yaml`, or `smile`.
34003567
:param h: A comma-separated list of columns names to display. It supports simple
34013568
wildcards.
34023569
:param help: When set to `true` will output available columns. This option can't
34033570
be combined with any other query string option.
3571+
:param ignore_throttled: If true, concrete, expanded or aliased indices are ignored
3572+
when frozen.
3573+
:param ignore_unavailable: If true, missing or closed indices are not included
3574+
in the response.
34043575
:param local: If `true`, the request computes the list of selected nodes from
34053576
the local cluster state. If `false` the list of selected nodes are computed
34063577
from the cluster state of the master node. In both cases the coordinating
@@ -3425,10 +3596,16 @@ async def segments(
34253596
__path_parts = {}
34263597
__path = "/_cat/segments"
34273598
__query: t.Dict[str, t.Any] = {}
3599+
if allow_closed is not None:
3600+
__query["allow_closed"] = allow_closed
3601+
if allow_no_indices is not None:
3602+
__query["allow_no_indices"] = allow_no_indices
34283603
if bytes is not None:
34293604
__query["bytes"] = bytes
34303605
if error_trace is not None:
34313606
__query["error_trace"] = error_trace
3607+
if expand_wildcards is not None:
3608+
__query["expand_wildcards"] = expand_wildcards
34323609
if filter_path is not None:
34333610
__query["filter_path"] = filter_path
34343611
if format is not None:
@@ -3439,6 +3616,10 @@ async def segments(
34393616
__query["help"] = help
34403617
if human is not None:
34413618
__query["human"] = human
3619+
if ignore_throttled is not None:
3620+
__query["ignore_throttled"] = ignore_throttled
3621+
if ignore_unavailable is not None:
3622+
__query["ignore_unavailable"] = ignore_unavailable
34423623
if local is not None:
34433624
__query["local"] = local
34443625
if master_timeout is not None:
@@ -3870,7 +4051,7 @@ async def snapshots(
38704051
)
38714052

38724053
@_rewrite_parameters()
3873-
@_availability_warning(Stability.EXPERIMENTAL)
4054+
@_stability_warning(Stability.EXPERIMENTAL)
38744055
async def tasks(
38754056
self,
38764057
*,

elasticsearch/_async/client/ccr.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ async def follow(
125125
"""
126126
.. raw:: html
127127
128-
<p>Create a follower.
129-
Create a cross-cluster replication follower index that follows a specific leader index.
128+
<p>Create a follower.</p>
129+
<p>Create a cross-cluster replication follower index that follows a specific leader index.
130130
When the API returns, the follower index exists and cross-cluster replication starts replicating operations from the leader index to the follower index.</p>
131131
132132
@@ -368,8 +368,8 @@ async def forget_follower(
368368
"""
369369
.. raw:: html
370370
371-
<p>Forget a follower.
372-
Remove the cross-cluster replication follower retention leases from the leader.</p>
371+
<p>Forget a follower.</p>
372+
<p>Remove the cross-cluster replication follower retention leases from the leader.</p>
373373
<p>A following index takes out retention leases on its leader index.
374374
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.
375375
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.
@@ -640,8 +640,8 @@ async def put_auto_follow_pattern(
640640
"""
641641
.. raw:: html
642642
643-
<p>Create or update auto-follow patterns.
644-
Create a collection of cross-cluster replication auto-follow patterns for a remote cluster.
643+
<p>Create or update auto-follow patterns.</p>
644+
<p>Create a collection of cross-cluster replication auto-follow patterns for a remote cluster.
645645
Newly created indices on the remote cluster that match any of the patterns are automatically configured as follower indices.
646646
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>
647647
<p>This API can also be used to update auto-follow patterns.
@@ -853,8 +853,8 @@ async def resume_follow(
853853
"""
854854
.. raw:: html
855855
856-
<p>Resume a follower.
857-
Resume a cross-cluster replication follower index that was paused.
856+
<p>Resume a follower.</p>
857+
<p>Resume a cross-cluster replication follower index that was paused.
858858
The follower index could have been paused with the pause follower API.
859859
Alternatively it could be paused due to replication that cannot be retried due to failures during following tasks.
860860
When this API returns, the follower index will resume fetching operations from the leader index.</p>

0 commit comments

Comments
 (0)