Skip to content

Commit f1e1661

Browse files
authored
[DOCS] Reuse aliases object properties in API docs (#73421)
Changes: * Reuses the same `aliases` object properties in the following API docs: * Clone index API * Create index API * Put component template API * Put legacy index template API * Put index template API * Rollover index API * Shrink index API * Simulate template API * Split index API * Updates the `aliases` object properties for the simulate index API docs. Closes #73044
1 parent 31643a5 commit f1e1661

11 files changed

+88
-32
lines changed

docs/reference/indices/clone-index.asciidoc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,9 @@ include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=timeoutparms]
174174
[[clone-index-api-request-body]]
175175
==== {api-request-body-title}
176176

177-
include::{es-repo-dir}/indices/create-index.asciidoc[tag=aliases]
177+
`aliases`::
178+
(Optional, object of objects) Aliases for the resulting index.
179+
+
180+
include::{es-repo-dir}/indices/create-index.asciidoc[tag=aliases-props]
178181

179182
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=target-index-settings]

docs/reference/indices/create-index.asciidoc

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ PUT /my-index-000001
2121
==== {api-prereq-title}
2222

2323
* If the {es} {security-features} are enabled, you must have the `create_index`
24-
or `manage` <<privileges-list-indices,index privilege>> for the target index.
24+
or `manage` <<privileges-list-indices,index privilege>> for the target index. To
25+
add the index to an alias, you must have the `manage` index privilege for the
26+
alias.
2527

2628
[[indices-create-api-desc]]
2729
==== {api-description-title}
@@ -66,13 +68,14 @@ include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=timeoutparms]
6668
[[indices-create-api-request-body]]
6769
==== {api-request-body-title}
6870

69-
// tag::aliases[]
7071
`aliases`::
71-
(Optional, object) Aliases for the index.
72+
(Optional, object of objects) Aliases for the index.
7273
+
73-
.Properties of `aliases` objects
74+
--
75+
// tag::aliases-props[]
7476
[%collapsible%open]
75-
====
77+
.Properties of `aliases` objects
78+
=======
7679
`<alias>`::
7780
(Required, object) The key is the alias name. Supports
7881
<<date-math-index-names,date math>>.
@@ -81,9 +84,9 @@ The object body contains options for the alias. Supports an empty object.
8184
+
8285
.Properties of `<alias>`
8386
[%collapsible%open]
84-
=====
87+
======
8588
`filter`::
86-
(Optional, <<query-dsl,Query DSL object>>) Query used to limit the documents the
89+
(Optional, <<query-dsl,Query DSL object>>) Query used to limit documents the
8790
alias can access.
8891

8992
`index_routing`::
@@ -92,7 +95,7 @@ If specified, this overwrites the `routing` value for indexing operations.
9295

9396
`is_hidden`::
9497
(Optional, Boolean) If `true`, the alias is <<hidden,hidden>>. Defaults to
95-
`false`.
98+
`false`. All indices for the alias must have the same `is_hidden` value.
9699

97100
`is_write_index`::
98101
(Optional, Boolean) If `true`, the index is the <<write-index,write index>> for
@@ -105,9 +108,10 @@ specific shard.
105108
`search_routing`::
106109
(Optional, string) Value used to route search operations to a specific shard. If
107110
specified, this overwrites the `routing` value for search operations.
108-
=====
109-
====
110-
// end::aliases[]
111+
======
112+
=======
113+
// end::aliases-props[]
114+
--
111115

112116
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=mappings]
113117

docs/reference/indices/put-component-template.asciidoc

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,21 +119,28 @@ Defaults to `false`.
119119

120120
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=master-timeout]
121121

122+
[role="child_attributes"]
122123
[[put-component-template-api-request-body]]
123124
==== {api-request-body-title}
124125

125126
`template`::
126127
(Required, object)
127128
This is the template to be applied, may optionally include a `mappings`,
128129
`settings`, or `aliases` configuration.
129-
130-
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=aliases]
131130
+
132-
NOTE: You cannot add data streams to an index alias.
131+
.Properties of `template`
132+
[%collapsible%open]
133+
====
134+
`aliases`::
135+
(Optional, object of objects) Aliases for the index. If an index template
136+
includes `data_stream`, this parameter is not supported.
137+
+
138+
include::{es-repo-dir}/indices/create-index.asciidoc[tag=aliases-props]
133139
134140
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=mappings]
135141
136142
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=settings]
143+
====
137144

138145
`version`::
139146
(Optional, integer)

docs/reference/indices/put-index-template-v1.asciidoc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ overriding templates with lower values.
114114

115115
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=master-timeout]
116116

117-
117+
[role="child_attributes"]
118118
[[put-index-template-v1-api-request-body]]
119119
==== {api-request-body-title}
120120

@@ -123,7 +123,10 @@ include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=master-timeout]
123123
Array of wildcard expressions
124124
used to match the names of indices during creation.
125125

126-
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=aliases]
126+
`aliases`::
127+
(Optional, object of objects) Aliases for the index.
128+
+
129+
include::{es-repo-dir}/indices/create-index.asciidoc[tag=aliases-props]
127130

