@@ -3310,10 +3310,20 @@ async def segments(
33103310 self ,
33113311 * ,
33123312 index : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
3313+ allow_closed : t .Optional [bool ] = None ,
3314+ allow_no_indices : t .Optional [bool ] = None ,
33133315 bytes : t .Optional [
33143316 t .Union [str , t .Literal ["b" , "gb" , "kb" , "mb" , "pb" , "tb" ]]
33153317 ] = None ,
33163318 error_trace : t .Optional [bool ] = None ,
3319+ expand_wildcards : t .Optional [
3320+ t .Union [
3321+ t .Sequence [
3322+ t .Union [str , t .Literal ["all" , "closed" , "hidden" , "none" , "open" ]]
3323+ ],
3324+ t .Union [str , t .Literal ["all" , "closed" , "hidden" , "none" , "open" ]],
3325+ ]
3326+ ] = None ,
33173327 filter_path : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
33183328 format : t .Optional [str ] = None ,
33193329 h : t .Optional [
@@ -3364,6 +3374,8 @@ async def segments(
33643374 ] = None ,
33653375 help : t .Optional [bool ] = None ,
33663376 human : t .Optional [bool ] = None ,
3377+ ignore_throttled : t .Optional [bool ] = None ,
3378+ ignore_unavailable : t .Optional [bool ] = None ,
33673379 local : t .Optional [bool ] = None ,
33683380 master_timeout : t .Optional [t .Union [str , t .Literal [- 1 ], t .Literal [0 ]]] = None ,
33693381 pretty : t .Optional [bool ] = None ,
@@ -3387,6 +3399,14 @@ async def segments(
33873399 :param index: A comma-separated list of data streams, indices, and aliases used
33883400 to limit the request. Supports wildcards (`*`). To target all data streams
33893401 and indices, omit this parameter or use `*` or `_all`.
3402+ :param allow_closed: If true, allow closed indices to be returned in the response
3403+ otherwise if false, keep the legacy behaviour of throwing an exception if
3404+ index pattern matches closed indices
3405+ :param allow_no_indices: If false, the request returns an error if any wildcard
3406+ expression, index alias, or _all value targets only missing or closed indices.
3407+ This behavior applies even if the request targets other open indices. For
3408+ example, a request targeting foo*,bar* returns an error if an index starts
3409+ with foo but no index starts with bar.
33903410 :param bytes: Sets the units for columns that contain a byte-size value. Note
33913411 that byte-size value units work in terms of powers of 1024. For instance
33923412 `1kb` means 1024 bytes, not 1000 bytes. If omitted, byte-size values are
@@ -3395,12 +3415,20 @@ async def segments(
33953415 least `1.0`. If given, byte-size values are rendered as an integer with no
33963416 suffix, representing the value of the column in the chosen unit. Values that
33973417 are not an exact multiple of the chosen unit are rounded down.
3418+ :param expand_wildcards: Type of index that wildcard expressions can match. If
3419+ the request can target data streams, this argument determines whether wildcard
3420+ expressions match hidden data streams. Supports comma-separated values, such
3421+ as open,hidden.
33983422 :param format: Specifies the format to return the columnar data in, can be set
33993423 to `text`, `json`, `cbor`, `yaml`, or `smile`.
34003424 :param h: A comma-separated list of columns names to display. It supports simple
34013425 wildcards.
34023426 :param help: When set to `true` will output available columns. This option can't
34033427 be combined with any other query string option.
3428+ :param ignore_throttled: If true, concrete, expanded or aliased indices are ignored
3429+ when frozen.
3430+ :param ignore_unavailable: If true, missing or closed indices are not included
3431+ in the response.
34043432 :param local: If `true`, the request computes the list of selected nodes from
34053433 the local cluster state. If `false` the list of selected nodes are computed
34063434 from the cluster state of the master node. In both cases the coordinating
@@ -3425,10 +3453,16 @@ async def segments(
34253453 __path_parts = {}
34263454 __path = "/_cat/segments"
34273455 __query : t .Dict [str , t .Any ] = {}
3456+ if allow_closed is not None :
3457+ __query ["allow_closed" ] = allow_closed
3458+ if allow_no_indices is not None :
3459+ __query ["allow_no_indices" ] = allow_no_indices
34283460 if bytes is not None :
34293461 __query ["bytes" ] = bytes
34303462 if error_trace is not None :
34313463 __query ["error_trace" ] = error_trace
3464+ if expand_wildcards is not None :
3465+ __query ["expand_wildcards" ] = expand_wildcards
34323466 if filter_path is not None :
34333467 __query ["filter_path" ] = filter_path
34343468 if format is not None :
@@ -3439,6 +3473,10 @@ async def segments(
34393473 __query ["help" ] = help
34403474 if human is not None :
34413475 __query ["human" ] = human
3476+ if ignore_throttled is not None :
3477+ __query ["ignore_throttled" ] = ignore_throttled
3478+ if ignore_unavailable is not None :
3479+ __query ["ignore_unavailable" ] = ignore_unavailable
34423480 if local is not None :
34433481 __query ["local" ] = local
34443482 if master_timeout is not None :
0 commit comments