Class CreateSnapshotRequest
- All Implemented Interfaces:
IndicesRequest
,IndicesRequest.Replaceable
,Writeable
,org.elasticsearch.common.xcontent.ToXContent
,org.elasticsearch.common.xcontent.ToXContentObject
,org.elasticsearch.core.RefCounted
,TaskAwareRequest
The only mandatory parameter is repository name. The repository name has to satisfy the following requirements
- be a non-empty string
- must not contain whitespace (tabs or spaces)
- must not contain comma (',')
- must not contain hash sign ('#')
- must not start with underscore ('-')
- must be lowercase
- must not contain invalid file name characters
Strings.INVALID_FILENAME_CHARS
-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.transport.TransportRequest
TransportRequest.Empty
Nested classes/interfaces inherited from interface org.elasticsearch.action.IndicesRequest
IndicesRequest.Replaceable
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.ToXContent.Params
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Field Summary
Fields inherited from class org.elasticsearch.action.support.master.MasterNodeRequest
DEFAULT_MASTER_NODE_TIMEOUT, masterNodeTimeout
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
Constructor Summary
ConstructorDescriptionCreateSnapshotRequest(String repository, String snapshot)
Constructs a new put repository request with the provided snapshot and repository names -
Method Summary
Modifier and TypeMethodDescriptionboolean
String[]
featureStates(String[] featureStates)
featureStates(List<String> featureStates)
Returns optional description of the request to be displayed by the task managerint
hashCode()
boolean
Determines whether the request should be applied to data streams.boolean
Returns true if global state should be stored as part of the snapshotincludeGlobalState(boolean includeGlobalState)
Set to true if global state should be stored as part of the snapshotString[]
indices()
Returns a list of indices that should be included into the snapshotSets a list of indices that should be included into the snapshotSets a list of indices that should be included into the snapshotSpecifies the indices options.indicesOptions(IndicesOptions indicesOptions)
Specifies the indices options.static int
metadataSize(Map<String,Object> userMetadata)
boolean
partial()
Returns true if indices with unavailable shards should be be partially snapshotted.partial(boolean partial)
Set to true to allow indices with unavailable shards to be partially snapshotted.Returns repository namerepository(String repository)
Sets repository namesettings()
Returns repository-specific snapshot settingsSets repository-specific snapshot settings in JSON or YAML formatSets repository-specific snapshot settings.Sets repository-specific snapshot settings.settings(Settings.Builder settings)
Sets repository-specific snapshot settings.snapshot()
The snapshot nameSets the snapshot nameParses snapshot definition.toString()
org.elasticsearch.common.xcontent.XContentBuilder
toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)
userMetadata(Map<String,Object> userMetadata)
validate()
boolean
Returns true if the request should wait for the snapshot completion before returningwaitForCompletion(boolean waitForCompletion)
If set to true the operation should wait for the snapshot completion before returning.void
writeTo(StreamOutput out)
Write this into the StreamOutput.Methods inherited from class org.elasticsearch.action.support.master.MasterNodeRequest
masterNodeTimeout, masterNodeTimeout, masterNodeTimeout
Methods inherited from class org.elasticsearch.action.ActionRequest
getShouldStoreResult
Methods inherited from class org.elasticsearch.transport.TransportRequest
getParentTask, setParentTask
Methods inherited from class org.elasticsearch.transport.TransportMessage
decRef, incRef, remoteAddress, remoteAddress, tryIncRef
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.elasticsearch.action.IndicesRequest
allowsRemoteIndices
Methods inherited from interface org.elasticsearch.tasks.TaskAwareRequest
createTask, setParentTask
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentObject
isFragment
-
Field Details
-
MAXIMUM_METADATA_BYTES
public static int MAXIMUM_METADATA_BYTES
-
-
Constructor Details
-
CreateSnapshotRequest
public CreateSnapshotRequest() -
CreateSnapshotRequest
Constructs a new put repository request with the provided snapshot and repository names- Parameters:
repository
- repository namesnapshot
- snapshot name
-
CreateSnapshotRequest
- Throws:
IOException
-
-
Method Details
-
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput.- Specified by:
writeTo
in interfaceWriteable
- Overrides:
writeTo
in classMasterNodeRequest<CreateSnapshotRequest>
- Throws:
IOException
-
validate
- Specified by:
validate
in classActionRequest
-
metadataSize
-
snapshot
Sets the snapshot name- Parameters:
snapshot
- snapshot name
-
snapshot
The snapshot name- Returns:
- snapshot name
-
repository
Sets repository name- Parameters:
repository
- name- Returns:
- this request
-
repository
Returns repository name- Returns:
- repository name
-
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.
- Specified by:
indices
in interfaceIndicesRequest.Replaceable
- Returns:
- this request
-
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 request
-
indices
Returns a list of indices that should be included into the snapshot- Specified by:
indices
in interfaceIndicesRequest
- Returns:
- list of indices
-
indicesOptions
Specifies the indices options. Like what type of requested indices to ignore. For example indices that don't exist.- Specified by:
indicesOptions
in interfaceIndicesRequest
- Returns:
- the desired behaviour regarding indices options
-
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
-
includeDataStreams
public boolean includeDataStreams()Description copied from interface:IndicesRequest
Determines whether the request should be applied to data streams. Whenfalse
, none of the names or wildcard expressions inIndicesRequest.indices()
should be applied to or expanded to any data streams. All layers involved in the request's fulfillment including security, name resolution, etc., should respect this flag.- Specified by:
includeDataStreams
in interfaceIndicesRequest
-
partial
public boolean partial()Returns true if indices with unavailable shards should be be partially snapshotted.- Returns:
- the desired behaviour regarding indices options
-
partial
Set to true to allow indices with unavailable shards to be partially snapshotted.- Parameters:
partial
- true if indices with unavailable shards should be be partially snapshotted.- Returns:
- this request
-
waitForCompletion
If set to true the operation should wait for the snapshot completion before returning. By default, the operation will return as soon as snapshot is initialized. It can be changed by setting this flag to true.- Parameters:
waitForCompletion
- true if operation should wait for the snapshot completion- Returns:
- this request
-
waitForCompletion
public boolean waitForCompletion()Returns true if the request should wait for the snapshot completion before returning- Returns:
- true if the request should wait for completion
-
settings
Sets repository-specific snapshot settings.See repository documentation for more information.
- Parameters:
settings
- repository-specific snapshot settings- Returns:
- this request
-
settings
Sets repository-specific snapshot settings.See repository documentation for more information.
- Parameters:
settings
- repository-specific snapshot settings- Returns:
- this request
-
settings
public CreateSnapshotRequest settings(String source, org.elasticsearch.common.xcontent.XContentType xContentType)Sets repository-specific snapshot settings in JSON or YAML formatSee repository documentation for more information.
- Parameters:
source
- repository-specific snapshot settingsxContentType
- the content type of the source- Returns:
- this request
-
settings
Sets repository-specific snapshot settings.See repository documentation for more information.
- Parameters:
source
- repository-specific snapshot settings- Returns:
- this request
-
settings
Returns repository-specific snapshot settings- Returns:
- repository-specific snapshot settings
-
includeGlobalState
Set to true if global state should be stored as part of the snapshot- Parameters:
includeGlobalState
- true if global state should be stored- Returns:
- this request
-
includeGlobalState
public boolean includeGlobalState()Returns true if global state should be stored as part of the snapshot- Returns:
- true if global state should be stored as part of the snapshot
-
userMetadata
-
userMetadata
-
featureStates
- Returns:
- Which plugin states should be included in the snapshot
-
featureStates
- Parameters:
featureStates
- The plugin states to be included in the snapshot
-
featureStates
- Parameters:
featureStates
- The plugin states to be included in the snapshot
-
source
Parses snapshot definition.- Parameters:
source
- snapshot definition- Returns:
- this request
-
toXContent
public org.elasticsearch.common.xcontent.XContentBuilder toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws IOException- Specified by:
toXContent
in interfaceorg.elasticsearch.common.xcontent.ToXContent
- Throws:
IOException
-
getDescription
Description copied from interface:TaskAwareRequest
Returns optional description of the request to be displayed by the task manager- Specified by:
getDescription
in interfaceTaskAwareRequest
-
equals
-
hashCode
public int hashCode() -
toString
- Overrides:
toString
in classTransportRequest
-