128131
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=mappings]
129132

docs/reference/indices/put-index-template.asciidoc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,11 @@ Template to be applied. It may optionally include an `aliases`, `mappings`, or
136136
.Properties of `template`
137137
[%collapsible%open]
138138
====
139-
include::{docdir}/rest-api/common-parms.asciidoc[tag=aliases]
139+
`aliases`::
140+
(Optional, object of objects) Aliases for the index. If the index template
141+
includes `data_stream`, this parameter is not supported.
140142
+
141-
NOTE: You cannot add data streams to an index alias.
143+
include::{es-repo-dir}/indices/create-index.asciidoc[tag=aliases-props]
142144
143145
include::{docdir}/rest-api/common-parms.asciidoc[tag=mappings]
144146

docs/reference/indices/rollover-index.asciidoc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,11 @@ include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=timeoutparms]
122122
[[rollover-index-api-request-body]]
123123
==== {api-request-body-title}
124124

125-
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=aliases]
125+
`aliases`::
126+
(Optional, object of objects) Aliases for the target index. Data streams do not
127+
support this parameter.
126128
+
127-
Data streams do not support this parameter.
129+
include::{es-repo-dir}/indices/create-index.asciidoc[tag=aliases-props]
128130

129131
[[rollover-conditions]]
130132
`conditions`::

docs/reference/indices/shrink-index.asciidoc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,10 @@ include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=timeoutparms]
227227
[[shrink-index-api-request-body]]
228228
==== {api-request-body-title}
229229

230-
include::{es-repo-dir}/indices/create-index.asciidoc[tag=aliases]
230+
`aliases`::
231+
(Optional, object of objects) Aliases for the resulting index.
232+
+
233+
include::{es-repo-dir}/indices/create-index.asciidoc[tag=aliases-props]
231234

232235
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=target-index-settings]
233236

docs/reference/indices/simulate-index.asciidoc

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,40 @@ The settings, mappings, and aliases that would be applied to the index.
8989
.Properties of `template`
9090
[%collapsible%open]
9191
====
92-
include::{es-ref-dir}/rest-api/common-parms.asciidoc[tag=aliases]
92+
`aliases`::
93+
(object) Aliases for the index. If no aliases apply, the response returns an
94+
empty `aliases` object.
9395
+
94-
Response includes an empty object if no aliases would be applied.
96+
=====
97+
`<alias>`::
98+
(object) The key is the alias name. The object body contains options for the
99+
alias.
100+
+
101+
.Properties of `<alias>`
102+
[%collapsible%open]
103+
======
104+
`filter`::
105+
(<<query-dsl,Query DSL object>>) Query used to limit documents the alias can
106+
access.
107+
108+
`index_routing`::
109+
(string) Value used to route indexing operations to a specific shard. This
110+
overwrites the `routing` value for indexing operations.
111+
112+
`is_hidden`::
113+
(Boolean) If `true`, the alias is <<hidden,hidden>>.
114+
115+
`is_write_index`::
116+
(Boolean) If `true`, the index is the <<write-index,write index>> for the alias.
117+
118+
`routing`::
119+
(string) Value used to route indexing and search operations to a specific shard.
120+
121+
`search_routing`::
122+
(string) Value used to route search operations to a specific shard. This
123+
overwrites the `routing` value for search operations.
124+
======
125+
=====
95126
96127
include::{es-ref-dir}/rest-api/common-parms.asciidoc[tag=mappings]
97128
+

docs/reference/indices/simulate-template.asciidoc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,11 @@ The settings, mappings, and aliases that would be applied to matching indices.
124124
.Properties of `template`
125125
[%collapsible%open]
126126
====
127-
include::{es-ref-dir}/rest-api/common-parms.asciidoc[tag=aliases]
127+
`aliases`::
128+
(Optional, object of objects) Aliases for the index. If the index template
129+
includes `data_stream`, this parameter is not supported.
130+
+
131+
include::{es-repo-dir}/indices/create-index.asciidoc[tag=aliases-props]
128132
129133
include::{es-ref-dir}/rest-api/common-parms.asciidoc[tag=mappings]
130134

docs/reference/indices/split-index.asciidoc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,9 @@ include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=timeoutparms]
277277
[[split-index-api-request-body]]
278278
==== {api-request-body-title}
279279

280-
include::{es-repo-dir}/indices/create-index.asciidoc[tag=aliases]
280+
`aliases`::
281+
(Optional, object of objects) Aliases for the resulting index.
282+
+
283+
include::{es-repo-dir}/indices/create-index.asciidoc[tag=aliases-props]
281284

282285
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=target-index-settings]

docs/reference/rest-api/common-parms.asciidoc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@ the response only includes ongoing shard recoveries.
1818
Defaults to `false`.
1919
end::active-only[]
2020

21-
tag::aliases[]
22-
`aliases`::
23-
(Optional, <<alias,alias object>>) Index aliases which include the index. Index
24-
alias names support <<date-math-index-names,date math>>.
25-
end::aliases[]
26-
2721
tag::allow-no-indices[]
2822
`allow_no_indices`::
2923
(Optional, Boolean)

0 commit comments

Comments
 (0)