Class GetSnapshotsRequest
- java.lang.Object
-
- org.elasticsearch.transport.TransportMessage
-
- org.elasticsearch.transport.TransportRequest
-
- org.elasticsearch.action.ActionRequest
-
- org.elasticsearch.action.support.master.MasterNodeRequest<GetSnapshotsRequest>
-
- org.elasticsearch.action.admin.cluster.snapshots.get.GetSnapshotsRequest
-
- All Implemented Interfaces:
Streamable
,Writeable
,TaskAwareRequest
public class GetSnapshotsRequest extends MasterNodeRequest<GetSnapshotsRequest>
Get snapshot request
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.elasticsearch.transport.TransportRequest
TransportRequest.Empty
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ALL_SNAPSHOTS
static java.lang.String
CURRENT_SNAPSHOT
static boolean
DEFAULT_VERBOSE_MODE
-
Fields inherited from class org.elasticsearch.action.support.master.MasterNodeRequest
DEFAULT_MASTER_NODE_TIMEOUT, masterNodeTimeout
-
-
Constructor Summary
Constructors Constructor Description GetSnapshotsRequest()
GetSnapshotsRequest(java.lang.String repository)
Constructs a new get snapshots request with given repository nameGetSnapshotsRequest(java.lang.String repository, java.lang.String[] snapshots)
Constructs a new get snapshots request with given repository name and list of snapshots
-
Method Summary
Modifier and Type Method Description boolean
ignoreUnavailable()
GetSnapshotsRequest
ignoreUnavailable(boolean ignoreUnavailable)
Set to true to ignore unavailable snapshotsvoid
readFrom(StreamInput in)
Set this object's fields from a StreamInput.java.lang.String
repository()
Returns repository nameGetSnapshotsRequest
repository(java.lang.String repository)
Sets repository namejava.lang.String[]
snapshots()
Returns the names of the snapshots.GetSnapshotsRequest
snapshots(java.lang.String[] snapshots)
Sets the list of snapshots to be returnedActionRequestValidationException
validate()
boolean
verbose()
Returns whether the request will return a verbose response.GetSnapshotsRequest
verbose(boolean verbose)
Set tofalse
to only show the snapshot names and the indices they contain.void
writeTo(StreamOutput out)
Write this object's fields to a 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
remoteAddress, remoteAddress
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.tasks.TaskAwareRequest
createTask, getDescription, setParentTask
-
-
-
-
Field Detail
-
ALL_SNAPSHOTS
public static final java.lang.String ALL_SNAPSHOTS
- See Also:
- Constant Field Values
-
CURRENT_SNAPSHOT
public static final java.lang.String CURRENT_SNAPSHOT
- See Also:
- Constant Field Values
-
DEFAULT_VERBOSE_MODE
public static final boolean DEFAULT_VERBOSE_MODE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GetSnapshotsRequest
public GetSnapshotsRequest()
-
GetSnapshotsRequest
public GetSnapshotsRequest(java.lang.String repository, java.lang.String[] snapshots)
Constructs a new get snapshots request with given repository name and list of snapshots- Parameters:
repository
- repository namesnapshots
- list of snapshots
-
GetSnapshotsRequest
public GetSnapshotsRequest(java.lang.String repository)
Constructs a new get snapshots request with given repository name- Parameters:
repository
- repository name
-
-
Method Detail
-
validate
public ActionRequestValidationException validate()
- Specified by:
validate
in classActionRequest
-
repository
public GetSnapshotsRequest repository(java.lang.String repository)
Sets repository name- Parameters:
repository
- repository name- Returns:
- this request
-
repository
public java.lang.String repository()
Returns repository name- Returns:
- repository name
-
snapshots
public java.lang.String[] snapshots()
Returns the names of the snapshots.- Returns:
- the names of snapshots
-
snapshots
public GetSnapshotsRequest snapshots(java.lang.String[] snapshots)
Sets the list of snapshots to be returned- Returns:
- this request
-
ignoreUnavailable
public GetSnapshotsRequest ignoreUnavailable(boolean ignoreUnavailable)
Set to true to ignore unavailable snapshots- Returns:
- this request
-
ignoreUnavailable
public boolean ignoreUnavailable()
- Returns:
- Whether snapshots should be ignored when unavailable (corrupt or temporarily not fetchable)
-
verbose
public GetSnapshotsRequest verbose(boolean verbose)
Set tofalse
to only show the snapshot names and the indices they contain. This is useful when the snapshots belong to a cloud-based repository where each blob read is a concern (cost wise and performance wise), as the snapshot names and indices they contain can be retrieved from a single index blob in the repository, whereas the rest of the information requires reading a snapshot metadata file for each snapshot requested. Defaults totrue
, which returns all information about each requested snapshot.
-
verbose
public boolean verbose()
Returns whether the request will return a verbose response.
-
readFrom
public void readFrom(StreamInput in) throws java.io.IOException
Description copied from interface:Streamable
Set this object's fields from a StreamInput.- Specified by:
readFrom
in interfaceStreamable
- Overrides:
readFrom
in classMasterNodeRequest<GetSnapshotsRequest>
- Throws:
java.io.IOException
-
writeTo
public void writeTo(StreamOutput out) throws java.io.IOException
Description copied from interface:Streamable
Write this object's fields to a StreamOutput.- Specified by:
writeTo
in interfaceStreamable
- Specified by:
writeTo
in interfaceWriteable
- Overrides:
writeTo
in classMasterNodeRequest<GetSnapshotsRequest>
- Throws:
java.io.IOException
-
-