Skip to content

Commit 58abf1a

Browse files
committed
Updated endpoints to 9.1.0 release
1 parent 95c0f0c commit 58abf1a

File tree

14 files changed

+753
-23
lines changed

14 files changed

+753
-23
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## Release 9.1.0
2+
3+
- Updated the APIs to Elasticsearch [9.1.0](https://www.elastic.co/docs/release-notes/elasticsearch#elasticsearch-9.1.0-release-notes)
4+
15
## Release 9.0.0
26

37
- **Use of PHP 8.1+:** Starting from 9.0.0 the `elasticsearch-php` client requires PHP 8.1+.

src/Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
final class Client implements ClientInterface
3030
{
3131
const CLIENT_NAME = 'es';
32-
const VERSION = '9.0.0';
32+
const VERSION = '9.1.0';
3333
const API_COMPATIBILITY_HEADER = '%s/vnd.elasticsearch+%s; compatible-with=9';
3434
const API_VERSION_HEADER = 'elastic-api-version';
3535
const API_VERSION = '2023-10-31';

src/Endpoints/Cluster.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,8 @@ public function existsComponentTemplate(?array $params = null)
198198
* master_timeout?: int|string, // Timeout for waiting for new cluster state in case it is blocked
199199
* local?: bool, // Return local information, do not retrieve the state from master node (default: false)
200200
* include_defaults?: bool, // Return all default configurations for the component template (default: false)
201+
* flat_settings?: bool, // Return settings in flat format (default: false)
202+
* settings_filter?: string, // Filter out results, for example to filter out sensitive information. Supports wildcards or full settings keys
201203
* pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false)
202204
* human?: bool, // Return human readable values for statistics. (DEFAULT: true)
203205
* error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false)
@@ -221,7 +223,7 @@ public function getComponentTemplate(?array $params = null)
221223
$url = '/_component_template';
222224
$method = 'GET';
223225
}
224-
$url = $this->addQueryString($url, $params, ['master_timeout','local','include_defaults','pretty','human','error_trace','source','filter_path']);
226+
$url = $this->addQueryString($url, $params, ['master_timeout','local','include_defaults','flat_settings','settings_filter','pretty','human','error_trace','source','filter_path']);
225227
$headers = [
226228
'Accept' => 'application/json',
227229
];
@@ -446,7 +448,7 @@ public function postVotingConfigExclusions(?array $params = null)
446448
* @param array{
447449
* name: string, // (REQUIRED) The name of the template
448450
* create?: bool, // Whether the index template should only be added if new or can also replace an existing one
449-
* timeout?: int|string, // Explicit operation timeout
451+
* cause?: string, // User defined reason for create the component template
450452
* master_timeout?: int|string, // Specify timeout for connection to master
451453
* pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false)
452454
* human?: bool, // Return human readable values for statistics. (DEFAULT: true)
@@ -470,7 +472,7 @@ public function putComponentTemplate(?array $params = null)
470472
$url = '/_component_template/' . $this->encode($params['name']);
471473
$method = 'PUT';
472474

473-
$url = $this->addQueryString($url, $params, ['create','timeout','master_timeout','pretty','human','error_trace','source','filter_path']);
475+
$url = $this->addQueryString($url, $params, ['create','cause','master_timeout','pretty','human','error_trace','source','filter_path']);
474476
$headers = [
475477
'Accept' => 'application/json',
476478
'Content-Type' => 'application/json',

src/Endpoints/Enrich.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ public function putPolicy(?array $params = null)
199199
* @link https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-stats-api.html
200200
*
201201
* @param array{
202-
* master_timeout?: int|string, // Timeout for processing on master node
202+
* master_timeout?: int|string, // Timeout for waiting for new cluster state in case it is blocked
203203
* pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false)
204204
* human?: bool, // Return human readable values for statistics. (DEFAULT: true)
205205
* error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false)

