Skip to content

Commit 1fcd26a

Browse files
committed
Merge branch 'main' into 8.13
2 parents ebc997b + 221723e commit 1fcd26a

17 files changed

+625
-51
lines changed

.buildkite/pipeline.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ steps:
55
env:
66
PHP_VERSION: "{{ matrix.php }}"
77
TEST_SUITE: "{{ matrix.suite }}"
8-
STACK_VERSION: 8.12-SNAPSHOT
8+
STACK_VERSION: 8.13.0-SNAPSHOT
99
matrix:
1010
setup:
1111
suite:

CHANGELOG.md

+83
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,86 @@
1+
## Release 8.13.0
2+
3+
- Added the `mapTo($class)` function to Elasticsearch response for mapping the result
4+
of [ES|QL](https://www.elastic.co/guide/en/elasticsearch/reference/current/esql.html)
5+
query to an object of stdClass or of a specific class
6+
[#1398](https://github.com/elastic/elasticsearch-php/issues/1398)
7+
8+
This release introduces 6 new APIs and 6 EXPERIMENTAL APIs.
9+
10+
- Specific changes per endpoints
11+
- `AsyncSearch.status`
12+
- Added the `keep_alive` parameter (time), specify the time interval in which the results (partial or final) for this search will be available.
13+
- `Connector.list`
14+
- Added the following parameters:
15+
- `index_name`: list, a comma-separated list of connector index names to fetch connector documents for;
16+
- `connector_name`: list, a comma-separated list of connector names to fetch connector documents for;
17+
- `service_type`: list, a comma-separated list of connector service types to fetch connector documents for;
18+
- `query`: string, a search string for querying connectors, filtering results by matching against connector names, descriptions, and index names;
19+
- `Connector.updateApiKeyId` (new EXPERIMENTAL API)
20+
- API: https://github.com/elastic/elasticsearch/blob/main/rest-api-spec/src/main/resources/rest-api-spec/api/connector.update_api_key_id.json
21+
- Documentation: https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-api-key-id-api.html
22+
- `Connector.updateIndexName` (new EXPERIMENTAL API)
23+
- API: https://github.com/elastic/elasticsearch/blob/main/rest-api-spec/src/main/resources/rest-api-spec/api/connector.update_index_name.json
24+
- Documentation: https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-index-name-api.html
25+
- `Connector.updateNative` (new EXPERIMENTAL API)
26+
- API: https://github.com/elastic/elasticsearch/blob/main/rest-api-spec/src/main/resources/rest-api-spec/api/connector.update_native.json
27+
- Documentation: https://www.elastic.co/guide/en/elasticsearch/reference/master/connector-apis.html
28+
- `Connector.updateServiceType` (new EXPERIMENTAL API)
29+
- API: https://github.com/elastic/elasticsearch/blob/main/rest-api-spec/src/main/resources/rest-api-spec/api/connector.update_service_type.json
30+
- Documentation: https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-service-type-api.html
31+
- `Connector.updateStatus` (new EXPERIMENTAL API)
32+
- API: https://github.com/elastic/elasticsearch/blob/main/rest-api-spec/src/main/resources/rest-api-spec/api/connector.update_status.json
33+
- Documentation: https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-status-api.html
34+
- `ConnectorSyncJob.list`
35+
- Added the `job_type` parameter (list), a comma-separated list of job types.
36+
- `Esql.asyncQuery` (new EXPERIMENTAL API)
37+
- API: https://github.com/elastic/elasticsearch/blob/main/rest-api-spec/src/main/resources/rest-api-spec/api/esql.async_query.json
38+
- Documentation: https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-async-query-api.html
39+
- `Esql.asyncQueryGet` (new API)
40+
- API: https://github.com/elastic/elasticsearch/blob/main/rest-api-spec/src/main/resources/rest-api-spec/api/esql.async_query_get.json
41+
- Documentation: https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-async-query-get-api.html
42+
- `Esql.query`
43+
- Added the `drop_null_columns` parameter (boolean) to sepcify if null columns should be removed from the results. If yes, their name and type will be returned in a new `all_columns` section.
44+
- `Indices.resolveCluster` (new API)
45+
- API: https://github.com/elastic/elasticsearch/blob/main/rest-api-spec/src/main/resources/rest-api-spec/api/get_script.json
46+
- Documentation: https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-resolve-cluster-api.html
47+
- `Indices.rollover`
48+
- Added the `lazy` parameter (boolean), if set to true, the rollover action will only mark a data stream to signal that it needs to be rolled over at the next write. Only allowed on data streams.
49+
- `Inference.deleteModel`
50+
- The `model_id` parameter has been renamed to `inference_id`.
51+
- `Inference.getModel`
52+
- The `model_id` parameter has been renamed in `inference_id`.
53+
- `Inference.inference`
54+
- The `model_id` parameter has been renamed in `inference_id`.
55+
- `Inference.putModel`
56+
- The `model_id` parameter has been renamed in `inference_id`.
57+
- `Profiling.flamegraph` (new API)
58+
- API: https://github.com/elastic/elasticsearch/blob/main/rest-api-spec/src/main/resources/rest-api-spec/api/profiling.flamegraph.json
59+
- Documentation: https://www.elastic.co/guide/en/observability/current/universal-profiling.html
60+
- `Profiling.stacktraces` (new API)
61+
- API: https://github.com/elastic/elasticsearch/blob/main/rest-api-spec/src/main/resources/rest-api-spec/api/profiling.stacktraces.json
62+
- Documentation: https://www.elastic.co/guide/en/observability/current/universal-profiling.html
63+
- `Security.queryUser` (new API)
64+
- API: https://github.com/elastic/elasticsearch/blob/main/rest-api-spec/src/main/resources/rest-api-spec/api/security.query_user.json
65+
- Documentation: https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-user.html
66+
- `Synonyms.deleteSynonym`
67+
- This API is now stable.
68+
- `Synonyms.deleteSynonymRule`
69+
- This API is now stable.
70+
- `Synonyms.getSynonym`
71+
- This API is now stable.
72+
- `Synonyms.getSynonymRule`
73+
- This API is now stable.
74+
- `Synonyms.getSynonymsSets`
75+
- This API is now stable.
76+
- `Synonyms.putSynonym`
77+
- This API is now stable.
78+
- `Synonyms.putSynonymRule`
79+
- This API is now stable.
80+
- `TextStructure.testGrokPattern` (new API)
81+
- API: https://github.com/elastic/elasticsearch/blob/main/rest-api-spec/src/main/resources/rest-api-spec/api/text_structure.test_grok_pattern.json
82+
- Documentation: https://www.elastic.co/guide/en/elasticsearch/reference/master/test-grok-pattern.html
83+
184
## Release 8.12.0
285

386
- Added 22 new EXPERIMENTAL APIs and 1 new stable API:

docs/release-notes.asciidoc

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
[[release-notes]]
22
== Release notes
33

4-
* <<rn-8-11-0>>
4+
* <<rn-8-13-0>>
5+
* <<rn-8-12-0>>
56
* <<rn-8-11-0>>
67
* <<rn-8-10-0>>
78
* <<rn-8-9-0>>
@@ -44,11 +45,20 @@
4445
* <<rn-7-0-1>>
4546
* <<rn-7-0-0>>
4647

48+
[discrete]
49+
[[rn-8-13-0]]
50+
=== 8.13.0
51+
52+
* Updated the API endpoints to Elasticserach 8.13.0
53+
* Added the Added the mapTo($class) function to Elasticsearch response for mapping the result
54+
of https://www.elastic.co/guide/en/elasticsearch/reference/current/esql.html[ES|QL]
55+
query to an object of stdClass or a specific class https://github.com/elastic/elasticsearch-php/issues/1398[#1398]
56+
4757
[discrete]
4858
[[rn-8-12-0]]
4959
=== 8.12.0
5060

51-
* Updated the API endpoints to Elasticserach 8.11.0
61+
* Updated the API endpoints to Elasticserach 8.12.0
5262
* Tested the library with PHP 8.3
5363

5464
[discrete]

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.12.0';
31+
const VERSION = '8.13.0';
3232
const API_COMPATIBILITY_HEADER = '%s/vnd.elasticsearch+%s; compatible-with=8';
3333

3434
use ClientEndpointsTrait;

src/Endpoints/AsyncSearch.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ public function get(array $params = [])
108108
*
109109
* @param array{
110110
* id: string, // (REQUIRED) The async search ID
111+
* keep_alive: time, // Specify the time interval in which the results (partial or final) for this search will be available
111112
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
112113
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
113114
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
@@ -128,7 +129,7 @@ public function status(array $params = [])
128129
$url = '/_async_search/status/' . $this->encode($params['id']);
129130
$method = 'GET';
130131

131-
$url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']);
132+
$url = $this->addQueryString($url, $params, ['keep_alive','pretty','human','error_trace','source','filter_path']);
132133
$headers = [
133134
'Accept' => 'application/json',
134135
];

src/Endpoints/Connector.php

+196-2
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,11 @@ public function lastSync(array $params = [])
182182
*
183183
* @param array{
184184
* from: int, // Starting offset (default: 0)
185-
* size: int, // specifies a max number of results to get (default: 100)
185+
* size: int, // Specifies a max number of results to get (default: 100)
186+
* index_name: list, // A comma-separated list of connector index names to fetch connector documents for
187+
* connector_name: list, // A comma-separated list of connector names to fetch connector documents for
188+
* service_type: list, // A comma-separated list of connector service types to fetch connector documents for
189+
* query: string, // A search string for querying connectors, filtering results by matching against connector names, descriptions, and index names
186190
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
187191
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
188192
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
@@ -201,7 +205,7 @@ public function list(array $params = [])
201205
$url = '/_connector';
202206
$method = 'GET';
203207

204-
$url = $this->addQueryString($url, $params, ['from','size','pretty','human','error_trace','source','filter_path']);
208+
$url = $this->addQueryString($url, $params, ['from','size','index_name','connector_name','service_type','query','pretty','human','error_trace','source','filter_path']);
205209
$headers = [
206210
'Accept' => 'application/json',
207211
];
@@ -283,6 +287,44 @@ public function put(array $params = [])
283287
}
284288

285289

290+
/**
291+
* Updates the API key id and/or API key secret id fields in the connector document.
292+
*
293+
* @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-api-key-id-api.html
294+
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
295+
*
296+
* @param array{
297+
* connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated.
298+
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
299+
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
300+
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
301+
* source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
302+
* filter_path: list, // A comma-separated list of filters used to reduce the response.
303+
* body: array, // (REQUIRED) An object containing the connector's API key id and/or Connector Secret document id for that API key.
304+
* } $params
305+
*
306+
* @throws MissingParameterException if a required parameter is missing
307+
* @throws NoNodeAvailableException if all the hosts are offline
308+
* @throws ClientResponseException if the status code of response is 4xx
309+
* @throws ServerResponseException if the status code of response is 5xx
310+
*
311+
* @return Elasticsearch|Promise
312+
*/
313+
public function updateApiKeyId(array $params = [])
314+
{
315+
$this->checkRequiredParameters(['connector_id','body'], $params);
316+
$url = '/_connector/' . $this->encode($params['connector_id']) . '/_api_key_id';
317+
$method = 'PUT';
318+
319+
$url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']);
320+
$headers = [
321+
'Accept' => 'application/json',
322+
'Content-Type' => 'application/json',
323+
];
324+
return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
325+
}
326+
327+
286328
/**
287329
* Updates the connector configuration.
288330
*
@@ -397,6 +439,44 @@ public function updateFiltering(array $params = [])
397439
}
398440

399441

442+
/**
443+
* Updates the index name of the connector.
444+
*
445+
* @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-index-name-api.html
446+
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
447+
*
448+
* @param array{
449+
* connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated.
450+
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
451+
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
452+
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
453+
* source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
454+
* filter_path: list, // A comma-separated list of filters used to reduce the response.
455+
* body: array, // (REQUIRED) An object containing the connector's index name.
456+
* } $params
457+
*
458+
* @throws MissingParameterException if a required parameter is missing
459+
* @throws NoNodeAvailableException if all the hosts are offline
460+
* @throws ClientResponseException if the status code of response is 4xx
461+
* @throws ServerResponseException if the status code of response is 5xx
462+
*
463+
* @return Elasticsearch|Promise
464+
*/
465+
public function updateIndexName(array $params = [])
466+
{
467+
$this->checkRequiredParameters(['connector_id','body'], $params);
468+
$url = '/_connector/' . $this->encode($params['connector_id']) . '/_index_name';
469+
$method = 'PUT';
470+
471+
$url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']);
472+
$headers = [
473+
'Accept' => 'application/json',
474+
'Content-Type' => 'application/json',
475+
];
476+
return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
477+
}
478+
479+
400480
/**
401481
* Updates the name and/or description fields in the connector document.
402482
*
@@ -435,6 +515,44 @@ public function updateName(array $params = [])
435515
}
436516

437517

518+
/**
519+
* Updates the is_native flag of the connector.
520+
*
521+
* @see https://www.elastic.co/guide/en/elasticsearch/reference/master/connector-apis.html
522+
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
523+
*
524+
* @param array{
525+
* connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated.
526+
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
527+
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
528+
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
529+
* source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
530+
* filter_path: list, // A comma-separated list of filters used to reduce the response.
531+
* body: array, // (REQUIRED) An object containing the connector's is_native flag
532+
* } $params
533+
*
534+
* @throws MissingParameterException if a required parameter is missing
535+
* @throws NoNodeAvailableException if all the hosts are offline
536+
* @throws ClientResponseException if the status code of response is 4xx
537+
* @throws ServerResponseException if the status code of response is 5xx
538+
*
539+
* @return Elasticsearch|Promise
540+
*/
541+
public function updateNative(array $params = [])
542+
{
543+
$this->checkRequiredParameters(['connector_id','body'], $params);
544+
$url = '/_connector/' . $this->encode($params['connector_id']) . '/_native';
545+
$method = 'PUT';
546+
547+
$url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']);
548+
$headers = [
549+
'Accept' => 'application/json',
550+
'Content-Type' => 'application/json',
551+
];
552+
return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
553+
}
554+
555+
438556
/**
439557
* Updates the pipeline field in the connector document.
440558
*
@@ -509,4 +627,80 @@ public function updateScheduling(array $params = [])
509627
];
510628
return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
511629
}
630+
631+
632+
/**
633+
* Updates the service type of the connector.
634+
*
635+
* @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-service-type-api.html
636+
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
637+
*
638+
* @param array{
639+
* connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated.
640+
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
641+
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
642+
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
643+
* source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
644+
* filter_path: list, // A comma-separated list of filters used to reduce the response.
645+
* body: array, // (REQUIRED) An object containing the connector's service type.
646+
* } $params
647+
*
648+
* @throws MissingParameterException if a required parameter is missing
649+
* @throws NoNodeAvailableException if all the hosts are offline
650+
* @throws ClientResponseException if the status code of response is 4xx
651+
* @throws ServerResponseException if the status code of response is 5xx
652+
*
653+
* @return Elasticsearch|Promise
654+
*/
655+
public function updateServiceType(array $params = [])
656+
{
657+
$this->checkRequiredParameters(['connector_id','body'], $params);
658+
$url = '/_connector/' . $this->encode($params['connector_id']) . '/_service_type';
659+
$method = 'PUT';
660+
661+
$url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']);
662+
$headers = [
663+
'Accept' => 'application/json',
664+
'Content-Type' => 'application/json',
665+
];
666+
return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
667+
}
668+
669+
670+
/**
671+
* Updates the status of the connector.
672+
*
673+
* @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-connector-status-api.html
674+
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
675+
*
676+
* @param array{
677+
* connector_id: string, // (REQUIRED) The unique identifier of the connector to be updated.
678+
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
679+
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
680+
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
681+
* source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
682+
* filter_path: list, // A comma-separated list of filters used to reduce the response.
683+
* body: array, // (REQUIRED) An object containing the connector's status.
684+
* } $params
685+
*
686+
* @throws MissingParameterException if a required parameter is missing
687+
* @throws NoNodeAvailableException if all the hosts are offline
688+
* @throws ClientResponseException if the status code of response is 4xx
689+
* @throws ServerResponseException if the status code of response is 5xx
690+
*
691+
* @return Elasticsearch|Promise
692+
*/
693+
public function updateStatus(array $params = [])
694+
{
695+
$this->checkRequiredParameters(['connector_id','body'], $params);
696+
$url = '/_connector/' . $this->encode($params['connector_id']) . '/_status';
697+
$method = 'PUT';
698+
699+
$url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']);
700+
$headers = [
701+
'Accept' => 'application/json',
702+
'Content-Type' => 'application/json',
703+
];
704+
return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
705+
}
512706
}

0 commit comments

Comments
 (0)