Search in sources :

Example 1 with PARAMETER_MODEL_ID

use of org.opensearch.ml.utils.RestActionUtils.PARAMETER_MODEL_ID in project ml-commons by opensearch-project.

the class RestMLDeleteModelAction method prepareRequest.

@Override
protected RestChannelConsumer prepareRequest(RestRequest request, NodeClient client) throws IOException {
    String modelId = request.param(PARAMETER_MODEL_ID);
    MLModelDeleteRequest mlModelDeleteRequest = new MLModelDeleteRequest(modelId);
    return channel -> client.execute(MLModelDeleteAction.INSTANCE, mlModelDeleteRequest, new RestToXContentListener<>(channel));
}
Also used : PARAMETER_MODEL_ID(org.opensearch.ml.utils.RestActionUtils.PARAMETER_MODEL_ID) List(java.util.List) MLModelDeleteAction(org.opensearch.ml.common.transport.model.MLModelDeleteAction) MLModelDeleteRequest(org.opensearch.ml.common.transport.model.MLModelDeleteRequest) NodeClient(org.opensearch.client.node.NodeClient) RestToXContentListener(org.opensearch.rest.action.RestToXContentListener) ImmutableList(com.google.common.collect.ImmutableList) Locale(java.util.Locale) RestRequest(org.opensearch.rest.RestRequest) IOException(java.io.IOException) BaseRestHandler(org.opensearch.rest.BaseRestHandler) ML_BASE_URI(org.opensearch.ml.plugin.MachineLearningPlugin.ML_BASE_URI) MLModelDeleteRequest(org.opensearch.ml.common.transport.model.MLModelDeleteRequest)

Aggregations

ImmutableList (com.google.common.collect.ImmutableList)1 IOException (java.io.IOException)1 List (java.util.List)1 Locale (java.util.Locale)1 NodeClient (org.opensearch.client.node.NodeClient)1 MLModelDeleteAction (org.opensearch.ml.common.transport.model.MLModelDeleteAction)1 MLModelDeleteRequest (org.opensearch.ml.common.transport.model.MLModelDeleteRequest)1 ML_BASE_URI (org.opensearch.ml.plugin.MachineLearningPlugin.ML_BASE_URI)1 PARAMETER_MODEL_ID (org.opensearch.ml.utils.RestActionUtils.PARAMETER_MODEL_ID)1 BaseRestHandler (org.opensearch.rest.BaseRestHandler)1 RestRequest (org.opensearch.rest.RestRequest)1 RestToXContentListener (org.opensearch.rest.action.RestToXContentListener)1