@@ -2895,10 +2895,20 @@ async def segments(
28952895 self ,
28962896 * ,
28972897 index : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
2898+ allow_closed : t .Optional [bool ] = None ,
2899+ allow_no_indices : t .Optional [bool ] = None ,
28982900 bytes : t .Optional [
28992901 t .Union [str , t .Literal ["b" , "gb" , "kb" , "mb" , "pb" , "tb" ]]
29002902 ] = None ,
29012903 error_trace : t .Optional [bool ] = None ,
2904+ expand_wildcards : t .Optional [
2905+ t .Union [
2906+ t .Sequence [
2907+ t .Union [str , t .Literal ["all" , "closed" , "hidden" , "none" , "open" ]]
2908+ ],
2909+ t .Union [str , t .Literal ["all" , "closed" , "hidden" , "none" , "open" ]],
2910+ ]
2911+ ] = None ,
29022912 filter_path : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
29032913 format : t .Optional [str ] = None ,
29042914 h : t .Optional [
@@ -2949,6 +2959,8 @@ async def segments(
29492959 ] = None ,
29502960 help : t .Optional [bool ] = None ,
29512961 human : t .Optional [bool ] = None ,
2962+ ignore_throttled : t .Optional [bool ] = None ,
2963+ ignore_unavailable : t .Optional [bool ] = None ,
29522964 local : t .Optional [bool ] = None ,
29532965 master_timeout : t .Optional [t .Union [str , t .Literal [- 1 ], t .Literal [0 ]]] = None ,
29542966 pretty : t .Optional [bool ] = None ,
@@ -2972,6 +2984,14 @@ async def segments(
29722984 :param index: A comma-separated list of data streams, indices, and aliases used
29732985 to limit the request. Supports wildcards (`*`). To target all data streams
29742986 and indices, omit this parameter or use `*` or `_all`.
2987+ :param allow_closed: If true, allow closed indices to be returned in the response
2988+ otherwise if false, keep the legacy behaviour of throwing an exception if
2989+ index pattern matches closed indices
2990+ :param allow_no_indices: If false, the request returns an error if any wildcard
2991+ expression, index alias, or _all value targets only missing or closed indices.
2992+ This behavior applies even if the request targets other open indices. For
2993+ example, a request targeting foo*,bar* returns an error if an index starts
2994+ with foo but no index starts with bar.
29752995 :param bytes: Sets the units for columns that contain a byte-size value. Note
29762996 that byte-size value units work in terms of powers of 1024. For instance
29772997 `1kb` means 1024 bytes, not 1000 bytes. If omitted, byte-size values are
@@ -2980,12 +3000,20 @@ async def segments(
29803000 least `1.0`. If given, byte-size values are rendered as an integer with no
29813001 suffix, representing the value of the column in the chosen unit. Values that
29823002 are not an exact multiple of the chosen unit are rounded down.
3003+ :param expand_wildcards: Type of index that wildcard expressions can match. If
3004+ the request can target data streams, this argument determines whether wildcard
3005+ expressions match hidden data streams. Supports comma-separated values, such
3006+ as open,hidden.
29833007 :param format: Specifies the format to return the columnar data in, can be set
29843008 to `text`, `json`, `cbor`, `yaml`, or `smile`.
29853009 :param h: A comma-separated list of columns names to display. It supports simple
29863010 wildcards.
29873011 :param help: When set to `true` will output available columns. This option can't
29883012 be combined with any other query string option.
3013+ :param ignore_throttled: If true, concrete, expanded or aliased indices are ignored
3014+ when frozen.
3015+ :param ignore_unavailable: If true, missing or closed indices are not included
3016+ in the response.
29893017 :param local: If `true`, the request computes the list of selected nodes from
29903018 the local cluster state. If `false` the list of selected nodes are computed
29913019 from the cluster state of the master node. In both cases the coordinating
@@ -3010,10 +3038,16 @@ async def segments(
30103038 __path_parts = {}
30113039 __path = "/_cat/segments"
30123040 __query : t .Dict [str , t .Any ] = {}
3041+ if allow_closed is not None :
3042+ __query ["allow_closed" ] = allow_closed
3043+ if allow_no_indices is not None :
3044+ __query ["allow_no_indices" ] = allow_no_indices
30133045 if bytes is not None :
30143046 __query ["bytes" ] = bytes
30153047 if error_trace is not None :
30163048 __query ["error_trace" ] = error_trace
3049+ if expand_wildcards is not None :
3050+ __query ["expand_wildcards" ] = expand_wildcards
30173051 if filter_path is not None :
30183052 __query ["filter_path" ] = filter_path
30193053 if format is not None :
@@ -3024,6 +3058,10 @@ async def segments(
30243058 __query ["help" ] = help
30253059 if human is not None :
30263060 __query ["human" ] = human
3061+ if ignore_throttled is not None :
3062+ __query ["ignore_throttled" ] = ignore_throttled
3063+ if ignore_unavailable is not None :
3064+ __query ["ignore_unavailable" ] = ignore_unavailable
30273065 if local is not None :
30283066 __query ["local" ] = local
30293067 if master_timeout is not None :
0 commit comments