From 782242fb4962c5dd2ca7dc03f2deb586bc829846 Mon Sep 17 00:00:00 2001 From: saimedhi Date: Mon, 8 Jul 2024 15:58:19 -0700 Subject: [PATCH] Generated Endpoints Using OpenSearch API Specifications: Phase II Signed-off-by: saimedhi --- src/OpenSearch/Client.php | 1348 +++++++++++------ src/OpenSearch/Endpoints/Bulk.php | 19 +- src/OpenSearch/Endpoints/Cat/Aliases.php | 4 +- .../Endpoints/Cat/AllPitSegments.php | 51 + src/OpenSearch/Endpoints/Cat/Allocation.php | 6 +- .../Endpoints/Cat/ClusterManager.php | 20 +- src/OpenSearch/Endpoints/Cat/Fielddata.php | 4 +- src/OpenSearch/Endpoints/Cat/Help.php | 2 - src/OpenSearch/Endpoints/Cat/Indices.php | 10 +- src/OpenSearch/Endpoints/Cat/Master.php | 17 +- src/OpenSearch/Endpoints/Cat/NodeAttrs.php | 6 +- src/OpenSearch/Endpoints/Cat/Nodes.php | 6 +- src/OpenSearch/Endpoints/Cat/PendingTasks.php | 6 +- src/OpenSearch/Endpoints/Cat/PitSegments.php | 61 + src/OpenSearch/Endpoints/Cat/Plugins.php | 6 +- src/OpenSearch/Endpoints/Cat/Recovery.php | 2 +- src/OpenSearch/Endpoints/Cat/Repositories.php | 6 +- .../Endpoints/Cat/SegmentReplication.php | 66 + src/OpenSearch/Endpoints/Cat/Segments.php | 20 +- src/OpenSearch/Endpoints/Cat/Shards.php | 6 +- src/OpenSearch/Endpoints/Cat/Snapshots.php | 6 +- src/OpenSearch/Endpoints/Cat/Tasks.php | 16 +- src/OpenSearch/Endpoints/Cat/Templates.php | 6 +- src/OpenSearch/Endpoints/Cat/ThreadPool.php | 8 +- src/OpenSearch/Endpoints/Cat/Transforms.php | 69 - src/OpenSearch/Endpoints/ClearScroll.php | 9 +- .../Endpoints/Cluster/AllocationExplain.php | 2 +- .../Cluster/DeleteComponentTemplate.php | 14 +- .../Cluster/DeleteDecommissionAwareness.php | 45 + .../Cluster/DeleteWeightedRouting.php | 45 + .../Cluster/ExistsComponentTemplate.php | 14 +- .../Cluster/GetComponentTemplate.php | 14 +- .../Cluster/GetDecommissionAwareness.php | 62 + .../Endpoints/Cluster/GetSettings.php | 4 +- .../Endpoints/Cluster/GetWeightedRouting.php | 62 + src/OpenSearch/Endpoints/Cluster/Health.php | 8 +- .../Endpoints/Cluster/PendingTasks.php | 2 +- .../Cluster/PutComponentTemplate.php | 14 +- .../Cluster/PutDecommissionAwareness.php | 74 + .../Endpoints/Cluster/PutSettings.php | 2 +- .../Endpoints/Cluster/PutWeightedRouting.php | 62 + src/OpenSearch/Endpoints/Cluster/Reroute.php | 6 +- src/OpenSearch/Endpoints/Cluster/State.php | 10 +- src/OpenSearch/Endpoints/Count.php | 16 +- src/OpenSearch/Endpoints/Create.php | 27 +- src/OpenSearch/Endpoints/CreatePit.php | 57 + .../Endpoints/CreatePointInTime.php | 56 - .../DanglingIndices/DeleteDanglingIndex.php | 14 +- .../DanglingIndices/ImportDanglingIndex.php | 14 +- .../DanglingIndices/ListDanglingIndices.php | 9 +- src/OpenSearch/Endpoints/Delete.php | 6 +- src/OpenSearch/Endpoints/DeleteAllPits.php | 45 + src/OpenSearch/Endpoints/DeleteByQuery.php | 32 +- .../Endpoints/DeleteByQueryRethrottle.php | 21 +- src/OpenSearch/Endpoints/DeletePit.php | 55 + .../Endpoints/DeletePointInTime.php | 53 - src/OpenSearch/Endpoints/DeleteScript.php | 24 +- src/OpenSearch/Endpoints/Exists.php | 8 +- src/OpenSearch/Endpoints/ExistsSource.php | 6 +- src/OpenSearch/Endpoints/Explain.php | 8 +- src/OpenSearch/Endpoints/FieldCaps.php | 4 +- src/OpenSearch/Endpoints/Get.php | 8 +- src/OpenSearch/Endpoints/GetAllPits.php | 45 + src/OpenSearch/Endpoints/GetScript.php | 23 +- src/OpenSearch/Endpoints/GetSource.php | 6 +- src/OpenSearch/Endpoints/Index.php | 10 +- src/OpenSearch/Endpoints/Indices/AddBlock.php | 20 +- .../Endpoints/Indices/ClearCache.php | 6 +- .../Endpoints/Indices/CloneIndices.php | 16 +- src/OpenSearch/Endpoints/Indices/Close.php | 18 +- src/OpenSearch/Endpoints/Indices/Create.php | 16 +- .../Endpoints/Indices/CreateDataStream.php | 20 +- .../Endpoints/Indices/DataStreamsStats.php | 12 +- src/OpenSearch/Endpoints/Indices/Delete.php | 18 +- .../Endpoints/Indices/DeleteAlias.php | 4 +- .../Endpoints/Indices/DeleteDataStream.php | 10 +- .../Endpoints/Indices/DeleteIndexTemplate.php | 14 +- .../Endpoints/Indices/DeleteTemplate.php | 14 +- src/OpenSearch/Endpoints/Indices/Exists.php | 15 +- .../Endpoints/Indices/ExistsAlias.php | 2 +- .../Endpoints/Indices/ExistsIndexTemplate.php | 14 +- .../Endpoints/Indices/ExistsTemplate.php | 14 +- src/OpenSearch/Endpoints/Indices/Flush.php | 15 +- .../Endpoints/Indices/ForceMerge.php | 6 +- src/OpenSearch/Endpoints/Indices/Freeze.php | 60 - src/OpenSearch/Endpoints/Indices/Get.php | 16 +- src/OpenSearch/Endpoints/Indices/GetAlias.php | 2 +- .../Endpoints/Indices/GetFieldMapping.php | 4 +- .../Endpoints/Indices/GetIndexTemplate.php | 14 +- .../Endpoints/Indices/GetMapping.php | 6 +- .../Endpoints/Indices/GetSettings.php | 8 +- .../Endpoints/Indices/GetTemplate.php | 4 +- .../Endpoints/Indices/GetUpgrade.php | 2 +- src/OpenSearch/Endpoints/Indices/Open.php | 20 +- src/OpenSearch/Endpoints/Indices/PutAlias.php | 4 +- .../Endpoints/Indices/PutIndexTemplate.php | 14 +- .../Endpoints/Indices/PutMapping.php | 17 +- .../Endpoints/Indices/PutSettings.php | 10 +- .../Endpoints/Indices/PutTemplate.php | 14 +- src/OpenSearch/Endpoints/Indices/Recovery.php | 2 +- src/OpenSearch/Endpoints/Indices/Refresh.php | 13 +- .../Indices/ReloadSearchAnalyzers.php | 52 - .../Endpoints/Indices/ResolveIndex.php | 11 +- src/OpenSearch/Endpoints/Indices/Rollover.php | 4 +- src/OpenSearch/Endpoints/Indices/Segments.php | 2 +- .../Endpoints/Indices/ShardStores.php | 4 +- src/OpenSearch/Endpoints/Indices/Shrink.php | 16 +- .../Indices/SimulateIndexTemplate.php | 14 +- .../Endpoints/Indices/SimulateTemplate.php | 4 +- src/OpenSearch/Endpoints/Indices/Split.php | 16 +- src/OpenSearch/Endpoints/Indices/Stats.php | 16 +- src/OpenSearch/Endpoints/Indices/Unfreeze.php | 60 - .../Endpoints/Indices/UpdateAliases.php | 4 +- src/OpenSearch/Endpoints/Indices/Upgrade.php | 2 +- .../Endpoints/Indices/ValidateQuery.php | 12 +- .../Endpoints/Ingest/DeletePipeline.php | 12 +- .../Endpoints/Ingest/GetPipeline.php | 2 +- .../Endpoints/Ingest/PutPipeline.php | 12 +- src/OpenSearch/Endpoints/Knn/DeleteModel.php | 62 + src/OpenSearch/Endpoints/Knn/GetModel.php | 62 + src/OpenSearch/Endpoints/Knn/SearchModels.php | 97 ++ src/OpenSearch/Endpoints/Knn/Stats.php | 86 ++ src/OpenSearch/Endpoints/Knn/TrainModel.php | 72 + src/OpenSearch/Endpoints/Knn/Warmup.php | 52 + src/OpenSearch/Endpoints/MTermVectors.php | 8 +- src/OpenSearch/Endpoints/Mget.php | 8 +- src/OpenSearch/Endpoints/Msearch.php | 16 +- src/OpenSearch/Endpoints/MsearchTemplate.php | 14 +- src/OpenSearch/Endpoints/Nodes/HotThreads.php | 13 +- src/OpenSearch/Endpoints/Nodes/Stats.php | 4 +- .../Endpoints/Notifications/CreateConfig.php | 55 + .../Endpoints/Notifications/DeleteConfig.php | 62 + .../Endpoints/Notifications/DeleteConfigs.php | 47 + .../Endpoints/Notifications/GetConfig.php | 62 + .../Endpoints/Notifications/GetConfigs.php | 93 ++ .../Endpoints/Notifications/ListChannels.php | 45 + .../Endpoints/Notifications/ListFeatures.php | 45 + .../Endpoints/Notifications/SendTest.php | 62 + .../Endpoints/Notifications/UpdateConfig.php | 72 + src/OpenSearch/Endpoints/PutScript.php | 15 +- src/OpenSearch/Endpoints/RankEval.php | 2 +- src/OpenSearch/Endpoints/Reindex.php | 8 +- .../Endpoints/ReindexRethrottle.php | 21 +- .../Endpoints/RemoteStore/Restore.php | 57 + src/OpenSearch/Endpoints/Rollups/Delete.php | 52 + src/OpenSearch/Endpoints/Rollups/Explain.php | 52 + src/OpenSearch/Endpoints/Rollups/Get.php | 52 + src/OpenSearch/Endpoints/Rollups/Put.php | 64 + src/OpenSearch/Endpoints/Rollups/Start.php | 52 + src/OpenSearch/Endpoints/Rollups/Stop.php | 52 + src/OpenSearch/Endpoints/Scroll.php | 2 +- src/OpenSearch/Endpoints/Search.php | 40 +- .../Endpoints/SearchPipeline/Delete.php | 52 + .../Endpoints/SearchPipeline/Get.php | 50 + .../Endpoints/SearchPipeline/Put.php | 62 + src/OpenSearch/Endpoints/SearchShards.php | 8 +- src/OpenSearch/Endpoints/SearchTemplate.php | 12 +- .../Endpoints/Snapshot/CleanupRepository.php | 12 +- .../Endpoints/Snapshot/CloneSnapshot.php | 13 +- src/OpenSearch/Endpoints/Snapshot/Create.php | 12 +- .../Endpoints/Snapshot/CreateRepository.php | 12 +- src/OpenSearch/Endpoints/Snapshot/Delete.php | 13 +- .../Endpoints/Snapshot/DeleteRepository.php | 12 +- src/OpenSearch/Endpoints/Snapshot/Get.php | 14 +- .../Endpoints/Snapshot/GetRepository.php | 14 +- src/OpenSearch/Endpoints/Snapshot/Restore.php | 12 +- src/OpenSearch/Endpoints/Snapshot/Status.php | 14 +- .../Endpoints/Snapshot/VerifyRepository.php | 12 +- src/OpenSearch/Endpoints/Tasks/Cancel.php | 2 +- src/OpenSearch/Endpoints/Tasks/Get.php | 11 +- src/OpenSearch/Endpoints/Tasks/ListTasks.php | 6 +- src/OpenSearch/Endpoints/TermVectors.php | 6 +- .../Endpoints/Transforms/Delete.php | 50 + .../Endpoints/Transforms/Explain.php | 50 + src/OpenSearch/Endpoints/Transforms/Get.php | 50 + .../Endpoints/Transforms/Preview.php | 45 + src/OpenSearch/Endpoints/Transforms/Put.php | 62 + .../Endpoints/Transforms/Search.php | 50 + src/OpenSearch/Endpoints/Transforms/Start.php | 50 + src/OpenSearch/Endpoints/Transforms/Stop.php | 50 + src/OpenSearch/Endpoints/Update.php | 8 +- src/OpenSearch/Endpoints/UpdateByQuery.php | 41 +- .../Endpoints/UpdateByQueryRethrottle.php | 21 +- src/OpenSearch/Namespaces/CatNamespace.php | 739 +++++---- .../Namespaces/ClusterNamespace.php | 390 ++++- .../Namespaces/DanglingIndicesNamespace.php | 40 +- .../Namespaces/IndicesNamespace.php | 1125 ++++++++------ src/OpenSearch/Namespaces/IngestNamespace.php | 63 +- src/OpenSearch/Namespaces/KnnNamespace.php | 219 +++ src/OpenSearch/Namespaces/NodesNamespace.php | 96 +- .../Namespaces/NotificationsNamespace.php | 271 ++++ .../Namespaces/RemoteStoreNamespace.php | 53 + .../Namespaces/RollupsNamespace.php | 175 +++ .../Namespaces/SearchPipelineNamespace.php | 106 ++ .../Namespaces/SnapshotNamespace.php | 177 ++- src/OpenSearch/Namespaces/TasksNamespace.php | 52 +- .../Namespaces/TransformsNamespace.php | 220 +++ ...ePointInTimeTest.php => CreatePitTest.php} | 10 +- tests/Endpoints/CreateTest.php | 27 +- ...ePointInTimeTest.php => DeletePitTest.php} | 8 +- util/ClientEndpoint.php | 8 +- util/EndpointProxies/createProxy.php | 42 + .../indices/refreshSearchAnalyzersProxy.php | 22 + util/GenerateEndpoints.php | 2 +- util/template/client-class | 2 +- 205 files changed, 7444 insertions(+), 2189 deletions(-) create mode 100644 src/OpenSearch/Endpoints/Cat/AllPitSegments.php create mode 100644 src/OpenSearch/Endpoints/Cat/PitSegments.php create mode 100644 src/OpenSearch/Endpoints/Cat/SegmentReplication.php delete mode 100644 src/OpenSearch/Endpoints/Cat/Transforms.php create mode 100644 src/OpenSearch/Endpoints/Cluster/DeleteDecommissionAwareness.php create mode 100644 src/OpenSearch/Endpoints/Cluster/DeleteWeightedRouting.php create mode 100644 src/OpenSearch/Endpoints/Cluster/GetDecommissionAwareness.php create mode 100644 src/OpenSearch/Endpoints/Cluster/GetWeightedRouting.php create mode 100644 src/OpenSearch/Endpoints/Cluster/PutDecommissionAwareness.php create mode 100644 src/OpenSearch/Endpoints/Cluster/PutWeightedRouting.php create mode 100644 src/OpenSearch/Endpoints/CreatePit.php delete mode 100644 src/OpenSearch/Endpoints/CreatePointInTime.php create mode 100644 src/OpenSearch/Endpoints/DeleteAllPits.php create mode 100644 src/OpenSearch/Endpoints/DeletePit.php delete mode 100644 src/OpenSearch/Endpoints/DeletePointInTime.php create mode 100644 src/OpenSearch/Endpoints/GetAllPits.php delete mode 100644 src/OpenSearch/Endpoints/Indices/Freeze.php delete mode 100644 src/OpenSearch/Endpoints/Indices/ReloadSearchAnalyzers.php delete mode 100644 src/OpenSearch/Endpoints/Indices/Unfreeze.php create mode 100644 src/OpenSearch/Endpoints/Knn/DeleteModel.php create mode 100644 src/OpenSearch/Endpoints/Knn/GetModel.php create mode 100644 src/OpenSearch/Endpoints/Knn/SearchModels.php create mode 100644 src/OpenSearch/Endpoints/Knn/Stats.php create mode 100644 src/OpenSearch/Endpoints/Knn/TrainModel.php create mode 100644 src/OpenSearch/Endpoints/Knn/Warmup.php create mode 100644 src/OpenSearch/Endpoints/Notifications/CreateConfig.php create mode 100644 src/OpenSearch/Endpoints/Notifications/DeleteConfig.php create mode 100644 src/OpenSearch/Endpoints/Notifications/DeleteConfigs.php create mode 100644 src/OpenSearch/Endpoints/Notifications/GetConfig.php create mode 100644 src/OpenSearch/Endpoints/Notifications/GetConfigs.php create mode 100644 src/OpenSearch/Endpoints/Notifications/ListChannels.php create mode 100644 src/OpenSearch/Endpoints/Notifications/ListFeatures.php create mode 100644 src/OpenSearch/Endpoints/Notifications/SendTest.php create mode 100644 src/OpenSearch/Endpoints/Notifications/UpdateConfig.php create mode 100644 src/OpenSearch/Endpoints/RemoteStore/Restore.php create mode 100644 src/OpenSearch/Endpoints/Rollups/Delete.php create mode 100644 src/OpenSearch/Endpoints/Rollups/Explain.php create mode 100644 src/OpenSearch/Endpoints/Rollups/Get.php create mode 100644 src/OpenSearch/Endpoints/Rollups/Put.php create mode 100644 src/OpenSearch/Endpoints/Rollups/Start.php create mode 100644 src/OpenSearch/Endpoints/Rollups/Stop.php create mode 100644 src/OpenSearch/Endpoints/SearchPipeline/Delete.php create mode 100644 src/OpenSearch/Endpoints/SearchPipeline/Get.php create mode 100644 src/OpenSearch/Endpoints/SearchPipeline/Put.php create mode 100644 src/OpenSearch/Endpoints/Transforms/Delete.php create mode 100644 src/OpenSearch/Endpoints/Transforms/Explain.php create mode 100644 src/OpenSearch/Endpoints/Transforms/Get.php create mode 100644 src/OpenSearch/Endpoints/Transforms/Preview.php create mode 100644 src/OpenSearch/Endpoints/Transforms/Put.php create mode 100644 src/OpenSearch/Endpoints/Transforms/Search.php create mode 100644 src/OpenSearch/Endpoints/Transforms/Start.php create mode 100644 src/OpenSearch/Endpoints/Transforms/Stop.php create mode 100644 src/OpenSearch/Namespaces/KnnNamespace.php create mode 100644 src/OpenSearch/Namespaces/NotificationsNamespace.php create mode 100644 src/OpenSearch/Namespaces/RemoteStoreNamespace.php create mode 100644 src/OpenSearch/Namespaces/RollupsNamespace.php create mode 100644 src/OpenSearch/Namespaces/SearchPipelineNamespace.php create mode 100644 src/OpenSearch/Namespaces/TransformsNamespace.php rename tests/Endpoints/{CreatePointInTimeTest.php => CreatePitTest.php} (90%) rename tests/Endpoints/{DeletePointInTimeTest.php => DeletePitTest.php} (92%) create mode 100644 util/EndpointProxies/createProxy.php create mode 100644 util/EndpointProxies/indices/refreshSearchAnalyzersProxy.php diff --git a/src/OpenSearch/Client.php b/src/OpenSearch/Client.php index 4b5e0295..1db3a7f1 100644 --- a/src/OpenSearch/Client.php +++ b/src/OpenSearch/Client.php @@ -24,34 +24,38 @@ use OpenSearch\Common\Exceptions\BadMethodCallException; use OpenSearch\Common\Exceptions\NoNodesAvailableException; use OpenSearch\Endpoints\AbstractEndpoint; -use OpenSearch\Namespaces\AsyncSearchNamespace; +use OpenSearch\Namespaces\NamespaceBuilderInterface; use OpenSearch\Namespaces\BooleanRequestWrapper; +use OpenSearch\Namespaces\AsyncSearchNamespace; use OpenSearch\Namespaces\CatNamespace; use OpenSearch\Namespaces\ClusterNamespace; use OpenSearch\Namespaces\DanglingIndicesNamespace; use OpenSearch\Namespaces\DataFrameTransformDeprecatedNamespace; use OpenSearch\Namespaces\IndicesNamespace; use OpenSearch\Namespaces\IngestNamespace; +use OpenSearch\Namespaces\KnnNamespace; use OpenSearch\Namespaces\MachineLearningNamespace; use OpenSearch\Namespaces\MonitoringNamespace; -use OpenSearch\Namespaces\NamespaceBuilderInterface; use OpenSearch\Namespaces\NodesNamespace; +use OpenSearch\Namespaces\NotificationsNamespace; +use OpenSearch\Namespaces\RemoteStoreNamespace; +use OpenSearch\Namespaces\RollupsNamespace; +use OpenSearch\Namespaces\SearchPipelineNamespace; use OpenSearch\Namespaces\SearchableSnapshotsNamespace; use OpenSearch\Namespaces\SecurityNamespace; use OpenSearch\Namespaces\SnapshotNamespace; use OpenSearch\Namespaces\SqlNamespace; use OpenSearch\Namespaces\SslNamespace; use OpenSearch\Namespaces\TasksNamespace; +use OpenSearch\Namespaces\TransformsNamespace; /** * Class Client * + * NOTE: This file is autogenerated using util/GenerateEndpoints.php */ class Client { - /** - * @deprecated since version is pulled from InstalledVersions::getVersion('opensearch-project/opensearch-php') - */ public const VERSION = '2.3.1'; /** @@ -74,6 +78,11 @@ class Client */ protected $registeredNamespaces = []; + /** + * @var AsyncSearchNamespace + */ + protected $asyncSearch; + /** * @var CatNamespace */ @@ -89,6 +98,11 @@ class Client */ protected $danglingIndices; + /** + * @var DataFrameTransformDeprecatedNamespace + */ + protected $dataFrameTransformDeprecated; + /** * @var IndicesNamespace */ @@ -100,34 +114,39 @@ class Client protected $ingest; /** - * @var NodesNamespace + * @var KnnNamespace */ - protected $nodes; + protected $knn; /** - * @var SnapshotNamespace + * @var MonitoringNamespace */ - protected $snapshot; + protected $monitoring; /** - * @var TasksNamespace + * @var NodesNamespace */ - protected $tasks; + protected $nodes; /** - * @var AsyncSearchNamespace + * @var NotificationsNamespace */ - protected $asyncSearch; + protected $notifications; /** - * @var DataFrameTransformDeprecatedNamespace + * @var RemoteStoreNamespace */ - protected $dataFrameTransformDeprecated; + protected $remoteStore; /** - * @var MonitoringNamespace + * @var RollupsNamespace */ - protected $monitoring; + protected $rollups; + + /** + * @var SearchPipelineNamespace + */ + protected $searchPipeline; /** * @var SearchableSnapshotsNamespace @@ -140,15 +159,30 @@ class Client protected $security; /** - * @var SslNamespace + * @var SnapshotNamespace */ - protected $ssl; + protected $snapshot; /** * @var SqlNamespace */ protected $sql; + /** + * @var SslNamespace + */ + protected $ssl; + + /** + * @var TasksNamespace + */ + protected $tasks; + + /** + * @var TransformsNamespace + */ + protected $transforms; + /** * @var MachineLearningNamespace */ @@ -165,37 +199,50 @@ public function __construct(Transport $transport, callable $endpoint, array $reg { $this->transport = $transport; $this->endpoints = $endpoint; + $this->asyncSearch = new AsyncSearchNamespace($transport, $endpoint); $this->cat = new CatNamespace($transport, $endpoint); $this->cluster = new ClusterNamespace($transport, $endpoint); $this->danglingIndices = new DanglingIndicesNamespace($transport, $endpoint); + $this->dataFrameTransformDeprecated = new DataFrameTransformDeprecatedNamespace($transport, $endpoint); $this->indices = new IndicesNamespace($transport, $endpoint); $this->ingest = new IngestNamespace($transport, $endpoint); - $this->nodes = new NodesNamespace($transport, $endpoint); - $this->snapshot = new SnapshotNamespace($transport, $endpoint); - $this->tasks = new TasksNamespace($transport, $endpoint); - $this->asyncSearch = new AsyncSearchNamespace($transport, $endpoint); - $this->dataFrameTransformDeprecated = new DataFrameTransformDeprecatedNamespace($transport, $endpoint); + $this->knn = new KnnNamespace($transport, $endpoint); $this->monitoring = new MonitoringNamespace($transport, $endpoint); + $this->nodes = new NodesNamespace($transport, $endpoint); + $this->notifications = new NotificationsNamespace($transport, $endpoint); + $this->remoteStore = new RemoteStoreNamespace($transport, $endpoint); + $this->rollups = new RollupsNamespace($transport, $endpoint); + $this->searchPipeline = new SearchPipelineNamespace($transport, $endpoint); $this->searchableSnapshots = new SearchableSnapshotsNamespace($transport, $endpoint); $this->security = new SecurityNamespace($transport, $endpoint); - $this->ssl = new SslNamespace($transport, $endpoint); + $this->snapshot = new SnapshotNamespace($transport, $endpoint); $this->sql = new SqlNamespace($transport, $endpoint); + $this->ssl = new SslNamespace($transport, $endpoint); $this->ml = new MachineLearningNamespace($transport, $endpoint); + $this->tasks = new TasksNamespace($transport, $endpoint); + $this->transforms = new TransformsNamespace($transport, $endpoint); $this->registeredNamespaces = $registeredNamespaces; } /** - * $params['index'] = (string) Default index for items which don't provide one - * $params['wait_for_active_shards'] = (string) Sets the number of shard copies that must be active before proceeding with the bulk operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * $params['refresh'] = (enum) If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. (Options = true,false,wait_for) - * $params['routing'] = (string) Specific routing value - * $params['timeout'] = (time) Explicit operation timeout - * $params['_source'] = (list) True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-request - * $params['_source_excludes'] = (list) Default list of fields to exclude from the returned _source field, can be overridden on each sub-request - * $params['_source_includes'] = (list) Default list of fields to extract and return from the _source field, can be overridden on each sub-request - * $params['pipeline'] = (string) The pipeline id to preprocess incoming documents with - * $params['require_alias'] = (boolean) Sets require_alias for all incoming documents. Defaults to unset (false) + * Allows to perform multiple index/update/delete operations in a single request. + * + * $params['index'] = (string) Name of the data stream, index, or index alias to perform bulk actions on. + * $params['_source'] = (any) `true` or `false` to return the `_source` field or not, or a list of fields to return. + * $params['_source_excludes'] = (any) A comma-separated list of source fields to exclude from the response. + * $params['_source_includes'] = (any) A comma-separated list of source fields to include in the response. + * $params['pipeline'] = (string) ID of the pipeline to use to preprocess incoming documents.If the index has a default ingest pipeline specified, then setting the value to `_none` disables the default ingest pipeline for this request.If a final pipeline is configured it will always run, regardless of the value of this parameter. + * $params['refresh'] = (enum) If `true`, OpenSearch refreshes the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` do nothing with refreshes.Valid values: `true`, `false`, `wait_for`. (Options = true,false,wait_for) + * $params['require_alias'] = (boolean) If `true`, the request’s actions must target an index alias. (Default = false) + * $params['routing'] = (string) Custom value used to route operations to a specific shard. + * $params['timeout'] = (string) Period each action waits for the following operations: automatic index creation, dynamic mapping updates, waiting for active shards. + * $params['wait_for_active_shards'] = (any) The number of shard copies that must be active before proceeding with the operation.Set to all or any positive integer up to the total number of shards in the index (`number_of_replicas+1`). + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * $params['body'] = (array) The operation definition and data (action-data pairs), separated by newlines (Required) * * @param array $params Associative array of parameters @@ -215,8 +262,15 @@ public function bulk(array $params = []) return $this->performRequest($endpoint); } /** - * $params['scroll_id'] = DEPRECATED (list) A comma-separated list of scroll IDs to clear - * $params['body'] = (array) A comma-separated list of scroll IDs to clear if none was specified via the scroll_id parameter + * Explicitly clears the search context for a scroll. + * + * $params['scroll_id'] = DEPRECATED (array) Comma-separated list of scroll IDs to clear. To clear all scroll IDs, use `_all`. + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * $params['body'] = (array) Comma-separated list of scroll IDs to clear if none was specified via the scroll_id parameter * * @param array $params Associative array of parameters * @return array @@ -235,22 +289,29 @@ public function clearScroll(array $params = []) return $this->performRequest($endpoint); } /** - * $params['index'] = (list) A comma-separated list of indices to restrict the results - * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed) - * $params['ignore_throttled'] = (boolean) Whether specified concrete, expanded or aliased indices should be ignored when throttled - * $params['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) - * $params['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both. (Options = open,closed,hidden,none,all) (Default = open) - * $params['min_score'] = (number) Include only documents with a specific `_score` value in the result - * $params['preference'] = (string) Specify the node or shard the operation should be performed on (default: random) - * $params['routing'] = (list) A comma-separated list of specific routing values - * $params['q'] = (string) Query in the Lucene query string syntax - * $params['analyzer'] = (string) The analyzer to use for the query string - * $params['analyze_wildcard'] = (boolean) Specify whether wildcard and prefix queries should be analyzed (default: false) - * $params['default_operator'] = (enum) The default operator for query string query (AND or OR) (Options = AND,OR) (Default = OR) - * $params['df'] = (string) The field to use as default where no field prefix is given in the query string - * $params['lenient'] = (boolean) Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * $params['terminate_after'] = (number) The maximum count for each shard, upon reaching which the query execution will terminate early - * $params['body'] = (array) A query to restrict the results specified with the Query DSL (optional) + * Returns number of documents matching a query. + * + * $params['index'] = (array) Comma-separated list of data streams, indices, and aliases to search. Supports wildcards (`*`). To search all data streams and indices, omit this parameter or use `*` or `_all`. + * $params['allow_no_indices'] = (boolean) If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.This behavior applies even if the request targets other open indices. + * $params['analyze_wildcard'] = (boolean) If `true`, wildcard and prefix queries are analyzed.This parameter can only be used when the `q` query string parameter is specified. (Default = false) + * $params['analyzer'] = (string) Analyzer to use for the query string.This parameter can only be used when the `q` query string parameter is specified. + * $params['default_operator'] = (enum) The default operator for query string query: `AND` or `OR`.This parameter can only be used when the `q` query string parameter is specified. (Options = and,or) + * $params['df'] = (string) Field to use as default where no field prefix is given in the query string.This parameter can only be used when the `q` query string parameter is specified. + * $params['expand_wildcards'] = (any) Type of index that wildcard patterns can match.If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.Supports comma-separated values, such as `open,hidden`. + * $params['ignore_throttled'] = (boolean) If `true`, concrete, expanded or aliased indices are ignored when frozen. + * $params['ignore_unavailable'] = (boolean) If `false`, the request returns an error if it targets a missing or closed index. + * $params['lenient'] = (boolean) If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored. + * $params['min_score'] = (number) Sets the minimum `_score` value that documents must have to be included in the result. + * $params['preference'] = (string) Specifies the node or shard the operation should be performed on.Random by default. (Default = random) + * $params['q'] = (string) Query in the Lucene query string syntax. + * $params['routing'] = (string) Custom value used to route operations to a specific shard. + * $params['terminate_after'] = (number) Maximum number of documents to collect for each shard.If a query reaches this limit, OpenSearch terminates the query early.OpenSearch collects documents before sorting. + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * $params['body'] = (array) Query to restrict the results specified with the Query DSL (optional) * * @param array $params Associative array of parameters * @return array @@ -269,46 +330,52 @@ public function count(array $params = []) return $this->performRequest($endpoint); } /** - * $params['id'] = (string) Document ID (Required) - * $params['index'] = (string) The name of the index (Required) - * $params['wait_for_active_shards'] = (string) Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * $params['refresh'] = (enum) If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. (Options = true,false,wait_for) - * $params['routing'] = (string) Specific routing value - * $params['timeout'] = (time) Explicit operation timeout - * $params['version'] = (number) Explicit version number for concurrency control - * $params['version_type'] = (enum) Specific version type (Options = internal,external,external_gte) - * $params['pipeline'] = (string) The pipeline id to preprocess incoming documents with - * $params['body'] = (array) The document (Required) + * Creates point in time context. + * + * $params['index'] = (array) Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices. (Required) + * $params['allow_partial_pit_creation'] = (boolean) Allow if point in time can be created with partial failures. + * $params['expand_wildcards'] = (any) Whether to expand wildcard expression to concrete indices that are open, closed or both. + * $params['keep_alive'] = (string) Specify the keep alive for point in time. + * $params['preference'] = (string) Specify the node or shard the operation should be performed on. (Default = random) + * $params['routing'] = (array) Comma-separated list of specific routing values. + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array */ - public function create(array $params = []) + public function createPit(array $params = []) { - $id = $this->extractArgument($params, 'id'); $index = $this->extractArgument($params, 'index'); - $body = $this->extractArgument($params, 'body'); $endpointBuilder = $this->endpoints; - $endpoint = $endpointBuilder('Create'); + $endpoint = $endpointBuilder('CreatePit'); $endpoint->setParams($params); - $endpoint->setId($id); $endpoint->setIndex($index); - $endpoint->setBody($body); return $this->performRequest($endpoint); } /** - * $params['id'] = (string) The document ID (Required) - * $params['index'] = (string) The name of the index (Required) - * $params['wait_for_active_shards'] = (string) Sets the number of shard copies that must be active before proceeding with the delete operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * $params['refresh'] = (enum) If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. (Options = true,false,wait_for) - * $params['routing'] = (string) Specific routing value - * $params['timeout'] = (time) Explicit operation timeout - * $params['if_seq_no'] = (number) only perform the delete operation if the last operation that has changed the document has the specified sequence number - * $params['if_primary_term'] = (number) only perform the delete operation if the last operation that has changed the document has the specified primary term - * $params['version'] = (number) Explicit version number for concurrency control - * $params['version_type'] = (enum) Specific version type (Options = internal,external,external_gte,force) + * Removes a document from the index. + * + * $params['id'] = (string) Unique identifier for the document. (Required) + * $params['index'] = (string) Name of the target index. (Required) + * $params['if_primary_term'] = (number) Only perform the operation if the document has this primary term. + * $params['if_seq_no'] = (number) Only perform the operation if the document has this sequence number. + * $params['refresh'] = (enum) If `true`, OpenSearch refreshes the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` do nothing with refreshes.Valid values: `true`, `false`, `wait_for`. (Options = true,false,wait_for) + * $params['routing'] = (string) Custom value used to route operations to a specific shard. + * $params['timeout'] = (string) Period to wait for active shards. + * $params['version'] = (number) Explicit version number for concurrency control.The specified version must match the current version of the document for the request to succeed. + * $params['version_type'] = (enum) Specific version type: `external`, `external_gte`. (Options = internal,external,external_gte,force) + * $params['wait_for_active_shards'] = (any) The number of shard copies that must be active before proceeding with the operation.Set to `all` or any positive integer up to the total number of shards in the index (`number_of_replicas+1`). + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -327,40 +394,67 @@ public function delete(array $params = []) return $this->performRequest($endpoint); } /** - * $params['index'] = (list) A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices (Required) - * $params['analyzer'] = (string) The analyzer to use for the query string - * $params['analyze_wildcard'] = (boolean) Specify whether wildcard and prefix queries should be analyzed (default: false) - * $params['default_operator'] = (enum) The default operator for query string query (AND or OR) (Options = AND,OR) (Default = OR) - * $params['df'] = (string) The field to use as default where no field prefix is given in the query string - * $params['from'] = (number) Starting offset (default: 0) - * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed) - * $params['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) - * $params['conflicts'] = (enum) What to do when the delete by query hits version conflicts? (Options = abort,proceed) (Default = abort) - * $params['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both. (Options = open,closed,hidden,none,all) (Default = open) - * $params['lenient'] = (boolean) Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * $params['preference'] = (string) Specify the node or shard the operation should be performed on (default: random) - * $params['q'] = (string) Query in the Lucene query string syntax - * $params['routing'] = (list) A comma-separated list of specific routing values - * $params['scroll'] = (time) Specify how long a consistent view of the index should be maintained for scrolled search - * $params['search_type'] = (enum) Search operation type (Options = query_then_fetch,dfs_query_then_fetch) - * $params['search_timeout'] = (time) Explicit timeout for each search request. Defaults to no timeout. - * $params['size'] = (number) Deprecated, please use `max_docs` instead - * $params['max_docs'] = (number) Maximum number of documents to process (default: all documents) - * $params['sort'] = (list) A comma-separated list of : pairs - * $params['_source'] = (list) True or false to return the _source field or not, or a list of fields to return - * $params['_source_excludes'] = (list) A list of fields to exclude from the returned _source field - * $params['_source_includes'] = (list) A list of fields to extract and return from the _source field - * $params['terminate_after'] = (number) The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - * $params['stats'] = (list) Specific 'tag' of the request for logging and statistical purposes - * $params['version'] = (boolean) Specify whether to return document version as part of a hit - * $params['request_cache'] = (boolean) Specify if request cache should be used for this request or not, defaults to index level setting - * $params['refresh'] = (boolean) Should the effected indexes be refreshed? - * $params['timeout'] = (time) Time each individual bulk request should wait for shards that are unavailable. (Default = 1m) - * $params['wait_for_active_shards'] = (string) Sets the number of shard copies that must be active before proceeding with the delete by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * $params['scroll_size'] = (number) Size on the scroll request powering the delete by query (Default = 100) - * $params['wait_for_completion'] = (boolean) Should the request should block until the delete by query is complete. (Default = true) - * $params['requests_per_second'] = (number) The throttle for this request in sub-requests per second. -1 means no throttle. (Default = 0) - * $params['slices'] = (number|string) The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be set to `auto`. (Default = 1) + * Deletes all active point in time searches. + * + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * + * @param array $params Associative array of parameters + * @return array + */ + public function deleteAllPits(array $params = []) + { + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('DeleteAllPits'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * Deletes documents matching the provided query. + * + * $params['index'] = (array) Comma-separated list of data streams, indices, and aliases to search. Supports wildcards (`*`). To search all data streams or indices, omit this parameter or use `*` or `_all`. (Required) + * $params['_source'] = (array) True or false to return the _source field or not, or a list of fields to return. + * $params['_source_excludes'] = (array) List of fields to exclude from the returned _source field. + * $params['_source_includes'] = (array) List of fields to extract and return from the _source field. + * $params['allow_no_indices'] = (boolean) If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.This behavior applies even if the request targets other open indices.For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`. + * $params['analyze_wildcard'] = (boolean) If `true`, wildcard and prefix queries are analyzed. (Default = false) + * $params['analyzer'] = (string) Analyzer to use for the query string. + * $params['conflicts'] = (enum) What to do if delete by query hits version conflicts: `abort` or `proceed`. (Options = abort,proceed) + * $params['default_operator'] = (enum) The default operator for query string query: `AND` or `OR`. (Options = and,or) + * $params['df'] = (string) Field to use as default where no field prefix is given in the query string. + * $params['expand_wildcards'] = (any) Type of index that wildcard patterns can match.If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.Supports comma-separated values, such as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`. + * $params['from'] = (number) Starting offset. (Default = 0) + * $params['ignore_unavailable'] = (boolean) If `false`, the request returns an error if it targets a missing or closed index. + * $params['lenient'] = (boolean) If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored. + * $params['max_docs'] = (number) Maximum number of documents to process.Defaults to all documents. + * $params['preference'] = (string) Specifies the node or shard the operation should be performed on.Random by default. (Default = random) + * $params['q'] = (string) Query in the Lucene query string syntax. + * $params['refresh'] = (boolean) If `true`, OpenSearch refreshes all shards involved in the delete by query after the request completes. + * $params['request_cache'] = (boolean) If `true`, the request cache is used for this request.Defaults to the index-level setting. + * $params['requests_per_second'] = (number) The throttle for this request in sub-requests per second. (Default = 0) + * $params['routing'] = (string) Custom value used to route operations to a specific shard. + * $params['scroll'] = (string) Period to retain the search context for scrolling. + * $params['scroll_size'] = (number) Size of the scroll request that powers the operation. (Default = 100) + * $params['search_timeout'] = (string) Explicit timeout for each search request.Defaults to no timeout. + * $params['search_type'] = (enum) The type of the search operation.Available options: `query_then_fetch`, `dfs_query_then_fetch`. (Options = query_then_fetch,dfs_query_then_fetch) + * $params['size'] = (integer) Deprecated, please use `max_docs` instead. + * $params['slices'] = (any) The number of slices this task should be divided into. + * $params['sort'] = (array) A comma-separated list of : pairs. + * $params['stats'] = (array) Specific `tag` of the request for logging and statistical purposes. + * $params['terminate_after'] = (number) Maximum number of documents to collect for each shard.If a query reaches this limit, OpenSearch terminates the query early.OpenSearch collects documents before sorting.Use with caution.OpenSearch applies this parameter to each shard handling the request.When possible, let OpenSearch perform early termination automatically.Avoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers. + * $params['timeout'] = (string) Period each deletion request waits for active shards. + * $params['version'] = (boolean) If `true`, returns the document version as part of a hit. + * $params['wait_for_active_shards'] = (any) The number of shard copies that must be active before proceeding with the operation.Set to all or any positive integer up to the total number of shards in the index (`number_of_replicas+1`). + * $params['wait_for_completion'] = (boolean) If `true`, the request blocks until the operation is complete. (Default = true) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * $params['body'] = (array) The search definition using the Query DSL (Required) * * @param array $params Associative array of parameters @@ -380,8 +474,15 @@ public function deleteByQuery(array $params = []) return $this->performRequest($endpoint); } /** - * $params['task_id'] = (string) The task id to rethrottle - * $params['requests_per_second'] = (number) The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. (Required) + * Changes the number of requests per second for a particular Delete By Query operation. + * + * $params['task_id'] = (number) The ID for the task. (Required) + * $params['requests_per_second'] = (number) The throttle for this request in sub-requests per second. + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -398,9 +499,41 @@ public function deleteByQueryRethrottle(array $params = []) return $this->performRequest($endpoint); } /** - * $params['id'] = (string) Script ID - * $params['timeout'] = (time) Explicit operation timeout - * $params['cluster_manager_timeout'] = (time) Specify timeout for connection to cluster_manager + * Deletes one or more point in time searches based on the IDs passed. + * + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * $params['body'] = (array) The point-in-time ids to be deleted + * + * @param array $params Associative array of parameters + * @return array + */ + public function deletePit(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('DeletePit'); + $endpoint->setParams($params); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * Deletes a script. + * + * $params['id'] = (string) Identifier for the stored script or search template. (Required) + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['master_timeout'] = (string) Period to wait for a connection to the master node.If no response is received before the timeout expires, the request fails and returns an error. + * $params['timeout'] = (string) Period to wait for a response.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. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -417,18 +550,25 @@ public function deleteScript(array $params = []) return $this->performRequest($endpoint); } /** - * $params['id'] = (string) The document ID (Required) - * $params['index'] = (string) The name of the index (Required) - * $params['stored_fields'] = (list) A comma-separated list of stored fields to return in the response - * $params['preference'] = (string) Specify the node or shard the operation should be performed on (default: random) - * $params['realtime'] = (boolean) Specify whether to perform the operation in realtime or search mode - * $params['refresh'] = (boolean) Refresh the shard containing the document before performing the operation - * $params['routing'] = (string) Specific routing value - * $params['_source'] = (list) True or false to return the _source field or not, or a list of fields to return - * $params['_source_excludes'] = (list) A list of fields to exclude from the returned _source field - * $params['_source_includes'] = (list) A list of fields to extract and return from the _source field - * $params['version'] = (number) Explicit version number for concurrency control - * $params['version_type'] = (enum) Specific version type (Options = internal,external,external_gte,force) + * Returns information about whether a document exists in an index. + * + * $params['id'] = (string) Identifier of the document. (Required) + * $params['index'] = (string) Comma-separated list of data streams, indices, and aliases. Supports wildcards (`*`). (Required) + * $params['_source'] = (any) `true` or `false` to return the `_source` field or not, or a list of fields to return. + * $params['_source_excludes'] = (any) A comma-separated list of source fields to exclude in the response. + * $params['_source_includes'] = (any) A comma-separated list of source fields to include in the response. + * $params['preference'] = (string) Specifies the node or shard the operation should be performed on.Random by default. (Default = random) + * $params['realtime'] = (boolean) If `true`, the request is real-time as opposed to near-real-time. + * $params['refresh'] = (boolean) If `true`, OpenSearch refreshes all shards involved in the delete by query after the request completes. + * $params['routing'] = (string) Target the specified primary shard. + * $params['stored_fields'] = (any) List of stored fields to return as part of a hit.If no fields are specified, no stored fields are included in the response.If this field is specified, the `_source` parameter defaults to false. + * $params['version'] = (number) Explicit version number for concurrency control.The specified version must match the current version of the document for the request to succeed. + * $params['version_type'] = (enum) Specific version type: `external`, `external_gte`. (Options = internal,external,external_gte,force) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return bool @@ -450,17 +590,24 @@ public function exists(array $params = []): bool return BooleanRequestWrapper::performRequest($endpoint, $this->transport); } /** - * $params['id'] = (string) The document ID (Required) - * $params['index'] = (string) The name of the index (Required) - * $params['preference'] = (string) Specify the node or shard the operation should be performed on (default: random) - * $params['realtime'] = (boolean) Specify whether to perform the operation in realtime or search mode - * $params['refresh'] = (boolean) Refresh the shard containing the document before performing the operation - * $params['routing'] = (string) Specific routing value - * $params['_source'] = (list) True or false to return the _source field or not, or a list of fields to return - * $params['_source_excludes'] = (list) A list of fields to exclude from the returned _source field - * $params['_source_includes'] = (list) A list of fields to extract and return from the _source field - * $params['version'] = (number) Explicit version number for concurrency control - * $params['version_type'] = (enum) Specific version type (Options = internal,external,external_gte,force) + * Returns information about whether a document source exists in an index. + * + * $params['id'] = (string) Identifier of the document. (Required) + * $params['index'] = (string) Comma-separated list of data streams, indices, and aliases. Supports wildcards (`*`). (Required) + * $params['_source'] = (any) `true` or `false` to return the `_source` field or not, or a list of fields to return. + * $params['_source_excludes'] = (any) A comma-separated list of source fields to exclude in the response. + * $params['_source_includes'] = (any) A comma-separated list of source fields to include in the response. + * $params['preference'] = (string) Specifies the node or shard the operation should be performed on.Random by default. (Default = random) + * $params['realtime'] = (boolean) If true, the request is real-time as opposed to near-real-time. + * $params['refresh'] = (boolean) If `true`, OpenSearch refreshes all shards involved in the delete by query after the request completes. + * $params['routing'] = (string) Target the specified primary shard. + * $params['version'] = (number) Explicit version number for concurrency control.The specified version must match the current version of the document for the request to succeed. + * $params['version_type'] = (enum) Specific version type: `external`, `external_gte`. (Options = internal,external,external_gte,force) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return bool @@ -482,20 +629,27 @@ public function existsSource(array $params = []): bool return BooleanRequestWrapper::performRequest($endpoint, $this->transport); } /** - * $params['id'] = (string) The document ID (Required) - * $params['index'] = (string) The name of the index (Required) - * $params['analyze_wildcard'] = (boolean) Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false) - * $params['analyzer'] = (string) The analyzer for the query string query - * $params['default_operator'] = (enum) The default operator for query string query (AND or OR) (Options = AND,OR) (Default = OR) - * $params['df'] = (string) The default field for query string query (default: _all) - * $params['stored_fields'] = (list) A comma-separated list of stored fields to return in the response - * $params['lenient'] = (boolean) Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * $params['preference'] = (string) Specify the node or shard the operation should be performed on (default: random) - * $params['q'] = (string) Query in the Lucene query string syntax - * $params['routing'] = (string) Specific routing value - * $params['_source'] = (list) True or false to return the _source field or not, or a list of fields to return - * $params['_source_excludes'] = (list) A list of fields to exclude from the returned _source field - * $params['_source_includes'] = (list) A list of fields to extract and return from the _source field + * Returns information about why a specific matches (or doesn't match) a query. + * + * $params['id'] = (string) Defines the document ID. (Required) + * $params['index'] = (string) Index names used to limit the request. Only a single index name can be provided to this parameter. (Required) + * $params['_source'] = (any) True or false to return the `_source` field or not, or a list of fields to return. + * $params['_source_excludes'] = (any) A comma-separated list of source fields to exclude from the response. + * $params['_source_includes'] = (any) A comma-separated list of source fields to include in the response. + * $params['analyze_wildcard'] = (boolean) If `true`, wildcard and prefix queries are analyzed. (Default = false) + * $params['analyzer'] = (string) Analyzer to use for the query string.This parameter can only be used when the `q` query string parameter is specified. + * $params['default_operator'] = (enum) The default operator for query string query: `AND` or `OR`. (Options = and,or) + * $params['df'] = (string) Field to use as default where no field prefix is given in the query string. (Default = _all) + * $params['lenient'] = (boolean) If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored. + * $params['preference'] = (string) Specifies the node or shard the operation should be performed on.Random by default. (Default = random) + * $params['q'] = (string) Query in the Lucene query string syntax. + * $params['routing'] = (string) Custom value used to route operations to a specific shard. + * $params['stored_fields'] = (any) A comma-separated list of stored fields to return in the response. + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * $params['body'] = (array) The query definition using the Query DSL * * @param array $params Associative array of parameters @@ -517,12 +671,19 @@ public function explain(array $params = []) return $this->performRequest($endpoint); } /** - * $params['index'] = (list) A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * $params['fields'] = (list) A comma-separated list of field names - * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed) - * $params['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) - * $params['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both. (Options = open,closed,hidden,none,all) (Default = open) - * $params['include_unmapped'] = (boolean) Indicates whether unmapped fields should be included in the response. (Default = false) + * Returns the information about the capabilities of fields among multiple indices. + * + * $params['index'] = (array) Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (*). To target all data streams and indices, omit this parameter or use * or _all. + * $params['allow_no_indices'] = (boolean) If false, the request returns an error if any wildcard expression, index alias,or `_all` value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a requesttargeting `foo*,bar*` returns an error if an index starts with foo but no index starts with bar. + * $params['expand_wildcards'] = (any) Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as `open,hidden`. + * $params['fields'] = (any) Comma-separated list of fields to retrieve capabilities for. Wildcard (`*`) expressions are supported. + * $params['ignore_unavailable'] = (boolean) If `true`, missing or closed indices are not included in the response. + * $params['include_unmapped'] = (boolean) If true, unmapped fields are included in the response. (Default = false) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * $params['body'] = (array) An index filter specified with the Query DSL * * @param array $params Associative array of parameters @@ -542,18 +703,25 @@ public function fieldCaps(array $params = []) return $this->performRequest($endpoint); } /** - * $params['id'] = (string) The document ID (Required) - * $params['index'] = (string) The name of the index (Required) - * $params['stored_fields'] = (list) A comma-separated list of stored fields to return in the response - * $params['preference'] = (string) Specify the node or shard the operation should be performed on (default: random) - * $params['realtime'] = (boolean) Specify whether to perform the operation in realtime or search mode - * $params['refresh'] = (boolean) Refresh the shard containing the document before performing the operation - * $params['routing'] = (string) Specific routing value - * $params['_source'] = (list) True or false to return the _source field or not, or a list of fields to return - * $params['_source_excludes'] = (list) A list of fields to exclude from the returned _source field - * $params['_source_includes'] = (list) A list of fields to extract and return from the _source field - * $params['version'] = (number) Explicit version number for concurrency control - * $params['version_type'] = (enum) Specific version type (Options = internal,external,external_gte,force) + * Returns a document. + * + * $params['id'] = (string) Unique identifier of the document. (Required) + * $params['index'] = (string) Name of the index that contains the document. (Required) + * $params['_source'] = (any) True or false to return the _source field or not, or a list of fields to return. + * $params['_source_excludes'] = (any) A comma-separated list of source fields to exclude in the response. + * $params['_source_includes'] = (any) A comma-separated list of source fields to include in the response. + * $params['preference'] = (string) Specifies the node or shard the operation should be performed on. Random by default. (Default = random) + * $params['realtime'] = (boolean) If `true`, the request is real-time as opposed to near-real-time. + * $params['refresh'] = (boolean) If true, OpenSearch refreshes the affected shards to make this operation visible to search. If false, do nothing with refreshes. + * $params['routing'] = (string) Target the specified primary shard. + * $params['stored_fields'] = (any) List of stored fields to return as part of a hit.If no fields are specified, no stored fields are included in the response.If this field is specified, the `_source` parameter defaults to false. + * $params['version'] = (number) Explicit version number for concurrency control. The specified version must match the current version of the document for the request to succeed. + * $params['version_type'] = (enum) Specific version type: internal, external, external_gte. (Options = internal,external,external_gte,force) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -572,8 +740,36 @@ public function get(array $params = []) return $this->performRequest($endpoint); } /** - * $params['id'] = (string) Script ID - * $params['cluster_manager_timeout'] = (time) Specify timeout for connection to cluster_manager + * Lists all active point in time searches. + * + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * + * @param array $params Associative array of parameters + * @return array + */ + public function getAllPits(array $params = []) + { + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('GetAllPits'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * Returns a script. + * + * $params['id'] = (string) Identifier for the stored script or search template. (Required) + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['master_timeout'] = (string) Specify timeout for connection to master + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -590,13 +786,16 @@ public function getScript(array $params = []) return $this->performRequest($endpoint); } /** + * Returns all script contexts. + * + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array - - * - * @note This API is EXPERIMENTAL and may be changed or removed completely in a future release - * */ public function getScriptContext(array $params = []) { @@ -607,13 +806,16 @@ public function getScriptContext(array $params = []) return $this->performRequest($endpoint); } /** + * Returns available script types, languages and contexts. + * + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array - - * - * @note This API is EXPERIMENTAL and may be changed or removed completely in a future release - * */ public function getScriptLanguages(array $params = []) { @@ -624,17 +826,24 @@ public function getScriptLanguages(array $params = []) return $this->performRequest($endpoint); } /** - * $params['id'] = (string) The document ID (Required) - * $params['index'] = (string) The name of the index (Required) - * $params['preference'] = (string) Specify the node or shard the operation should be performed on (default: random) - * $params['realtime'] = (boolean) Specify whether to perform the operation in realtime or search mode - * $params['refresh'] = (boolean) Refresh the shard containing the document before performing the operation - * $params['routing'] = (string) Specific routing value - * $params['_source'] = (list) True or false to return the _source field or not, or a list of fields to return - * $params['_source_excludes'] = (list) A list of fields to exclude from the returned _source field - * $params['_source_includes'] = (list) A list of fields to extract and return from the _source field - * $params['version'] = (number) Explicit version number for concurrency control - * $params['version_type'] = (enum) Specific version type (Options = internal,external,external_gte,force) + * Returns the source of a document. + * + * $params['id'] = (string) Unique identifier of the document. (Required) + * $params['index'] = (string) Name of the index that contains the document. (Required) + * $params['_source'] = (any) True or false to return the _source field or not, or a list of fields to return. + * $params['_source_excludes'] = (any) A comma-separated list of source fields to exclude in the response. + * $params['_source_includes'] = (any) A comma-separated list of source fields to include in the response. + * $params['preference'] = (string) Specifies the node or shard the operation should be performed on. Random by default. (Default = random) + * $params['realtime'] = (boolean) Boolean) If true, the request is real-time as opposed to near-real-time. + * $params['refresh'] = (boolean) If true, OpenSearch refreshes the affected shards to make this operation visible to search. If false, do nothing with refreshes. + * $params['routing'] = (string) Target the specified primary shard. + * $params['version'] = (number) Explicit version number for concurrency control. The specified version must match the current version of the document for the request to succeed. + * $params['version_type'] = (enum) Specific version type: internal, external, external_gte. (Options = internal,external,external_gte,force) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -653,19 +862,26 @@ public function getSource(array $params = []) return $this->performRequest($endpoint); } /** - * $params['id'] = (string) Document ID - * $params['index'] = (string) The name of the index (Required) - * $params['wait_for_active_shards'] = (string) Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * $params['op_type'] = (enum) Explicit operation type. Defaults to `index` for requests with an explicit document ID, and to `create`for requests without an explicit document ID (Options = index,create) - * $params['refresh'] = (enum) If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. (Options = true,false,wait_for) - * $params['routing'] = (string) Specific routing value - * $params['timeout'] = (time) Explicit operation timeout - * $params['version'] = (number) Explicit version number for concurrency control - * $params['version_type'] = (enum) Specific version type (Options = internal,external,external_gte) - * $params['if_seq_no'] = (number) only perform the index operation if the last operation that has changed the document has the specified sequence number - * $params['if_primary_term'] = (number) only perform the index operation if the last operation that has changed the document has the specified primary term - * $params['pipeline'] = (string) The pipeline id to preprocess incoming documents with - * $params['require_alias'] = (boolean) When true, requires destination to be an alias. Default is false + * Creates or updates a document in an index. + * + * $params['index'] = (string) Name of the data stream or index to target. (Required) + * $params['id'] = (string) Unique identifier for the document. + * $params['if_primary_term'] = (number) Only perform the operation if the document has this primary term. + * $params['if_seq_no'] = (number) Only perform the operation if the document has this sequence number. + * $params['op_type'] = (enum) Set to create to only index the document if it does not already exist (put if absent).If a document with the specified `_id` already exists, the indexing operation will fail.Same as using the `/_create` endpoint.Valid values: `index`, `create`.If document id is specified, it defaults to `index`.Otherwise, it defaults to `create`. (Options = index,create) + * $params['pipeline'] = (string) ID of the pipeline to use to preprocess incoming documents.If the index has a default ingest pipeline specified, then setting the value to `_none` disables the default ingest pipeline for this request.If a final pipeline is configured it will always run, regardless of the value of this parameter. + * $params['refresh'] = (enum) If `true`, OpenSearch refreshes the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` do nothing with refreshes.Valid values: `true`, `false`, `wait_for`. (Options = true,false,wait_for) + * $params['require_alias'] = (boolean) If `true`, the destination must be an index alias. (Default = false) + * $params['routing'] = (string) Custom value used to route operations to a specific shard. + * $params['timeout'] = (string) Period the request waits for the following operations: automatic index creation, dynamic mapping updates, waiting for active shards. + * $params['version'] = (number) Explicit version number for concurrency control.The specified version must match the current version of the document for the request to succeed. + * $params['version_type'] = (enum) Specific version type: `external`, `external_gte`. (Options = internal,external,external_gte,force) + * $params['wait_for_active_shards'] = (any) The number of shard copies that must be active before proceeding with the operation.Set to all or any positive integer up to the total number of shards in the index (`number_of_replicas+1`). + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * $params['body'] = (array) The document (Required) * * @param array $params Associative array of parameters @@ -673,20 +889,27 @@ public function getSource(array $params = []) */ public function index(array $params = []) { - $id = $this->extractArgument($params, 'id'); $index = $this->extractArgument($params, 'index'); + $id = $this->extractArgument($params, 'id'); $body = $this->extractArgument($params, 'body'); $endpointBuilder = $this->endpoints; $endpoint = $endpointBuilder('Index'); $endpoint->setParams($params); - $endpoint->setId($id); $endpoint->setIndex($index); + $endpoint->setId($id); $endpoint->setBody($body); return $this->performRequest($endpoint); } /** + * Returns basic information about the cluster. + * + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -700,16 +923,23 @@ public function info(array $params = []) return $this->performRequest($endpoint); } /** - * $params['index'] = (string) The name of the index - * $params['stored_fields'] = (list) A comma-separated list of stored fields to return in the response - * $params['preference'] = (string) Specify the node or shard the operation should be performed on (default: random) - * $params['realtime'] = (boolean) Specify whether to perform the operation in realtime or search mode - * $params['refresh'] = (boolean) Refresh the shard containing the document before performing the operation - * $params['routing'] = (string) Specific routing value - * $params['_source'] = (list) True or false to return the _source field or not, or a list of fields to return - * $params['_source_excludes'] = (list) A list of fields to exclude from the returned _source field - * $params['_source_includes'] = (list) A list of fields to extract and return from the _source field - * $params['body'] = (array) Document identifiers; can be either `docs` (containing full document information) or `ids` (when index and type is provided in the URL. (Required) + * Allows to get multiple documents in one request. + * + * $params['index'] = (string) Name of the index to retrieve documents from when `ids` are specified, or when a document in the `docs` array does not specify an index. + * $params['_source'] = (any) True or false to return the `_source` field or not, or a list of fields to return. + * $params['_source_excludes'] = (any) A comma-separated list of source fields to exclude from the response.You can also use this parameter to exclude fields from the subset specified in `_source_includes` query parameter. + * $params['_source_includes'] = (any) A comma-separated list of source fields to include in the response.If this parameter is specified, only these source fields are returned. You can exclude fields from this subset using the `_source_excludes` query parameter.If the `_source` parameter is `false`, this parameter is ignored. + * $params['preference'] = (string) Specifies the node or shard the operation should be performed on. Random by default. (Default = random) + * $params['realtime'] = (boolean) If `true`, the request is real-time as opposed to near-real-time. + * $params['refresh'] = (boolean) If `true`, the request refreshes relevant shards before retrieving documents. + * $params['routing'] = (string) Custom value used to route operations to a specific shard. + * $params['stored_fields'] = (any) If `true`, retrieves the document fields stored in the index rather than the document `_source`. + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * $params['body'] = (array) Document identifiers; can be either `docs` (containing full document information) or `ids` (when index is provided in the URL. (Required) * * @param array $params Associative array of parameters * @return array @@ -728,14 +958,21 @@ public function mget(array $params = []) return $this->performRequest($endpoint); } /** - * $params['index'] = (list) A comma-separated list of index names to use as default - * $params['search_type'] = (enum) Search operation type (Options = query_then_fetch,query_and_fetch,dfs_query_then_fetch,dfs_query_and_fetch) - * $params['max_concurrent_searches'] = (number) Controls the maximum number of concurrent searches the multi search api will execute - * $params['typed_keys'] = (boolean) Specify whether aggregation and suggester names should be prefixed by their respective types in the response - * $params['pre_filter_shard_size'] = (number) A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint. - * $params['max_concurrent_shard_requests'] = (number) The number of concurrent shard requests each sub search executes concurrently per node. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests (Default = 5) - * $params['rest_total_hits_as_int'] = (boolean) Indicates whether hits.total should be rendered as an integer or an object in the rest search response (Default = false) - * $params['ccs_minimize_roundtrips'] = (boolean) Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution (Default = true) + * Allows to execute several search operations in one request. + * + * $params['index'] = (array) Comma-separated list of data streams, indices, and index aliases to search. + * $params['ccs_minimize_roundtrips'] = (boolean) If true, network roundtrips between the coordinating node and remote clusters are minimized for cross-cluster search requests. (Default = true) + * $params['max_concurrent_searches'] = (number) Maximum number of concurrent searches the multi search API can execute. + * $params['max_concurrent_shard_requests'] = (number) Maximum number of concurrent shard requests that each sub-search request executes per node. (Default = 5) + * $params['pre_filter_shard_size'] = (number) Defines a threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method i.e., if date filters are mandatory to match but the shard bounds and the query are disjoint. + * $params['rest_total_hits_as_int'] = (boolean) If true, hits.total are returned as an integer in the response. Defaults to false, which returns an object. (Default = false) + * $params['search_type'] = (enum) Indicates whether global term and document frequencies should be used when scoring returned documents. (Options = query_then_fetch,dfs_query_then_fetch) + * $params['typed_keys'] = (boolean) Specifies whether aggregation and suggester names should be prefixed by their respective types in the response. + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * $params['body'] = (array) The request definitions (metadata-search request definition pairs), separated by newlines (Required) * * @param array $params Associative array of parameters @@ -755,12 +992,19 @@ public function msearch(array $params = []) return $this->performRequest($endpoint); } /** - * $params['index'] = (list) A comma-separated list of index names to use as default - * $params['search_type'] = (enum) Search operation type (Options = query_then_fetch,query_and_fetch,dfs_query_then_fetch,dfs_query_and_fetch) - * $params['typed_keys'] = (boolean) Specify whether aggregation and suggester names should be prefixed by their respective types in the response - * $params['max_concurrent_searches'] = (number) Controls the maximum number of concurrent searches the multi search api will execute - * $params['rest_total_hits_as_int'] = (boolean) Indicates whether hits.total should be rendered as an integer or an object in the rest search response (Default = false) - * $params['ccs_minimize_roundtrips'] = (boolean) Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution (Default = true) + * Allows to execute several search template operations in one request. + * + * $params['index'] = (array) Comma-separated list of data streams, indices, and aliases to search. Supports wildcards (`*`). To search all data streams and indices, omit this parameter or use `*`. + * $params['ccs_minimize_roundtrips'] = (boolean) If `true`, network round-trips are minimized for cross-cluster search requests. (Default = true) + * $params['max_concurrent_searches'] = (number) Maximum number of concurrent searches the API can run. + * $params['rest_total_hits_as_int'] = (boolean) If `true`, the response returns `hits.total` as an integer.If `false`, it returns `hits.total` as an object. (Default = false) + * $params['search_type'] = (enum) The type of the search operation.Available options: `query_then_fetch`, `dfs_query_then_fetch`. (Options = query_then_fetch,dfs_query_then_fetch) + * $params['typed_keys'] = (boolean) If `true`, the response prefixes aggregation and suggester names with their respective types. + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * $params['body'] = (array) The request definitions (metadata-search request definition pairs), separated by newlines (Required) * * @param array $params Associative array of parameters @@ -780,19 +1024,26 @@ public function msearchTemplate(array $params = []) return $this->performRequest($endpoint); } /** - * $params['index'] = (string) The index in which the document resides. - * $params['ids'] = (list) A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body - * $params['term_statistics'] = (boolean) Specifies if total term frequency and document frequency should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". (Default = false) - * $params['field_statistics'] = (boolean) Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". (Default = true) - * $params['fields'] = (list) A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * $params['offsets'] = (boolean) Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". (Default = true) - * $params['positions'] = (boolean) Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". (Default = true) - * $params['payloads'] = (boolean) Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". (Default = true) - * $params['preference'] = (string) Specify the node or shard the operation should be performed on (default: random) .Applies to all returned documents unless otherwise specified in body "params" or "docs". - * $params['routing'] = (string) Specific routing value. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * $params['realtime'] = (boolean) Specifies if requests are real-time as opposed to near-real-time (default: true). - * $params['version'] = (number) Explicit version number for concurrency control - * $params['version_type'] = (enum) Specific version type (Options = internal,external,external_gte,force) + * Returns multiple termvectors in one request. + * + * $params['index'] = (string) Name of the index that contains the documents. + * $params['field_statistics'] = (boolean) If `true`, the response includes the document count, sum of document frequencies, and sum of total term frequencies. (Default = true) + * $params['fields'] = (any) Comma-separated list or wildcard expressions of fields to include in the statistics.Used as the default list unless a specific field list is provided in the `completion_fields` or `fielddata_fields` parameters. + * $params['ids'] = (array) A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body + * $params['offsets'] = (boolean) If `true`, the response includes term offsets. (Default = true) + * $params['payloads'] = (boolean) If `true`, the response includes term payloads. (Default = true) + * $params['positions'] = (boolean) If `true`, the response includes term positions. (Default = true) + * $params['preference'] = (string) Specifies the node or shard the operation should be performed on.Random by default. (Default = random) + * $params['realtime'] = (boolean) If true, the request is real-time as opposed to near-real-time. (Default = true) + * $params['routing'] = (string) Custom value used to route operations to a specific shard. + * $params['term_statistics'] = (boolean) If true, the response includes term frequency and document frequency. (Default = false) + * $params['version'] = (number) If `true`, returns the document version as part of a hit. + * $params['version_type'] = (enum) Specific version type. (Options = internal,external,external_gte,force) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * $params['body'] = (array) Define ids, documents, parameters or a list of parameters per document here. You must at least provide a list of document ids. See documentation. * * @param array $params Associative array of parameters @@ -812,13 +1063,19 @@ public function mtermvectors(array $params = []) return $this->performRequest($endpoint); } /** + * Returns whether the cluster is running. + * + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return bool */ public function ping(array $params = []): bool { - // manually make this verbose so we can check status code $params['client']['verbose'] = true; @@ -829,11 +1086,19 @@ public function ping(array $params = []): bool return BooleanRequestWrapper::performRequest($endpoint, $this->transport); } /** - * $params['id'] = (string) Script ID (Required) - * $params['context'] = (string) Script context - * $params['timeout'] = (time) Explicit operation timeout - * $params['cluster_manager_timeout'] = (time) Specify timeout for connection to cluster_manager - * $params['body'] = (array) The document (Required) + * Creates or updates a script. + * + * $params['id'] = (string) Identifier for the stored script or search template. Must be unique within the cluster. (Required) + * $params['context'] = (string) Context in which the script or search template should run. To prevent errors, the API immediately compiles the script or template in this context. + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['master_timeout'] = (string) Period to wait for a connection to the master node.If no response is received before the timeout expires, the request fails and returns an error. + * $params['timeout'] = (string) Period to wait for a response.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. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * $params['body'] = (array) The document (Required) * * @param array $params Associative array of parameters * @return array @@ -854,19 +1119,22 @@ public function putScript(array $params = []) return $this->performRequest($endpoint); } /** - * $params['index'] = (list) A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed) - * $params['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) - * $params['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both. (Options = open,closed,hidden,none,all) (Default = open) - * $params['search_type'] = (enum) Search operation type (Options = query_then_fetch,dfs_query_then_fetch) + * Allows to evaluate the quality of ranked search results over a set of typical search queries. + * + * $params['index'] = (array) Comma-separated list of data streams, indices, and index aliases used to limit the request. Wildcard (`*`) expressions are supported. To target all data streams and indices in a cluster, omit this parameter or use `_all` or `*`. + * $params['allow_no_indices'] = (boolean) If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`. + * $params['expand_wildcards'] = (any) Whether to expand wildcard expression to concrete indices that are open, closed or both. + * $params['ignore_unavailable'] = (boolean) If `true`, missing or closed indices are not included in the response. + * $params['search_type'] = (string) Search operation type + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * $params['body'] = (array) The ranking evaluation search definition, including search requests, document ratings and ranking metric definition. (Required) * * @param array $params Associative array of parameters * @return array - - * - * @note This API is EXPERIMENTAL and may be changed or removed completely in a future release - * */ public function rankEval(array $params = []) { @@ -882,14 +1150,21 @@ public function rankEval(array $params = []) return $this->performRequest($endpoint); } /** - * $params['refresh'] = (boolean) Should the affected indexes be refreshed? - * $params['timeout'] = (time) Time each individual bulk request should wait for shards that are unavailable. (Default = 1m) - * $params['wait_for_active_shards'] = (string) Sets the number of shard copies that must be active before proceeding with the reindex operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * $params['wait_for_completion'] = (boolean) Should the request should block until the reindex is complete. (Default = true) - * $params['requests_per_second'] = (number) The throttle to set on this request in sub-requests per second. -1 means no throttle. (Default = 0) - * $params['scroll'] = (time) Control how long to keep the search context alive (Default = 5m) - * $params['slices'] = (number|string) The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be set to `auto`. (Default = 1) - * $params['max_docs'] = (number) Maximum number of documents to process (default: all documents) + * Allows to copy documents from one index to another, optionally filtering the sourcedocuments by a query, changing the destination index settings, or fetching thedocuments from a remote cluster. + * + * $params['max_docs'] = (integer) Maximum number of documents to process. By default, all documents. + * $params['refresh'] = (boolean) If `true`, the request refreshes affected shards to make this operation visible to search. + * $params['requests_per_second'] = (number) The throttle for this request in sub-requests per second.Defaults to no throttle. (Default = 0) + * $params['scroll'] = (string) Specifies how long a consistent view of the index should be maintained for scrolled search. + * $params['slices'] = (any) The number of slices this task should be divided into.Defaults to 1 slice, meaning the task isn’t sliced into subtasks. + * $params['timeout'] = (string) Period each indexing waits for automatic index creation, dynamic mapping updates, and waiting for active shards. + * $params['wait_for_active_shards'] = (any) The number of shard copies that must be active before proceeding with the operation.Set to `all` or any positive integer up to the total number of shards in the index (`number_of_replicas+1`). + * $params['wait_for_completion'] = (boolean) If `true`, the request blocks until the operation is complete. (Default = true) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * $params['body'] = (array) The search definition using the Query DSL and the prototype for the index request. (Required) * * @param array $params Associative array of parameters @@ -907,8 +1182,15 @@ public function reindex(array $params = []) return $this->performRequest($endpoint); } /** - * $params['task_id'] = (string) The task id to rethrottle - * $params['requests_per_second'] = (number) The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. (Required) + * 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. + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -925,8 +1207,15 @@ public function reindexRethrottle(array $params = []) return $this->performRequest($endpoint); } /** - * $params['id'] = (string) The id of the stored search template - * $params['body'] = (array) The search definition template and its params + * Allows to use the Mustache language to pre-render a search definition. + * + * $params['id'] = (string) ID of the search template to render. If no `source` is specified, this or the `id` request body parameter is required. + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * $params['body'] = (array) The search definition template and its params * * @param array $params Associative array of parameters * @return array @@ -945,14 +1234,17 @@ public function renderSearchTemplate(array $params = []) return $this->performRequest($endpoint); } /** - * $params['body'] = (array) The script to execute + * Allows an arbitrary script to be executed and a result to be returned. + * + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * $params['body'] = (array) The script to execute * * @param array $params Associative array of parameters * @return array - - * - * @note This API is EXPERIMENTAL and may be changed or removed completely in a future release - * */ public function scriptsPainlessExecute(array $params = []) { @@ -966,9 +1258,16 @@ public function scriptsPainlessExecute(array $params = []) return $this->performRequest($endpoint); } /** + * Allows to retrieve a large numbers of results from a single search request. + * * $params['scroll_id'] = DEPRECATED (string) The scroll ID - * $params['scroll'] = (time) Specify how long a consistent view of the index should be maintained for scrolled search - * $params['rest_total_hits_as_int'] = (boolean) Indicates whether hits.total should be rendered as an integer or an object in the rest search response (Default = false) + * $params['rest_total_hits_as_int'] = (boolean) If true, the API response’s hit.total property is returned as an integer. If false, the API response’s hit.total property is returned as an object. (Default = false) + * $params['scroll'] = (string) Period to retain the search context for scrolling. + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * $params['body'] = (array) The scroll ID if not passed by URL or query parameter. * * @param array $params Associative array of parameters @@ -988,49 +1287,60 @@ public function scroll(array $params = []) return $this->performRequest($endpoint); } /** - * $params['index'] = (list) A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * $params['analyzer'] = (string) The analyzer to use for the query string - * $params['analyze_wildcard'] = (boolean) Specify whether wildcard and prefix queries should be analyzed (default: false) - * $params['ccs_minimize_roundtrips'] = (boolean) Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution (Default = true) - * $params['default_operator'] = (enum) The default operator for query string query (AND or OR) (Options = AND,OR) (Default = OR) - * $params['df'] = (string) The field to use as default where no field prefix is given in the query string - * $params['explain'] = (boolean) Specify whether to return detailed information about score computation as part of a hit - * $params['stored_fields'] = (list) A comma-separated list of stored fields to return as part of a hit - * $params['docvalue_fields'] = (list) A comma-separated list of fields to return as the docvalue representation of a field for each hit - * $params['from'] = (number) Starting offset (default: 0) - * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed) - * $params['ignore_throttled'] = (boolean) Whether specified concrete, expanded or aliased indices should be ignored when throttled - * $params['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) - * $params['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both. (Options = open,closed,hidden,none,all) (Default = open) - * $params['lenient'] = (boolean) Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * $params['preference'] = (string) Specify the node or shard the operation should be performed on (default: random) - * $params['q'] = (string) Query in the Lucene query string syntax - * $params['routing'] = (list) A comma-separated list of specific routing values - * $params['scroll'] = (time) Specify how long a consistent view of the index should be maintained for scrolled search - * $params['search_type'] = (enum) Search operation type (Options = query_then_fetch,dfs_query_then_fetch) - * $params['size'] = (number) Number of hits to return (default: 10) - * $params['sort'] = (list) A comma-separated list of : pairs - * $params['_source'] = (list) True or false to return the _source field or not, or a list of fields to return - * $params['_source_excludes'] = (list) A list of fields to exclude from the returned _source field - * $params['_source_includes'] = (list) A list of fields to extract and return from the _source field - * $params['terminate_after'] = (number) The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - * $params['stats'] = (list) Specific 'tag' of the request for logging and statistical purposes - * $params['suggest_field'] = (string) Specify which field to use for suggestions - * $params['suggest_mode'] = (enum) Specify suggest mode (Options = missing,popular,always) (Default = missing) - * $params['suggest_size'] = (number) How many suggestions to return in response - * $params['suggest_text'] = (string) The source text for which the suggestions should be returned - * $params['timeout'] = (time) Explicit operation timeout - * $params['track_scores'] = (boolean) Whether to calculate and return scores even if they are not used for sorting - * $params['track_total_hits'] = (boolean) Indicate if the number of documents that match the query should be tracked - * $params['allow_partial_search_results'] = (boolean) Indicate if an error should be returned if there is a partial search failure or timeout (Default = true) - * $params['typed_keys'] = (boolean) Specify whether aggregation and suggester names should be prefixed by their respective types in the response - * $params['version'] = (boolean) Specify whether to return document version as part of a hit - * $params['seq_no_primary_term'] = (boolean) Specify whether to return sequence number and primary term of the last modification of each hit - * $params['request_cache'] = (boolean) Specify if request cache should be used for this request or not, defaults to index level setting - * $params['batched_reduce_size'] = (number) The number of shard results that should be reduced at once on the coordinating node. This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large. (Default = 512) - * $params['max_concurrent_shard_requests'] = (number) The number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests (Default = 5) - * $params['pre_filter_shard_size'] = (number) A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint. - * $params['rest_total_hits_as_int'] = (boolean) Indicates whether hits.total should be rendered as an integer or an object in the rest search response (Default = false) + * Returns results matching a query. + * + * $params['index'] = (array) Comma-separated list of data streams, indices, and aliases to search. Supports wildcards (`*`). To search all data streams and indices, omit this parameter or use `*` or `_all`. + * $params['_source'] = (any) Indicates which source fields are returned for matching documents.These fields are returned in the `hits._source` property of the search response.Valid values are:`true` to return the entire document source;`false` to not return the document source;`` to return the source fields that are specified as a comma-separated list (supports wildcard (`*`) patterns). + * $params['_source_excludes'] = (any) A comma-separated list of source fields to exclude from the response.You can also use this parameter to exclude fields from the subset specified in `_source_includes` query parameter.If the `_source` parameter is `false`, this parameter is ignored. + * $params['_source_includes'] = (any) A comma-separated list of source fields to include in the response.If this parameter is specified, only these source fields are returned.You can exclude fields from this subset using the `_source_excludes` query parameter.If the `_source` parameter is `false`, this parameter is ignored. + * $params['allow_no_indices'] = (boolean) If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.This behavior applies even if the request targets other open indices.For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`. + * $params['allow_partial_search_results'] = (boolean) If true, returns partial results if there are shard request timeouts or shard failures. If false, returns an error with no partial results. (Default = true) + * $params['analyze_wildcard'] = (boolean) If true, wildcard and prefix queries are analyzed.This parameter can only be used when the q query string parameter is specified. (Default = false) + * $params['analyzer'] = (string) Analyzer to use for the query string.This parameter can only be used when the q query string parameter is specified. + * $params['batched_reduce_size'] = (number) The number of shard results that should be reduced at once on the coordinating node.This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large. (Default = 512) + * $params['cancel_after_time_interval'] = (string) The time after which the search request will be canceled.Request-level parameter takes precedence over `cancel_after_time_interval` cluster setting. + * $params['ccs_minimize_roundtrips'] = (boolean) If true, network round-trips between the coordinating node and the remote clusters are minimized when executing cross-cluster search (CCS) requests. (Default = true) + * $params['default_operator'] = (enum) The default operator for query string query: AND or OR.This parameter can only be used when the `q` query string parameter is specified. (Options = and,or) + * $params['df'] = (string) Field to use as default where no field prefix is given in the query string.This parameter can only be used when the q query string parameter is specified. + * $params['docvalue_fields'] = (any) A comma-separated list of fields to return as the docvalue representation for each hit. + * $params['expand_wildcards'] = (any) Type of index that wildcard patterns can match.If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.Supports comma-separated values, such as `open,hidden`. + * $params['explain'] = (boolean) If `true`, returns detailed information about score computation as part of a hit. + * $params['from'] = (number) Starting document offset.Needs to be non-negative.By default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.To page through more hits, use the `search_after` parameter. (Default = 0) + * $params['ignore_throttled'] = (boolean) If `true`, concrete, expanded or aliased indices will be ignored when frozen. + * $params['ignore_unavailable'] = (boolean) If `false`, the request returns an error if it targets a missing or closed index. + * $params['include_named_queries_score'] = (boolean) Indicates whether hit.matched_queries should be rendered as a map that includes the name of the matched query associated with its score (true) or as an array containing the name of the matched queries (false) (Default = false) + * $params['lenient'] = (boolean) If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.This parameter can only be used when the `q` query string parameter is specified. + * $params['max_concurrent_shard_requests'] = (number) Defines the number of concurrent shard requests per node this search executes concurrently.This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests. (Default = 5) + * $params['phase_took'] = (boolean) Indicates whether to return phase-level `took` time values in the response. (Default = false) + * $params['pre_filter_shard_size'] = (number) Defines a threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold.This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method (if date filters are mandatory to match but the shard bounds and the query are disjoint).When unspecified, the pre-filter phase is executed if any of these conditions is met:the request targets more than 128 shards;the request targets one or more read-only index;the primary sort of the query targets an indexed field. + * $params['preference'] = (string) Nodes and shards used for the search.By default, OpenSearch selects from eligible nodes and shards using adaptive replica selection, accounting for allocation awareness. Valid values are:`_only_local` to run the search only on shards on the local node;`_local` to, if possible, run the search on shards on the local node, or if not, select shards using the default method;`_only_nodes:,` to run the search on only the specified nodes IDs, where, if suitable shards exist on more than one selected node, use shards on those nodes using the default method, or if none of the specified nodes are available, select shards from any available node using the default method;`_prefer_nodes:,` to if possible, run the search on the specified nodes IDs, or if not, select shards using the default method;`_shards:,` to run the search only on the specified shards;`` (any string that does not start with `_`) to route searches with the same `` to the same shards in the same order. (Default = random) + * $params['q'] = (string) Query in the Lucene query string syntax using query parameter search.Query parameter searches do not support the full OpenSearch Query DSL but are handy for testing. + * $params['request_cache'] = (boolean) If `true`, the caching of search results is enabled for requests where `size` is `0`.Defaults to index level settings. + * $params['rest_total_hits_as_int'] = (boolean) Indicates whether `hits.total` should be rendered as an integer or an object in the rest search response. (Default = false) + * $params['routing'] = (string) Custom value used to route operations to a specific shard. + * $params['scroll'] = (string) Period to retain the search context for scrolling. See Scroll search results.By default, this value cannot exceed `1d` (24 hours).You can change this limit using the `search.max_keep_alive` cluster-level setting. + * $params['search_pipeline'] = (string) Customizable sequence of processing stages applied to search queries. + * $params['search_type'] = (enum) How distributed term frequencies are calculated for relevance scoring. (Options = query_then_fetch,dfs_query_then_fetch) + * $params['seq_no_primary_term'] = (boolean) If `true`, returns sequence number and primary term of the last modification of each hit. + * $params['size'] = (number) Defines the number of hits to return.By default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.To page through more hits, use the `search_after` parameter. (Default = 10) + * $params['sort'] = (any) A comma-separated list of : pairs. + * $params['stats'] = (array) Specific `tag` of the request for logging and statistical purposes. + * $params['stored_fields'] = (any) A comma-separated list of stored fields to return as part of a hit.If no fields are specified, no stored fields are included in the response.If this field is specified, the `_source` parameter defaults to `false`.You can pass `_source: true` to return both source fields and stored fields in the search response. + * $params['suggest_field'] = (string) Specifies which field to use for suggestions. + * $params['suggest_mode'] = (enum) Specifies the suggest mode.This parameter can only be used when the `suggest_field` and `suggest_text` query string parameters are specified. (Options = missing,popular,always) + * $params['suggest_size'] = (number) Number of suggestions to return.This parameter can only be used when the `suggest_field` and `suggest_text` query string parameters are specified. + * $params['suggest_text'] = (string) The source text for which the suggestions should be returned.This parameter can only be used when the `suggest_field` and `suggest_text` query string parameters are specified. + * $params['terminate_after'] = (number) Maximum number of documents to collect for each shard.If a query reaches this limit, OpenSearch terminates the query early.OpenSearch collects documents before sorting.Use with caution.OpenSearch applies this parameter to each shard handling the request.When possible, let OpenSearch perform early termination automatically.Avoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers.If set to `0` (default), the query does not terminate early. + * $params['timeout'] = (string) Specifies the period of time to wait for a response from each shard.If no response is received before the timeout expires, the request fails and returns an error. + * $params['track_scores'] = (boolean) If `true`, calculate and return document scores, even if the scores are not used for sorting. + * $params['track_total_hits'] = (any) Number of hits matching the query to count accurately.If `true`, the exact number of hits is returned at the cost of some performance.If `false`, the response does not include the total number of hits matching the query. + * $params['typed_keys'] = (boolean) If `true`, aggregation and suggester names are be prefixed by their respective types in the response. + * $params['version'] = (boolean) If `true`, returns document version as part of a hit. + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * $params['body'] = (array) The search definition using the Query DSL * * @param array $params Associative array of parameters @@ -1050,13 +1360,20 @@ public function search(array $params = []) return $this->performRequest($endpoint); } /** - * $params['index'] = (list) A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * $params['preference'] = (string) Specify the node or shard the operation should be performed on (default: random) - * $params['routing'] = (string) Specific routing value - * $params['local'] = (boolean) Return local information, do not retrieve the state from cluster manager node (default: false) - * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed) - * $params['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) - * $params['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both. (Options = open,closed,hidden,none,all) (Default = open) + * Returns information about the indices and shards that a search request would be executed against. + * + * $params['index'] = (array) Returns the indices and shards that a search request would be executed against. + * $params['allow_no_indices'] = (boolean) If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.This behavior applies even if the request targets other open indices.For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`. + * $params['expand_wildcards'] = (any) Type of index that wildcard patterns can match.If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.Supports comma-separated values, such as `open,hidden`.Valid values are: `all`, `open`, `closed`, `hidden`, `none`. + * $params['ignore_unavailable'] = (boolean) If `false`, the request returns an error if it targets a missing or closed index. + * $params['local'] = (boolean) If `true`, the request retrieves information from the local node only. (Default = false) + * $params['preference'] = (string) Specifies the node or shard the operation should be performed on.Random by default. (Default = random) + * $params['routing'] = (string) Custom value used to route operations to a specific shard. + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -1073,20 +1390,27 @@ public function searchShards(array $params = []) return $this->performRequest($endpoint); } /** - * $params['index'] = (list) A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed) - * $params['ignore_throttled'] = (boolean) Whether specified concrete, expanded or aliased indices should be ignored when throttled - * $params['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) - * $params['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both. (Options = open,closed,hidden,none,all) (Default = open) - * $params['preference'] = (string) Specify the node or shard the operation should be performed on (default: random) - * $params['routing'] = (list) A comma-separated list of specific routing values - * $params['scroll'] = (time) Specify how long a consistent view of the index should be maintained for scrolled search - * $params['search_type'] = (enum) Search operation type (Options = query_then_fetch,query_and_fetch,dfs_query_then_fetch,dfs_query_and_fetch) - * $params['explain'] = (boolean) Specify whether to return detailed information about score computation as part of a hit - * $params['profile'] = (boolean) Specify whether to profile the query execution - * $params['typed_keys'] = (boolean) Specify whether aggregation and suggester names should be prefixed by their respective types in the response - * $params['rest_total_hits_as_int'] = (boolean) Indicates whether hits.total should be rendered as an integer or an object in the rest search response (Default = false) - * $params['ccs_minimize_roundtrips'] = (boolean) Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution (Default = true) + * Allows to use the Mustache language to pre-render a search definition. + * + * $params['index'] = (array) Comma-separated list of data streams, indices, and aliases to search. Supports wildcards (*). + * $params['allow_no_indices'] = (boolean) If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.This behavior applies even if the request targets other open indices.For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`. + * $params['ccs_minimize_roundtrips'] = (boolean) If `true`, network round-trips are minimized for cross-cluster search requests. (Default = true) + * $params['expand_wildcards'] = (any) Type of index that wildcard patterns can match.If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.Supports comma-separated values, such as `open,hidden`.Valid values are: `all`, `open`, `closed`, `hidden`, `none`. + * $params['explain'] = (boolean) If `true`, the response includes additional details about score computation as part of a hit. + * $params['ignore_throttled'] = (boolean) If `true`, specified concrete, expanded, or aliased indices are not included in the response when throttled. + * $params['ignore_unavailable'] = (boolean) If `false`, the request returns an error if it targets a missing or closed index. + * $params['preference'] = (string) Specifies the node or shard the operation should be performed on.Random by default. (Default = random) + * $params['profile'] = (boolean) If `true`, the query execution is profiled. + * $params['rest_total_hits_as_int'] = (boolean) If true, hits.total are rendered as an integer in the response. (Default = false) + * $params['routing'] = (string) Custom value used to route operations to a specific shard. + * $params['scroll'] = (string) Specifies how long a consistent view of the indexshould be maintained for scrolled search. + * $params['search_type'] = (enum) The type of the search operation. (Options = query_then_fetch,dfs_query_then_fetch) + * $params['typed_keys'] = (boolean) If `true`, the response prefixes aggregation and suggester names with their respective types. + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * $params['body'] = (array) The search definition template and its params (Required) * * @param array $params Associative array of parameters @@ -1106,19 +1430,26 @@ public function searchTemplate(array $params = []) return $this->performRequest($endpoint); } /** - * $params['index'] = (string) The index in which the document resides. (Required) - * $params['id'] = (string) The id of the document, when not specified a doc param should be supplied. - * $params['term_statistics'] = (boolean) Specifies if total term frequency and document frequency should be returned. (Default = false) - * $params['field_statistics'] = (boolean) Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. (Default = true) - * $params['fields'] = (list) A comma-separated list of fields to return. - * $params['offsets'] = (boolean) Specifies if term offsets should be returned. (Default = true) - * $params['positions'] = (boolean) Specifies if term positions should be returned. (Default = true) - * $params['payloads'] = (boolean) Specifies if term payloads should be returned. (Default = true) - * $params['preference'] = (string) Specify the node or shard the operation should be performed on (default: random). - * $params['routing'] = (string) Specific routing value. - * $params['realtime'] = (boolean) Specifies if request is real-time as opposed to near-real-time (default: true). - * $params['version'] = (number) Explicit version number for concurrency control - * $params['version_type'] = (enum) Specific version type (Options = internal,external,external_gte,force) + * Returns information and statistics about terms in the fields of a particular document. + * + * $params['index'] = (string) Name of the index that contains the document. (Required) + * $params['id'] = (string) Unique identifier of the document. + * $params['field_statistics'] = (boolean) If `true`, the response includes the document count, sum of document frequencies, and sum of total term frequencies. (Default = true) + * $params['fields'] = (any) Comma-separated list or wildcard expressions of fields to include in the statistics.Used as the default list unless a specific field list is provided in the `completion_fields` or `fielddata_fields` parameters. + * $params['offsets'] = (boolean) If `true`, the response includes term offsets. (Default = true) + * $params['payloads'] = (boolean) If `true`, the response includes term payloads. (Default = true) + * $params['positions'] = (boolean) If `true`, the response includes term positions. (Default = true) + * $params['preference'] = (string) Specifies the node or shard the operation should be performed on.Random by default. (Default = random) + * $params['realtime'] = (boolean) If true, the request is real-time as opposed to near-real-time. (Default = true) + * $params['routing'] = (string) Custom value used to route operations to a specific shard. + * $params['term_statistics'] = (boolean) If `true`, the response includes term frequency and document frequency. (Default = false) + * $params['version'] = (number) If `true`, returns the document version as part of a hit. + * $params['version_type'] = (enum) Specific version type. (Options = internal,external,external_gte,force) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * $params['body'] = (array) Define parameters and or supply a document to get termvectors for. See documentation. * * @param array $params Associative array of parameters @@ -1140,20 +1471,27 @@ public function termvectors(array $params = []) return $this->performRequest($endpoint); } /** + * Updates a document with a script or partial document. + * * $params['id'] = (string) Document ID (Required) * $params['index'] = (string) The name of the index (Required) - * $params['wait_for_active_shards'] = (string) Sets the number of shard copies that must be active before proceeding with the update operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * $params['_source'] = (list) True or false to return the _source field or not, or a list of fields to return - * $params['_source_excludes'] = (list) A list of fields to exclude from the returned _source field - * $params['_source_includes'] = (list) A list of fields to extract and return from the _source field - * $params['lang'] = (string) The script language (default: painless) - * $params['refresh'] = (enum) If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. (Options = true,false,wait_for) - * $params['retry_on_conflict'] = (number) Specify how many times should the operation be retried when a conflict occurs (default: 0) - * $params['routing'] = (string) Specific routing value - * $params['timeout'] = (time) Explicit operation timeout - * $params['if_seq_no'] = (number) only perform the update operation if the last operation that has changed the document has the specified sequence number - * $params['if_primary_term'] = (number) only perform the update operation if the last operation that has changed the document has the specified primary term - * $params['require_alias'] = (boolean) When true, requires destination is an alias. Default is false + * $params['_source'] = (any) Set to false to disable source retrieval. You can also specify a comma-separatedlist of the fields you want to retrieve. + * $params['_source_excludes'] = (any) Specify the source fields you want to exclude. + * $params['_source_includes'] = (any) Specify the source fields you want to retrieve. + * $params['if_primary_term'] = (number) Only perform the operation if the document has this primary term. + * $params['if_seq_no'] = (number) Only perform the operation if the document has this sequence number. + * $params['lang'] = (string) The script language. (Default = painless) + * $params['refresh'] = (enum) If 'true', OpenSearch refreshes the affected shards to make this operationvisible to search, if 'wait_for' then wait for a refresh to make this operationvisible to search, if 'false' do nothing with refreshes. (Options = true,false,wait_for) + * $params['require_alias'] = (boolean) If true, the destination must be an index alias. (Default = false) + * $params['retry_on_conflict'] = (number) Specify how many times should the operation be retried when a conflict occurs. (Default = 0) + * $params['routing'] = (string) Custom value used to route operations to a specific shard. + * $params['timeout'] = (string) Period to wait for dynamic mapping updates and active shards.This guarantees OpenSearch waits for at least the timeout before failing.The actual wait time could be longer, particularly when multiple waits occur. + * $params['wait_for_active_shards'] = (any) The number of shard copies that must be active before proceeding with the operations.Set to 'all' or any positive integer up to the total number of shards in the index(number_of_replicas+1). Defaults to 1 meaning the primary shard. + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * $params['body'] = (array) The request definition requires either `script` or partial `doc` (Required) * * @param array $params Associative array of parameters @@ -1175,42 +1513,48 @@ public function update(array $params = []) return $this->performRequest($endpoint); } /** - * $params['index'] = (list) A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices (Required) - * $params['analyzer'] = (string) The analyzer to use for the query string - * $params['analyze_wildcard'] = (boolean) Specify whether wildcard and prefix queries should be analyzed (default: false) - * $params['default_operator'] = (enum) The default operator for query string query (AND or OR) (Options = AND,OR) (Default = OR) - * $params['df'] = (string) The field to use as default where no field prefix is given in the query string - * $params['from'] = (number) Starting offset (default: 0) - * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed) - * $params['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) - * $params['conflicts'] = (enum) What to do when the update by query hits version conflicts? (Options = abort,proceed) (Default = abort) - * $params['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both. (Options = open,closed,hidden,none,all) (Default = open) - * $params['lenient'] = (boolean) Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * $params['pipeline'] = (string) Ingest pipeline to set on index requests made by this action. (default: none) - * $params['preference'] = (string) Specify the node or shard the operation should be performed on (default: random) - * $params['q'] = (string) Query in the Lucene query string syntax - * $params['routing'] = (list) A comma-separated list of specific routing values - * $params['scroll'] = (time) Specify how long a consistent view of the index should be maintained for scrolled search - * $params['search_type'] = (enum) Search operation type (Options = query_then_fetch,dfs_query_then_fetch) - * $params['search_timeout'] = (time) Explicit timeout for each search request. Defaults to no timeout. - * $params['size'] = (number) Deprecated, please use `max_docs` instead - * $params['max_docs'] = (number) Maximum number of documents to process (default: all documents) - * $params['sort'] = (list) A comma-separated list of : pairs - * $params['_source'] = (list) True or false to return the _source field or not, or a list of fields to return - * $params['_source_excludes'] = (list) A list of fields to exclude from the returned _source field - * $params['_source_includes'] = (list) A list of fields to extract and return from the _source field - * $params['terminate_after'] = (number) The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - * $params['stats'] = (list) Specific 'tag' of the request for logging and statistical purposes - * $params['version'] = (boolean) Specify whether to return document version as part of a hit - * $params['version_type'] = (boolean) Should the document increment the version number (internal) on hit or not (reindex) - * $params['request_cache'] = (boolean) Specify if request cache should be used for this request or not, defaults to index level setting - * $params['refresh'] = (boolean) Should the affected indexes be refreshed? - * $params['timeout'] = (time) Time each individual bulk request should wait for shards that are unavailable. (Default = 1m) - * $params['wait_for_active_shards'] = (string) Sets the number of shard copies that must be active before proceeding with the update by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * $params['scroll_size'] = (number) Size on the scroll request powering the update by query (Default = 100) - * $params['wait_for_completion'] = (boolean) Should the request should block until the update by query operation is complete. (Default = true) - * $params['requests_per_second'] = (number) The throttle to set on this request in sub-requests per second. -1 means no throttle. (Default = 0) - * $params['slices'] = (number|string) The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be set to `auto`. (Default = 1) + * Performs an update on every document in the index without changing the source,for example to pick up a mapping change. + * + * $params['index'] = (array) Comma-separated list of data streams, indices, and aliases to search. Supports wildcards (`*`). To search all data streams or indices, omit this parameter or use `*` or `_all`. (Required) + * $params['_source'] = (array) True or false to return the _source field or not, or a list of fields to return. + * $params['_source_excludes'] = (array) List of fields to exclude from the returned _source field. + * $params['_source_includes'] = (array) List of fields to extract and return from the _source field. + * $params['allow_no_indices'] = (boolean) If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.This behavior applies even if the request targets other open indices.For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`. + * $params['analyze_wildcard'] = (boolean) If `true`, wildcard and prefix queries are analyzed. (Default = false) + * $params['analyzer'] = (string) Analyzer to use for the query string. + * $params['conflicts'] = (enum) What to do if update by query hits version conflicts: `abort` or `proceed`. (Options = abort,proceed) + * $params['default_operator'] = (enum) The default operator for query string query: `AND` or `OR`. (Options = and,or) + * $params['df'] = (string) Field to use as default where no field prefix is given in the query string. + * $params['expand_wildcards'] = (any) Type of index that wildcard patterns can match.If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.Supports comma-separated values, such as `open,hidden`.Valid values are: `all`, `open`, `closed`, `hidden`, `none`. + * $params['from'] = (number) Starting offset. (Default = 0) + * $params['ignore_unavailable'] = (boolean) If `false`, the request returns an error if it targets a missing or closed index. + * $params['lenient'] = (boolean) If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored. + * $params['max_docs'] = (number) Maximum number of documents to process.Defaults to all documents. + * $params['pipeline'] = (string) ID of the pipeline to use to preprocess incoming documents.If the index has a default ingest pipeline specified, then setting the value to `_none` disables the default ingest pipeline for this request.If a final pipeline is configured it will always run, regardless of the value of this parameter. + * $params['preference'] = (string) Specifies the node or shard the operation should be performed on.Random by default. (Default = random) + * $params['q'] = (string) Query in the Lucene query string syntax. + * $params['refresh'] = (boolean) If `true`, OpenSearch refreshes affected shards to make the operation visible to search. + * $params['request_cache'] = (boolean) If `true`, the request cache is used for this request. + * $params['requests_per_second'] = (number) The throttle for this request in sub-requests per second. (Default = 0) + * $params['routing'] = (string) Custom value used to route operations to a specific shard. + * $params['scroll'] = (string) Period to retain the search context for scrolling. + * $params['scroll_size'] = (number) Size of the scroll request that powers the operation. (Default = 100) + * $params['search_timeout'] = (string) Explicit timeout for each search request. + * $params['search_type'] = (enum) The type of the search operation. Available options: `query_then_fetch`, `dfs_query_then_fetch`. (Options = query_then_fetch,dfs_query_then_fetch) + * $params['size'] = (integer) Deprecated, please use `max_docs` instead. + * $params['slices'] = (any) The number of slices this task should be divided into. + * $params['sort'] = (array) A comma-separated list of : pairs. + * $params['stats'] = (array) Specific `tag` of the request for logging and statistical purposes. + * $params['terminate_after'] = (number) Maximum number of documents to collect for each shard.If a query reaches this limit, OpenSearch terminates the query early.OpenSearch collects documents before sorting.Use with caution.OpenSearch applies this parameter to each shard handling the request.When possible, let OpenSearch perform early termination automatically.Avoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers. + * $params['timeout'] = (string) Period each update request waits for the following operations: dynamic mapping updates, waiting for active shards. + * $params['version'] = (boolean) If `true`, returns the document version as part of a hit. + * $params['wait_for_active_shards'] = (any) The number of shard copies that must be active before proceeding with the operation.Set to `all` or any positive integer up to the total number of shards in the index (`number_of_replicas+1`). + * $params['wait_for_completion'] = (boolean) If `true`, the request blocks until the operation is complete. (Default = true) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * $params['body'] = (array) The search definition using the Query DSL * * @param array $params Associative array of parameters @@ -1230,8 +1574,15 @@ public function updateByQuery(array $params = []) return $this->performRequest($endpoint); } /** - * $params['task_id'] = (string) The task id to rethrottle - * $params['requests_per_second'] = (number) The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. (Required) + * Changes the number of requests per second for a particular Update By Query operation. + * + * $params['task_id'] = (string) The ID for the task. (Required) + * $params['requests_per_second'] = (number) The throttle for this request in sub-requests per second. + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -1248,108 +1599,205 @@ public function updateByQueryRethrottle(array $params = []) return $this->performRequest($endpoint); } /** - * $params['body'] = (array) a point-in-time id to delete - * - * @param array $params Associative array of parameters - * @return array + * Proxy function to createPointInTime() to prevent BC break. + * This API will be removed in a future version. Use 'createPit' API instead. */ - public function deletePointInTime(array $params = []) + public function createPointInTime(array $params = []) + { + return $this->createPit($params); + } + /** + * Creates a new document in the index.Returns a 409 response when a document with a same ID already exists in the index. + * + * $params['id'] = (string) Unique identifier for the document. (Required) + * $params['index'] = (string) Name of the data stream or index to target. If the target doesn’t exist and matches the name or wildcard (`*`) pattern of an index template with a `data_stream` definition, this request creates the data stream. If the target doesn’t exist and doesn’t match a data stream template, this request creates the index. (Required) + * $params['pipeline'] = (string) ID of the pipeline to use to preprocess incoming documents.If the index has a default ingest pipeline specified, then setting the value to `_none` disables the default ingest pipeline for this request.If a final pipeline is configured it will always run, regardless of the value of this parameter. + * $params['refresh'] = (enum) If `true`, OpenSearch refreshes the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` do nothing with refreshes.Valid values: `true`, `false`, `wait_for`. (Options = true,false,wait_for) + * $params['routing'] = (string) Custom value used to route operations to a specific shard. + * $params['timeout'] = (string) Period the request waits for the following operations: automatic index creation, dynamic mapping updates, waiting for active shards. + * $params['version'] = (number) Explicit version number for concurrency control.The specified version must match the current version of the document for the request to succeed. + * $params['version_type'] = (enum) Specific version type: `external`, `external_gte`. (Options = internal,external,external_gte,force) + * $params['wait_for_active_shards'] = (any) The number of shard copies that must be active before proceeding with the operation.Set to `all` or any positive integer up to the total number of shards in the index (`number_of_replicas+1`). + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * $params['body'] = (array) The document (Required) + * + * @param array $params Associative array of parameters + * @return array + */ + public function create(array $params = []) { + $id = $this->extractArgument($params, 'id'); + $index = $this->extractArgument($params, 'index'); $body = $this->extractArgument($params, 'body'); $endpointBuilder = $this->endpoints; - $endpoint = $endpointBuilder('DeletePointInTime'); + $endpoint = $id ? $endpointBuilder('Create') : $endpointBuilder('Index'); $endpoint->setParams($params); + $endpoint->setId($id); + $endpoint->setIndex($index); $endpoint->setBody($body); return $this->performRequest($endpoint); } /** - * $params['index'] = (list) A comma-separated list of index names to open point in time; use `_all` or empty string to perform the operation on all indices - * $params['preference'] = (string) Specify the node or shard the operation should be performed on (default: random) - * $params['routing'] = (string) Specific routing value - * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed) - * $params['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both. (Options = open,closed,hidden,none,all) (Default = open) - * $params['keep_alive'] = (string) Specific the time to live for the point in time - * - * @param array $params Associative array of parameters - * @return array + * Proxy function to deletePointInTime() to prevent BC break. + * This API will be removed in a future version. Use 'deletePit' API instead. */ - public function createPointInTime(array $params = []) + public function deletePointInTime(array $params = []) { - $index = $this->extractArgument($params, 'index'); - - $endpointBuilder = $this->endpoints; - $endpoint = $endpointBuilder('CreatePointInTime'); - $endpoint->setParams($params); - $endpoint->setIndex($index); - - return $this->performRequest($endpoint); + return $this->deletePit($params); } + /** + * Returns the asyncSearch namespace + */ + public function asyncSearch(): AsyncSearchNamespace + { + return $this->asyncSearch; + } + /** + * Returns the cat namespace + */ public function cat(): CatNamespace { return $this->cat; } + /** + * Returns the cluster namespace + */ public function cluster(): ClusterNamespace { return $this->cluster; } + /** + * Returns the danglingIndices namespace + */ public function danglingIndices(): DanglingIndicesNamespace { return $this->danglingIndices; } + /** + * Returns the dataFrameTransformDeprecated namespace + */ + public function dataFrameTransformDeprecated(): DataFrameTransformDeprecatedNamespace + { + return $this->dataFrameTransformDeprecated; + } + /** + * Returns the indices namespace + */ public function indices(): IndicesNamespace { return $this->indices; } + /** + * Returns the ingest namespace + */ public function ingest(): IngestNamespace { return $this->ingest; } - public function nodes(): NodesNamespace + /** + * Returns the knn namespace + */ + public function knn(): KnnNamespace { - return $this->nodes; + return $this->knn; } - public function snapshot(): SnapshotNamespace + /** + * Returns the monitoring namespace + */ + public function monitoring(): MonitoringNamespace { - return $this->snapshot; + return $this->monitoring; } - public function tasks(): TasksNamespace + /** + * Returns the nodes namespace + */ + public function nodes(): NodesNamespace { - return $this->tasks; + return $this->nodes; } - public function asyncSearch(): AsyncSearchNamespace + /** + * Returns the notifications namespace + */ + public function notifications(): NotificationsNamespace { - return $this->asyncSearch; + return $this->notifications; } - public function dataFrameTransformDeprecated(): DataFrameTransformDeprecatedNamespace + /** + * Returns the remoteStore namespace + */ + public function remoteStore(): RemoteStoreNamespace { - return $this->dataFrameTransformDeprecated; + return $this->remoteStore; } - public function monitoring(): MonitoringNamespace + /** + * Returns the rollups namespace + */ + public function rollups(): RollupsNamespace { - return $this->monitoring; + return $this->rollups; + } + /** + * Returns the searchPipeline namespace + */ + public function searchPipeline(): SearchPipelineNamespace + { + return $this->searchPipeline; } + /** + * Returns the searchableSnapshots namespace + */ public function searchableSnapshots(): SearchableSnapshotsNamespace { return $this->searchableSnapshots; } - + /** + * Returns the security namespace + */ public function security(): SecurityNamespace { return $this->security; } - - public function ssl(): SslNamespace + /** + * Returns the snapshot namespace + */ + public function snapshot(): SnapshotNamespace { - return $this->ssl; + return $this->snapshot; } - + /** + * Returns the sql namespace + */ public function sql(): SqlNamespace { return $this->sql; } - + /** + * Returns the ssl namespace + */ + public function ssl(): SslNamespace + { + return $this->ssl; + } + /** + * Returns the tasks namespace + */ + public function tasks(): TasksNamespace + { + return $this->tasks; + } + /** + * Returns the transforms namespace + */ + public function transforms(): TransformsNamespace + { + return $this->transforms; + } public function ml(): MachineLearningNamespace { return $this->ml; @@ -1370,6 +1818,8 @@ public function __call(string $name, array $arguments) } /** + * Extract an argument from the array of parameters + * * @return null|mixed */ public function extractArgument(array &$params, string $arg) diff --git a/src/OpenSearch/Endpoints/Bulk.php b/src/OpenSearch/Endpoints/Bulk.php index 364e9d2a..6376a6fb 100644 --- a/src/OpenSearch/Endpoints/Bulk.php +++ b/src/OpenSearch/Endpoints/Bulk.php @@ -26,6 +26,9 @@ use OpenSearch\Serializers\SerializerInterface; use Traversable; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Bulk extends AbstractEndpoint { public function __construct(SerializerInterface $serializer) @@ -36,7 +39,6 @@ public function __construct(SerializerInterface $serializer) public function getURI(): string { $index = $this->index ?? null; - if (isset($index)) { return "/$index/_bulk"; } @@ -46,15 +48,20 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'wait_for_active_shards', - 'refresh', - 'routing', - 'timeout', '_source', '_source_excludes', '_source_includes', 'pipeline', - 'require_alias' + 'refresh', + 'require_alias', + 'routing', + 'timeout', + 'wait_for_active_shards', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/Cat/Aliases.php b/src/OpenSearch/Endpoints/Cat/Aliases.php index b2c350e5..cee786be 100644 --- a/src/OpenSearch/Endpoints/Cat/Aliases.php +++ b/src/OpenSearch/Endpoints/Cat/Aliases.php @@ -42,13 +42,13 @@ public function getURI(): string public function getParamWhitelist(): array { return [ + 'expand_wildcards', 'format', - 'local', 'h', 'help', + 'local', 's', 'v', - 'expand_wildcards', 'pretty', 'human', 'error_trace', diff --git a/src/OpenSearch/Endpoints/Cat/AllPitSegments.php b/src/OpenSearch/Endpoints/Cat/AllPitSegments.php new file mode 100644 index 00000000..0330e450 --- /dev/null +++ b/src/OpenSearch/Endpoints/Cat/AllPitSegments.php @@ -0,0 +1,51 @@ + 'cluster_manager_timeout']; + } } diff --git a/src/OpenSearch/Endpoints/Cat/Fielddata.php b/src/OpenSearch/Endpoints/Cat/Fielddata.php index 4017b63e..dd48d156 100644 --- a/src/OpenSearch/Endpoints/Cat/Fielddata.php +++ b/src/OpenSearch/Endpoints/Cat/Fielddata.php @@ -42,13 +42,13 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'format', 'bytes', + 'fields', + 'format', 'h', 'help', 's', 'v', - 'fields', 'pretty', 'human', 'error_trace', diff --git a/src/OpenSearch/Endpoints/Cat/Help.php b/src/OpenSearch/Endpoints/Cat/Help.php index 2a377a24..1b45a359 100644 --- a/src/OpenSearch/Endpoints/Cat/Help.php +++ b/src/OpenSearch/Endpoints/Cat/Help.php @@ -36,8 +36,6 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'help', - 's', 'pretty', 'human', 'error_trace', diff --git a/src/OpenSearch/Endpoints/Cat/Indices.php b/src/OpenSearch/Endpoints/Cat/Indices.php index bca30749..47b885a1 100644 --- a/src/OpenSearch/Endpoints/Cat/Indices.php +++ b/src/OpenSearch/Endpoints/Cat/Indices.php @@ -40,20 +40,20 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'format', 'bytes', - 'local', - 'master_timeout', 'cluster_manager_timeout', + 'expand_wildcards', + 'format', 'h', 'health', 'help', + 'include_unloaded_segments', + 'local', + 'master_timeout', 'pri', 's', 'time', 'v', - 'include_unloaded_segments', - 'expand_wildcards', 'pretty', 'human', 'error_trace', diff --git a/src/OpenSearch/Endpoints/Cat/Master.php b/src/OpenSearch/Endpoints/Cat/Master.php index 0231746c..56961358 100644 --- a/src/OpenSearch/Endpoints/Cat/Master.php +++ b/src/OpenSearch/Endpoints/Cat/Master.php @@ -24,7 +24,10 @@ use OpenSearch\Endpoints\AbstractEndpoint; /** - * @deprecated use \OpenSearch\Endpoints\Cat\ClusterManager instead + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ +/** + * @deprecated To promote inclusive language, please use '/_cat/cluster_manager' instead. */ class Master extends AbstractEndpoint { @@ -36,14 +39,19 @@ public function getURI(): string public function getParamWhitelist(): array { return [ + 'cluster_manager_timeout', 'format', - 'local', - 'master_timeout', 'h', 'help', + 'local', + 'master_timeout', 's', 'v', - 'cluster_manager_timeout' + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -51,6 +59,7 @@ public function getMethod(): string { return 'GET'; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Cat/NodeAttrs.php b/src/OpenSearch/Endpoints/Cat/NodeAttrs.php index 5df8e6d0..80ee6920 100644 --- a/src/OpenSearch/Endpoints/Cat/NodeAttrs.php +++ b/src/OpenSearch/Endpoints/Cat/NodeAttrs.php @@ -36,12 +36,12 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'format', - 'local', - 'master_timeout', 'cluster_manager_timeout', + 'format', 'h', 'help', + 'local', + 'master_timeout', 's', 'v', 'pretty', diff --git a/src/OpenSearch/Endpoints/Cat/Nodes.php b/src/OpenSearch/Endpoints/Cat/Nodes.php index be41cb24..fbcb24b4 100644 --- a/src/OpenSearch/Endpoints/Cat/Nodes.php +++ b/src/OpenSearch/Endpoints/Cat/Nodes.php @@ -37,13 +37,13 @@ public function getParamWhitelist(): array { return [ 'bytes', + 'cluster_manager_timeout', 'format', 'full_id', - 'local', - 'master_timeout', - 'cluster_manager_timeout', 'h', 'help', + 'local', + 'master_timeout', 's', 'time', 'v', diff --git a/src/OpenSearch/Endpoints/Cat/PendingTasks.php b/src/OpenSearch/Endpoints/Cat/PendingTasks.php index 488e0246..8d1f0fac 100644 --- a/src/OpenSearch/Endpoints/Cat/PendingTasks.php +++ b/src/OpenSearch/Endpoints/Cat/PendingTasks.php @@ -36,12 +36,12 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'format', - 'local', - 'master_timeout', 'cluster_manager_timeout', + 'format', 'h', 'help', + 'local', + 'master_timeout', 's', 'time', 'v', diff --git a/src/OpenSearch/Endpoints/Cat/PitSegments.php b/src/OpenSearch/Endpoints/Cat/PitSegments.php new file mode 100644 index 00000000..af9981b2 --- /dev/null +++ b/src/OpenSearch/Endpoints/Cat/PitSegments.php @@ -0,0 +1,61 @@ +body = $body; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Cat/Plugins.php b/src/OpenSearch/Endpoints/Cat/Plugins.php index 371f91ae..a58c7641 100644 --- a/src/OpenSearch/Endpoints/Cat/Plugins.php +++ b/src/OpenSearch/Endpoints/Cat/Plugins.php @@ -36,12 +36,12 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'format', - 'local', - 'master_timeout', 'cluster_manager_timeout', + 'format', 'h', 'help', + 'local', + 'master_timeout', 's', 'v', 'pretty', diff --git a/src/OpenSearch/Endpoints/Cat/Recovery.php b/src/OpenSearch/Endpoints/Cat/Recovery.php index 3bd7e9c2..709f77a3 100644 --- a/src/OpenSearch/Endpoints/Cat/Recovery.php +++ b/src/OpenSearch/Endpoints/Cat/Recovery.php @@ -40,10 +40,10 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'format', 'active_only', 'bytes', 'detailed', + 'format', 'h', 'help', 'index', diff --git a/src/OpenSearch/Endpoints/Cat/Repositories.php b/src/OpenSearch/Endpoints/Cat/Repositories.php index b0ef1039..d8b1ec10 100644 --- a/src/OpenSearch/Endpoints/Cat/Repositories.php +++ b/src/OpenSearch/Endpoints/Cat/Repositories.php @@ -36,12 +36,12 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'format', - 'local', - 'master_timeout', 'cluster_manager_timeout', + 'format', 'h', 'help', + 'local', + 'master_timeout', 's', 'v', 'pretty', diff --git a/src/OpenSearch/Endpoints/Cat/SegmentReplication.php b/src/OpenSearch/Endpoints/Cat/SegmentReplication.php new file mode 100644 index 00000000..7cb8c59d --- /dev/null +++ b/src/OpenSearch/Endpoints/Cat/SegmentReplication.php @@ -0,0 +1,66 @@ +index ?? null; + if (isset($index)) { + return "/_cat/segment_replication/$index"; + } + return "/_cat/segment_replication"; + } + + public function getParamWhitelist(): array + { + return [ + 'active_only', + 'allow_no_indices', + 'bytes', + 'completed_only', + 'detailed', + 'expand_wildcards', + 'format', + 'h', + 'help', + 'ignore_throttled', + 'ignore_unavailable', + 'index', + 's', + 'shards', + 'time', + 'timeout', + 'v', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/src/OpenSearch/Endpoints/Cat/Segments.php b/src/OpenSearch/Endpoints/Cat/Segments.php index eaf029b3..2eb07be8 100644 --- a/src/OpenSearch/Endpoints/Cat/Segments.php +++ b/src/OpenSearch/Endpoints/Cat/Segments.php @@ -23,12 +23,14 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Segments extends AbstractEndpoint { public function getURI(): string { $index = $this->index ?? null; - if (isset($index)) { return "/_cat/segments/$index"; } @@ -38,12 +40,19 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'format', 'bytes', + 'cluster_manager_timeout', + 'format', 'h', 'help', + 'master_timeout', 's', - 'v' + 'v', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -51,4 +60,9 @@ public function getMethod(): string { return 'GET'; } + + protected function getParamDeprecation(): array + { + return ['master_timeout' => 'cluster_manager_timeout']; + } } diff --git a/src/OpenSearch/Endpoints/Cat/Shards.php b/src/OpenSearch/Endpoints/Cat/Shards.php index 22a38e24..4a140a38 100644 --- a/src/OpenSearch/Endpoints/Cat/Shards.php +++ b/src/OpenSearch/Endpoints/Cat/Shards.php @@ -40,13 +40,13 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'format', 'bytes', - 'local', - 'master_timeout', 'cluster_manager_timeout', + 'format', 'h', 'help', + 'local', + 'master_timeout', 's', 'time', 'v', diff --git a/src/OpenSearch/Endpoints/Cat/Snapshots.php b/src/OpenSearch/Endpoints/Cat/Snapshots.php index 65e1c487..03f0ae52 100644 --- a/src/OpenSearch/Endpoints/Cat/Snapshots.php +++ b/src/OpenSearch/Endpoints/Cat/Snapshots.php @@ -42,12 +42,12 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'format', - 'ignore_unavailable', - 'master_timeout', 'cluster_manager_timeout', + 'format', 'h', 'help', + 'ignore_unavailable', + 'master_timeout', 's', 'time', 'v', diff --git a/src/OpenSearch/Endpoints/Cat/Tasks.php b/src/OpenSearch/Endpoints/Cat/Tasks.php index c860ac0c..86d94dc7 100644 --- a/src/OpenSearch/Endpoints/Cat/Tasks.php +++ b/src/OpenSearch/Endpoints/Cat/Tasks.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Tasks extends AbstractEndpoint { public function getURI(): string @@ -33,16 +36,21 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'format', - 'node_id', 'actions', 'detailed', - 'parent_task', + 'format', 'h', 'help', 's', 'time', - 'v' + 'v', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path', + 'node_id', + 'parent_task' ]; } diff --git a/src/OpenSearch/Endpoints/Cat/Templates.php b/src/OpenSearch/Endpoints/Cat/Templates.php index 8a006992..8bf42aa9 100644 --- a/src/OpenSearch/Endpoints/Cat/Templates.php +++ b/src/OpenSearch/Endpoints/Cat/Templates.php @@ -42,12 +42,12 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'format', - 'local', - 'master_timeout', 'cluster_manager_timeout', + 'format', 'h', 'help', + 'local', + 'master_timeout', 's', 'v', 'pretty', diff --git a/src/OpenSearch/Endpoints/Cat/ThreadPool.php b/src/OpenSearch/Endpoints/Cat/ThreadPool.php index ed76bf7d..fcd168c9 100644 --- a/src/OpenSearch/Endpoints/Cat/ThreadPool.php +++ b/src/OpenSearch/Endpoints/Cat/ThreadPool.php @@ -42,14 +42,14 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'format', - 'size', - 'local', - 'master_timeout', 'cluster_manager_timeout', + 'format', 'h', 'help', + 'local', + 'master_timeout', 's', + 'size', 'v', 'pretty', 'human', diff --git a/src/OpenSearch/Endpoints/Cat/Transforms.php b/src/OpenSearch/Endpoints/Cat/Transforms.php deleted file mode 100644 index 0b2a7e3f..00000000 --- a/src/OpenSearch/Endpoints/Cat/Transforms.php +++ /dev/null @@ -1,69 +0,0 @@ -transform_id ?? null; - - if (isset($transform_id)) { - return "/_cat/transforms/$transform_id"; - } - return "/_cat/transforms"; - } - - public function getParamWhitelist(): array - { - return [ - 'from', - 'size', - 'allow_no_match', - 'format', - 'h', - 'help', - 's', - 'time', - 'v' - ]; - } - - public function getMethod(): string - { - return 'GET'; - } - - public function setTransformId($transform_id): Transforms - { - if (isset($transform_id) !== true) { - return $this; - } - $this->transform_id = $transform_id; - - return $this; - } -} diff --git a/src/OpenSearch/Endpoints/ClearScroll.php b/src/OpenSearch/Endpoints/ClearScroll.php index 7a371d1e..190e9be5 100644 --- a/src/OpenSearch/Endpoints/ClearScroll.php +++ b/src/OpenSearch/Endpoints/ClearScroll.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class ClearScroll extends AbstractEndpoint { protected $scroll_id; @@ -43,7 +46,11 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/Cluster/AllocationExplain.php b/src/OpenSearch/Endpoints/Cluster/AllocationExplain.php index 878a36ab..0c0c8993 100644 --- a/src/OpenSearch/Endpoints/Cluster/AllocationExplain.php +++ b/src/OpenSearch/Endpoints/Cluster/AllocationExplain.php @@ -36,8 +36,8 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'include_yes_decisions', 'include_disk_info', + 'include_yes_decisions', 'pretty', 'human', 'error_trace', diff --git a/src/OpenSearch/Endpoints/Cluster/DeleteComponentTemplate.php b/src/OpenSearch/Endpoints/Cluster/DeleteComponentTemplate.php index e2519407..e8b16bdc 100644 --- a/src/OpenSearch/Endpoints/Cluster/DeleteComponentTemplate.php +++ b/src/OpenSearch/Endpoints/Cluster/DeleteComponentTemplate.php @@ -24,6 +24,9 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class DeleteComponentTemplate extends AbstractEndpoint { protected $name; @@ -31,7 +34,6 @@ class DeleteComponentTemplate extends AbstractEndpoint public function getURI(): string { $name = $this->name ?? null; - if (isset($name)) { return "/_component_template/$name"; } @@ -41,9 +43,14 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'timeout', + 'cluster_manager_timeout', 'master_timeout', - 'cluster_manager_timeout' + 'timeout', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -61,6 +68,7 @@ public function setName($name): DeleteComponentTemplate return $this; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Cluster/DeleteDecommissionAwareness.php b/src/OpenSearch/Endpoints/Cluster/DeleteDecommissionAwareness.php new file mode 100644 index 00000000..3f17a926 --- /dev/null +++ b/src/OpenSearch/Endpoints/Cluster/DeleteDecommissionAwareness.php @@ -0,0 +1,45 @@ +name ?? null; - if (isset($name)) { return "/_component_template/$name"; } @@ -41,9 +43,14 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'master_timeout', + 'cluster_manager_timeout', 'local', - 'cluster_manager_timeout' + 'master_timeout', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -61,6 +68,7 @@ public function setName($name): ExistsComponentTemplate return $this; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Cluster/GetComponentTemplate.php b/src/OpenSearch/Endpoints/Cluster/GetComponentTemplate.php index abaefabe..5d495710 100644 --- a/src/OpenSearch/Endpoints/Cluster/GetComponentTemplate.php +++ b/src/OpenSearch/Endpoints/Cluster/GetComponentTemplate.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class GetComponentTemplate extends AbstractEndpoint { protected $name; @@ -30,7 +33,6 @@ class GetComponentTemplate extends AbstractEndpoint public function getURI(): string { $name = $this->name ?? null; - if (isset($name)) { return "/_component_template/$name"; } @@ -40,9 +42,14 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'master_timeout', + 'cluster_manager_timeout', 'local', - 'cluster_manager_timeout' + 'master_timeout', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -63,6 +70,7 @@ public function setName($name): GetComponentTemplate return $this; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Cluster/GetDecommissionAwareness.php b/src/OpenSearch/Endpoints/Cluster/GetDecommissionAwareness.php new file mode 100644 index 00000000..66c250c5 --- /dev/null +++ b/src/OpenSearch/Endpoints/Cluster/GetDecommissionAwareness.php @@ -0,0 +1,62 @@ +awareness_attribute_name ?? null; + if (isset($awareness_attribute_name)) { + return "/_cluster/decommission/awareness/$awareness_attribute_name/_status"; + } + throw new RuntimeException('Missing parameter for the endpoint cluster.get_decommission_awareness'); + } + + public function getParamWhitelist(): array + { + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setAwarenessAttributeName($awareness_attribute_name): GetDecommissionAwareness + { + if (isset($awareness_attribute_name) !== true) { + return $this; + } + $this->awareness_attribute_name = $awareness_attribute_name; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Cluster/GetSettings.php b/src/OpenSearch/Endpoints/Cluster/GetSettings.php index 91d2d4b5..b5b66c36 100644 --- a/src/OpenSearch/Endpoints/Cluster/GetSettings.php +++ b/src/OpenSearch/Endpoints/Cluster/GetSettings.php @@ -36,11 +36,11 @@ public function getURI(): string public function getParamWhitelist(): array { return [ + 'cluster_manager_timeout', 'flat_settings', + 'include_defaults', 'master_timeout', - 'cluster_manager_timeout', 'timeout', - 'include_defaults', 'pretty', 'human', 'error_trace', diff --git a/src/OpenSearch/Endpoints/Cluster/GetWeightedRouting.php b/src/OpenSearch/Endpoints/Cluster/GetWeightedRouting.php new file mode 100644 index 00000000..0890735b --- /dev/null +++ b/src/OpenSearch/Endpoints/Cluster/GetWeightedRouting.php @@ -0,0 +1,62 @@ +attribute ?? null; + if (isset($attribute)) { + return "/_cluster/routing/awareness/$attribute/weights"; + } + throw new RuntimeException('Missing parameter for the endpoint cluster.get_weighted_routing'); + } + + public function getParamWhitelist(): array + { + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setAttribute($attribute): GetWeightedRouting + { + if (isset($attribute) !== true) { + return $this; + } + $this->attribute = $attribute; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Cluster/Health.php b/src/OpenSearch/Endpoints/Cluster/Health.php index b3800f53..04d2bb8f 100644 --- a/src/OpenSearch/Endpoints/Cluster/Health.php +++ b/src/OpenSearch/Endpoints/Cluster/Health.php @@ -40,19 +40,19 @@ public function getURI(): string public function getParamWhitelist(): array { return [ + 'awareness_attribute', + 'cluster_manager_timeout', 'expand_wildcards', 'level', 'local', 'master_timeout', - 'cluster_manager_timeout', 'timeout', 'wait_for_active_shards', - 'wait_for_nodes', 'wait_for_events', - 'wait_for_no_relocating_shards', 'wait_for_no_initializing_shards', + 'wait_for_no_relocating_shards', + 'wait_for_nodes', 'wait_for_status', - 'awareness_attribute', 'pretty', 'human', 'error_trace', diff --git a/src/OpenSearch/Endpoints/Cluster/PendingTasks.php b/src/OpenSearch/Endpoints/Cluster/PendingTasks.php index 46cd5c08..de7f81c0 100644 --- a/src/OpenSearch/Endpoints/Cluster/PendingTasks.php +++ b/src/OpenSearch/Endpoints/Cluster/PendingTasks.php @@ -36,9 +36,9 @@ public function getURI(): string public function getParamWhitelist(): array { return [ + 'cluster_manager_timeout', 'local', 'master_timeout', - 'cluster_manager_timeout', 'pretty', 'human', 'error_trace', diff --git a/src/OpenSearch/Endpoints/Cluster/PutComponentTemplate.php b/src/OpenSearch/Endpoints/Cluster/PutComponentTemplate.php index dc9fb862..c79a3db9 100644 --- a/src/OpenSearch/Endpoints/Cluster/PutComponentTemplate.php +++ b/src/OpenSearch/Endpoints/Cluster/PutComponentTemplate.php @@ -24,6 +24,9 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class PutComponentTemplate extends AbstractEndpoint { protected $name; @@ -31,7 +34,6 @@ class PutComponentTemplate extends AbstractEndpoint public function getURI(): string { $name = $this->name ?? null; - if (isset($name)) { return "/_component_template/$name"; } @@ -41,10 +43,15 @@ public function getURI(): string public function getParamWhitelist(): array { return [ + 'cluster_manager_timeout', 'create', - 'timeout', 'master_timeout', - 'cluster_manager_timeout' + 'timeout', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -72,6 +79,7 @@ public function setName($name): PutComponentTemplate return $this; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Cluster/PutDecommissionAwareness.php b/src/OpenSearch/Endpoints/Cluster/PutDecommissionAwareness.php new file mode 100644 index 00000000..c80fed51 --- /dev/null +++ b/src/OpenSearch/Endpoints/Cluster/PutDecommissionAwareness.php @@ -0,0 +1,74 @@ +awareness_attribute_name ?? null; + $awareness_attribute_value = $this->awareness_attribute_value ?? null; + if (isset($awareness_attribute_name) && isset($awareness_attribute_value)) { + return "/_cluster/decommission/awareness/$awareness_attribute_name/$awareness_attribute_value"; + } + throw new RuntimeException('Missing parameter for the endpoint cluster.put_decommission_awareness'); + } + + public function getParamWhitelist(): array + { + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setAwarenessAttributeName($awareness_attribute_name): PutDecommissionAwareness + { + if (isset($awareness_attribute_name) !== true) { + return $this; + } + $this->awareness_attribute_name = $awareness_attribute_name; + + return $this; + } + + public function setAwarenessAttributeValue($awareness_attribute_value): PutDecommissionAwareness + { + if (isset($awareness_attribute_value) !== true) { + return $this; + } + $this->awareness_attribute_value = $awareness_attribute_value; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Cluster/PutSettings.php b/src/OpenSearch/Endpoints/Cluster/PutSettings.php index c6c1d06e..2a78a059 100644 --- a/src/OpenSearch/Endpoints/Cluster/PutSettings.php +++ b/src/OpenSearch/Endpoints/Cluster/PutSettings.php @@ -36,9 +36,9 @@ public function getURI(): string public function getParamWhitelist(): array { return [ + 'cluster_manager_timeout', 'flat_settings', 'master_timeout', - 'cluster_manager_timeout', 'timeout', 'pretty', 'human', diff --git a/src/OpenSearch/Endpoints/Cluster/PutWeightedRouting.php b/src/OpenSearch/Endpoints/Cluster/PutWeightedRouting.php new file mode 100644 index 00000000..3a35b555 --- /dev/null +++ b/src/OpenSearch/Endpoints/Cluster/PutWeightedRouting.php @@ -0,0 +1,62 @@ +attribute ?? null; + if (isset($attribute)) { + return "/_cluster/routing/awareness/$attribute/weights"; + } + throw new RuntimeException('Missing parameter for the endpoint cluster.put_weighted_routing'); + } + + public function getParamWhitelist(): array + { + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setAttribute($attribute): PutWeightedRouting + { + if (isset($attribute) !== true) { + return $this; + } + $this->attribute = $attribute; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Cluster/Reroute.php b/src/OpenSearch/Endpoints/Cluster/Reroute.php index f95d0ea1..235e5515 100644 --- a/src/OpenSearch/Endpoints/Cluster/Reroute.php +++ b/src/OpenSearch/Endpoints/Cluster/Reroute.php @@ -36,12 +36,12 @@ public function getURI(): string public function getParamWhitelist(): array { return [ + 'cluster_manager_timeout', 'dry_run', 'explain', - 'retry_failed', - 'metric', 'master_timeout', - 'cluster_manager_timeout', + 'metric', + 'retry_failed', 'timeout', 'pretty', 'human', diff --git a/src/OpenSearch/Endpoints/Cluster/State.php b/src/OpenSearch/Endpoints/Cluster/State.php index 0b144c8a..a8b7f2eb 100644 --- a/src/OpenSearch/Endpoints/Cluster/State.php +++ b/src/OpenSearch/Endpoints/Cluster/State.php @@ -46,15 +46,15 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'local', - 'master_timeout', + 'allow_no_indices', 'cluster_manager_timeout', + 'expand_wildcards', 'flat_settings', + 'ignore_unavailable', + 'local', + 'master_timeout', 'wait_for_metadata_version', 'wait_for_timeout', - 'ignore_unavailable', - 'allow_no_indices', - 'expand_wildcards', 'pretty', 'human', 'error_trace', diff --git a/src/OpenSearch/Endpoints/Count.php b/src/OpenSearch/Endpoints/Count.php index b9d47c92..43abf6b7 100644 --- a/src/OpenSearch/Endpoints/Count.php +++ b/src/OpenSearch/Endpoints/Count.php @@ -40,19 +40,19 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'ignore_unavailable', - 'ignore_throttled', 'allow_no_indices', - 'expand_wildcards', - 'min_score', - 'preference', - 'routing', - 'q', - 'analyzer', 'analyze_wildcard', + 'analyzer', 'default_operator', 'df', + 'expand_wildcards', + 'ignore_throttled', + 'ignore_unavailable', 'lenient', + 'min_score', + 'preference', + 'q', + 'routing', 'terminate_after', 'pretty', 'human', diff --git a/src/OpenSearch/Endpoints/Create.php b/src/OpenSearch/Endpoints/Create.php index dbd7092a..9fd7b60b 100644 --- a/src/OpenSearch/Endpoints/Create.php +++ b/src/OpenSearch/Endpoints/Create.php @@ -24,40 +24,49 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Create extends AbstractEndpoint { public function getURI(): string { + if (isset($this->id) !== true) { + throw new RuntimeException( + 'id is required for create' + ); + } + $id = $this->id; if (isset($this->index) !== true) { throw new RuntimeException( 'index is required for create' ); } $index = $this->index; - - if (isset($this->id) !== true) { - return "/$index/_doc"; - } - - return "/$index/_create/$this->id"; + return "/$index/_create/$id"; } public function getParamWhitelist(): array { return [ - 'wait_for_active_shards', + 'pipeline', 'refresh', 'routing', 'timeout', 'version', 'version_type', - 'pipeline' + 'wait_for_active_shards', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } public function getMethod(): string { - return isset($this->id) ? 'PUT' : 'POST'; + return 'PUT'; } public function setBody($body): Create diff --git a/src/OpenSearch/Endpoints/CreatePit.php b/src/OpenSearch/Endpoints/CreatePit.php new file mode 100644 index 00000000..5bebbb45 --- /dev/null +++ b/src/OpenSearch/Endpoints/CreatePit.php @@ -0,0 +1,57 @@ +index) !== true) { + throw new RuntimeException( + 'index is required for create_pit' + ); + } + $index = $this->index; + return "/$index/_search/point_in_time"; + } + + public function getParamWhitelist(): array + { + return [ + 'allow_partial_pit_creation', + 'expand_wildcards', + 'keep_alive', + 'preference', + 'routing', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } +} diff --git a/src/OpenSearch/Endpoints/CreatePointInTime.php b/src/OpenSearch/Endpoints/CreatePointInTime.php deleted file mode 100644 index 531084fc..00000000 --- a/src/OpenSearch/Endpoints/CreatePointInTime.php +++ /dev/null @@ -1,56 +0,0 @@ -index) !== true) { - throw new RuntimeException( - 'index is required for creating point-in-time' - ); - } - $index = $this->index ?? null; - - return "/$index/_search/point_in_time"; - } - - public function getParamWhitelist(): array - { - return [ - 'preference', - 'routing', - 'ignore_unavailable', - 'expand_wildcards', - 'keep_alive' - ]; - } - - public function getMethod(): string - { - return 'POST'; - } -} diff --git a/src/OpenSearch/Endpoints/DanglingIndices/DeleteDanglingIndex.php b/src/OpenSearch/Endpoints/DanglingIndices/DeleteDanglingIndex.php index 18cb8e39..bc1e1d8a 100644 --- a/src/OpenSearch/Endpoints/DanglingIndices/DeleteDanglingIndex.php +++ b/src/OpenSearch/Endpoints/DanglingIndices/DeleteDanglingIndex.php @@ -24,6 +24,9 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class DeleteDanglingIndex extends AbstractEndpoint { protected $index_uuid; @@ -31,7 +34,6 @@ class DeleteDanglingIndex extends AbstractEndpoint public function getURI(): string { $index_uuid = $this->index_uuid ?? null; - if (isset($index_uuid)) { return "/_dangling/$index_uuid"; } @@ -42,9 +44,14 @@ public function getParamWhitelist(): array { return [ 'accept_data_loss', - 'timeout', + 'cluster_manager_timeout', 'master_timeout', - 'cluster_manager_timeout' + 'timeout', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -62,6 +69,7 @@ public function setIndexUuid($index_uuid): DeleteDanglingIndex return $this; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/DanglingIndices/ImportDanglingIndex.php b/src/OpenSearch/Endpoints/DanglingIndices/ImportDanglingIndex.php index 75121767..ca86f44d 100644 --- a/src/OpenSearch/Endpoints/DanglingIndices/ImportDanglingIndex.php +++ b/src/OpenSearch/Endpoints/DanglingIndices/ImportDanglingIndex.php @@ -24,6 +24,9 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class ImportDanglingIndex extends AbstractEndpoint { protected $index_uuid; @@ -31,7 +34,6 @@ class ImportDanglingIndex extends AbstractEndpoint public function getURI(): string { $index_uuid = $this->index_uuid ?? null; - if (isset($index_uuid)) { return "/_dangling/$index_uuid"; } @@ -42,9 +44,14 @@ public function getParamWhitelist(): array { return [ 'accept_data_loss', - 'timeout', + 'cluster_manager_timeout', 'master_timeout', - 'cluster_manager_timeout' + 'timeout', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -62,6 +69,7 @@ public function setIndexUuid($index_uuid): ImportDanglingIndex return $this; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/DanglingIndices/ListDanglingIndices.php b/src/OpenSearch/Endpoints/DanglingIndices/ListDanglingIndices.php index 32dc180e..c4edc361 100644 --- a/src/OpenSearch/Endpoints/DanglingIndices/ListDanglingIndices.php +++ b/src/OpenSearch/Endpoints/DanglingIndices/ListDanglingIndices.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class ListDanglingIndices extends AbstractEndpoint { public function getURI(): string @@ -33,7 +36,11 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/Delete.php b/src/OpenSearch/Endpoints/Delete.php index f103cdf2..8ef0db8d 100644 --- a/src/OpenSearch/Endpoints/Delete.php +++ b/src/OpenSearch/Endpoints/Delete.php @@ -49,14 +49,14 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'wait_for_active_shards', + 'if_primary_term', + 'if_seq_no', 'refresh', 'routing', 'timeout', - 'if_seq_no', - 'if_primary_term', 'version', 'version_type', + 'wait_for_active_shards', 'pretty', 'human', 'error_trace', diff --git a/src/OpenSearch/Endpoints/DeleteAllPits.php b/src/OpenSearch/Endpoints/DeleteAllPits.php new file mode 100644 index 00000000..14360cfc --- /dev/null +++ b/src/OpenSearch/Endpoints/DeleteAllPits.php @@ -0,0 +1,45 @@ +task_id ?? null; - - if (isset($task_id)) { - return "/_delete_by_query/$task_id/_rethrottle"; + if (isset($this->task_id) !== true) { + throw new RuntimeException( + 'task_id is required for delete_by_query_rethrottle' + ); } - throw new RuntimeException('Missing parameter for the endpoint delete_by_query_rethrottle'); + $task_id = $this->task_id; + return "/_delete_by_query/$task_id/_rethrottle"; } public function getParamWhitelist(): array { return [ - 'requests_per_second' + 'requests_per_second', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/DeletePit.php b/src/OpenSearch/Endpoints/DeletePit.php new file mode 100644 index 00000000..df9768d3 --- /dev/null +++ b/src/OpenSearch/Endpoints/DeletePit.php @@ -0,0 +1,55 @@ +body = $body; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/DeletePointInTime.php b/src/OpenSearch/Endpoints/DeletePointInTime.php deleted file mode 100644 index 5b963d70..00000000 --- a/src/OpenSearch/Endpoints/DeletePointInTime.php +++ /dev/null @@ -1,53 +0,0 @@ -body = $body; - - return $this; - } -} diff --git a/src/OpenSearch/Endpoints/DeleteScript.php b/src/OpenSearch/Endpoints/DeleteScript.php index 92c47ac6..36d3bfd7 100644 --- a/src/OpenSearch/Endpoints/DeleteScript.php +++ b/src/OpenSearch/Endpoints/DeleteScript.php @@ -24,24 +24,33 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class DeleteScript extends AbstractEndpoint { public function getURI(): string { - $id = $this->id ?? null; - - if (isset($id)) { - return "/_scripts/$id"; + if (isset($this->id) !== true) { + throw new RuntimeException( + 'id is required for delete_script' + ); } - throw new RuntimeException('Missing parameter for the endpoint delete_script'); + $id = $this->id; + return "/_scripts/$id"; } public function getParamWhitelist(): array { return [ - 'timeout', + 'cluster_manager_timeout', 'master_timeout', - 'cluster_manager_timeout' + 'timeout', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -49,6 +58,7 @@ public function getMethod(): string { return 'DELETE'; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Exists.php b/src/OpenSearch/Endpoints/Exists.php index 07d45c1d..be7f3a4c 100644 --- a/src/OpenSearch/Endpoints/Exists.php +++ b/src/OpenSearch/Endpoints/Exists.php @@ -49,14 +49,14 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'stored_fields', + '_source', + '_source_excludes', + '_source_includes', 'preference', 'realtime', 'refresh', 'routing', - '_source', - '_source_excludes', - '_source_includes', + 'stored_fields', 'version', 'version_type', 'pretty', diff --git a/src/OpenSearch/Endpoints/ExistsSource.php b/src/OpenSearch/Endpoints/ExistsSource.php index 4d529e0e..7d2b9e7f 100644 --- a/src/OpenSearch/Endpoints/ExistsSource.php +++ b/src/OpenSearch/Endpoints/ExistsSource.php @@ -49,13 +49,13 @@ public function getURI(): string public function getParamWhitelist(): array { return [ + '_source', + '_source_excludes', + '_source_includes', 'preference', 'realtime', 'refresh', 'routing', - '_source', - '_source_excludes', - '_source_includes', 'version', 'version_type', 'pretty', diff --git a/src/OpenSearch/Endpoints/Explain.php b/src/OpenSearch/Endpoints/Explain.php index 567c2198..cf5a6f1c 100644 --- a/src/OpenSearch/Endpoints/Explain.php +++ b/src/OpenSearch/Endpoints/Explain.php @@ -49,18 +49,18 @@ public function getURI(): string public function getParamWhitelist(): array { return [ + '_source', + '_source_excludes', + '_source_includes', 'analyze_wildcard', 'analyzer', 'default_operator', 'df', - 'stored_fields', 'lenient', 'preference', 'q', 'routing', - '_source', - '_source_excludes', - '_source_includes', + 'stored_fields', 'pretty', 'human', 'error_trace', diff --git a/src/OpenSearch/Endpoints/FieldCaps.php b/src/OpenSearch/Endpoints/FieldCaps.php index 9353b3f9..93cd3749 100644 --- a/src/OpenSearch/Endpoints/FieldCaps.php +++ b/src/OpenSearch/Endpoints/FieldCaps.php @@ -40,10 +40,10 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'fields', - 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', + 'fields', + 'ignore_unavailable', 'include_unmapped', 'pretty', 'human', diff --git a/src/OpenSearch/Endpoints/Get.php b/src/OpenSearch/Endpoints/Get.php index 87dac044..dce7661a 100644 --- a/src/OpenSearch/Endpoints/Get.php +++ b/src/OpenSearch/Endpoints/Get.php @@ -49,14 +49,14 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'stored_fields', + '_source', + '_source_excludes', + '_source_includes', 'preference', 'realtime', 'refresh', 'routing', - '_source', - '_source_excludes', - '_source_includes', + 'stored_fields', 'version', 'version_type', 'pretty', diff --git a/src/OpenSearch/Endpoints/GetAllPits.php b/src/OpenSearch/Endpoints/GetAllPits.php new file mode 100644 index 00000000..6301d674 --- /dev/null +++ b/src/OpenSearch/Endpoints/GetAllPits.php @@ -0,0 +1,45 @@ +id ?? null; - - if (isset($id)) { - return "/_scripts/$id"; + if (isset($this->id) !== true) { + throw new RuntimeException( + 'id is required for get_script' + ); } - throw new RuntimeException('Missing parameter for the endpoint get_script'); + $id = $this->id; + return "/_scripts/$id"; } public function getParamWhitelist(): array { return [ - 'master_timeout', 'cluster_manager_timeout' + 'cluster_manager_timeout', + 'master_timeout', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -47,6 +57,7 @@ public function getMethod(): string { return 'GET'; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/GetSource.php b/src/OpenSearch/Endpoints/GetSource.php index fa1f4f0d..5ee7df93 100644 --- a/src/OpenSearch/Endpoints/GetSource.php +++ b/src/OpenSearch/Endpoints/GetSource.php @@ -49,13 +49,13 @@ public function getURI(): string public function getParamWhitelist(): array { return [ + '_source', + '_source_excludes', + '_source_includes', 'preference', 'realtime', 'refresh', 'routing', - '_source', - '_source_excludes', - '_source_includes', 'version', 'version_type', 'pretty', diff --git a/src/OpenSearch/Endpoints/Index.php b/src/OpenSearch/Endpoints/Index.php index 66cce98a..abeecc31 100644 --- a/src/OpenSearch/Endpoints/Index.php +++ b/src/OpenSearch/Endpoints/Index.php @@ -47,17 +47,17 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'wait_for_active_shards', + 'if_primary_term', + 'if_seq_no', 'op_type', + 'pipeline', 'refresh', + 'require_alias', 'routing', 'timeout', 'version', 'version_type', - 'if_seq_no', - 'if_primary_term', - 'pipeline', - 'require_alias', + 'wait_for_active_shards', 'pretty', 'human', 'error_trace', diff --git a/src/OpenSearch/Endpoints/Indices/AddBlock.php b/src/OpenSearch/Endpoints/Indices/AddBlock.php index b6d77d12..5c878c89 100644 --- a/src/OpenSearch/Endpoints/Indices/AddBlock.php +++ b/src/OpenSearch/Endpoints/Indices/AddBlock.php @@ -24,15 +24,17 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class AddBlock extends AbstractEndpoint { protected $block; public function getURI(): string { - $index = $this->index ?? null; $block = $this->block ?? null; - + $index = $this->index ?? null; if (isset($index) && isset($block)) { return "/$index/_block/$block"; } @@ -42,12 +44,17 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'timeout', - 'master_timeout', - 'ignore_unavailable', 'allow_no_indices', + 'cluster_manager_timeout', 'expand_wildcards', - 'cluster_manager_timeout' + 'ignore_unavailable', + 'master_timeout', + 'timeout', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -65,6 +72,7 @@ public function setBlock($block): AddBlock return $this; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Indices/ClearCache.php b/src/OpenSearch/Endpoints/Indices/ClearCache.php index 8d98f20a..deafb1eb 100644 --- a/src/OpenSearch/Endpoints/Indices/ClearCache.php +++ b/src/OpenSearch/Endpoints/Indices/ClearCache.php @@ -40,13 +40,13 @@ public function getURI(): string public function getParamWhitelist(): array { return [ + 'allow_no_indices', + 'expand_wildcards', 'fielddata', 'fields', - 'query', 'ignore_unavailable', - 'allow_no_indices', - 'expand_wildcards', 'index', + 'query', 'request', 'pretty', 'human', diff --git a/src/OpenSearch/Endpoints/Indices/CloneIndices.php b/src/OpenSearch/Endpoints/Indices/CloneIndices.php index 52d620f7..ca94ac96 100644 --- a/src/OpenSearch/Endpoints/Indices/CloneIndices.php +++ b/src/OpenSearch/Endpoints/Indices/CloneIndices.php @@ -24,6 +24,9 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class CloneIndices extends AbstractEndpoint { protected $target; @@ -32,7 +35,6 @@ public function getURI(): string { $index = $this->index ?? null; $target = $this->target ?? null; - if (isset($index) && isset($target)) { return "/$index/_clone/$target"; } @@ -42,10 +44,17 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'timeout', + 'cluster_manager_timeout', 'master_timeout', + 'task_execution_timeout', + 'timeout', 'wait_for_active_shards', - 'cluster_manager_timeout' + 'wait_for_completion', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -73,6 +82,7 @@ public function setTarget($target): CloneIndices return $this; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Indices/Close.php b/src/OpenSearch/Endpoints/Indices/Close.php index e7c59d4f..a858965d 100644 --- a/src/OpenSearch/Endpoints/Indices/Close.php +++ b/src/OpenSearch/Endpoints/Indices/Close.php @@ -24,12 +24,14 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Close extends AbstractEndpoint { public function getURI(): string { $index = $this->index ?? null; - if (isset($index)) { return "/$index/_close"; } @@ -39,13 +41,18 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'timeout', - 'master_timeout', - 'ignore_unavailable', 'allow_no_indices', + 'cluster_manager_timeout', 'expand_wildcards', + 'ignore_unavailable', + 'master_timeout', + 'timeout', 'wait_for_active_shards', - 'cluster_manager_timeout' + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -53,6 +60,7 @@ public function getMethod(): string { return 'POST'; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Indices/Create.php b/src/OpenSearch/Endpoints/Indices/Create.php index 781ef540..bf9e3d56 100644 --- a/src/OpenSearch/Endpoints/Indices/Create.php +++ b/src/OpenSearch/Endpoints/Indices/Create.php @@ -24,12 +24,14 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Create extends AbstractEndpoint { public function getURI(): string { $index = $this->index ?? null; - if (isset($index)) { return "/$index"; } @@ -39,10 +41,15 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'wait_for_active_shards', - 'timeout', + 'cluster_manager_timeout', 'master_timeout', - 'cluster_manager_timeout' + 'timeout', + 'wait_for_active_shards', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -60,6 +67,7 @@ public function setBody($body): Create return $this; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Indices/CreateDataStream.php b/src/OpenSearch/Endpoints/Indices/CreateDataStream.php index c3a9b0a3..0c74c24d 100644 --- a/src/OpenSearch/Endpoints/Indices/CreateDataStream.php +++ b/src/OpenSearch/Endpoints/Indices/CreateDataStream.php @@ -24,6 +24,9 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class CreateDataStream extends AbstractEndpoint { protected $name; @@ -31,7 +34,6 @@ class CreateDataStream extends AbstractEndpoint public function getURI(): string { $name = $this->name ?? null; - if (isset($name)) { return "/_data_stream/$name"; } @@ -41,7 +43,11 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -50,6 +56,16 @@ public function getMethod(): string return 'PUT'; } + public function setBody($body): CreateDataStream + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + public function setName($name): CreateDataStream { if (isset($name) !== true) { diff --git a/src/OpenSearch/Endpoints/Indices/DataStreamsStats.php b/src/OpenSearch/Endpoints/Indices/DataStreamsStats.php index a5a453f9..fc3ee039 100644 --- a/src/OpenSearch/Endpoints/Indices/DataStreamsStats.php +++ b/src/OpenSearch/Endpoints/Indices/DataStreamsStats.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class DataStreamsStats extends AbstractEndpoint { protected $name; @@ -30,7 +33,6 @@ class DataStreamsStats extends AbstractEndpoint public function getURI(): string { $name = $this->name ?? null; - if (isset($name)) { return "/_data_stream/$name/_stats"; } @@ -39,7 +41,13 @@ public function getURI(): string public function getParamWhitelist(): array { - return []; + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; } public function getMethod(): string diff --git a/src/OpenSearch/Endpoints/Indices/Delete.php b/src/OpenSearch/Endpoints/Indices/Delete.php index 78d61064..1b39192d 100644 --- a/src/OpenSearch/Endpoints/Indices/Delete.php +++ b/src/OpenSearch/Endpoints/Indices/Delete.php @@ -24,12 +24,14 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Delete extends AbstractEndpoint { public function getURI(): string { $index = $this->index ?? null; - if (isset($index)) { return "/$index"; } @@ -39,12 +41,17 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'timeout', - 'master_timeout', - 'ignore_unavailable', 'allow_no_indices', + 'cluster_manager_timeout', 'expand_wildcards', - 'cluster_manager_timeout' + 'ignore_unavailable', + 'master_timeout', + 'timeout', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -52,6 +59,7 @@ public function getMethod(): string { return 'DELETE'; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Indices/DeleteAlias.php b/src/OpenSearch/Endpoints/Indices/DeleteAlias.php index 1bb4a7ee..edce99b3 100644 --- a/src/OpenSearch/Endpoints/Indices/DeleteAlias.php +++ b/src/OpenSearch/Endpoints/Indices/DeleteAlias.php @@ -51,9 +51,9 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'timeout', - 'master_timeout', 'cluster_manager_timeout', + 'master_timeout', + 'timeout', 'pretty', 'human', 'error_trace', diff --git a/src/OpenSearch/Endpoints/Indices/DeleteDataStream.php b/src/OpenSearch/Endpoints/Indices/DeleteDataStream.php index 16f9afd1..f266b1d8 100644 --- a/src/OpenSearch/Endpoints/Indices/DeleteDataStream.php +++ b/src/OpenSearch/Endpoints/Indices/DeleteDataStream.php @@ -24,6 +24,9 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class DeleteDataStream extends AbstractEndpoint { protected $name; @@ -31,7 +34,6 @@ class DeleteDataStream extends AbstractEndpoint public function getURI(): string { $name = $this->name ?? null; - if (isset($name)) { return "/_data_stream/$name"; } @@ -41,7 +43,11 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/Indices/DeleteIndexTemplate.php b/src/OpenSearch/Endpoints/Indices/DeleteIndexTemplate.php index 068098fe..41f340d1 100644 --- a/src/OpenSearch/Endpoints/Indices/DeleteIndexTemplate.php +++ b/src/OpenSearch/Endpoints/Indices/DeleteIndexTemplate.php @@ -24,6 +24,9 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class DeleteIndexTemplate extends AbstractEndpoint { protected $name; @@ -31,7 +34,6 @@ class DeleteIndexTemplate extends AbstractEndpoint public function getURI(): string { $name = $this->name ?? null; - if (isset($name)) { return "/_index_template/$name"; } @@ -41,9 +43,14 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'timeout', + 'cluster_manager_timeout', 'master_timeout', - 'cluster_manager_timeout' + 'timeout', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -61,6 +68,7 @@ public function setName($name): DeleteIndexTemplate return $this; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Indices/DeleteTemplate.php b/src/OpenSearch/Endpoints/Indices/DeleteTemplate.php index 9acf2830..40f3c92e 100644 --- a/src/OpenSearch/Endpoints/Indices/DeleteTemplate.php +++ b/src/OpenSearch/Endpoints/Indices/DeleteTemplate.php @@ -24,6 +24,9 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class DeleteTemplate extends AbstractEndpoint { protected $name; @@ -31,7 +34,6 @@ class DeleteTemplate extends AbstractEndpoint public function getURI(): string { $name = $this->name ?? null; - if (isset($name)) { return "/_template/$name"; } @@ -41,9 +43,14 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'timeout', + 'cluster_manager_timeout', 'master_timeout', - 'cluster_manager_timeout' + 'timeout', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -61,6 +68,7 @@ public function setName($name): DeleteTemplate return $this; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Indices/Exists.php b/src/OpenSearch/Endpoints/Indices/Exists.php index 0ef5e602..9d90b98f 100644 --- a/src/OpenSearch/Endpoints/Indices/Exists.php +++ b/src/OpenSearch/Endpoints/Indices/Exists.php @@ -24,12 +24,14 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Exists extends AbstractEndpoint { public function getURI(): string { $index = $this->index ?? null; - if (isset($index)) { return "/$index"; } @@ -39,12 +41,17 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'local', - 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'flat_settings', - 'include_defaults' + 'ignore_unavailable', + 'include_defaults', + 'local', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/Indices/ExistsAlias.php b/src/OpenSearch/Endpoints/Indices/ExistsAlias.php index 33699a7d..5b391dd1 100644 --- a/src/OpenSearch/Endpoints/Indices/ExistsAlias.php +++ b/src/OpenSearch/Endpoints/Indices/ExistsAlias.php @@ -49,9 +49,9 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', + 'ignore_unavailable', 'local', 'pretty', 'human', diff --git a/src/OpenSearch/Endpoints/Indices/ExistsIndexTemplate.php b/src/OpenSearch/Endpoints/Indices/ExistsIndexTemplate.php index 010c7226..437baf77 100644 --- a/src/OpenSearch/Endpoints/Indices/ExistsIndexTemplate.php +++ b/src/OpenSearch/Endpoints/Indices/ExistsIndexTemplate.php @@ -24,6 +24,9 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class ExistsIndexTemplate extends AbstractEndpoint { protected $name; @@ -31,7 +34,6 @@ class ExistsIndexTemplate extends AbstractEndpoint public function getURI(): string { $name = $this->name ?? null; - if (isset($name)) { return "/_index_template/$name"; } @@ -41,10 +43,15 @@ public function getURI(): string public function getParamWhitelist(): array { return [ + 'cluster_manager_timeout', 'flat_settings', - 'master_timeout', 'local', - 'cluster_manager_timeout' + 'master_timeout', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -62,6 +69,7 @@ public function setName($name): ExistsIndexTemplate return $this; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Indices/ExistsTemplate.php b/src/OpenSearch/Endpoints/Indices/ExistsTemplate.php index 8b9ac82b..02390314 100644 --- a/src/OpenSearch/Endpoints/Indices/ExistsTemplate.php +++ b/src/OpenSearch/Endpoints/Indices/ExistsTemplate.php @@ -24,6 +24,9 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class ExistsTemplate extends AbstractEndpoint { protected $name; @@ -31,7 +34,6 @@ class ExistsTemplate extends AbstractEndpoint public function getURI(): string { $name = $this->name ?? null; - if (isset($name)) { return "/_template/$name"; } @@ -41,10 +43,15 @@ public function getURI(): string public function getParamWhitelist(): array { return [ + 'cluster_manager_timeout', 'flat_settings', - 'master_timeout', 'local', - 'cluster_manager_timeout' + 'master_timeout', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -65,6 +72,7 @@ public function setName($name): ExistsTemplate return $this; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Indices/Flush.php b/src/OpenSearch/Endpoints/Indices/Flush.php index e472e131..b83d0112 100644 --- a/src/OpenSearch/Endpoints/Indices/Flush.php +++ b/src/OpenSearch/Endpoints/Indices/Flush.php @@ -23,12 +23,14 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Flush extends AbstractEndpoint { public function getURI(): string { $index = $this->index ?? null; - if (isset($index)) { return "/$index/_flush"; } @@ -38,11 +40,16 @@ public function getURI(): string public function getParamWhitelist(): array { return [ + 'allow_no_indices', + 'expand_wildcards', 'force', - 'wait_if_ongoing', 'ignore_unavailable', - 'allow_no_indices', - 'expand_wildcards' + 'wait_if_ongoing', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/Indices/ForceMerge.php b/src/OpenSearch/Endpoints/Indices/ForceMerge.php index 93f0eb45..19416ef2 100644 --- a/src/OpenSearch/Endpoints/Indices/ForceMerge.php +++ b/src/OpenSearch/Endpoints/Indices/ForceMerge.php @@ -40,13 +40,13 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'flush', - 'primary_only', - 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', + 'flush', + 'ignore_unavailable', 'max_num_segments', 'only_expunge_deletes', + 'primary_only', 'wait_for_completion', 'pretty', 'human', diff --git a/src/OpenSearch/Endpoints/Indices/Freeze.php b/src/OpenSearch/Endpoints/Indices/Freeze.php deleted file mode 100644 index d2dbd7c0..00000000 --- a/src/OpenSearch/Endpoints/Indices/Freeze.php +++ /dev/null @@ -1,60 +0,0 @@ -index ?? null; - - if (isset($index)) { - return "/$index/_freeze"; - } - throw new RuntimeException('Missing parameter for the endpoint indices.freeze'); - } - - public function getParamWhitelist(): array - { - return [ - 'timeout', - 'master_timeout', - 'ignore_unavailable', - 'allow_no_indices', - 'expand_wildcards', - 'wait_for_active_shards', - 'cluster_manager_timeout' - ]; - } - - public function getMethod(): string - { - return 'POST'; - } - protected function getParamDeprecation(): array - { - return ['master_timeout' => 'cluster_manager_timeout']; - } -} diff --git a/src/OpenSearch/Endpoints/Indices/Get.php b/src/OpenSearch/Endpoints/Indices/Get.php index 5a1543cc..fa1f85c6 100644 --- a/src/OpenSearch/Endpoints/Indices/Get.php +++ b/src/OpenSearch/Endpoints/Indices/Get.php @@ -24,12 +24,14 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Get extends AbstractEndpoint { public function getURI(): string { $index = $this->index ?? null; - if (isset($index)) { return "/$index"; } @@ -39,14 +41,19 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'local', - 'ignore_unavailable', 'allow_no_indices', + 'cluster_manager_timeout', 'expand_wildcards', 'flat_settings', + 'ignore_unavailable', 'include_defaults', + 'local', 'master_timeout', - 'cluster_manager_timeout' + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -54,6 +61,7 @@ public function getMethod(): string { return 'GET'; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Indices/GetAlias.php b/src/OpenSearch/Endpoints/Indices/GetAlias.php index c406b50f..1a2cdc76 100644 --- a/src/OpenSearch/Endpoints/Indices/GetAlias.php +++ b/src/OpenSearch/Endpoints/Indices/GetAlias.php @@ -49,9 +49,9 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', + 'ignore_unavailable', 'local', 'pretty', 'human', diff --git a/src/OpenSearch/Endpoints/Indices/GetFieldMapping.php b/src/OpenSearch/Endpoints/Indices/GetFieldMapping.php index 81b49735..aa2db2de 100644 --- a/src/OpenSearch/Endpoints/Indices/GetFieldMapping.php +++ b/src/OpenSearch/Endpoints/Indices/GetFieldMapping.php @@ -49,10 +49,10 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'include_defaults', - 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', + 'ignore_unavailable', + 'include_defaults', 'local', 'pretty', 'human', diff --git a/src/OpenSearch/Endpoints/Indices/GetIndexTemplate.php b/src/OpenSearch/Endpoints/Indices/GetIndexTemplate.php index 04d58048..84915edd 100644 --- a/src/OpenSearch/Endpoints/Indices/GetIndexTemplate.php +++ b/src/OpenSearch/Endpoints/Indices/GetIndexTemplate.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class GetIndexTemplate extends AbstractEndpoint { protected $name; @@ -30,7 +33,6 @@ class GetIndexTemplate extends AbstractEndpoint public function getURI(): string { $name = $this->name ?? null; - if (isset($name)) { return "/_index_template/$name"; } @@ -40,10 +42,15 @@ public function getURI(): string public function getParamWhitelist(): array { return [ + 'cluster_manager_timeout', 'flat_settings', - 'master_timeout', 'local', - 'cluster_manager_timeout' + 'master_timeout', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -64,6 +71,7 @@ public function setName($name): GetIndexTemplate return $this; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Indices/GetMapping.php b/src/OpenSearch/Endpoints/Indices/GetMapping.php index f88bf11a..0641e8ed 100644 --- a/src/OpenSearch/Endpoints/Indices/GetMapping.php +++ b/src/OpenSearch/Endpoints/Indices/GetMapping.php @@ -40,12 +40,12 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'ignore_unavailable', 'allow_no_indices', - 'expand_wildcards', - 'master_timeout', 'cluster_manager_timeout', + 'expand_wildcards', + 'ignore_unavailable', 'local', + 'master_timeout', 'pretty', 'human', 'error_trace', diff --git a/src/OpenSearch/Endpoints/Indices/GetSettings.php b/src/OpenSearch/Endpoints/Indices/GetSettings.php index 537d3def..6f0aa1b5 100644 --- a/src/OpenSearch/Endpoints/Indices/GetSettings.php +++ b/src/OpenSearch/Endpoints/Indices/GetSettings.php @@ -49,14 +49,14 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'master_timeout', - 'cluster_manager_timeout', - 'ignore_unavailable', 'allow_no_indices', + 'cluster_manager_timeout', 'expand_wildcards', 'flat_settings', - 'local', + 'ignore_unavailable', 'include_defaults', + 'local', + 'master_timeout', 'pretty', 'human', 'error_trace', diff --git a/src/OpenSearch/Endpoints/Indices/GetTemplate.php b/src/OpenSearch/Endpoints/Indices/GetTemplate.php index 0ff5d7b6..83568eb6 100644 --- a/src/OpenSearch/Endpoints/Indices/GetTemplate.php +++ b/src/OpenSearch/Endpoints/Indices/GetTemplate.php @@ -42,10 +42,10 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'flat_settings', - 'master_timeout', 'cluster_manager_timeout', + 'flat_settings', 'local', + 'master_timeout', 'pretty', 'human', 'error_trace', diff --git a/src/OpenSearch/Endpoints/Indices/GetUpgrade.php b/src/OpenSearch/Endpoints/Indices/GetUpgrade.php index d5156153..1fc57db5 100644 --- a/src/OpenSearch/Endpoints/Indices/GetUpgrade.php +++ b/src/OpenSearch/Endpoints/Indices/GetUpgrade.php @@ -40,9 +40,9 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', + 'ignore_unavailable', 'pretty', 'human', 'error_trace', diff --git a/src/OpenSearch/Endpoints/Indices/Open.php b/src/OpenSearch/Endpoints/Indices/Open.php index e627df62..8b410b2c 100644 --- a/src/OpenSearch/Endpoints/Indices/Open.php +++ b/src/OpenSearch/Endpoints/Indices/Open.php @@ -24,12 +24,14 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Open extends AbstractEndpoint { public function getURI(): string { $index = $this->index ?? null; - if (isset($index)) { return "/$index/_open"; } @@ -39,13 +41,20 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'timeout', - 'master_timeout', - 'ignore_unavailable', 'allow_no_indices', + 'cluster_manager_timeout', 'expand_wildcards', + 'ignore_unavailable', + 'master_timeout', + 'task_execution_timeout', + 'timeout', 'wait_for_active_shards', - 'cluster_manager_timeout' + 'wait_for_completion', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -53,6 +62,7 @@ public function getMethod(): string { return 'POST'; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Indices/PutAlias.php b/src/OpenSearch/Endpoints/Indices/PutAlias.php index b30e28d1..a4d28852 100644 --- a/src/OpenSearch/Endpoints/Indices/PutAlias.php +++ b/src/OpenSearch/Endpoints/Indices/PutAlias.php @@ -51,9 +51,9 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'timeout', - 'master_timeout', 'cluster_manager_timeout', + 'master_timeout', + 'timeout', 'pretty', 'human', 'error_trace', diff --git a/src/OpenSearch/Endpoints/Indices/PutIndexTemplate.php b/src/OpenSearch/Endpoints/Indices/PutIndexTemplate.php index b215ff09..52713029 100644 --- a/src/OpenSearch/Endpoints/Indices/PutIndexTemplate.php +++ b/src/OpenSearch/Endpoints/Indices/PutIndexTemplate.php @@ -24,6 +24,9 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class PutIndexTemplate extends AbstractEndpoint { protected $name; @@ -31,7 +34,6 @@ class PutIndexTemplate extends AbstractEndpoint public function getURI(): string { $name = $this->name ?? null; - if (isset($name)) { return "/_index_template/$name"; } @@ -41,10 +43,15 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'create', 'cause', + 'cluster_manager_timeout', + 'create', 'master_timeout', - 'cluster_manager_timeout' + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -72,6 +79,7 @@ public function setName($name): PutIndexTemplate return $this; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Indices/PutMapping.php b/src/OpenSearch/Endpoints/Indices/PutMapping.php index d1a12240..fd10a888 100644 --- a/src/OpenSearch/Endpoints/Indices/PutMapping.php +++ b/src/OpenSearch/Endpoints/Indices/PutMapping.php @@ -24,6 +24,9 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class PutMapping extends AbstractEndpoint { public function getURI(): string @@ -38,13 +41,18 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'timeout', - 'master_timeout', - 'ignore_unavailable', 'allow_no_indices', + 'cluster_manager_timeout', 'expand_wildcards', + 'ignore_unavailable', + 'master_timeout', + 'timeout', 'write_index_only', - 'cluster_manager_timeout' + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -62,6 +70,7 @@ public function setBody($body): PutMapping return $this; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Indices/PutSettings.php b/src/OpenSearch/Endpoints/Indices/PutSettings.php index 3f1af2eb..332b2286 100644 --- a/src/OpenSearch/Endpoints/Indices/PutSettings.php +++ b/src/OpenSearch/Endpoints/Indices/PutSettings.php @@ -40,14 +40,14 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'master_timeout', - 'cluster_manager_timeout', - 'timeout', - 'preserve_existing', - 'ignore_unavailable', 'allow_no_indices', + 'cluster_manager_timeout', 'expand_wildcards', 'flat_settings', + 'ignore_unavailable', + 'master_timeout', + 'preserve_existing', + 'timeout', 'pretty', 'human', 'error_trace', diff --git a/src/OpenSearch/Endpoints/Indices/PutTemplate.php b/src/OpenSearch/Endpoints/Indices/PutTemplate.php index 26c7d14b..90c581a3 100644 --- a/src/OpenSearch/Endpoints/Indices/PutTemplate.php +++ b/src/OpenSearch/Endpoints/Indices/PutTemplate.php @@ -24,6 +24,9 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class PutTemplate extends AbstractEndpoint { protected $name; @@ -31,7 +34,6 @@ class PutTemplate extends AbstractEndpoint public function getURI(): string { $name = $this->name ?? null; - if (isset($name)) { return "/_template/$name"; } @@ -41,10 +43,15 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'order', + 'cluster_manager_timeout', 'create', 'master_timeout', - 'cluster_manager_timeout' + 'order', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -72,6 +79,7 @@ public function setName($name): PutTemplate return $this; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Indices/Recovery.php b/src/OpenSearch/Endpoints/Indices/Recovery.php index ed8e61fe..7fd60c92 100644 --- a/src/OpenSearch/Endpoints/Indices/Recovery.php +++ b/src/OpenSearch/Endpoints/Indices/Recovery.php @@ -40,8 +40,8 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'detailed', 'active_only', + 'detailed', 'pretty', 'human', 'error_trace', diff --git a/src/OpenSearch/Endpoints/Indices/Refresh.php b/src/OpenSearch/Endpoints/Indices/Refresh.php index 14e7e1ea..13bd3fac 100644 --- a/src/OpenSearch/Endpoints/Indices/Refresh.php +++ b/src/OpenSearch/Endpoints/Indices/Refresh.php @@ -23,12 +23,14 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Refresh extends AbstractEndpoint { public function getURI(): string { $index = $this->index ?? null; - if (isset($index)) { return "/$index/_refresh"; } @@ -38,9 +40,14 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'ignore_unavailable', 'allow_no_indices', - 'expand_wildcards' + 'expand_wildcards', + 'ignore_unavailable', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/Indices/ReloadSearchAnalyzers.php b/src/OpenSearch/Endpoints/Indices/ReloadSearchAnalyzers.php deleted file mode 100644 index d30509fe..00000000 --- a/src/OpenSearch/Endpoints/Indices/ReloadSearchAnalyzers.php +++ /dev/null @@ -1,52 +0,0 @@ -index ?? null; - - if (isset($index)) { - return "/$index/_reload_search_analyzers"; - } - throw new RuntimeException('Missing parameter for the endpoint indices.reload_search_analyzers'); - } - - public function getParamWhitelist(): array - { - return [ - 'ignore_unavailable', - 'allow_no_indices', - 'expand_wildcards' - ]; - } - - public function getMethod(): string - { - return 'GET'; - } -} diff --git a/src/OpenSearch/Endpoints/Indices/ResolveIndex.php b/src/OpenSearch/Endpoints/Indices/ResolveIndex.php index 204ecac7..c6d2fec0 100644 --- a/src/OpenSearch/Endpoints/Indices/ResolveIndex.php +++ b/src/OpenSearch/Endpoints/Indices/ResolveIndex.php @@ -24,6 +24,9 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class ResolveIndex extends AbstractEndpoint { protected $name; @@ -31,7 +34,6 @@ class ResolveIndex extends AbstractEndpoint public function getURI(): string { $name = $this->name ?? null; - if (isset($name)) { return "/_resolve/index/$name"; } @@ -41,7 +43,12 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'expand_wildcards' + 'expand_wildcards', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/Indices/Rollover.php b/src/OpenSearch/Endpoints/Indices/Rollover.php index 75a00ebb..0f4ec259 100644 --- a/src/OpenSearch/Endpoints/Indices/Rollover.php +++ b/src/OpenSearch/Endpoints/Indices/Rollover.php @@ -50,10 +50,10 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'timeout', + 'cluster_manager_timeout', 'dry_run', 'master_timeout', - 'cluster_manager_timeout', + 'timeout', 'wait_for_active_shards', 'pretty', 'human', diff --git a/src/OpenSearch/Endpoints/Indices/Segments.php b/src/OpenSearch/Endpoints/Indices/Segments.php index c835c68b..1f81d605 100644 --- a/src/OpenSearch/Endpoints/Indices/Segments.php +++ b/src/OpenSearch/Endpoints/Indices/Segments.php @@ -40,9 +40,9 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', + 'ignore_unavailable', 'verbose', 'pretty', 'human', diff --git a/src/OpenSearch/Endpoints/Indices/ShardStores.php b/src/OpenSearch/Endpoints/Indices/ShardStores.php index 7d524851..97130e44 100644 --- a/src/OpenSearch/Endpoints/Indices/ShardStores.php +++ b/src/OpenSearch/Endpoints/Indices/ShardStores.php @@ -40,10 +40,10 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'status', - 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', + 'ignore_unavailable', + 'status', 'pretty', 'human', 'error_trace', diff --git a/src/OpenSearch/Endpoints/Indices/Shrink.php b/src/OpenSearch/Endpoints/Indices/Shrink.php index 26e833a7..8806b7e6 100644 --- a/src/OpenSearch/Endpoints/Indices/Shrink.php +++ b/src/OpenSearch/Endpoints/Indices/Shrink.php @@ -24,6 +24,9 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Shrink extends AbstractEndpoint { protected $target; @@ -32,7 +35,6 @@ public function getURI(): string { $index = $this->index ?? null; $target = $this->target ?? null; - if (isset($index) && isset($target)) { return "/$index/_shrink/$target"; } @@ -42,11 +44,18 @@ public function getURI(): string public function getParamWhitelist(): array { return [ + 'cluster_manager_timeout', 'copy_settings', - 'timeout', 'master_timeout', + 'task_execution_timeout', + 'timeout', 'wait_for_active_shards', - 'cluster_manager_timeout' + 'wait_for_completion', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -74,6 +83,7 @@ public function setTarget($target): Shrink return $this; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Indices/SimulateIndexTemplate.php b/src/OpenSearch/Endpoints/Indices/SimulateIndexTemplate.php index c2961c45..cc987ae2 100644 --- a/src/OpenSearch/Endpoints/Indices/SimulateIndexTemplate.php +++ b/src/OpenSearch/Endpoints/Indices/SimulateIndexTemplate.php @@ -24,6 +24,9 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class SimulateIndexTemplate extends AbstractEndpoint { protected $name; @@ -31,7 +34,6 @@ class SimulateIndexTemplate extends AbstractEndpoint public function getURI(): string { $name = $this->name ?? null; - if (isset($name)) { return "/_index_template/_simulate_index/$name"; } @@ -41,10 +43,15 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'create', 'cause', + 'cluster_manager_timeout', + 'create', 'master_timeout', - 'cluster_manager_timeout' + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -72,6 +79,7 @@ public function setName($name): SimulateIndexTemplate return $this; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Indices/SimulateTemplate.php b/src/OpenSearch/Endpoints/Indices/SimulateTemplate.php index cba31a84..8aa2c0ff 100644 --- a/src/OpenSearch/Endpoints/Indices/SimulateTemplate.php +++ b/src/OpenSearch/Endpoints/Indices/SimulateTemplate.php @@ -42,10 +42,10 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'create', 'cause', - 'master_timeout', 'cluster_manager_timeout', + 'create', + 'master_timeout', 'pretty', 'human', 'error_trace', diff --git a/src/OpenSearch/Endpoints/Indices/Split.php b/src/OpenSearch/Endpoints/Indices/Split.php index 500922af..6559b881 100644 --- a/src/OpenSearch/Endpoints/Indices/Split.php +++ b/src/OpenSearch/Endpoints/Indices/Split.php @@ -24,6 +24,9 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Split extends AbstractEndpoint { protected $target; @@ -32,7 +35,6 @@ public function getURI(): string { $index = $this->index ?? null; $target = $this->target ?? null; - if (isset($index) && isset($target)) { return "/$index/_split/$target"; } @@ -42,11 +44,18 @@ public function getURI(): string public function getParamWhitelist(): array { return [ + 'cluster_manager_timeout', 'copy_settings', - 'timeout', 'master_timeout', + 'task_execution_timeout', + 'timeout', 'wait_for_active_shards', - 'cluster_manager_timeout' + 'wait_for_completion', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -74,6 +83,7 @@ public function setTarget($target): Split return $this; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Indices/Stats.php b/src/OpenSearch/Endpoints/Indices/Stats.php index 3a2525e3..86195e16 100644 --- a/src/OpenSearch/Endpoints/Indices/Stats.php +++ b/src/OpenSearch/Endpoints/Indices/Stats.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Stats extends AbstractEndpoint { protected $metric; @@ -31,7 +34,6 @@ public function getURI(): string { $metric = $this->metric ?? null; $index = $this->index ?? null; - if (isset($index) && isset($metric)) { return "/$index/_stats/$metric"; } @@ -48,15 +50,19 @@ public function getParamWhitelist(): array { return [ 'completion_fields', + 'expand_wildcards', 'fielddata_fields', 'fields', + 'forbid_closed_indices', 'groups', - 'level', - 'types', 'include_segment_file_sizes', 'include_unloaded_segments', - 'expand_wildcards', - 'forbid_closed_indices' + 'level', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/Indices/Unfreeze.php b/src/OpenSearch/Endpoints/Indices/Unfreeze.php deleted file mode 100644 index 136864e1..00000000 --- a/src/OpenSearch/Endpoints/Indices/Unfreeze.php +++ /dev/null @@ -1,60 +0,0 @@ -index ?? null; - - if (isset($index)) { - return "/$index/_unfreeze"; - } - throw new RuntimeException('Missing parameter for the endpoint indices.unfreeze'); - } - - public function getParamWhitelist(): array - { - return [ - 'timeout', - 'master_timeout', - 'ignore_unavailable', - 'allow_no_indices', - 'expand_wildcards', - 'wait_for_active_shards', - 'cluster_manager_timeout' - ]; - } - - public function getMethod(): string - { - return 'POST'; - } - protected function getParamDeprecation(): array - { - return ['master_timeout' => 'cluster_manager_timeout']; - } -} diff --git a/src/OpenSearch/Endpoints/Indices/UpdateAliases.php b/src/OpenSearch/Endpoints/Indices/UpdateAliases.php index 91914efe..fea7b223 100644 --- a/src/OpenSearch/Endpoints/Indices/UpdateAliases.php +++ b/src/OpenSearch/Endpoints/Indices/UpdateAliases.php @@ -36,9 +36,9 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'timeout', - 'master_timeout', 'cluster_manager_timeout', + 'master_timeout', + 'timeout', 'pretty', 'human', 'error_trace', diff --git a/src/OpenSearch/Endpoints/Indices/Upgrade.php b/src/OpenSearch/Endpoints/Indices/Upgrade.php index d8616500..3d6ae289 100644 --- a/src/OpenSearch/Endpoints/Indices/Upgrade.php +++ b/src/OpenSearch/Endpoints/Indices/Upgrade.php @@ -43,8 +43,8 @@ public function getParamWhitelist(): array 'allow_no_indices', 'expand_wildcards', 'ignore_unavailable', - 'wait_for_completion', 'only_ancient_segments', + 'wait_for_completion', 'pretty', 'human', 'error_trace', diff --git a/src/OpenSearch/Endpoints/Indices/ValidateQuery.php b/src/OpenSearch/Endpoints/Indices/ValidateQuery.php index a7ebfe49..b6d6bda7 100644 --- a/src/OpenSearch/Endpoints/Indices/ValidateQuery.php +++ b/src/OpenSearch/Endpoints/Indices/ValidateQuery.php @@ -40,18 +40,18 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'explain', - 'ignore_unavailable', + 'all_shards', 'allow_no_indices', - 'expand_wildcards', - 'q', - 'analyzer', 'analyze_wildcard', + 'analyzer', 'default_operator', 'df', + 'expand_wildcards', + 'explain', + 'ignore_unavailable', 'lenient', + 'q', 'rewrite', - 'all_shards', 'pretty', 'human', 'error_trace', diff --git a/src/OpenSearch/Endpoints/Ingest/DeletePipeline.php b/src/OpenSearch/Endpoints/Ingest/DeletePipeline.php index 70324b58..aacb475b 100644 --- a/src/OpenSearch/Endpoints/Ingest/DeletePipeline.php +++ b/src/OpenSearch/Endpoints/Ingest/DeletePipeline.php @@ -24,12 +24,14 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class DeletePipeline extends AbstractEndpoint { public function getURI(): string { $id = $this->id ?? null; - if (isset($id)) { return "/_ingest/pipeline/$id"; } @@ -39,9 +41,14 @@ public function getURI(): string public function getParamWhitelist(): array { return [ + 'cluster_manager_timeout', 'master_timeout', 'timeout', - 'cluster_manager_timeout' + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -49,6 +56,7 @@ public function getMethod(): string { return 'DELETE'; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Ingest/GetPipeline.php b/src/OpenSearch/Endpoints/Ingest/GetPipeline.php index 5de380fb..49d7c0aa 100644 --- a/src/OpenSearch/Endpoints/Ingest/GetPipeline.php +++ b/src/OpenSearch/Endpoints/Ingest/GetPipeline.php @@ -40,8 +40,8 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'master_timeout', 'cluster_manager_timeout', + 'master_timeout', 'pretty', 'human', 'error_trace', diff --git a/src/OpenSearch/Endpoints/Ingest/PutPipeline.php b/src/OpenSearch/Endpoints/Ingest/PutPipeline.php index 38767ce2..9205cbc4 100644 --- a/src/OpenSearch/Endpoints/Ingest/PutPipeline.php +++ b/src/OpenSearch/Endpoints/Ingest/PutPipeline.php @@ -24,12 +24,14 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class PutPipeline extends AbstractEndpoint { public function getURI(): string { $id = $this->id ?? null; - if (isset($id)) { return "/_ingest/pipeline/$id"; } @@ -39,9 +41,14 @@ public function getURI(): string public function getParamWhitelist(): array { return [ + 'cluster_manager_timeout', 'master_timeout', 'timeout', - 'cluster_manager_timeout' + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -59,6 +66,7 @@ public function setBody($body): PutPipeline return $this; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Knn/DeleteModel.php b/src/OpenSearch/Endpoints/Knn/DeleteModel.php new file mode 100644 index 00000000..e4afbc05 --- /dev/null +++ b/src/OpenSearch/Endpoints/Knn/DeleteModel.php @@ -0,0 +1,62 @@ +model_id ?? null; + if (isset($model_id)) { + return "/_plugins/_knn/models/$model_id"; + } + throw new RuntimeException('Missing parameter for the endpoint knn.delete_model'); + } + + public function getParamWhitelist(): array + { + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setModelId($model_id): DeleteModel + { + if (isset($model_id) !== true) { + return $this; + } + $this->model_id = $model_id; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Knn/GetModel.php b/src/OpenSearch/Endpoints/Knn/GetModel.php new file mode 100644 index 00000000..c8d2e927 --- /dev/null +++ b/src/OpenSearch/Endpoints/Knn/GetModel.php @@ -0,0 +1,62 @@ +model_id ?? null; + if (isset($model_id)) { + return "/_plugins/_knn/models/$model_id"; + } + throw new RuntimeException('Missing parameter for the endpoint knn.get_model'); + } + + public function getParamWhitelist(): array + { + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setModelId($model_id): GetModel + { + if (isset($model_id) !== true) { + return $this; + } + $this->model_id = $model_id; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Knn/SearchModels.php b/src/OpenSearch/Endpoints/Knn/SearchModels.php new file mode 100644 index 00000000..23e988cd --- /dev/null +++ b/src/OpenSearch/Endpoints/Knn/SearchModels.php @@ -0,0 +1,97 @@ +body) ? 'POST' : 'GET'; + } + + public function setBody($body): SearchModels + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Knn/Stats.php b/src/OpenSearch/Endpoints/Knn/Stats.php new file mode 100644 index 00000000..a5fac196 --- /dev/null +++ b/src/OpenSearch/Endpoints/Knn/Stats.php @@ -0,0 +1,86 @@ +node_id ?? null; + $stat = $this->stat ?? null; + if (isset($node_id) && isset($stat)) { + return "/_plugins/_knn/$node_id/stats/$stat"; + } + if (isset($node_id)) { + return "/_plugins/_knn/$node_id/stats"; + } + if (isset($stat)) { + return "/_plugins/_knn/stats/$stat"; + } + return "/_plugins/_knn/stats"; + } + + public function getParamWhitelist(): array + { + return [ + 'timeout', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setNodeId($node_id): Stats + { + if (isset($node_id) !== true) { + return $this; + } + if (is_array($node_id) === true) { + $node_id = implode(",", $node_id); + } + $this->node_id = $node_id; + + return $this; + } + + public function setStat($stat): Stats + { + if (isset($stat) !== true) { + return $this; + } + if (is_array($stat) === true) { + $stat = implode(",", $stat); + } + $this->stat = $stat; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Knn/TrainModel.php b/src/OpenSearch/Endpoints/Knn/TrainModel.php new file mode 100644 index 00000000..19b8d807 --- /dev/null +++ b/src/OpenSearch/Endpoints/Knn/TrainModel.php @@ -0,0 +1,72 @@ +model_id ?? null; + if (isset($model_id)) { + return "/_plugins/_knn/models/$model_id/_train"; + } + return "/_plugins/_knn/models/_train"; + } + + public function getParamWhitelist(): array + { + return [ + 'preference', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): TrainModel + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setModelId($model_id): TrainModel + { + if (isset($model_id) !== true) { + return $this; + } + $this->model_id = $model_id; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Knn/Warmup.php b/src/OpenSearch/Endpoints/Knn/Warmup.php new file mode 100644 index 00000000..7251ae6b --- /dev/null +++ b/src/OpenSearch/Endpoints/Knn/Warmup.php @@ -0,0 +1,52 @@ +index) !== true) { + throw new RuntimeException( + 'index is required for warmup' + ); + } + $index = $this->index; + return "/_plugins/_knn/warmup/$index"; + } + + public function getParamWhitelist(): array + { + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/src/OpenSearch/Endpoints/MTermVectors.php b/src/OpenSearch/Endpoints/MTermVectors.php index 77960aa3..11afa11e 100644 --- a/src/OpenSearch/Endpoints/MTermVectors.php +++ b/src/OpenSearch/Endpoints/MTermVectors.php @@ -40,16 +40,16 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'ids', - 'term_statistics', 'field_statistics', 'fields', + 'ids', 'offsets', - 'positions', 'payloads', + 'positions', 'preference', - 'routing', 'realtime', + 'routing', + 'term_statistics', 'version', 'version_type', 'pretty', diff --git a/src/OpenSearch/Endpoints/Mget.php b/src/OpenSearch/Endpoints/Mget.php index b43477f0..e1a57615 100644 --- a/src/OpenSearch/Endpoints/Mget.php +++ b/src/OpenSearch/Endpoints/Mget.php @@ -40,14 +40,14 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'stored_fields', + '_source', + '_source_excludes', + '_source_includes', 'preference', 'realtime', 'refresh', 'routing', - '_source', - '_source_excludes', - '_source_includes', + 'stored_fields', 'pretty', 'human', 'error_trace', diff --git a/src/OpenSearch/Endpoints/Msearch.php b/src/OpenSearch/Endpoints/Msearch.php index 753b6608..e2a5fb6e 100644 --- a/src/OpenSearch/Endpoints/Msearch.php +++ b/src/OpenSearch/Endpoints/Msearch.php @@ -26,6 +26,9 @@ use OpenSearch\Serializers\SerializerInterface; use Traversable; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Msearch extends AbstractEndpoint { public function __construct(SerializerInterface $serializer) @@ -45,13 +48,18 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'search_type', + 'ccs_minimize_roundtrips', 'max_concurrent_searches', - 'typed_keys', - 'pre_filter_shard_size', 'max_concurrent_shard_requests', + 'pre_filter_shard_size', 'rest_total_hits_as_int', - 'ccs_minimize_roundtrips' + 'search_type', + 'typed_keys', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/MsearchTemplate.php b/src/OpenSearch/Endpoints/MsearchTemplate.php index 0ef26052..560c62d8 100644 --- a/src/OpenSearch/Endpoints/MsearchTemplate.php +++ b/src/OpenSearch/Endpoints/MsearchTemplate.php @@ -26,6 +26,9 @@ use OpenSearch\Serializers\SerializerInterface; use Traversable; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class MsearchTemplate extends AbstractEndpoint { public function __construct(SerializerInterface $serializer) @@ -45,11 +48,16 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'search_type', - 'typed_keys', + 'ccs_minimize_roundtrips', 'max_concurrent_searches', 'rest_total_hits_as_int', - 'ccs_minimize_roundtrips' + 'search_type', + 'typed_keys', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/Nodes/HotThreads.php b/src/OpenSearch/Endpoints/Nodes/HotThreads.php index ef8d8cb6..ab4e0a97 100644 --- a/src/OpenSearch/Endpoints/Nodes/HotThreads.php +++ b/src/OpenSearch/Endpoints/Nodes/HotThreads.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class HotThreads extends AbstractEndpoint { protected $node_id; @@ -30,7 +33,6 @@ class HotThreads extends AbstractEndpoint public function getURI(): string { $node_id = $this->node_id ?? null; - if (isset($node_id)) { return "/_nodes/$node_id/hot_threads"; } @@ -40,12 +42,17 @@ public function getURI(): string public function getParamWhitelist(): array { return [ + 'ignore_idle_threads', 'interval', 'snapshots', 'threads', - 'ignore_idle_threads', + 'timeout', 'type', - 'timeout' + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/Nodes/Stats.php b/src/OpenSearch/Endpoints/Nodes/Stats.php index 981a82b9..1758d29f 100644 --- a/src/OpenSearch/Endpoints/Nodes/Stats.php +++ b/src/OpenSearch/Endpoints/Nodes/Stats.php @@ -62,10 +62,10 @@ public function getParamWhitelist(): array 'fielddata_fields', 'fields', 'groups', + 'include_segment_file_sizes', 'level', - 'types', 'timeout', - 'include_segment_file_sizes', + 'types', 'pretty', 'human', 'error_trace', diff --git a/src/OpenSearch/Endpoints/Notifications/CreateConfig.php b/src/OpenSearch/Endpoints/Notifications/CreateConfig.php new file mode 100644 index 00000000..72ddf593 --- /dev/null +++ b/src/OpenSearch/Endpoints/Notifications/CreateConfig.php @@ -0,0 +1,55 @@ +body = $body; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Notifications/DeleteConfig.php b/src/OpenSearch/Endpoints/Notifications/DeleteConfig.php new file mode 100644 index 00000000..afe39ff2 --- /dev/null +++ b/src/OpenSearch/Endpoints/Notifications/DeleteConfig.php @@ -0,0 +1,62 @@ +config_id ?? null; + if (isset($config_id)) { + return "/_plugins/_notifications/configs/$config_id"; + } + throw new RuntimeException('Missing parameter for the endpoint notifications.delete_config'); + } + + public function getParamWhitelist(): array + { + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setConfigId($config_id): DeleteConfig + { + if (isset($config_id) !== true) { + return $this; + } + $this->config_id = $config_id; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Notifications/DeleteConfigs.php b/src/OpenSearch/Endpoints/Notifications/DeleteConfigs.php new file mode 100644 index 00000000..5227e2db --- /dev/null +++ b/src/OpenSearch/Endpoints/Notifications/DeleteConfigs.php @@ -0,0 +1,47 @@ +config_id ?? null; + if (isset($config_id)) { + return "/_plugins/_notifications/configs/$config_id"; + } + throw new RuntimeException('Missing parameter for the endpoint notifications.get_config'); + } + + public function getParamWhitelist(): array + { + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setConfigId($config_id): GetConfig + { + if (isset($config_id) !== true) { + return $this; + } + $this->config_id = $config_id; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Notifications/GetConfigs.php b/src/OpenSearch/Endpoints/Notifications/GetConfigs.php new file mode 100644 index 00000000..34ac9b41 --- /dev/null +++ b/src/OpenSearch/Endpoints/Notifications/GetConfigs.php @@ -0,0 +1,93 @@ +body = $body; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Notifications/ListChannels.php b/src/OpenSearch/Endpoints/Notifications/ListChannels.php new file mode 100644 index 00000000..f0d9864c --- /dev/null +++ b/src/OpenSearch/Endpoints/Notifications/ListChannels.php @@ -0,0 +1,45 @@ +config_id ?? null; + if (isset($config_id)) { + return "/_plugins/_notifications/feature/test/$config_id"; + } + throw new RuntimeException('Missing parameter for the endpoint notifications.send_test'); + } + + public function getParamWhitelist(): array + { + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setConfigId($config_id): SendTest + { + if (isset($config_id) !== true) { + return $this; + } + $this->config_id = $config_id; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Notifications/UpdateConfig.php b/src/OpenSearch/Endpoints/Notifications/UpdateConfig.php new file mode 100644 index 00000000..d493a5c7 --- /dev/null +++ b/src/OpenSearch/Endpoints/Notifications/UpdateConfig.php @@ -0,0 +1,72 @@ +config_id ?? null; + if (isset($config_id)) { + return "/_plugins/_notifications/configs/$config_id"; + } + throw new RuntimeException('Missing parameter for the endpoint notifications.update_config'); + } + + public function getParamWhitelist(): array + { + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): UpdateConfig + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setConfigId($config_id): UpdateConfig + { + if (isset($config_id) !== true) { + return $this; + } + $this->config_id = $config_id; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/PutScript.php b/src/OpenSearch/Endpoints/PutScript.php index 3b705f96..cc779271 100644 --- a/src/OpenSearch/Endpoints/PutScript.php +++ b/src/OpenSearch/Endpoints/PutScript.php @@ -24,6 +24,9 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class PutScript extends AbstractEndpoint { protected $context; @@ -37,7 +40,6 @@ public function getURI(): string } $id = $this->id; $context = $this->context ?? null; - if (isset($context)) { return "/_scripts/$id/$context"; } @@ -47,10 +49,14 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'timeout', + 'cluster_manager_timeout', 'master_timeout', - 'context', - 'cluster_manager_timeout' + 'timeout', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -78,6 +84,7 @@ public function setContext($context): PutScript return $this; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/RankEval.php b/src/OpenSearch/Endpoints/RankEval.php index 3b886361..ee92c79f 100644 --- a/src/OpenSearch/Endpoints/RankEval.php +++ b/src/OpenSearch/Endpoints/RankEval.php @@ -40,9 +40,9 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', + 'ignore_unavailable', 'search_type', 'pretty', 'human', diff --git a/src/OpenSearch/Endpoints/Reindex.php b/src/OpenSearch/Endpoints/Reindex.php index a83d0b66..8aacbcda 100644 --- a/src/OpenSearch/Endpoints/Reindex.php +++ b/src/OpenSearch/Endpoints/Reindex.php @@ -36,14 +36,14 @@ public function getURI(): string public function getParamWhitelist(): array { return [ + 'max_docs', 'refresh', - 'timeout', - 'wait_for_active_shards', - 'wait_for_completion', 'requests_per_second', 'scroll', 'slices', - 'max_docs', + 'timeout', + 'wait_for_active_shards', + 'wait_for_completion', 'pretty', 'human', 'error_trace', diff --git a/src/OpenSearch/Endpoints/ReindexRethrottle.php b/src/OpenSearch/Endpoints/ReindexRethrottle.php index d99cba03..50d7bc45 100644 --- a/src/OpenSearch/Endpoints/ReindexRethrottle.php +++ b/src/OpenSearch/Endpoints/ReindexRethrottle.php @@ -24,24 +24,33 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class ReindexRethrottle extends AbstractEndpoint { protected $task_id; public function getURI(): string { - $task_id = $this->task_id ?? null; - - if (isset($task_id)) { - return "/_reindex/$task_id/_rethrottle"; + if (isset($this->task_id) !== true) { + throw new RuntimeException( + 'task_id is required for reindex_rethrottle' + ); } - throw new RuntimeException('Missing parameter for the endpoint reindex_rethrottle'); + $task_id = $this->task_id; + return "/_reindex/$task_id/_rethrottle"; } public function getParamWhitelist(): array { return [ - 'requests_per_second' + 'requests_per_second', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/RemoteStore/Restore.php b/src/OpenSearch/Endpoints/RemoteStore/Restore.php new file mode 100644 index 00000000..d1c4630f --- /dev/null +++ b/src/OpenSearch/Endpoints/RemoteStore/Restore.php @@ -0,0 +1,57 @@ +body = $body; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Rollups/Delete.php b/src/OpenSearch/Endpoints/Rollups/Delete.php new file mode 100644 index 00000000..1e439bd6 --- /dev/null +++ b/src/OpenSearch/Endpoints/Rollups/Delete.php @@ -0,0 +1,52 @@ +id) !== true) { + throw new RuntimeException( + 'id is required for delete' + ); + } + $id = $this->id; + return "/_plugins/_rollup/jobs/$id"; + } + + public function getParamWhitelist(): array + { + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; + } + + public function getMethod(): string + { + return 'DELETE'; + } +} diff --git a/src/OpenSearch/Endpoints/Rollups/Explain.php b/src/OpenSearch/Endpoints/Rollups/Explain.php new file mode 100644 index 00000000..f3b4e567 --- /dev/null +++ b/src/OpenSearch/Endpoints/Rollups/Explain.php @@ -0,0 +1,52 @@ +id) !== true) { + throw new RuntimeException( + 'id is required for explain' + ); + } + $id = $this->id; + return "/_plugins/_rollup/jobs/$id/_explain"; + } + + public function getParamWhitelist(): array + { + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/src/OpenSearch/Endpoints/Rollups/Get.php b/src/OpenSearch/Endpoints/Rollups/Get.php new file mode 100644 index 00000000..ecdf22b5 --- /dev/null +++ b/src/OpenSearch/Endpoints/Rollups/Get.php @@ -0,0 +1,52 @@ +id) !== true) { + throw new RuntimeException( + 'id is required for get' + ); + } + $id = $this->id; + return "/_plugins/_rollup/jobs/$id"; + } + + public function getParamWhitelist(): array + { + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/src/OpenSearch/Endpoints/Rollups/Put.php b/src/OpenSearch/Endpoints/Rollups/Put.php new file mode 100644 index 00000000..6aa63aaf --- /dev/null +++ b/src/OpenSearch/Endpoints/Rollups/Put.php @@ -0,0 +1,64 @@ +id) !== true) { + throw new RuntimeException( + 'id is required for put' + ); + } + $id = $this->id; + return "/_plugins/_rollup/jobs/$id"; + } + + public function getParamWhitelist(): array + { + return [ + 'if_primary_term', + 'if_seq_no', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): Put + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Rollups/Start.php b/src/OpenSearch/Endpoints/Rollups/Start.php new file mode 100644 index 00000000..cd10a70c --- /dev/null +++ b/src/OpenSearch/Endpoints/Rollups/Start.php @@ -0,0 +1,52 @@ +id) !== true) { + throw new RuntimeException( + 'id is required for start' + ); + } + $id = $this->id; + return "/_plugins/_rollup/jobs/$id/_start"; + } + + public function getParamWhitelist(): array + { + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } +} diff --git a/src/OpenSearch/Endpoints/Rollups/Stop.php b/src/OpenSearch/Endpoints/Rollups/Stop.php new file mode 100644 index 00000000..cce54a0c --- /dev/null +++ b/src/OpenSearch/Endpoints/Rollups/Stop.php @@ -0,0 +1,52 @@ +id) !== true) { + throw new RuntimeException( + 'id is required for stop' + ); + } + $id = $this->id; + return "/_plugins/_rollup/jobs/$id/_stop"; + } + + public function getParamWhitelist(): array + { + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } +} diff --git a/src/OpenSearch/Endpoints/Scroll.php b/src/OpenSearch/Endpoints/Scroll.php index ba3ee2a2..907a555d 100644 --- a/src/OpenSearch/Endpoints/Scroll.php +++ b/src/OpenSearch/Endpoints/Scroll.php @@ -46,9 +46,9 @@ public function getURI(): string public function getParamWhitelist(): array { return [ + 'rest_total_hits_as_int', 'scroll', 'scroll_id', - 'rest_total_hits_as_int', 'pretty', 'human', 'error_trace', diff --git a/src/OpenSearch/Endpoints/Search.php b/src/OpenSearch/Endpoints/Search.php index 2ab63473..0bbdf51c 100644 --- a/src/OpenSearch/Endpoints/Search.php +++ b/src/OpenSearch/Endpoints/Search.php @@ -40,50 +40,52 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'analyzer', + '_source', + '_source_excludes', + '_source_includes', + 'allow_no_indices', + 'allow_partial_search_results', 'analyze_wildcard', + 'analyzer', + 'batched_reduce_size', + 'cancel_after_time_interval', 'ccs_minimize_roundtrips', 'default_operator', 'df', - 'explain', - 'stored_fields', 'docvalue_fields', + 'expand_wildcards', + 'explain', 'from', - 'ignore_unavailable', 'ignore_throttled', - 'allow_no_indices', - 'expand_wildcards', + 'ignore_unavailable', + 'include_named_queries_score', 'lenient', + 'max_concurrent_shard_requests', + 'phase_took', + 'pre_filter_shard_size', 'preference', 'q', + 'request_cache', + 'rest_total_hits_as_int', 'routing', 'scroll', + 'search_pipeline', 'search_type', + 'seq_no_primary_term', 'size', 'sort', - '_source', - '_source_excludes', - '_source_includes', - 'terminate_after', 'stats', + 'stored_fields', 'suggest_field', 'suggest_mode', 'suggest_size', 'suggest_text', + 'terminate_after', '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', - 'search_pipeline', - 'include_named_queries_score', 'pretty', 'human', 'error_trace', diff --git a/src/OpenSearch/Endpoints/SearchPipeline/Delete.php b/src/OpenSearch/Endpoints/SearchPipeline/Delete.php new file mode 100644 index 00000000..f0a9927f --- /dev/null +++ b/src/OpenSearch/Endpoints/SearchPipeline/Delete.php @@ -0,0 +1,52 @@ +id ?? null; + if (isset($id)) { + return "/_search/pipeline/$id"; + } + throw new RuntimeException('Missing parameter for the endpoint search_pipeline.delete'); + } + + public function getParamWhitelist(): array + { + return [ + 'cluster_manager_timeout', + 'timeout', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; + } + + public function getMethod(): string + { + return 'DELETE'; + } +} diff --git a/src/OpenSearch/Endpoints/SearchPipeline/Get.php b/src/OpenSearch/Endpoints/SearchPipeline/Get.php new file mode 100644 index 00000000..b2bc62bc --- /dev/null +++ b/src/OpenSearch/Endpoints/SearchPipeline/Get.php @@ -0,0 +1,50 @@ +id ?? null; + if (isset($id)) { + return "/_search/pipeline/$id"; + } + return "/_search/pipeline"; + } + + public function getParamWhitelist(): array + { + return [ + 'cluster_manager_timeout', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/src/OpenSearch/Endpoints/SearchPipeline/Put.php b/src/OpenSearch/Endpoints/SearchPipeline/Put.php new file mode 100644 index 00000000..c194a59d --- /dev/null +++ b/src/OpenSearch/Endpoints/SearchPipeline/Put.php @@ -0,0 +1,62 @@ +id ?? null; + if (isset($id)) { + return "/_search/pipeline/$id"; + } + throw new RuntimeException('Missing parameter for the endpoint search_pipeline.put'); + } + + public function getParamWhitelist(): array + { + return [ + 'cluster_manager_timeout', + 'timeout', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): Put + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/SearchShards.php b/src/OpenSearch/Endpoints/SearchShards.php index 10e5f8d7..4d7d3161 100644 --- a/src/OpenSearch/Endpoints/SearchShards.php +++ b/src/OpenSearch/Endpoints/SearchShards.php @@ -40,12 +40,12 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'preference', - 'routing', - 'local', - 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', + 'ignore_unavailable', + 'local', + 'preference', + 'routing', 'pretty', 'human', 'error_trace', diff --git a/src/OpenSearch/Endpoints/SearchTemplate.php b/src/OpenSearch/Endpoints/SearchTemplate.php index e2fd5a6c..f297b183 100644 --- a/src/OpenSearch/Endpoints/SearchTemplate.php +++ b/src/OpenSearch/Endpoints/SearchTemplate.php @@ -40,19 +40,19 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'ignore_unavailable', - 'ignore_throttled', 'allow_no_indices', + 'ccs_minimize_roundtrips', 'expand_wildcards', + 'explain', + 'ignore_throttled', + 'ignore_unavailable', 'preference', + 'profile', + 'rest_total_hits_as_int', 'routing', 'scroll', 'search_type', - 'explain', - 'profile', 'typed_keys', - 'rest_total_hits_as_int', - 'ccs_minimize_roundtrips', 'pretty', 'human', 'error_trace', diff --git a/src/OpenSearch/Endpoints/Snapshot/CleanupRepository.php b/src/OpenSearch/Endpoints/Snapshot/CleanupRepository.php index 6425fb04..4f7b5d72 100644 --- a/src/OpenSearch/Endpoints/Snapshot/CleanupRepository.php +++ b/src/OpenSearch/Endpoints/Snapshot/CleanupRepository.php @@ -24,6 +24,9 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class CleanupRepository extends AbstractEndpoint { protected $repository; @@ -31,7 +34,6 @@ class CleanupRepository extends AbstractEndpoint public function getURI(): string { $repository = $this->repository ?? null; - if (isset($repository)) { return "/_snapshot/$repository/_cleanup"; } @@ -41,9 +43,14 @@ public function getURI(): string public function getParamWhitelist(): array { return [ + 'cluster_manager_timeout', 'master_timeout', 'timeout', - 'cluster_manager_timeout' + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -61,6 +68,7 @@ public function setRepository($repository): CleanupRepository return $this; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Snapshot/CloneSnapshot.php b/src/OpenSearch/Endpoints/Snapshot/CloneSnapshot.php index f1eba1cb..9808f55c 100644 --- a/src/OpenSearch/Endpoints/Snapshot/CloneSnapshot.php +++ b/src/OpenSearch/Endpoints/Snapshot/CloneSnapshot.php @@ -24,6 +24,9 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class CloneSnapshot extends AbstractEndpoint { protected $repository; @@ -35,7 +38,6 @@ public function getURI(): string $repository = $this->repository ?? null; $snapshot = $this->snapshot ?? null; $target_snapshot = $this->target_snapshot ?? null; - if (isset($repository) && isset($snapshot) && isset($target_snapshot)) { return "/_snapshot/$repository/$snapshot/_clone/$target_snapshot"; } @@ -45,7 +47,13 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'master_timeout', 'cluster_manager_timeout' + 'cluster_manager_timeout', + 'master_timeout', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -93,6 +101,7 @@ public function setTargetSnapshot($target_snapshot): CloneSnapshot return $this; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Snapshot/Create.php b/src/OpenSearch/Endpoints/Snapshot/Create.php index 64906920..e46cbd48 100644 --- a/src/OpenSearch/Endpoints/Snapshot/Create.php +++ b/src/OpenSearch/Endpoints/Snapshot/Create.php @@ -24,6 +24,9 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Create extends AbstractEndpoint { protected $repository; @@ -33,7 +36,6 @@ public function getURI(): string { $repository = $this->repository ?? null; $snapshot = $this->snapshot ?? null; - if (isset($repository) && isset($snapshot)) { return "/_snapshot/$repository/$snapshot"; } @@ -43,9 +45,14 @@ public function getURI(): string public function getParamWhitelist(): array { return [ + 'cluster_manager_timeout', 'master_timeout', 'wait_for_completion', - 'cluster_manager_timeout' + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -83,6 +90,7 @@ public function setSnapshot($snapshot): Create return $this; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Snapshot/CreateRepository.php b/src/OpenSearch/Endpoints/Snapshot/CreateRepository.php index 86398538..1fef0bed 100644 --- a/src/OpenSearch/Endpoints/Snapshot/CreateRepository.php +++ b/src/OpenSearch/Endpoints/Snapshot/CreateRepository.php @@ -24,6 +24,9 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class CreateRepository extends AbstractEndpoint { protected $repository; @@ -31,7 +34,6 @@ class CreateRepository extends AbstractEndpoint public function getURI(): string { $repository = $this->repository ?? null; - if (isset($repository)) { return "/_snapshot/$repository"; } @@ -41,10 +43,15 @@ public function getURI(): string public function getParamWhitelist(): array { return [ + 'cluster_manager_timeout', 'master_timeout', 'timeout', 'verify', - 'cluster_manager_timeout' + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -72,6 +79,7 @@ public function setRepository($repository): CreateRepository return $this; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Snapshot/Delete.php b/src/OpenSearch/Endpoints/Snapshot/Delete.php index e07b0264..f543d1a6 100644 --- a/src/OpenSearch/Endpoints/Snapshot/Delete.php +++ b/src/OpenSearch/Endpoints/Snapshot/Delete.php @@ -24,6 +24,9 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Delete extends AbstractEndpoint { protected $repository; @@ -33,7 +36,6 @@ public function getURI(): string { $repository = $this->repository ?? null; $snapshot = $this->snapshot ?? null; - if (isset($repository) && isset($snapshot)) { return "/_snapshot/$repository/$snapshot"; } @@ -43,7 +45,13 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'master_timeout', 'cluster_manager_timeout' + 'cluster_manager_timeout', + 'master_timeout', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -71,6 +79,7 @@ public function setSnapshot($snapshot): Delete return $this; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Snapshot/DeleteRepository.php b/src/OpenSearch/Endpoints/Snapshot/DeleteRepository.php index a5392886..b4f7bd36 100644 --- a/src/OpenSearch/Endpoints/Snapshot/DeleteRepository.php +++ b/src/OpenSearch/Endpoints/Snapshot/DeleteRepository.php @@ -24,6 +24,9 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class DeleteRepository extends AbstractEndpoint { protected $repository; @@ -31,7 +34,6 @@ class DeleteRepository extends AbstractEndpoint public function getURI(): string { $repository = $this->repository ?? null; - if (isset($repository)) { return "/_snapshot/$repository"; } @@ -41,9 +43,14 @@ public function getURI(): string public function getParamWhitelist(): array { return [ + 'cluster_manager_timeout', 'master_timeout', 'timeout', - 'cluster_manager_timeout' + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -64,6 +71,7 @@ public function setRepository($repository): DeleteRepository return $this; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Snapshot/Get.php b/src/OpenSearch/Endpoints/Snapshot/Get.php index 89a1f0ce..77facdee 100644 --- a/src/OpenSearch/Endpoints/Snapshot/Get.php +++ b/src/OpenSearch/Endpoints/Snapshot/Get.php @@ -24,6 +24,9 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Get extends AbstractEndpoint { protected $repository; @@ -33,7 +36,6 @@ public function getURI(): string { $repository = $this->repository ?? null; $snapshot = $this->snapshot ?? null; - if (isset($repository) && isset($snapshot)) { return "/_snapshot/$repository/$snapshot"; } @@ -43,10 +45,15 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'master_timeout', + 'cluster_manager_timeout', 'ignore_unavailable', + 'master_timeout', 'verbose', - 'cluster_manager_timeout' + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -77,6 +84,7 @@ public function setSnapshot($snapshot): Get return $this; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Snapshot/GetRepository.php b/src/OpenSearch/Endpoints/Snapshot/GetRepository.php index c252dbad..d9b3442f 100644 --- a/src/OpenSearch/Endpoints/Snapshot/GetRepository.php +++ b/src/OpenSearch/Endpoints/Snapshot/GetRepository.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class GetRepository extends AbstractEndpoint { protected $repository; @@ -30,7 +33,6 @@ class GetRepository extends AbstractEndpoint public function getURI(): string { $repository = $this->repository ?? null; - if (isset($repository)) { return "/_snapshot/$repository"; } @@ -40,9 +42,14 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'master_timeout', + 'cluster_manager_timeout', 'local', - 'cluster_manager_timeout' + 'master_timeout', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -63,6 +70,7 @@ public function setRepository($repository): GetRepository return $this; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Snapshot/Restore.php b/src/OpenSearch/Endpoints/Snapshot/Restore.php index 6fa87d77..575cc343 100644 --- a/src/OpenSearch/Endpoints/Snapshot/Restore.php +++ b/src/OpenSearch/Endpoints/Snapshot/Restore.php @@ -24,6 +24,9 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Restore extends AbstractEndpoint { protected $repository; @@ -33,7 +36,6 @@ public function getURI(): string { $repository = $this->repository ?? null; $snapshot = $this->snapshot ?? null; - if (isset($repository) && isset($snapshot)) { return "/_snapshot/$repository/$snapshot/_restore"; } @@ -43,9 +45,14 @@ public function getURI(): string public function getParamWhitelist(): array { return [ + 'cluster_manager_timeout', 'master_timeout', 'wait_for_completion', - 'cluster_manager_timeout' + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -83,6 +90,7 @@ public function setSnapshot($snapshot): Restore return $this; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Snapshot/Status.php b/src/OpenSearch/Endpoints/Snapshot/Status.php index a626bea6..183272cb 100644 --- a/src/OpenSearch/Endpoints/Snapshot/Status.php +++ b/src/OpenSearch/Endpoints/Snapshot/Status.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Status extends AbstractEndpoint { protected $repository; @@ -32,7 +35,6 @@ public function getURI(): string { $repository = $this->repository ?? null; $snapshot = $this->snapshot ?? null; - if (isset($repository) && isset($snapshot)) { return "/_snapshot/$repository/$snapshot/_status"; } @@ -45,9 +47,14 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'master_timeout', + 'cluster_manager_timeout', 'ignore_unavailable', - 'cluster_manager_timeout' + 'master_timeout', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -78,6 +85,7 @@ public function setSnapshot($snapshot): Status return $this; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Snapshot/VerifyRepository.php b/src/OpenSearch/Endpoints/Snapshot/VerifyRepository.php index 57a51613..6203bc29 100644 --- a/src/OpenSearch/Endpoints/Snapshot/VerifyRepository.php +++ b/src/OpenSearch/Endpoints/Snapshot/VerifyRepository.php @@ -24,6 +24,9 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class VerifyRepository extends AbstractEndpoint { protected $repository; @@ -31,7 +34,6 @@ class VerifyRepository extends AbstractEndpoint public function getURI(): string { $repository = $this->repository ?? null; - if (isset($repository)) { return "/_snapshot/$repository/_verify"; } @@ -41,9 +43,14 @@ public function getURI(): string public function getParamWhitelist(): array { return [ + 'cluster_manager_timeout', 'master_timeout', 'timeout', - 'cluster_manager_timeout' + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -61,6 +68,7 @@ public function setRepository($repository): VerifyRepository return $this; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Tasks/Cancel.php b/src/OpenSearch/Endpoints/Tasks/Cancel.php index c51bc050..83deffe9 100644 --- a/src/OpenSearch/Endpoints/Tasks/Cancel.php +++ b/src/OpenSearch/Endpoints/Tasks/Cancel.php @@ -42,8 +42,8 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'nodes', 'actions', + 'nodes', 'parent_task_id', 'wait_for_completion', 'pretty', diff --git a/src/OpenSearch/Endpoints/Tasks/Get.php b/src/OpenSearch/Endpoints/Tasks/Get.php index 7f985c94..df8e113d 100644 --- a/src/OpenSearch/Endpoints/Tasks/Get.php +++ b/src/OpenSearch/Endpoints/Tasks/Get.php @@ -24,6 +24,9 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Get extends AbstractEndpoint { protected $task_id; @@ -31,7 +34,6 @@ class Get extends AbstractEndpoint public function getURI(): string { $task_id = $this->task_id ?? null; - if (isset($task_id)) { return "/_tasks/$task_id"; } @@ -41,8 +43,13 @@ public function getURI(): string public function getParamWhitelist(): array { return [ + 'timeout', 'wait_for_completion', - 'timeout' + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/Tasks/ListTasks.php b/src/OpenSearch/Endpoints/Tasks/ListTasks.php index 36bf46f6..04d9db5e 100644 --- a/src/OpenSearch/Endpoints/Tasks/ListTasks.php +++ b/src/OpenSearch/Endpoints/Tasks/ListTasks.php @@ -36,13 +36,13 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'nodes', 'actions', 'detailed', - 'parent_task_id', - 'wait_for_completion', 'group_by', + 'nodes', + 'parent_task_id', 'timeout', + 'wait_for_completion', 'pretty', 'human', 'error_trace', diff --git a/src/OpenSearch/Endpoints/TermVectors.php b/src/OpenSearch/Endpoints/TermVectors.php index 1ae10195..c06aefdb 100644 --- a/src/OpenSearch/Endpoints/TermVectors.php +++ b/src/OpenSearch/Endpoints/TermVectors.php @@ -47,15 +47,15 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'term_statistics', 'field_statistics', 'fields', 'offsets', - 'positions', 'payloads', + 'positions', 'preference', - 'routing', 'realtime', + 'routing', + 'term_statistics', 'version', 'version_type', 'pretty', diff --git a/src/OpenSearch/Endpoints/Transforms/Delete.php b/src/OpenSearch/Endpoints/Transforms/Delete.php new file mode 100644 index 00000000..1eb4d8e0 --- /dev/null +++ b/src/OpenSearch/Endpoints/Transforms/Delete.php @@ -0,0 +1,50 @@ +id ?? null; + if (isset($id)) { + return "/_plugins/_transform/$id"; + } + throw new RuntimeException('Missing parameter for the endpoint transforms.delete'); + } + + public function getParamWhitelist(): array + { + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; + } + + public function getMethod(): string + { + return 'DELETE'; + } +} diff --git a/src/OpenSearch/Endpoints/Transforms/Explain.php b/src/OpenSearch/Endpoints/Transforms/Explain.php new file mode 100644 index 00000000..118d87f4 --- /dev/null +++ b/src/OpenSearch/Endpoints/Transforms/Explain.php @@ -0,0 +1,50 @@ +id ?? null; + if (isset($id)) { + return "/_plugins/_transform/$id/_explain"; + } + throw new RuntimeException('Missing parameter for the endpoint transforms.explain'); + } + + public function getParamWhitelist(): array + { + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/src/OpenSearch/Endpoints/Transforms/Get.php b/src/OpenSearch/Endpoints/Transforms/Get.php new file mode 100644 index 00000000..2c682bb2 --- /dev/null +++ b/src/OpenSearch/Endpoints/Transforms/Get.php @@ -0,0 +1,50 @@ +id ?? null; + if (isset($id)) { + return "/_plugins/_transform/$id"; + } + throw new RuntimeException('Missing parameter for the endpoint transforms.get'); + } + + public function getParamWhitelist(): array + { + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/src/OpenSearch/Endpoints/Transforms/Preview.php b/src/OpenSearch/Endpoints/Transforms/Preview.php new file mode 100644 index 00000000..7600a1c8 --- /dev/null +++ b/src/OpenSearch/Endpoints/Transforms/Preview.php @@ -0,0 +1,45 @@ +id ?? null; + if (isset($id)) { + return "/_plugins/_transform/$id"; + } + throw new RuntimeException('Missing parameter for the endpoint transforms.put'); + } + + public function getParamWhitelist(): array + { + return [ + 'if_primary_term', + 'if_seq_no', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): Put + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Transforms/Search.php b/src/OpenSearch/Endpoints/Transforms/Search.php new file mode 100644 index 00000000..e1ee0c9c --- /dev/null +++ b/src/OpenSearch/Endpoints/Transforms/Search.php @@ -0,0 +1,50 @@ +id ?? null; + if (isset($id)) { + return "/_plugins/_transform/$id/_start"; + } + throw new RuntimeException('Missing parameter for the endpoint transforms.start'); + } + + public function getParamWhitelist(): array + { + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } +} diff --git a/src/OpenSearch/Endpoints/Transforms/Stop.php b/src/OpenSearch/Endpoints/Transforms/Stop.php new file mode 100644 index 00000000..d26b6dbb --- /dev/null +++ b/src/OpenSearch/Endpoints/Transforms/Stop.php @@ -0,0 +1,50 @@ +id ?? null; + if (isset($id)) { + return "/_plugins/_transform/$id/_stop"; + } + throw new RuntimeException('Missing parameter for the endpoint transforms.stop'); + } + + public function getParamWhitelist(): array + { + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } +} diff --git a/src/OpenSearch/Endpoints/Update.php b/src/OpenSearch/Endpoints/Update.php index 92debabd..eedb3019 100644 --- a/src/OpenSearch/Endpoints/Update.php +++ b/src/OpenSearch/Endpoints/Update.php @@ -49,18 +49,18 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'wait_for_active_shards', '_source', '_source_excludes', '_source_includes', + 'if_primary_term', + 'if_seq_no', 'lang', 'refresh', + 'require_alias', 'retry_on_conflict', 'routing', 'timeout', - 'if_seq_no', - 'if_primary_term', - 'require_alias', + 'wait_for_active_shards', 'pretty', 'human', 'error_trace', diff --git a/src/OpenSearch/Endpoints/UpdateByQuery.php b/src/OpenSearch/Endpoints/UpdateByQuery.php index 535b1de4..f08a450e 100644 --- a/src/OpenSearch/Endpoints/UpdateByQuery.php +++ b/src/OpenSearch/Endpoints/UpdateByQuery.php @@ -24,6 +24,9 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class UpdateByQuery extends AbstractEndpoint { public function getURI(): string @@ -40,41 +43,45 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'analyzer', + '_source', + '_source_excludes', + '_source_includes', + 'allow_no_indices', 'analyze_wildcard', + 'analyzer', + 'conflicts', 'default_operator', 'df', + 'expand_wildcards', 'from', 'ignore_unavailable', - 'allow_no_indices', - 'conflicts', - 'expand_wildcards', 'lenient', + 'max_docs', 'pipeline', 'preference', 'q', + 'refresh', + 'request_cache', + 'requests_per_second', 'routing', 'scroll', - 'search_type', + 'scroll_size', 'search_timeout', + 'search_type', 'size', - 'max_docs', + 'slices', 'sort', - '_source', - '_source_excludes', - '_source_includes', - 'terminate_after', 'stats', - 'version', - 'version_type', - 'request_cache', - 'refresh', + 'terminate_after', 'timeout', + 'version', 'wait_for_active_shards', - 'scroll_size', 'wait_for_completion', - 'requests_per_second', - 'slices' + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/UpdateByQueryRethrottle.php b/src/OpenSearch/Endpoints/UpdateByQueryRethrottle.php index 0ad0917e..37d8f7ff 100644 --- a/src/OpenSearch/Endpoints/UpdateByQueryRethrottle.php +++ b/src/OpenSearch/Endpoints/UpdateByQueryRethrottle.php @@ -24,24 +24,33 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class UpdateByQueryRethrottle extends AbstractEndpoint { protected $task_id; public function getURI(): string { - $task_id = $this->task_id ?? null; - - if (isset($task_id)) { - return "/_update_by_query/$task_id/_rethrottle"; + if (isset($this->task_id) !== true) { + throw new RuntimeException( + 'task_id is required for update_by_query_rethrottle' + ); } - throw new RuntimeException('Missing parameter for the endpoint update_by_query_rethrottle'); + $task_id = $this->task_id; + return "/_update_by_query/$task_id/_rethrottle"; } public function getParamWhitelist(): array { return [ - 'requests_per_second' + 'requests_per_second', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Namespaces/CatNamespace.php b/src/OpenSearch/Namespaces/CatNamespace.php index 37a5886a..9a3196d4 100644 --- a/src/OpenSearch/Namespaces/CatNamespace.php +++ b/src/OpenSearch/Namespaces/CatNamespace.php @@ -26,18 +26,26 @@ /** * Class CatNamespace * + * NOTE: This file is autogenerated using util/GenerateEndpoints.php */ class CatNamespace extends AbstractNamespace { /** - * $params['name'] = (list) A comma-separated list of alias names to return - * $params['format'] = (string) a short version of the Accept header, e.g. json, yaml - * $params['local'] = (boolean) Return local information, do not retrieve the state from cluster_manager node (default: false) - * $params['h'] = (list) Comma-separated list of column names to display - * $params['help'] = (boolean) Return help information (Default = false) - * $params['s'] = (list) Comma-separated list of column names or column aliases to sort by - * $params['v'] = (boolean) Verbose mode. Display column headers (Default = false) - * $params['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both. (Options = open,closed,hidden,none,all) (Default = all) + * Shows information about currently configured aliases to indices including filter and routing infos. + * + * $params['name'] = (array) A comma-separated list of aliases to retrieve. Supports wildcards (`*`). To retrieve all aliases, omit this parameter or use `*` or `_all`. + * $params['expand_wildcards'] = (any) Whether to expand wildcard expression to concrete indices that are open, closed or both. + * $params['format'] = (string) A short version of the Accept header, e.g. json, yaml. + * $params['h'] = (array) Comma-separated list of column names to display. + * $params['help'] = (boolean) Return help information. (Default = false) + * $params['local'] = (boolean) Return local information, do not retrieve the state from cluster-manager node. (Default = false) + * $params['s'] = (array) Comma-separated list of column names or column aliases to sort by. + * $params['v'] = (boolean) Verbose mode. Display column headers. (Default = false) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -54,15 +62,49 @@ public function aliases(array $params = []) return $this->performRequest($endpoint); } /** - * $params['node_id'] = (list) A comma-separated list of node IDs or names to limit the returned information - * $params['format'] = (string) a short version of the Accept header, e.g. json, yaml - * $params['bytes'] = (enum) The unit in which to display byte values (Options = b,k,kb,m,mb,g,gb,t,tb,p,pb) - * $params['local'] = (boolean) Return local information, do not retrieve the state from cluster_manager node (default: false) - * $params['cluster_manager_timeout'] = (time) Explicit operation timeout for connection to cluster_manager node - * $params['h'] = (list) Comma-separated list of column names to display - * $params['help'] = (boolean) Return help information (Default = false) - * $params['s'] = (list) Comma-separated list of column names or column aliases to sort by - * $params['v'] = (boolean) Verbose mode. Display column headers (Default = false) + * Lists all active point-in-time segments. + * + * $params['bytes'] = (enum) The unit in which to display byte values. (Options = b,k,kb,m,mb,g,gb,t,tb,p,pb) + * $params['format'] = (string) A short version of the Accept header, e.g. json, yaml. + * $params['h'] = (array) Comma-separated list of column names to display. + * $params['help'] = (boolean) Return help information. (Default = false) + * $params['s'] = (array) Comma-separated list of column names or column aliases to sort by. + * $params['v'] = (boolean) Verbose mode. Display column headers. (Default = false) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * + * @param array $params Associative array of parameters + * @return array + */ + public function allPitSegments(array $params = []) + { + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Cat\AllPitSegments'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * Provides a snapshot of how many shards are allocated to each data node and how much disk space they are using. + * + * $params['node_id'] = (array) Comma-separated list of node identifiers or names used to limit the returned information. + * $params['bytes'] = (enum) The unit used to display byte values. (Options = b,k,kb,m,mb,g,gb,t,tb,p,pb) + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['format'] = (string) A short version of the Accept header, e.g. json, yaml. + * $params['h'] = (array) Comma-separated list of column names to display. + * $params['help'] = (boolean) Return help information. (Default = false) + * $params['local'] = (boolean) Return local information, do not retrieve the state from cluster-manager node. (Default = false) + * $params['master_timeout'] = (string) Operation timeout for connection to master node. + * $params['s'] = (array) Comma-separated list of column names or column aliases to sort by. + * $params['v'] = (boolean) Verbose mode. Display column headers. (Default = false) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -79,12 +121,47 @@ public function allocation(array $params = []) return $this->performRequest($endpoint); } /** - * $params['index'] = (list) A comma-separated list of index names to limit the returned information - * $params['format'] = (string) a short version of the Accept header, e.g. json, yaml - * $params['h'] = (list) Comma-separated list of column names to display - * $params['help'] = (boolean) Return help information (Default = false) - * $params['s'] = (list) Comma-separated list of column names or column aliases to sort by - * $params['v'] = (boolean) Verbose mode. Display column headers (Default = false) + * Returns information about the cluster-manager node. + * + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['format'] = (string) A short version of the Accept header, e.g. json, yaml. + * $params['h'] = (array) Comma-separated list of column names to display. + * $params['help'] = (boolean) Return help information. (Default = false) + * $params['local'] = (boolean) Return local information, do not retrieve the state from cluster-manager node. (Default = false) + * $params['master_timeout'] = (string) Operation timeout for connection to master node. + * $params['s'] = (array) Comma-separated list of column names or column aliases to sort by. + * $params['v'] = (boolean) Verbose mode. Display column headers. (Default = false) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * + * @param array $params Associative array of parameters + * @return array + */ + public function clusterManager(array $params = []) + { + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Cat\ClusterManager'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * Provides quick access to the document count of the entire cluster, or individual indices. + * + * $params['index'] = (array) Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indices, omit this parameter or use `*` or `_all`. + * $params['format'] = (string) A short version of the Accept header, e.g. json, yaml. + * $params['h'] = (array) Comma-separated list of column names to display. + * $params['help'] = (boolean) Return help information. (Default = false) + * $params['s'] = (array) Comma-separated list of column names or column aliases to sort by. + * $params['v'] = (boolean) Verbose mode. Display column headers. (Default = false) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -101,13 +178,20 @@ public function count(array $params = []) return $this->performRequest($endpoint); } /** - * $params['fields'] = (list) A comma-separated list of fields to return the fielddata size - * $params['format'] = (string) a short version of the Accept header, e.g. json, yaml - * $params['bytes'] = (enum) The unit in which to display byte values (Options = b,k,kb,m,mb,g,gb,t,tb,p,pb) - * $params['h'] = (list) Comma-separated list of column names to display - * $params['help'] = (boolean) Return help information (Default = false) - * $params['s'] = (list) Comma-separated list of column names or column aliases to sort by - * $params['v'] = (boolean) Verbose mode. Display column headers (Default = false) + * Shows how much heap memory is currently being used by fielddata on every data node in the cluster. + * + * $params['fields'] = (array) Comma-separated list of fields used to limit returned information. To retrieve all fields, omit this parameter. + * $params['bytes'] = (enum) The unit used to display byte values. (Options = b,k,kb,m,mb,g,gb,t,tb,p,pb) + * $params['format'] = (string) A short version of the Accept header, e.g. json, yaml. + * $params['h'] = (array) Comma-separated list of column names to display. + * $params['help'] = (boolean) Return help information. (Default = false) + * $params['s'] = (array) Comma-separated list of column names or column aliases to sort by. + * $params['v'] = (boolean) Verbose mode. Display column headers. (Default = false) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -124,13 +208,20 @@ public function fielddata(array $params = []) return $this->performRequest($endpoint); } /** - * $params['format'] = (string) a short version of the Accept header, e.g. json, yaml - * $params['h'] = (list) Comma-separated list of column names to display - * $params['help'] = (boolean) Return help information (Default = false) - * $params['s'] = (list) Comma-separated list of column names or column aliases to sort by - * $params['time'] = (enum) The unit in which to display time values (Options = d,h,m,s,ms,micros,nanos) - * $params['ts'] = (boolean) Set to false to disable timestamping (Default = true) - * $params['v'] = (boolean) Verbose mode. Display column headers (Default = false) + * Returns a concise representation of the cluster health. + * + * $params['format'] = (string) A short version of the Accept header, e.g. json, yaml. + * $params['h'] = (array) Comma-separated list of column names to display. + * $params['help'] = (boolean) Return help information. (Default = false) + * $params['s'] = (array) Comma-separated list of column names or column aliases to sort by. + * $params['time'] = (enum) The unit used to display time values. (Options = nanos,micros,ms,s,m,h,d) + * $params['ts'] = (boolean) If true, returns `HH:MM:SS` and Unix epoch timestamps. (Default = true) + * $params['v'] = (boolean) Verbose mode. Display column headers. (Default = false) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -144,8 +235,13 @@ public function health(array $params = []) return $this->performRequest($endpoint); } /** - * $params['help'] = (boolean) Return help information (Default = false) - * $params['s'] = (list) Comma-separated list of column names or column aliases to sort by + * Returns help for the Cat APIs. + * + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -159,20 +255,28 @@ public function help(array $params = []) return $this->performRequest($endpoint); } /** - * $params['index'] = (list) A comma-separated list of index names to limit the returned information - * $params['format'] = (string) a short version of the Accept header, e.g. json, yaml - * $params['bytes'] = (enum) The unit in which to display byte values (Options = b,k,kb,m,mb,g,gb,t,tb,p,pb) - * $params['local'] = (boolean) Return local information, do not retrieve the state from cluster_manager node (default: false) - * $params['cluster_manager_timeout'] = (time) Explicit operation timeout for connection to cluster_manager node - * $params['h'] = (list) Comma-separated list of column names to display - * $params['health'] = (enum) A health status ("green", "yellow", or "red" to filter only indices matching the specified health status (Options = green,yellow,red) - * $params['help'] = (boolean) Return help information (Default = false) - * $params['pri'] = (boolean) Set to true to return stats only for primary shards (Default = false) - * $params['s'] = (list) Comma-separated list of column names or column aliases to sort by - * $params['time'] = (enum) The unit in which to display time values (Options = d,h,m,s,ms,micros,nanos) - * $params['v'] = (boolean) Verbose mode. Display column headers (Default = false) - * $params['include_unloaded_segments'] = (boolean) If set to true segment stats will include stats for segments that are not currently loaded into memory (Default = false) - * $params['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both. (Options = open,closed,hidden,none,all) (Default = all) + * Returns information about indices: number of primaries and replicas, document counts, disk size, ... + * + * $params['index'] = (array) Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indices, omit this parameter or use `*` or `_all`. + * $params['bytes'] = (enum) The unit used to display byte values. (Options = b,k,kb,m,mb,g,gb,t,tb,p,pb) + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['expand_wildcards'] = (any) The type of index that wildcard patterns can match. + * $params['format'] = (string) A short version of the Accept header, e.g. json, yaml. + * $params['h'] = (array) Comma-separated list of column names to display. + * $params['health'] = (enum) The health status used to limit returned indices. By default, the response includes indices of any health status. (Options = green,yellow,red) + * $params['help'] = (boolean) Return help information. (Default = false) + * $params['include_unloaded_segments'] = (boolean) If true, the response includes information from segments that are not loaded into memory. (Default = false) + * $params['local'] = (boolean) Return local information, do not retrieve the state from cluster-manager node. (Default = false) + * $params['master_timeout'] = (string) Operation timeout for connection to master node. + * $params['pri'] = (boolean) If true, the response only includes information from primary shards. (Default = false) + * $params['s'] = (array) Comma-separated list of column names or column aliases to sort by. + * $params['time'] = (enum) The unit used to display time values. (Options = nanos,micros,ms,s,m,h,d) + * $params['v'] = (boolean) Verbose mode. Display column headers. (Default = false) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -189,15 +293,21 @@ public function indices(array $params = []) return $this->performRequest($endpoint); } /** - * $params['format'] = (string) a short version of the Accept header, e.g. json, yaml - * $params['local'] = (boolean) Return local information, do not retrieve the state from cluster_manager node (default: false) - * $params['cluster_manager_timeout'] = (time) Explicit operation timeout for connection to cluster_manager node - * $params['h'] = (list) Comma-separated list of column names to display - * $params['help'] = (boolean) Return help information (Default = false) - * $params['s'] = (list) Comma-separated list of column names or column aliases to sort by - * $params['v'] = (boolean) Verbose mode. Display column headers (Default = false) + * Returns information about the cluster-manager node. * - * @deprecated use clusterManager instead + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['format'] = (string) A short version of the Accept header, e.g. json, yaml. + * $params['h'] = (array) Comma-separated list of column names to display. + * $params['help'] = (boolean) Return help information. (Default = false) + * $params['local'] = (boolean) Return local information, do not retrieve the state from cluster-manager node. (Default = false) + * $params['master_timeout'] = (string) Operation timeout for connection to master node. + * $params['s'] = (array) Comma-separated list of column names or column aliases to sort by. + * $params['v'] = (boolean) Verbose mode. Display column headers. (Default = false) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -211,97 +321,138 @@ public function master(array $params = []) return $this->performRequest($endpoint); } /** - * $params['format'] = (string) a short version of the Accept header, e.g. json, yaml - * $params['local'] = (boolean) Return local information, do not retrieve the state from cluster_manager node (default: false) - * $params['cluster_manager_timeout'] = (time) Explicit operation timeout for connection to cluster_manager node - * $params['h'] = (list) Comma-separated list of column names to display - * $params['help'] = (boolean) Return help information (Default = false) - * $params['s'] = (list) Comma-separated list of column names or column aliases to sort by - * $params['v'] = (boolean) Verbose mode. Display column headers (Default = false) + * Returns information about custom node attributes. + * + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['format'] = (string) A short version of the Accept header, e.g. json, yaml. + * $params['h'] = (array) Comma-separated list of column names to display. + * $params['help'] = (boolean) Return help information. (Default = false) + * $params['local'] = (boolean) Return local information, do not retrieve the state from cluster-manager node. (Default = false) + * $params['master_timeout'] = (string) Operation timeout for connection to master node. + * $params['s'] = (array) Comma-separated list of column names or column aliases to sort by. + * $params['v'] = (boolean) Verbose mode. Display column headers. (Default = false) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array */ - public function clusterManager(array $params = []) + public function nodeattrs(array $params = []) { $endpointBuilder = $this->endpoints; - $endpoint = $endpointBuilder('Cat\ClusterManager'); + $endpoint = $endpointBuilder('Cat\NodeAttrs'); $endpoint->setParams($params); return $this->performRequest($endpoint); } /** - * $params['format'] = (string) a short version of the Accept header, e.g. json, yaml - * $params['local'] = (boolean) Return local information, do not retrieve the state from cluster_manager node (default: false) - * $params['cluster_manager_timeout'] = (time) Explicit operation timeout for connection to cluster_manager node - * $params['h'] = (list) Comma-separated list of column names to display - * $params['help'] = (boolean) Return help information (Default = false) - * $params['s'] = (list) Comma-separated list of column names or column aliases to sort by - * $params['v'] = (boolean) Verbose mode. Display column headers (Default = false) + * Returns basic statistics about performance of cluster nodes. + * + * $params['bytes'] = (enum) The unit used to display byte values. (Options = b,k,kb,m,mb,g,gb,t,tb,p,pb) + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['format'] = (string) A short version of the Accept header, e.g. json, yaml. + * $params['full_id'] = (any) If `true`, return the full node ID. If `false`, return the shortened node ID. (Default = ) + * $params['h'] = (array) Comma-separated list of column names to display. + * $params['help'] = (boolean) Return help information. (Default = false) + * $params['local'] = (boolean) Return local information, do not retrieve the state from cluster-manager node. (Default = false) + * $params['master_timeout'] = (string) Operation timeout for connection to master node. + * $params['s'] = (array) Comma-separated list of column names or column aliases to sort by. + * $params['time'] = (enum) The unit in which to display time values. (Options = nanos,micros,ms,s,m,h,d) + * $params['v'] = (boolean) Verbose mode. Display column headers. (Default = false) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array */ - public function nodeattrs(array $params = []) + public function nodes(array $params = []) { $endpointBuilder = $this->endpoints; - $endpoint = $endpointBuilder('Cat\NodeAttrs'); + $endpoint = $endpointBuilder('Cat\Nodes'); $endpoint->setParams($params); return $this->performRequest($endpoint); } /** - * $params['bytes'] = (enum) The unit in which to display byte values (Options = b,k,kb,m,mb,g,gb,t,tb,p,pb) - * $params['format'] = (string) a short version of the Accept header, e.g. json, yaml - * $params['full_id'] = (boolean) Return the full node ID instead of the shortened version (default: false) - * $params['local'] = (boolean) Calculate the selected nodes using the local cluster state rather than the state from cluster_manager node (default: false) - * $params['cluster_manager_timeout'] = (time) Explicit operation timeout for connection to cluster_manager node - * $params['h'] = (list) Comma-separated list of column names to display - * $params['help'] = (boolean) Return help information (Default = false) - * $params['s'] = (list) Comma-separated list of column names or column aliases to sort by - * $params['time'] = (enum) The unit in which to display time values (Options = d,h,m,s,ms,micros,nanos) - * $params['v'] = (boolean) Verbose mode. Display column headers (Default = false) + * Returns a concise representation of the cluster pending tasks. + * + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['format'] = (string) A short version of the Accept header, e.g. json, yaml. + * $params['h'] = (array) Comma-separated list of column names to display. + * $params['help'] = (boolean) Return help information. (Default = false) + * $params['local'] = (boolean) Return local information, do not retrieve the state from cluster-manager node. (Default = false) + * $params['master_timeout'] = (string) Operation timeout for connection to master node. + * $params['s'] = (array) Comma-separated list of column names or column aliases to sort by. + * $params['time'] = (enum) The unit in which to display time values. (Options = nanos,micros,ms,s,m,h,d) + * $params['v'] = (boolean) Verbose mode. Display column headers. (Default = false) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array */ - public function nodes(array $params = []) + public function pendingTasks(array $params = []) { $endpointBuilder = $this->endpoints; - $endpoint = $endpointBuilder('Cat\Nodes'); + $endpoint = $endpointBuilder('Cat\PendingTasks'); $endpoint->setParams($params); return $this->performRequest($endpoint); } /** - * $params['format'] = (string) a short version of the Accept header, e.g. json, yaml - * $params['local'] = (boolean) Return local information, do not retrieve the state from cluster_manager node (default: false) - * $params['cluster_manager_timeout'] = (time) Explicit operation timeout for connection to cluster_manager node - * $params['h'] = (list) Comma-separated list of column names to display - * $params['help'] = (boolean) Return help information (Default = false) - * $params['s'] = (list) Comma-separated list of column names or column aliases to sort by - * $params['time'] = (enum) The unit in which to display time values (Options = d,h,m,s,ms,micros,nanos) - * $params['v'] = (boolean) Verbose mode. Display column headers (Default = false) + * List segments for one or several PITs. + * + * $params['bytes'] = (enum) The unit in which to display byte values. (Options = b,k,kb,m,mb,g,gb,t,tb,p,pb) + * $params['format'] = (string) A short version of the Accept header, e.g. json, yaml. + * $params['h'] = (array) Comma-separated list of column names to display. + * $params['help'] = (boolean) Return help information. (Default = false) + * $params['s'] = (array) Comma-separated list of column names or column aliases to sort by. + * $params['v'] = (boolean) Verbose mode. Display column headers. (Default = false) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array */ - public function pendingTasks(array $params = []) + public function pitSegments(array $params = []) { + $body = $this->extractArgument($params, 'body'); + $endpointBuilder = $this->endpoints; - $endpoint = $endpointBuilder('Cat\PendingTasks'); + $endpoint = $endpointBuilder('Cat\PitSegments'); $endpoint->setParams($params); + $endpoint->setBody($body); return $this->performRequest($endpoint); } /** - * $params['format'] = (string) a short version of the Accept header, e.g. json, yaml - * $params['local'] = (boolean) Return local information, do not retrieve the state from cluster_manager node (default: false) - * $params['cluster_manager_timeout'] = (time) Explicit operation timeout for connection to cluster_manager node - * $params['h'] = (list) Comma-separated list of column names to display - * $params['help'] = (boolean) Return help information (Default = false) - * $params['s'] = (list) Comma-separated list of column names or column aliases to sort by - * $params['v'] = (boolean) Verbose mode. Display column headers (Default = false) + * Returns information about installed plugins across nodes node. + * + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['format'] = (string) A short version of the Accept header, e.g. json, yaml. + * $params['h'] = (array) Comma-separated list of column names to display. + * $params['help'] = (boolean) Return help information. (Default = false) + * $params['local'] = (boolean) Return local information, do not retrieve the state from cluster-manager node. (Default = false) + * $params['master_timeout'] = (string) Operation timeout for connection to master node. + * $params['s'] = (array) Comma-separated list of column names or column aliases to sort by. + * $params['v'] = (boolean) Verbose mode. Display column headers. (Default = false) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -315,16 +466,23 @@ public function plugins(array $params = []) return $this->performRequest($endpoint); } /** - * $params['index'] = (list) Comma-separated list or wildcard expression of index names to limit the returned information - * $params['format'] = (string) a short version of the Accept header, e.g. json, yaml - * $params['active_only'] = (boolean) If `true`, the response only includes ongoing shard recoveries (Default = false) - * $params['bytes'] = (enum) The unit in which to display byte values (Options = b,k,kb,m,mb,g,gb,t,tb,p,pb) - * $params['detailed'] = (boolean) If `true`, the response includes detailed information about shard recoveries (Default = false) - * $params['h'] = (list) Comma-separated list of column names to display - * $params['help'] = (boolean) Return help information (Default = false) - * $params['s'] = (list) Comma-separated list of column names or column aliases to sort by - * $params['time'] = (enum) The unit in which to display time values (Options = d,h,m,s,ms,micros,nanos) - * $params['v'] = (boolean) Verbose mode. Display column headers (Default = false) + * Returns information about index shard recoveries, both on-going completed. + * + * $params['index'] = (array) A comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indices, omit this parameter or use `*` or `_all`. + * $params['active_only'] = (boolean) If `true`, the response only includes ongoing shard recoveries. (Default = false) + * $params['bytes'] = (enum) The unit used to display byte values. (Options = b,k,kb,m,mb,g,gb,t,tb,p,pb) + * $params['detailed'] = (boolean) If `true`, the response includes detailed information about shard recoveries. (Default = false) + * $params['format'] = (string) A short version of the Accept header, e.g. json, yaml. + * $params['h'] = (array) Comma-separated list of column names to display. + * $params['help'] = (boolean) Return help information. (Default = false) + * $params['s'] = (array) Comma-separated list of column names or column aliases to sort by. + * $params['time'] = (enum) The unit in which to display time values. (Options = nanos,micros,ms,s,m,h,d) + * $params['v'] = (boolean) Verbose mode. Display column headers. (Default = false) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -341,13 +499,21 @@ public function recovery(array $params = []) return $this->performRequest($endpoint); } /** - * $params['format'] = (string) a short version of the Accept header, e.g. json, yaml - * $params['local'] = (boolean) Return local information, do not retrieve the state from cluster_manager node (Default = false) - * $params['cluster_manager_timeout'] = (time) Explicit operation timeout for connection to cluster_manager node - * $params['h'] = (list) Comma-separated list of column names to display - * $params['help'] = (boolean) Return help information (Default = false) - * $params['s'] = (list) Comma-separated list of column names or column aliases to sort by - * $params['v'] = (boolean) Verbose mode. Display column headers (Default = false) + * Returns information about snapshot repositories registered in the cluster. + * + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['format'] = (string) A short version of the Accept header, e.g. json, yaml. + * $params['h'] = (array) Comma-separated list of column names to display. + * $params['help'] = (boolean) Return help information. (Default = false) + * $params['local'] = (boolean) Return local information, do not retrieve the state from cluster-manager node. (Default = false) + * $params['master_timeout'] = (string) Operation timeout for connection to master node. + * $params['s'] = (array) Comma-separated list of column names or column aliases to sort by. + * $params['v'] = (boolean) Verbose mode. Display column headers. (Default = false) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -361,13 +527,62 @@ public function repositories(array $params = []) return $this->performRequest($endpoint); } /** - * $params['index'] = (list) A comma-separated list of index names to limit the returned information - * $params['format'] = (string) a short version of the Accept header, e.g. json, yaml - * $params['bytes'] = (enum) The unit in which to display byte values (Options = b,k,kb,m,mb,g,gb,t,tb,p,pb) - * $params['h'] = (list) Comma-separated list of column names to display - * $params['help'] = (boolean) Return help information (Default = false) - * $params['s'] = (list) Comma-separated list of column names or column aliases to sort by - * $params['v'] = (boolean) Verbose mode. Display column headers (Default = false) + * Returns information about both on-going and latest completed Segment Replication events. + * + * $params['index'] = (array) Comma-separated list or wildcard expression of index names to limit the returned information. + * $params['active_only'] = (boolean) If `true`, the response only includes ongoing segment replication events. (Default = false) + * $params['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). + * $params['bytes'] = (enum) The unit in which to display byte values. (Options = b,k,kb,m,mb,g,gb,t,tb,p,pb) + * $params['completed_only'] = (boolean) If `true`, the response only includes latest completed segment replication events. (Default = false) + * $params['detailed'] = (boolean) If `true`, the response includes detailed information about segment replications. (Default = false) + * $params['expand_wildcards'] = (any) Whether to expand wildcard expression to concrete indices that are open, closed or both. + * $params['format'] = (string) A short version of the Accept header, e.g. json, yaml. + * $params['h'] = (array) Comma-separated list of column names to display. + * $params['help'] = (boolean) Return help information. (Default = false) + * $params['ignore_throttled'] = (boolean) Whether specified concrete, expanded or aliased indices should be ignored when throttled. + * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed). + * $params['s'] = (array) Comma-separated list of column names or column aliases to sort by. + * $params['shards'] = (array) Comma-separated list of shards to display. + * $params['time'] = (enum) The unit in which to display time values. (Options = nanos,micros,ms,s,m,h,d) + * $params['timeout'] = (string) Operation timeout. + * $params['v'] = (boolean) Verbose mode. Display column headers. (Default = false) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * + * @param array $params Associative array of parameters + * @return array + */ + public function segmentReplication(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Cat\SegmentReplication'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + + return $this->performRequest($endpoint); + } + /** + * Provides low-level information about the segments in the shards of an index. + * + * $params['index'] = (array) A comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indices, omit this parameter or use `*` or `_all`. + * $params['bytes'] = (enum) The unit used to display byte values. (Options = b,k,kb,m,mb,g,gb,t,tb,p,pb) + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['format'] = (string) A short version of the Accept header, e.g. json, yaml. + * $params['h'] = (array) Comma-separated list of column names to display. + * $params['help'] = (boolean) Return help information. (Default = false) + * $params['master_timeout'] = (string) Operation timeout for connection to master node. + * $params['s'] = (array) Comma-separated list of column names or column aliases to sort by. + * $params['v'] = (boolean) Verbose mode. Display column headers. (Default = false) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -384,16 +599,24 @@ public function segments(array $params = []) return $this->performRequest($endpoint); } /** - * $params['index'] = (list) A comma-separated list of index names to limit the returned information - * $params['format'] = (string) a short version of the Accept header, e.g. json, yaml - * $params['bytes'] = (enum) The unit in which to display byte values (Options = b,k,kb,m,mb,g,gb,t,tb,p,pb) - * $params['local'] = (boolean) Return local information, do not retrieve the state from cluster_manager node (default: false) - * $params['cluster_manager_timeout'] = (time) Explicit operation timeout for connection to cluster_manager node - * $params['h'] = (list) Comma-separated list of column names to display - * $params['help'] = (boolean) Return help information (Default = false) - * $params['s'] = (list) Comma-separated list of column names or column aliases to sort by - * $params['time'] = (enum) The unit in which to display time values (Options = d,h,m,s,ms,micros,nanos) - * $params['v'] = (boolean) Verbose mode. Display column headers (Default = false) + * Provides a detailed view of shard allocation on nodes. + * + * $params['index'] = (array) A comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indices, omit this parameter or use `*` or `_all`. + * $params['bytes'] = (enum) The unit used to display byte values. (Options = b,k,kb,m,mb,g,gb,t,tb,p,pb) + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['format'] = (string) A short version of the Accept header, e.g. json, yaml. + * $params['h'] = (array) Comma-separated list of column names to display. + * $params['help'] = (boolean) Return help information. (Default = false) + * $params['local'] = (boolean) Return local information, do not retrieve the state from cluster-manager node. (Default = false) + * $params['master_timeout'] = (string) Operation timeout for connection to master node. + * $params['s'] = (array) Comma-separated list of column names or column aliases to sort by. + * $params['time'] = (enum) The unit in which to display time values. (Options = nanos,micros,ms,s,m,h,d) + * $params['v'] = (boolean) Verbose mode. Display column headers. (Default = false) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -410,15 +633,23 @@ public function shards(array $params = []) return $this->performRequest($endpoint); } /** - * $params['repository'] = (list) Name of repository from which to fetch the snapshot information - * $params['format'] = (string) a short version of the Accept header, e.g. json, yaml - * $params['ignore_unavailable'] = (boolean) Set to true to ignore unavailable snapshots (Default = false) - * $params['cluster_manager_timeout'] = (time) Explicit operation timeout for connection to cluster_manager node - * $params['h'] = (list) Comma-separated list of column names to display - * $params['help'] = (boolean) Return help information (Default = false) - * $params['s'] = (list) Comma-separated list of column names or column aliases to sort by - * $params['time'] = (enum) The unit in which to display time values (Options = d,h,m,s,ms,micros,nanos) - * $params['v'] = (boolean) Verbose mode. Display column headers (Default = false) + * Returns all snapshots in a specific repository. + * + * $params['repository'] = (array) A comma-separated list of snapshot repositories used to limit the request. Accepts wildcard expressions. `_all` returns all repositories. If any repository fails during the request, OpenSearch returns an error. + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['format'] = (string) A short version of the Accept header, e.g. json, yaml. + * $params['h'] = (array) Comma-separated list of column names to display. + * $params['help'] = (boolean) Return help information. (Default = false) + * $params['ignore_unavailable'] = (boolean) If `true`, the response does not include information from unavailable snapshots. (Default = false) + * $params['master_timeout'] = (string) Operation timeout for connection to master node. + * $params['s'] = (array) Comma-separated list of column names or column aliases to sort by. + * $params['time'] = (enum) The unit in which to display time values. (Options = nanos,micros,ms,s,m,h,d) + * $params['v'] = (boolean) Verbose mode. Display column headers. (Default = false) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -435,16 +666,23 @@ public function snapshots(array $params = []) return $this->performRequest($endpoint); } /** - * $params['format'] = (string) a short version of the Accept header, e.g. json, yaml - * $params['node_id'] = (list) A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * $params['actions'] = (list) A comma-separated list of actions that should be returned. Leave empty to return all. - * $params['detailed'] = (boolean) Return detailed task information (default: false) - * $params['parent_task'] = (number) Return tasks with specified parent task id. Set to -1 to return all. - * $params['h'] = (list) Comma-separated list of column names to display - * $params['help'] = (boolean) Return help information (Default = false) - * $params['s'] = (list) Comma-separated list of column names or column aliases to sort by - * $params['time'] = (enum) The unit in which to display time values (Options = d,h,m,s,ms,micros,nanos) - * $params['v'] = (boolean) Verbose mode. Display column headers (Default = false) + * Returns information about the tasks currently executing on one or more nodes in the cluster. + * + * $params['actions'] = (array) The task action names, which are used to limit the response. + * $params['detailed'] = (boolean) If `true`, the response includes detailed information about shard recoveries. (Default = false) + * $params['format'] = (string) A short version of the Accept header, e.g. json, yaml. + * $params['h'] = (array) Comma-separated list of column names to display. + * $params['help'] = (boolean) Return help information. (Default = false) + * $params['s'] = (array) Comma-separated list of column names or column aliases to sort by. + * $params['time'] = (enum) The unit in which to display time values. (Options = nanos,micros,ms,s,m,h,d) + * $params['v'] = (boolean) Verbose mode. Display column headers. (Default = false) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * $params['node_id'] = (array) Comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes. + * $params['parent_task'] = (string) The parent task identifier, which is used to limit the response. * * @param array $params Associative array of parameters * @return array @@ -458,14 +696,22 @@ public function tasks(array $params = []) return $this->performRequest($endpoint); } /** - * $params['name'] = (string) A pattern that returned template names must match - * $params['format'] = (string) a short version of the Accept header, e.g. json, yaml - * $params['local'] = (boolean) Return local information, do not retrieve the state from cluster_manager node (default: false) - * $params['cluster_manager_timeout'] = (time) Explicit operation timeout for connection to cluster_manager node - * $params['h'] = (list) Comma-separated list of column names to display - * $params['help'] = (boolean) Return help information (Default = false) - * $params['s'] = (list) Comma-separated list of column names or column aliases to sort by - * $params['v'] = (boolean) Verbose mode. Display column headers (Default = false) + * Returns information about existing templates. + * + * $params['name'] = (string) The name of the template to return. Accepts wildcard expressions. If omitted, all templates are returned. + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['format'] = (string) A short version of the Accept header, e.g. json, yaml. + * $params['h'] = (array) Comma-separated list of column names to display. + * $params['help'] = (boolean) Return help information. (Default = false) + * $params['local'] = (boolean) Return local information, do not retrieve the state from cluster-manager node. (Default = false) + * $params['master_timeout'] = (string) Operation timeout for connection to master node. + * $params['s'] = (array) Comma-separated list of column names or column aliases to sort by. + * $params['v'] = (boolean) Verbose mode. Display column headers. (Default = false) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -482,15 +728,23 @@ public function templates(array $params = []) return $this->performRequest($endpoint); } /** - * $params['thread_pool_patterns'] = (list) A comma-separated list of regular-expressions to filter the thread pools in the output - * $params['format'] = (string) a short version of the Accept header, e.g. json, yaml - * $params['size'] = (enum) The multiplier in which to display values (Options = ,k,m,g,t,p) - * $params['local'] = (boolean) Return local information, do not retrieve the state from cluster_manager node (default: false) - * $params['cluster_manager_timeout'] = (time) Explicit operation timeout for connection to cluster_manager node - * $params['h'] = (list) Comma-separated list of column names to display - * $params['help'] = (boolean) Return help information (Default = false) - * $params['s'] = (list) Comma-separated list of column names or column aliases to sort by - * $params['v'] = (boolean) Verbose mode. Display column headers (Default = false) + * Returns cluster-wide thread pool statistics per node.By default the active, queue and rejected statistics are returned for all thread pools. + * + * $params['thread_pool_patterns'] = (array) A comma-separated list of thread pool names used to limit the request. Accepts wildcard expressions. + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['format'] = (string) A short version of the Accept header, e.g. json, yaml. + * $params['h'] = (array) Comma-separated list of column names to display. + * $params['help'] = (boolean) Return help information. (Default = false) + * $params['local'] = (boolean) Return local information, do not retrieve the state from cluster-manager node. (Default = false) + * $params['master_timeout'] = (string) Operation timeout for connection to master node. + * $params['s'] = (array) Comma-separated list of column names or column aliases to sort by. + * $params['size'] = (integer) The multiplier in which to display values. + * $params['v'] = (boolean) Verbose mode. Display column headers. (Default = false) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -504,135 +758,6 @@ public function threadPool(array $params = []) $endpoint->setParams($params); $endpoint->setThreadPoolPatterns($thread_pool_patterns); - return $this->performRequest($endpoint); - } - /** - * $params['id'] = (string) The ID of the data frame analytics to fetch - * $params['allow_no_match'] = (boolean) Whether to ignore if a wildcard expression matches no configs. (This includes `_all` string or when no configs have been specified) - * $params['bytes'] = (enum) The unit in which to display byte values (Options = b,k,kb,m,mb,g,gb,t,tb,p,pb) - * $params['format'] = (string) a short version of the Accept header, e.g. json, yaml - * $params['h'] = (list) Comma-separated list of column names to display - * $params['help'] = (boolean) Return help information (Default = false) - * $params['s'] = (list) Comma-separated list of column names or column aliases to sort by - * $params['time'] = (enum) The unit in which to display time values (Options = d,h,m,s,ms,micros,nanos) - * $params['v'] = (boolean) Verbose mode. Display column headers (Default = false) - * - * @param array $params Associative array of parameters - * @return array - */ - public function mlDataFrameAnalytics(array $params = []) - { - $id = $this->extractArgument($params, 'id'); - - $endpointBuilder = $this->endpoints; - $endpoint = $endpointBuilder('Cat\MlDataFrameAnalytics'); - $endpoint->setParams($params); - $endpoint->setId($id); - - return $this->performRequest($endpoint); - } - /** - * $params['datafeed_id'] = (string) The ID of the datafeeds stats to fetch - * $params['allow_no_match'] = (boolean) Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified) - * $params['allow_no_datafeeds'] = (boolean) Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified) - * $params['format'] = (string) a short version of the Accept header, e.g. json, yaml - * $params['h'] = (list) Comma-separated list of column names to display - * $params['help'] = (boolean) Return help information (Default = false) - * $params['s'] = (list) Comma-separated list of column names or column aliases to sort by - * $params['time'] = (enum) The unit in which to display time values (Options = d,h,m,s,ms,micros,nanos) - * $params['v'] = (boolean) Verbose mode. Display column headers (Default = false) - * - * @param array $params Associative array of parameters - * @return array - */ - public function mlDatafeeds(array $params = []) - { - $datafeed_id = $this->extractArgument($params, 'datafeed_id'); - - $endpointBuilder = $this->endpoints; - $endpoint = $endpointBuilder('Cat\MlDatafeeds'); - $endpoint->setParams($params); - $endpoint->setDatafeedId($datafeed_id); - - return $this->performRequest($endpoint); - } - /** - * $params['job_id'] = (string) The ID of the jobs stats to fetch - * $params['allow_no_match'] = (boolean) Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified) - * $params['allow_no_jobs'] = (boolean) Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified) - * $params['bytes'] = (enum) The unit in which to display byte values (Options = b,k,kb,m,mb,g,gb,t,tb,p,pb) - * $params['format'] = (string) a short version of the Accept header, e.g. json, yaml - * $params['h'] = (list) Comma-separated list of column names to display - * $params['help'] = (boolean) Return help information (Default = false) - * $params['s'] = (list) Comma-separated list of column names or column aliases to sort by - * $params['time'] = (enum) The unit in which to display time values (Options = d,h,m,s,ms,micros,nanos) - * $params['v'] = (boolean) Verbose mode. Display column headers (Default = false) - * - * @param array $params Associative array of parameters - * @return array - */ - public function mlJobs(array $params = []) - { - $job_id = $this->extractArgument($params, 'job_id'); - - $endpointBuilder = $this->endpoints; - $endpoint = $endpointBuilder('Cat\MlJobs'); - $endpoint->setParams($params); - $endpoint->setJobId($job_id); - - return $this->performRequest($endpoint); - } - /** - * $params['model_id'] = (string) The ID of the trained models stats to fetch - * $params['allow_no_match'] = (boolean) Whether to ignore if a wildcard expression matches no trained models. (This includes `_all` string or when no trained models have been specified) (Default = true) - * $params['from'] = (int) skips a number of trained models (Default = 0) - * $params['size'] = (int) specifies a max number of trained models to get (Default = 100) - * $params['bytes'] = (enum) The unit in which to display byte values (Options = b,k,kb,m,mb,g,gb,t,tb,p,pb) - * $params['format'] = (string) a short version of the Accept header, e.g. json, yaml - * $params['h'] = (list) Comma-separated list of column names to display - * $params['help'] = (boolean) Return help information (Default = false) - * $params['s'] = (list) Comma-separated list of column names or column aliases to sort by - * $params['time'] = (enum) The unit in which to display time values (Options = d,h,m,s,ms,micros,nanos) - * $params['v'] = (boolean) Verbose mode. Display column headers (Default = false) - * - * @param array $params Associative array of parameters - * @return array - */ - public function mlTrainedModels(array $params = []) - { - $model_id = $this->extractArgument($params, 'model_id'); - - $endpointBuilder = $this->endpoints; - $endpoint = $endpointBuilder('Cat\MlTrainedModels'); - $endpoint->setParams($params); - $endpoint->setModelId($model_id); - - return $this->performRequest($endpoint); - } - /** - * $params['transform_id'] = (string) The id of the transform for which to get stats. '_all' or '*' implies all transforms - * $params['from'] = (int) skips a number of transform configs, defaults to 0 - * $params['size'] = (int) specifies a max number of transforms to get, defaults to 100 - * $params['allow_no_match'] = (boolean) Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified) - * $params['format'] = (string) a short version of the Accept header, e.g. json, yaml - * $params['h'] = (list) Comma-separated list of column names to display - * $params['help'] = (boolean) Return help information (Default = false) - * $params['s'] = (list) Comma-separated list of column names or column aliases to sort by - * $params['time'] = (enum) The unit in which to display time values (Options = d,h,m,s,ms,micros,nanos) - * $params['v'] = (boolean) Verbose mode. Display column headers (Default = false) - * - * @param array $params Associative array of parameters - * @return array - */ - public function transforms(array $params = []) - { - $transform_id = $this->extractArgument($params, 'transform_id'); - - $endpointBuilder = $this->endpoints; - $endpoint = $endpointBuilder('Cat\Transforms'); - $endpoint->setParams($params); - $endpoint->setTransformId($transform_id); - return $this->performRequest($endpoint); } } diff --git a/src/OpenSearch/Namespaces/ClusterNamespace.php b/src/OpenSearch/Namespaces/ClusterNamespace.php index 299cdaaa..c0e3c9fc 100644 --- a/src/OpenSearch/Namespaces/ClusterNamespace.php +++ b/src/OpenSearch/Namespaces/ClusterNamespace.php @@ -26,12 +26,20 @@ /** * Class ClusterNamespace * + * NOTE: This file is autogenerated using util/GenerateEndpoints.php */ class ClusterNamespace extends AbstractNamespace { /** - * $params['include_yes_decisions'] = (boolean) Return 'YES' decisions in explanation (default: false) - * $params['include_disk_info'] = (boolean) Return information about disk usage and shard sizes (default: false) + * Provides explanations for shard allocations in the cluster. + * + * $params['include_disk_info'] = (boolean) If true, returns information about disk usage and shard sizes. (Default = false) + * $params['include_yes_decisions'] = (boolean) If true, returns YES decisions in explanation. (Default = false) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * $params['body'] = (array) The index, shard, and primary flag to explain. Empty means 'explain the first unassigned shard' * * @param array $params Associative array of parameters @@ -49,16 +57,20 @@ public function allocationExplain(array $params = []) return $this->performRequest($endpoint); } /** - * $params['name'] = (string) The name of the template - * $params['timeout'] = (time) Explicit operation timeout - * $params['cluster_manager_timeout'] = (time) Specify timeout for connection to cluster_manager + * Deletes a component template. + * + * $params['name'] = (string) Name of the component template to delete. Wildcard (*) expressions are supported. + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['master_timeout'] = (string) Period to wait for a connection to the master node.If no response is received before the timeout expires, the request fails and returns an error. + * $params['timeout'] = (string) Period to wait for a response.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. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array - - * - * @note This API is EXPERIMENTAL and may be changed or removed completely in a future release - * */ public function deleteComponentTemplate(array $params = []) { @@ -72,7 +84,34 @@ public function deleteComponentTemplate(array $params = []) return $this->performRequest($endpoint); } /** - * $params['wait_for_removal'] = (boolean) Specifies whether to wait for all excluded nodes to be removed from the cluster before clearing the voting configuration exclusions list. (Default = true) + * Delete any existing decommission. + * + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * + * @param array $params Associative array of parameters + * @return array + */ + public function deleteDecommissionAwareness(array $params = []) + { + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Cluster\DeleteDecommissionAwareness'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * Clears cluster voting config exclusions. + * + * $params['wait_for_removal'] = (boolean) Specifies whether to wait for all excluded nodes to be removed from thecluster before clearing the voting configuration exclusions list.Defaults to true, meaning that all excluded nodes must be removed fromthe cluster before this API takes any action. If set to false then thevoting configuration exclusions list is cleared even if some excludednodes are still in the cluster. (Default = true) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -86,16 +125,40 @@ public function deleteVotingConfigExclusions(array $params = []) return $this->performRequest($endpoint); } /** - * $params['name'] = (string) The name of the template - * $params['cluster_manager_timeout'] = (time) Explicit operation timeout for connection to cluster_manager node - * $params['local'] = (boolean) Return local information, do not retrieve the state from cluster_manager node (default: false) + * Delete weighted shard routing weights. + * + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters - * @return bool + * @return array + */ + public function deleteWeightedRouting(array $params = []) + { + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Cluster\DeleteWeightedRouting'); + $endpoint->setParams($params); + return $this->performRequest($endpoint); + } + /** + * Returns information about whether a particular component template exist. * - * @note This API is EXPERIMENTAL and may be changed or removed completely in a future release + * $params['name'] = (string) Name of the component template to check existence of. Wildcard (*) expressions are supported. + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['local'] = (boolean) If true, the request retrieves information from the local node only.Defaults to false, which means information is retrieved from the master node. (Default = false) + * $params['master_timeout'] = (string) Period to wait for a connection to the master node. If no response isreceived before the timeout expires, the request fails and returns anerror. + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * + * @param array $params Associative array of parameters + * @return bool */ public function existsComponentTemplate(array $params = []): bool { @@ -112,16 +175,20 @@ public function existsComponentTemplate(array $params = []): bool return BooleanRequestWrapper::performRequest($endpoint, $this->transport); } /** - * $params['name'] = (list) The comma separated names of the component templates - * $params['cluster_manager_timeout'] = (time) Explicit operation timeout for connection to cluster_manager node - * $params['local'] = (boolean) Return local information, do not retrieve the state from cluster_manager node (default: false) + * Returns one or more component templates. + * + * $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['local'] = (boolean) If `true`, the request retrieves information from the local node only.If `false`, information is retrieved from the master node. (Default = false) + * $params['master_timeout'] = (string) Period to wait for a connection to the master 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. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array - - * - * @note This API is EXPERIMENTAL and may be changed or removed completely in a future release - * */ public function getComponentTemplate(array $params = []) { @@ -135,10 +202,42 @@ public function getComponentTemplate(array $params = []) return $this->performRequest($endpoint); } /** - * $params['flat_settings'] = (boolean) Return settings in flat format (default: false) - * $params['cluster_manager_timeout'] = (time) Explicit operation timeout for connection to cluster_manager node - * $params['timeout'] = (time) Explicit operation timeout - * $params['include_defaults'] = (boolean) Whether to return all default clusters setting. (Default = false) + * Get details and status of decommissioned attribute. + * + * $params['awareness_attribute_name'] = (string) Awareness attribute name. + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * + * @param array $params Associative array of parameters + * @return array + */ + public function getDecommissionAwareness(array $params = []) + { + $awareness_attribute_name = $this->extractArgument($params, 'awareness_attribute_name'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Cluster\GetDecommissionAwareness'); + $endpoint->setParams($params); + $endpoint->setAwarenessAttributeName($awareness_attribute_name); + + return $this->performRequest($endpoint); + } + /** + * Returns cluster settings. + * + * $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['include_defaults'] = (boolean) If `true`, returns default cluster settings from the local node. (Default = false) + * $params['master_timeout'] = (string) Period to wait for a connection to the master node.If no response is received before the timeout expires, the request fails and returns an error. + * $params['timeout'] = (string) Period to wait for a response.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. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -152,18 +251,51 @@ public function getSettings(array $params = []) return $this->performRequest($endpoint); } /** - * $params['index'] = (list) Limit the information returned to a specific index - * $params['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both. (Options = open,closed,hidden,none,all) (Default = all) - * $params['level'] = (enum) Specify the level of detail for returned information (Options = cluster,indices,shards) (Default = cluster) - * $params['local'] = (boolean) Return local information, do not retrieve the state from cluster_manager node (default: false) - * $params['cluster_manager_timeout'] = (time) Explicit operation timeout for connection to cluster_manager node - * $params['timeout'] = (time) Explicit operation timeout - * $params['wait_for_active_shards'] = (string) Wait until the specified number of shards is active - * $params['wait_for_nodes'] = (string) Wait until the specified number of nodes is available - * $params['wait_for_events'] = (enum) Wait until all currently queued events with the given priority are processed (Options = immediate,urgent,high,normal,low,languid) - * $params['wait_for_no_relocating_shards'] = (boolean) Whether to wait until there are no relocating shards in the cluster - * $params['wait_for_no_initializing_shards'] = (boolean) Whether to wait until there are no initializing shards in the cluster - * $params['wait_for_status'] = (enum) Wait until cluster is in a specific state (Options = green,yellow,red) + * Fetches weighted shard routing weights. + * + * $params['attribute'] = (string) Awareness attribute name. + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * + * @param array $params Associative array of parameters + * @return array + */ + public function getWeightedRouting(array $params = []) + { + $attribute = $this->extractArgument($params, 'attribute'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Cluster\GetWeightedRouting'); + $endpoint->setParams($params); + $endpoint->setAttribute($attribute); + + return $this->performRequest($endpoint); + } + /** + * Returns basic information about the health of the cluster. + * + * $params['index'] = (array) Comma-separated list of data streams, indices, and index aliases used to limit the request. Wildcard expressions (*) are supported. To target all data streams and indices in a cluster, omit this parameter or use `_all` or `*`. + * $params['awareness_attribute'] = (string) The awareness attribute for which the health is required. + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['expand_wildcards'] = (any) Whether to expand wildcard expression to concrete indices that are open, closed or both. + * $params['level'] = (enum) Can be one of cluster, indices or shards. Controls the details level of the health information returned. (Options = cluster,indices,shards,awareness_attributes) + * $params['local'] = (boolean) If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node. (Default = false) + * $params['master_timeout'] = (string) Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + * $params['timeout'] = (string) Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. + * $params['wait_for_active_shards'] = (any) A number controlling to how many active shards to wait for, all to wait for all shards in the cluster to be active, or 0 to not wait. + * $params['wait_for_events'] = (enum) Can be one of immediate, urgent, high, normal, low, languid. Wait until all currently queued events with the given priority are processed. (Options = immediate,urgent,high,normal,low,languid) + * $params['wait_for_no_initializing_shards'] = (boolean) A boolean value which controls whether to wait (until the timeout provided) for the cluster to have no shard initializations. Defaults to false, which means it will not wait for initializing shards. + * $params['wait_for_no_relocating_shards'] = (boolean) A boolean value which controls whether to wait (until the timeout provided) for the cluster to have no shard relocations. Defaults to false, which means it will not wait for relocating shards. + * $params['wait_for_nodes'] = (any) The request waits until the specified number N of nodes is available. It also accepts >=N, <=N, >N and yellow > red. By default, will not wait for any status. (Options = green,yellow,red) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -180,8 +312,16 @@ public function health(array $params = []) return $this->performRequest($endpoint); } /** - * $params['local'] = (boolean) Return local information, do not retrieve the state from cluster_manager node (default: false) - * $params['cluster_manager_timeout'] = (time) Specify timeout for connection to cluster_manager + * Returns a list of any cluster-level changes (e.g. create index, update mapping,allocate or fail shard) which have not yet been executed. + * + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['local'] = (boolean) If `true`, the request retrieves information from the local node only.If `false`, information is retrieved from the master node. (Default = false) + * $params['master_timeout'] = (string) Period to wait for a connection to the master 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. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -195,9 +335,16 @@ public function pendingTasks(array $params = []) return $this->performRequest($endpoint); } /** - * $params['node_ids'] = (string) A comma-separated list of the persistent ids of the nodes to exclude from the voting configuration. If specified, you may not also specify ?node_names. - * $params['node_names'] = (string) A comma-separated list of the names of the nodes to exclude from the voting configuration. If specified, you may not also specify ?node_ids. - * $params['timeout'] = (time) Explicit operation timeout (Default = 30s) + * Updates the cluster voting config exclusions by node ids or node names. + * + * $params['node_ids'] = (any) A comma-separated list of the persistent ids of the nodes to excludefrom the voting configuration. If specified, you may not also specify node_names. + * $params['node_names'] = (any) A comma-separated list of the names of the nodes to exclude from thevoting configuration. If specified, you may not also specify node_ids. + * $params['timeout'] = (string) When adding a voting configuration exclusion, the API waits for thespecified nodes to be excluded from the voting configuration beforereturning. If the timeout expires before the appropriate conditionis satisfied, the request fails and returns an error. + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -211,18 +358,22 @@ public function postVotingConfigExclusions(array $params = []) return $this->performRequest($endpoint); } /** - * $params['name'] = (string) The name of the template - * $params['create'] = (boolean) Whether the index template should only be added if new or can also replace an existing one (Default = false) - * $params['timeout'] = (time) Explicit operation timeout - * $params['cluster_manager_timeout'] = (time) Specify timeout for connection to cluster_manager - * $params['body'] = (array) The template definition (Required) + * Creates or updates a component template. + * + * $params['name'] = (string) Name of the component template to create. OpenSearch includes the following built-in component templates: `logs-mappings`; 'logs-settings`; `metrics-mappings`; `metrics-settings`;`synthetics-mapping`; `synthetics-settings`. OpenSearch Agent uses these templates to configure backing indices for its data streams. If you use OpenSearch Agent and want to overwrite one of these templates, set the `version` for your replacement template higher than the current version. If you don’t use OpenSearch Agent and want to disable all built-in component and index templates, set `stack.templates.enabled` to `false` using the cluster update settings API. + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['create'] = (boolean) If `true`, this request cannot replace or update existing component templates. (Default = false) + * $params['master_timeout'] = (string) Period to wait for a connection to the master node.If no response is received before the timeout expires, the request fails and returns an error. + * $params['timeout'] = (string) Operation timeout. + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * $params['body'] = (array) The template definition (Required) * * @param array $params Associative array of parameters * @return array - - * - * @note This API is EXPERIMENTAL and may be changed or removed completely in a future release - * */ public function putComponentTemplate(array $params = []) { @@ -238,10 +389,45 @@ public function putComponentTemplate(array $params = []) return $this->performRequest($endpoint); } /** - * $params['flat_settings'] = (boolean) Return settings in flat format (default: false) - * $params['cluster_manager_timeout'] = (time) Explicit operation timeout for connection to cluster_manager node - * $params['timeout'] = (time) Explicit operation timeout - * $params['body'] = (array) The settings to be updated. Can be either `transient` or `persistent` (survives cluster restart). (Required) + * Decommissions an awareness attribute. + * + * $params['awareness_attribute_name'] = (string) Awareness attribute name. + * $params['awareness_attribute_value'] = (string) Awareness attribute value. + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * + * @param array $params Associative array of parameters + * @return array + */ + public function putDecommissionAwareness(array $params = []) + { + $awareness_attribute_name = $this->extractArgument($params, 'awareness_attribute_name'); + $awareness_attribute_value = $this->extractArgument($params, 'awareness_attribute_value'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Cluster\PutDecommissionAwareness'); + $endpoint->setParams($params); + $endpoint->setAwarenessAttributeName($awareness_attribute_name); + $endpoint->setAwarenessAttributeValue($awareness_attribute_value); + + return $this->performRequest($endpoint); + } + /** + * Updates the cluster settings. + * + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['flat_settings'] = (boolean) Return settings in flat format. (Default = false) + * $params['master_timeout'] = (string) Explicit operation timeout for connection to master node + * $params['timeout'] = (string) Explicit operation timeout + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * $params['body'] = (array) The settings to be updated. Can be either `transient` or `persistent` (survives cluster restart). (Required) * * @param array $params Associative array of parameters * @return array @@ -258,6 +444,37 @@ public function putSettings(array $params = []) return $this->performRequest($endpoint); } /** + * Updates weighted shard routing weights. + * + * $params['attribute'] = (string) Awareness attribute name. + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * + * @param array $params Associative array of parameters + * @return array + */ + public function putWeightedRouting(array $params = []) + { + $attribute = $this->extractArgument($params, 'attribute'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Cluster\PutWeightedRouting'); + $endpoint->setParams($params); + $endpoint->setAttribute($attribute); + + return $this->performRequest($endpoint); + } + /** + * Returns the information about configured remote clusters. + * + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -271,13 +488,21 @@ public function remoteInfo(array $params = []) return $this->performRequest($endpoint); } /** - * $params['dry_run'] = (boolean) Simulate the operation only and return the resulting state - * $params['explain'] = (boolean) Return an explanation of why the commands can or cannot be executed - * $params['retry_failed'] = (boolean) Retries allocation of shards that are blocked due to too many subsequent allocation failures - * $params['metric'] = (list) Limit the information returned to the specified metrics. Defaults to all but metadata (Options = _all,blocks,metadata,nodes,routing_table,master_node,cluster_manager_node,version) - * $params['cluster_manager_timeout'] = (time) Explicit operation timeout for connection to cluster_manager node - * $params['timeout'] = (time) Explicit operation timeout - * $params['body'] = (array) The definition of `commands` to perform (`move`, `cancel`, `allocate`) + * Allows to manually change the allocation of individual shards in the cluster. + * + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['dry_run'] = (boolean) If true, then the request simulates the operation only and returns the resulting state. + * $params['explain'] = (boolean) If true, then the response contains an explanation of why the commands can or cannot be executed. + * $params['master_timeout'] = (string) Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + * $params['metric'] = (any) Limits the information returned to the specified metrics. + * $params['retry_failed'] = (boolean) If true, then retries allocation of shards that are blocked due to too many subsequent allocation failures. + * $params['timeout'] = (string) Period to wait for a response. 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. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * $params['body'] = (array) The definition of `commands` to perform (`move`, `cancel`, `allocate`) * * @param array $params Associative array of parameters * @return array @@ -294,16 +519,24 @@ public function reroute(array $params = []) return $this->performRequest($endpoint); } /** - * $params['metric'] = (list) Limit the information returned to the specified metrics - * $params['index'] = (list) A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * $params['local'] = (boolean) Return local information, do not retrieve the state from cluster_manager node (default: false) - * $params['cluster_manager_timeout'] = (time) Specify timeout for connection to cluster_manager - * $params['flat_settings'] = (boolean) Return settings in flat format (default: false) - * $params['wait_for_metadata_version'] = (number) Wait for the metadata version to be equal or greater than the specified metadata version - * $params['wait_for_timeout'] = (time) The maximum time to wait for wait_for_metadata_version before timing out - * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed) + * Returns a comprehensive information about the state of the cluster. + * + * $params['metric'] = (array) Limit the information returned to the specified metrics + * $params['index'] = (array) A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices * $params['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) - * $params['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both. (Options = open,closed,hidden,none,all) (Default = open) + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['expand_wildcards'] = (any) Whether to expand wildcard expression to concrete indices that are open, closed or both. + * $params['flat_settings'] = (boolean) Return settings in flat format. (Default = false) + * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed) + * $params['local'] = (boolean) Return local information, do not retrieve the state from cluster-manager node. (Default = false) + * $params['master_timeout'] = (string) Specify timeout for connection to master + * $params['wait_for_metadata_version'] = (number) Wait for the metadata version to be equal or greater than the specified metadata version + * $params['wait_for_timeout'] = (string) The maximum time to wait for wait_for_metadata_version before timing out + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -322,9 +555,16 @@ public function state(array $params = []) return $this->performRequest($endpoint); } /** - * $params['node_id'] = (list) A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * $params['flat_settings'] = (boolean) Return settings in flat format (default: false) - * $params['timeout'] = (time) Explicit operation timeout + * Returns high-level overview of cluster statistics. + * + * $params['node_id'] = (array) Comma-separated list of node filters used to limit returned information. Defaults to all nodes in the cluster. + * $params['flat_settings'] = (boolean) If `true`, returns settings in flat format. (Default = false) + * $params['timeout'] = (string) Period to wait for each node to respond.If a node does not respond before its timeout expires, the response does not include its stats.However, timed out nodes are included in the response’s `_nodes.failed` property. Defaults to no timeout. + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array diff --git a/src/OpenSearch/Namespaces/DanglingIndicesNamespace.php b/src/OpenSearch/Namespaces/DanglingIndicesNamespace.php index 1a9436c6..ff17095b 100644 --- a/src/OpenSearch/Namespaces/DanglingIndicesNamespace.php +++ b/src/OpenSearch/Namespaces/DanglingIndicesNamespace.php @@ -26,14 +26,23 @@ /** * Class DanglingIndicesNamespace * + * NOTE: This file is autogenerated using util/GenerateEndpoints.php */ class DanglingIndicesNamespace extends AbstractNamespace { /** - * $params['index_uuid'] = (string) The UUID of the dangling index - * $params['accept_data_loss'] = (boolean) Must be set to true in order to delete the dangling index - * $params['timeout'] = (time) Explicit operation timeout - * $params['cluster_manager_timeout'] = (time) Specify timeout for connection to cluster_manager + * Deletes the specified dangling index. + * + * $params['index_uuid'] = (string) The UUID of the dangling index + * $params['accept_data_loss'] = (boolean) Must be set to true in order to delete the dangling index + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['master_timeout'] = (string) Specify timeout for connection to master + * $params['timeout'] = (string) Explicit operation timeout + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -50,10 +59,18 @@ public function deleteDanglingIndex(array $params = []) return $this->performRequest($endpoint); } /** - * $params['index_uuid'] = (string) The UUID of the dangling index - * $params['accept_data_loss'] = (boolean) Must be set to true in order to import the dangling index - * $params['timeout'] = (time) Explicit operation timeout - * $params['cluster_manager_timeout'] = (time) Specify timeout for connection to cluster_manager + * Imports the specified dangling index. + * + * $params['index_uuid'] = (string) The UUID of the dangling index + * $params['accept_data_loss'] = (boolean) Must be set to true in order to import the dangling index + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['master_timeout'] = (string) Specify timeout for connection to master + * $params['timeout'] = (string) Explicit operation timeout + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -70,6 +87,13 @@ public function importDanglingIndex(array $params = []) return $this->performRequest($endpoint); } /** + * Returns all dangling indices. + * + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array diff --git a/src/OpenSearch/Namespaces/IndicesNamespace.php b/src/OpenSearch/Namespaces/IndicesNamespace.php index c922c622..47396725 100644 --- a/src/OpenSearch/Namespaces/IndicesNamespace.php +++ b/src/OpenSearch/Namespaces/IndicesNamespace.php @@ -26,37 +26,53 @@ /** * Class IndicesNamespace * + * NOTE: This file is autogenerated using util/GenerateEndpoints.php */ class IndicesNamespace extends AbstractNamespace { /** - * $params['index'] = (list) A comma separated list of indices to add a block to - * $params['block'] = (string) The block to add (one of read, write, read_only or metadata) - * $params['timeout'] = (time) Explicit operation timeout - * $params['cluster_manager_timeout'] = (time) Specify timeout for connection to cluster_manager - * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed) - * $params['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) - * $params['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both. (Options = open,closed,hidden,none,all) (Default = open) + * Adds a block to an index. + * + * $params['block'] = (string) The block to add (one of read, write, read_only or metadata) + * $params['index'] = (array) A comma separated list of indices to add a block to + * $params['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) + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['expand_wildcards'] = (any) Whether to expand wildcard expression to concrete indices that are open, closed or both. + * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed) + * $params['master_timeout'] = (string) Specify timeout for connection to master + * $params['timeout'] = (string) Explicit operation timeout + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array */ public function addBlock(array $params = []) { - $index = $this->extractArgument($params, 'index'); $block = $this->extractArgument($params, 'block'); + $index = $this->extractArgument($params, 'index'); $endpointBuilder = $this->endpoints; $endpoint = $endpointBuilder('Indices\AddBlock'); $endpoint->setParams($params); - $endpoint->setIndex($index); $endpoint->setBlock($block); + $endpoint->setIndex($index); return $this->performRequest($endpoint); } /** - * $params['index'] = (string) The name of the index to scope the operation - * $params['body'] = (array) Define analyzer/tokenizer parameters and the text on which the analysis should be performed + * Performs the analysis process on a text and return the tokens breakdown of the text. + * + * $params['index'] = (string) Index used to derive the analyzer. If specified, the `analyzer` or field parameter overrides this value. If no index is specified or the index does not have a default analyzer, the analyze API uses the standard analyzer. + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * $params['body'] = (array) Define analyzer/tokenizer parameters and the text on which the analysis should be performed * * @param array $params Associative array of parameters * @return array @@ -75,14 +91,21 @@ public function analyze(array $params = []) return $this->performRequest($endpoint); } /** - * $params['index'] = (list) A comma-separated list of index name to limit the operation - * $params['fielddata'] = (boolean) Clear field data - * $params['fields'] = (list) A comma-separated list of fields to clear when using the `fielddata` parameter (default: all) - * $params['query'] = (boolean) Clear query caches - * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed) - * $params['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) - * $params['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both. (Options = open,closed,hidden,none,all) (Default = open) - * $params['request'] = (boolean) Clear request cache + * Clears all or specific caches for one or more indices. + * + * $params['index'] = (array) Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indices, omit this parameter or use `*` or `_all`. + * $params['allow_no_indices'] = (boolean) If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.This behavior applies even if the request targets other open indices. + * $params['expand_wildcards'] = (any) Type of index that wildcard patterns can match.If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.Supports comma-separated values, such as `open,hidden`.Valid values are: `all`, `open`, `closed`, `hidden`, `none`. + * $params['fielddata'] = (boolean) If `true`, clears the fields cache.Use the `fields` parameter to clear the cache of specific fields only. + * $params['fields'] = (any) Comma-separated list of field names used to limit the `fielddata` parameter. + * $params['ignore_unavailable'] = (boolean) If `false`, the request returns an error if it targets a missing or closed index. + * $params['query'] = (boolean) If `true`, clears the query cache. + * $params['request'] = (boolean) If `true`, clears the request cache. + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -99,12 +122,22 @@ public function clearCache(array $params = []) return $this->performRequest($endpoint); } /** - * $params['index'] = (string) The name of the source index to clone - * $params['target'] = (string) The name of the target index to clone into - * $params['timeout'] = (time) Explicit operation timeout - * $params['cluster_manager_timeout'] = (time) Specify timeout for connection to cluster_manager - * $params['wait_for_active_shards'] = (string) Set the number of active shards to wait for on the cloned index before the operation returns. - * $params['body'] = (array) The configuration for the target index (`settings` and `aliases`) + * Clones an index. + * + * $params['index'] = (string) Name of the source index to clone. + * $params['target'] = (string) Name of the target index to create. + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['master_timeout'] = (string) Period to wait for a connection to the master node.If no response is received before the timeout expires, the request fails and returns an error. + * $params['task_execution_timeout'] = (string) Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h. + * $params['timeout'] = (string) Period to wait for a response.If no response is received before the timeout expires, the request fails and returns an error. + * $params['wait_for_active_shards'] = (any) The number of shard copies that must be active before proceeding with the operation.Set to `all` or any positive integer up to the total number of shards in the index (`number_of_replicas+1`). + * $params['wait_for_completion'] = (boolean) Should this request wait until the operation has completed before returning. (Default = true) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * $params['body'] = (array) The configuration for the target index (`settings` and `aliases`) * * @param array $params Associative array of parameters * @return array @@ -125,13 +158,21 @@ public function clone(array $params = []) return $this->performRequest($endpoint); } /** - * $params['index'] = (list) A comma separated list of indices to close - * $params['timeout'] = (time) Explicit operation timeout - * $params['cluster_manager_timeout'] = (time) Specify timeout for connection to cluster_manager - * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed) - * $params['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) - * $params['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both. (Options = open,closed,hidden,none,all) (Default = open) - * $params['wait_for_active_shards'] = (string) Sets the number of active shards to wait for before the operation returns. + * Closes an index. + * + * $params['index'] = (array) Comma-separated list or wildcard expression of index names used to limit the request. + * $params['allow_no_indices'] = (boolean) If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.This behavior applies even if the request targets other open indices. + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['expand_wildcards'] = (any) Type of index that wildcard patterns can match.If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.Supports comma-separated values, such as `open,hidden`.Valid values are: `all`, `open`, `closed`, `hidden`, `none`. + * $params['ignore_unavailable'] = (boolean) If `false`, the request returns an error if it targets a missing or closed index. + * $params['master_timeout'] = (string) Period to wait for a connection to the master node.If no response is received before the timeout expires, the request fails and returns an error. + * $params['timeout'] = (string) Period to wait for a response.If no response is received before the timeout expires, the request fails and returns an error. + * $params['wait_for_active_shards'] = (any) The number of shard copies that must be active before proceeding with the operation.Set to `all` or any positive integer up to the total number of shards in the index (`number_of_replicas+1`). + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -148,11 +189,19 @@ public function close(array $params = []) return $this->performRequest($endpoint); } /** - * $params['index'] = (string) The name of the index - * $params['wait_for_active_shards'] = (string) Set the number of active shards to wait for before the operation returns. - * $params['timeout'] = (time) Explicit operation timeout - * $params['cluster_manager_timeout'] = (time) Specify timeout for connection to cluster_manager - * $params['body'] = (array) The configuration for the index (`settings` and `mappings`) + * Creates an index with optional settings and mappings. + * + * $params['index'] = (string) Name of the index you wish to create. + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['master_timeout'] = (string) Period to wait for a connection to the master node.If no response is received before the timeout expires, the request fails and returns an error. + * $params['timeout'] = (string) Period to wait for a response.If no response is received before the timeout expires, the request fails and returns an error. + * $params['wait_for_active_shards'] = (any) The number of shard copies that must be active before proceeding with the operation. Set to `all` or any positive integer up to the total number of shards in the index (`number_of_replicas+1`). + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * $params['body'] = (array) The configuration for the index (`settings` and `mappings`) * * @param array $params Associative array of parameters * @return array @@ -171,12 +220,71 @@ public function create(array $params = []) return $this->performRequest($endpoint); } /** - * $params['index'] = (list) A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices - * $params['timeout'] = (time) Explicit operation timeout - * $params['cluster_manager_timeout'] = (time) Specify timeout for connection to cluster_manager - * $params['ignore_unavailable'] = (boolean) Ignore unavailable indexes (default: false) - * $params['allow_no_indices'] = (boolean) Ignore if a wildcard expression resolves to no concrete indices (default: false) - * $params['expand_wildcards'] = (enum) Whether wildcard expressions should get expanded to open or closed indices (default: open) (Options = open,closed,hidden,none,all) (Default = open) + * Creates or updates a data stream. + * + * $params['name'] = (string) Name of the data stream, which must meet the following criteria: Lowercase only; Cannot include `\`, `/`, `*`, `?`, `"`, `<`, `>`, `|`, `,`, `#`, `:`, or a space character; Cannot start with `-`, `_`, `+`, or `.ds-`; Cannot be `.` or `..`; Cannot be longer than 255 bytes. Multi-byte characters count towards this limit faster. + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * $params['body'] = (array) The data stream definition + * + * @param array $params Associative array of parameters + * @return array + */ + public function createDataStream(array $params = []) + { + $name = $this->extractArgument($params, 'name'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Indices\CreateDataStream'); + $endpoint->setParams($params); + $endpoint->setName($name); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * Provides statistics on operations happening in a data stream. + * + * $params['name'] = (array) Comma-separated list of data streams used to limit the request. Wildcard expressions (`*`) are supported. To target all data streams in a cluster, omit this parameter or use `*`. + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * + * @param array $params Associative array of parameters + * @return array + */ + public function dataStreamsStats(array $params = []) + { + $name = $this->extractArgument($params, 'name'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Indices\DataStreamsStats'); + $endpoint->setParams($params); + $endpoint->setName($name); + + return $this->performRequest($endpoint); + } + /** + * Deletes an index. + * + * $params['index'] = (array) Comma-separated list of indices to delete. You cannot specify index aliases. By default, this parameter does not support wildcards (`*`) or `_all`. To use wildcards or `_all`, set the `action.destructive_requires_name` cluster setting to `false`. + * $params['allow_no_indices'] = (boolean) If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.This behavior applies even if the request targets other open indices. (Default = false) + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['expand_wildcards'] = (any) Type of index that wildcard patterns can match.If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.Supports comma-separated values, such as `open,hidden`.Valid values are: `all`, `open`, `closed`, `hidden`, `none`. + * $params['ignore_unavailable'] = (boolean) If `false`, the request returns an error if it targets a missing or closed index. (Default = false) + * $params['master_timeout'] = (string) Period to wait for a connection to the master node.If no response is received before the timeout expires, the request fails and returns an error. + * $params['timeout'] = (string) Period to wait for a response.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. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -193,10 +301,18 @@ public function delete(array $params = []) return $this->performRequest($endpoint); } /** - * $params['index'] = (list) A comma-separated list of index names (supports wildcards); use `_all` for all indices (Required) - * $params['name'] = (list) A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices. (Required) - * $params['timeout'] = (time) Explicit timestamp for the document - * $params['cluster_manager_timeout'] = (time) Specify timeout for connection to cluster_manager + * Deletes an alias. + * + * $params['index'] = (array) Comma-separated list of data streams or indices used to limit the request. Supports wildcards (`*`). (Required) + * $params['name'] = (array) Comma-separated list of aliases to remove. Supports wildcards (`*`). To remove all aliases, use `*` or `_all`. (Required) + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['master_timeout'] = (string) Period to wait for a connection to the master node.If no response is received before the timeout expires, the request fails and returns an error. + * $params['timeout'] = (string) Period to wait for a response.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. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -215,16 +331,44 @@ public function deleteAlias(array $params = []) return $this->performRequest($endpoint); } /** - * $params['name'] = (string) The name of the template - * $params['timeout'] = (time) Explicit operation timeout - * $params['cluster_manager_timeout'] = (time) Specify timeout for connection to cluster_manager + * Deletes a data stream. + * + * $params['name'] = (array) Comma-separated list of data streams to delete. Wildcard (`*`) expressions are supported. + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array + */ + public function deleteDataStream(array $params = []) + { + $name = $this->extractArgument($params, 'name'); + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Indices\DeleteDataStream'); + $endpoint->setParams($params); + $endpoint->setName($name); + + return $this->performRequest($endpoint); + } + /** + * Deletes an index template. + * + * $params['name'] = (string) Name of the index template to delete. Wildcard (*) expressions are supported. + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['master_timeout'] = (string) Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + * $params['timeout'] = (string) Period to wait for a response. 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. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * - * @note This API is EXPERIMENTAL and may be changed or removed completely in a future release - * + * @param array $params Associative array of parameters + * @return array */ public function deleteIndexTemplate(array $params = []) { @@ -238,9 +382,17 @@ public function deleteIndexTemplate(array $params = []) return $this->performRequest($endpoint); } /** - * $params['name'] = (string) The name of the template - * $params['timeout'] = (time) Explicit operation timeout - * $params['cluster_manager_timeout'] = (time) Specify timeout for connection to cluster_manager + * Deletes an index template. + * + * $params['name'] = (string) The name of the legacy index template to delete. Wildcard (`*`) expressions are supported. + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['master_timeout'] = (string) Period to wait for a connection to the master node.If no response is received before the timeout expires, the request fails and returns an error. + * $params['timeout'] = (string) Period to wait for a response.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. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -257,13 +409,20 @@ public function deleteTemplate(array $params = []) return $this->performRequest($endpoint); } /** - * $params['index'] = (list) A comma-separated list of index names - * $params['local'] = (boolean) Return local information, do not retrieve the state from cluster_manager node (default: false) - * $params['ignore_unavailable'] = (boolean) Ignore unavailable indexes (default: false) - * $params['allow_no_indices'] = (boolean) Ignore if a wildcard expression resolves to no concrete indices (default: false) - * $params['expand_wildcards'] = (enum) Whether wildcard expressions should get expanded to open or closed indices (default: open) (Options = open,closed,hidden,none,all) (Default = open) - * $params['flat_settings'] = (boolean) Return settings in flat format (default: false) - * $params['include_defaults'] = (boolean) Whether to return all default setting for each of the indices. (Default = false) + * Returns information about whether a particular index exists. + * + * $params['index'] = (array) Comma-separated list of data streams, indices, and aliases. Supports wildcards (`*`). + * $params['allow_no_indices'] = (boolean) If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.This behavior applies even if the request targets other open indices. (Default = false) + * $params['expand_wildcards'] = (any) Type of index that wildcard patterns can match.If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.Supports comma-separated values, such as `open,hidden`.Valid values are: `all`, `open`, `closed`, `hidden`, `none`. + * $params['flat_settings'] = (boolean) If `true`, returns settings in flat format. (Default = false) + * $params['ignore_unavailable'] = (boolean) If `false`, the request returns an error if it targets a missing or closed index. (Default = false) + * $params['include_defaults'] = (boolean) If `true`, return all default settings in the response. (Default = false) + * $params['local'] = (boolean) If `true`, the request retrieves information from the local node only. (Default = false) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return bool @@ -283,12 +442,19 @@ public function exists(array $params = []): bool return BooleanRequestWrapper::performRequest($endpoint, $this->transport); } /** - * $params['name'] = (list) A comma-separated list of alias names to return (Required) - * $params['index'] = (list) A comma-separated list of index names to filter aliases - * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed) - * $params['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) - * $params['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both. (Options = open,closed,hidden,none,all) (Default = all) - * $params['local'] = (boolean) Return local information, do not retrieve the state from cluster_manager node (default: false) + * Returns information about whether a particular alias exists. + * + * $params['name'] = (array) Comma-separated list of aliases to check. Supports wildcards (`*`). (Required) + * $params['index'] = (array) Comma-separated list of data streams or indices used to limit the request. Supports wildcards (`*`). To target all data streams and indices, omit this parameter or use `*` or `_all`. + * $params['allow_no_indices'] = (boolean) If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.This behavior applies even if the request targets other open indices. + * $params['expand_wildcards'] = (any) Type of index that wildcard patterns can match.If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.Supports comma-separated values, such as `open,hidden`.Valid values are: `all`, `open`, `closed`, `hidden`, `none`. + * $params['ignore_unavailable'] = (boolean) If `false`, requests that include a missing data stream or index in the target indices or data streams return an error. + * $params['local'] = (boolean) If `true`, the request retrieves information from the local node only. (Default = false) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return bool @@ -310,17 +476,21 @@ public function existsAlias(array $params = []): bool return BooleanRequestWrapper::performRequest($endpoint, $this->transport); } /** - * $params['name'] = (string) The name of the template - * $params['flat_settings'] = (boolean) Return settings in flat format (default: false) - * $params['cluster_manager_timeout'] = (time) Explicit operation timeout for connection to cluster_manager node - * $params['local'] = (boolean) Return local information, do not retrieve the state from cluster_manager node (default: false) + * Returns information about whether a particular index template exists. + * + * $params['name'] = (string) Name of the index template to check existence of. Wildcard (*) expressions are supported. + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['flat_settings'] = (boolean) Return settings in flat format. (Default = false) + * $params['local'] = (boolean) Return local information, do not retrieve the state from cluster-manager node. (Default = false) + * $params['master_timeout'] = (string) Period to wait for a connection to the master 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. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return bool - - * - * @note This API is EXPERIMENTAL and may be changed or removed completely in a future release - * */ public function existsIndexTemplate(array $params = []): bool { @@ -337,10 +507,18 @@ public function existsIndexTemplate(array $params = []): bool return BooleanRequestWrapper::performRequest($endpoint, $this->transport); } /** - * $params['name'] = (list) The comma separated names of the index templates - * $params['flat_settings'] = (boolean) Return settings in flat format (default: false) - * $params['cluster_manager_timeout'] = (time) Explicit operation timeout for connection to cluster_manager node - * $params['local'] = (boolean) Return local information, do not retrieve the state from cluster_manager node (default: false) + * Returns information about whether a particular index template exists. + * + * $params['name'] = (array) The comma separated names of the index templates + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['flat_settings'] = (boolean) Return settings in flat format. (Default = false) + * $params['local'] = (boolean) Return local information, do not retrieve the state from cluster-manager node. (Default = false) + * $params['master_timeout'] = (string) Explicit operation timeout for connection to master node + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return bool @@ -360,12 +538,19 @@ public function existsTemplate(array $params = []): bool return BooleanRequestWrapper::performRequest($endpoint, $this->transport); } /** - * $params['index'] = (list) A comma-separated list of index names; use `_all` or empty string for all indices - * $params['force'] = (boolean) Whether a flush should be forced even if it is not necessarily needed ie. if no changes will be committed to the index. This is useful if transaction log IDs should be incremented even if no uncommitted changes are present. (This setting can be considered as internal) - * $params['wait_if_ongoing'] = (boolean) If set to true the flush operation will block until the flush can be executed if another flush operation is already executing. The default is true. If set to false the flush will be skipped iff if another flush operation is already running. - * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed) - * $params['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) - * $params['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both. (Options = open,closed,hidden,none,all) (Default = open) + * Performs the flush operation on one or more indices. + * + * $params['index'] = (array) Comma-separated list of data streams, indices, and aliases to flush. Supports wildcards (`*`). To flush all data streams and indices, omit this parameter or use `*` or `_all`. + * $params['allow_no_indices'] = (boolean) If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.This behavior applies even if the request targets other open indices. + * $params['expand_wildcards'] = (any) Type of index that wildcard patterns can match.If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.Supports comma-separated values, such as `open,hidden`.Valid values are: `all`, `open`, `closed`, `hidden`, `none`. + * $params['force'] = (boolean) If `true`, the request forces a flush even if there are no changes to commit to the index. + * $params['ignore_unavailable'] = (boolean) If `false`, the request returns an error if it targets a missing or closed index. + * $params['wait_if_ongoing'] = (boolean) If `true`, the flush operation blocks until execution when another flush operation is running.If `false`, OpenSearch returns an error if you request a flush when another flush operation is running. (Default = true) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -382,13 +567,22 @@ public function flush(array $params = []) return $this->performRequest($endpoint); } /** - * $params['index'] = (list) A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * $params['flush'] = (boolean) Specify whether the index should be flushed after performing the operation (default: true) - * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed) + * Performs the force merge operation on one or more indices. + * + * $params['index'] = (array) A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices * $params['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) - * $params['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both. (Options = open,closed,hidden,none,all) (Default = open) - * $params['max_num_segments'] = (number) The number of segments the index should be merged into (default: dynamic) + * $params['expand_wildcards'] = (any) Whether to expand wildcard expression to concrete indices 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 indices 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['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) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -405,14 +599,22 @@ public function forcemerge(array $params = []) return $this->performRequest($endpoint); } /** - * $params['index'] = (list) A comma-separated list of index names - * $params['local'] = (boolean) Return local information, do not retrieve the state from cluster_manager node (default: false) - * $params['ignore_unavailable'] = (boolean) Ignore unavailable indexes (default: false) - * $params['allow_no_indices'] = (boolean) Ignore if a wildcard expression resolves to no concrete indices (default: false) - * $params['expand_wildcards'] = (enum) Whether wildcard expressions should get expanded to open or closed indices (default: open) (Options = open,closed,hidden,none,all) (Default = open) - * $params['flat_settings'] = (boolean) Return settings in flat format (default: false) - * $params['include_defaults'] = (boolean) Whether to return all default setting for each of the indices. (Default = false) - * $params['cluster_manager_timeout'] = (time) Specify timeout for connection to cluster_manager + * Returns information about one or more indices. + * + * $params['index'] = (array) Comma-separated list of data streams, indices, and index aliases used to limit the request. Wildcard expressions (*) are supported. + * $params['allow_no_indices'] = (boolean) If false, the request returns an error if any wildcard expression, index alias, or _all value targets onlymissing or closed indices. This behavior applies even if the request targets other open indices. For example,a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar. (Default = false) + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['expand_wildcards'] = (any) Type of index that wildcard expressions can match. If the request can target data streams, this argumentdetermines whether wildcard expressions match hidden data streams. Supports comma-separated values,such as open,hidden. + * $params['flat_settings'] = (boolean) If true, returns settings in flat format. (Default = false) + * $params['ignore_unavailable'] = (boolean) If false, requests that target a missing index return an error. (Default = false) + * $params['include_defaults'] = (boolean) If true, return all default settings in the response. (Default = false) + * $params['local'] = (boolean) If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node. (Default = false) + * $params['master_timeout'] = (string) Period to wait for a connection to the master 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. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -429,12 +631,19 @@ public function get(array $params = []) return $this->performRequest($endpoint); } /** - * $params['name'] = (list) A comma-separated list of alias names to return - * $params['index'] = (list) A comma-separated list of index names to filter aliases - * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed) - * $params['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) - * $params['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both. (Options = open,closed,hidden,none,all) (Default = all) - * $params['local'] = (boolean) Return local information, do not retrieve the state from cluster_manager node (default: false) + * Returns an alias. + * + * $params['name'] = (array) Comma-separated list of aliases to retrieve. Supports wildcards (`*`). To retrieve all aliases, omit this parameter or use `*` or `_all`. + * $params['index'] = (array) Comma-separated list of data streams or indices used to limit the request. Supports wildcards (`*`). To target all data streams and indices, omit this parameter or use `*` or `_all`. + * $params['allow_no_indices'] = (boolean) If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.This behavior applies even if the request targets other open indices. + * $params['expand_wildcards'] = (any) Type of index that wildcard patterns can match.If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.Supports comma-separated values, such as `open,hidden`.Valid values are: `all`, `open`, `closed`, `hidden`, `none`. + * $params['ignore_unavailable'] = (boolean) If `false`, the request returns an error if it targets a missing or closed index. + * $params['local'] = (boolean) If `true`, the request retrieves information from the local node only. (Default = false) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -453,13 +662,44 @@ public function getAlias(array $params = []) return $this->performRequest($endpoint); } /** - * $params['fields'] = (list) A comma-separated list of fields (Required) - * $params['index'] = (list) A comma-separated list of index names - * $params['include_defaults'] = (boolean) Whether the default mapping values should be returned as well - * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed) - * $params['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) - * $params['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both. (Options = open,closed,hidden,none,all) (Default = open) - * $params['local'] = (boolean) Return local information, do not retrieve the state from cluster_manager node (default: false) + * Returns data streams. + * + * $params['name'] = (array) Comma-separated list of data stream names used to limit the request. Wildcard (`*`) expressions are supported. If omitted, all data streams are returned. + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * + * @param array $params Associative array of parameters + * @return array + */ + public function getDataStream(array $params = []) + { + $name = $this->extractArgument($params, 'name'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Indices\GetDataStream'); + $endpoint->setParams($params); + $endpoint->setName($name); + + return $this->performRequest($endpoint); + } + /** + * Returns mapping for one or more fields. + * + * $params['fields'] = (array) Comma-separated list or wildcard expression of fields used to limit returned information. (Required) + * $params['index'] = (array) Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indices, omit this parameter or use `*` or `_all`. + * $params['allow_no_indices'] = (boolean) If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.This behavior applies even if the request targets other open indices. + * $params['expand_wildcards'] = (any) Type of index that wildcard patterns can match.If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.Supports comma-separated values, such as `open,hidden`.Valid values are: `all`, `open`, `closed`, `hidden`, `none`. + * $params['ignore_unavailable'] = (boolean) If `false`, the request returns an error if it targets a missing or closed index. + * $params['include_defaults'] = (boolean) If `true`, return all default settings in the response. + * $params['local'] = (boolean) If `true`, the request retrieves information from the local node only. (Default = false) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -478,17 +718,21 @@ public function getFieldMapping(array $params = []) return $this->performRequest($endpoint); } /** - * $params['name'] = (list) The comma separated names of the index templates - * $params['flat_settings'] = (boolean) Return settings in flat format (default: false) - * $params['cluster_manager_timeout'] = (time) Explicit operation timeout for connection to cluster_manager node - * $params['local'] = (boolean) Return local information, do not retrieve the state from cluster_manager node (default: false) + * Returns an index template. + * + * $params['name'] = (array) Name of the index 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. Defaults to false, which means information is retrieved from the master node. (Default = false) + * $params['master_timeout'] = (string) Period to wait for a connection to the master 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. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array - - * - * @note This API is EXPERIMENTAL and may be changed or removed completely in a future release - * */ public function getIndexTemplate(array $params = []) { @@ -502,12 +746,20 @@ public function getIndexTemplate(array $params = []) return $this->performRequest($endpoint); } /** - * $params['index'] = (list) A comma-separated list of index names - * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed) - * $params['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) - * $params['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both. (Options = open,closed,hidden,none,all) (Default = open) - * $params['cluster_manager_timeout'] = (time) Specify timeout for connection to cluster_manager - * $params['local'] = (boolean) Return local information, do not retrieve the state from cluster_manager node (default: false) + * Returns mappings for one or more indices. + * + * $params['index'] = (array) Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indices, omit this parameter or use `*` or `_all`. + * $params['allow_no_indices'] = (boolean) If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.This behavior applies even if the request targets other open indices. + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['expand_wildcards'] = (any) Type of index that wildcard patterns can match.If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.Supports comma-separated values, such as `open,hidden`.Valid values are: `all`, `open`, `closed`, `hidden`, `none`. + * $params['ignore_unavailable'] = (boolean) If `false`, the request returns an error if it targets a missing or closed index. + * $params['local'] = (boolean) If `true`, the request retrieves information from the local node only. (Default = false) + * $params['master_timeout'] = (string) Period to wait for a connection to the master 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. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -524,37 +776,53 @@ public function getMapping(array $params = []) return $this->performRequest($endpoint); } /** - * $params['index'] = (list) A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * $params['name'] = (list) The name of the settings that should be included - * $params['cluster_manager_timeout'] = (time) Specify timeout for connection to cluster_manager - * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed) - * $params['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) - * $params['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both. (Options = open,closed,hidden,none,all) (Default = all) - * $params['flat_settings'] = (boolean) Return settings in flat format (default: false) - * $params['local'] = (boolean) Return local information, do not retrieve the state from cluster_manager node (default: false) - * $params['include_defaults'] = (boolean) Whether to return all default setting for each of the indices. (Default = false) + * Returns settings for one or more indices. + * + * $params['name'] = (array) Comma-separated list or wildcard expression of settings to retrieve. + * $params['index'] = (array) Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indices, omit this parameter or use `*` or `_all`. + * $params['allow_no_indices'] = (boolean) If `false`, the request returns an error if any wildcard expression, indexalias, or `_all` value targets only missing or closed indices. Thisbehavior applies even if the request targets other open indices. Forexample, a request targeting `foo*,bar*` returns an error if an indexstarts with foo but no index starts with `bar`. + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['expand_wildcards'] = (any) Type of index that wildcard patterns can match.If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.Supports comma-separated values, such as `open,hidden`. + * $params['flat_settings'] = (boolean) If `true`, returns settings in flat format. (Default = false) + * $params['ignore_unavailable'] = (boolean) If `false`, the request returns an error if it targets a missing or closed index. + * $params['include_defaults'] = (boolean) If `true`, return all default settings in the response. (Default = false) + * $params['local'] = (boolean) If `true`, the request retrieves information from the local node only. If`false`, information is retrieved from the master node. (Default = false) + * $params['master_timeout'] = (string) Period to wait for a connection to the master node. If no response isreceived before the timeout expires, the request fails and returns anerror. + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array */ public function getSettings(array $params = []) { - $index = $this->extractArgument($params, 'index'); $name = $this->extractArgument($params, 'name'); + $index = $this->extractArgument($params, 'index'); $endpointBuilder = $this->endpoints; $endpoint = $endpointBuilder('Indices\GetSettings'); $endpoint->setParams($params); - $endpoint->setIndex($index); $endpoint->setName($name); + $endpoint->setIndex($index); return $this->performRequest($endpoint); } /** - * $params['name'] = (list) The comma separated names of the index templates - * $params['flat_settings'] = (boolean) Return settings in flat format (default: false) - * $params['cluster_manager_timeout'] = (time) Explicit operation timeout for connection to cluster_manager node - * $params['local'] = (boolean) Return local information, do not retrieve the state from cluster_manager node (default: false) + * Returns an index template. + * + * $params['name'] = (array) Comma-separated list of index template names used to limit the request. Wildcard (`*`) expressions are supported. To return all index templates, omit this parameter or use a value of `_all` or `*`. + * $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. (Default = false) + * $params['master_timeout'] = (string) Period to wait for a connection to the master 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. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -571,10 +839,17 @@ public function getTemplate(array $params = []) return $this->performRequest($endpoint); } /** - * $params['index'] = (list) A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed) - * $params['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) - * $params['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both. (Options = open,closed,hidden,none,all) (Default = open) + * The _upgrade API is no longer useful and will be removed. + * + * $params['index'] = (array) Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices. + * $params['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). + * $params['expand_wildcards'] = (any) Whether to expand wildcard expression to concrete indices that are open, closed or both. + * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed). + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -591,13 +866,23 @@ public function getUpgrade(array $params = []) return $this->performRequest($endpoint); } /** - * $params['index'] = (list) A comma separated list of indices to open - * $params['timeout'] = (time) Explicit operation timeout - * $params['cluster_manager_timeout'] = (time) Specify timeout for connection to cluster_manager - * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed) - * $params['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) - * $params['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both. (Options = open,closed,hidden,none,all) (Default = closed) - * $params['wait_for_active_shards'] = (string) Sets the number of active shards to wait for before the operation returns. + * Opens an index. + * + * $params['index'] = (array) Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (`*`). By default, you must explicitly name the indices you using to limit the request. To limit a request using `_all`, `*`, or other wildcard expressions, change the `action.destructive_requires_name` setting to false. You can update this setting in the `opensearch.yml` file or using the cluster update settings API. + * $params['allow_no_indices'] = (boolean) If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.This behavior applies even if the request targets other open indices. + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['expand_wildcards'] = (any) Type of index that wildcard patterns can match.If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.Supports comma-separated values, such as `open,hidden`.Valid values are: `all`, `open`, `closed`, `hidden`, `none`. + * $params['ignore_unavailable'] = (boolean) If `false`, the request returns an error if it targets a missing or closed index. + * $params['master_timeout'] = (string) Period to wait for a connection to the master node.If no response is received before the timeout expires, the request fails and returns an error. + * $params['task_execution_timeout'] = (string) Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h. + * $params['timeout'] = (string) Period to wait for a response.If no response is received before the timeout expires, the request fails and returns an error. + * $params['wait_for_active_shards'] = (any) The number of shard copies that must be active before proceeding with the operation.Set to `all` or any positive integer up to the total number of shards in the index (`number_of_replicas+1`). + * $params['wait_for_completion'] = (boolean) Should this request wait until the operation has completed before returning. (Default = true) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -614,11 +899,19 @@ public function open(array $params = []) return $this->performRequest($endpoint); } /** - * $params['index'] = (list) A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the operation on all indices. (Required) - * $params['name'] = (string) The name of the alias to be created or updated (Required) - * $params['timeout'] = (time) Explicit timestamp for the document - * $params['cluster_manager_timeout'] = (time) Specify timeout for connection to cluster_manager - * $params['body'] = (array) The settings for the alias, such as `routing` or `filter` + * Creates or updates an alias. + * + * $params['index'] = (array) Comma-separated list of data streams or indices to add. Supports wildcards (`*`). Wildcard patterns that match both data streams and indices return an error. (Required) + * $params['name'] = (string) Alias to update. If the alias doesn’t exist, the request creates it. Index alias names support date math. (Required) + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['master_timeout'] = (string) Period to wait for a connection to the master node.If no response is received before the timeout expires, the request fails and returns an error. + * $params['timeout'] = (string) Period to wait for a response.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. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * $params['body'] = (array) The settings for the alias, such as `routing` or `filter` * * @param array $params Associative array of parameters * @return array @@ -639,18 +932,22 @@ public function putAlias(array $params = []) return $this->performRequest($endpoint); } /** - * $params['name'] = (string) The name of the template - * $params['create'] = (boolean) Whether the index template should only be added if new or can also replace an existing one (Default = false) - * $params['cause'] = (string) User defined reason for creating/updating the index template (Default = ) - * $params['cluster_manager_timeout'] = (time) Specify timeout for connection to cluster_manager - * $params['body'] = (array) The template definition (Required) + * Creates or updates an index template. + * + * $params['name'] = (string) Index or template name + * $params['cause'] = (string) User defined reason for creating/updating the index template. (Default = false) + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['create'] = (boolean) If `true`, this request cannot replace or update existing index templates. (Default = false) + * $params['master_timeout'] = (string) Operation timeout for connection to master node. + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * $params['body'] = (array) The template definition (Required) * * @param array $params Associative array of parameters * @return array - - * - * @note This API is EXPERIMENTAL and may be changed or removed completely in a future release - * */ public function putIndexTemplate(array $params = []) { @@ -666,14 +963,22 @@ public function putIndexTemplate(array $params = []) return $this->performRequest($endpoint); } /** - * $params['index'] = (list) A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices. - * $params['timeout'] = (time) Explicit operation timeout - * $params['cluster_manager_timeout'] = (time) Specify timeout for connection to cluster_manager - * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed) - * $params['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) - * $params['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both. (Options = open,closed,hidden,none,all) (Default = open) - * $params['write_index_only'] = (boolean) When true, applies mappings only to the write index of an alias or data stream (Default = false) - * $params['body'] = (array) The mapping definition (Required) + * Updates the index mappings. + * + * $params['index'] = (array) A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices. + * $params['allow_no_indices'] = (boolean) If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.This behavior applies even if the request targets other open indices. + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['expand_wildcards'] = (any) Type of index that wildcard patterns can match.If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.Supports comma-separated values, such as `open,hidden`.Valid values are: `all`, `open`, `closed`, `hidden`, `none`. + * $params['ignore_unavailable'] = (boolean) If `false`, the request returns an error if it targets a missing or closed index. + * $params['master_timeout'] = (string) Period to wait for a connection to the master node.If no response is received before the timeout expires, the request fails and returns an error. + * $params['timeout'] = (string) Period to wait for a response.If no response is received before the timeout expires, the request fails and returns an error. + * $params['write_index_only'] = (boolean) If `true`, the mappings are applied only to the current write index for the target. (Default = false) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * $params['body'] = (array) The mapping definition (Required) * * @param array $params Associative array of parameters * @return array @@ -692,15 +997,22 @@ public function putMapping(array $params = []) return $this->performRequest($endpoint); } /** - * $params['index'] = (list) A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * $params['cluster_manager_timeout'] = (time) Specify timeout for connection to cluster_manager - * $params['timeout'] = (time) Explicit operation timeout - * $params['preserve_existing'] = (boolean) Whether to update existing settings. If set to `true` existing settings on an index remain unchanged, the default is `false` - * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed) - * $params['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) - * $params['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both. (Options = open,closed,hidden,none,all) (Default = open) - * $params['flat_settings'] = (boolean) Return settings in flat format (default: false) - * $params['body'] = (array) The index settings to be updated (Required) + * Updates the index settings. + * + * $params['index'] = (array) Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indices, omit this parameter or use `*` or `_all`. + * $params['allow_no_indices'] = (boolean) If `false`, the request returns an error if any wildcard expression, indexalias, or `_all` value targets only missing or closed indices. Thisbehavior applies even if the request targets other open indices. Forexample, a request targeting `foo*,bar*` returns an error if an indexstarts with `foo` but no index starts with `bar`. + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['expand_wildcards'] = (any) Type of index that wildcard patterns can match. If the request can targetdata streams, this argument determines whether wildcard expressions matchhidden data streams. Supports comma-separated values, such as`open,hidden`. + * $params['flat_settings'] = (boolean) If `true`, returns settings in flat format. (Default = false) + * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed). + * $params['master_timeout'] = (string) Period to wait for a connection to the master node. If no response isreceived before the timeout expires, the request fails and returns anerror. + * $params['preserve_existing'] = (boolean) If `true`, existing index settings remain unchanged. (Default = false) + * $params['timeout'] = (string) Period to wait for a response. 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. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -719,11 +1031,19 @@ public function putSettings(array $params = []) return $this->performRequest($endpoint); } /** - * $params['name'] = (string) The name of the template - * $params['order'] = (number) The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers) - * $params['create'] = (boolean) Whether the index template should only be added if new or can also replace an existing one (Default = false) - * $params['cluster_manager_timeout'] = (time) Specify timeout for connection to cluster_manager - * $params['body'] = (array) The template definition (Required) + * Creates or updates an index template. + * + * $params['name'] = (string) The name of the template + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['create'] = (boolean) If true, this request cannot replace or update existing index templates. (Default = false) + * $params['master_timeout'] = (string) Period to wait for a connection to the master node. If no response isreceived before the timeout expires, the request fails and returns an error. + * $params['order'] = (number) Order in which OpenSearch applies this template if indexmatches multiple templates.Templates with lower 'order' values are merged first. Templates with higher'order' values are merged later, overriding templates with lower values. + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * $params['body'] = (array) The template definition (Required) * * @param array $params Associative array of parameters * @return array @@ -742,9 +1062,16 @@ public function putTemplate(array $params = []) return $this->performRequest($endpoint); } /** - * $params['index'] = (list) A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * $params['detailed'] = (boolean) Whether to display detailed information about shard recovery (Default = false) - * $params['active_only'] = (boolean) Display only those recoveries that are currently on-going (Default = false) + * Returns information about ongoing index shard recoveries. + * + * $params['index'] = (array) Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indices, omit this parameter or use `*` or `_all`. + * $params['active_only'] = (boolean) If `true`, the response only includes ongoing shard recoveries. (Default = false) + * $params['detailed'] = (boolean) If `true`, the response includes detailed information about shard recoveries. (Default = false) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -761,10 +1088,17 @@ public function recovery(array $params = []) return $this->performRequest($endpoint); } /** - * $params['index'] = (list) A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed) - * $params['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) - * $params['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both. (Options = open,closed,hidden,none,all) (Default = open) + * Performs the refresh operation in one or more indices. + * + * $params['index'] = (array) Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indices, omit this parameter or use `*` or `_all`. + * $params['allow_no_indices'] = (boolean) If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.This behavior applies even if the request targets other open indices. + * $params['expand_wildcards'] = (any) Type of index that wildcard patterns can match.If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.Supports comma-separated values, such as `open,hidden`.Valid values are: `all`, `open`, `closed`, `hidden`, `none`. + * $params['ignore_unavailable'] = (boolean) If `false`, the request returns an error if it targets a missing or closed index. + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -781,15 +1115,18 @@ public function refresh(array $params = []) return $this->performRequest($endpoint); } /** - * $params['name'] = (list) A comma-separated list of names or wildcard expressions - * $params['expand_wildcards'] = (enum) Whether wildcard expressions should get expanded to open or closed indices (default: open) (Options = open,closed,hidden,none,all) (Default = open) + * Returns information about any matching indices, aliases, and data streams. + * + * $params['name'] = (array) Comma-separated name(s) or index pattern(s) of the indices, aliases, and data streams to resolve. Resources on remote clusters can be specified using the ``:`` syntax. + * $params['expand_wildcards'] = (any) Type of index that wildcard patterns can match.If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.Supports comma-separated values, such as `open,hidden`.Valid values are: `all`, `open`, `closed`, `hidden`, `none`. + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array - - * - * @note This API is EXPERIMENTAL and may be changed or removed completely in a future release - * */ public function resolveIndex(array $params = []) { @@ -803,13 +1140,21 @@ public function resolveIndex(array $params = []) return $this->performRequest($endpoint); } /** - * $params['alias'] = (string) The name of the alias to rollover (Required) - * $params['new_index'] = (string) The name of the rollover index - * $params['timeout'] = (time) Explicit operation timeout - * $params['dry_run'] = (boolean) If set to true the rollover action will only be validated but not actually performed even if a condition matches. The default is false - * $params['cluster_manager_timeout'] = (time) Specify timeout for connection to cluster_manager - * $params['wait_for_active_shards'] = (string) Set the number of active shards to wait for on the newly created rollover index before the operation returns. - * $params['body'] = (array) The conditions that needs to be met for executing rollover + * Updates an alias to point to a new index when the existing indexis considered to be too large or too old. + * + * $params['alias'] = (string) Name of the data stream or index alias to roll over. (Required) + * $params['new_index'] = (string) Name of the index to create. Supports date math. Data streams do not support this parameter. + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['dry_run'] = (boolean) If `true`, checks whether the current index satisfies the specified conditions but does not perform a rollover. (Default = false) + * $params['master_timeout'] = (string) Period to wait for a connection to the master node.If no response is received before the timeout expires, the request fails and returns an error. + * $params['timeout'] = (string) Period to wait for a response.If no response is received before the timeout expires, the request fails and returns an error. + * $params['wait_for_active_shards'] = (any) The number of shard copies that must be active before proceeding with the operation.Set to all or any positive integer up to the total number of shards in the index (`number_of_replicas+1`). + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * $params['body'] = (array) The conditions that needs to be met for executing rollover * * @param array $params Associative array of parameters * @return array @@ -830,11 +1175,18 @@ public function rollover(array $params = []) return $this->performRequest($endpoint); } /** - * $params['index'] = (list) A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed) - * $params['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) - * $params['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both. (Options = open,closed,hidden,none,all) (Default = open) - * $params['verbose'] = (boolean) Includes detailed memory usage by Lucene. (Default = false) + * Provides low-level information about segments in a Lucene index. + * + * $params['index'] = (array) Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indices, omit this parameter or use `*` or `_all`. + * $params['allow_no_indices'] = (boolean) If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.This behavior applies even if the request targets other open indices. + * $params['expand_wildcards'] = (any) Type of index that wildcard patterns can match.If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.Supports comma-separated values, such as `open,hidden`.Valid values are: `all`, `open`, `closed`, `hidden`, `none`. + * $params['ignore_unavailable'] = (boolean) If `false`, the request returns an error if it targets a missing or closed index. + * $params['verbose'] = (boolean) If `true`, the request returns a verbose response. (Default = false) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -851,11 +1203,18 @@ public function segments(array $params = []) return $this->performRequest($endpoint); } /** - * $params['index'] = (list) A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * $params['status'] = (list) A comma-separated list of statuses used to filter on shards to get store information for (Options = green,yellow,red,all) - * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed) - * $params['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) - * $params['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both. (Options = open,closed,hidden,none,all) (Default = open) + * Provides store information for shard copies of indices. + * + * $params['index'] = (array) List of data streams, indices, and aliases used to limit the request. + * $params['allow_no_indices'] = (boolean) If false, the request returns an error if any wildcard expression, index alias, or _allvalue targets only missing or closed indices. This behavior applies even if the requesttargets other open indices. + * $params['expand_wildcards'] = (any) Type of index that wildcard patterns can match. If the request can target data streams,this argument determines whether wildcard expressions match hidden data streams. + * $params['ignore_unavailable'] = (boolean) If true, missing or closed indices are not included in the response. + * $params['status'] = (any) List of shard health statuses used to limit the request. + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -872,13 +1231,23 @@ public function shardStores(array $params = []) return $this->performRequest($endpoint); } /** - * $params['index'] = (string) The name of the source index to shrink - * $params['target'] = (string) The name of the target index to shrink into - * $params['copy_settings'] = (boolean) whether or not to copy settings from the source index (defaults to false) - * $params['timeout'] = (time) Explicit operation timeout - * $params['cluster_manager_timeout'] = (time) Specify timeout for connection to cluster_manager - * $params['wait_for_active_shards'] = (string) Set the number of active shards to wait for on the shrunken index before the operation returns. - * $params['body'] = (array) The configuration for the target index (`settings` and `aliases`) + * Allow to shrink an existing index into a new index with fewer primary shards. + * + * $params['index'] = (string) Name of the source index to shrink. + * $params['target'] = (string) Name of the target index to create. + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['copy_settings'] = (boolean) whether or not to copy settings from the source index. (Default = false) + * $params['master_timeout'] = (string) Period to wait for a connection to the master node.If no response is received before the timeout expires, the request fails and returns an error. + * $params['task_execution_timeout'] = (string) Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h. + * $params['timeout'] = (string) Period to wait for a response.If no response is received before the timeout expires, the request fails and returns an error. + * $params['wait_for_active_shards'] = (any) The number of shard copies that must be active before proceeding with the operation.Set to `all` or any positive integer up to the total number of shards in the index (`number_of_replicas+1`). + * $params['wait_for_completion'] = (boolean) Should this request wait until the operation has completed before returning. (Default = true) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * $params['body'] = (array) The configuration for the target index (`settings` and `aliases`) * * @param array $params Associative array of parameters * @return array @@ -899,18 +1268,22 @@ public function shrink(array $params = []) return $this->performRequest($endpoint); } /** - * $params['name'] = (string) The name of the index (it must be a concrete index name) - * $params['create'] = (boolean) Whether the index template we optionally defined in the body should only be dry-run added if new or can also replace an existing one (Default = false) - * $params['cause'] = (string) User defined reason for dry-run creating the new template for simulation purposes (Default = ) - * $params['cluster_manager_timeout'] = (time) Specify timeout for connection to cluster_manager - * $params['body'] = (array) New index template definition, which will be included in the simulation, as if it already exists in the system + * Simulate matching the given index name against the index templates in the system. + * + * $params['name'] = (string) Index or template name to simulate + * $params['cause'] = (string) User defined reason for dry-run creating the new template for simulation purposes. (Default = false) + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['create'] = (boolean) If `true`, the template passed in the body is only used if no existingtemplates match the same index patterns. If `false`, the simulation usesthe template with the highest priority. Note that the template is notpermanently added or updated in either case; it is only used for thesimulation. (Default = false) + * $params['master_timeout'] = (string) Period to wait for a connection to the master node. If no response is receivedbefore the timeout expires, the request fails and returns an error. + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * $params['body'] = (array) New index template definition, which will be included in the simulation, as if it already exists in the system * * @param array $params Associative array of parameters * @return array - - * - * @note This API is EXPERIMENTAL and may be changed or removed completely in a future release - * */ public function simulateIndexTemplate(array $params = []) { @@ -926,18 +1299,21 @@ public function simulateIndexTemplate(array $params = []) return $this->performRequest($endpoint); } /** - * $params['name'] = (string) The name of the index template - * $params['create'] = (boolean) Whether the index template we optionally defined in the body should only be dry-run added if new or can also replace an existing one (Default = false) - * $params['cause'] = (string) User defined reason for dry-run creating the new template for simulation purposes (Default = ) - * $params['cluster_manager_timeout'] = (time) Specify timeout for connection to cluster_manager - * $params['body'] = (array) New index template definition to be simulated, if no index template name is specified + * Simulate resolving the given template name or body. + * + * $params['name'] = (string) Name of the index template to simulate. To test a template configuration before you add it to the cluster, omit this parameter and specify the template configuration in the request body. + * $params['cause'] = (string) User defined reason for dry-run creating the new template for simulation purposes. (Default = false) + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['create'] = (boolean) If true, the template passed in the body is only used if no existing templates match the same index patterns. If false, the simulation uses the template with the highest priority. Note that the template is not permanently added or updated in either case; it is only used for the simulation. (Default = false) + * $params['master_timeout'] = (string) Period to wait for a connection to the master 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. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array - - * - * @note This API is EXPERIMENTAL and may be changed or removed completely in a future release - * */ public function simulateTemplate(array $params = []) { @@ -953,13 +1329,23 @@ public function simulateTemplate(array $params = []) return $this->performRequest($endpoint); } /** - * $params['index'] = (string) The name of the source index to split - * $params['target'] = (string) The name of the target index to split into - * $params['copy_settings'] = (boolean) whether or not to copy settings from the source index (defaults to false) - * $params['timeout'] = (time) Explicit operation timeout - * $params['cluster_manager_timeout'] = (time) Specify timeout for connection to cluster_manager - * $params['wait_for_active_shards'] = (string) Set the number of active shards to wait for on the shrunken index before the operation returns. - * $params['body'] = (array) The configuration for the target index (`settings` and `aliases`) + * Allows you to split an existing index into a new index with more primary shards. + * + * $params['index'] = (string) Name of the source index to split. + * $params['target'] = (string) Name of the target index to create. + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['copy_settings'] = (boolean) whether or not to copy settings from the source index. (Default = false) + * $params['master_timeout'] = (string) Period to wait for a connection to the master node.If no response is received before the timeout expires, the request fails and returns an error. + * $params['task_execution_timeout'] = (string) Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h. + * $params['timeout'] = (string) Period to wait for a response.If no response is received before the timeout expires, the request fails and returns an error. + * $params['wait_for_active_shards'] = (any) The number of shard copies that must be active before proceeding with the operation.Set to `all` or any positive integer up to the total number of shards in the index (`number_of_replicas+1`). + * $params['wait_for_completion'] = (boolean) Should this request wait until the operation has completed before returning. (Default = true) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * $params['body'] = (array) The configuration for the target index (`settings` and `aliases`) * * @param array $params Associative array of parameters * @return array @@ -980,18 +1366,24 @@ public function split(array $params = []) return $this->performRequest($endpoint); } /** - * $params['metric'] = (list) Limit the information returned the specific metrics. - * $params['index'] = (list) A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * $params['completion_fields'] = (list) A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) - * $params['fielddata_fields'] = (list) A comma-separated list of fields for `fielddata` index metric (supports wildcards) - * $params['fields'] = (list) A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) - * $params['groups'] = (list) A comma-separated list of search groups for `search` index metric - * $params['level'] = (enum) Return stats aggregated at cluster, index or shard level (Options = cluster,indices,shards) (Default = indices) - * $params['types'] = (list) A comma-separated list of document types for the `indexing` index metric - * $params['include_segment_file_sizes'] = (boolean) Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested) (Default = false) - * $params['include_unloaded_segments'] = (boolean) If set to true segment stats will include stats for segments that are not currently loaded into memory (Default = false) - * $params['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both. (Options = open,closed,hidden,none,all) (Default = open) - * $params['forbid_closed_indices'] = (boolean) If set to false stats will also collected from closed indices if explicitly specified or if expand_wildcards expands to closed indices (Default = true) + * Provides statistics on operations happening in an index. + * + * $params['metric'] = (array) Limit the information returned the specific metrics. + * $params['index'] = (array) A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + * $params['completion_fields'] = (any) Comma-separated list or wildcard expressions of fields to include in fielddata and suggest statistics. + * $params['expand_wildcards'] = (any) Type of index that wildcard patterns can match. If the request can target data streams, this argumentdetermines whether wildcard expressions match hidden data streams. Supports comma-separated values,such as `open,hidden`. + * $params['fielddata_fields'] = (any) Comma-separated list or wildcard expressions of fields to include in fielddata statistics. + * $params['fields'] = (any) Comma-separated list or wildcard expressions of fields to include in the statistics. + * $params['forbid_closed_indices'] = (boolean) If true, statistics are not collected from closed indices. (Default = true) + * $params['groups'] = (any) Comma-separated list of search groups to include in the search statistics. + * $params['include_segment_file_sizes'] = (boolean) If true, the call reports the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested). (Default = false) + * $params['include_unloaded_segments'] = (boolean) If true, the response includes information from segments that are not loaded into memory. (Default = false) + * $params['level'] = (enum) Indicates whether statistics are aggregated at the cluster, index, or shard level. (Options = cluster,indices,shards) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -1010,9 +1402,17 @@ public function stats(array $params = []) return $this->performRequest($endpoint); } /** - * $params['timeout'] = (time) Request timeout - * $params['cluster_manager_timeout'] = (time) Specify timeout for connection to cluster_manager - * $params['body'] = (array) The definition of `actions` to perform (Required) + * Updates index aliases. + * + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['master_timeout'] = (string) Period to wait for a connection to the master node.If no response is received before the timeout expires, the request fails and returns an error. + * $params['timeout'] = (string) Period to wait for a response.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. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * $params['body'] = (array) The definition of `actions` to perform (Required) * * @param array $params Associative array of parameters * @return array @@ -1029,12 +1429,19 @@ public function updateAliases(array $params = []) return $this->performRequest($endpoint); } /** - * $params['index'] = (list) A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * $params['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) - * $params['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both. (Options = open,closed,hidden,none,all) (Default = open) - * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed) - * $params['wait_for_completion'] = (boolean) Specify whether the request should block until the all segments are upgraded (default: false) - * $params['only_ancient_segments'] = (boolean) If true, only ancient (an older Lucene major release) segments will be upgraded + * The _upgrade API is no longer useful and will be removed. + * + * $params['index'] = (array) Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices. + * $params['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). + * $params['expand_wildcards'] = (any) Whether to expand wildcard expression to concrete indices that are open, closed or both. + * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed). + * $params['only_ancient_segments'] = (boolean) If true, only ancient (an older Lucene major release) segments will be upgraded. + * $params['wait_for_completion'] = (boolean) Should this request wait until the operation has completed before returning. (Default = false) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -1051,19 +1458,26 @@ public function upgrade(array $params = []) return $this->performRequest($endpoint); } /** - * $params['index'] = (list) A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices - * $params['explain'] = (boolean) Return detailed information about the error - * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed) - * $params['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) - * $params['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both. (Options = open,closed,hidden,none,all) (Default = open) - * $params['q'] = (string) Query in the Lucene query string syntax - * $params['analyzer'] = (string) The analyzer to use for the query string - * $params['analyze_wildcard'] = (boolean) Specify whether wildcard and prefix queries should be analyzed (default: false) - * $params['default_operator'] = (enum) The default operator for query string query (AND or OR) (Options = AND,OR) (Default = OR) - * $params['df'] = (string) The field to use as default where no field prefix is given in the query string - * $params['lenient'] = (boolean) Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * $params['rewrite'] = (boolean) Provide a more detailed explanation showing the actual Lucene query that will be executed. - * $params['all_shards'] = (boolean) Execute validation on all shards instead of one random shard per index + * Allows a user to validate a potentially expensive query without executing it. + * + * $params['index'] = (array) Comma-separated list of data streams, indices, and aliases to search. Supports wildcards (`*`). To search all data streams or indices, omit this parameter or use `*` or `_all`. + * $params['all_shards'] = (boolean) If `true`, the validation is executed on all shards instead of one random shard per index. + * $params['allow_no_indices'] = (boolean) If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.This behavior applies even if the request targets other open indices. + * $params['analyze_wildcard'] = (boolean) If `true`, wildcard and prefix queries are analyzed. (Default = false) + * $params['analyzer'] = (string) Analyzer to use for the query string.This parameter can only be used when the `q` query string parameter is specified. + * $params['default_operator'] = (enum) The default operator for query string query: `AND` or `OR`. (Options = and,or) + * $params['df'] = (string) Field to use as default where no field prefix is given in the query string.This parameter can only be used when the `q` query string parameter is specified. + * $params['expand_wildcards'] = (any) Type of index that wildcard patterns can match.If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.Supports comma-separated values, such as `open,hidden`.Valid values are: `all`, `open`, `closed`, `hidden`, `none`. + * $params['explain'] = (boolean) If `true`, the response returns detailed information if an error has occurred. + * $params['ignore_unavailable'] = (boolean) If `false`, the request returns an error if it targets a missing or closed index. + * $params['lenient'] = (boolean) If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored. + * $params['q'] = (string) Query in the Lucene query string syntax. + * $params['rewrite'] = (boolean) If `true`, returns a more detailed explanation showing the actual Lucene query that will be executed. + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * $params['body'] = (array) The query definition specified with the Query DSL * * @param array $params Associative array of parameters @@ -1083,95 +1497,14 @@ public function validateQuery(array $params = []) return $this->performRequest($endpoint); } /** - * $params['name'] = (string) The name of the data stream - * - * @param array $params Associative array of parameters - * @return array - */ - public function createDataStream(array $params = []) - { - $name = $this->extractArgument($params, 'name'); - - $endpointBuilder = $this->endpoints; - $endpoint = $endpointBuilder('Indices\CreateDataStream'); - $endpoint->setParams($params); - $endpoint->setName($name); - - return $this->performRequest($endpoint); - } - /** - * $params['name'] = (list) A comma-separated list of data stream names; use `_all` or empty string to perform the operation on all data streams - * - * @param array $params Associative array of parameters - * @return array - */ - public function dataStreamsStats(array $params = []) - { - $name = $this->extractArgument($params, 'name'); - - $endpointBuilder = $this->endpoints; - $endpoint = $endpointBuilder('Indices\DataStreamsStats'); - $endpoint->setParams($params); - $endpoint->setName($name); - - return $this->performRequest($endpoint); - } - /** - * $params['name'] = (list) A comma-separated list of data streams to delete; use `*` to delete all data streams - * - * @param array $params Associative array of parameters - * @return array - */ - public function deleteDataStream(array $params = []) - { - $name = $this->extractArgument($params, 'name'); - - $endpointBuilder = $this->endpoints; - $endpoint = $endpointBuilder('Indices\DeleteDataStream'); - $endpoint->setParams($params); - $endpoint->setName($name); - - return $this->performRequest($endpoint); - } - /** - * $params['index'] = (string) The name of the index to freeze - * $params['timeout'] = (time) Explicit operation timeout - * $params['cluster_manager_timeout'] = (time) Specify timeout for connection to cluster_manager - * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed) - * $params['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) - * $params['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both. (Options = open,closed,hidden,none,all) (Default = closed) - * $params['wait_for_active_shards'] = (string) Sets the number of active shards to wait for before the operation returns. - * - * @param array $params Associative array of parameters - * @return array - */ - public function freeze(array $params = []) - { - $index = $this->extractArgument($params, 'index'); - - $endpointBuilder = $this->endpoints; - $endpoint = $endpointBuilder('Indices\Freeze'); - $endpoint->setParams($params); - $endpoint->setIndex($index); - - return $this->performRequest($endpoint); - } - /** - * $params['name'] = (list) A comma-separated list of data streams to get; use `*` to get all data streams + * Alias function to getAlias() * - * @param array $params Associative array of parameters - * @return array + * @deprecated added to prevent BC break introduced in 7.2.0 + * @see https://github.com/elastic/elasticsearch-php/issues/940 */ - public function getDataStream(array $params = []) + public function getAliases(array $params = []) { - $name = $this->extractArgument($params, 'name'); - - $endpointBuilder = $this->endpoints; - $endpoint = $endpointBuilder('Indices\GetDataStream'); - $endpoint->setParams($params); - $endpoint->setName($name); - - return $this->performRequest($endpoint); + return $this->getAlias($params); } /** * $params['index'] = (list) A comma-separated list of index names to refresh analyzers for @@ -1190,56 +1523,4 @@ public function refreshSearchAnalyzers(array $params = []) return $this->performRequest($endpoint); } - /** - * $params['index'] = (list) A comma-separated list of index names to reload analyzers for - * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed) - * $params['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) - * $params['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both. (Options = open,closed,hidden,none,all) (Default = open) - * - * @param array $params Associative array of parameters - * @return array - */ - public function reloadSearchAnalyzers(array $params = []) - { - $index = $this->extractArgument($params, 'index'); - - $endpointBuilder = $this->endpoints; - $endpoint = $endpointBuilder('Indices\ReloadSearchAnalyzers'); - $endpoint->setParams($params); - $endpoint->setIndex($index); - - return $this->performRequest($endpoint); - } - /** - * $params['index'] = (string) The name of the index to unfreeze - * $params['timeout'] = (time) Explicit operation timeout - * $params['cluster_manager_timeout'] = (time) Specify timeout for connection to cluster_manager - * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed) - * $params['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) - * $params['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both. (Options = open,closed,hidden,none,all) (Default = closed) - * $params['wait_for_active_shards'] = (string) Sets the number of active shards to wait for before the operation returns. - * - * @param array $params Associative array of parameters - * @return array - */ - public function unfreeze(array $params = []) - { - $index = $this->extractArgument($params, 'index'); - - $endpointBuilder = $this->endpoints; - $endpoint = $endpointBuilder('Indices\Unfreeze'); - $endpoint->setParams($params); - $endpoint->setIndex($index); - - return $this->performRequest($endpoint); - } - /** - * Alias function to getAlias() - * - * @deprecated added to prevent BC break introduced in 7.2.0 - */ - public function getAliases(array $params = []) - { - return $this->getAlias($params); - } } diff --git a/src/OpenSearch/Namespaces/IngestNamespace.php b/src/OpenSearch/Namespaces/IngestNamespace.php index 071e2f65..927158c5 100644 --- a/src/OpenSearch/Namespaces/IngestNamespace.php +++ b/src/OpenSearch/Namespaces/IngestNamespace.php @@ -26,13 +26,22 @@ /** * Class IngestNamespace * + * NOTE: This file is autogenerated using util/GenerateEndpoints.php */ class IngestNamespace extends AbstractNamespace { /** - * $params['id'] = (string) Pipeline ID - * $params['cluster_manager_timeout'] = (time) Explicit operation timeout for connection to cluster_manager node - * $params['timeout'] = (time) Explicit operation timeout + * Deletes a pipeline. + * + * $params['id'] = (string) Pipeline ID or wildcard expression of pipeline IDs used to limit the request. To delete all ingest pipelines in a cluster, use a value of `*`. + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['master_timeout'] = (string) Period to wait for a connection to the master node.If no response is received before the timeout expires, the request fails and returns an error. + * $params['timeout'] = (string) Period to wait for a response.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. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -49,8 +58,16 @@ public function deletePipeline(array $params = []) return $this->performRequest($endpoint); } /** - * $params['id'] = (string) Comma separated list of pipeline ids. Wildcards supported - * $params['cluster_manager_timeout'] = (time) Explicit operation timeout for connection to cluster_manager node + * Returns a pipeline. + * + * $params['id'] = (string) Comma-separated list of pipeline IDs to retrieve. Wildcard (`*`) expressions are supported. To get all ingest pipelines, omit this parameter or use `*`. + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['master_timeout'] = (string) Period to wait for a connection to the master 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. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -67,6 +84,13 @@ public function getPipeline(array $params = []) return $this->performRequest($endpoint); } /** + * Returns a list of the built-in patterns. + * + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -80,10 +104,18 @@ public function processorGrok(array $params = []) return $this->performRequest($endpoint); } /** - * $params['id'] = (string) Pipeline ID - * $params['cluster_manager_timeout'] = (time) Explicit operation timeout for connection to cluster_manager node - * $params['timeout'] = (time) Explicit operation timeout - * $params['body'] = (array) The ingest definition (Required) + * Creates or updates a pipeline. + * + * $params['id'] = (string) ID of the ingest pipeline to create or update. + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['master_timeout'] = (string) Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + * $params['timeout'] = (string) Period to wait for a response. 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. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * $params['body'] = (array) The ingest definition (Required) * * @param array $params Associative array of parameters * @return array @@ -102,9 +134,16 @@ public function putPipeline(array $params = []) return $this->performRequest($endpoint); } /** - * $params['id'] = (string) Pipeline ID - * $params['verbose'] = (boolean) Verbose mode. Display data output for each processor in executed pipeline (Default = false) - * $params['body'] = (array) The simulate definition (Required) + * Allows to simulate a pipeline with example documents. + * + * $params['id'] = (string) Pipeline to test. If you don’t specify a `pipeline` in the request body, this parameter is required. + * $params['verbose'] = (boolean) If `true`, the response includes output data for each processor in the executed pipeline. (Default = false) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * $params['body'] = (array) The simulate definition (Required) * * @param array $params Associative array of parameters * @return array diff --git a/src/OpenSearch/Namespaces/KnnNamespace.php b/src/OpenSearch/Namespaces/KnnNamespace.php new file mode 100644 index 00000000..2d094fab --- /dev/null +++ b/src/OpenSearch/Namespaces/KnnNamespace.php @@ -0,0 +1,219 @@ +extractArgument($params, 'model_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Knn\DeleteModel'); + $endpoint->setParams($params); + $endpoint->setModelId($model_id); + + return $this->performRequest($endpoint); + } + /** + * Used to retrieve information about models present in the cluster. + * + * $params['model_id'] = (string) The id of the model. + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * + * @param array $params Associative array of parameters + * @return array + */ + public function getModel(array $params = []) + { + $model_id = $this->extractArgument($params, 'model_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Knn\GetModel'); + $endpoint->setParams($params); + $endpoint->setModelId($model_id); + + return $this->performRequest($endpoint); + } + /** + * Use an OpenSearch query to search for models in the index. + * + * $params['_source'] = (array) True or false to return the _source field or not, or a list of fields to return. + * $params['_source_excludes'] = (array) List of fields to exclude from the returned _source field. + * $params['_source_includes'] = (array) List of fields to extract and return from the _source field. + * $params['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). + * $params['allow_partial_search_results'] = (boolean) Indicate if an error should be returned if there is a partial search failure or timeout. (Default = true) + * $params['analyze_wildcard'] = (boolean) Specify whether wildcard and prefix queries should be analyzed. (Default = false) + * $params['analyzer'] = (string) The analyzer to use for the query string. + * $params['batched_reduce_size'] = (integer) The number of shard results that should be reduced at once on the coordinating node. This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large. (Default = 512) + * $params['ccs_minimize_roundtrips'] = (boolean) Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution. (Default = true) + * $params['default_operator'] = (enum) The default operator for query string query (AND or OR). (Options = AND,OR) + * $params['df'] = (string) The field to use as default where no field prefix is given in the query string. + * $params['docvalue_fields'] = (array) Comma-separated list of fields to return as the docvalue representation of a field for each hit. + * $params['expand_wildcards'] = (any) Whether to expand wildcard expression to concrete indices that are open, closed or both. + * $params['explain'] = (boolean) Specify whether to return detailed information about score computation as part of a hit. + * $params['from'] = (integer) Starting offset. (Default = 0) + * $params['ignore_throttled'] = (boolean) Whether specified concrete, expanded or aliased indices should be ignored when throttled. + * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed). + * $params['lenient'] = (boolean) Specify whether format-based query failures (such as providing text to a numeric field) should be ignored. + * $params['max_concurrent_shard_requests'] = (integer) The number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests. (Default = 5) + * $params['pre_filter_shard_size'] = (integer) Threshold that enforces a pre-filter round-trip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter round-trip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint. + * $params['preference'] = (string) Specify the node or shard the operation should be performed on. (Default = random) + * $params['q'] = (string) Query in the Lucene query string syntax. + * $params['request_cache'] = (boolean) Specify if request cache should be used for this request or not, defaults to index level setting. + * $params['rest_total_hits_as_int'] = (boolean) Indicates whether hits.total should be rendered as an integer or an object in the rest search response. (Default = false) + * $params['routing'] = (array) Comma-separated list of specific routing values. + * $params['scroll'] = (string) Specify how long a consistent view of the index should be maintained for scrolled search. + * $params['search_type'] = (enum) Search operation type. (Options = query_then_fetch,dfs_query_then_fetch) + * $params['seq_no_primary_term'] = (boolean) Specify whether to return sequence number and primary term of the last modification of each hit. + * $params['size'] = (integer) Number of hits to return. (Default = 10) + * $params['sort'] = (array) Comma-separated list of : pairs. + * $params['stats'] = (array) Specific 'tag' of the request for logging and statistical purposes. + * $params['stored_fields'] = (array) Comma-separated list of stored fields to return. + * $params['suggest_field'] = (string) Specify which field to use for suggestions. + * $params['suggest_mode'] = (enum) Specify suggest mode. (Options = missing,popular,always) + * $params['suggest_size'] = (integer) How many suggestions to return in response. + * $params['suggest_text'] = (string) The source text for which the suggestions should be returned. + * $params['terminate_after'] = (integer) The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. + * $params['timeout'] = (string) Operation timeout. + * $params['track_scores'] = (boolean) Whether to calculate and return scores even if they are not used for sorting. + * $params['track_total_hits'] = (boolean) Indicate if the number of documents that match the query should be tracked. + * $params['typed_keys'] = (boolean) Specify whether aggregation and suggester names should be prefixed by their respective types in the response. + * $params['version'] = (boolean) Whether to return document version as part of a hit. + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * + * @param array $params Associative array of parameters + * @return array + */ + public function searchModels(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Knn\SearchModels'); + $endpoint->setParams($params); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * Provides information about the current status of the k-NN plugin. + * + * $params['node_id'] = (array) Comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes. + * $params['stat'] = (array) Comma-separated list of stats to retrieve; use `_all` or empty string to retrieve all stats. + * $params['timeout'] = (string) Operation timeout. + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * + * @param array $params Associative array of parameters + * @return array + */ + public function stats(array $params = []) + { + $node_id = $this->extractArgument($params, 'node_id'); + $stat = $this->extractArgument($params, 'stat'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Knn\Stats'); + $endpoint->setParams($params); + $endpoint->setNodeId($node_id); + $endpoint->setStat($stat); + + return $this->performRequest($endpoint); + } + /** + * Create and train a model that can be used for initializing k-NN native library indexes during indexing. + * + * $params['model_id'] = (string) The id of the model. + * $params['preference'] = (string) Preferred node to execute training. + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * + * @param array $params Associative array of parameters + * @return array + */ + public function trainModel(array $params = []) + { + $model_id = $this->extractArgument($params, 'model_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Knn\TrainModel'); + $endpoint->setParams($params); + $endpoint->setModelId($model_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * Preloads native library files into memory, reducing initial search latency for specified indexes. + * + * $params['index'] = (array) Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices. (Required) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * + * @param array $params Associative array of parameters + * @return array + */ + public function warmup(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Knn\Warmup'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + + return $this->performRequest($endpoint); + } +} diff --git a/src/OpenSearch/Namespaces/NodesNamespace.php b/src/OpenSearch/Namespaces/NodesNamespace.php index 035e2b71..6946b1de 100644 --- a/src/OpenSearch/Namespaces/NodesNamespace.php +++ b/src/OpenSearch/Namespaces/NodesNamespace.php @@ -26,17 +26,25 @@ /** * Class NodesNamespace * + * NOTE: This file is autogenerated using util/GenerateEndpoints.php */ class NodesNamespace extends AbstractNamespace { /** - * $params['node_id'] = (list) A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * $params['interval'] = (time) The interval for the second sampling of threads - * $params['snapshots'] = (number) Number of samples of thread stacktrace (default: 10) - * $params['threads'] = (number) Specify the number of threads to provide information for (default: 3) - * $params['ignore_idle_threads'] = (boolean) Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue (default: true) - * $params['type'] = (enum) The type to sample (default: cpu) (Options = cpu,wait,block) - * $params['timeout'] = (time) Explicit operation timeout + * Returns information about hot threads on each node in the cluster. + * + * $params['node_id'] = (array) Comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes. + * $params['ignore_idle_threads'] = (boolean) Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue. (Default = true) + * $params['interval'] = (string) The interval for the second sampling of threads. + * $params['snapshots'] = (integer) Number of samples of thread stacktrace. (Default = 10) + * $params['threads'] = (integer) Specify the number of threads to provide information for. (Default = 3) + * $params['timeout'] = (string) Operation timeout. + * $params['type'] = (enum) The type to sample. (Options = cpu,wait,block) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -53,31 +61,45 @@ public function hotThreads(array $params = []) return $this->performRequest($endpoint); } /** - * $params['node_id'] = (list) A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * $params['metric'] = (list) A comma-separated list of metrics you wish returned. Leave empty to return all. - * $params['flat_settings'] = (boolean) Return settings in flat format (default: false) - * $params['timeout'] = (time) Explicit operation timeout + * Returns information about nodes in the cluster. + * + * $params['metric'] = (array) Limits the information returned to the specific metrics. Supports a comma-separated list, such as http,ingest. + * $params['node_id'] = (array) Comma-separated list of node IDs or names used to limit returned information. + * $params['flat_settings'] = (boolean) If true, returns settings in flat format. (Default = false) + * $params['timeout'] = (string) Period to wait for a response. 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. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array */ public function info(array $params = []) { - $node_id = $this->extractArgument($params, 'node_id'); $metric = $this->extractArgument($params, 'metric'); + $node_id = $this->extractArgument($params, 'node_id'); $endpointBuilder = $this->endpoints; $endpoint = $endpointBuilder('Nodes\Info'); $endpoint->setParams($params); - $endpoint->setNodeId($node_id); $endpoint->setMetric($metric); + $endpoint->setNodeId($node_id); return $this->performRequest($endpoint); } /** - * $params['node_id'] = (list) A comma-separated list of node IDs to span the reload/reinit call. Should stay empty because reloading usually involves all cluster nodes. - * $params['timeout'] = (time) Explicit operation timeout - * $params['body'] = (array) An object containing the password for the opensearch keystore + * Reloads secure settings. + * + * $params['node_id'] = (array) The names of particular nodes in the cluster to target. + * $params['timeout'] = (string) Period to wait for a response.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. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * $params['body'] = (array) An object containing the password for the opensearch keystore * * @param array $params Associative array of parameters * @return array @@ -96,17 +118,24 @@ public function reloadSecureSettings(array $params = []) return $this->performRequest($endpoint); } /** - * $params['node_id'] = (list) A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * $params['metric'] = (list) Limit the information returned to the specified metrics - * $params['index_metric'] = (list) Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified. - * $params['completion_fields'] = (list) A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) - * $params['fielddata_fields'] = (list) A comma-separated list of fields for `fielddata` index metric (supports wildcards) - * $params['fields'] = (list) A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) - * $params['groups'] = (boolean) A comma-separated list of search groups for `search` index metric - * $params['level'] = (enum) Return indices stats aggregated at index, node or shard level (Options = indices,node,shards) (Default = node) - * $params['types'] = (list) A comma-separated list of document types for the `indexing` index metric - * $params['timeout'] = (time) Explicit operation timeout - * $params['include_segment_file_sizes'] = (boolean) Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested) (Default = false) + * Returns statistical information about nodes in the cluster. + * + * $params['node_id'] = (array) Comma-separated list of node IDs or names used to limit returned information. + * $params['metric'] = (array) Limit the information returned to the specified metrics + * $params['index_metric'] = (array) Limit the information returned for indices metric to the specific index metrics. It can be used only if indices (or all) metric is specified. + * $params['completion_fields'] = (any) Comma-separated list or wildcard expressions of fields to include in fielddata and suggest statistics. + * $params['fielddata_fields'] = (any) Comma-separated list or wildcard expressions of fields to include in fielddata statistics. + * $params['fields'] = (any) Comma-separated list or wildcard expressions of fields to include in the statistics. + * $params['groups'] = (array) Comma-separated list of search groups to include in the search statistics. + * $params['include_segment_file_sizes'] = (boolean) If true, the call reports the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested). (Default = false) + * $params['level'] = (enum) Indicates whether statistics are aggregated at the cluster, index, or shard level. (Options = cluster,indices,shards) + * $params['timeout'] = (string) Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. + * $params['types'] = (array) A comma-separated list of document types for the indexing index metric. + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -127,9 +156,16 @@ public function stats(array $params = []) return $this->performRequest($endpoint); } /** - * $params['node_id'] = (list) A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * $params['metric'] = (list) Limit the information returned to the specified metrics - * $params['timeout'] = (time) Explicit operation timeout + * Returns low-level information about REST actions usage on nodes. + * + * $params['node_id'] = (array) A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes + * $params['metric'] = (array) Limits the information returned to the specific metrics. A comma-separated list of the following options: `_all`, `rest_actions`. + * $params['timeout'] = (string) Period to wait for a response.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. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array diff --git a/src/OpenSearch/Namespaces/NotificationsNamespace.php b/src/OpenSearch/Namespaces/NotificationsNamespace.php new file mode 100644 index 00000000..756dd2a0 --- /dev/null +++ b/src/OpenSearch/Namespaces/NotificationsNamespace.php @@ -0,0 +1,271 @@ +extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Notifications\CreateConfig'); + $endpoint->setParams($params); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * Delete a channel configuration. + * + * $params['config_id'] = (string) The ID of the channel configuration to delete. + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * + * @param array $params Associative array of parameters + * @return array + */ + public function deleteConfig(array $params = []) + { + $config_id = $this->extractArgument($params, 'config_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Notifications\DeleteConfig'); + $endpoint->setParams($params); + $endpoint->setConfigId($config_id); + + return $this->performRequest($endpoint); + } + /** + * Delete multiple channel configurations. + * + * $params['config_id'] = (string) The ID of the channel configuration to delete. + * $params['config_id_list'] = (string) A comma-separated list of channel IDs to delete. + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * + * @param array $params Associative array of parameters + * @return array + */ + public function deleteConfigs(array $params = []) + { + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Notifications\DeleteConfigs'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * Get a specific channel configuration. + * + * $params['config_id'] = (string) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * + * @param array $params Associative array of parameters + * @return array + */ + public function getConfig(array $params = []) + { + $config_id = $this->extractArgument($params, 'config_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Notifications\GetConfig'); + $endpoint->setParams($params); + $endpoint->setConfigId($config_id); + + return $this->performRequest($endpoint); + } + /** + * Get multiple channel configurations with filtering. + * + * $params['chime.url'] = (string) + * $params['chime.url.keyword'] = (string) + * $params['config_type'] = (enum) Type of notification configuration. (Options = slack,chime,microsoft_teams,webhook,email,sns,ses_account,smtp_account,email_group) + * $params['created_time_ms'] = (integer) + * $params['description'] = (string) + * $params['description.keyword'] = (string) + * $params['email.email_account_id'] = (string) + * $params['email.email_group_id_list'] = (string) + * $params['email.recipient_list.recipient'] = (string) + * $params['email.recipient_list.recipient.keyword'] = (string) + * $params['email_group.recipient_list.recipient'] = (string) + * $params['email_group.recipient_list.recipient.keyword'] = (string) + * $params['is_enabled'] = (boolean) + * $params['last_updated_time_ms'] = (integer) + * $params['microsoft_teams.url'] = (string) + * $params['microsoft_teams.url.keyword'] = (string) + * $params['name'] = (string) + * $params['name.keyword'] = (string) + * $params['query'] = (string) + * $params['ses_account.from_address'] = (string) + * $params['ses_account.from_address.keyword'] = (string) + * $params['ses_account.region'] = (string) + * $params['ses_account.role_arn'] = (string) + * $params['ses_account.role_arn.keyword'] = (string) + * $params['slack.url'] = (string) + * $params['slack.url.keyword'] = (string) + * $params['smtp_account.from_address'] = (string) + * $params['smtp_account.from_address.keyword'] = (string) + * $params['smtp_account.host'] = (string) + * $params['smtp_account.host.keyword'] = (string) + * $params['smtp_account.method'] = (string) + * $params['sns.role_arn'] = (string) + * $params['sns.role_arn.keyword'] = (string) + * $params['sns.topic_arn'] = (string) + * $params['sns.topic_arn.keyword'] = (string) + * $params['text_query'] = (string) + * $params['webhook.url'] = (string) + * $params['webhook.url.keyword'] = (string) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * + * @param array $params Associative array of parameters + * @return array + */ + public function getConfigs(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Notifications\GetConfigs'); + $endpoint->setParams($params); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * List created notification channels. + * + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * + * @param array $params Associative array of parameters + * @return array + */ + public function listChannels(array $params = []) + { + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Notifications\ListChannels'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * List supported channel configurations. + * + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * + * @param array $params Associative array of parameters + * @return array + */ + public function listFeatures(array $params = []) + { + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Notifications\ListFeatures'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * Send a test notification. + * + * $params['config_id'] = (string) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * + * @param array $params Associative array of parameters + * @return array + */ + public function sendTest(array $params = []) + { + $config_id = $this->extractArgument($params, 'config_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Notifications\SendTest'); + $endpoint->setParams($params); + $endpoint->setConfigId($config_id); + + return $this->performRequest($endpoint); + } + /** + * Update channel configuration. + * + * $params['config_id'] = (string) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * + * @param array $params Associative array of parameters + * @return array + */ + public function updateConfig(array $params = []) + { + $config_id = $this->extractArgument($params, 'config_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Notifications\UpdateConfig'); + $endpoint->setParams($params); + $endpoint->setConfigId($config_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } +} diff --git a/src/OpenSearch/Namespaces/RemoteStoreNamespace.php b/src/OpenSearch/Namespaces/RemoteStoreNamespace.php new file mode 100644 index 00000000..bd1b9080 --- /dev/null +++ b/src/OpenSearch/Namespaces/RemoteStoreNamespace.php @@ -0,0 +1,53 @@ +extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('RemoteStore\Restore'); + $endpoint->setParams($params); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } +} diff --git a/src/OpenSearch/Namespaces/RollupsNamespace.php b/src/OpenSearch/Namespaces/RollupsNamespace.php new file mode 100644 index 00000000..d0deb602 --- /dev/null +++ b/src/OpenSearch/Namespaces/RollupsNamespace.php @@ -0,0 +1,175 @@ +extractArgument($params, 'id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Rollups\Delete'); + $endpoint->setParams($params); + $endpoint->setId($id); + + return $this->performRequest($endpoint); + } + /** + * Get a rollup's current status. + * + * $params['id'] = (string) Rollup to access (Required) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * + * @param array $params Associative array of parameters + * @return array + */ + public function explain(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Rollups\Explain'); + $endpoint->setParams($params); + $endpoint->setId($id); + + return $this->performRequest($endpoint); + } + /** + * Get an index rollup. + * + * $params['id'] = (string) Rollup to access (Required) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * + * @param array $params Associative array of parameters + * @return array + */ + public function get(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Rollups\Get'); + $endpoint->setParams($params); + $endpoint->setId($id); + + return $this->performRequest($endpoint); + } + /** + * Create or update index rollup. + * + * $params['id'] = (string) Rollup to access (Required) + * $params['if_primary_term'] = (number) Only perform the operation if the document has this primary term. + * $params['if_seq_no'] = (number) Only perform the operation if the document has this sequence number. + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * + * @param array $params Associative array of parameters + * @return array + */ + public function put(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Rollups\Put'); + $endpoint->setParams($params); + $endpoint->setId($id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * Start rollup. + * + * $params['id'] = (string) Rollup to access (Required) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * + * @param array $params Associative array of parameters + * @return array + */ + public function start(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Rollups\Start'); + $endpoint->setParams($params); + $endpoint->setId($id); + + return $this->performRequest($endpoint); + } + /** + * Stop rollup. + * + * $params['id'] = (string) Rollup to access (Required) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * + * @param array $params Associative array of parameters + * @return array + */ + public function stop(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Rollups\Stop'); + $endpoint->setParams($params); + $endpoint->setId($id); + + return $this->performRequest($endpoint); + } +} diff --git a/src/OpenSearch/Namespaces/SearchPipelineNamespace.php b/src/OpenSearch/Namespaces/SearchPipelineNamespace.php new file mode 100644 index 00000000..0066519d --- /dev/null +++ b/src/OpenSearch/Namespaces/SearchPipelineNamespace.php @@ -0,0 +1,106 @@ +extractArgument($params, 'id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('SearchPipeline\Delete'); + $endpoint->setParams($params); + $endpoint->setId($id); + + return $this->performRequest($endpoint); + } + /** + * Retrieves information about a specified search pipeline. + * + * $params['id'] = (string) Comma-separated list of search pipeline ids. Wildcards supported. + * $params['cluster_manager_timeout'] = (string) operation timeout for connection to cluster-manager node. + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * + * @param array $params Associative array of parameters + * @return array + */ + public function get(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('SearchPipeline\Get'); + $endpoint->setParams($params); + $endpoint->setId($id); + + return $this->performRequest($endpoint); + } + /** + * Creates or replaces the specified search pipeline. + * + * $params['id'] = (string) Pipeline ID. + * $params['cluster_manager_timeout'] = (string) operation timeout for connection to cluster-manager node. + * $params['timeout'] = (string) Operation timeout. + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * + * @param array $params Associative array of parameters + * @return array + */ + public function put(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('SearchPipeline\Put'); + $endpoint->setParams($params); + $endpoint->setId($id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } +} diff --git a/src/OpenSearch/Namespaces/SnapshotNamespace.php b/src/OpenSearch/Namespaces/SnapshotNamespace.php index d7d96bb1..db1dc978 100644 --- a/src/OpenSearch/Namespaces/SnapshotNamespace.php +++ b/src/OpenSearch/Namespaces/SnapshotNamespace.php @@ -26,13 +26,22 @@ /** * Class SnapshotNamespace * + * NOTE: This file is autogenerated using util/GenerateEndpoints.php */ class SnapshotNamespace extends AbstractNamespace { /** - * $params['repository'] = (string) A repository name - * $params['cluster_manager_timeout'] = (time) Explicit operation timeout for connection to cluster_manager node - * $params['timeout'] = (time) Explicit operation timeout + * Removes stale data from repository. + * + * $params['repository'] = (string) Snapshot repository to clean up. + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['master_timeout'] = (string) Period to wait for a connection to the master node. + * $params['timeout'] = (string) Period to wait for a response. + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -49,11 +58,19 @@ public function cleanupRepository(array $params = []) return $this->performRequest($endpoint); } /** - * $params['repository'] = (string) A repository name - * $params['snapshot'] = (string) The name of the snapshot to clone from - * $params['target_snapshot'] = (string) The name of the cloned snapshot to create - * $params['cluster_manager_timeout'] = (time) Explicit operation timeout for connection to cluster_manager node - * $params['body'] = (array) The snapshot clone definition (Required) + * Clones indices from one snapshot into another snapshot in the same repository. + * + * $params['repository'] = (string) A repository name + * $params['snapshot'] = (string) The name of the snapshot to clone from + * $params['target_snapshot'] = (string) The name of the cloned snapshot to create + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['master_timeout'] = (string) Explicit operation timeout for connection to master node + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * $params['body'] = (array) The snapshot clone definition (Required) * * @param array $params Associative array of parameters * @return array @@ -76,11 +93,19 @@ public function clone(array $params = []) return $this->performRequest($endpoint); } /** - * $params['repository'] = (string) A repository name - * $params['snapshot'] = (string) A snapshot name - * $params['cluster_manager_timeout'] = (time) Explicit operation timeout for connection to cluster_manager node - * $params['wait_for_completion'] = (boolean) Should this request wait until the operation has completed before returning (Default = false) - * $params['body'] = (array) The snapshot definition + * Creates a snapshot in a repository. + * + * $params['repository'] = (string) Repository for the snapshot. + * $params['snapshot'] = (string) Name of the snapshot. Must be unique in the repository. + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['master_timeout'] = (string) Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + * $params['wait_for_completion'] = (boolean) If `true`, the request returns a response when the snapshot is complete. If `false`, the request returns a response when the snapshot initializes. (Default = false) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * $params['body'] = (array) The snapshot definition * * @param array $params Associative array of parameters * @return array @@ -101,11 +126,19 @@ public function create(array $params = []) return $this->performRequest($endpoint); } /** - * $params['repository'] = (string) A repository name - * $params['cluster_manager_timeout'] = (time) Explicit operation timeout for connection to cluster_manager node - * $params['timeout'] = (time) Explicit operation timeout - * $params['verify'] = (boolean) Whether to verify the repository after creation - * $params['body'] = (array) The repository definition (Required) + * Creates a repository. + * + * $params['repository'] = (string) A repository name + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['master_timeout'] = (string) Explicit operation timeout for connection to master node + * $params['timeout'] = (string) Explicit operation timeout + * $params['verify'] = (boolean) Whether to verify the repository after creation + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * $params['body'] = (array) The repository definition (Required) * * @param array $params Associative array of parameters * @return array @@ -124,9 +157,17 @@ public function createRepository(array $params = []) return $this->performRequest($endpoint); } /** - * $params['repository'] = (string) A repository name - * $params['snapshot'] = (string) A snapshot name - * $params['cluster_manager_timeout'] = (time) Explicit operation timeout for connection to cluster_manager node + * Deletes a snapshot. + * + * $params['repository'] = (string) A repository name + * $params['snapshot'] = (string) A comma-separated list of snapshot names + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['master_timeout'] = (string) Explicit operation timeout for connection to master node + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -145,9 +186,17 @@ public function delete(array $params = []) return $this->performRequest($endpoint); } /** - * $params['repository'] = (list) Name of the snapshot repository to unregister. Wildcard (`*`) patterns are supported. - * $params['cluster_manager_timeout'] = (time) Explicit operation timeout for connection to cluster_manager node - * $params['timeout'] = (time) Explicit operation timeout + * Deletes a repository. + * + * $params['repository'] = (array) Name of the snapshot repository to unregister. Wildcard (`*`) patterns are supported. + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['master_timeout'] = (string) Explicit operation timeout for connection to master node + * $params['timeout'] = (string) Explicit operation timeout + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -164,11 +213,19 @@ public function deleteRepository(array $params = []) return $this->performRequest($endpoint); } /** - * $params['repository'] = (string) A repository name - * $params['snapshot'] = (list) A comma-separated list of snapshot names - * $params['cluster_manager_timeout'] = (time) Explicit operation timeout for connection to cluster_manager node - * $params['ignore_unavailable'] = (boolean) Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown - * $params['verbose'] = (boolean) Whether to show verbose snapshot info or only show the basic info found in the repository index blob + * Returns information about a snapshot. + * + * $params['repository'] = (string) Comma-separated list of snapshot repository names used to limit the request. Wildcard (*) expressions are supported. + * $params['snapshot'] = (array) Comma-separated list of snapshot names to retrieve. Also accepts wildcards (*). - To get information about all snapshots in a registered repository, use a wildcard (*) or _all. - To get information about any snapshots that are currently running, use _current. + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['ignore_unavailable'] = (boolean) If false, the request returns an error for any snapshots that are unavailable. (Default = false) + * $params['master_timeout'] = (string) Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + * $params['verbose'] = (boolean) If true, returns additional information about each snapshot such as the version of OpenSearch which took the snapshot, the start and end times of the snapshot, and the number of shards snapshotted. + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -187,9 +244,17 @@ public function get(array $params = []) return $this->performRequest($endpoint); } /** - * $params['repository'] = (list) A comma-separated list of repository names - * $params['cluster_manager_timeout'] = (time) Explicit operation timeout for connection to cluster_manager node - * $params['local'] = (boolean) Return local information, do not retrieve the state from cluster_manager node (default: false) + * Returns information about a repository. + * + * $params['repository'] = (array) A comma-separated list of repository names + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['local'] = (boolean) Return local information, do not retrieve the state from cluster-manager node. (Default = false) + * $params['master_timeout'] = (string) Explicit operation timeout for connection to master node + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -206,11 +271,19 @@ public function getRepository(array $params = []) return $this->performRequest($endpoint); } /** - * $params['repository'] = (string) A repository name - * $params['snapshot'] = (string) A snapshot name - * $params['cluster_manager_timeout'] = (time) Explicit operation timeout for connection to cluster_manager node - * $params['wait_for_completion'] = (boolean) Should this request wait until the operation has completed before returning (Default = false) - * $params['body'] = (array) Details of what to restore + * Restores a snapshot. + * + * $params['repository'] = (string) A repository name + * $params['snapshot'] = (string) A snapshot name + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['master_timeout'] = (string) Explicit operation timeout for connection to master node + * $params['wait_for_completion'] = (boolean) Should this request wait until the operation has completed before returning (Default = false) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * $params['body'] = (array) Details of what to restore * * @param array $params Associative array of parameters * @return array @@ -231,10 +304,18 @@ public function restore(array $params = []) return $this->performRequest($endpoint); } /** - * $params['repository'] = (string) A repository name - * $params['snapshot'] = (list) A comma-separated list of snapshot names - * $params['cluster_manager_timeout'] = (time) Explicit operation timeout for connection to cluster_manager node - * $params['ignore_unavailable'] = (boolean) Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown + * Returns information about the status of a snapshot. + * + * $params['repository'] = (string) A repository name + * $params['snapshot'] = (array) A comma-separated list of snapshot names + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['ignore_unavailable'] = (boolean) Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown (Default = false) + * $params['master_timeout'] = (string) Explicit operation timeout for connection to master node + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -253,9 +334,17 @@ public function status(array $params = []) return $this->performRequest($endpoint); } /** - * $params['repository'] = (string) A repository name - * $params['cluster_manager_timeout'] = (time) Explicit operation timeout for connection to cluster_manager node - * $params['timeout'] = (time) Explicit operation timeout + * Verifies a repository. + * + * $params['repository'] = (string) A repository name + * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. + * $params['master_timeout'] = (string) Explicit operation timeout for connection to master node + * $params['timeout'] = (string) Explicit operation timeout + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array diff --git a/src/OpenSearch/Namespaces/TasksNamespace.php b/src/OpenSearch/Namespaces/TasksNamespace.php index d278eb86..2292ed72 100644 --- a/src/OpenSearch/Namespaces/TasksNamespace.php +++ b/src/OpenSearch/Namespaces/TasksNamespace.php @@ -26,15 +26,23 @@ /** * Class TasksNamespace * + * NOTE: This file is autogenerated using util/GenerateEndpoints.php */ class TasksNamespace extends AbstractNamespace { /** - * $params['task_id'] = (string) Cancel the task with specified task id (node_id:task_number) - * $params['nodes'] = (list) A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * $params['actions'] = (list) A comma-separated list of actions that should be cancelled. Leave empty to cancel all. - * $params['parent_task_id'] = (string) Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all. - * $params['wait_for_completion'] = (boolean) Should the request block until the cancellation of the task and its descendant tasks is completed. Defaults to false + * Cancels a task, if it can be cancelled through an API. + * + * $params['task_id'] = (number) ID of the task. + * $params['actions'] = (any) Comma-separated list or wildcard expression of actions used to limit the request. + * $params['nodes'] = (array) Comma-separated list of node IDs or names used to limit the request. + * $params['parent_task_id'] = (string) Parent task ID used to limit the tasks. + * $params['wait_for_completion'] = (boolean) Should the request block until the cancellation of the task and its descendant tasks is completed. Defaults to false (Default = false) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -51,9 +59,16 @@ public function cancel(array $params = []) return $this->performRequest($endpoint); } /** - * $params['task_id'] = (string) Return the task with specified id (node_id:task_number) - * $params['wait_for_completion'] = (boolean) Wait for the matching tasks to complete (default: false) - * $params['timeout'] = (time) Explicit operation timeout + * Returns information about a task. + * + * $params['task_id'] = (string) ID of the task. + * $params['timeout'] = (string) Period to wait for a response.If no response is received before the timeout expires, the request fails and returns an error. + * $params['wait_for_completion'] = (boolean) If `true`, the request blocks until the task has completed. (Default = false) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array @@ -70,13 +85,20 @@ public function get(array $params = []) return $this->performRequest($endpoint); } /** - * $params['nodes'] = (list) A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * $params['actions'] = (list) A comma-separated list of actions that should be returned. Leave empty to return all. - * $params['detailed'] = (boolean) Return detailed task information (default: false) - * $params['parent_task_id'] = (string) Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all. - * $params['wait_for_completion'] = (boolean) Wait for the matching tasks to complete (default: false) - * $params['group_by'] = (enum) Group tasks by nodes or parent/child relationships (Options = nodes,parents,none) (Default = nodes) - * $params['timeout'] = (time) Explicit operation timeout + * Returns a list of tasks. + * + * $params['actions'] = (any) Comma-separated list or wildcard expression of actions used to limit the request. + * $params['detailed'] = (boolean) If `true`, the response includes detailed information about shard recoveries. (Default = false) + * $params['group_by'] = (enum) Key used to group tasks in the response. (Options = nodes,parents,none) + * $params['nodes'] = (array) Comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes. + * $params['parent_task_id'] = (string) Parent task ID used to limit returned information. To return all tasks, omit this parameter or use a value of `-1`. + * $params['timeout'] = (string) Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. + * $params['wait_for_completion'] = (boolean) If `true`, the request blocks until the operation is complete. (Default = false) + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. * * @param array $params Associative array of parameters * @return array diff --git a/src/OpenSearch/Namespaces/TransformsNamespace.php b/src/OpenSearch/Namespaces/TransformsNamespace.php new file mode 100644 index 00000000..fa124ad5 --- /dev/null +++ b/src/OpenSearch/Namespaces/TransformsNamespace.php @@ -0,0 +1,220 @@ +extractArgument($params, 'id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Transforms\Delete'); + $endpoint->setParams($params); + $endpoint->setId($id); + + return $this->performRequest($endpoint); + } + /** + * Returns the status and metadata of a transform job. + * + * $params['id'] = (string) Transform to explain + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * + * @param array $params Associative array of parameters + * @return array + */ + public function explain(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Transforms\Explain'); + $endpoint->setParams($params); + $endpoint->setId($id); + + return $this->performRequest($endpoint); + } + /** + * Returns the status and metadata of a transform job. + * + * $params['id'] = (string) Transform to access + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * + * @param array $params Associative array of parameters + * @return array + */ + public function get(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Transforms\Get'); + $endpoint->setParams($params); + $endpoint->setId($id); + + return $this->performRequest($endpoint); + } + /** + * Returns a preview of what a transformed index would look like. + * + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * + * @param array $params Associative array of parameters + * @return array + */ + public function preview(array $params = []) + { + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Transforms\Preview'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * Create an index transform, or update a transform if if_seq_no and if_primary_term are provided. + * + * $params['id'] = (string) Transform to create/update + * $params['if_primary_term'] = (number) Only perform the operation if the document has this primary term. + * $params['if_seq_no'] = (number) Only perform the operation if the document has this sequence number. + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * + * @param array $params Associative array of parameters + * @return array + */ + public function put(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Transforms\Put'); + $endpoint->setParams($params); + $endpoint->setId($id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * Returns the details of all transform jobs. + * + * $params['from'] = (number) The starting transform to return. Default is 0. + * $params['search'] = (string) The search term to use to filter results. + * $params['size'] = (number) Specifies the number of transforms to return. Default is 10. + * $params['sortDirection'] = (string) Specifies the direction to sort results in. Can be ASC or DESC. Default is ASC. + * $params['sortField'] = (string) The field to sort results with. + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * + * @param array $params Associative array of parameters + * @return array + */ + public function search(array $params = []) + { + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Transforms\Search'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * Start transform. + * + * $params['id'] = (string) Transform to start + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * + * @param array $params Associative array of parameters + * @return array + */ + public function start(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Transforms\Start'); + $endpoint->setParams($params); + $endpoint->setId($id); + + return $this->performRequest($endpoint); + } + /** + * stop transform. + * + * $params['id'] = (string) Transform to stop + * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. + * $params['human'] = (boolean) Whether to return human readable values for statistics. + * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. + * $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) Comma-separated list of filters used to reduce the response. + * + * @param array $params Associative array of parameters + * @return array + */ + public function stop(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Transforms\Stop'); + $endpoint->setParams($params); + $endpoint->setId($id); + + return $this->performRequest($endpoint); + } +} diff --git a/tests/Endpoints/CreatePointInTimeTest.php b/tests/Endpoints/CreatePitTest.php similarity index 90% rename from tests/Endpoints/CreatePointInTimeTest.php rename to tests/Endpoints/CreatePitTest.php index 8fbaa0fe..779f68ee 100644 --- a/tests/Endpoints/CreatePointInTimeTest.php +++ b/tests/Endpoints/CreatePitTest.php @@ -22,11 +22,11 @@ namespace OpenSearch\Tests\Endpoints; use OpenSearch\Common\Exceptions\RuntimeException; -use OpenSearch\Endpoints\CreatePointInTime; +use OpenSearch\Endpoints\CreatePit; -class CreatePointInTimeTest extends \PHPUnit\Framework\TestCase +class CreatePitTest extends \PHPUnit\Framework\TestCase { - /** @var CreatePointInTime */ + /** @var CreatePit */ private $instance; /** @@ -35,7 +35,7 @@ class CreatePointInTimeTest extends \PHPUnit\Framework\TestCase protected function setUp(): void { // Instance - $this->instance = new CreatePointInTime(); + $this->instance = new CreatePit(); } public function testGetURIWhenIndexAndIdAreDefined(): void @@ -71,7 +71,7 @@ public function testGetURIWhenIndexIsNotDefined(): void { // Arrange $expected = RuntimeException::class; - $expectedMessage = 'index is required for creating point-in-time'; + $expectedMessage = 'index is required for create_pit'; // Assert $this->expectException($expected); diff --git a/tests/Endpoints/CreateTest.php b/tests/Endpoints/CreateTest.php index a86fb5a8..c5e7cfd6 100644 --- a/tests/Endpoints/CreateTest.php +++ b/tests/Endpoints/CreateTest.php @@ -56,23 +56,27 @@ public function testGetURIWhenIndexAndIdAreDefined(): void public function testGetURIWhenIndexIsDefinedAndIdIsNotDefined(): void { // Arrange - $expected = '/index/_doc'; + $expected = RuntimeException::class; + $expectedMessage = 'id is required for create'; $this->instance->setIndex('index'); - // Act - $result = $this->instance->getURI(); - // Assert - $this->assertEquals($expected, $result); + $this->expectException($expected); + $this->expectExceptionMessage($expectedMessage); + + // Act + $this->instance->getURI(); } - public function testGetURIWhenIndexIsNotDefined(): void + public function testGetURIWhenIdIsDefinedAndIndexIsNotDefined(): void { // Arrange $expected = RuntimeException::class; $expectedMessage = 'index is required for create'; + $this->instance->setId('1'); + // Assert $this->expectException($expected); $this->expectExceptionMessage($expectedMessage); @@ -95,15 +99,4 @@ public function testGetMethodWhenIdIsDefined(): void $this->assertEquals($expected, $result); } - public function testGetMethodWhenIdIsNotDefined(): void - { - // Arrange - $expected = 'POST'; - - // Act - $result = $this->instance->getMethod(); - - // Assert - $this->assertEquals($expected, $result); - } } diff --git a/tests/Endpoints/DeletePointInTimeTest.php b/tests/Endpoints/DeletePitTest.php similarity index 92% rename from tests/Endpoints/DeletePointInTimeTest.php rename to tests/Endpoints/DeletePitTest.php index d4e01855..9f095e3f 100644 --- a/tests/Endpoints/DeletePointInTimeTest.php +++ b/tests/Endpoints/DeletePitTest.php @@ -21,11 +21,11 @@ namespace OpenSearch\Tests\Endpoints; -use OpenSearch\Endpoints\DeletePointInTime; +use OpenSearch\Endpoints\DeletePit; -class DeletePointInTimeTest extends \PHPUnit\Framework\TestCase +class DeletePitTest extends \PHPUnit\Framework\TestCase { - /** @var DeletePointInTime */ + /** @var DeletePit */ private $instance; /** @@ -34,7 +34,7 @@ class DeletePointInTimeTest extends \PHPUnit\Framework\TestCase protected function setUp(): void { // Instance - $this->instance = new DeletePointInTime(); + $this->instance = new DeletePit(); } public function testGetURIWhenIndexAndIdAreDefined(): void diff --git a/util/ClientEndpoint.php b/util/ClientEndpoint.php index 58835109..0eeffbbf 100644 --- a/util/ClientEndpoint.php +++ b/util/ClientEndpoint.php @@ -48,7 +48,7 @@ public function renderClass(): string $class = file_get_contents(self::CLIENT_CLASS_TEMPLATE); // use Namespace $useNamespace = ''; - + // The following namespaces do not have OpenSearch API specifications $patchnamespaces = ['async_search', 'searchable_snapshots', 'ssl', 'sql', 'data_frame_transform_deprecated', 'monitoring']; $this->namespace = array_unique(array_merge($this->namespace, $patchnamespaces)); @@ -93,7 +93,11 @@ public function renderClass(): string // Endpoints $endpoints = ''; foreach ($this->endpoints as $endpoint) { - $endpoints .= $this->renderEndpoint($endpoint); + $endpointName = $this->getEndpointName($endpoint->name); + $proxyFilePath = 'util/endpointproxies/' . $this->name . '/' . $endpointName . 'Proxy.php'; + if (!file_exists($proxyFilePath)) { + $endpoints .= $this->renderEndpoint($endpoint); + } } $proxyFolder = 'util/endpointproxies/'; if (is_dir($proxyFolder)) { diff --git a/util/EndpointProxies/createProxy.php b/util/EndpointProxies/createProxy.php new file mode 100644 index 00000000..56a75bf6 --- /dev/null +++ b/util/EndpointProxies/createProxy.php @@ -0,0 +1,42 @@ +extractArgument($params, 'id'); + $index = $this->extractArgument($params, 'index'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $id ? $endpointBuilder('Create') : $endpointBuilder('Index'); + $endpoint->setParams($params); + $endpoint->setId($id); + $endpoint->setIndex($index); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } +EOD; diff --git a/util/EndpointProxies/indices/refreshSearchAnalyzersProxy.php b/util/EndpointProxies/indices/refreshSearchAnalyzersProxy.php new file mode 100644 index 00000000..4b0497b8 --- /dev/null +++ b/util/EndpointProxies/indices/refreshSearchAnalyzersProxy.php @@ -0,0 +1,22 @@ +extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Indices\RefreshSearchAnalyzers'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + + return $this->performRequest($endpoint); +} +EOD; diff --git a/util/GenerateEndpoints.php b/util/GenerateEndpoints.php index e9637595..9a121d08 100644 --- a/util/GenerateEndpoints.php +++ b/util/GenerateEndpoints.php @@ -508,7 +508,7 @@ function isValidPhpSyntax(string $filename): bool function Patch_Endpoints() { $patchEndpoints = ['AsyncSearch', 'SearchableSnapshots', 'Ssl', 'Sql', - 'DataFrameTransformDeprecated', 'Monitoring' ]; + 'DataFrameTransformDeprecated', 'Monitoring', 'Indices/RefreshSearchAnalyzers' ]; $outputDir = __DIR__ . "/output"; $destDir = __DIR__ . "/../src/OpenSearch"; diff --git a/util/template/client-class b/util/template/client-class index 00a50673..e3ed316f 100644 --- a/util/template/client-class +++ b/util/template/client-class @@ -34,7 +34,7 @@ use OpenSearch\Namespaces\BooleanRequestWrapper; */ class Client { - const VERSION = '2.3.0'; + const VERSION = '2.3.1'; /** * @var Transport