Skip to content

Commit e6d71f7

Browse files
authored
do not return model and task id in response (#171)
Signed-off-by: Xun Zhang <[email protected]>
1 parent e895405 commit e6d71f7

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

plugin/src/main/java/org/opensearch/ml/action/models/GetModelTransportAction.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ protected void doExecute(Task task, ActionRequest request, ActionListener<MLMode
7171
actionListener.onFailure(e);
7272
}
7373
} else {
74-
actionListener.onFailure(new MLResourceNotFoundException("Fail to find model " + modelId));
74+
actionListener.onFailure(new MLResourceNotFoundException("Fail to find model"));
7575
}
7676
}, e -> {
7777
if (e instanceof IndexNotFoundException) {
78-
actionListener.onFailure(new MLResourceNotFoundException("Fail to find model " + modelId));
78+
actionListener.onFailure(new MLResourceNotFoundException("Fail to find model"));
7979
} else {
8080
log.error("Failed to get ML model " + modelId, e);
8181
actionListener.onFailure(e);

plugin/src/main/java/org/opensearch/ml/action/tasks/GetTaskTransportAction.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ protected void doExecute(Task task, ActionRequest request, ActionListener<MLTask
6868
actionListener.onFailure(e);
6969
}
7070
} else {
71-
actionListener.onFailure(new MLResourceNotFoundException("Fail to find task " + taskId));
71+
actionListener.onFailure(new MLResourceNotFoundException("Fail to find task"));
7272
}
7373
}, e -> {
7474
if (e instanceof IndexNotFoundException) {
75-
actionListener.onFailure(new MLResourceNotFoundException("Fail to find task " + taskId));
75+
actionListener.onFailure(new MLResourceNotFoundException("Fail to find task"));
7676
} else {
7777
log.error("Failed to get ML task " + taskId, e);
7878
actionListener.onFailure(e);

plugin/src/main/java/org/opensearch/ml/action/models/SearchTaskTransportAction.java renamed to plugin/src/main/java/org/opensearch/ml/action/tasks/SearchTaskTransportAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
package org.opensearch.ml.action.models;
6+
package org.opensearch.ml.action.tasks;
77

88
import org.opensearch.action.ActionListener;
99
import org.opensearch.action.search.SearchRequest;

plugin/src/main/java/org/opensearch/ml/plugin/MachineLearningPlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@
3333
import org.opensearch.ml.action.models.DeleteModelTransportAction;
3434
import org.opensearch.ml.action.models.GetModelTransportAction;
3535
import org.opensearch.ml.action.models.SearchModelTransportAction;
36-
import org.opensearch.ml.action.models.SearchTaskTransportAction;
3736
import org.opensearch.ml.action.prediction.TransportPredictionTaskAction;
3837
import org.opensearch.ml.action.stats.MLStatsNodesAction;
3938
import org.opensearch.ml.action.stats.MLStatsNodesTransportAction;
4039
import org.opensearch.ml.action.tasks.DeleteTaskTransportAction;
4140
import org.opensearch.ml.action.tasks.GetTaskTransportAction;
41+
import org.opensearch.ml.action.tasks.SearchTaskTransportAction;
4242
import org.opensearch.ml.action.training.TransportTrainingTaskAction;
4343
import org.opensearch.ml.action.trainpredict.TransportTrainAndPredictionTaskAction;
4444
import org.opensearch.ml.common.breaker.MLCircuitBreakerService;

plugin/src/test/java/org/opensearch/ml/rest/RestMLGetModelActionIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class RestMLGetModelActionIT extends MLCommonsRestTestCase {
2222

2323
public void testGetModelAPI_EmptyResources() throws IOException {
2424
exceptionRule.expect(ResponseException.class);
25-
exceptionRule.expectMessage("Fail to find model 111222333");
25+
exceptionRule.expectMessage("Fail to find model");
2626
TestHelper.makeRequest(client(), "GET", "/_plugins/_ml/models/111222333", null, "", null);
2727
}
2828

0 commit comments

Comments
 (0)