use of org.elasticsearch.action.admin.cluster.storedscripts.DeleteStoredScriptRequest in project elasticsearch by elastic.
the class RestDeleteSearchTemplateAction method prepareRequest.
@Override
public RestChannelConsumer prepareRequest(RestRequest request, NodeClient client) throws IOException {
String id = request.param("id");
DeleteStoredScriptRequest deleteStoredScriptRequest = new DeleteStoredScriptRequest(id, Script.DEFAULT_TEMPLATE_LANG);
return channel -> client.admin().cluster().deleteStoredScript(deleteStoredScriptRequest, new AcknowledgedRestListener<>(channel));
}
use of org.elasticsearch.action.admin.cluster.storedscripts.DeleteStoredScriptRequest in project elasticsearch by elastic.
the class RestDeleteStoredScriptAction method prepareRequest.
@Override
public RestChannelConsumer prepareRequest(RestRequest request, NodeClient client) throws IOException {
String id = request.param("id");
String lang = request.param("lang");
// name ordering issues in the handlers' paths.
if (id == null) {
id = lang;
lang = null;
}
if (lang != null) {
deprecationLogger.deprecated("specifying lang [" + lang + "] as part of the url path is deprecated");
}
DeleteStoredScriptRequest deleteStoredScriptRequest = new DeleteStoredScriptRequest(id, lang);
return channel -> client.admin().cluster().deleteStoredScript(deleteStoredScriptRequest, new AcknowledgedRestListener<>(channel));
}
Aggregations