All Implemented Interfaces:
Writeable, RefCounted, TaskAwareRequest, TransportRequest

public class DeleteSnapshotRequest extends MasterNodeRequest<DeleteSnapshotRequest>
Delete snapshot request

Delete snapshot request removes snapshots from the repository and cleans up all files that are associated with the snapshots. All files that are shared with at least one other existing snapshot are left intact.

  • Constructor Details

    • DeleteSnapshotRequest

      public DeleteSnapshotRequest(TimeValue masterNodeTimeout, String repository, String... snapshots)
      Constructs a new delete snapshots request with repository and snapshot names
      Parameters:
      repository - repository name
      snapshots - snapshot names
    • DeleteSnapshotRequest

      public DeleteSnapshotRequest(StreamInput in) throws IOException
      Throws:
      IOException
  • Method Details

    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Description copied from interface: Writeable
      Write this into the StreamOutput.
      Specified by:
      writeTo in interface Writeable
      Overrides:
      writeTo in class MasterNodeRequest<DeleteSnapshotRequest>
      Throws:
      IOException
    • validate

      Specified by:
      validate in class ActionRequest
    • repository

      public DeleteSnapshotRequest repository(String repository)
    • repository

      public String repository()
      Returns repository name
      Returns:
      repository name
    • snapshots

      public String[] snapshots()
      Returns snapshot names
      Returns:
      snapshot names
    • snapshots

      public DeleteSnapshotRequest snapshots(String... snapshots)
      Sets snapshot names
      Returns:
      this request
    • getDescription

      public String getDescription()
      Description copied from interface: TaskAwareRequest
      Returns optional description of the request to be displayed by the task manager
    • waitForCompletion

      public DeleteSnapshotRequest waitForCompletion(boolean waitForCompletion)
      If set to false the operation should return without waiting for the deletion to complete. By default, the operation will wait until all matching snapshots are deleted. It can be changed by setting this flag to false.
      Parameters:
      waitForCompletion - true if operation should wait for the snapshot deletion
      Returns:
      this request
    • waitForCompletion

      public boolean waitForCompletion()
      Returns true if the request should wait for the snapshot delete(s) to complete before returning
      Returns:
      true if the request should wait for completion