Skip to content

Commit b3af430

Browse files
committed
Updated endpoints changes for ES 8.6
1 parent 70df3b9 commit b3af430

File tree

1 file changed

+39
-1
lines changed

1 file changed

+39
-1
lines changed

src/Endpoints/Ml.php

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2375,6 +2375,7 @@ public function startDatafeed(array $params = [])
23752375
* cache_size: string, // A byte-size value for configuring the inference cache size. For example, 20mb.
23762376
* number_of_allocations: int, // The total number of allocations this model is assigned across machine learning nodes.
23772377
* threads_per_allocation: int, // The number of threads used by each model allocation during inference.
2378+
* priority: string, // The deployment priority.
23782379
* queue_capacity: int, // Controls how many inference requests are allowed in the queue at a time.
23792380
* timeout: time, // Controls the amount of time to wait for the model to deploy.
23802381
* wait_for: string, // The allocation status for which to wait
@@ -2398,7 +2399,7 @@ public function startTrainedModelDeployment(array $params = [])
23982399
$url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/deployment/_start';
23992400
$method = 'POST';
24002401

2401-
$url = $this->addQueryString($url, $params, ['cache_size','number_of_allocations','threads_per_allocation','queue_capacity','timeout','wait_for','pretty','human','error_trace','source','filter_path']);
2402+
$url = $this->addQueryString($url, $params, ['cache_size','number_of_allocations','threads_per_allocation','priority','queue_capacity','timeout','wait_for','pretty','human','error_trace','source','filter_path']);
24022403
$headers = [
24032404
'Accept' => 'application/json',
24042405
'Content-Type' => 'application/json',
@@ -2717,6 +2718,43 @@ public function updateModelSnapshot(array $params = [])
27172718
}
27182719

27192720

2721+
/**
2722+
* Updates certain properties of trained model deployment.
2723+
*
2724+
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-trained-model-deployment.html
2725+
*
2726+
* @param array{
2727+
* model_id: string, // (REQUIRED) The unique identifier of the trained model.
2728+
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
2729+
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
2730+
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
2731+
* source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
2732+
* filter_path: list, // A comma-separated list of filters used to reduce the response.
2733+
* body: array, // (REQUIRED) The updated trained model deployment settings
2734+
* } $params
2735+
*
2736+
* @throws MissingParameterException if a required parameter is missing
2737+
* @throws NoNodeAvailableException if all the hosts are offline
2738+
* @throws ClientResponseException if the status code of response is 4xx
2739+
* @throws ServerResponseException if the status code of response is 5xx
2740+
*
2741+
* @return Elasticsearch|Promise
2742+
*/
2743+
public function updateTrainedModelDeployment(array $params = [])
2744+
{
2745+
$this->checkRequiredParameters(['model_id','body'], $params);
2746+
$url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/deployment/_update';
2747+
$method = 'POST';
2748+
2749+
$url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']);
2750+
$headers = [
2751+
'Accept' => 'application/json',
2752+
'Content-Type' => 'application/json',
2753+
];
2754+
return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
2755+
}
2756+
2757+
27202758
/**
27212759
* Upgrades a given job snapshot to the current major version.
27222760
*

0 commit comments

Comments
 (0)