IndicesRequest
, IndicesRequest.Replaceable
, Streamable
, Writeable
, TaskAwareRequest
public class CreateSnapshotRequest extends MasterNodeRequest<CreateSnapshotRequest> implements IndicesRequest.Replaceable
The only mandatory parameter is repository name. The repository name has to satisfy the following requirements
Strings.INVALID_FILENAME_CHARS
IndicesRequest.Replaceable
TransportRequest.Empty
Writeable.Reader<V>, Writeable.Writer<V>
DEFAULT_MASTER_NODE_TIMEOUT, masterNodeTimeout
Constructor | Description |
---|---|
CreateSnapshotRequest() |
|
CreateSnapshotRequest(java.lang.String repository,
java.lang.String snapshot) |
Constructs a new put repository request with the provided snapshot and repository names
|
Modifier and Type | Method | Description |
---|---|---|
java.lang.String |
getDescription() |
Returns optional description of the request to be displayed by the task manager
|
boolean |
includeGlobalState() |
Returns true if global state should be stored as part of the snapshot
|
CreateSnapshotRequest |
includeGlobalState(boolean includeGlobalState) |
Set to true if global state should be stored as part of the snapshot
|
java.lang.String[] |
indices() |
Returns a list of indices that should be included into the snapshot
|
CreateSnapshotRequest |
indices(java.lang.String... indices) |
Sets a list of indices that should be included into the snapshot
|
CreateSnapshotRequest |
indices(java.util.List<java.lang.String> indices) |
Sets a list of indices that should be included into the snapshot
|
IndicesOptions |
indicesOptions() |
Specifies the indices options.
|
CreateSnapshotRequest |
indicesOptions(IndicesOptions indicesOptions) |
Specifies the indices options.
|
boolean |
partial() |
Returns true if indices with unavailable shards should be be partially snapshotted.
|
CreateSnapshotRequest |
partial(boolean partial) |
Set to true to allow indices with unavailable shards to be partially snapshotted.
|
void |
readFrom(StreamInput in) |
Set this object's fields from a StreamInput.
|
java.lang.String |
repository() |
Returns repository name
|
CreateSnapshotRequest |
repository(java.lang.String repository) |
Sets repository name
|
Settings |
settings() |
Returns repository-specific snapshot settings
|
CreateSnapshotRequest |
settings(java.lang.String source,
XContentType xContentType) |
Sets repository-specific snapshot settings in JSON or YAML format
|
CreateSnapshotRequest |
settings(java.util.Map<java.lang.String,java.lang.Object> source) |
Sets repository-specific snapshot settings.
|
CreateSnapshotRequest |
settings(Settings settings) |
Sets repository-specific snapshot settings.
|
CreateSnapshotRequest |
settings(Settings.Builder settings) |
Sets repository-specific snapshot settings.
|
java.lang.String |
snapshot() |
The snapshot name
|
CreateSnapshotRequest |
snapshot(java.lang.String snapshot) |
Sets the snapshot name
|
CreateSnapshotRequest |
source(java.util.Map<java.lang.String,java.lang.Object> source) |
Parses snapshot definition.
|
ActionRequestValidationException |
validate() |
|
boolean |
waitForCompletion() |
Returns true if the request should wait for the snapshot completion before returning
|
CreateSnapshotRequest |
waitForCompletion(boolean waitForCompletion) |
If set to true the operation should wait for the snapshot completion before returning.
|
void |
writeTo(StreamOutput out) |
Write this object's fields to a StreamOutput.
|
getShouldStoreResult
masterNodeTimeout, masterNodeTimeout, masterNodeTimeout
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createTask, setParentTask
remoteAddress, remoteAddress
getParentTask, setParentTask
public CreateSnapshotRequest()
public CreateSnapshotRequest(java.lang.String repository, java.lang.String snapshot)
repository
- repository namesnapshot
- snapshot namepublic ActionRequestValidationException validate()
validate
in class ActionRequest
public CreateSnapshotRequest snapshot(java.lang.String snapshot)
snapshot
- snapshot namepublic java.lang.String snapshot()
public CreateSnapshotRequest repository(java.lang.String repository)
repository
- namepublic java.lang.String repository()
public CreateSnapshotRequest 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 supported. An empty list or {"_all"} will snapshot all open indices in the cluster.
indices
in interface IndicesRequest.Replaceable
public CreateSnapshotRequest 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 supported. An empty list or {"_all"} will snapshot all open indices in the cluster.
public java.lang.String[] indices()
indices
in interface IndicesRequest
public IndicesOptions indicesOptions()
indicesOptions
in interface IndicesRequest
public CreateSnapshotRequest indicesOptions(IndicesOptions indicesOptions)
indicesOptions
- the desired behaviour regarding indices optionspublic boolean partial()
public CreateSnapshotRequest partial(boolean partial)
partial
- true if indices with unavailable shards should be be partially snapshotted.public CreateSnapshotRequest waitForCompletion(boolean waitForCompletion)
waitForCompletion
- true if operation should wait for the snapshot completionpublic boolean waitForCompletion()
public CreateSnapshotRequest settings(Settings settings)
See repository documentation for more information.
settings
- repository-specific snapshot settingspublic CreateSnapshotRequest settings(Settings.Builder settings)
See repository documentation for more information.
settings
- repository-specific snapshot settingspublic CreateSnapshotRequest settings(java.lang.String source, XContentType xContentType)
See repository documentation for more information.
source
- repository-specific snapshot settingsxContentType
- the content type of the sourcepublic CreateSnapshotRequest 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 CreateSnapshotRequest includeGlobalState(boolean includeGlobalState)
includeGlobalState
- true if global state should be storedpublic boolean includeGlobalState()
public CreateSnapshotRequest source(java.util.Map<java.lang.String,java.lang.Object> source)
source
- snapshot definitionpublic void readFrom(StreamInput in) throws java.io.IOException
Streamable
readFrom
in interface Streamable
readFrom
in class MasterNodeRequest<CreateSnapshotRequest>
java.io.IOException
public void writeTo(StreamOutput out) throws java.io.IOException
Streamable
writeTo
in interface Streamable
writeTo
in interface Writeable
writeTo
in class MasterNodeRequest<CreateSnapshotRequest>
java.io.IOException
public java.lang.String getDescription()
TaskAwareRequest
getDescription
in interface TaskAwareRequest