summaryrefslogtreecommitdiff
path: root/rest-api-spec/src
diff options
context:
space:
mode:
authorAndreas Gebhardt <agebhar1@googlemail.com>2017-06-28 18:20:20 +0200
committerLuca Cavanna <javanna@users.noreply.github.com>2017-06-28 18:20:20 +0200
commita156ccd80ed7ef2dcc26b2ff1e9b6c9d5a831092 (patch)
tree6aab685d44fdd3a3abfa21dbb364839d25c20b67 /rest-api-spec/src
parent5f8be0e090f788d9132c2c371f3ecb9c4129bd8e (diff)
Expand `/_cat/nodes` to return information about hard drive (#21775)
Expand `/_cat/nodes` with already present information about available disk space `diskAvail` (alias: `d`, `disk`) by: * `diskTotal` (alias `dt`): total disk space * `diskUsed` (alias `du`): used disk space (`diskTotal - diskAvail`) * `diskUsedPercent` (alias `dup`): used disk space percentage Note: The available disk space is the number of bytes available to the node's Java virtual machine. The size might be smaller than the real one. That means the used disk space (percentage) is larger. Closes #21679
Diffstat (limited to 'rest-api-spec/src')
-rwxr-xr-xrest-api-spec/src/main/resources/rest-api-spec/test/cat.nodes/10_basic.yml32
1 files changed, 32 insertions, 0 deletions
diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/cat.nodes/10_basic.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/cat.nodes/10_basic.yml
index f48f73cb47..e1225ef5da 100755
--- a/rest-api-spec/src/main/resources/rest-api-spec/test/cat.nodes/10_basic.yml
+++ b/rest-api-spec/src/main/resources/rest-api-spec/test/cat.nodes/10_basic.yml
@@ -59,6 +59,38 @@
/^ http \n ((\d{1,3}\.){3}\d{1,3}:\d{1,5}\n)+ $/
---
+"Additional disk information":
+ - skip:
+ version: " - 5.5.99"
+ reason: additional disk info added in 5.6.0
+
+ - do:
+ cat.nodes:
+ h: diskAvail,diskTotal,diskUsed,diskUsedPercent
+ v: true
+
+ - match:
+ # leading whitespace on columns and optional whitespace on values is necessary
+ # because `diskAvail` is right aligned and text representation of disk size might be
+ # longer so it's padded with leading whitespace
+ $body: |
+ /^ \s* diskAvail \s+ diskTotal \s+ diskUsed \s+ diskUsedPercent \n
+ (\s* \d+(\.\d+)?[ptgmk]?b \s+ \d+(\.\d+)?[ptgmk]?b \s+ \d+(\.\d+)?[ptgmk]?b\s+ (100\.00 | \d{1,2}\.\d{2}) \n)+ $/
+
+ - do:
+ cat.nodes:
+ h: disk,dt,du,dup
+ v: true
+
+ - match:
+ # leading whitespace on columns and optional whitespace on values is necessary
+ # because `disk` is right aligned and text representation of disk size might be
+ # longer so it's padded with leading whitespace
+ $body: |
+ /^ \s* disk \s+ dt \s+ du \s+ dup \n
+ (\s* \d+(\.\d+)?[ptgmk]?b \s+ \d+(\.\d+)?[ptgmk]?b \s+ \d+(\.\d+)?[ptgmk]?b\s+ (100\.00 | \d{1,2}\.\d{2}) \n)+ $/
+
+---
"Test cat nodes output with full_id set":
- skip:
version: " - 5.0.0"