src/Endpoints/Eql.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,10 @@ public function getStatus(?array $params = null)
160160
* keep_alive?: int|string, // Update the time interval in which the results (partial or final) for this search will be available
161161
* allow_partial_search_results?: bool, // Control whether the query should keep running in case of shard failures, and return partial results
162162
* allow_partial_sequence_results?: bool, // Control whether a sequence query should return partial results or no results at all in case of shard failures. This option has effect only if [allow_partial_search_results] is true.
163+
* ccs_minimize_roundtrips?: bool, // Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution
164+
* ignore_unavailable?: bool, // Whether specified concrete indices should be ignored when unavailable (missing or closed)
165+
* allow_no_indices?: bool, // Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
166+
* expand_wildcards?: string, // Whether to expand wildcard expression to concrete indices that are open, closed or both.
163167
* pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false)
164168
* human?: bool, // Return human readable values for statistics. (DEFAULT: true)
165169
* error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false)
@@ -182,7 +186,7 @@ public function search(?array $params = null)
182186
$url = '/' . $this->encode($params['index']) . '/_eql/search';
183187
$method = empty($params['body']) ? 'GET' : 'POST';
184188

185-
$url = $this->addQueryString($url, $params, ['wait_for_completion_timeout','keep_on_completion','keep_alive','allow_partial_search_results','allow_partial_sequence_results','pretty','human','error_trace','source','filter_path']);
189+
$url = $this->addQueryString($url, $params, ['wait_for_completion_timeout','keep_on_completion','keep_alive','allow_partial_search_results','allow_partial_sequence_results','ccs_minimize_roundtrips','ignore_unavailable','allow_no_indices','expand_wildcards','pretty','human','error_trace','source','filter_path']);
186190
$headers = [
187191
'Accept' => 'application/json',
188192
'Content-Type' => 'application/json',

src/Endpoints/Esql.php

Lines changed: 89 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ class Esql extends AbstractEndpoint
3737
* format?: string, // a short version of the Accept header, e.g. json, yaml
3838
* delimiter?: string, // The character to use between values within a CSV row. Only valid for the csv format.
3939
* drop_null_columns?: bool, // Should entirely null columns be removed from the results? Their name and type will be returning in a new `all_columns` section.
40+
* allow_partial_results?: bool, // If `true`, partial results will be returned if there are shard failures, but
41+
* the query can continue to execute on other clusters and shards.
42+
* If `false`, the entire query will fail if there are
43+
* any failures.
4044
* pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false)
4145
* human?: bool, // Return human readable values for statistics. (DEFAULT: true)
4246
* error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false)
@@ -58,7 +62,7 @@ public function asyncQuery(?array $params = null)
5862
$url = '/_query/async';
5963
$method = 'POST';
6064

