Class GetSnapshotsRequest
java.lang.Object
org.opensearch.transport.TransportMessage
org.opensearch.transport.TransportRequest
org.opensearch.action.ActionRequest
org.opensearch.action.support.master.MasterNodeRequest<GetSnapshotsRequest>
org.opensearch.action.admin.cluster.snapshots.get.GetSnapshotsRequest
- All Implemented Interfaces:
Writeable
,TaskAwareRequest
public class GetSnapshotsRequest extends MasterNodeRequest<GetSnapshotsRequest>
Get snapshot request
-
Nested Class Summary
Nested classes/interfaces inherited from class org.opensearch.transport.TransportRequest
TransportRequest.Empty
Nested classes/interfaces inherited from interface org.opensearch.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.opensearch.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 snapshotsGetSnapshotsRequest(StreamInput in)
-
Method Summary
Modifier and Type Method Description boolean
ignoreUnavailable()
GetSnapshotsRequest
ignoreUnavailable(boolean ignoreUnavailable)
Set to true to ignore unavailable snapshotsjava.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 into the StreamOutput.Methods inherited from class org.opensearch.action.support.master.MasterNodeRequest
masterNodeTimeout, masterNodeTimeout, masterNodeTimeout
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.opensearch.tasks.TaskAwareRequest
createTask, getDescription, setParentTask
-
Field Details
-
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 Details
-
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
-
GetSnapshotsRequest
- Throws:
java.io.IOException
-
-
Method Details
-
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput.- Specified by:
writeTo
in interfaceWriteable
- Overrides:
writeTo
in classMasterNodeRequest<GetSnapshotsRequest>
- Throws:
java.io.IOException
-
validate
- Specified by:
validate
in classActionRequest
-
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
Sets the list of snapshots to be returned- Returns:
- this request
-
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
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.
-