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 TransportRequest.EmptyIndicesRequest.ReplaceableDEFAULT_MASTER_NODE_TIMEOUT, masterNodeTimeoutheaders| Constructor and Description |
|---|
CreateSnapshotRequest() |
CreateSnapshotRequest(String repository,
String snapshot)
Constructs a new put repository request with the provided snapshot and repository names
|
| Modifier and Type | Method and Description |
|---|---|
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
|
String[] |
indices()
Returns a list of indices that should be included into the snapshot
|
CreateSnapshotRequest |
indices(List<String> indices)
Sets a list of indices that should be included into the snapshot
|
CreateSnapshotRequest |
indices(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) |
String |
repository()
Returns repository name
|
CreateSnapshotRequest |
repository(String repository)
Sets repository name
|
Settings |
settings()
Returns repository-specific snapshot settings
|
CreateSnapshotRequest |
settings(Map<String,Object> source)
Sets repository-specific snapshot settings.
|
CreateSnapshotRequest |
settings(Settings.Builder settings)
Sets repository-specific snapshot settings.
|
CreateSnapshotRequest |
settings(Settings settings)
Sets repository-specific snapshot settings.
|
CreateSnapshotRequest |
settings(String source)
Sets repository-specific snapshot settings in JSON, YAML or properties format
|
String |
snapshot()
The snapshot name
|
CreateSnapshotRequest |
snapshot(String snapshot)
Sets the snapshot name
|
CreateSnapshotRequest |
source(byte[] source)
Parses snapshot definition.
|
CreateSnapshotRequest |
source(byte[] source,
int offset,
int length)
Parses snapshot definition.
|
CreateSnapshotRequest |
source(BytesReference source)
Parses snapshot definition.
|
CreateSnapshotRequest |
source(Map source)
Parses snapshot definition.
|
CreateSnapshotRequest |
source(String source)
Parses snapshot definition.
|
CreateSnapshotRequest |
source(XContentBuilder 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) |
masterNodeTimeout, masterNodeTimeout, masterNodeTimeoutcreateTask, createTask, setParentTaskgetDescriptionremoteAddress, remoteAddresscontextSize, copyContextAndHeadersFrom, copyContextFrom, copyHeadersFrom, getContext, getFromContext, getFromContext, getHeader, getHeaders, hasHeader, hasInContext, isContextEmpty, putAllInContext, putHeader, putInContextpublic ActionRequestValidationException validate()
validate in class ActionRequest<CreateSnapshotRequest>public CreateSnapshotRequest snapshot(String snapshot)
snapshot - snapshot namepublic String snapshot()
public CreateSnapshotRequest repository(String repository)
repository - namepublic String repository()
public CreateSnapshotRequest indices(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.Replaceablepublic CreateSnapshotRequest indices(List<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 String[] indices()
indices in interface IndicesRequestpublic IndicesOptions indicesOptions()
indicesOptions in interface IndicesRequestpublic 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(String source)
See repository documentation for more information.
source - repository-specific snapshot settingspublic CreateSnapshotRequest settings(Map<String,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(XContentBuilder source)
source - snapshot definitionpublic CreateSnapshotRequest source(Map source)
source - snapshot definitionpublic CreateSnapshotRequest source(String source)
source - snapshot definitionpublic CreateSnapshotRequest source(byte[] source)
source - snapshot definitionpublic CreateSnapshotRequest source(byte[] source, int offset, int length)
source - snapshot definitionoffset - offsetlength - lengthpublic CreateSnapshotRequest source(BytesReference source)
source - snapshot definitionpublic void readFrom(StreamInput in) throws IOException
readFrom in interface StreamablereadFrom in class MasterNodeRequest<CreateSnapshotRequest>IOExceptionpublic void writeTo(StreamOutput out) throws IOException
writeTo in interface StreamablewriteTo in class MasterNodeRequest<CreateSnapshotRequest>IOExceptionCopyright © 2009–2017. All rights reserved.