Skip to content

Commit 0366049

Browse files
committed
[API] Adds defer_definition_decompression to ml.put_trained_model
1 parent bd84d15 commit 0366049

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ module Actions
2323
# Creates an inference trained model.
2424
#
2525
# @option arguments [String] :model_id The ID of the trained models to store
26+
# @option arguments [Boolean] :defer_definition_decompression If set to `true` and a `compressed_definition` is provided, the request defers definition decompression and skips relevant validations.
2627
# @option arguments [Hash] :headers Custom HTTP headers
2728
# @option arguments [Hash] :body The trained model configuration (*Required*)
2829
#
@@ -40,11 +41,19 @@ def put_trained_model(arguments = {})
4041

4142
method = Elasticsearch::API::HTTP_PUT
4243
path = "_ml/trained_models/#{Elasticsearch::API::Utils.__listify(_model_id)}"
43-
params = {}
44+
params = Elasticsearch::API::Utils.__validate_and_extract_params arguments,
45+
ParamsRegistry.get(__method__)
4446

4547
body = arguments[:body]
4648
perform_request(method, path, params, body, headers).body
4749
end
50+
51+
# Register this action with its valid params when the module is loaded.
52+
#
53+
# @since 6.2.0
54+
ParamsRegistry.register(:put_trained_model, [
55+
:defer_definition_decompression
56+
].freeze)
4857
end
4958
end
5059
end

0 commit comments

Comments
 (0)