|
26 | 26 | import org.opensearch.OpenSearchStatusException;
|
27 | 27 | import org.opensearch.action.search.SearchPhaseExecutionException;
|
28 | 28 | import org.opensearch.action.search.ShardSearchFailure;
|
29 |
| -import org.opensearch.ad.transport.IndexAnomalyDetectorResponse; |
30 | 29 | import org.opensearch.common.Nullable;
|
31 | 30 | import org.opensearch.common.xcontent.LoggingDeprecationHandler;
|
32 | 31 | import org.opensearch.common.xcontent.XContentHelper;
|
33 | 32 | import org.opensearch.common.xcontent.XContentType;
|
34 | 33 | import org.opensearch.core.action.ActionListener;
|
35 |
| -import org.opensearch.core.action.ActionResponse; |
36 | 34 | import org.opensearch.core.common.Strings;
|
37 | 35 | import org.opensearch.core.common.bytes.BytesReference;
|
38 | 36 | import org.opensearch.core.rest.RestStatus;
|
39 | 37 | import org.opensearch.core.xcontent.NamedXContentRegistry;
|
40 | 38 | import org.opensearch.core.xcontent.ToXContent;
|
41 | 39 | import org.opensearch.core.xcontent.XContentParser;
|
42 |
| -import org.opensearch.forecast.transport.IndexForecasterResponse; |
43 | 40 | import org.opensearch.index.IndexNotFoundException;
|
44 | 41 | import org.opensearch.indices.InvalidIndexNameException;
|
45 | 42 | import org.opensearch.rest.RestChannel;
|
@@ -293,21 +290,4 @@ public static Entity buildEntity(RestRequest request, String detectorId) throws
|
293 | 290 | // not a valid profile request with correct entity information
|
294 | 291 | return null;
|
295 | 292 | }
|
296 |
| - |
297 |
| - public static String getConfigIdFromIndexResponse(ActionResponse actionResponse) { |
298 |
| - String configId; |
299 |
| - if (actionResponse instanceof IndexAnomalyDetectorResponse) { |
300 |
| - IndexAnomalyDetectorResponse response = (IndexAnomalyDetectorResponse) actionResponse; |
301 |
| - configId = response.getId(); |
302 |
| - logger.info("Handling IndexAnomalyDetectorResponse for configId: {}", configId); |
303 |
| - } else if (actionResponse instanceof IndexForecasterResponse) { |
304 |
| - IndexForecasterResponse response = (IndexForecasterResponse) actionResponse; |
305 |
| - configId = response.getId(); |
306 |
| - logger.info("Handling IndexForecasterResponse for configId: {}", configId); |
307 |
| - } else { |
308 |
| - throw new IllegalStateException("Unexpected response type: " + actionResponse.getClass().getName()); |
309 |
| - } |
310 |
| - return configId; |
311 |
| - } |
312 |
| - |
313 | 293 | }
|
0 commit comments