Class RestoreSnapshotRequest
- All Implemented Interfaces:
Writeable
,org.elasticsearch.common.util.concurrent.RefCounted
,org.elasticsearch.common.xcontent.ToXContent
,org.elasticsearch.common.xcontent.ToXContentObject
,TaskAwareRequest
public class RestoreSnapshotRequest extends MasterNodeRequest<RestoreSnapshotRequest> implements org.elasticsearch.common.xcontent.ToXContentObject
-
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
org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.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.RestoreSnapshotRequest(StreamInput in)
-
Method Summary
Modifier and Type Method Description boolean
equals(java.lang.Object o)
java.lang.String[]
featureStates()
RestoreSnapshotRequest
featureStates(java.lang.String[] featureStates)
RestoreSnapshotRequest
featureStates(java.util.List<java.lang.String> featureStates)
java.lang.String
getDescription()
Returns optional description of the request to be displayed by the task managerint
hashCode()
java.lang.String[]
ignoreIndexSettings()
Returns the list of index settings and index settings groups that shouldn't be restored from snapshotRestoreSnapshotRequest
ignoreIndexSettings(java.lang.String... ignoreIndexSettings)
Sets the list of index settings and index settings groups that shouldn't be restored from snapshotRestoreSnapshotRequest
ignoreIndexSettings(java.util.List<java.lang.String> ignoreIndexSettings)
Sets the list of index settings and index settings groups that shouldn't be restored from snapshotboolean
includeAliases()
Returns true if aliases should be restored from this snapshotRestoreSnapshotRequest
includeAliases(boolean includeAliases)
If set to true the restore procedure will restore aliasesboolean
includeGlobalState()
Returns true if global state should be restored from this snapshotRestoreSnapshotRequest
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 indicesRestoreSnapshotRequest
indexSettings(java.lang.String source, org.elasticsearch.common.xcontent.XContentType xContentType)
Sets settings that should be added/changed in all restored indicesRestoreSnapshotRequest
indexSettings(java.util.Map<java.lang.String,java.lang.Object> source)
Sets settings that should be added/changed in all restored indicesRestoreSnapshotRequest
indexSettings(Settings settings)
Sets settings that should be added/changed in all restored indicesRestoreSnapshotRequest
indexSettings(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 snapshotRestoreSnapshotRequest
indices(java.lang.String... indices)
Sets the list of indices that should be restored from snapshotRestoreSnapshotRequest
indices(java.util.List<java.lang.String> indices)
Sets the list of indices that should be restored from snapshotIndicesOptions
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.java.lang.String
renamePattern()
Returns rename patternRestoreSnapshotRequest
renamePattern(java.lang.String renamePattern)
Sets rename pattern that should be applied to restored indices.java.lang.String
renameReplacement()
Returns rename replacementRestoreSnapshotRequest
renameReplacement(java.lang.String renameReplacement)
Sets rename replacementjava.lang.String
repository()
Returns repository nameRestoreSnapshotRequest
repository(java.lang.String repository)
Sets repository nameboolean
skipOperatorOnlyState()
void
skipOperatorOnlyState(boolean skipOperatorOnlyState)
java.lang.String
snapshot()
Returns the name of the snapshot.RestoreSnapshotRequest
snapshot(java.lang.String snapshot)
Sets the name of the snapshot.java.lang.String
snapshotUuid()
RestoreSnapshotRequest
snapshotUuid(java.lang.String snapshotUuid)
Sometimes a client has identified precisely which snapshot is to be restored via a separate mechanism and wishes to guarantee that this is the snapshot that this request restores.RestoreSnapshotRequest
source(java.util.Map<java.lang.String,java.lang.Object> source)
Parses restore definitionjava.lang.String
toString()
org.elasticsearch.common.xcontent.XContentBuilder
toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)
ActionRequestValidationException
validate()
boolean
waitForCompletion()
Returns wait for completion settingRestoreSnapshotRequest
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 into the 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
decRef, incRef, remoteAddress, remoteAddress, tryIncRef
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 Details
-
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
-
RestoreSnapshotRequest
- Throws:
java.io.IOException
-
-
Method Details
-
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput.- Specified by:
writeTo
in interfaceWriteable
- Overrides:
writeTo
in classMasterNodeRequest<RestoreSnapshotRequest>
- Throws:
java.io.IOException
-
validate
- Specified by:
validate
in classActionRequest
-
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
Sets repository name- Parameters:
repository
- repository name- Returns:
- this request
-
repository
public java.lang.String repository()Returns repository name- Returns:
- repository name
-
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
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
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
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
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
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
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
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
-
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
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
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
Sets settings that should be added/changed in all restored indices -
indexSettings
Sets settings that should be added/changed in all restored indices -
indexSettings
public RestoreSnapshotRequest indexSettings(java.lang.String source, org.elasticsearch.common.xcontent.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
Returns settings that should be added/changed in all restored indices -
snapshotUuid
Sometimes a client has identified precisely which snapshot is to be restored via a separate mechanism and wishes to guarantee that this is the snapshot that this request restores. If the client can only identify a snapshot by its name then there is a risk that the desired snapshot may be deleted and replaced by a new snapshot with the same name which is inconsistent with the original one. This method lets us fail the restore if the precise snapshot we want is not available. This is for internal use only and is not exposed in the REST layer. -
snapshotUuid
@Nullable public java.lang.String snapshotUuid()- Returns:
- the UUID that identifies the specific snapshot in the repository to be restored, or
null
if the snapshot name is a sufficient identifier.
-
skipOperatorOnlyState
public boolean skipOperatorOnlyState() -
skipOperatorOnlyState
public void skipOperatorOnlyState(boolean skipOperatorOnlyState) -
featureStates
@Nullable public java.lang.String[] featureStates()- Returns:
- Which feature states should be included in the snapshot
-
featureStates
- Parameters:
featureStates
- The feature states to be included in the snapshot
-
featureStates
- Parameters:
featureStates
- The feature states to be included in the snapshot
-
source
Parses restore definition- Parameters:
source
- restore definition- Returns:
- this request
-
toXContent
public org.elasticsearch.common.xcontent.XContentBuilder toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws java.io.IOException- Specified by:
toXContent
in interfaceorg.elasticsearch.common.xcontent.ToXContent
- Throws:
java.io.IOException
-
getDescription
public java.lang.String getDescription()Description copied from interface:TaskAwareRequest
Returns optional description of the request to be displayed by the task manager- Specified by:
getDescription
in interfaceTaskAwareRequest
-
equals
public boolean equals(java.lang.Object o)- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-