Skip to content
This repository was archived by the owner on Apr 10, 2025. It is now read-only.

Commit 4f9b3db

Browse files
committed
Updated the API and fixed User-Agent
1 parent 17534d3 commit 4f9b3db

22 files changed

+633
-313
lines changed

src/Client.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
final class Client implements ClientInterface
2929
{
3030
const CLIENT_NAME = 'esv';
31-
const VERSION = '0.1.0';
31+
const VERSION = '0.2.0';
3232
const API_VERSION_HEADER = 'Elastic-Api-Version';
3333
const API_VERSION = '2023-10-31';
3434

@@ -90,7 +90,7 @@ public function getLogger(): LoggerInterface
9090
*/
9191
protected function defaultTransportSettings(Transport $transport): void
9292
{
93-
$transport->setUserAgent('elasticsearch-serverless', self::VERSION);
93+
$transport->setUserAgent('elasticsearch-serverless-php', self::VERSION);
9494
}
9595

9696
/**

src/Endpoints/AsyncSearch.php

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@
2929
class AsyncSearch extends AbstractEndpoint
3030
{
3131
/**
32-
* Deletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted.
32+
* Deletes an async search by identifier.
33+
* If the search is still running, the search request will be cancelled.
34+
* Otherwise, the saved search results are deleted.
35+
* If the Elasticsearch security features are enabled, the deletion of a specific async search is restricted to: the authenticated user that submitted the original search request; users that have the `cancel_task` cluster privilege.
3336
*
3437
* @see https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/async-search.html
3538
*
@@ -60,7 +63,8 @@ public function delete(string $id, array $params = []): Elasticsearch|Promise
6063

6164

6265
/**
63-
* Retrieves the results of a previously submitted async search request given its ID.
66+
* Retrieves the results of a previously submitted async search request given its identifier.
67+
* If the Elasticsearch security features are enabled, access to the results of a specific async search is restricted to the user or API key that submitted it.
6468
*
6569
* @see https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/async-search.html
6670
*
@@ -103,7 +107,9 @@ public function get(string $id, array $params = []): Elasticsearch|Promise
103107

104108

105109
/**
106-
* Retrieves the status of a previously submitted async search request given its ID.
110+
* Get async search status
111+
* Retrieves the status of a previously submitted async search request given its identifier, without retrieving search results.
112+
* If the Elasticsearch security features are enabled, use of this API is restricted to the `monitoring_user` role.
107113
*
108114
* @see https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/async-search.html
109115
*
@@ -134,7 +140,11 @@ public function status(string $id, array $params = []): Elasticsearch|Promise
134140

135141

136142
/**
137-
* Executes a search request asynchronously.
143+
* Runs a search request asynchronously.
144+
* When the primary sort of the results is an indexed field, shards get sorted based on minimum and maximum value that they hold for that field, hence partial results become available following the sort criteria that was requested.
145+
* Warning: Async search does not support scroll nor search requests that only include the suggest section.
146+
* By default, Elasticsearch doesn’t allow you to store an async search response larger than 10Mb and an attempt to do this results in an error.
147+
* The maximum allowed size for a stored async search response can be set by changing the `search.max_async_search_response_size` cluster level setting.
138148
*
139149
* @see https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/async-search.html
140150
*

src/Endpoints/Cat.php

Lines changed: 48 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@
2929
class Cat extends AbstractEndpoint
3030
{
3131
/**
32-
* Shows information about currently configured aliases to indices including filter and routing infos.
32+
* Retrieves the cluster’s index aliases, including filter and routing information.
33+
* The API does not return data stream aliases.
34+
* IMPORTANT: cat APIs are only intended for human consumption using the command line or the Kibana console. They are not intended for use by applications. For application consumption, use the aliases API.
3335
*
3436
* @see https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/cat-alias.html
3537
*
@@ -74,7 +76,10 @@ public function aliases(string|array $name = null, array $params = []): Elastics
7476

7577

7678
/**
77-
* Returns information about existing component_templates templates.
79+
* Returns information about component templates in a cluster.
80+
* Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases.
81+
* IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console.
82+
* They are not intended for use by applications. For application consumption, use the get component template API.
7883
*
7984
* @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-component-templates.html
8085
*
@@ -110,7 +115,10 @@ public function componentTemplates(string $name = null, array $params = []): Ela
110115

111116

112117
/**
113-
* Provides quick access to the document count of the entire cluster, or individual indices.
118+
* Provides quick access to a document count for a data stream, an index, or an entire cluster.
119+
* NOTE: The document count only includes live documents, not deleted documents which have not yet been removed by the merge process.
120+
* IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console.
121+
* They are not intended for use by applications. For application consumption, use the count API.
114122
*
115123
* @see https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/cat-count.html
116124
*
@@ -178,7 +186,12 @@ public function help(array $params = []): Elasticsearch|Promise
178186

179187

180188
/**
181-
* Returns information about indices: number of primaries and replicas, document counts, disk size, ...
189+
* Returns high-level information about indices in a cluster, including backing indices for data streams.
190+
* IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console.
191+
* They are not intended for use by applications. For application consumption, use the get index API.
192+
* Use the cat indices API to get the following information for each index in a cluster: shard count; document count; deleted document count; primary store size; total store size of all shards, including shard replicas.
193+
* These metrics are retrieved directly from Lucene, which Elasticsearch uses internally to power indexing and search. As a result, all document counts include hidden nested documents.
194+
* To get an accurate count of Elasticsearch documents, use the cat count or count APIs.
182195
*
183196
* @see https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/cat-indices.html
184197
*
@@ -234,7 +247,11 @@ public function indices(string|array $index = null, array $params = []): Elastic
234247

235248

236249
/**
237-
* Gets configuration and usage information about data frame analytics jobs.
250+
* Returns configuration and usage information about data frame analytics jobs.
251+
*
252+
* IMPORTANT: cat APIs are only intended for human consumption using the Kibana
253+
* console or command line. They are not intended for use by applications. For
254+
* application consumption, use the get data frame analytics jobs statistics API.
238255
*
239256
* @see https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/cat-dfanalytics.html
240257
*
@@ -286,7 +303,14 @@ public function mlDataFrameAnalytics(string $id = null, array $params = []): Ela
286303

287304

288305
/**
289-
* Gets configuration and usage information about datafeeds.
306+
* Returns configuration and usage information about datafeeds.
307+
* This API returns a maximum of 10,000 datafeeds.
308+
* If the Elasticsearch security features are enabled, you must have `monitor_ml`, `monitor`, `manage_ml`, or `manage`
309+
* cluster privileges to use this API.
310+
*
311+
* IMPORTANT: cat APIs are only intended for human consumption using the Kibana
312+
* console or command line. They are not intended for use by applications. For
313+
* application consumption, use the get datafeed statistics API.
290314
*
291315
* @see https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/cat-datafeeds.html
292316
*
@@ -336,7 +360,14 @@ public function mlDatafeeds(string $datafeed_id = null, array $params = []): Ela
336360

337361

338362
/**
339-
* Gets configuration and usage information about anomaly detection jobs.
363+
* Returns configuration and usage information for anomaly detection jobs.
364+
* This API returns a maximum of 10,000 jobs.
365+
* If the Elasticsearch security features are enabled, you must have `monitor_ml`,
366+
* `monitor`, `manage_ml`, or `manage` cluster privileges to use this API.
367+
*
368+
* IMPORTANT: cat APIs are only intended for human consumption using the Kibana
369+
* console or command line. They are not intended for use by applications. For
370+
* application consumption, use the get anomaly detection job statistics API.
340371
*
341372
* @see https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/cat-anomaly-detectors.html
342373
*
@@ -388,7 +419,11 @@ public function mlJobs(string $job_id = null, array $params = []): Elasticsearch
388419

389420

390421
/**
391-
* Gets configuration and usage information about inference trained models.
422+
* Returns configuration and usage information about inference trained models.
423+
*
424+
* IMPORTANT: cat APIs are only intended for human consumption using the Kibana
425+
* console or command line. They are not intended for use by applications. For
426+
* application consumption, use the get trained models statistics API.
392427
*
393428
* @see https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/cat-trained-model.html
394429
*
@@ -442,7 +477,11 @@ public function mlTrainedModels(string $model_id = null, array $params = []): El
442477

443478

444479
/**
445-
* Gets configuration and usage information about transforms.
480+
* Returns configuration and usage information about transforms.
481+
*
482+
* IMPORTANT: cat APIs are only intended for human consumption using the Kibana
483+
* console or command line. They are not intended for use by applications. For
484+
* application consumption, use the get transform statistics API.
446485
*
447486
* @see https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/cat-transforms.html
448487
*

src/Endpoints/Cluster.php

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
class Cluster extends AbstractEndpoint
3030
{
3131
/**
32-
* Deletes a component template
32+
* Deletes component templates.
33+
* Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases.
3334
*
3435
* @see https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/indices-component-template.html
3536
*
@@ -114,7 +115,7 @@ public function existsComponentTemplate(string|array $name, array $params = []):
114115

115116

116117
/**
117-
* Returns one or more component templates
118+
* Retrieves information about component templates.
118119
*
119120
* @see https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/indices-component-template.html
120121
*
@@ -197,7 +198,21 @@ public function info(string|array $target, array $params = []): Elasticsearch|Pr
197198

198199

199200
/**
200-
* Creates or updates a component template
201+
* Creates or updates a component template.
202+
* Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases.
203+
*
204+
* An index template can be composed of multiple component templates.
205+
* To use a component template, specify it in an index template’s `composed_of` list.
206+
* Component templates are only applied to new data streams and indices as part of a matching index template.
207+
*
208+
* Settings and mappings specified directly in the index template or the create index request override any settings or mappings specified in a component template.
209+
*
210+
* Component templates are only used during index creation.
211+
* For data streams, this includes data stream creation and the creation of a stream’s backing indices.
212+
* Changes to component templates do not affect existing indices, including a stream’s backing indices.
213+
*
214+
* You can use C-style `/* *\/` block comments in component templates.
215+
* You can include comments anywhere in the request body except before the opening curly bracket.
201216
*
202217
* @see https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/indices-component-template.html
203218
*

0 commit comments

Comments
 (0)