61-
$url = $this->addQueryString($url, $params, ['format','delimiter','drop_null_columns','pretty','human','error_trace','source','filter_path']);
65+
$url = $this->addQueryString($url, $params, ['format','delimiter','drop_null_columns','allow_partial_results','pretty','human','error_trace','source','filter_path']);
6266
$headers = [
6367
'Accept' => 'application/json',
6468
'Content-Type' => 'application/json',
@@ -114,6 +118,7 @@ public function asyncQueryDelete(?array $params = null)
114118
*
115119
* @param array{
116120
* id: string, // (REQUIRED) The async query ID
121+
* format?: string, // a short version of the Accept header, e.g. json, yaml
117122
* wait_for_completion_timeout?: int|string, // Specify the time that the request should block waiting for the final response
118123
* keep_alive?: int|string, // Specify the time interval in which the results (partial or final) for this search will be available
119124
* drop_null_columns?: bool, // Should entirely null columns be removed from the results? Their name and type will be returning in a new `all_columns` section.
@@ -138,7 +143,7 @@ public function asyncQueryGet(?array $params = null)
138143
$url = '/_query/async/' . $this->encode($params['id']);
139144
$method = 'GET';
140145

141-
$url = $this->addQueryString($url, $params, ['wait_for_completion_timeout','keep_alive','drop_null_columns','pretty','human','error_trace','source','filter_path']);
146+
$url = $this->addQueryString($url, $params, ['format','wait_for_completion_timeout','keep_alive','drop_null_columns','pretty','human','error_trace','source','filter_path']);
142147
$headers = [
143148
'Accept' => 'application/json',
144149
];
@@ -186,6 +191,83 @@ public function asyncQueryStop(?array $params = null)
186191
}
187192

188193

194+
/**
195+
* Executes a get ESQL query request
196+
*
197+
* @group serverless
198+
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
199+
*
200+
* @param array{
201+
* id: string, // (REQUIRED) The query ID
202+
* pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false)
203+
* human?: bool, // Return human readable values for statistics. (DEFAULT: true)
204+
* error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false)
205+
* source?: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
206+
* filter_path?: string|array<string>, // A comma-separated list of filters used to reduce the response.
207+
* } $params
208+
*
209+
* @throws MissingParameterException if a required parameter is missing
210+
* @throws NoNodeAvailableException if all the hosts are offline
211+
* @throws ClientResponseException if the status code of response is 4xx
212+
* @throws ServerResponseException if the status code of response is 5xx
213+
*
214+
* @return Elasticsearch|Promise
215+
*/
216+
public function getQuery(?array $params = null)
217+
{
218+
$params = $params ?? [];
219+
$this->checkRequiredParameters(['id'], $params);
220+
$url = '/_query/queries/' . $this->encode($params['id']);
221+
$method = 'GET';
222+
223+
$url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']);
224+
$headers = [
225+
'Accept' => 'application/json',
226+
'Content-Type' => 'application/json',
227+
];
228+
$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
229+
$request = $this->addOtelAttributes($params, ['id'], $request, 'esql.get_query');
230+
return $this->client->sendRequest($request);
231+
}
232+
233+
234+
/**
235+
* Executes a list ESQL queries request
236+
*
237+
* @group serverless
238+
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
239+
*
240+
* @param array{
241+
* pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false)
242+
* human?: bool, // Return human readable values for statistics. (DEFAULT: true)
243+
* error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false)
244+
* source?: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
245+
* filter_path?: string|array<string>, // A comma-separated list of filters used to reduce the response.
246+
* } $params
247+
*
248+
* @throws NoNodeAvailableException if all the hosts are offline
249+
* @throws ClientResponseException if the status code of response is 4xx
250+
* @throws ServerResponseException if the status code of response is 5xx
251+
*
252+
* @return Elasticsearch|Promise
253+
*/
254+
public function listQueries(?array $params = null)
255+
{
256+
$params = $params ?? [];
257+
$url = '/_query/queries';
258+
$method = 'GET';
259+
260+
$url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']);
261+
$headers = [
262+
'Accept' => 'application/json',
263+
'Content-Type' => 'application/json',
264+
];
265+
$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
266+
$request = $this->addOtelAttributes($params, [], $request, 'esql.list_queries');
267+
return $this->client->sendRequest($request);
268+
}
269+
270+
189271
/**
190272
* Executes an ESQL request
191273
*
@@ -196,6 +278,10 @@ public function asyncQueryStop(?array $params = null)
196278
* format?: string, // a short version of the Accept header, e.g. json, yaml
197279
* delimiter?: string, // The character to use between values within a CSV row. Only valid for the csv format.
198280
* drop_null_columns?: bool, // Should entirely null columns be removed from the results? Their name and type will be returning in a new `all_columns` section.
281+
* allow_partial_results?: bool, // If `true`, partial results will be returned if there are shard failures, but
282+
* the query can continue to execute on other clusters and shards.
283+
* If `false`, the entire query will fail if there are
284+
* any failures.
199285
* pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false)
200286
* human?: bool, // Return human readable values for statistics. (DEFAULT: true)
201287
* error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false)
@@ -217,7 +303,7 @@ public function query(?array $params = null)
217303
$url = '/_query';
218304
$method = 'POST';
219305

220-
$url = $this->addQueryString($url, $params, ['format','delimiter','drop_null_columns','pretty','human','error_trace','source','filter_path']);
306+
$url = $this->addQueryString($url, $params, ['format','delimiter','drop_null_columns','allow_partial_results','pretty','human','error_trace','source','filter_path']);
221307
$headers = [
222308
'Accept' => 'application/json',
223309
'Content-Type' => 'application/json',

0 commit comments

Comments
 (0)