org.elasticsearch.license.RestGetTrialStatus Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of x-pack-core Show documentation
Show all versions of x-pack-core Show documentation
Elasticsearch Expanded Pack Plugin - Core
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
package org.elasticsearch.license;
import org.elasticsearch.client.internal.node.NodeClient;
import org.elasticsearch.core.RestApiVersion;
import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestRequest;
import org.elasticsearch.rest.RestUtils;
import org.elasticsearch.rest.action.RestToXContentListener;
import java.util.List;
import static org.elasticsearch.rest.RestRequest.Method.GET;
public class RestGetTrialStatus extends BaseRestHandler {
public RestGetTrialStatus() {}
@Override
public List routes() {
return List.of(
Route.builder(GET, "/_license/trial_status").replaces(GET, "/_xpack/license/trial_status", RestApiVersion.V_7).build()
);
}
@Override
protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) {
final var request = new GetTrialStatusRequest(RestUtils.getMasterNodeTimeout(restRequest));
return channel -> client.execute(GetTrialStatusAction.INSTANCE, request, new RestToXContentListener<>(channel));
}
@Override
public String getName() {
return "get_trial_status";
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy