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
Fields inherited from class org.elasticsearch.action.ActionRequestBuilder
action, client, request
-
Constructor Summary
ConstructorDescriptionCreateSnapshotRequestBuilder(ElasticsearchClient client, CreateSnapshotAction action)
Constructs a new create snapshot request builderCreateSnapshotRequestBuilder(ElasticsearchClient client, CreateSnapshotAction action, String repository, String snapshot)
Constructs a new create snapshot request builder with specified repository and snapshot names -
Method Summary
Modifier and TypeMethodDescriptionsetFeatureStates(String... featureStates)
Provide a list of features whose state indices should be included in the snapshotsetIncludeGlobalState(boolean includeGlobalState)
Set to true if snapshot should include global cluster statesetIndices(String... indices)
Sets a list of indices that should be included into the snapshotsetIndicesOptions(IndicesOptions indicesOptions)
Specifies the indices options.setPartial(boolean partial)
If set to true the request should snapshot indices with unavailable shardssetRepository(String repository)
Sets the repository namesetSettings(String source, org.elasticsearch.common.xcontent.XContentType xContentType)
Sets repository-specific snapshot settings in YAML or JSON formatsetSettings(Map<String,Object> settings)
Sets repository-specific snapshot settings.setSettings(Settings settings)
Sets repository-specific snapshot settings.setSettings(Settings.Builder settings)
Sets repository-specific snapshot settings.setSnapshot(String snapshot)
Sets the snapshot namesetUserMetadata(Map<String,Object> metadata)
Provide a map of user metadata that should be included in the snapshot metadata.setWaitForCompletion(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, String repository, 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(String source, org.elasticsearch.common.xcontent.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
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
-
setFeatureStates
Provide a list of features whose state indices should be included in the snapshot- Parameters:
featureStates
- A list of feature names- Returns:
- this builder
-
setUserMetadata
Provide a map of user metadata that should be included in the snapshot metadata.- Parameters:
metadata
- user metadata map- Returns:
- this builder
-