Skip to content

Commit 7003ac4

Browse files
authored
[DOCS] Collapse nested objects in cluster reroute docs (elastic#54851)
1 parent 605f9c6 commit 7003ac4

File tree

1 file changed

+30
-25
lines changed

1 file changed

+30
-25
lines changed

docs/reference/cluster/reroute.asciidoc

+30-25
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ Changes the allocation of shards in a cluster.
1212

1313
`POST /_cluster/reroute`
1414

15-
1615
[[cluster-reroute-api-desc]]
1716
==== {api-description-title}
1817

@@ -21,15 +20,15 @@ shards in the cluster. For example, a shard can be moved from one node to
2120
another explicitly, an allocation can be cancelled, and an unassigned shard can
2221
be explicitly allocated to a specific node.
2322

24-
It is important to note that after processing any reroute commands {es} will
25-
perform rebalancing as normal (respecting the values of settings such as
26-
`cluster.routing.rebalance.enable`) in order to remain in a balanced state. For
27-
example, if the requested allocation includes moving a shard from `node1` to
28-
`node2` then this may cause a shard to be moved from `node2` back to `node1` to
23+
It is important to note that after processing any reroute commands {es} will
24+
perform rebalancing as normal (respecting the values of settings such as
25+
`cluster.routing.rebalance.enable`) in order to remain in a balanced state. For
26+
example, if the requested allocation includes moving a shard from `node1` to
27+
`node2` then this may cause a shard to be moved from `node2` back to `node1` to
2928
even things out.
3029

3130
The cluster can be set to disable allocations using the
32-
`cluster.routing.allocation.enable` setting. If allocations are disabled then
31+
`cluster.routing.allocation.enable` setting. If allocations are disabled then
3332
the only allocations that will be performed are explicit ones given using the
3433
`reroute` command, and consequent allocations due to rebalancing.
3534

@@ -55,31 +54,34 @@ query parameter, which will attempt a single retry round for these shards.
5554

5655

5756
[[cluster-reroute-api-query-params]]
57+
[role="child_attributes"]
5858
==== {api-query-parms-title}
5959

6060
`dry_run`::
61-
(Optional, boolean) If `true`, then the request simulates the operation only
61+
(Optional, boolean) If `true`, then the request simulates the operation only
6262
and returns the resulting state.
63-
63+
6464
`explain`::
65-
(Optional, boolean) If `true`, then the response contains an explanation of
65+
(Optional, boolean) If `true`, then the response contains an explanation of
6666
why the commands can or cannot be executed.
6767

6868
`metric`::
69-
(Optional, string) Limits the information returned to the specified metrics.
69+
(Optional, string) Limits the information returned to the specified metrics.
7070
Defaults to all but metadata The following options are available:
7171

7272
+
73-
--
73+
.Options for `metric`
74+
[%collapsible%open]
75+
======
7476
`_all`::
7577
Shows all metrics.
76-
78+
7779
`blocks`::
7880
Shows the `blocks` part of the response.
7981
8082
`master_node`::
8183
Shows the elected `master_node` part of the response.
82-
84+
8385
`metadata`::
8486
Shows the `metadata` part of the response. If you supply a comma separated
8587
list of indices, the returned output will only contain metadata for these
@@ -90,29 +92,33 @@ query parameter, which will attempt a single retry round for these shards.
9092
9193
`routing_table`::
9294
Shows the `routing_table` part of the response.
93-
95+
9496
`version`::
9597
Shows the cluster state version.
96-
--
98+
======
99+
97100

98101
`retry_failed`::
99-
(Optional, boolean) If `true`, then retries allocation of shards that are
102+
(Optional, boolean) If `true`, then retries allocation of shards that are
100103
blocked due to too many subsequent allocation failures.
101104

102105
include::{docdir}/rest-api/common-parms.asciidoc[tag=timeoutparms]
103106

104-
107+
[role="child_attributes"]
105108
[[cluster-reroute-api-request-body]]
106109
==== {api-request-body-title}
107110

108111
`commands`::
109-
(Required, object) Defines the commands to perform. Supported commands are:
112+
(Required, array of objects) Defines the commands to perform. Supported commands are:
110113

111114
+
112-
--
115+
.Properties of `commands`
116+
[%collapsible%open]
117+
======
118+
113119
`move`::
114-
Move a started shard from one node to another node. Accepts `index` and
115-
`shard` for index name and shard number, `from_node` for the node to move
120+
Move a started shard from one node to another node. Accepts `index` and
121+
`shard` for index name and shard number, `from_node` for the node to move
116122
the shard from, and `to_node` for the node to move the shard to.
117123
118124
`cancel`::
@@ -129,11 +135,10 @@ include::{docdir}/rest-api/common-parms.asciidoc[tag=timeoutparms]
129135
Allocate an unassigned replica shard to a node. Accepts `index` and `shard`
130136
for index name and shard number, and `node` to allocate the shard to. Takes
131137
<<modules-cluster,allocation deciders>> into account.
132-
--
133138
134139
Two more commands are available that allow the allocation of a primary shard to
135140
a node. These commands should however be used with extreme care, as primary
136-
shard allocation is usually fully automatically handled by {es}. Reasons why a
141+
shard allocation is usually fully automatically handled by {es}. Reasons why a
137142
primary shard cannot be automatically allocated include the
138143
following:
139144
@@ -169,7 +174,7 @@ will be deleted or overwritten.
169174
data rejoins the cluster later on, that data will be deleted. To ensure
170175
that these implications are well-understood, this command requires the flag
171176
`accept_data_loss` to be explicitly set to `true`.
172-
177+
======
173178

174179
[[cluster-reroute-api-example]]
175180
==== {api-examples-title}

0 commit comments

Comments
 (0)