Skip to content

Commit 7815caa

Browse files
committed
Updated endpoints to 8.4
2 parents 161682c + e98c4d3 commit 7815caa

File tree

10 files changed

+65
-16
lines changed

10 files changed

+65
-16
lines changed

.ci/jobs/elastic+elasticsearch-php+6.8.x.yml renamed to .ci/jobs/elastic+elasticsearch-php+8.4.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
22
- job:
3-
name: elastic+elasticsearch-php+6.8.x
4-
display-name: 'elastic / elasticsearch-php # 6.8.x'
5-
description: Testing the elasticsearch-php 6.8.x branch.
3+
name: elastic+elasticsearch-php+8.4
4+
display-name: 'elastic / elasticsearch-php # 8.4'
5+
description: Testing the elasticsearch-php 8.4 branch.
66
parameters:
77
- string:
88
name: branch_specifier
9-
default: refs/heads/6.8.x
9+
default: refs/heads/8.4
1010
description: the Git branch specifier to build (<branchName>, <tagName>,
1111
<commitId>, etc.)
1212
triggers:

.ci/test-matrix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
STACK_VERSION:
3-
- 8.4.0-SNAPSHOT
3+
- 8.4-SNAPSHOT
44

55
PHP_VERSION:
66
- 8.1-cli

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
matrix:
1212
php-version: [7.4, 8.0, 8.1]
1313
os: [ubuntu-latest]
14-
es-version: [8.4.0-SNAPSHOT]
14+
es-version: [8.4-SNAPSHOT]
1515

