/** * Constructs delete snapshot request builder with specified repository and snapshot names */ public DeleteSnapshotRequestBuilder(ElasticsearchClient client, DeleteSnapshotAction action, String repository, String snapshot) { super(client, action, new DeleteSnapshotRequest(repository, snapshot)); }
/** * Sets the snapshot name * * @param snapshot snapshot name * @return this builder */ public DeleteSnapshotRequestBuilder setSnapshot(String snapshot) { request.snapshot(snapshot); return this; } }
@Override public DeleteSnapshotRequestBuilder newRequestBuilder(ElasticsearchClient client) { return new DeleteSnapshotRequestBuilder(client, this); } }
@Override protected void masterOperation(final DeleteSnapshotRequest request, ClusterState state, final ActionListener<AcknowledgedResponse> listener) { snapshotsService.deleteSnapshot(request.repository(), request.snapshot(), new SnapshotsService.DeleteSnapshotListener() { @Override public void onResponse() { listener.onResponse(new AcknowledgedResponse(true)); } @Override public void onFailure(Exception e) { listener.onFailure(e); } }, false); } }
/** * Sets the repository name * * @param repository repository name * @return this builder */ public DeleteSnapshotRequestBuilder setRepository(String repository) { request.repository(repository); return this; }
@Override public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { DeleteSnapshotRequest deleteSnapshotRequest = deleteSnapshotRequest(request.param("repository"), request.param("snapshot")); deleteSnapshotRequest.masterNodeTimeout(request.paramAsTime("master_timeout", deleteSnapshotRequest.masterNodeTimeout())); return channel -> client.admin().cluster().deleteSnapshot(deleteSnapshotRequest, new RestToXContentListener<>(channel)); } }
/** * Sets the repository name * * @param repository repository name * @return this builder */ public DeleteSnapshotRequestBuilder setRepository(String repository) { request.repository(repository); return this; }
/** * Constructs delete snapshot request builder */ public DeleteSnapshotRequestBuilder(ElasticsearchClient client, DeleteSnapshotAction action) { super(client, action, new DeleteSnapshotRequest()); }
/** * Sets the snapshot name * * @param snapshot snapshot name * @return this builder */ public DeleteSnapshotRequestBuilder setSnapshot(String snapshot) { request.snapshot(snapshot); return this; } }
@Override public DeleteSnapshotRequestBuilder prepareDeleteSnapshot(String repository, String name) { return new DeleteSnapshotRequestBuilder(this, DeleteSnapshotAction.INSTANCE, repository, name); }
/** * Sets the repository name * * @param repository repository name * @return this builder */ public DeleteSnapshotRequestBuilder setRepository(String repository) { request.repository(repository); return this; }
/** * Deletes a snapshot * * @param snapshot snapshot name * @param repository repository name * @return delete snapshot request */ public static DeleteSnapshotRequest deleteSnapshotRequest(String repository, String snapshot) { return new DeleteSnapshotRequest(repository, snapshot); }
/** * Sets the snapshot name * * @param snapshot snapshot name * @return this builder */ public DeleteSnapshotRequestBuilder setSnapshot(String snapshot) { request.snapshot(snapshot); return this; } }
@Override public DeleteSnapshotRequestBuilder newRequestBuilder(ElasticsearchClient client) { return new DeleteSnapshotRequestBuilder(client, this); } }
/** * Sets the repository name * * @param repository repository name * @return this builder */ public DeleteSnapshotRequestBuilder setRepository(String repository) { request.repository(repository); return this; }
/** * Constructs delete snapshot request builder */ public DeleteSnapshotRequestBuilder(ElasticsearchClient client, DeleteSnapshotAction action) { super(client, action, new DeleteSnapshotRequest()); }
@Override public DeleteSnapshotRequestBuilder newRequestBuilder(ElasticsearchClient client) { return new DeleteSnapshotRequestBuilder(client, this); } }
/** * Constructs delete snapshot request builder with specified repository and snapshot names */ public DeleteSnapshotRequestBuilder(ElasticsearchClient client, DeleteSnapshotAction action, String repository, String snapshot) { super(client, action, new DeleteSnapshotRequest(repository, snapshot)); }
/** * Deletes a snapshot * * @param snapshot snapshot name * @param repository repository name * @return delete snapshot request */ public static DeleteSnapshotRequest deleteSnapshotRequest(String repository, String snapshot) { return new DeleteSnapshotRequest(repository, snapshot); }
/** * Deletes a snapshot * * @param snapshot snapshot name * @param repository repository name * @return delete snapshot request */ public static DeleteSnapshotRequest deleteSnapshotRequest(String repository, String snapshot) { return new DeleteSnapshotRequest(repository, snapshot); }