Class RestoreRequest.Builder
- All Implemented Interfaces:
WithJson<RestoreRequest.Builder>
,ObjectBuilder<RestoreRequest>
- Enclosing class:
- RestoreRequest
RestoreRequest
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds aRestoreRequest
.final RestoreRequest.Builder
featureStates
(String value, String... values) The feature states to restore.final RestoreRequest.Builder
featureStates
(List<String> list) The feature states to restore.final RestoreRequest.Builder
ignoreIndexSettings
(String value, String... values) The index settings to not restore from the snapshot.final RestoreRequest.Builder
ignoreIndexSettings
(List<String> list) The index settings to not restore from the snapshot.final RestoreRequest.Builder
ignoreUnavailable
(Boolean value) Iftrue
, the request ignores any index or data stream in indices that's missing from the snapshot.final RestoreRequest.Builder
includeAliases
(Boolean value) Iftrue
, the request restores aliases for any restored data streams and indices.final RestoreRequest.Builder
includeGlobalState
(Boolean value) Iftrue
, restore the cluster state.final RestoreRequest.Builder
indexSettings
(IndexSettings value) Index settings to add or change in restored indices, including backing indices.final RestoreRequest.Builder
Index settings to add or change in restored indices, including backing indices.final RestoreRequest.Builder
A comma-separated list of indices and data streams to restore.final RestoreRequest.Builder
A comma-separated list of indices and data streams to restore.final RestoreRequest.Builder
masterTimeout
(Time value) The period to wait for the master node.final RestoreRequest.Builder
The period to wait for the master node.final RestoreRequest.Builder
Iffalse
, the entire restore operation will fail if one or more indices included in the snapshot do not have all primary shards available.final RestoreRequest.Builder
renamePattern
(String value) A rename pattern to apply to restored data streams and indices.final RestoreRequest.Builder
renameReplacement
(String value) The rename replacement string that is used with therename_pattern
.final RestoreRequest.Builder
repository
(String value) Required - The name of the repository to restore a snapshot from.protected RestoreRequest.Builder
self()
final RestoreRequest.Builder
Required - The name of the snapshot to restore.final RestoreRequest.Builder
waitForCompletion
(Boolean value) Iftrue
, the request returns a response when the restore operation completes.Methods inherited from class co.elastic.clients.util.WithJsonObjectBuilderBase
withJson
Methods inherited from class co.elastic.clients.util.ObjectBuilderBase
_checkSingleUse, _listAdd, _listAddAll, _mapPut, _mapPutAll
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
featureStates
The feature states to restore. Ifinclude_global_state
istrue
, the request restores all feature states in the snapshot by default. Ifinclude_global_state
isfalse
, the request restores no feature states by default. Note that specifying an empty array will result in the default behavior. To restore no feature states, regardless of theinclude_global_state
value, specify an array containing only the valuenone
(["none"]
).API name:
feature_states
Adds all elements of
list
tofeatureStates
. -
featureStates
The feature states to restore. Ifinclude_global_state
istrue
, the request restores all feature states in the snapshot by default. Ifinclude_global_state
isfalse
, the request restores no feature states by default. Note that specifying an empty array will result in the default behavior. To restore no feature states, regardless of theinclude_global_state
value, specify an array containing only the valuenone
(["none"]
).API name:
feature_states
Adds one or more values to
featureStates
. -
ignoreIndexSettings
The index settings to not restore from the snapshot. You can't use this option to ignoreindex.number_of_shards
.For data streams, this option applies only to restored backing indices. New backing indices are configured using the data stream's matching index template.
API name:
ignore_index_settings
Adds all elements of
list
toignoreIndexSettings
. -
ignoreIndexSettings
The index settings to not restore from the snapshot. You can't use this option to ignoreindex.number_of_shards
.For data streams, this option applies only to restored backing indices. New backing indices are configured using the data stream's matching index template.
API name:
ignore_index_settings
Adds one or more values to
ignoreIndexSettings
. -
includeAliases
Iftrue
, the request restores aliases for any restored data streams and indices. Iffalse
, the request doesn’t restore aliases.API name:
include_aliases
-
includeGlobalState
Iftrue
, restore the cluster state. The cluster state includes:- Persistent cluster settings
- Index templates
- Legacy index templates
- Ingest pipelines
- Index lifecycle management (ILM) policies
- Stored scripts
- For snapshots taken after 7.12.0, feature states
If
include_global_state
istrue
, the restore operation merges the legacy index templates in your cluster with the templates contained in the snapshot, replacing any existing ones whose name matches one in the snapshot. It completely removes all persistent settings, non-legacy index templates, ingest pipelines, and ILM lifecycle policies that exist in your cluster and replaces them with the corresponding items from the snapshot.Use the
feature_states
parameter to configure how feature states are restored.If
include_global_state
istrue
and a snapshot was created without a global state then the restore request will fail.API name:
include_global_state
-
indexSettings
Index settings to add or change in restored indices, including backing indices. You can't use this option to changeindex.number_of_shards
.For data streams, this option applies only to restored backing indices. New backing indices are configured using the data stream's matching index template.
API name:
index_settings
-
indexSettings
public final RestoreRequest.Builder indexSettings(Function<IndexSettings.Builder, ObjectBuilder<IndexSettings>> fn) Index settings to add or change in restored indices, including backing indices. You can't use this option to changeindex.number_of_shards
.For data streams, this option applies only to restored backing indices. New backing indices are configured using the data stream's matching index template.
API name:
index_settings
-
indices
A comma-separated list of indices and data streams to restore. It supports a multi-target syntax. The default behavior is all regular indices and regular data streams in the snapshot.You can't use this parameter to restore system indices or system data streams. Use
feature_states
instead.API name:
indices
Adds all elements of
list
toindices
. -
indices
A comma-separated list of indices and data streams to restore. It supports a multi-target syntax. The default behavior is all regular indices and regular data streams in the snapshot.You can't use this parameter to restore system indices or system data streams. Use
feature_states
instead.API name:
indices
Adds one or more values to
indices
. -
masterTimeout
The period to wait for the master node. If the master node is not available before the timeout expires, the request fails and returns an error. To indicate that the request should never timeout, set it to-1
.API name:
master_timeout
-
masterTimeout
The period to wait for the master node. If the master node is not available before the timeout expires, the request fails and returns an error. To indicate that the request should never timeout, set it to-1
.API name:
master_timeout
-
partial
Iffalse
, the entire restore operation will fail if one or more indices included in the snapshot do not have all primary shards available.If true, it allows restoring a partial snapshot of indices with unavailable shards. Only shards that were successfully included in the snapshot will be restored. All missing shards will be recreated as empty.
API name:
partial
-
renamePattern
A rename pattern to apply to restored data streams and indices. Data streams and indices matching the rename pattern will be renamed according torename_replacement
.The rename pattern is applied as defined by the regular expression that supports referencing the original text, according to the
appendReplacement
logic.API name:
rename_pattern
-
renameReplacement
The rename replacement string that is used with therename_pattern
.API name:
rename_replacement
-
repository
Required - The name of the repository to restore a snapshot from.API name:
repository
-
snapshot
Required - The name of the snapshot to restore.API name:
snapshot
-
waitForCompletion
Iftrue
, the request returns a response when the restore operation completes. The operation is complete when it finishes all attempts to recover primary shards for restored indices. This applies even if one or more of the recovery attempts fail.If
false
, the request returns a response when the restore operation initializes.API name:
wait_for_completion
-
self
- Specified by:
self
in classRequestBase.AbstractBuilder<RestoreRequest.Builder>
-
build
Builds aRestoreRequest
.- Specified by:
build
in interfaceObjectBuilder<RestoreRequest>
- Throws:
NullPointerException
- if some of the required fields are null.
-