Class CreateSnapshotRequestBuilder
- java.lang.Object
-
- org.elasticsearch.action.ActionRequestBuilder<Request,Response,RequestBuilder>
-
- 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
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 CreateSnapshotRequestBuilder
setIncludeGlobalState(boolean includeGlobalState)
Set to true if snapshot should include global cluster stateCreateSnapshotRequestBuilder
setIndices(java.lang.String... indices)
Sets a list of indices that should be included into the snapshotCreateSnapshotRequestBuilder
setIndicesOptions(IndicesOptions indicesOptions)
Specifies the indices options.CreateSnapshotRequestBuilder
setPartial(boolean partial)
If set to true the request should snapshot indices with unavailable shardsCreateSnapshotRequestBuilder
setRepository(java.lang.String repository)
Sets the repository nameCreateSnapshotRequestBuilder
setSettings(java.lang.String source, XContentType xContentType)
Sets repository-specific snapshot settings in YAML or JSON formatCreateSnapshotRequestBuilder
setSettings(java.util.Map<java.lang.String,java.lang.Object> settings)
Sets repository-specific snapshot settings.CreateSnapshotRequestBuilder
setSettings(Settings settings)
Sets repository-specific snapshot settings.CreateSnapshotRequestBuilder
setSettings(Settings.Builder settings)
Sets repository-specific snapshot settings.CreateSnapshotRequestBuilder
setSnapshot(java.lang.String snapshot)
Sets the snapshot nameCreateSnapshotRequestBuilder
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 Detail
-
CreateSnapshotRequestBuilder
public CreateSnapshotRequestBuilder(ElasticsearchClient client, CreateSnapshotAction action)
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 Detail
-
setSnapshot
public CreateSnapshotRequestBuilder setSnapshot(java.lang.String snapshot)
Sets the snapshot name- Parameters:
snapshot
- snapshot name- Returns:
- this builder
-
setRepository
public CreateSnapshotRequestBuilder setRepository(java.lang.String repository)
Sets the repository name- Parameters:
repository
- repository name- Returns:
- this builder
-
setIndices
public CreateSnapshotRequestBuilder setIndices(java.lang.String... indices)
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
public CreateSnapshotRequestBuilder setIndicesOptions(IndicesOptions indicesOptions)
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
public CreateSnapshotRequestBuilder setWaitForCompletion(boolean waitForCompletion)
If set to true the request should wait for the snapshot completion before returning.- Parameters:
waitForCompletion
- true if- Returns:
- this builder
-
setPartial
public CreateSnapshotRequestBuilder setPartial(boolean partial)
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
public CreateSnapshotRequestBuilder setSettings(Settings settings)
Sets repository-specific snapshot settings.See repository documentation for more information.
- Parameters:
settings
- repository-specific snapshot settings- Returns:
- this builder
-
setSettings
public CreateSnapshotRequestBuilder setSettings(Settings.Builder settings)
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
public CreateSnapshotRequestBuilder setIncludeGlobalState(boolean includeGlobalState)
Set to true if snapshot should include global cluster state- Parameters:
includeGlobalState
- true if snapshot should include global cluster state- Returns:
- this builder
-
-