Skip to content

Commit c132519

Browse files
committed
Updated endpoints to 8.16.0
1 parent 7440931 commit c132519

File tree

8 files changed

+232
-18
lines changed

8 files changed

+232
-18
lines changed

src/Client.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
final class Client implements ClientInterface
2929
{
3030
const CLIENT_NAME = 'es';
31-
const VERSION = '8.15.0';
31+
const VERSION = '8.16.0';
3232
const API_COMPATIBILITY_HEADER = '%s/vnd.elasticsearch+%s; compatible-with=8';
3333

3434
const SEARCH_ENDPOINTS = [

src/Endpoints/Cluster.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ public function state(array $params = [])
639639
*
640640
* @param array{
641641
* node_id: list, // A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes
642-
* flat_settings: boolean, // Return settings in flat format (default: false)
642+
* include_remotes: boolean, // Include remote cluster data into the response (default: false)
643643
* timeout: time, // Explicit operation timeout
644644
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
645645
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
@@ -663,7 +663,7 @@ public function stats(array $params = [])
663663
$url = '/_cluster/stats';
664664
$method = 'GET';
665665
}
666-
$url = $this->addQueryString($url, $params, ['flat_settings','timeout','pretty','human','error_trace','source','filter_path']);
666+
$url = $this->addQueryString($url, $params, ['include_remotes','timeout','pretty','human','error_trace','source','filter_path']);
667667
$headers = [
668668
'Accept' => 'application/json',
669669
];

src/Endpoints/Indices.php

+18-11
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,8 @@ public function create(array $params = [])
293293
*
294294
* @param array{
295295
* name: string, // (REQUIRED) The name of the data stream
296+
* timeout: time, // Specify timeout for acknowledging the cluster state update
297+
* master_timeout: time, // Specify timeout for connection to master
296298
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
297299
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
298300
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
@@ -313,7 +315,7 @@ public function createDataStream(array $params = [])
313315
$url = '/_data_stream/' . $this->encode($params['name']);
314316
$method = 'PUT';
315317

316-
$url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']);
318+
$url = $this->addQueryString($url, $params, ['timeout','master_timeout','pretty','human','error_trace','source','filter_path']);
317319
$headers = [
318320
'Accept' => 'application/json',
319321
];
@@ -448,7 +450,6 @@ public function deleteAlias(array $params = [])
448450
* Deletes the data stream lifecycle of the selected data streams.
449451
*
450452
* @see https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams-delete-lifecycle.html
451-
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
452453
*
453454
* @param array{
454455
* name: list, // (REQUIRED) A comma-separated list of data streams of which the data stream lifecycle will be deleted; use `*` to get all data streams
@@ -493,6 +494,7 @@ public function deleteDataLifecycle(array $params = [])
493494
* @param array{
494495
* name: list, // (REQUIRED) A comma-separated list of data streams to delete; use `*` to delete all data streams
495496
* expand_wildcards: enum, // Whether wildcard expressions should get expanded to open or closed indices (default: open)
497+
* master_timeout: time, // Specify timeout for connection to master
496498
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
497499
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
498500
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
@@ -513,7 +515,7 @@ public function deleteDataStream(array $params = [])
513515
$url = '/_data_stream/' . $this->encode($params['name']);
514516
$method = 'DELETE';
515517

516-
$url = $this->addQueryString($url, $params, ['expand_wildcards','pretty','human','error_trace','source','filter_path']);
518+
$url = $this->addQueryString($url, $params, ['expand_wildcards','master_timeout','pretty','human','error_trace','source','filter_path']);
517519
$headers = [
518520
'Accept' => 'application/json',
519521
];
@@ -858,7 +860,6 @@ public function existsTemplate(array $params = [])
858860
* Retrieves information about the index's current data stream lifecycle, such as any potential encountered error, time since creation etc.
859861
*
860862
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/data-streams-explain-lifecycle.html
861-
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
862863
*
863864
* @param array{
864865
* index: string, // (REQUIRED) The name of the index to explain
@@ -1125,12 +1126,12 @@ public function getAlias(array $params = [])
11251126
* Returns the data stream lifecycle of the selected data streams.
11261127
*
11271128
* @see https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams-get-lifecycle.html
1128-
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
11291129
*
11301130
* @param array{
11311131
* name: list, // (REQUIRED) A comma-separated list of data streams to get; use `*` to get all data streams
11321132
* expand_wildcards: enum, // Whether wildcard expressions should get expanded to open or closed indices (default: open)
11331133
* include_defaults: boolean, // Return all relevant default configurations for the data stream (default: false)
1134+
* master_timeout: time, // Specify timeout for connection to master
11341135
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
11351136
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
11361137
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
@@ -1151,7 +1152,7 @@ public function getDataLifecycle(array $params = [])
11511152
$url = '/_data_stream/' . $this->encode($params['name']) . '/_lifecycle';
11521153
$method = 'GET';
11531154

1154-
$url = $this->addQueryString($url, $params, ['expand_wildcards','include_defaults','pretty','human','error_trace','source','filter_path']);
1155+
$url = $this->addQueryString($url, $params, ['expand_wildcards','include_defaults','master_timeout','pretty','human','error_trace','source','filter_path']);
11551156
$headers = [
11561157
'Accept' => 'application/json',
11571158
];
@@ -1170,6 +1171,8 @@ public function getDataLifecycle(array $params = [])
11701171
* name: list, // A comma-separated list of data streams to get; use `*` to get all data streams
11711172
* expand_wildcards: enum, // Whether wildcard expressions should get expanded to open or closed indices (default: open)
11721173
* include_defaults: boolean, // Return all relevant default configurations for the data stream (default: false)
1174+
* master_timeout: time, // Specify timeout for connection to master
1175+
* verbose: boolean, // Whether the maximum timestamp for each data stream should be calculated and returned (default: false)
11731176
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
11741177
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
11751178
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
@@ -1192,7 +1195,7 @@ public function getDataStream(array $params = [])
11921195
$url = '/_data_stream';
11931196
$method = 'GET';
11941197
}
1195-
$url = $this->addQueryString($url, $params, ['expand_wildcards','include_defaults','pretty','human','error_trace','source','filter_path']);
1198+
$url = $this->addQueryString($url, $params, ['expand_wildcards','include_defaults','master_timeout','verbose','pretty','human','error_trace','source','filter_path']);
11961199
$headers = [
11971200
'Accept' => 'application/json',
11981201
];
@@ -1438,6 +1441,8 @@ public function getTemplate(array $params = [])
14381441
*
14391442
* @param array{
14401443
* name: string, // (REQUIRED) The name of the alias to migrate
1444+
* timeout: time, // Specify timeout for acknowledging the cluster state update
1445+
* master_timeout: time, // Specify timeout for connection to master
14411446
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
14421447
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
14431448
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
@@ -1458,7 +1463,7 @@ public function migrateToDataStream(array $params = [])
14581463
$url = '/_data_stream/_migrate/' . $this->encode($params['name']);
14591464
$method = 'POST';
14601465

1461-
$url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']);
1466+
$url = $this->addQueryString($url, $params, ['timeout','master_timeout','pretty','human','error_trace','source','filter_path']);
14621467
$headers = [
14631468
'Accept' => 'application/json',
14641469
];
@@ -1555,6 +1560,7 @@ public function open(array $params = [])
15551560
*
15561561
* @param array{
15571562
* name: string, // (REQUIRED) The name of the data stream
1563+
* master_timeout: time, // Specify timeout for connection to master
15581564
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
15591565
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
15601566
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
@@ -1575,7 +1581,7 @@ public function promoteDataStream(array $params = [])
15751581
$url = '/_data_stream/_promote/' . $this->encode($params['name']);
15761582
$method = 'POST';
15771583

1578-
$url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']);
1584+
$url = $this->addQueryString($url, $params, ['master_timeout','pretty','human','error_trace','source','filter_path']);
15791585
$headers = [
15801586
'Accept' => 'application/json',
15811587
];
@@ -1631,7 +1637,6 @@ public function putAlias(array $params = [])
16311637
* Updates the data stream lifecycle of the selected data streams.
16321638
*
16331639
* @see https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams-put-lifecycle.html
1634-
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
16351640
*
16361641
* @param array{
16371642
* name: list, // (REQUIRED) A comma-separated list of data streams whose lifecycle will be updated; use `*` to set the lifecycle to all data streams
@@ -2021,6 +2026,8 @@ public function resolveCluster(array $params = [])
20212026
* @param array{
20222027
* name: list, // (REQUIRED) A comma-separated list of names or wildcard expressions
20232028
* expand_wildcards: enum, // Whether wildcard expressions should get expanded to open or closed indices (default: open)
2029+
* ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed)
2030+
* allow_no_indices: boolean, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
20242031
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
20252032
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
20262033
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
@@ -2041,7 +2048,7 @@ public function resolveIndex(array $params = [])
20412048
$url = '/_resolve/index/' . $this->encode($params['name']);
20422049
$method = 'GET';
20432050

2044-
$url = $this->addQueryString($url, $params, ['expand_wildcards','pretty','human','error_trace','source','filter_path']);
2051+
$url = $this->addQueryString($url, $params, ['expand_wildcards','ignore_unavailable','allow_no_indices','pretty','human','error_trace','source','filter_path']);
20452052
$headers = [
20462053
'Accept' => 'application/json',
20472054
];

src/Endpoints/Inference.php

+45
Original file line numberDiff line numberDiff line change
@@ -205,4 +205,49 @@ public function put(array $params = [])
205205
$request = $this->addOtelAttributes($params, ['inference_id', 'task_type'], $request, 'inference.put');
206206
return $this->client->sendRequest($request);
207207
}
208+
209+
210+
/**
211+
* Perform streaming inference
212+
*
213+
* @see https://www.elastic.co/guide/en/elasticsearch/reference/master/post-stream-inference-api.html
214+
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
215+
*
216+
* @param array{
217+
* inference_id: string, // (REQUIRED) The inference Id
218+
* task_type: string, // The task type
219+
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
220+
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
221+
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
222+
* source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
223+
* filter_path: list, // A comma-separated list of filters used to reduce the response.
224+
* body: array, // The inference payload
225+
* } $params
226+
*
227+
* @throws MissingParameterException if a required parameter is missing
228+
* @throws NoNodeAvailableException if all the hosts are offline
229+
* @throws ClientResponseException if the status code of response is 4xx
230+
* @throws ServerResponseException if the status code of response is 5xx
231+
*
232+
* @return Elasticsearch|Promise
233+
*/
234+
public function streamInference(array $params = [])
235+
{
236+
$this->checkRequiredParameters(['inference_id'], $params);
237+
if (isset($params['task_type'])) {
238+
$url = '/_inference/' . $this->encode($params['task_type']) . '/' . $this->encode($params['inference_id']) . '/_stream';
239+
$method = 'POST';
240+
} else {
241+
$url = '/_inference/' . $this->encode($params['inference_id']) . '/_stream';
242+
$method = 'POST';
243+
}
244+
$url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']);
245+
$headers = [
246+
'Accept' => 'text/event-stream',
247+
'Content-Type' => 'application/json',
248+
];
249+
$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
250+
$request = $this->addOtelAttributes($params, ['inference_id', 'task_type'], $request, 'inference.stream_inference');
251+
return $this->client->sendRequest($request);
252+
}
208253
}

0 commit comments

Comments
 (0)