1616
steps:
1717
- name: Checkout

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ This is the official PHP client for
1818
- [Search a document](#search-a-document)
1919
- [Delete a document](#delete-a-document)
2020
- [Versioning](#versioning)
21-
- [Backward Incompatible Changes](#backward-incompatible-changes-)
21+
- [Backward Incompatible Changes](#backward-incompatible-changes-boom)
2222
- [Mock the Elasticsearch client](#mock-the-elasticsearch-client)
2323
- [FAQ](#faq-)
2424
- [Contribute](#contribute-)
@@ -118,7 +118,7 @@ docker run --name es01 --net elastic -p 9200:9200 -p 9300:9300 -it docker.elasti
118118
This command creates an `elastic` Docker network and start Elasticsearch
119119
using the port `9200` (default).
120120

121-
When you run the docker imnage a password is generated for the `elastic` user
121+
When you run the docker image a password is generated for the `elastic` user
122122
and it's printed to the terminal (you might need to scroll back a bit in the
123123
terminal to view it). You have to copy it since we will need to connect to
124124
Elasticsearch.
@@ -384,7 +384,7 @@ section of PHP-HTTP documentation.
384384
### Where do I report issues with the client?
385385

386386
If something is not working as expected, please open an
387-
[issue](https://github.com/elastic/elasticsearh-php/issues/new).
387+
[issue](https://github.com/elastic/elasticsearch-php/issues/new).
388388

389389
### Where else can I go to get help?
390390

docs/installation.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ create this object, as follows:
2929
--------------------------
3030
require 'vendor/autoload.php';
3131
32-
$client = Elasticsearch\ClientBuilder::create()->build();
32+
$client = Elastic\Elasticsearch\ClientBuilder::create()->build();
3333
--------------------------
3434
+
3535
Client instantiation is performed with a static helper function `create()`. This

src/Endpoints/Ml.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2340,6 +2340,7 @@ public function startDatafeed(array $params = [])
23402340
*
23412341
* @param array{
23422342
* model_id: string, // (REQUIRED) The unique identifier of the trained model.
2343+
* cache_size: string, // A byte-size value for configuring the inference cache size. For example, 20mb.
23432344
* number_of_allocations: int, // The number of model allocations on each node where the model is deployed.
23442345
* threads_per_allocation: int, // The number of threads used by each model allocation during inference.
23452346
* queue_capacity: int, // Controls how many inference requests are allowed in the queue at a time.
@@ -2365,7 +2366,7 @@ public function startTrainedModelDeployment(array $params = [])
23652366
$url = '/_ml/trained_models/' . $this->encode($params['model_id']) . '/deployment/_start';
23662367
$method = 'POST';
23672368

2368-
$url = $this->addQueryString($url, $params, ['number_of_allocations','threads_per_allocation','queue_capacity','timeout','wait_for','pretty','human','error_trace','source','filter_path']);
2369+
$url = $this->addQueryString($url, $params, ['cache_size','number_of_allocations','threads_per_allocation','queue_capacity','timeout','wait_for','pretty','human','error_trace','source','filter_path']);
23692370
$headers = [
23702371
'Accept' => 'application/json',
23712372
'Content-Type' => 'application/json',

src/Endpoints/Security.php

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1908,6 +1908,43 @@ public function suggestUserProfiles(array $params = [])
19081908
}
19091909

19101910

1911+
/**
1912+
* Updates attributes of an existing API key.
1913+
*
1914+
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-api-key.html
1915+
*
1916+
* @param array{
1917+
* id: string, // (REQUIRED) The ID of the API key to update
1918+
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
1919+
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
1920+
* error_trace: boolean, // Include the stack trace of returned errors. (DEFAULT: false)
1921+
* source: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1922+
* filter_path: list, // A comma-separated list of filters used to reduce the response.
1923+
* body: array, // The API key request to update attributes of an API key.
1924+
* } $params
1925+
*
1926+
* @throws MissingParameterException if a required parameter is missing
1927+
* @throws NoNodeAvailableException if all the hosts are offline
1928+
* @throws ClientResponseException if the status code of response is 4xx
1929+
* @throws ServerResponseException if the status code of response is 5xx
1930+
*
1931+
* @return Elasticsearch|Promise
1932+
*/
1933+
public function updateApiKey(array $params = [])
1934+
{
1935+
$this->checkRequiredParameters(['id'], $params);
1936+
$url = '/_security/api_key/' . $this->encode($params['id']);
1937+
$method = 'PUT';
1938+
1939+
$url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']);
1940+
$headers = [
1941+
'Accept' => 'application/json',
1942+
'Content-Type' => 'application/json',
1943+
];
1944+
return $this->client->sendRequest($this->createRequest($method, $url, $headers, $params['body'] ?? null));
1945+
}
1946+
1947+
19111948
/**
19121949
* Update application specific data for the user profile of the given unique ID.
19131950
*

src/Endpoints/Snapshot.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,13 @@ public function deleteRepository(array $params = [])
272272
* index_names: boolean, // Whether to include the name of each index in the snapshot. Defaults to true.
273273
* index_details: boolean, // Whether to include details of each index in the snapshot, if those details are available. Defaults to false.
274274
* include_repository: boolean, // Whether to include the repository name in the snapshot info. Defaults to true.
275+
* sort: enum, // Allows setting a sort order for the result. Defaults to start_time
276+
* size: integer, // Maximum number of snapshots to return. Defaults to 0 which means return all that match without limit.
277+
* order: enum, // Sort order
278+
* from_sort_value: string, // Value of the current sort column at which to start retrieval.
279+
* after: string, // Offset identifier to start pagination from as returned by the 'next' field in the response body.
280+
* offset: integer, // Numeric offset to start pagination based on the snapshots matching the request. Defaults to 0
281+
* slm_policy_filter: string, // Filter snapshots by a comma-separated list of SLM policy names that snapshots belong to. Accepts wildcards. Use the special pattern '_none' to match snapshots without an SLM policy
275282
* verbose: boolean, // Whether to show verbose snapshot info or only show the basic info found in the repository index blob
276283
* pretty: boolean, // Pretty format the returned JSON response. (DEFAULT: false)
277284
* human: boolean, // Return human readable values for statistics. (DEFAULT: true)
@@ -293,7 +300,7 @@ public function get(array $params = [])
293300
$url = '/_snapshot/' . $this->encode($params['repository']) . '/' . $this->encode($params['snapshot']);
294301
$method = 'GET';
295302

296-
$url = $this->addQueryString($url, $params, ['master_timeout','ignore_unavailable','index_names','index_details','include_repository','verbose','pretty','human','error_trace','source','filter_path']);
303+
$url = $this->addQueryString($url, $params, ['master_timeout','ignore_unavailable','index_names','index_details','include_repository','sort','size','order','from_sort_value','after','offset','slm_policy_filter','verbose','pretty','human','error_trace','source','filter_path']);
297304
$headers = [
298305
'Accept' => 'application/json',
299306
];

src/Traits/ClientEndpointsTrait.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,7 @@ public function fieldCaps(array $params = [])
629629
* @param array{
630630
* id: string, // (REQUIRED) The document ID
631631
* index: string, // (REQUIRED) The name of the index
632+
* force_synthetic_source: boolean, // Should this request force synthetic _source? Use this to test if the mapping supports synthetic _source and to get a sense of the worst case performance. Fetches with this enabled will be slower the enabling synthetic source natively in the index.
632633
* stored_fields: list, // A comma-separated list of stored fields to return in the response
633634
* preference: string, // Specify the node or shard the operation should be performed on (default: random)
634635
* realtime: boolean, // Specify whether to perform the operation in realtime or search mode
@@ -659,7 +660,7 @@ public function get(array $params = [])
659660
$url = '/' . $this->encode($params['index']) . '/_doc/' . $this->encode($params['id']);
660661
$method = 'GET';
661662

662-
$url = $this->addQueryString($url, $params, ['stored_fields','preference','realtime','refresh','routing','_source','_source_excludes','_source_includes','version','version_type','pretty','human','error_trace','source','filter_path']);
663+
$url = $this->addQueryString($url, $params, ['force_synthetic_source','stored_fields','preference','realtime','refresh','routing','_source','_source_excludes','_source_includes','version','version_type','pretty','human','error_trace','source','filter_path']);
663664
$headers = [
664665
'Accept' => 'application/json',
665666
];
@@ -943,6 +944,7 @@ public function knnSearch(array $params = [])
943944
*
944945
* @param array{
945946
* index: string, // The name of the index
947+
* force_synthetic_source: boolean, // Should this request force synthetic _source? Use this to test if the mapping supports synthetic _source and to get a sense of the worst case performance. Fetches with this enabled will be slower the enabling synthetic source natively in the index.
946948
* stored_fields: list, // A comma-separated list of stored fields to return in the response
947949
* preference: string, // Specify the node or shard the operation should be performed on (default: random)
948950
* realtime: boolean, // Specify whether to perform the operation in realtime or search mode
@@ -975,7 +977,7 @@ public function mget(array $params = [])
975977
$url = '/_mget';
976978
$method = empty($params['body']) ? 'GET' : 'POST';
977979
}
978-
$url = $this->addQueryString($url, $params, ['stored_fields','preference','realtime','refresh','routing','_source','_source_excludes','_source_includes','pretty','human','error_trace','source','filter_path']);
980+
$url = $this->addQueryString($url, $params, ['force_synthetic_source','stored_fields','preference','realtime','refresh','routing','_source','_source_excludes','_source_includes','pretty','human','error_trace','source','filter_path']);
979981
$headers = [
980982
'Accept' => 'application/json',
981983
'Content-Type' => 'application/json',
@@ -1499,6 +1501,7 @@ public function scroll(array $params = [])
14991501
* stored_fields: list, // A comma-separated list of stored fields to return as part of a hit
15001502
* docvalue_fields: list, // A comma-separated list of fields to return as the docvalue representation of a field for each hit
15011503
* from: number, // Starting offset (default: 0)
1504+
* force_synthetic_source: boolean, // Should this request force synthetic _source? Use this to test if the mapping supports synthetic _source and to get a sense of the worst case performance. Fetches with this enabled will be slower the enabling synthetic source natively in the index.
15021505
* ignore_unavailable: boolean, // Whether specified concrete indices should be ignored when unavailable (missing or closed)
15031506
* ignore_throttled: boolean, // Whether specified concrete, expanded or aliased indices should be ignored when throttled
15041507
* 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)
@@ -1556,7 +1559,7 @@ public function search(array $params = [])
15561559
$url = '/_search';
15571560
$method = empty($params['body']) ? 'GET' : 'POST';
15581561
}
1559-
$url = $this->addQueryString($url, $params, ['analyzer','analyze_wildcard','ccs_minimize_roundtrips','default_operator','df','explain','stored_fields','docvalue_fields','from','ignore_unavailable','ignore_throttled','allow_no_indices','expand_wildcards','lenient','preference','q','routing','scroll','search_type','size','sort','_source','_source_excludes','_source_includes','terminate_after','stats','suggest_field','suggest_mode','suggest_size','suggest_text','timeout','track_scores','track_total_hits','allow_partial_search_results','typed_keys','version','seq_no_primary_term','request_cache','batched_reduce_size','max_concurrent_shard_requests','pre_filter_shard_size','rest_total_hits_as_int','min_compatible_shard_node','pretty','human','error_trace','source','filter_path']);
1562+
$url = $this->addQueryString($url, $params, ['analyzer','analyze_wildcard','ccs_minimize_roundtrips','default_operator','df','explain','stored_fields','docvalue_fields','from','force_synthetic_source','ignore_unavailable','ignore_throttled','allow_no_indices','expand_wildcards','lenient','preference','q','routing','scroll','search_type','size','sort','_source','_source_excludes','_source_includes','terminate_after','stats','suggest_field','suggest_mode','suggest_size','suggest_text','timeout','track_scores','track_total_hits','allow_partial_search_results','typed_keys','version','seq_no_primary_term','request_cache','batched_reduce_size','max_concurrent_shard_requests','pre_filter_shard_size','rest_total_hits_as_int','min_compatible_shard_node','pretty','human','error_trace','source','filter_path']);
15601563
$headers = [
15611564
'Accept' => 'application/json',
15621565
'Content-Type' => 'application/json',

util/YamlTests.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ class YamlTests
3535
const YAML_FILES_TO_OMIT = [
3636
'platinum/eql/10_basic.yml',
3737
// use of _internal APIs
38-
'free/cluster.desired_nodes/10_basic.yml',
38+
'free/cluster.desired_nodes/10_basic.yml',
39+
'free/cluster.desired_nodes/20_dry_run.yml',
3940
'free/health/'
4041
];
4142

0 commit comments

Comments
 (0)