Skip to content

Commit 45dd378

Browse files
committed
CONSOLEify remaining _cat docs
Relates to #18160
1 parent 4862544 commit 45dd378

File tree

4 files changed

+73
-34
lines changed

4 files changed

+73
-34
lines changed

docs/build.gradle

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ buildRestTests.expectedUnconvertedCandidates = [
3838
'reference/aggregations/metrics/percentile-rank-aggregation.asciidoc',
3939
'reference/aggregations/metrics/scripted-metric-aggregation.asciidoc',
4040
'reference/aggregations/metrics/tophits-aggregation.asciidoc',
41-
'reference/cat/snapshots.asciidoc',
42-
'reference/cat/templates.asciidoc',
43-
'reference/cat/thread_pool.asciidoc',
4441
'reference/cluster/allocation-explain.asciidoc',
4542
'reference/cluster/nodes-info.asciidoc',
4643
'reference/cluster/nodes-stats.asciidoc',

docs/reference/cat/snapshots.asciidoc

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,30 @@ The `snapshots` command shows all snapshots that belong to a specific repository
55
To find a list of available repositories to query, the command `/_cat/repositories` can be used.
66
Querying the snapshots of a repository named `repo1` then looks as follows.
77

8-
[source,sh]
8+
[source,js]
9+
--------------------------------------------------
10+
GET /_cat/snapshots/repo1?v&s=id
11+
--------------------------------------------------
12+
// CONSOLE
13+
// TEST[s/^/PUT \/_snapshot\/repo1\/snap1?wait_for_completion=true\n/]
14+
// TEST[s/^/PUT \/_snapshot\/repo1\/snap2?wait_for_completion=true\n/]
15+
// TEST[s/^/PUT \/_snapshot\/repo1\n{"type": "fs", "settings": {"location": "repo\/1"}}\n/]
16+
17+
Which looks like:
18+
19+
[source,txt]
920
--------------------------------------------------
10-
% curl 'localhost:9200/_cat/snapshots/repo1?v'
1121
id status start_epoch start_time end_epoch end_time duration indices successful_shards failed_shards total_shards
1222
snap1 FAILED 1445616705 18:11:45 1445616978 18:16:18 4.6m 1 4 1 5
1323
snap2 SUCCESS 1445634298 23:04:58 1445634672 23:11:12 6.2m 2 10 0 10
1424
--------------------------------------------------
25+
// TESTRESPONSE[s/FAILED/SUCCESS/ s/14456\d+/\\d+/ s/\d+(\.\d+)?(m|s|ms)/\\d+(\\.\\d+)?(m|s|ms)/]
26+
// TESTRESPONSE[s/\d+:\d+:\d+/\\d+:\\d+:\\d+/]
27+
// TESTRESPONSE[s/1 4 1 5/\\d+ \\d+ \\d+ \\d+/]
28+
// TESTRESPONSE[s/2 10 0 10/\\d+ \\d+ \\d+ \\d+/]
29+
// TESTRESPONSE[_cat]
1530

1631
Each snapshot contains information about when it was started and stopped.
1732
Start and stop timestamps are available in two formats.
1833
The `HH:MM:SS` output is simply for quick human consumption.
19-
The epoch time retains more information, including date, and is machine sortable if the snapshot process spans days.
34+
The epoch time retains more information, including date, and is machine sortable if the snapshot process spans days.

docs/reference/cat/templates.asciidoc

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,25 @@
33

44
The `templates` command provides information about existing templates.
55

6-
[source, sh]
6+
[source,js]
77
--------------------------------------------------
8-
% curl 'localhost:9200/_cat/templates?v=true'
9-
name template order version
10-
template0 te* 0
11-
template1 tea* 1
12-
template2 teak* 2 7
8+
GET /_cat/templates?v&s=name
139
--------------------------------------------------
10+
// CONSOLE
11+
// TEST[s/^/PUT _template\/template0\n{"index_patterns": "te*", "order": 0}\n/]
12+
// TEST[s/^/PUT _template\/template1\n{"index_patterns": "tea*", "order": 1}\n/]
13+
// TEST[s/^/PUT _template\/template2\n{"index_patterns": "teak*", "order": 2, "version": 7}\n/]
14+
15+
which looks like
16+
17+
[source,txt]
18+
--------------------------------------------------
19+
name index_patterns order version
20+
template0 [te*] 0
21+
template1 [tea*] 1
22+
template2 [teak*] 2 7
23+
--------------------------------------------------
24+
// TESTRESPONSE[s/\*/\\*/ s/\[/\\[/ s/\]/\\]/ _cat]
1425

1526
The output shows that there are three existing templates,
1627
with template2 having a version value.

docs/reference/cat/thread_pool.asciidoc

Lines changed: 38 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,43 @@
44
The `thread_pool` command shows cluster wide thread pool statistics per node. By default the active, queue and rejected
55
statistics are returned for all thread pools.
66

7-
[source,sh]
7+
[source,js]
88
--------------------------------------------------
9-
% curl 192.168.56.10:9200/_cat/thread_pool
10-
0EWUhXe bulk 0 0 0
11-
0EWUhXe fetch_shard_started 0 0 0
12-
0EWUhXe fetch_shard_store 0 0 0
13-
0EWUhXe flush 0 0 0
14-
0EWUhXe force_merge 0 0 0
15-
0EWUhXe generic 0 0 0
16-
0EWUhXe get 0 0 0
17-
0EWUhXe index 0 0 0
18-
0EWUhXe listener 0 0 0
19-
0EWUhXe management 1 0 0
20-
0EWUhXe refresh 0 0 0
21-
0EWUhXe search 0 0 0
22-
0EWUhXe snapshot 0 0 0
23-
0EWUhXe warmer 0 0 0
9+
GET /_cat/thread_pool
2410
--------------------------------------------------
11+
// CONSOLE
12+
13+
Which looks like:
14+
15+
[source,txt]
16+
--------------------------------------------------
17+
node-0 bulk 0 0 0
18+
node-0 fetch_shard_started 0 0 0
19+
node-0 fetch_shard_store 0 0 0
20+
node-0 flush 0 0 0
21+
node-0 force_merge 0 0 0
22+
node-0 generic 0 0 0
23+
node-0 get 0 0 0
24+
node-0 index 0 0 0
25+
node-0 listener 0 0 0
26+
node-0 management 1 0 0
27+
node-0 refresh 0 0 0
28+
node-0 search 0 0 0
29+
node-0 snapshot 0 0 0
30+
node-0 warmer 0 0 0
31+
--------------------------------------------------
32+
// TESTRESPONSE[s/\d+/\\d+/ _cat]
2533

2634
The first column is the node name
2735

28-
[source,sh]
36+
[source,txt]
2937
--------------------------------------------------
3038
node_name
31-
0EWUhXe
39+
node-0
3240
--------------------------------------------------
3341

3442
The second column is the thread pool name
35-
[source,sh]
43+
[source,txt]
3644
--------------------------------------------------
3745
name
3846
bulk
@@ -54,7 +62,7 @@ warmer
5462

5563
The next three columns show the active, queue, and rejected statistics for each thread pool
5664

57-
[source,sh]
65+
[source,txt]
5866
--------------------------------------------------
5967
active queue rejected
6068
0 0 0
@@ -76,12 +84,20 @@ active queue rejected
7684
The cat thread pool API accepts a `thread_pool_patterns` URL parameter for specifying a
7785
comma-separated list of regular expressions to match thread pool names.
7886

79-
[source,sh]
87+
[source,js]
88+
--------------------------------------------------
89+
GET /_cat/thread_pool/generic?v&h=id,name,active,rejected,completed
90+
--------------------------------------------------
91+
// CONSOLE
92+
93+
which looks like:
94+
95+
[source,js]
8096
--------------------------------------------------
81-
% curl 'localhost:9200/_cat/thread_pool/generic?v&h=id,name,active,rejected,completed'
8297
id name active rejected completed
8398
0EWUhXeBQtaVGlexUeVwMg generic 0 0 70
8499
--------------------------------------------------
100+
// TESTRESPONSE[s/0EWUhXeBQtaVGlexUeVwMg/[\\w-]+/ s/\d+/\\d+/ _cat]
85101

86102
Here the host columns and the active, rejected and completed suggest thread pool statistics are displayed.
87103

0 commit comments

Comments
 (0)