Skip to content

Commit e924a62

Browse files
committed
[XPACK] ml.forecast and ml.open_job now accept body as parameter
1 parent f786483 commit e924a62

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

elasticsearch-xpack/lib/elasticsearch/xpack/api/actions/machine_learning/forecast.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ module Actions
2727
# @option arguments [Time] :expires_in The time interval after which the forecast expires. Expired forecasts will be deleted at the first opportunity.
2828
# @option arguments [String] :max_model_memory The max memory able to be used by the forecast. Default is 20mb.
2929
# @option arguments [Hash] :headers Custom HTTP headers
30+
# @option arguments [Hash] :body Query parameters can be specified in the body
3031
#
3132
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.16/ml-forecast.html
3233
#
@@ -43,7 +44,7 @@ def forecast(arguments = {})
4344
path = "_ml/anomaly_detectors/#{Elasticsearch::API::Utils.__listify(_job_id)}/_forecast"
4445
params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
4546

46-
body = nil
47+
body = arguments[:body]
4748
perform_request(method, path, params, body, headers).body
4849
end
4950

elasticsearch-xpack/lib/elasticsearch/xpack/api/actions/machine_learning/open_job.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ module Actions
2424
#
2525
# @option arguments [String] :job_id The ID of the job to open
2626
# @option arguments [Hash] :headers Custom HTTP headers
27+
# @option arguments [Hash] :body Query parameters can be specified in the body
2728
#
2829
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.16/ml-open-job.html
2930
#
@@ -40,7 +41,7 @@ def open_job(arguments = {})
4041
path = "_ml/anomaly_detectors/#{Elasticsearch::API::Utils.__listify(_job_id)}/_open"
4142
params = {}
4243

43-
body = nil
44+
body = arguments[:body]
4445
perform_request(method, path, params, body, headers).body
4546
end
4647
end

0 commit comments

Comments
 (0)