Default _cat APIs to verbose

`?v=false` can be used if the headers are not desired.

Resolves #8922

Fixes #8927
This commit is contained in:
Lee Hinman 2014-12-12 14:51:20 +01:00 committed by Jordan Sissel
parent e47b753617
commit 9b18c44b67
23 changed files with 62 additions and 32 deletions

View File

@ -32,7 +32,7 @@
"v": { "v": {
"type": "boolean", "type": "boolean",
"description": "Verbose mode. Display column headers", "description": "Verbose mode. Display column headers",
"default": false "default": true
} }
} }
}, },

View File

@ -37,7 +37,7 @@
"v": { "v": {
"type": "boolean", "type": "boolean",
"description": "Verbose mode. Display column headers", "description": "Verbose mode. Display column headers",
"default": false "default": true
} }
} }
}, },

View File

@ -32,7 +32,7 @@
"v": { "v": {
"type": "boolean", "type": "boolean",
"description": "Verbose mode. Display column headers", "description": "Verbose mode. Display column headers",
"default": false "default": true
} }
} }
}, },

View File

@ -37,7 +37,7 @@
"v": { "v": {
"type": "boolean", "type": "boolean",
"description": "Verbose mode. Display column headers", "description": "Verbose mode. Display column headers",
"default": false "default": true
}, },
"fields": { "fields": {
"type": "list", "type": "list",

View File

@ -33,7 +33,7 @@
"v": { "v": {
"type": "boolean", "type": "boolean",
"description": "Verbose mode. Display column headers", "description": "Verbose mode. Display column headers",
"default": false "default": true
} }
} }
}, },

View File

@ -42,7 +42,7 @@
"v": { "v": {
"type": "boolean", "type": "boolean",
"description": "Verbose mode. Display column headers", "description": "Verbose mode. Display column headers",
"default": false "default": true
} }
} }
}, },

View File

@ -28,7 +28,7 @@
"v": { "v": {
"type": "boolean", "type": "boolean",
"description": "Verbose mode. Display column headers", "description": "Verbose mode. Display column headers",
"default": false "default": true
} }
} }
}, },

View File

@ -28,7 +28,7 @@
"v": { "v": {
"type": "boolean", "type": "boolean",
"description": "Verbose mode. Display column headers", "description": "Verbose mode. Display column headers",
"default": false "default": true
} }
} }
}, },

View File

@ -28,7 +28,7 @@
"v": { "v": {
"type": "boolean", "type": "boolean",
"description": "Verbose mode. Display column headers", "description": "Verbose mode. Display column headers",
"default": false "default": true
} }
} }
}, },

View File

@ -26,7 +26,7 @@
"v": { "v": {
"type": "boolean", "type": "boolean",
"description": "Verbose mode. Display column headers", "description": "Verbose mode. Display column headers",
"default": false "default": true
} }
} }
}, },

View File

@ -33,7 +33,7 @@
"v": { "v": {
"type": "boolean", "type": "boolean",
"description": "Verbose mode. Display column headers", "description": "Verbose mode. Display column headers",
"default": false "default": true
} }
} }
}, },

View File

@ -32,7 +32,7 @@
"v": { "v": {
"type": "boolean", "type": "boolean",
"description": "Verbose mode. Display column headers", "description": "Verbose mode. Display column headers",
"default": false "default": true
} }
} }
}, },

View File

