Class RestoreSnapshotRequest
- java.lang.Object
-
- org.elasticsearch.transport.TransportMessage
-
- org.elasticsearch.transport.TransportRequest
-
- org.elasticsearch.action.ActionRequest
-
- org.elasticsearch.action.support.master.MasterNodeRequest<RestoreSnapshotRequest>
-
- org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotRequest
-
- All Implemented Interfaces:
Streamable,Writeable,ToXContent,ToXContentObject,TaskAwareRequest
public class RestoreSnapshotRequest extends MasterNodeRequest<RestoreSnapshotRequest> implements ToXContentObject
Restore snapshot request
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.elasticsearch.transport.TransportRequest
TransportRequest.Empty
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
-
Field Summary
-
Fields inherited from class org.elasticsearch.action.support.master.MasterNodeRequest
DEFAULT_MASTER_NODE_TIMEOUT, masterNodeTimeout
-
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
-
Constructor Summary
Constructors Constructor Description RestoreSnapshotRequest()RestoreSnapshotRequest(java.lang.String repository, java.lang.String snapshot)Constructs a new put repository request with the provided repository and snapshot names.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)java.lang.StringgetDescription()Returns optional description of the request to be displayed by the task managerinthashCode()java.lang.String[]ignoreIndexSettings()Returns the list of index settings and index settings groups that shouldn't be restored from snapshotRestoreSnapshotRequestignoreIndexSettings(java.lang.String... ignoreIndexSettings)Sets the list of index settings and index settings groups that shouldn't be restored from snapshotRestoreSnapshotRequestignoreIndexSettings(java.util.List<java.lang.String> ignoreIndexSettings)Sets the list of index settings and index settings groups that shouldn't be restored from snapshotbooleanincludeAliases()Returns true if aliases should be restored from this snapshotRestoreSnapshotRequestincludeAliases(boolean includeAliases)If set to true the restore procedure will restore aliasesbooleanincludeGlobalState()Returns true if global state should be restored from this snapshotRestoreSnapshotRequestincludeGlobalState(boolean includeGlobalState)If set to true the restore procedure will restore global cluster state.SettingsindexSettings()Returns settings that should be added/changed in all restored indicesRestoreSnapshotRequestindexSettings(java.lang.String source, XContentType xContentType)Sets settings that should be added/changed in all restored indicesRestoreSnapshotRequestindexSettings(java.util.Map<java.lang.String,java.lang.Object> source)Sets settings that should be added/changed in all restored indicesRestoreSnapshotRequestindexSettings(Settings settings)Sets settings that should be added/changed in all restored indicesRestoreSnapshotRequestindexSettings(Settings.Builder settings)Sets settings that should be added/changed in all restored indicesjava.lang.String[]indices()Returns list of indices that should be restored from snapshotRestoreSnapshotRequestindices(java.lang.String... indices)Sets the list of indices that should be restored from snapshotRestoreSnapshotRequestindices(java.util.List<java.lang.String> indices)Sets the list of indices that should be restored from snapshotIndicesOptionsindicesOptions()Specifies what type of requested indices to ignore and how to deal with wildcard expressions.RestoreSnapshotRequestindicesOptions(IndicesOptions indicesOptions)Specifies what type of requested indices to ignore and how to deal with wildcard expressions.booleanpartial()Returns true if indices with failed to snapshot shards should be partially restored.RestoreSnapshotRequestpartial(boolean partial)Set to true to allow indices with failed to snapshot shards should be partially restored.voidreadFrom(StreamInput in)Set this object's fields from a StreamInput.java.lang.StringrenamePattern()Returns rename patternRestoreSnapshotRequestrenamePattern(java.lang.String renamePattern)Sets rename pattern that should be applied to restored indices.java.lang.StringrenameReplacement()Returns rename replacementRestoreSnapshotRequestrenameReplacement(java.lang.String renameReplacement)Sets rename replacementjava.lang.Stringrepository()Returns repository nameRestoreSnapshotRequestrepository(java.lang.String repository)Sets repository nameSettingssettings()Returns repository-specific restore settingsRestoreSnapshotRequestsettings(java.lang.String source, XContentType xContentType)Sets repository-specific restore settings in JSON or YAML formatRestoreSnapshotRequestsettings(java.util.Map<java.lang.String,java.lang.Object> source)Sets repository-specific restore settingsRestoreSnapshotRequestsettings(Settings settings)Sets repository-specific restore settings.RestoreSnapshotRequestsettings(Settings.Builder settings)Sets repository-specific restore settings.java.lang.Stringsnapshot()Returns the name of the snapshot.RestoreSnapshotRequestsnapshot(java.lang.String snapshot)Sets the name of the snapshot.RestoreSnapshotRequestsource(java.util.Map<java.lang.String,java.lang.Object> source)Parses restore definitionjava.lang.StringtoString()XContentBuildertoXContent(XContentBuilder builder, ToXContent.Params params)ActionRequestValidationExceptionvalidate()booleanwaitForCompletion()Returns wait for completion settingRestoreSnapshotRequestwaitForCompletion(boolean waitForCompletion)If this parameter is set to true the operation will wait for completion of restore process before returning.voidwriteTo(StreamOutput out)Write this object's fields to a StreamOutput.-
Methods inherited from class org.elasticsearch.action.support.master.MasterNodeRequest
masterNodeTimeout, masterNodeTimeout, masterNodeTimeout
-
Methods inherited from class org.elasticsearch.action.ActionRequest
getShouldStoreResult
-
Methods inherited from class org.elasticsearch.transport.TransportRequest
getParentTask, setParentTask
-
Methods inherited from class org.elasticsearch.transport.TransportMessage
remoteAddress, remoteAddress
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.tasks.TaskAwareRequest
createTask, setParentTask
-
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentObject
isFragment
-
-
-
-
Constructor Detail
-
RestoreSnapshotRequest
public RestoreSnapshotRequest()
-
RestoreSnapshotRequest
public RestoreSnapshotRequest(java.lang.String repository, java.lang.String snapshot)Constructs a new put repository request with the provided repository and snapshot names.- Parameters:
repository- repository namesnapshot- snapshot name
-
-
Method Detail
-
validate
public ActionRequestValidationException validate()
- Specified by:
validatein classActionRequest
-
snapshot
public RestoreSnapshotRequest snapshot(java.lang.String snapshot)
Sets the name of the snapshot.- Parameters:
snapshot- snapshot name- Returns:
- this request
-
snapshot
public java.lang.String snapshot()
Returns the name of the snapshot.- Returns:
- snapshot name
-
repository
public RestoreSnapshotRequest repository(java.lang.String repository)
Sets repository name- Parameters:
repository- repository name- Returns:
- this request
-
repository
public java.lang.String repository()
Returns repository name- Returns:
- repository name
-
indices
public RestoreSnapshotRequest indices(java.lang.String... indices)
Sets the list of indices that should be restored from snapshotThe 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.
- Parameters:
indices- list of indices- Returns:
- this request
-
indices
public RestoreSnapshotRequest indices(java.util.List<java.lang.String> indices)
Sets the list of indices that should be restored from snapshotThe 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.
- Parameters:
indices- list of indices- Returns:
- this request
-
indices
public java.lang.String[] indices()
Returns list of indices that should be restored from snapshot
-
indicesOptions
public IndicesOptions indicesOptions()
Specifies what type of requested indices to ignore and how to deal with wildcard expressions. For example indices that don't exist.- Returns:
- the desired behaviour regarding indices to ignore and wildcard indices expression
-
indicesOptions
public RestoreSnapshotRequest indicesOptions(IndicesOptions indicesOptions)
Specifies what type of requested indices to ignore and how to deal with wildcard expressions. For example indices that don't exist.- Parameters:
indicesOptions- the desired behaviour regarding indices to ignore and wildcard indices expressions- Returns:
- this request
-
renamePattern
public RestoreSnapshotRequest renamePattern(java.lang.String renamePattern)
Sets rename pattern that should be applied to restored indices.Indices that match the rename pattern will be renamed according to
renameReplacement(String). The rename pattern is applied according to theMatcher.appendReplacement(StringBuffer, String)The request will fail if two or more indices will be renamed into the same name.- Parameters:
renamePattern- rename pattern- Returns:
- this request
-
renamePattern
public java.lang.String renamePattern()
Returns rename pattern- Returns:
- rename pattern
-
renameReplacement
public RestoreSnapshotRequest renameReplacement(java.lang.String renameReplacement)
Sets rename replacementSee
renamePattern(String)for more information.- Parameters:
renameReplacement- rename replacement
-
renameReplacement
public java.lang.String renameReplacement()
Returns rename replacement- Returns:
- rename replacement
-
waitForCompletion
public RestoreSnapshotRequest waitForCompletion(boolean waitForCompletion)
If this parameter is set to true the operation will wait for completion of restore process before returning.- Parameters:
waitForCompletion- if true the operation will wait for completion- Returns:
- this request
-
waitForCompletion
public boolean waitForCompletion()
Returns wait for completion setting- Returns:
- true if the operation will wait for completion
-
partial
public boolean partial()
Returns true if indices with failed to snapshot shards should be partially restored.- Returns:
- true if indices with failed to snapshot shards should be partially restored
-
partial
public RestoreSnapshotRequest partial(boolean partial)
Set to true to allow indices with failed to snapshot shards should be partially restored.- Parameters:
partial- true if indices with failed to snapshot shards should be partially restored.- Returns:
- this request
-
settings
public RestoreSnapshotRequest settings(Settings settings)
Sets repository-specific restore settings.See repository documentation for more information.
- Parameters:
settings- repository-specific snapshot settings- Returns:
- this request
-
settings
public RestoreSnapshotRequest settings(Settings.Builder settings)
Sets repository-specific restore settings.See repository documentation for more information.
- Parameters:
settings- repository-specific snapshot settings- Returns:
- this request
-
settings
public RestoreSnapshotRequest settings(java.lang.String source, XContentType xContentType)
Sets repository-specific restore settings in JSON or YAML formatSee repository documentation for more information.
- Parameters:
source- repository-specific snapshot settingsxContentType- the content type of the source- Returns:
- this request
-
settings
public RestoreSnapshotRequest settings(java.util.Map<java.lang.String,java.lang.Object> source)
Sets repository-specific restore settingsSee repository documentation for more information.
- Parameters:
source- repository-specific snapshot settings- Returns:
- this request
-
settings
public Settings settings()
Returns repository-specific restore settings- Returns:
- restore settings
-
ignoreIndexSettings
public RestoreSnapshotRequest ignoreIndexSettings(java.lang.String... ignoreIndexSettings)
Sets the list of index settings and index settings groups that shouldn't be restored from snapshot
-
ignoreIndexSettings
public 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
-
ignoreIndexSettings
public java.lang.String[] ignoreIndexSettings()
Returns the list of index settings and index settings groups that shouldn't be restored from snapshot
-
includeGlobalState
public RestoreSnapshotRequest includeGlobalState(boolean includeGlobalState)
If set to true the restore procedure will restore global cluster state.The global cluster state includes persistent settings and index template definitions.
- Parameters:
includeGlobalState- true if global state should be restored from the snapshot- Returns:
- this request
-
includeGlobalState
public boolean includeGlobalState()
Returns true if global state should be restored from this snapshot- Returns:
- true if global state should be restored
-
includeAliases
public RestoreSnapshotRequest includeAliases(boolean includeAliases)
If set to true the restore procedure will restore aliases- Parameters:
includeAliases- true if aliases should be restored from the snapshot- Returns:
- this request
-
includeAliases
public boolean includeAliases()
Returns true if aliases should be restored from this snapshot- Returns:
- true if aliases should be restored
-
indexSettings
public RestoreSnapshotRequest indexSettings(Settings settings)
Sets settings that should be added/changed in all restored indices
-
indexSettings
public RestoreSnapshotRequest indexSettings(Settings.Builder settings)
Sets settings that should be added/changed in all restored indices
-
indexSettings
public RestoreSnapshotRequest indexSettings(java.lang.String source, XContentType xContentType)
Sets settings that should be added/changed in all restored indices
-
indexSettings
public RestoreSnapshotRequest indexSettings(java.util.Map<java.lang.String,java.lang.Object> source)
Sets settings that should be added/changed in all restored indices
-
indexSettings
public Settings indexSettings()
Returns settings that should be added/changed in all restored indices
-
source
public RestoreSnapshotRequest source(java.util.Map<java.lang.String,java.lang.Object> source)
Parses restore definition- Parameters:
source- restore definition- Returns:
- this request
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
- Specified by:
toXContentin interfaceToXContent- Throws:
java.io.IOException
-
readFrom
public void readFrom(StreamInput in) throws java.io.IOException
Description copied from interface:StreamableSet this object's fields from a StreamInput.- Specified by:
readFromin interfaceStreamable- Overrides:
readFromin classMasterNodeRequest<RestoreSnapshotRequest>- Throws:
java.io.IOException
-
writeTo
public void writeTo(StreamOutput out) throws java.io.IOException
Description copied from interface:StreamableWrite this object's fields to a StreamOutput.- Specified by:
writeToin interfaceStreamable- Specified by:
writeToin interfaceWriteable- Overrides:
writeToin classMasterNodeRequest<RestoreSnapshotRequest>- Throws:
java.io.IOException
-
getDescription
public java.lang.String getDescription()
Description copied from interface:TaskAwareRequestReturns optional description of the request to be displayed by the task manager- Specified by:
getDescriptionin interfaceTaskAwareRequest
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-