Skip to content

Commit c8f32a2

Browse files
committed
Updated APIs to ES 8.13
1 parent e68f81d commit c8f32a2

12 files changed

+507
-42
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:

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
}

src/Endpoints/ConnectorSyncJob.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ public function get(array $params = [])
221221
* size: int, // specifies a max number of results to get (default: 100)
222222
* status: string, // Sync job status, which sync jobs are fetched for
223223
* connector_id: string, // Id of the connector to fetch the sync jobs for
224+
* job_type: list, // A comma-separated list of job types
224225
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
225226
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
226227
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
@@ -239,7 +240,7 @@ public function list(array $params = [])
239240
$url = '/_connector/_sync_job';
240241
$method = 'GET';
241242

242-
$url = $this->addQueryString($url, $params, ['from','size','status','connector_id','pretty','human','error_trace','source','filter_path']);
243+
$url = $this->addQueryString($url, $params, ['from','size','status','connector_id','job_type','pretty','human','error_trace','source','filter_path']);
243244
$headers = [
244245
'Accept' => 'application/json',
245246
];

src/Endpoints/Esql.php

+80-2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,83 @@
2828
*/
2929
class Esql extends AbstractEndpoint
3030
{
31+
/**
32+
* Executes an ESQL request asynchronously
33+
*
34+
* @see https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-async-query-api.html
35+
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
36+
*
37+
* @param array{
38+
* format: string, // a short version of the Accept header, e.g. json, yaml
39+
* delimiter: string, // The character to use between values within a CSV row. Only valid for the csv format.
40+
* drop_null_columns: boolean, // Should entirely null columns be removed from the results? Their name and type will be returning in a new `all_columns` section.
41+
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
42+
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
43+
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
44+
* source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
45+
* filter_path: list, // A comma-separated list of filters used to reduce the response.
46+
* body: array, // (REQUIRED) Use the `query` element to start a query. Use `columnar` to format the answer.
47+
* } $params
48+
*
49+
* @throws NoNodeAvailableException if all the hosts are offline
50+
* @throws ClientResponseException if the status code of response is 4xx
51+
* @throws ServerResponseException if the status code of response is 5xx
52+
*
53+
* @return Elasticsearch|Promise
54+
*/
55+
public function asyncQuery(array $params = [])
56+
{
57+
$this->checkRequiredParameters(['body'], $params);
58+
$url = '/_query/async';
59+
$method = 'POST';
60+
61+
$url = $this->addQueryString($url, $params, ['format','delimiter','drop_null_columns','pretty','human','error_trace','source','filter_path']);
62+
$headers = [
63+
'Accept' => 'application/json',
64+
'Content-Type' => 'application/json',
65+
];
66+
return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
67+
}
68+
69+
70+
/**
71+
* Retrieves the results of a previously submitted async query request given its ID.
72+
*
73+
* @see https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-async-query-get-api.html
74+
*
75+
* @param array{
76+
* id: string, // (REQUIRED) The async query ID
77+
* wait_for_completion_timeout: time, // Specify the time that the request should block waiting for the final response
78+
* keep_alive: time, // Specify the time interval in which the results (partial or final) for this search will be available
79+
* drop_null_columns: boolean, // Should entirely null columns be removed from the results? Their name and type will be returning in a new `all_columns` section.
80+
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
81+
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
82+
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
83+
* source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
84+
* filter_path: list, // A comma-separated list of filters used to reduce the response.
85+
* } $params
86+
*
87+
* @throws MissingParameterException if a required parameter is missing
88+
* @throws NoNodeAvailableException if all the hosts are offline
89+
* @throws ClientResponseException if the status code of response is 4xx
90+
* @throws ServerResponseException if the status code of response is 5xx
91+
*
92+
* @return Elasticsearch|Promise
93+
*/
94+
public function asyncQueryGet(array $params = [])
95+
{
96+
$this->checkRequiredParameters(['id'], $params);
97+
$url = '/_query/async/' . $this->encode($params['id']);
98+
$method = 'GET';
99+
100+
$url = $this->addQueryString($url, $params, ['wait_for_completion_timeout','keep_alive','drop_null_columns','pretty','human','error_trace','source','filter_path']);
101+
$headers = [
102+
'Accept' => 'application/json',
103+
];
104+
return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
105+
}
106+
107+
31108
/**
32109
* Executes an ESQL request
33110
*
@@ -37,12 +114,13 @@ class Esql extends AbstractEndpoint
37114
* @param array{
38115
* format: string, // a short version of the Accept header, e.g. json, yaml
39116
* delimiter: string, // The character to use between values within a CSV row. Only valid for the csv format.
117+
* drop_null_columns: boolean, // Should entirely null columns be removed from the results? Their name and type will be returning in a new `all_columns` section.
40118
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
41119
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
42120
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
43121
* source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
44122
* filter_path: list, // A comma-separated list of filters used to reduce the response.
45-
* body: array, // (REQUIRED) Use the `query` element to start a query. Use `time_zone` to specify an execution time zone and `columnar` to format the answer.
123+
* body: array, // (REQUIRED) Use the `query` element to start a query. Use `columnar` to format the answer.
46124
* } $params
47125
*
48126
* @throws NoNodeAvailableException if all the hosts are offline
@@ -57,7 +135,7 @@ public function query(array $params = [])
57135
$url = '/_query';
58136
$method = 'POST';
59137

60-
$url = $this->addQueryString($url, $params, ['format','delimiter','pretty','human','error_trace','source','filter_path']);
138+
$url = $this->addQueryString($url, $params, ['format','delimiter','drop_null_columns','pretty','human','error_trace','source','filter_path']);
61139
$headers = [
62140
'Accept' => 'application/json',
63141
'Content-Type' => 'application/json',

0 commit comments

Comments
 (0)