@ -28,7 +28,7 @@
"v": { "v": {
"type": "boolean", "type": "boolean",
"description": "Verbose mode. Display column headers", "description": "Verbose mode. Display column headers",
"default": false "default": true
}, },
"full_id": { "full_id": {
"type": "boolean", "type": "boolean",

View File

@ -17,7 +17,8 @@
"Empty cluster": "Empty cluster":
- do: - do:
cat.aliases: {} cat.aliases:
v: false
- match: - match:
$body: | $body: |
@ -37,7 +38,8 @@
name: test_alias name: test_alias
- do: - do:
cat.aliases: {} cat.aliases:
v: false
- match: - match:
$body: | $body: |
@ -73,7 +75,8 @@
term: term:
foo: bar foo: bar
- do: - do:
cat.aliases: {} cat.aliases:
v: false
- match: - match:
$body: | $body: |
@ -105,12 +108,14 @@
- do: - do:
cat.aliases: cat.aliases:
name: test_1 name: test_1
v: false
- match: - match:
$body: /^test_1 .+ \n$/ $body: /^test_1 .+ \n$/
- do: - do:
cat.aliases: cat.aliases:
v: false
name: test_2 name: test_2
- match: - match:
@ -118,6 +123,7 @@
- do: - do:
cat.aliases: cat.aliases:
v: false
name: test_* name: test_*
- match: - match:
@ -172,6 +178,7 @@
- do: - do:
cat.aliases: cat.aliases:
v: false
h: [index, alias] h: [index, alias]
- match: - match:

View File

@ -3,6 +3,7 @@
- do: - do:
cat.allocation: cat.allocation:
help: true help: true
v: false
- match: - match:
$body: | $body: |
@ -20,7 +21,8 @@
"Empty cluster": "Empty cluster":
- do: - do:
cat.allocation: {} cat.allocation:
v: false
- match: - match:
$body: | $body: |
@ -50,7 +52,8 @@
timeout: 1s timeout: 1s
- do: - do:
cat.allocation: {} cat.allocation:
v: false
- match: - match:
$body: | $body: |
@ -80,6 +83,7 @@
- do: - do:
cat.allocation: cat.allocation:
node_id: _master node_id: _master
v: false
- match: - match:
$body: | $body: |
@ -99,6 +103,7 @@
- do: - do:
cat.allocation: cat.allocation:
node_id: non_existent node_id: non_existent
v: false
- match: - match:
$body: | $body: |
@ -143,6 +148,7 @@
- do: - do:
cat.allocation: cat.allocation:
h: [disk.percent, node] h: [disk.percent, node]
v: false
- match: - match:
$body: | $body: |
@ -179,6 +185,7 @@
- do: - do:
cat.allocation: cat.allocation:
bytes: g bytes: g
v: false
- match: - match:
$body: | $body: |

View File

@ -14,7 +14,8 @@
"Test cat count output": "Test cat count output":
- do: - do:
cat.count: {} cat.count:
v: false
- match: - match:
$body: | $body: |
@ -30,7 +31,8 @@
refresh: true refresh: true
- do: - do:
cat.count: {} cat.count:
v: false
- match: - match:
$body: | $body: |
@ -48,6 +50,7 @@
- do: - do:
cat.count: cat.count:
h: count h: count
v: false
- match: - match:
$body: | $body: |
@ -58,6 +61,7 @@
- do: - do:
cat.count: cat.count:
index: index1 index: index1
v: false
- match: - match:
$body: | $body: |

View File

@ -17,7 +17,8 @@
"Test cat fielddata output": "Test cat fielddata output":
- do: - do:
cat.fielddata: {} cat.fielddata:
v: false
- do: - do:
index: index:

View File

@ -2,7 +2,8 @@
"Test cat indices output": "Test cat indices output":
- do: - do:
cat.indices: {} cat.indices:
v: false
- match: - match:
$body: | $body: |
@ -19,7 +20,8 @@
cluster.health: cluster.health:
wait_for_status: yellow wait_for_status: yellow
- do: - do:
cat.indices: {} cat.indices:
v: false
- match: - match:
$body: | $body: |

View File

@ -2,7 +2,8 @@
"Test cat nodes output": "Test cat nodes output":
- do: - do:
cat.nodes: {} cat.nodes:
v: false
- match: - match:
$body: | $body: |

View File

@ -2,7 +2,8 @@
"Test cat recovery output": "Test cat recovery output":
- do: - do:
cat.recovery: {} cat.recovery:
v: false
- match: - match:
$body: | $body: |
@ -19,7 +20,8 @@
cluster.health: cluster.health:
wait_for_status: yellow wait_for_status: yellow
- do: - do:
cat.recovery: {} cat.recovery:
v: false
- match: - match:
$body: | $body: |

View File

@ -2,7 +2,8 @@
"Test cat shards output": "Test cat shards output":
- do: - do:
cat.shards: {} cat.shards:
v: false
- match: - match:
$body: | $body: |
@ -19,7 +20,8 @@
cluster.health: cluster.health:
wait_for_status: yellow wait_for_status: yellow
- do: - do:
cat.shards: {} cat.shards:
v: false
- match: - match:
$body: | $body: |
@ -38,7 +40,8 @@
wait_for_relocating_shards: 0 wait_for_relocating_shards: 0
- do: - do:
cat.shards: {} cat.shards:
v: false
- match: - match:
$body: | $body: |
/^(index(1|2) \s+ \d \s+ (p|r) \s+ ((STARTED|INITIALIZING) \s+ (\d \s+ (\d+|\d+[.]\d+)(kb|b) \s+)? \d{1,3}.\d{1,3}.\d{1,3}.\d{1,3} \s+ .+|UNASSIGNED \s+) \n?){15}$/ /^(index(1|2) \s+ \d \s+ (p|r) \s+ ((STARTED|INITIALIZING) \s+ (\d \s+ (\d+|\d+[.]\d+)(kb|b) \s+)? \d{1,3}.\d{1,3}.\d{1,3}.\d{1,3} \s+ .+|UNASSIGNED \s+) \n?){15}$/
@ -46,6 +49,7 @@
- do: - do:
cat.shards: cat.shards:
index: index2 index: index2
v: false
- match: - match:
$body: | $body: |
/^(index2 \s+ \d \s+ (p|r) \s+ ((STARTED|INITIALIZING) \s+ (\d \s+ (\d+|\d+[.]\d+)(kb|b) \s+)? \d{1,3}.\d{1,3}.\d{1,3}.\d{1,3} \s+ .+|UNASSIGNED \s+) \n?){5}$/ /^(index2 \s+ \d \s+ (p|r) \s+ ((STARTED|INITIALIZING) \s+ (\d \s+ (\d+|\d+[.]\d+)(kb|b) \s+)? \d{1,3}.\d{1,3}.\d{1,3}.\d{1,3} \s+ .+|UNASSIGNED \s+) \n?){5}$/

View File

@ -2,7 +2,8 @@
"Test cat thread_pool output": "Test cat thread_pool output":
- do: - do:
cat.thread_pool: {} cat.thread_pool:
v: false
- match: - match:
$body: | $body: |
@ -21,6 +22,7 @@
- do: - do:
cat.thread_pool: cat.thread_pool:
h: pid,id,h,i,po h: pid,id,h,i,po
v: false
- match: - match:
$body: | $body: |

View File

@ -68,7 +68,7 @@ public class RestTable {
public static RestResponse buildTextPlainResponse(Table table, RestChannel channel) throws IOException { public static RestResponse buildTextPlainResponse(Table table, RestChannel channel) throws IOException {
RestRequest request = channel.request(); RestRequest request = channel.request();
boolean verbose = request.paramAsBoolean("v", false); boolean verbose = request.paramAsBoolean("v", true);
List<DisplayHeader> headers = buildDisplayHeaders(table, request); List<DisplayHeader> headers = buildDisplayHeaders(table, request);
int[] width = buildWidths(table, request, verbose, headers); int[] width = buildWidths(table, request, verbose, headers);