Skip to content

Commit 1f11498

Browse files
committed
[API] Updates API parameters
1 parent bb26b49 commit 1f11498

File tree

5 files changed

+37
-5
lines changed

5 files changed

+37
-5
lines changed

elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/infer_trained_model_deployment.rb

+9-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ module Actions
2626
# support SLA of official GA features.
2727
#
2828
# @option arguments [String] :model_id The ID of the model to perform inference on
29+
# @option arguments [Time] :timeout Controls the time to wait for the inference result
2930
# @option arguments [Hash] :headers Custom HTTP headers
3031
#
3132
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-infer-trained-model-deployment.html
@@ -41,11 +42,18 @@ def infer_trained_model_deployment(arguments = {})
4142

4243
method = Elasticsearch::API::HTTP_POST
4344
path = "_ml/trained_models/#{Utils.__listify(_model_id)}/deployment/_infer"
44-
params = {}
45+
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
4546

4647
body = nil
4748
perform_request(method, path, params, body, headers).body
4849
end
50+
51+
# Register this action with its valid params when the module is loaded.
52+
#
53+
# @since 6.2.0
54+
ParamsRegistry.register(:infer_trained_model_deployment, [
55+
:timeout
56+
].freeze)
4957
end
5058
end
5159
end

elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/put_job.rb

+15-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ module Actions
2222
# Instantiates an anomaly detection job.
2323
#
2424
# @option arguments [String] :job_id The ID of the job to create
25+
# @option arguments [Boolean] :ignore_unavailable Ignore unavailable indexes (default: false). Only set if datafeed_config is provided.
26+
# @option arguments [Boolean] :allow_no_indices Ignore if the source indices expressions resolves to no concrete indices (default: true). Only set if datafeed_config is provided.
27+
# @option arguments [Boolean] :ignore_throttled Ignore indices that are marked as throttled (default: true). Only set if datafeed_config is provided.
28+
# @option arguments [String] :expand_wildcards Whether source index expressions should get expanded to open or closed indices (default: open). Only set if datafeed_config is provided. (options: open, closed, hidden, none, all)
2529
# @option arguments [Hash] :headers Custom HTTP headers
2630
# @option arguments [Hash] :body The job (*Required*)
2731
#
@@ -39,11 +43,21 @@ def put_job(arguments = {})
3943

4044
method = Elasticsearch::API::HTTP_PUT
4145
path = "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}"
42-
params = {}
46+
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
4347

4448
body = arguments[:body]
4549
perform_request(method, path, params, body, headers).body
4650
end
51+
52+
# Register this action with its valid params when the module is loaded.
53+
#
54+
# @since 6.2.0
55+
ParamsRegistry.register(:put_job, [
56+
:ignore_unavailable,
57+
:allow_no_indices,
58+
:ignore_throttled,
59+
:expand_wildcards
60+
].freeze)
4761
end
4862
end
4963
end

elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/start_trained_model_deployment.rb

+9-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ module Actions
2626
# support SLA of official GA features.
2727
#
2828
# @option arguments [String] :model_id The ID of the model to deploy
29+
# @option arguments [Time] :timeout Controls the time to wait until the model is deployed
2930
# @option arguments [Hash] :headers Custom HTTP headers
3031
#
3132
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-start-trained-model-deployment.html
@@ -41,11 +42,18 @@ def start_trained_model_deployment(arguments = {})
4142

4243
method = Elasticsearch::API::HTTP_POST
4344
path = "_ml/trained_models/#{Utils.__listify(_model_id)}/deployment/_start"
44-
params = {}
45+
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
4546

4647
body = nil
4748
perform_request(method, path, params, body, headers).body
4849
end
50+
51+
# Register this action with its valid params when the module is loaded.
52+
#
53+
# @since 6.2.0
54+
ParamsRegistry.register(:start_trained_model_deployment, [
55+
:timeout
56+
].freeze)
4957
end
5058
end
5159
end

elasticsearch-api/lib/elasticsearch/api/actions/security/get_user_privileges.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ module Elasticsearch
1919
module API
2020
module Security
2121
module Actions
22-
# Retrieves application privileges.
22+
# Retrieves security privileges for the logged in user.
2323
#
2424
# @option arguments [Hash] :headers Custom HTTP headers
2525
#
26-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-privileges.html
26+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user-privileges.html
2727
#
2828
def get_user_privileges(arguments = {})
2929
headers = arguments.delete(:headers) || {}

elasticsearch-api/lib/elasticsearch/api/actions/snapshot/get.rb

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ module Actions
2626
# @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
2727
# @option arguments [Boolean] :ignore_unavailable Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown
2828
# @option arguments [Boolean] :index_details Whether to include details of each index in the snapshot, if those details are available. Defaults to false.
29+
# @option arguments [Boolean] :include_repository Whether to include the repository name in the snapshot info. Defaults to true.
2930
# @option arguments [Boolean] :verbose Whether to show verbose snapshot info or only show the basic info found in the repository index blob
3031
# @option arguments [Hash] :headers Custom HTTP headers
3132
#
@@ -62,6 +63,7 @@ def get(arguments = {})
6263
:master_timeout,
6364
:ignore_unavailable,
6465
:index_details,
66+
:include_repository,
6567
:verbose
6668
].freeze)
6769
end

0 commit comments

Comments
 (0)