Search in sources :

Example 1 with VerifyRepositoryRequest

use of org.elasticsearch.action.admin.cluster.repositories.verify.VerifyRepositoryRequest in project elasticsearch by elastic.

the class RestVerifyRepositoryAction method prepareRequest.

@Override
public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {
    VerifyRepositoryRequest verifyRepositoryRequest = verifyRepositoryRequest(request.param("repository"));
    verifyRepositoryRequest.masterNodeTimeout(request.paramAsTime("master_timeout", verifyRepositoryRequest.masterNodeTimeout()));
    verifyRepositoryRequest.timeout(request.paramAsTime("timeout", verifyRepositoryRequest.timeout()));
    return channel -> client.admin().cluster().verifyRepository(verifyRepositoryRequest, new RestToXContentListener<>(channel));
}
Also used : BaseRestHandler(org.elasticsearch.rest.BaseRestHandler) POST(org.elasticsearch.rest.RestRequest.Method.POST) VerifyRepositoryRequest(org.elasticsearch.action.admin.cluster.repositories.verify.VerifyRepositoryRequest) Settings(org.elasticsearch.common.settings.Settings) RestToXContentListener(org.elasticsearch.rest.action.RestToXContentListener) RestRequest(org.elasticsearch.rest.RestRequest) NodeClient(org.elasticsearch.client.node.NodeClient) Requests.verifyRepositoryRequest(org.elasticsearch.client.Requests.verifyRepositoryRequest) IOException(java.io.IOException) RestController(org.elasticsearch.rest.RestController) VerifyRepositoryRequest(org.elasticsearch.action.admin.cluster.repositories.verify.VerifyRepositoryRequest)

Aggregations

IOException (java.io.IOException)1 VerifyRepositoryRequest (org.elasticsearch.action.admin.cluster.repositories.verify.VerifyRepositoryRequest)1 Requests.verifyRepositoryRequest (org.elasticsearch.client.Requests.verifyRepositoryRequest)1 NodeClient (org.elasticsearch.client.node.NodeClient)1 Settings (org.elasticsearch.common.settings.Settings)1 BaseRestHandler (org.elasticsearch.rest.BaseRestHandler)1 RestController (org.elasticsearch.rest.RestController)1 RestRequest (org.elasticsearch.rest.RestRequest)1 POST (org.elasticsearch.rest.RestRequest.Method.POST)1 RestToXContentListener (org.elasticsearch.rest.action.RestToXContentListener)1