Skip to content

Commit a037d76

Browse files
committed
[API] Updates generated code
* cluster.delete_voting_config_exclusions, cluster.post_voting_config_exclusions - adds `master_timeout` parameter: Timeout for submitting request to master * machine_learning.infer_trained_model_deployment is renamed to machine_learning.infer_trained_model * machine_learning.start_trained_model_deployment adds parameters: * number_of_allocations (integer) The number of model allocations on each node where the model is deployed. * threads_per_allocation (integer) The number of threads used by each model allocation during inference. * queue_capacity Controls (integer) how many inference requests are allowed in the queue at a time. * snapshot.get adds parameter: index_names (boolean) Whether to * include the name of each index in the snapshot. Defaults to true.
1 parent d1b510e commit a037d76

File tree

6 files changed

+19
-6
lines changed

6 files changed

+19
-6
lines changed

elasticsearch-api/lib/elasticsearch/api/actions/cluster/delete_voting_config_exclusions.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ module Actions
2222
# Clears cluster voting config exclusions.
2323
#
2424
# @option arguments [Boolean] :wait_for_removal Specifies whether to wait for all excluded nodes to be removed from the cluster before clearing the voting configuration exclusions list.
25+
# @option arguments [Time] :master_timeout Timeout for submitting request to master
2526
# @option arguments [Hash] :headers Custom HTTP headers
2627
#
2728
# @see https://www.elastic.co/guide/en/elasticsearch/reference/master/voting-config-exclusions.html

elasticsearch-api/lib/elasticsearch/api/actions/cluster/post_voting_config_exclusions.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ module Actions
2424
# @option arguments [String] :node_ids A comma-separated list of the persistent ids of the nodes to exclude from the voting configuration. If specified, you may not also specify ?node_names.
2525
# @option arguments [String] :node_names A comma-separated list of the names of the nodes to exclude from the voting configuration. If specified, you may not also specify ?node_ids.
2626
# @option arguments [Time] :timeout Explicit operation timeout
27+
# @option arguments [Time] :master_timeout Timeout for submitting request to master
2728
# @option arguments [Hash] :headers Custom HTTP headers
2829
#
2930
# @see https://www.elastic.co/guide/en/elasticsearch/reference/master/voting-config-exclusions.html
Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,16 @@ module Actions
2828
# @option arguments [String] :model_id The unique identifier of the trained model. (*Required*)
2929
# @option arguments [Time] :timeout Controls the amount of time to wait for inference results.
3030
# @option arguments [Hash] :headers Custom HTTP headers
31-
# @option arguments [Hash] :body The docs to apply inference on (*Required*)
31+
# @option arguments [Hash] :body The docs to apply inference on and inference configuration overrides (*Required*)
3232
#
33-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/master/infer-trained-model-deployment.html
33+
# *Deprecation notice*:
34+
# /_ml/trained_models/{model_id}/deployment/_infer is deprecated. Use /_ml/trained_models/{model_id}/_infer instead
35+
# Deprecated since version 8.3.0
3436
#
35-
def infer_trained_model_deployment(arguments = {})
37+
#
38+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/master/infer-trained-model.html
39+
#
40+
def infer_trained_model(arguments = {})
3641
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
3742
raise ArgumentError, "Required argument 'model_id' missing" unless arguments[:model_id]
3843

@@ -44,7 +49,9 @@ def infer_trained_model_deployment(arguments = {})
4449
_model_id = arguments.delete(:model_id)
4550

4651
method = Elasticsearch::API::HTTP_POST
47-
path = "_ml/trained_models/#{Utils.__listify(_model_id)}/deployment/_infer"
52+
path = if _model_id
53+
"_ml/trained_models/#{Utils.__listify(_model_id)}/deployment/_infer"
54+
end
4855
params = Utils.process_params(arguments)
4956

5057
Elasticsearch::API::Response.new(

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ module Actions
2626
# support SLA of official GA features.
2727
#
2828
# @option arguments [String] :model_id The unique identifier of the trained model. (*Required*)
29+
# @option arguments [Integer] :number_of_allocations The number of model allocations on each node where the model is deployed.
30+
# @option arguments [Integer] :threads_per_allocation The number of threads used by each model allocation during inference.
31+
# @option arguments [Integer] :queue_capacity Controls how many inference requests are allowed in the queue at a time.
2932
# @option arguments [Time] :timeout Controls the amount of time to wait for the model to deploy.
3033
# @option arguments [String] :wait_for The allocation status for which to wait (options: starting, started, fully_allocated)
3134
# @option arguments [Hash] :headers Custom HTTP headers

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ module Actions
2525
# @option arguments [List] :snapshot A comma-separated list of snapshot names
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
28+
# @option arguments [Boolean] :index_names Whether to include the name of each index in the snapshot. Defaults to true.
2829
# @option arguments [Boolean] :index_details Whether to include details of each index in the snapshot, if those details are available. Defaults to false.
2930
# @option arguments [Boolean] :include_repository Whether to include the repository name in the snapshot info. Defaults to true.
3031
# @option arguments [Boolean] :verbose Whether to show verbose snapshot info or only show the basic info found in the repository index blob

elasticsearch-api/spec/elasticsearch/api/actions/machine_learning/infer_trained_model_deployment_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
end
3030

3131
it 'performs the request' do
32-
expect(client_double.ml.infer_trained_model_deployment(model_id: 'foo', body: {})).to be_a Elasticsearch::API::Response
32+
expect(client_double.ml.infer_trained_model(model_id: 'foo', body: {})).to be_a Elasticsearch::API::Response
3333
end
3434

3535
let(:client) do
@@ -39,7 +39,7 @@
3939
context 'when a model_id is not provided' do
4040
it 'raises an exception' do
4141
expect {
42-
client.ml.infer_trained_model_deployment
42+
client.ml.infer_trained_model
4343
}.to raise_exception(ArgumentError)
4444
end
4545
end

0 commit comments

Comments
 (0)