Skip to content

Commit 12474b1

Browse files
authored
[DOCS] Fix create snapshot API parameters (#79209)
Changes: - Notes snapshot names support date math - Sorts request body parameters alphabetically - Adds the `expand_wildcards` request body parameter - Reuses cluster state contents list from the restore snapshot API - Notes the `indices` and `feature_states` parameters support a special `none` value Relates to #79081
1 parent 808b70d commit 12474b1

File tree

2 files changed

+61
-39
lines changed

2 files changed

+61
-39
lines changed

docs/reference/snapshot-restore/apis/create-snapshot-api.asciidoc

Lines changed: 47 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,12 @@ Besides creating a copy of each data stream and index, the snapshot process can
7373

7474
`<repository>`::
7575
(Required, string)
76-
Name of the repository to create a snapshot in.
76+
Name of the snapshot repository.
7777

7878
`<snapshot>`::
7979
(Required, string)
80-
Name of the snapshot to create. This name must be unique in the snapshot repository.
80+
Name of the snapshot. Supports <<api-date-math-index-names,date math>>. Must be
81+
unique within the snapshot repository.
8182

8283
[[create-snapshot-api-query-params]]
8384
==== {api-query-parms-title}
@@ -96,50 +97,67 @@ initializes. Defaults to `false`.
9697
// Set an attribute so we can reuse these params with anchors
9798
:page-id: create-snapshot-api
9899
// tag::snapshot-config[]
100+
`expand_wildcards`::
101+
+
102+
--
103+
(Optional, string) Determines how wildcard patterns in the `indices` parameter
104+
match data streams and indices. Supports comma-separated values, such as
105+
`open,hidden`. Defaults to `all`. Valid values are:
106+
107+
`all`:::
108+
Match any data stream or index, including <<hidden,hidden>> ones.
109+
110+
`open`:::
111+
Match open indices and data streams.
112+
113+
`closed`:::
114+
Match closed indices and data streams.
115+
116+
`hidden`:::
117+
Match hidden data streams and indices. Must be combined with `open`, `closed`,
118+
or both.
119+
120+
`none`:::
121+
Don't expand wildcard patterns.
122+
--
123+
99124
`ignore_unavailable`::
100125
(Optional, Boolean)
101126
If `false`, the snapshot fails if any data stream or index in `indices` is
102127
missing or closed. If `true`, the snapshot ignores missing or closed data
103128
streams and indices. Defaults to `false`.
104129

105-
`indices`::
106-
(Optional, string)
107-
A comma-separated list of data streams and indices to include in the snapshot.
108-
<<multi-index,Multi-index syntax>> is supported.
109-
+
110-
By default, a snapshot includes all data streams and indices in the cluster. If this
111-
argument is provided, the snapshot only includes the specified data streams and clusters.
112-
113130
`include_global_state`::
114131
+
115132
--
116133
(Optional, Boolean)
117-
If `true`, the current global state is included in the snapshot.
118-
Defaults to `true`.
119-
120-
The global state includes:
134+
If `true`, include the cluster state in the snapshot. Defaults to `true`.
135+
The cluster state includes:
121136

122-
* Persistent cluster settings
123-
* Index templates
124-
* Legacy index templates
125-
* Ingest pipelines
126-
* {ilm-init} lifecycle policies
127-
* Data stored in system indices, such as Watches and task records (configurable via `feature_states`)
137+
include::restore-snapshot-api.asciidoc[tag=cluster-state-contents]
128138
--
129139

140+
`indices`::
141+
(Optional, string or array of strings)
142+
Comma-separated list of data streams and indices to include in the snapshot.
143+
Supports <<api-multi-index,multi-index syntax>>. Defaults to an empty array
144+
(`[]`), which includes all data streams and indices, including system indices.
145+
+
146+
To exclude all data streams and indices, use `-*` or `none`.
147+
130148
[id="{page-id}-feature-states"]
131149
`feature_states`::
132150
(Optional, array of strings)
133-
A list of feature states to be included in this snapshot. A list of features
134-
available for inclusion in the snapshot and their descriptions be can be
135-
retrieved using the <<get-features-api,get features API>>.
136-
Each feature state includes one or more system indices containing data necessary
137-
for the function of that feature. Providing an empty array will include no feature
138-
states in the snapshot, regardless of the value of `include_global_state`.
151+
Feature states to include in the snapshot. To get a list of possible feature
152+
state values and their descriptions, use the <<get-features-api,get features
153+
API>>. Each feature state includes one or more system indices.
154+
+
155+
If `include_global_state` is `true`, the snapshot includes all feature states by
156+
default. If `include_global_state` is `false`, the snapshot includes no feature
157+
states by default.
139158
+
140-
By default, all available feature states will be included in the snapshot if
141-
`include_global_state` is `true`, or no feature states if `include_global_state`
142-
is `false`.
159+
To exclude all feature states, regardless of the `include_global_state` value,
160+
specify an empty array (`[]`) or `none`.
143161

144162
`metadata`::
145163
(Optional, object)

docs/reference/snapshot-restore/apis/restore-snapshot-api.asciidoc

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -135,25 +135,29 @@ indices. If `false`, the request doesn't restore aliases. Defaults to `true`.
135135
+
136136
--
137137
(Optional, Boolean)
138-
If `false`, the global state is not restored. Defaults to `false`.
138+
If `true`, restore the cluster state. Defaults to `false`.
139139

140-
If `true`, the current global state is included in the restore operation.
140+
The cluster state includes:
141141

142-
The global state includes:
143-
144-
* Persistent cluster settings
145-
* Index templates
146-
* Legacy index templates
147-
* Ingest pipelines
148-
* {ilm-init} lifecycle policies
149-
* For snapshots taken after 7.12.0, data stored in system indices, such as Watches and task records, replacing any existing configuration (configurable via `feature_states`)
142+
// tag::cluster-state-contents[]
143+
* <<cluster-setting-types,Persistent cluster settings>>
144+
* <<index-templates,Index templates>>
145+
* <<indices-templates-v1,Legacy index templates>>
146+
* <<ingest,Ingest pipelines>>
147+
* <<index-lifecycle-management,{ilm-init} policies>>
148+
* For snapshots taken after 7.12.0, data stored in system indices, such as
149+
Watches and task records.
150+
// end::cluster-state-contents[]
150151

151152
If `include_global_state` is `true` then the restore operation merges the
152153
legacy index templates in your cluster with the templates contained in the
153154
snapshot, replacing any existing ones whose name matches one in the snapshot.
154155
It completely removes all persistent settings, non-legacy index templates,
155156
ingest pipelines and {ilm-init} lifecycle policies that exist in your cluster
156157
and replaces them with the corresponding items from the snapshot.
158+
159+
You can use the `feature_states` parameter to configure how system indices
160+
are restored from the cluster state.
157161
--
158162

159163
[[restore-snapshot-api-feature-states]]

0 commit comments

Comments
 (0)