public class RestoreSnapshotRequest extends MasterNodeRequest<RestoreSnapshotRequest>
TransportRequest.Empty
DEFAULT_MASTER_NODE_TIMEOUT, masterNodeTimeout
Constructor and Description |
---|
RestoreSnapshotRequest() |
RestoreSnapshotRequest(java.lang.String repository,
java.lang.String snapshot)
Constructs a new put repository request with the provided repository and snapshot names.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getDescription()
Returns optional description of the request to be displayed by the task manager
|
java.lang.String[] |
ignoreIndexSettings()
Returns the list of index settings and index settings groups that shouldn't be restored from snapshot
|
RestoreSnapshotRequest |
ignoreIndexSettings(java.util.List<java.lang.String> ignoreIndexSettings)
Sets the list of index settings and index settings groups that shouldn't be restored from snapshot
|
RestoreSnapshotRequest |
ignoreIndexSettings(java.lang.String... ignoreIndexSettings)
Sets the list of index settings and index settings groups that shouldn't be restored from snapshot
|
boolean |
includeAliases()
Returns true if aliases should be restored from this snapshot
|
RestoreSnapshotRequest |
includeAliases(boolean includeAliases)
If set to true the restore procedure will restore aliases
|
boolean |
includeGlobalState()
Returns true if global state should be restored from this snapshot
|
RestoreSnapshotRequest |
includeGlobalState(boolean includeGlobalState)
If set to true the restore procedure will restore global cluster state.
|
Settings |
indexSettings()
Returns settings that should be added/changed in all restored indices
|
RestoreSnapshotRequest |
indexSettings(java.util.Map<java.lang.String,java.lang.Object> source)
Sets settings that should be added/changed in all restored indices
|
RestoreSnapshotRequest |
indexSettings(Settings.Builder settings)
Sets settings that should be added/changed in all restored indices
|
RestoreSnapshotRequest |
indexSettings(Settings settings)
Sets settings that should be added/changed in all restored indices
|
RestoreSnapshotRequest |
indexSettings(java.lang.String source)
Deprecated.
use
indexSettings(String, XContentType) to avoid content type detection |
RestoreSnapshotRequest |
indexSettings(java.lang.String source,
XContentType xContentType)
Sets settings that should be added/changed in all restored indices
|
java.lang.String[] |
indices()
Returns list of indices that should be restored from snapshot
|
RestoreSnapshotRequest |
indices(java.util.List<java.lang.String> indices)
Sets the list of indices that should be restored from snapshot
|
RestoreSnapshotRequest |
indices(java.lang.String... indices)
Sets the list of indices that should be restored from snapshot
|
IndicesOptions |
indicesOptions()
Specifies what type of requested indices to ignore and how to deal with wildcard expressions.
|
RestoreSnapshotRequest |
indicesOptions(IndicesOptions indicesOptions)
Specifies what type of requested indices to ignore and how to deal with wildcard expressions.
|
boolean |
partial()
Returns true if indices with failed to snapshot shards should be partially restored.
|
RestoreSnapshotRequest |
partial(boolean partial)
Set to true to allow indices with failed to snapshot shards should be partially restored.
|
void |
readFrom(StreamInput in)
Set this object's fields from a StreamInput.
|
java.lang.String |
renamePattern()
Returns rename pattern
|
RestoreSnapshotRequest |
renamePattern(java.lang.String renamePattern)
Sets rename pattern that should be applied to restored indices.
|
java.lang.String |
renameReplacement()
Returns rename replacement
|
RestoreSnapshotRequest |
renameReplacement(java.lang.String renameReplacement)
Sets rename replacement
|
java.lang.String |
repository()
Returns repository name
|
RestoreSnapshotRequest |
repository(java.lang.String repository)
Sets repository name
|
Settings |
settings()
Returns repository-specific restore settings
|
RestoreSnapshotRequest |
settings(java.util.Map<java.lang.String,java.lang.Object> source)
Sets repository-specific restore settings
|
RestoreSnapshotRequest |
settings(Settings.Builder settings)
Sets repository-specific restore settings.
|
RestoreSnapshotRequest |
settings(Settings settings)
Sets repository-specific restore settings.
|
RestoreSnapshotRequest |
settings(java.lang.String source)
Deprecated.
use
settings(String, XContentType) to avoid content type detection |
RestoreSnapshotRequest |
settings(java.lang.String source,
XContentType xContentType)
Sets repository-specific restore settings in JSON or YAML format
|
java.lang.String |
snapshot()
Returns the name of the snapshot.
|
RestoreSnapshotRequest |
snapshot(java.lang.String snapshot)
Sets the name of the snapshot.
|
RestoreSnapshotRequest |
source(java.util.Map<java.lang.String,java.lang.Object> source)
Parses restore definition
|
ActionRequestValidationException |
validate() |
boolean |
waitForCompletion()
Returns wait for completion setting
|
RestoreSnapshotRequest |
waitForCompletion(boolean waitForCompletion)
If this parameter is set to true the operation will wait for completion of restore process before returning.
|
void |
writeTo(StreamOutput out)
Write this object's fields to a StreamOutput.
|
masterNodeTimeout, masterNodeTimeout, masterNodeTimeout
getShouldStoreResult
getParentTask, setParentTask
remoteAddress, remoteAddress
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createTask, setParentTask
public RestoreSnapshotRequest()
public RestoreSnapshotRequest(java.lang.String repository, java.lang.String snapshot)
repository
- repository namesnapshot
- snapshot namepublic ActionRequestValidationException validate()
validate
in class ActionRequest
public RestoreSnapshotRequest snapshot(java.lang.String snapshot)
snapshot
- snapshot namepublic java.lang.String snapshot()
public RestoreSnapshotRequest repository(java.lang.String repository)
repository
- repository namepublic java.lang.String repository()
public RestoreSnapshotRequest indices(java.lang.String... indices)
The list of indices supports multi-index syntax. For example: "+test*" ,"-test42" will index all indices with prefix "test" except index "test42". Aliases are not supported. An empty list or {"_all"} will restore all open indices in the snapshot.
indices
- list of indicespublic RestoreSnapshotRequest indices(java.util.List<java.lang.String> indices)
The list of indices supports multi-index syntax. For example: "+test*" ,"-test42" will index all indices with prefix "test" except index "test42". Aliases are not supported. An empty list or {"_all"} will restore all open indices in the snapshot.
indices
- list of indicespublic java.lang.String[] indices()
public IndicesOptions indicesOptions()
public RestoreSnapshotRequest indicesOptions(IndicesOptions indicesOptions)
indicesOptions
- the desired behaviour regarding indices to ignore and wildcard indices expressionspublic RestoreSnapshotRequest renamePattern(java.lang.String renamePattern)
Indices that match the rename pattern will be renamed according to renameReplacement(String)
. The
rename pattern is applied according to the Matcher.appendReplacement(StringBuffer, String)
The request will fail if two or more indices will be renamed into the same name.
renamePattern
- rename patternpublic java.lang.String renamePattern()
public RestoreSnapshotRequest renameReplacement(java.lang.String renameReplacement)
See renamePattern(String)
for more information.
renameReplacement
- rename replacementpublic java.lang.String renameReplacement()
public RestoreSnapshotRequest waitForCompletion(boolean waitForCompletion)
waitForCompletion
- if true the operation will wait for completionpublic boolean waitForCompletion()
public boolean partial()
public RestoreSnapshotRequest partial(boolean partial)
partial
- true if indices with failed to snapshot shards should be partially restored.public RestoreSnapshotRequest settings(Settings settings)
See repository documentation for more information.
settings
- repository-specific snapshot settingspublic RestoreSnapshotRequest settings(Settings.Builder settings)
See repository documentation for more information.
settings
- repository-specific snapshot settings@Deprecated public RestoreSnapshotRequest settings(java.lang.String source)
settings(String, XContentType)
to avoid content type detectionSee repository documentation for more information.
source
- repository-specific snapshot settingspublic RestoreSnapshotRequest settings(java.lang.String source, XContentType xContentType)
See repository documentation for more information.
source
- repository-specific snapshot settingsxContentType
- the content type of the sourcepublic RestoreSnapshotRequest settings(java.util.Map<java.lang.String,java.lang.Object> source)
See repository documentation for more information.
source
- repository-specific snapshot settingspublic Settings settings()
public RestoreSnapshotRequest ignoreIndexSettings(java.lang.String... ignoreIndexSettings)
public RestoreSnapshotRequest ignoreIndexSettings(java.util.List<java.lang.String> ignoreIndexSettings)
public java.lang.String[] ignoreIndexSettings()
public RestoreSnapshotRequest includeGlobalState(boolean includeGlobalState)
The global cluster state includes persistent settings and index template definitions.
includeGlobalState
- true if global state should be restored from the snapshotpublic boolean includeGlobalState()
public RestoreSnapshotRequest includeAliases(boolean includeAliases)
includeAliases
- true if aliases should be restored from the snapshotpublic boolean includeAliases()
public RestoreSnapshotRequest indexSettings(Settings settings)
public RestoreSnapshotRequest indexSettings(Settings.Builder settings)
@Deprecated public RestoreSnapshotRequest indexSettings(java.lang.String source)
indexSettings(String, XContentType)
to avoid content type detectionpublic RestoreSnapshotRequest indexSettings(java.lang.String source, XContentType xContentType)
public RestoreSnapshotRequest indexSettings(java.util.Map<java.lang.String,java.lang.Object> source)
public Settings indexSettings()
public RestoreSnapshotRequest source(java.util.Map<java.lang.String,java.lang.Object> source)
source
- restore definitionpublic void readFrom(StreamInput in) throws java.io.IOException
Streamable
readFrom
in interface Streamable
readFrom
in class MasterNodeRequest<RestoreSnapshotRequest>
java.io.IOException
public void writeTo(StreamOutput out) throws java.io.IOException
Streamable
writeTo
in interface Streamable
writeTo
in class MasterNodeRequest<RestoreSnapshotRequest>
java.io.IOException
public java.lang.String getDescription()
TaskAwareRequest