Skip to content

Commit 585bef6

Browse files
authored
[DOCS] Reuse aliases object properties in API docs (#73421) (#73662)
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 4130852 commit 585bef6

11 files changed

+88
-33
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}
@@ -68,13 +70,14 @@ include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=timeoutparms]
6870
[[indices-create-api-request-body]]
6971
==== {api-request-body-title}
7072

71-
// tag::aliases[]
7273
`aliases`::
73-
(Optional, object) Aliases for the index.
74+
(Optional, object of objects) Aliases for the index.
7475
+
75-
.Properties of `aliases` objects
76+
--
77+
// tag::aliases-props[]
7678
[%collapsible%open]
77-
====
79+
.Properties of `aliases` objects
80+
=======
7881
`<alias>`::
7982
(Required, object) The key is the alias name. Supports
8083
<<date-math-index-names,date math>>.
@@ -83,9 +86,9 @@ The object body contains options for the alias. Supports an empty object.
8386
+
8487
.Properties of `<alias>`
8588
[%collapsible%open]
86-
=====
89+
======
8790
`filter`::
88-
(Optional, <<query-dsl,Query DSL object>>) Query used to limit the documents the
91+
(Optional, <<query-dsl,Query DSL object>>) Query used to limit documents the
8992
alias can access.
9093

9194
`index_routing`::
@@ -94,7 +97,7 @@ If specified, this overwrites the `routing` value for indexing operations.
9497

9598
`is_hidden`::
9699
(Optional, Boolean) If `true`, the alias is <<hidden,hidden>>. Defaults to
97-
`false`.
100+
`false`. All indices for the alias must have the same `is_hidden` value.
98101

99102
`is_write_index`::
100103
(Optional, Boolean) If `true`, the index is the <<write-index,write index>> for
@@ -107,9 +110,10 @@ specific shard.
107110
`search_routing`::
108111
(Optional, string) Value used to route search operations to a specific shard. If
109112
specified, this overwrites the `routing` value for search operations.
110-
=====
111-
====
112-
// end::aliases[]
113+
======
114+
=======
115+
// end::aliases-props[]
116+
--
113117

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

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
@@ -125,9 +125,11 @@ include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=timeoutparms]
125125
[[rollover-index-api-request-body]]
126126
==== {api-request-body-title}
127127

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

132134
[[rollover-conditions]]
133135
`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 & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,6 @@ Comma-separated list or wildcard expression of index alias names
2525
used to limit the request.
2626
end::index-alias[]
2727

28-
tag::aliases[]
29-
`aliases`::
30-
(Optional, <<indices-aliases,alias object>>) <<indices-aliases,Index aliases>>
31-
which include the index. Index alias names support <<date-math-index-names,date
32-
math>>.
33-
end::aliases[]
34-
3528
tag::allow-no-indices[]
3629
`allow_no_indices`::
3730
(Optional, Boolean)

0 commit comments

Comments
 (0)