Class CreateSnapshotRequestBuilder
java.lang.Object
org.elasticsearch.action.ActionRequestBuilder<Request,Response>
org.elasticsearch.action.support.master.MasterNodeOperationRequestBuilder<CreateSnapshotRequest,CreateSnapshotResponse,CreateSnapshotRequestBuilder>
org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotRequestBuilder
public class CreateSnapshotRequestBuilder extends MasterNodeOperationRequestBuilder<CreateSnapshotRequest,CreateSnapshotResponse,CreateSnapshotRequestBuilder>
Create snapshot request builder
-
Field Summary
-
Constructor Summary
Constructors Constructor Description CreateSnapshotRequestBuilder(ElasticsearchClient client, CreateSnapshotAction action)Constructs a new create snapshot request builderCreateSnapshotRequestBuilder(ElasticsearchClient client, CreateSnapshotAction action, java.lang.String repository, java.lang.String snapshot)Constructs a new create snapshot request builder with specified repository and snapshot names -
Method Summary
Modifier and Type Method Description CreateSnapshotRequestBuildersetIncludeGlobalState(boolean includeGlobalState)Set to true if snapshot should include global cluster stateCreateSnapshotRequestBuildersetIndices(java.lang.String... indices)Sets a list of indices that should be included into the snapshotCreateSnapshotRequestBuildersetIndicesOptions(IndicesOptions indicesOptions)Specifies the indices options.CreateSnapshotRequestBuildersetPartial(boolean partial)If set to true the request should snapshot indices with unavailable shardsCreateSnapshotRequestBuildersetRepository(java.lang.String repository)Sets the repository nameCreateSnapshotRequestBuildersetSettings(java.lang.String source, XContentType xContentType)Sets repository-specific snapshot settings in YAML or JSON formatCreateSnapshotRequestBuildersetSettings(java.util.Map<java.lang.String,java.lang.Object> settings)Sets repository-specific snapshot settings.CreateSnapshotRequestBuildersetSettings(Settings settings)Sets repository-specific snapshot settings.CreateSnapshotRequestBuildersetSettings(Settings.Builder settings)Sets repository-specific snapshot settings.CreateSnapshotRequestBuildersetSnapshot(java.lang.String snapshot)Sets the snapshot nameCreateSnapshotRequestBuildersetWaitForCompletion(boolean waitForCompletion)If set to true the request should wait for the snapshot completion before returning.Methods inherited from class org.elasticsearch.action.support.master.MasterNodeOperationRequestBuilder
setMasterNodeTimeout, setMasterNodeTimeout
-
Constructor Details
-
CreateSnapshotRequestBuilder
Constructs a new create snapshot request builder -
CreateSnapshotRequestBuilder
public CreateSnapshotRequestBuilder(ElasticsearchClient client, CreateSnapshotAction action, java.lang.String repository, java.lang.String snapshot)Constructs a new create snapshot request builder with specified repository and snapshot names
-
-
Method Details
-
setSnapshot
Sets the snapshot name- Parameters:
snapshot- snapshot name- Returns:
- this builder
-
setRepository
Sets the repository name- Parameters:
repository- repository name- Returns:
- this builder
-
setIndices
Sets a list of indices that should be included into the snapshotThe 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.
- Returns:
- this builder
-
setIndicesOptions
Specifies the indices options. Like what type of requested indices to ignore. For example indices that don't exist.- Parameters:
indicesOptions- the desired behaviour regarding indices options- Returns:
- this request
-
setWaitForCompletion
If set to true the request should wait for the snapshot completion before returning.- Parameters:
waitForCompletion- true if- Returns:
- this builder
-
setPartial
If set to true the request should snapshot indices with unavailable shards- Parameters:
partial- true if request should snapshot indices with unavailable shards- Returns:
- this builder
-
setSettings
Sets repository-specific snapshot settings.See repository documentation for more information.
- Parameters:
settings- repository-specific snapshot settings- Returns:
- this builder
-
setSettings
Sets repository-specific snapshot settings.See repository documentation for more information.
- Parameters:
settings- repository-specific snapshot settings- Returns:
- this builder
-
setSettings
public CreateSnapshotRequestBuilder setSettings(java.lang.String source, XContentType xContentType)Sets repository-specific snapshot settings in YAML or JSON formatSee repository documentation for more information.
- Parameters:
source- repository-specific snapshot settingsxContentType- the content type of the source- Returns:
- this builder
-
setSettings
public CreateSnapshotRequestBuilder setSettings(java.util.Map<java.lang.String,java.lang.Object> settings)Sets repository-specific snapshot settings.See repository documentation for more information.
- Parameters:
settings- repository-specific snapshot settings- Returns:
- this builder
-
setIncludeGlobalState
Set to true if snapshot should include global cluster state- Parameters:
includeGlobalState- true if snapshot should include global cluster state- Returns:
- this builder
-