From 3ce596ec51289cb36c7f8d541fcec7cd81756440 Mon Sep 17 00:00:00 2001 From: dblock Date: Sat, 28 Dec 2024 03:36:16 +0000 Subject: [PATCH] Updated opensearch-php to reflect the latest OpenSearch API spec (2024-12-28) Signed-off-by: GitHub --- CHANGELOG.md | 1 + src/OpenSearch/Client.php | 3 +-- .../Endpoints/Cluster/GetComponentTemplate.php | 1 + src/OpenSearch/Endpoints/Indices/Upgrade.php | 10 ---------- src/OpenSearch/Namespaces/ClusterNamespace.php | 1 + src/OpenSearch/Namespaces/IndicesNamespace.php | 4 +--- 6 files changed, 5 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 35d9587cb..d5f84f0e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ### Fixed - Fixed PHP 8.4 deprecations ### Updated APIs +- Updated opensearch-php APIs to reflect [opensearch-api-specification@0e0e072](https://github.com/opensearch-project/opensearch-api-specification/commit/0e0e072cf064ef8e369f8ea718f727965eda35a7) - Updated opensearch-php APIs to reflect [opensearch-api-specification@ebe0f8a](https://github.com/opensearch-project/opensearch-api-specification/commit/ebe0f8a885f7db7e882d160c101055a5aa70a707) - Updated opensearch-php APIs to reflect [opensearch-api-specification@398481e](https://github.com/opensearch-project/opensearch-api-specification/commit/398481e5bd1cc590d947c35379c47096f2114f00) - Updated opensearch-php APIs to reflect [opensearch-api-specification@6bb1fed](https://github.com/opensearch-project/opensearch-api-specification/commit/6bb1fed0a2c7cf094a5ecfdb01f0306a4b9f8eba) diff --git a/src/OpenSearch/Client.php b/src/OpenSearch/Client.php index 580fe032a..8f3b465bb 100644 --- a/src/OpenSearch/Client.php +++ b/src/OpenSearch/Client.php @@ -1314,7 +1314,7 @@ public function reindex(array $params = []) } /** - * Changes the number of requests per second for a particular Reindex operation. + * Changes the number of requests per second for a particular reindex operation. * * $params['task_id'] = (string) Identifier for the task. (Required) * $params['requests_per_second'] = (number) The throttle for this request in sub-requests per second. @@ -1400,7 +1400,6 @@ public function scriptsPainlessExecute(array $params = []) * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - * $params['body'] = (array) The scroll ID if not passed by URL or query parameter. * * @param array $params Associative array of parameters * @return array diff --git a/src/OpenSearch/Endpoints/Cluster/GetComponentTemplate.php b/src/OpenSearch/Endpoints/Cluster/GetComponentTemplate.php index 0d4905178..2c2f79b72 100644 --- a/src/OpenSearch/Endpoints/Cluster/GetComponentTemplate.php +++ b/src/OpenSearch/Endpoints/Cluster/GetComponentTemplate.php @@ -43,6 +43,7 @@ public function getParamWhitelist(): array { return [ 'cluster_manager_timeout', + 'flat_settings', 'local', 'master_timeout', 'pretty', diff --git a/src/OpenSearch/Endpoints/Indices/Upgrade.php b/src/OpenSearch/Endpoints/Indices/Upgrade.php index 239c1e4bf..3d6ae2898 100644 --- a/src/OpenSearch/Endpoints/Indices/Upgrade.php +++ b/src/OpenSearch/Endpoints/Indices/Upgrade.php @@ -57,14 +57,4 @@ public function getMethod(): string { return 'POST'; } - - public function setBody($body): static - { - if (isset($body) !== true) { - return $this; - } - $this->body = $body; - - return $this; - } } diff --git a/src/OpenSearch/Namespaces/ClusterNamespace.php b/src/OpenSearch/Namespaces/ClusterNamespace.php index 7d763a504..2f0eb1af4 100644 --- a/src/OpenSearch/Namespaces/ClusterNamespace.php +++ b/src/OpenSearch/Namespaces/ClusterNamespace.php @@ -182,6 +182,7 @@ public function existsComponentTemplate(array $params = []): bool * * $params['name'] = (array) Name of the component template to retrieve. Wildcard (`*`) expressions are supported. * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['flat_settings'] = (boolean) If `true`, returns settings in flat format. (Default = false) * $params['local'] = (boolean) If `true`, the request retrieves information from the local node only.If `false`, information is retrieved from the cluster-manager node. (Default = false) * $params['master_timeout'] = (string) Period to wait for a connection to the cluster-manager node.If no response is received before the timeout expires, the request fails and returns an error. * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) diff --git a/src/OpenSearch/Namespaces/IndicesNamespace.php b/src/OpenSearch/Namespaces/IndicesNamespace.php index cd7b64b03..9045a3133 100644 --- a/src/OpenSearch/Namespaces/IndicesNamespace.php +++ b/src/OpenSearch/Namespaces/IndicesNamespace.php @@ -576,7 +576,7 @@ public function flush(array $params = []) * $params['expand_wildcards'] = (any) Whether to expand wildcard expression to concrete indexes that are open, closed or both. * $params['flush'] = (boolean) Specify whether the index should be flushed after performing the operation. (Default = true) * $params['ignore_unavailable'] = (boolean) Whether specified concrete indexes should be ignored when unavailable (missing or closed) - * $params['max_num_segments'] = (number) The number of larger segments into which smaller segments are merged.Set this parameter to 1 to merge all segments into one segment.The default behavior is to perform the merge as necessary. + * $params['max_num_segments'] = (integer) The number of larger segments into which smaller segments are merged.Set this parameter to 1 to merge all segments into one segment.The default behavior is to perform the merge as necessary. * $params['only_expunge_deletes'] = (boolean) Specify whether the operation should only expunge deleted documents * $params['primary_only'] = (boolean) Specify whether the operation should only perform on primary shards. Defaults to false. (Default = false) * $params['wait_for_completion'] = (boolean) Should the request wait until the force merge is completed. (Default = true) @@ -1449,12 +1449,10 @@ public function updateAliases(array $params = []) public function upgrade(array $params = []) { $index = $this->extractArgument($params, 'index'); - $body = $this->extractArgument($params, 'body'); $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Indices\Upgrade::class); $endpoint->setParams($params); $endpoint->setIndex($index); - $endpoint->setBody($body); return $this->performRequest($endpoint); }