@@ -3301,10 +3301,20 @@ async def segments(
33013301 self ,
33023302 * ,
33033303 index : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
3304+ allow_closed : t .Optional [bool ] = None ,
3305+ allow_no_indices : t .Optional [bool ] = None ,
33043306 bytes : t .Optional [
33053307 t .Union [str , t .Literal ["b" , "gb" , "kb" , "mb" , "pb" , "tb" ]]
33063308 ] = None ,
33073309 error_trace : t .Optional [bool ] = None ,
3310+ expand_wildcards : t .Optional [
3311+ t .Union [
3312+ t .Sequence [
3313+ t .Union [str , t .Literal ["all" , "closed" , "hidden" , "none" , "open" ]]
3314+ ],
3315+ t .Union [str , t .Literal ["all" , "closed" , "hidden" , "none" , "open" ]],
3316+ ]
3317+ ] = None ,
33083318 filter_path : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
33093319 format : t .Optional [str ] = None ,
33103320 h : t .Optional [
@@ -3355,6 +3365,8 @@ async def segments(
33553365 ] = None ,
33563366 help : t .Optional [bool ] = None ,
33573367 human : t .Optional [bool ] = None ,
3368+ ignore_throttled : t .Optional [bool ] = None ,
3369+ ignore_unavailable : t .Optional [bool ] = None ,
33583370 local : t .Optional [bool ] = None ,
33593371 master_timeout : t .Optional [t .Union [str , t .Literal [- 1 ], t .Literal [0 ]]] = None ,
33603372 pretty : t .Optional [bool ] = None ,
@@ -3378,6 +3390,14 @@ async def segments(
33783390 :param index: A comma-separated list of data streams, indices, and aliases used
33793391 to limit the request. Supports wildcards (`*`). To target all data streams
33803392 and indices, omit this parameter or use `*` or `_all`.
3393+ :param allow_closed: If true, allow closed indices to be returned in the response
3394+ otherwise if false, keep the legacy behaviour of throwing an exception if
3395+ index pattern matches closed indices
3396+ :param allow_no_indices: If false, the request returns an error if any wildcard
3397+ expression, index alias, or _all value targets only missing or closed indices.
3398+ This behavior applies even if the request targets other open indices. For
3399+ example, a request targeting foo*,bar* returns an error if an index starts
3400+ with foo but no index starts with bar.
33813401 :param bytes: Sets the units for columns that contain a byte-size value. Note
33823402 that byte-size value units work in terms of powers of 1024. For instance
33833403 `1kb` means 1024 bytes, not 1000 bytes. If omitted, byte-size values are
@@ -3386,12 +3406,20 @@ async def segments(
33863406 least `1.0`. If given, byte-size values are rendered as an integer with no
33873407 suffix, representing the value of the column in the chosen unit. Values that
33883408 are not an exact multiple of the chosen unit are rounded down.
3409+ :param expand_wildcards: Type of index that wildcard expressions can match. If
3410+ the request can target data streams, this argument determines whether wildcard
3411+ expressions match hidden data streams. Supports comma-separated values, such
3412+ as open,hidden.
33893413 :param format: Specifies the format to return the columnar data in, can be set
33903414 to `text`, `json`, `cbor`, `yaml`, or `smile`.
33913415 :param h: A comma-separated list of columns names to display. It supports simple
33923416 wildcards.
33933417 :param help: When set to `true` will output available columns. This option can't
33943418 be combined with any other query string option.
3419+ :param ignore_throttled: If true, concrete, expanded or aliased indices are ignored
3420+ when frozen.
3421+ :param ignore_unavailable: If true, missing or closed indices are not included
3422+ in the response.
33953423 :param local: If `true`, the request computes the list of selected nodes from
33963424 the local cluster state. If `false` the list of selected nodes are computed
33973425 from the cluster state of the master node. In both cases the coordinating
@@ -3416,10 +3444,16 @@ async def segments(
34163444 __path_parts = {}
34173445 __path = "/_cat/segments"
34183446 __query : t .Dict [str , t .Any ] = {}
3447+ if allow_closed is not None :
3448+ __query ["allow_closed" ] = allow_closed
3449+ if allow_no_indices is not None :
3450+ __query ["allow_no_indices" ] = allow_no_indices
34193451 if bytes is not None :
34203452 __query ["bytes" ] = bytes
34213453 if error_trace is not None :
34223454 __query ["error_trace" ] = error_trace
3455+ if expand_wildcards is not None :
3456+ __query ["expand_wildcards" ] = expand_wildcards
34233457 if filter_path is not None :
34243458 __query ["filter_path" ] = filter_path
34253459 if format is not None :
@@ -3430,6 +3464,10 @@ async def segments(
34303464 __query ["help" ] = help
34313465 if human is not None :
34323466 __query ["human" ] = human
3467+ if ignore_throttled is not None :
3468+ __query ["ignore_throttled" ] = ignore_throttled
3469+ if ignore_unavailable is not None :
3470+ __query ["ignore_unavailable" ] = ignore_unavailable
34333471 if local is not None :
34343472 __query ["local" ] = local
34353473 if master_timeout is not None :
0 commit comments