|
| 1 | +# Licensed to Elasticsearch B.V. under one or more contributor |
| 2 | +# license agreements. See the NOTICE file distributed with |
| 3 | +# this work for additional information regarding copyright |
| 4 | +# ownership. Elasticsearch B.V. licenses this file to you under |
| 5 | +# the Apache License, Version 2.0 (the "License"); you may |
| 6 | +# not use this file except in compliance with the License. |
| 7 | +# You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, |
| 12 | +# software distributed under the License is distributed on an |
| 13 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +# KIND, either express or implied. See the License for the |
| 15 | +# specific language governing permissions and limitations |
| 16 | +# under the License. |
| 17 | +# |
| 18 | +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 |
| 19 | +# @see https://github.com/elastic/elasticsearch-specification |
| 20 | +# |
| 21 | +module ElasticsearchServerless |
| 22 | + module API |
| 23 | + module MachineLearning |
| 24 | + module Actions |
| 25 | + # Starts a trained model deployment, which allocates the model to every machine learning node. |
| 26 | + # @option arguments [String] :model_id The unique identifier of the trained model. Currently, only PyTorch models are supported. (*Required*) |
| 27 | + # @option arguments [Integer] :number_of_allocations The number of model allocations on each node where the model is deployed. All allocations on a node share the same copy of the model in memory but use a separate set of threads to evaluate the model. Increasing this value generally increases the throughput. If this setting is greater than the number of hardware threads it will automatically be changed to a value less than the number of hardware threads. Server default: 1. |
| 28 | + # @option arguments [Hash] :headers Custom HTTP headers |
| 29 | + # @option arguments [Hash] :body request body |
| 30 | + # |
| 31 | + # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-trained-model-deployment.html |
| 32 | + # |
| 33 | + def update_trained_model_deployment(arguments = {}) |
| 34 | + raise ArgumentError, "Required argument 'model_id' missing" unless arguments[:model_id] |
| 35 | + |
| 36 | + arguments = arguments.clone |
| 37 | + headers = arguments.delete(:headers) || {} |
| 38 | + |
| 39 | + body = arguments.delete(:body) |
| 40 | + |
| 41 | + _model_id = arguments.delete(:model_id) |
| 42 | + |
| 43 | + method = ElasticsearchServerless::API::HTTP_POST |
| 44 | + path = "_ml/trained_models/#{Utils.listify(_model_id)}/deployment/_update" |
| 45 | + params = Utils.process_params(arguments) |
| 46 | + |
| 47 | + ElasticsearchServerless::API::Response.new( |
| 48 | + perform_request(method, path, params, body, headers) |
| 49 | + ) |
| 50 | + end |
| 51 | + end |
| 52 | + end |
| 53 | + end |
| 54 | +end |
0 commit comments