-
Notifications
You must be signed in to change notification settings - Fork 25.5k
Description
The documentation (https://www.elastic.co/guide/en/elasticsearch/reference/6.5/ml-delete-forecast.html) indicates that <forecast_id>
is optional, and the REST JSON specification indicates this too (
elasticsearch/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.delete_forecast.json
Line 19 in 9e8cfbb
"required": false, |
The issue is, however, is that the RestDeleteForecastAction
registration only registers URLs that contain the <forecastid>
parameter (
Line 24 in fc76bcb
public RestDeleteForecastAction(Settings settings, RestController controller) { |
The .NET client, when calling a URL without the <forecastid>
defaults to a DELETE
verb on _xpack/ml/anomaly_detectors/<job_id>/_forecast
. The server then responds with a 405
error and that the endpoint accepts a POST
- at this point the server likely assumes this request was intended to post a record - albeit an incorrect assumption.
In the meantime I have patched the REST JSON spec locally to make <forecastid>
a required field and everything then works as expected: https://github.com/elastic/elasticsearch-net/blob/4aa8ad121cd4830afe98f1dbcdcc3790fd2e291d/src/CodeGeneration/ApiGenerator/RestSpecification/XPack/MachineLearning/xpack.ml.delete_forecast.patch.json
Can a fix be considered along the lines of:
- Register correct REST endpoint url for
DELETE
action.
or - Make
<forecastid>
required.