Skip to content

Commit 9526c29

Browse files
committed
Add common cat API parameters for unit rendering
Describes the `?bytes=`, `?size=` and `?time=` parameters which are accepted by all the `GET _cat/...` APIs.
1 parent f5e72ea commit 9526c29

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

specification/_spec_utils/behaviors.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,28 @@ export interface CommonCatQueryParameters {
9797
* @server_default false
9898
*/
9999
v?: boolean
100+
/**
101+
* Sets the units for columns that contain a byte-size value.
102+
* Note that byte-size value units work in terms of powers of 1024. For instance `1kb` means 1024 bytes, not 1000 bytes.
103+
* 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`.
104+
* If given, byte-size values are rendered as an integer with no suffix, representing the value of the column in the chosen unit.
105+
* Values that are not an exact multiple of the chosen unit are rounded down.
106+
*/
107+
bytes?: 'b' | 'kb' | 'mb' | 'gb' | 'tb' | 'pb'
108+
/**
109+
* Sets the units for columns that contain a size value which is not a byte-size value.
110+
* If omitted, size values are rendered with a suffix such as `k`, `m`, or `g`, chosen such that the numeric value of the column is as small as possible whilst still being at least `1.0`.
111+
* If given, size values are rendered as an integer with no suffix, representing the value of the column in the chosen unit.
112+
* Values that are not an exact multiple of the chosen unit are rounded down.
113+
*/
114+
size?: '' | 'k' | 'm' | 'g' | 't' | 'p'
115+
/**
116+
* Sets the units for columns that contain a time duration.
117+
* 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`.
118+
* If given, time duration values are rendered as an integer with no suffix.
119+
* Values that are not an exact multiple of the chosen unit are rounded down.
120+
*/
121+
time?: 'nanos' | 'micros' | 'ms' | 's' | 'm' | 'h' | 'd'
100122
}
101123

102124
/**

0 commit comments

Comments
 (0)