From 2519e26c7b66b9bb1adc8db30874240352144e8a Mon Sep 17 00:00:00 2001 From: saimedhi Date: Wed, 3 Jul 2024 16:16:29 -0700 Subject: [PATCH] Generated code Signed-off-by: saimedhi --- src/OpenSearch/Client.php | 1376 ++++++++----- src/OpenSearch/Endpoints/Bulk.php | 19 +- src/OpenSearch/Endpoints/Cat/Aliases.php | 13 +- .../Endpoints/Cat/AllPitSegments.php | 51 + src/OpenSearch/Endpoints/Cat/Allocation.php | 17 +- .../Endpoints/Cat/ClusterManager.php | 20 +- src/OpenSearch/Endpoints/Cat/Count.php | 11 +- src/OpenSearch/Endpoints/Cat/Fielddata.php | 13 +- src/OpenSearch/Endpoints/Cat/Health.php | 10 +- src/OpenSearch/Endpoints/Cat/Help.php | 10 +- src/OpenSearch/Endpoints/Cat/Indices.php | 22 +- src/OpenSearch/Endpoints/Cat/Master.php | 17 +- src/OpenSearch/Endpoints/Cat/NodeAttrs.php | 15 +- src/OpenSearch/Endpoints/Cat/Nodes.php | 15 +- src/OpenSearch/Endpoints/Cat/PendingTasks.php | 15 +- src/OpenSearch/Endpoints/Cat/PitSegments.php | 61 + src/OpenSearch/Endpoints/Cat/Plugins.php | 15 +- src/OpenSearch/Endpoints/Cat/Recovery.php | 13 +- src/OpenSearch/Endpoints/Cat/Repositories.php | 15 +- .../Endpoints/Cat/SegmentReplication.php | 66 + src/OpenSearch/Endpoints/Cat/Segments.php | 20 +- src/OpenSearch/Endpoints/Cat/Shards.php | 18 +- src/OpenSearch/Endpoints/Cat/Snapshots.php | 16 +- src/OpenSearch/Endpoints/Cat/Tasks.php | 16 +- src/OpenSearch/Endpoints/Cat/Templates.php | 16 +- src/OpenSearch/Endpoints/Cat/ThreadPool.php | 18 +- src/OpenSearch/Endpoints/Cat/Transforms.php | 69 - src/OpenSearch/Endpoints/ClearScroll.php | 9 +- .../Endpoints/Cluster/AllocationExplain.php | 10 +- .../Cluster/DeleteComponentTemplate.php | 14 +- .../Cluster/DeleteDecommissionAwareness.php | 45 + .../Cluster/DeleteVotingConfigExclusions.php | 10 +- .../Cluster/DeleteWeightedRouting.php | 45 + .../Cluster/ExistsComponentTemplate.php | 14 +- .../Cluster/GetComponentTemplate.php | 14 +- .../Cluster/GetDecommissionAwareness.php | 62 + .../Endpoints/Cluster/GetSettings.php | 13 +- .../Endpoints/Cluster/GetWeightedRouting.php | 62 + src/OpenSearch/Endpoints/Cluster/Health.php | 17 +- .../Endpoints/Cluster/PendingTasks.php | 11 +- .../Cluster/PostVotingConfigExclusions.php | 10 +- .../Cluster/PutComponentTemplate.php | 14 +- .../Cluster/PutDecommissionAwareness.php | 74 + .../Endpoints/Cluster/PutSettings.php | 11 +- .../Endpoints/Cluster/PutWeightedRouting.php | 62 + .../Endpoints/Cluster/RemoteInfo.php | 9 +- src/OpenSearch/Endpoints/Cluster/Reroute.php | 15 +- src/OpenSearch/Endpoints/Cluster/State.php | 20 +- src/OpenSearch/Endpoints/Cluster/Stats.php | 11 +- src/OpenSearch/Endpoints/Count.php | 26 +- 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 | 16 +- src/OpenSearch/Endpoints/DeleteAllPits.php | 45 + src/OpenSearch/Endpoints/DeleteByQuery.php | 40 +- .../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 | 18 +- src/OpenSearch/Endpoints/ExistsSource.php | 16 +- src/OpenSearch/Endpoints/Explain.php | 16 +- src/OpenSearch/Endpoints/FieldCaps.php | 15 +- src/OpenSearch/Endpoints/Get.php | 18 +- src/OpenSearch/Endpoints/GetAllPits.php | 45 + src/OpenSearch/Endpoints/GetScript.php | 23 +- src/OpenSearch/Endpoints/GetScriptContext.php | 9 +- .../Endpoints/GetScriptLanguages.php | 9 +- src/OpenSearch/Endpoints/GetSource.php | 16 +- src/OpenSearch/Endpoints/Index.php | 18 +- src/OpenSearch/Endpoints/Indices/AddBlock.php | 20 +- src/OpenSearch/Endpoints/Indices/Analyze.php | 11 +- .../Endpoints/Indices/ClearCache.php | 17 +- .../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 | 14 +- .../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 | 13 +- .../Endpoints/Indices/ExistsIndexTemplate.php | 14 +- .../Endpoints/Indices/ExistsTemplate.php | 14 +- src/OpenSearch/Endpoints/Indices/Flush.php | 15 +- .../Endpoints/Indices/ForceMerge.php | 17 +- src/OpenSearch/Endpoints/Indices/Freeze.php | 60 - src/OpenSearch/Endpoints/Indices/Get.php | 16 +- src/OpenSearch/Endpoints/Indices/GetAlias.php | 13 +- .../Endpoints/Indices/GetDataStream.php | 10 +- .../Endpoints/Indices/GetFieldMapping.php | 14 +- .../Endpoints/Indices/GetIndexTemplate.php | 14 +- .../Endpoints/Indices/GetMapping.php | 15 +- .../Endpoints/Indices/GetSettings.php | 20 +- .../Endpoints/Indices/GetTemplate.php | 14 +- .../Endpoints/Indices/GetUpgrade.php | 13 +- src/OpenSearch/Endpoints/Indices/Open.php | 20 +- src/OpenSearch/Endpoints/Indices/PutAlias.php | 14 +- .../Endpoints/Indices/PutIndexTemplate.php | 14 +- .../Endpoints/Indices/PutMapping.php | 17 +- .../Endpoints/Indices/PutSettings.php | 20 +- .../Endpoints/Indices/PutTemplate.php | 14 +- src/OpenSearch/Endpoints/Indices/Recovery.php | 11 +- src/OpenSearch/Endpoints/Indices/Refresh.php | 13 +- .../Endpoints/Indices/ResolveIndex.php | 11 +- src/OpenSearch/Endpoints/Indices/Rollover.php | 14 +- src/OpenSearch/Endpoints/Indices/Segments.php | 13 +- .../Endpoints/Indices/ShardStores.php | 15 +- src/OpenSearch/Endpoints/Indices/Shrink.php | 16 +- .../Indices/SimulateIndexTemplate.php | 14 +- .../Endpoints/Indices/SimulateTemplate.php | 14 +- 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 | 13 +- src/OpenSearch/Endpoints/Indices/Upgrade.php | 11 +- .../Endpoints/Indices/ValidateQuery.php | 20 +- src/OpenSearch/Endpoints/Info.php | 9 +- .../Endpoints/Ingest/DeletePipeline.php | 12 +- .../Endpoints/Ingest/GetPipeline.php | 13 +- .../Endpoints/Ingest/ProcessorGrok.php | 9 +- .../Endpoints/Ingest/PutPipeline.php | 12 +- src/OpenSearch/Endpoints/Ingest/Simulate.php | 11 +- 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 | 18 +- .../MachineLearning/Models/RegisterModel.php | 43 - src/OpenSearch/Endpoints/Mget.php | 16 +- src/OpenSearch/Endpoints/Ml/DeleteModel.php | 62 + .../Endpoints/Ml/DeleteModelGroup.php | 62 + src/OpenSearch/Endpoints/Ml/GetModelGroup.php | 62 + src/OpenSearch/Endpoints/Ml/GetTask.php | 62 + src/OpenSearch/Endpoints/Ml/RegisterModel.php | 55 + .../Endpoints/Ml/RegisterModelGroup.php | 55 + src/OpenSearch/Endpoints/Ml/SearchModels.php | 55 + src/OpenSearch/Endpoints/Msearch.php | 16 +- src/OpenSearch/Endpoints/MsearchTemplate.php | 14 +- src/OpenSearch/Endpoints/Nodes/HotThreads.php | 13 +- src/OpenSearch/Endpoints/Nodes/Info.php | 35 +- .../Endpoints/Nodes/ReloadSecureSettings.php | 11 +- src/OpenSearch/Endpoints/Nodes/Stats.php | 13 +- src/OpenSearch/Endpoints/Nodes/Usage.php | 11 +- .../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/Ping.php | 9 +- src/OpenSearch/Endpoints/PutScript.php | 15 +- src/OpenSearch/Endpoints/RankEval.php | 13 +- src/OpenSearch/Endpoints/Reindex.php | 16 +- .../Endpoints/ReindexRethrottle.php | 21 +- .../Endpoints/RemoteStore/Restore.php | 57 + .../Endpoints/RenderSearchTemplate.php | 12 +- 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 + .../Endpoints/ScriptsPainlessExecute.php | 9 +- src/OpenSearch/Endpoints/Scroll.php | 10 +- src/OpenSearch/Endpoints/Search.php | 46 +- .../Endpoints/SearchPipeline/Delete.php | 52 + .../Endpoints/SearchPipeline/Get.php | 50 + .../Endpoints/SearchPipeline/Put.php | 62 + src/OpenSearch/Endpoints/SearchShards.php | 17 +- src/OpenSearch/Endpoints/SearchTemplate.php | 20 +- .../Endpoints/Security/Authinfo.php | 47 + .../Endpoints/Security/Authtoken.php | 45 + .../Security/{GetAccount.php => Cache.php} | 19 +- .../Endpoints/Security/ChangePassword.php | 28 +- .../Endpoints/Security/ConfigUpgradeCheck.php | 45 + .../Security/ConfigUpgradePerform.php | 55 + .../Endpoints/Security/CreateActionGroup.php | 49 +- .../Endpoints/Security/CreateAllowlist.php | 55 + .../Endpoints/Security/CreateRole.php | 52 +- .../Endpoints/Security/CreateRoleMapping.php | 52 +- .../Endpoints/Security/CreateTenant.php | 50 +- .../Security/CreateUpdateTenancyConfig.php | 55 + .../Endpoints/Security/CreateUser.php | 53 +- .../Endpoints/Security/CreateUserLegacy.php | 74 + .../Endpoints/Security/DeleteActionGroup.php | 40 +- ...dNames.php => DeleteDistinguishedName.php} | 46 +- .../Security/DeleteDistinguishedNames.php | 56 - .../Endpoints/Security/DeleteRole.php | 40 +- .../Endpoints/Security/DeleteRoleMapping.php | 40 +- .../Endpoints/Security/DeleteTenant.php | 40 +- .../Endpoints/Security/DeleteUser.php | 40 +- .../Endpoints/Security/DeleteUserLegacy.php | 64 + .../Endpoints/Security/FlushCache.php | 17 +- .../Endpoints/Security/GenerateOboToken.php | 55 + .../Endpoints/Security/GenerateUserToken.php | 64 + .../Security/GenerateUserTokenLegacy.php | 64 + .../Endpoints/Security/GetAccountDetails.php | 45 + .../Endpoints/Security/GetActionGroup.php | 64 + .../Endpoints/Security/GetActionGroups.php | 32 +- .../Endpoints/Security/GetAllowlist.php | 45 + .../Security/GetAuditConfiguration.php | 45 + .../Endpoints/Security/GetCertificates.php | 17 +- .../{PatchConfig.php => GetConfiguration.php} | 21 +- .../Endpoints/Security/GetDashboardsInfo.php | 45 + .../Security/GetDistinguishedName.php | 65 + .../Security/GetDistinguishedNames.php | 33 +- .../Endpoints/Security/GetPermissionsInfo.php | 45 + src/OpenSearch/Endpoints/Security/GetRole.php | 64 + .../Endpoints/Security/GetRoleMapping.php | 64 + .../Endpoints/Security/GetRoleMappings.php | 32 +- .../Endpoints/Security/GetRoles.php | 32 +- .../Endpoints/Security/GetSslinfo.php | 46 + .../Endpoints/Security/GetTenancyConfig.php | 45 + .../Endpoints/Security/GetTenant.php | 64 + .../Endpoints/Security/GetTenants.php | 32 +- src/OpenSearch/Endpoints/Security/GetUser.php | 64 + .../Endpoints/Security/GetUserLegacy.php | 64 + .../Endpoints/Security/GetUsers.php | 32 +- .../Endpoints/Security/GetUsersLegacy.php | 45 + src/OpenSearch/Endpoints/Security/Health.php | 18 +- src/OpenSearch/Endpoints/Security/Migrate.php | 45 + .../Endpoints/Security/PatchActionGroup.php | 74 + .../Endpoints/Security/PatchActionGroups.php | 34 +- .../Endpoints/Security/PatchAllowlist.php | 55 + .../Security/PatchAuditConfiguration.php | 55 + .../Endpoints/Security/PatchConfiguration.php | 55 + .../Security/PatchDistinguishedName.php | 74 + .../Security/PatchDistinguishedNames.php | 55 + .../Endpoints/Security/PatchRole.php | 74 + .../Endpoints/Security/PatchRoleMapping.php | 74 + .../Endpoints/Security/PatchRoleMappings.php | 34 +- .../Endpoints/Security/PatchRoles.php | 34 +- .../Endpoints/Security/PatchTenant.php | 74 + .../Endpoints/Security/PatchTenants.php | 34 +- .../Endpoints/Security/PatchUser.php | 74 + .../Endpoints/Security/PatchUsers.php | 35 +- .../Endpoints/Security/PostDashboardsInfo.php | 55 + .../Security/ReloadHttpCertificates.php | 45 + .../Security/ReloadTransportCertificates.php | 45 + .../{GetConfig.php => TenantInfo.php} | 19 +- .../Security/UpdateAuditConfiguration.php | 55 + .../Security/UpdateConfiguration.php | 55 + .../Security/UpdateDistinguishedName.php | 74 + .../Endpoints/Security/Validate.php | 46 + .../Security/{UpdateConfig.php => WhoAmI.php} | 23 +- .../Endpoints/Security/WhoAmIProtected.php | 45 + .../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 | 13 +- src/OpenSearch/Endpoints/Tasks/Get.php | 11 +- src/OpenSearch/Endpoints/Tasks/ListTasks.php | 14 +- src/OpenSearch/Endpoints/TermVectors.php | 16 +- .../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 | 16 +- src/OpenSearch/Endpoints/UpdateByQuery.php | 41 +- .../Endpoints/UpdateByQueryRethrottle.php | 21 +- src/OpenSearch/Namespaces/CatNamespace.php | 739 ++++--- .../Namespaces/ClusterNamespace.php | 390 +++- .../Namespaces/DanglingIndicesNamespace.php | 40 +- src/OpenSearch/Namespaces/IngestNamespace.php | 63 +- src/OpenSearch/Namespaces/KnnNamespace.php | 219 +++ src/OpenSearch/Namespaces/MlNamespace.php | 192 ++ src/OpenSearch/Namespaces/NodesNamespace.php | 96 +- .../Namespaces/NotificationsNamespace.php | 271 +++ .../Namespaces/RemoteStoreNamespace.php | 53 + .../Namespaces/RollupsNamespace.php | 175 ++ .../Namespaces/SearchPipelineNamespace.php | 106 + .../Namespaces/SecurityNamespace.php | 1735 +++++++++++++++-- .../Namespaces/SnapshotNamespace.php | 177 +- src/OpenSearch/Namespaces/TasksNamespace.php | 52 +- .../Namespaces/TransformsNamespace.php | 220 +++ tests/Endpoints/CreateIntegrationTest.php | 28 - tests/Endpoints/CreatePointInTimeTest.php | 10 +- tests/Endpoints/CreateTest.php | 27 +- tests/Endpoints/DeletePointInTimeTest.php | 8 +- .../MachineLearningNamespaceTest.php | 5 +- tests/Namespaces/SecurityNamespaceTest.php | 26 +- 306 files changed, 12795 insertions(+), 2550 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/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 delete mode 100644 src/OpenSearch/Endpoints/MachineLearning/Models/RegisterModel.php create mode 100644 src/OpenSearch/Endpoints/Ml/DeleteModel.php create mode 100644 src/OpenSearch/Endpoints/Ml/DeleteModelGroup.php create mode 100644 src/OpenSearch/Endpoints/Ml/GetModelGroup.php create mode 100644 src/OpenSearch/Endpoints/Ml/GetTask.php create mode 100644 src/OpenSearch/Endpoints/Ml/RegisterModel.php create mode 100644 src/OpenSearch/Endpoints/Ml/RegisterModelGroup.php create mode 100644 src/OpenSearch/Endpoints/Ml/SearchModels.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/Security/Authinfo.php create mode 100644 src/OpenSearch/Endpoints/Security/Authtoken.php rename src/OpenSearch/Endpoints/Security/{GetAccount.php => Cache.php} (66%) create mode 100644 src/OpenSearch/Endpoints/Security/ConfigUpgradeCheck.php create mode 100644 src/OpenSearch/Endpoints/Security/ConfigUpgradePerform.php create mode 100644 src/OpenSearch/Endpoints/Security/CreateAllowlist.php create mode 100644 src/OpenSearch/Endpoints/Security/CreateUpdateTenancyConfig.php create mode 100644 src/OpenSearch/Endpoints/Security/CreateUserLegacy.php rename src/OpenSearch/Endpoints/Security/{UpdateDistinguishedNames.php => DeleteDistinguishedName.php} (52%) delete mode 100644 src/OpenSearch/Endpoints/Security/DeleteDistinguishedNames.php create mode 100644 src/OpenSearch/Endpoints/Security/DeleteUserLegacy.php create mode 100644 src/OpenSearch/Endpoints/Security/GenerateOboToken.php create mode 100644 src/OpenSearch/Endpoints/Security/GenerateUserToken.php create mode 100644 src/OpenSearch/Endpoints/Security/GenerateUserTokenLegacy.php create mode 100644 src/OpenSearch/Endpoints/Security/GetAccountDetails.php create mode 100644 src/OpenSearch/Endpoints/Security/GetActionGroup.php create mode 100644 src/OpenSearch/Endpoints/Security/GetAllowlist.php create mode 100644 src/OpenSearch/Endpoints/Security/GetAuditConfiguration.php rename src/OpenSearch/Endpoints/Security/{PatchConfig.php => GetConfiguration.php} (68%) create mode 100644 src/OpenSearch/Endpoints/Security/GetDashboardsInfo.php create mode 100644 src/OpenSearch/Endpoints/Security/GetDistinguishedName.php create mode 100644 src/OpenSearch/Endpoints/Security/GetPermissionsInfo.php create mode 100644 src/OpenSearch/Endpoints/Security/GetRole.php create mode 100644 src/OpenSearch/Endpoints/Security/GetRoleMapping.php create mode 100644 src/OpenSearch/Endpoints/Security/GetSslinfo.php create mode 100644 src/OpenSearch/Endpoints/Security/GetTenancyConfig.php create mode 100644 src/OpenSearch/Endpoints/Security/GetTenant.php create mode 100644 src/OpenSearch/Endpoints/Security/GetUser.php create mode 100644 src/OpenSearch/Endpoints/Security/GetUserLegacy.php create mode 100644 src/OpenSearch/Endpoints/Security/GetUsersLegacy.php create mode 100644 src/OpenSearch/Endpoints/Security/Migrate.php create mode 100644 src/OpenSearch/Endpoints/Security/PatchActionGroup.php create mode 100644 src/OpenSearch/Endpoints/Security/PatchAllowlist.php create mode 100644 src/OpenSearch/Endpoints/Security/PatchAuditConfiguration.php create mode 100644 src/OpenSearch/Endpoints/Security/PatchConfiguration.php create mode 100644 src/OpenSearch/Endpoints/Security/PatchDistinguishedName.php create mode 100644 src/OpenSearch/Endpoints/Security/PatchDistinguishedNames.php create mode 100644 src/OpenSearch/Endpoints/Security/PatchRole.php create mode 100644 src/OpenSearch/Endpoints/Security/PatchRoleMapping.php create mode 100644 src/OpenSearch/Endpoints/Security/PatchTenant.php create mode 100644 src/OpenSearch/Endpoints/Security/PatchUser.php create mode 100644 src/OpenSearch/Endpoints/Security/PostDashboardsInfo.php create mode 100644 src/OpenSearch/Endpoints/Security/ReloadHttpCertificates.php create mode 100644 src/OpenSearch/Endpoints/Security/ReloadTransportCertificates.php rename src/OpenSearch/Endpoints/Security/{GetConfig.php => TenantInfo.php} (65%) create mode 100644 src/OpenSearch/Endpoints/Security/UpdateAuditConfiguration.php create mode 100644 src/OpenSearch/Endpoints/Security/UpdateConfiguration.php create mode 100644 src/OpenSearch/Endpoints/Security/UpdateDistinguishedName.php create mode 100644 src/OpenSearch/Endpoints/Security/Validate.php rename src/OpenSearch/Endpoints/Security/{UpdateConfig.php => WhoAmI.php} (66%) create mode 100644 src/OpenSearch/Endpoints/Security/WhoAmIProtected.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/MlNamespace.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 diff --git a/src/OpenSearch/Client.php b/src/OpenSearch/Client.php index 4b5e02955..2cc7e74db 100644 --- a/src/OpenSearch/Client.php +++ b/src/OpenSearch/Client.php @@ -24,35 +24,40 @@ 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\MlNamespace; 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'; + public const VERSION = '2.3.0'; /** * @var Transport @@ -74,6 +79,11 @@ class Client */ protected $registeredNamespaces = []; + /** + * @var AsyncSearchNamespace + */ + protected $asyncSearch; + /** * @var CatNamespace */ @@ -89,6 +99,11 @@ class Client */ protected $danglingIndices; + /** + * @var DataFrameTransformDeprecatedNamespace + */ + protected $dataFrameTransformDeprecated; + /** * @var IndicesNamespace */ @@ -100,34 +115,49 @@ class Client protected $ingest; /** - * @var NodesNamespace + * @var KnnNamespace */ - protected $nodes; + protected $knn; /** - * @var SnapshotNamespace + * @var MachineLearningNamespace */ - protected $snapshot; + protected $machineLearning; /** - * @var TasksNamespace + * @var MlNamespace */ - protected $tasks; + protected $ml; /** - * @var AsyncSearchNamespace + * @var MonitoringNamespace */ - protected $asyncSearch; + protected $monitoring; /** - * @var DataFrameTransformDeprecatedNamespace + * @var NodesNamespace */ - protected $dataFrameTransformDeprecated; + protected $nodes; /** - * @var MonitoringNamespace + * @var NotificationsNamespace */ - protected $monitoring; + protected $notifications; + + /** + * @var RemoteStoreNamespace + */ + protected $remoteStore; + + /** + * @var RollupsNamespace + */ + protected $rollups; + + /** + * @var SearchPipelineNamespace + */ + protected $searchPipeline; /** * @var SearchableSnapshotsNamespace @@ -140,9 +170,9 @@ class Client protected $security; /** - * @var SslNamespace + * @var SnapshotNamespace */ - protected $ssl; + protected $snapshot; /** * @var SqlNamespace @@ -150,9 +180,20 @@ class Client protected $sql; /** - * @var MachineLearningNamespace + * @var SslNamespace */ - protected $ml; + protected $ssl; + + /** + * @var TasksNamespace + */ + protected $tasks; + + /** + * @var TransformsNamespace + */ + protected $transforms; + /** * Client constructor @@ -165,37 +206,51 @@ 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->machineLearning = new MachineLearningNamespace($transport, $endpoint); + $this->ml = new MlNamespace($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->ml = new MachineLearningNamespace($transport, $endpoint); + $this->ssl = new SslNamespace($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 +270,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 +297,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,15 +338,22 @@ 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 + * 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 @@ -299,16 +375,52 @@ public function create(array $params = []) 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) + * 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 createPit(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('CreatePit'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + + return $this->performRequest($endpoint); + } + /** + * 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 +439,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 +519,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 +544,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 +595,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 +635,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 +674,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 +716,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 +748,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 +785,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 +831,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 +851,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 +871,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 +907,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 +934,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 +968,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 +1003,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 +1037,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 +1069,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 +1108,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 +1131,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 +1164,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 +1195,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 +1227,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 +1252,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 +1279,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 +1303,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 +1332,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 +1405,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 +1435,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 +1475,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 +1516,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 +1558,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 +1619,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,111 +1644,181 @@ 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 createPointInTime(array $params = []) + { + return $this->createPit($params); + } + /** + * Proxy function to deletePointInTime() to prevent BC break. + * This API will be removed in a future version. Use 'deletePit' API instead. */ public function deletePointInTime(array $params = []) { - $body = $this->extractArgument($params, 'body'); - - $endpointBuilder = $this->endpoints; - $endpoint = $endpointBuilder('DeletePointInTime'); - $endpoint->setParams($params); - $endpoint->setBody($body); - - return $this->performRequest($endpoint); + return $this->deletePit($params); } /** - * $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 + * Returns the asyncSearch namespace */ - public function createPointInTime(array $params = []) + public function asyncSearch(): AsyncSearchNamespace { - $index = $this->extractArgument($params, 'index'); - - $endpointBuilder = $this->endpoints; - $endpoint = $endpointBuilder('CreatePointInTime'); - $endpoint->setParams($params); - $endpoint->setIndex($index); - - return $this->performRequest($endpoint); + 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 machineLearning namespace + */ + public function machineLearning(): MachineLearningNamespace { - return $this->snapshot; + return $this->machineLearning; } - public function tasks(): TasksNamespace + /** + * Returns the ml namespace + */ + public function ml(): MlNamespace { - return $this->tasks; + return $this->ml; } - public function asyncSearch(): AsyncSearchNamespace + /** + * Returns the monitoring namespace + */ + public function monitoring(): MonitoringNamespace { - return $this->asyncSearch; + return $this->monitoring; } - public function dataFrameTransformDeprecated(): DataFrameTransformDeprecatedNamespace + /** + * Returns the nodes namespace + */ + public function nodes(): NodesNamespace { - return $this->dataFrameTransformDeprecated; + return $this->nodes; } - public function monitoring(): MonitoringNamespace + /** + * Returns the notifications namespace + */ + public function notifications(): NotificationsNamespace { - return $this->monitoring; + return $this->notifications; } + /** + * Returns the remoteStore namespace + */ + public function remoteStore(): RemoteStoreNamespace + { + return $this->remoteStore; + } + /** + * Returns the rollups namespace + */ + public function rollups(): RollupsNamespace + { + 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; } - - public function ml(): MachineLearningNamespace + /** + * Returns the ssl namespace + */ + public function ssl(): SslNamespace { - return $this->ml; + 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; } /** @@ -1370,6 +1836,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 364e9d2a1..6376a6fb6 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 34045aa4c..cee786be3 100644 --- a/src/OpenSearch/Endpoints/Cat/Aliases.php +++ b/src/OpenSearch/Endpoints/Cat/Aliases.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Aliases extends AbstractEndpoint { protected $name; @@ -30,7 +33,6 @@ class Aliases extends AbstractEndpoint public function getURI(): string { $name = $this->name ?? null; - if (isset($name)) { return "/_cat/aliases/$name"; } @@ -40,13 +42,18 @@ public function getURI(): string public function getParamWhitelist(): array { return [ + 'expand_wildcards', 'format', - 'local', 'h', 'help', + 'local', 's', 'v', - 'expand_wildcards' + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/Cat/AllPitSegments.php b/src/OpenSearch/Endpoints/Cat/AllPitSegments.php new file mode 100644 index 000000000..0330e450a --- /dev/null +++ b/src/OpenSearch/Endpoints/Cat/AllPitSegments.php @@ -0,0 +1,51 @@ +node_id ?? null; - if (isset($node_id)) { return "/_cat/allocation/$node_id"; } @@ -40,15 +42,20 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'format', 'bytes', - 'local', - 'master_timeout', + 'cluster_manager_timeout', + 'format', 'h', 'help', + 'local', + 'master_timeout', 's', 'v', - 'cluster_manager_timeout' + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/Cat/ClusterManager.php b/src/OpenSearch/Endpoints/Cat/ClusterManager.php index 3a7c78960..cfcd3a234 100644 --- a/src/OpenSearch/Endpoints/Cat/ClusterManager.php +++ b/src/OpenSearch/Endpoints/Cat/ClusterManager.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class ClusterManager extends AbstractEndpoint { public function getURI(): string @@ -33,13 +36,19 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'format', - 'local', 'cluster_manager_timeout', + 'format', 'h', 'help', + 'local', + 'master_timeout', 's', - 'v' + 'v', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -47,4 +56,9 @@ public function getMethod(): string { return 'GET'; } + + protected function getParamDeprecation(): array + { + return ['master_timeout' => 'cluster_manager_timeout']; + } } diff --git a/src/OpenSearch/Endpoints/Cat/Count.php b/src/OpenSearch/Endpoints/Cat/Count.php index 0c13702ed..2922eab94 100644 --- a/src/OpenSearch/Endpoints/Cat/Count.php +++ b/src/OpenSearch/Endpoints/Cat/Count.php @@ -23,12 +23,14 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Count extends AbstractEndpoint { public function getURI(): string { $index = $this->index ?? null; - if (isset($index)) { return "/_cat/count/$index"; } @@ -42,7 +44,12 @@ public function getParamWhitelist(): array 'h', 'help', 's', - 'v' + 'v', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/Cat/Fielddata.php b/src/OpenSearch/Endpoints/Cat/Fielddata.php index c343dc0f2..dd48d1562 100644 --- a/src/OpenSearch/Endpoints/Cat/Fielddata.php +++ b/src/OpenSearch/Endpoints/Cat/Fielddata.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Fielddata extends AbstractEndpoint { protected $fields; @@ -30,7 +33,6 @@ class Fielddata extends AbstractEndpoint public function getURI(): string { $fields = $this->fields ?? null; - if (isset($fields)) { return "/_cat/fielddata/$fields"; } @@ -40,13 +42,18 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'format', 'bytes', + 'fields', + 'format', 'h', 'help', 's', 'v', - 'fields' + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/Cat/Health.php b/src/OpenSearch/Endpoints/Cat/Health.php index 83544880b..47cf0ca4f 100644 --- a/src/OpenSearch/Endpoints/Cat/Health.php +++ b/src/OpenSearch/Endpoints/Cat/Health.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Health extends AbstractEndpoint { public function getURI(): string @@ -39,7 +42,12 @@ public function getParamWhitelist(): array 's', 'time', 'ts', - 'v' + 'v', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/Cat/Help.php b/src/OpenSearch/Endpoints/Cat/Help.php index 3efbde38e..1b45a3592 100644 --- a/src/OpenSearch/Endpoints/Cat/Help.php +++ b/src/OpenSearch/Endpoints/Cat/Help.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Help extends AbstractEndpoint { public function getURI(): string @@ -33,8 +36,11 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'help', - 's' + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/Cat/Indices.php b/src/OpenSearch/Endpoints/Cat/Indices.php index 54936d524..47b885a1d 100644 --- a/src/OpenSearch/Endpoints/Cat/Indices.php +++ b/src/OpenSearch/Endpoints/Cat/Indices.php @@ -23,12 +23,14 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Indices extends AbstractEndpoint { public function getURI(): string { $index = $this->index ?? null; - if (isset($index)) { return "/_cat/indices/$index"; } @@ -38,20 +40,25 @@ 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', - 'cluster_manager_timeout' + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -59,6 +66,7 @@ public function getMethod(): string { return 'GET'; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Cat/Master.php b/src/OpenSearch/Endpoints/Cat/Master.php index 0231746c1..569613582 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 f1e4edc02..80ee6920f 100644 --- a/src/OpenSearch/Endpoints/Cat/NodeAttrs.php +++ b/src/OpenSearch/Endpoints/Cat/NodeAttrs.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class NodeAttrs extends AbstractEndpoint { public function getURI(): string @@ -33,14 +36,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' ]; } @@ -48,6 +56,7 @@ public function getMethod(): string { return 'GET'; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Cat/Nodes.php b/src/OpenSearch/Endpoints/Cat/Nodes.php index b46e99b77..fbcb24b47 100644 --- a/src/OpenSearch/Endpoints/Cat/Nodes.php +++ b/src/OpenSearch/Endpoints/Cat/Nodes.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Nodes extends AbstractEndpoint { public function getURI(): string @@ -34,16 +37,21 @@ public function getParamWhitelist(): array { return [ 'bytes', + 'cluster_manager_timeout', 'format', 'full_id', - 'local', - 'master_timeout', 'h', 'help', + 'local', + 'master_timeout', 's', 'time', '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/PendingTasks.php b/src/OpenSearch/Endpoints/Cat/PendingTasks.php index 0f62cc7c6..8d1f0fac9 100644 --- a/src/OpenSearch/Endpoints/Cat/PendingTasks.php +++ b/src/OpenSearch/Endpoints/Cat/PendingTasks.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class PendingTasks extends AbstractEndpoint { public function getURI(): string @@ -33,15 +36,20 @@ public function getURI(): string public function getParamWhitelist(): array { return [ + 'cluster_manager_timeout', 'format', - 'local', - 'master_timeout', 'h', 'help', + 'local', + 'master_timeout', 's', 'time', 'v', - 'cluster_manager_timeout' + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -49,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/Cat/PitSegments.php b/src/OpenSearch/Endpoints/Cat/PitSegments.php new file mode 100644 index 000000000..af9981b2d --- /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 86af20931..a58c76410 100644 --- a/src/OpenSearch/Endpoints/Cat/Plugins.php +++ b/src/OpenSearch/Endpoints/Cat/Plugins.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Plugins extends AbstractEndpoint { public function getURI(): string @@ -33,14 +36,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' ]; } @@ -48,6 +56,7 @@ public function getMethod(): string { return 'GET'; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Cat/Recovery.php b/src/OpenSearch/Endpoints/Cat/Recovery.php index b7a13ad4e..709f77a36 100644 --- a/src/OpenSearch/Endpoints/Cat/Recovery.php +++ b/src/OpenSearch/Endpoints/Cat/Recovery.php @@ -23,12 +23,14 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Recovery extends AbstractEndpoint { public function getURI(): string { $index = $this->index ?? null; - if (isset($index)) { return "/_cat/recovery/$index"; } @@ -38,16 +40,21 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'format', 'active_only', 'bytes', 'detailed', + 'format', 'h', 'help', 'index', 's', 'time', - 'v' + 'v', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/Cat/Repositories.php b/src/OpenSearch/Endpoints/Cat/Repositories.php index 555943fd9..d8b1ec103 100644 --- a/src/OpenSearch/Endpoints/Cat/Repositories.php +++ b/src/OpenSearch/Endpoints/Cat/Repositories.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Repositories extends AbstractEndpoint { public function getURI(): string @@ -33,14 +36,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' ]; } @@ -48,6 +56,7 @@ public function getMethod(): string { return 'GET'; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Cat/SegmentReplication.php b/src/OpenSearch/Endpoints/Cat/SegmentReplication.php new file mode 100644 index 000000000..7cb8c59db --- /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 eaf029b34..2eb07be80 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 86d447a15..4a140a384 100644 --- a/src/OpenSearch/Endpoints/Cat/Shards.php +++ b/src/OpenSearch/Endpoints/Cat/Shards.php @@ -23,12 +23,14 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Shards extends AbstractEndpoint { public function getURI(): string { $index = $this->index ?? null; - if (isset($index)) { return "/_cat/shards/$index"; } @@ -38,16 +40,21 @@ 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', - 'cluster_manager_timeout' + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -55,6 +62,7 @@ public function getMethod(): string { return 'GET'; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Cat/Snapshots.php b/src/OpenSearch/Endpoints/Cat/Snapshots.php index 45f33b557..03f0ae527 100644 --- a/src/OpenSearch/Endpoints/Cat/Snapshots.php +++ b/src/OpenSearch/Endpoints/Cat/Snapshots.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Snapshots extends AbstractEndpoint { protected $repository; @@ -30,7 +33,6 @@ class Snapshots extends AbstractEndpoint public function getURI(): string { $repository = $this->repository ?? null; - if (isset($repository)) { return "/_cat/snapshots/$repository"; } @@ -40,15 +42,20 @@ public function getURI(): string public function getParamWhitelist(): array { return [ + 'cluster_manager_timeout', 'format', - 'ignore_unavailable', - 'master_timeout', 'h', 'help', + 'ignore_unavailable', + 'master_timeout', 's', 'time', 'v', - 'cluster_manager_timeout' + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -69,6 +76,7 @@ public function setRepository($repository): Snapshots return $this; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Cat/Tasks.php b/src/OpenSearch/Endpoints/Cat/Tasks.php index c860ac0c3..86d94dc78 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 9bb0807da..8bf42aa9a 100644 --- a/src/OpenSearch/Endpoints/Cat/Templates.php +++ b/src/OpenSearch/Endpoints/Cat/Templates.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Templates extends AbstractEndpoint { protected $name; @@ -30,7 +33,6 @@ class Templates extends AbstractEndpoint public function getURI(): string { $name = $this->name ?? null; - if (isset($name)) { return "/_cat/templates/$name"; } @@ -40,14 +42,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' ]; } @@ -65,6 +72,7 @@ public function setName($name): Templates return $this; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Cat/ThreadPool.php b/src/OpenSearch/Endpoints/Cat/ThreadPool.php index fe24d4ee1..fcd168c97 100644 --- a/src/OpenSearch/Endpoints/Cat/ThreadPool.php +++ b/src/OpenSearch/Endpoints/Cat/ThreadPool.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class ThreadPool extends AbstractEndpoint { protected $thread_pool_patterns; @@ -30,7 +33,6 @@ class ThreadPool extends AbstractEndpoint public function getURI(): string { $thread_pool_patterns = $this->thread_pool_patterns ?? null; - if (isset($thread_pool_patterns)) { return "/_cat/thread_pool/$thread_pool_patterns"; } @@ -40,15 +42,20 @@ public function getURI(): string public function getParamWhitelist(): array { return [ + 'cluster_manager_timeout', 'format', - 'size', - 'local', - 'master_timeout', 'h', 'help', + 'local', + 'master_timeout', 's', + 'size', 'v', - 'cluster_manager_timeout' + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -69,6 +76,7 @@ public function setThreadPoolPatterns($thread_pool_patterns): ThreadPool return $this; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Cat/Transforms.php b/src/OpenSearch/Endpoints/Cat/Transforms.php deleted file mode 100644 index 0b2a7e3fb..000000000 --- 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 7a371d1eb..190e9be52 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 117bbe1da..0c0c89939 100644 --- a/src/OpenSearch/Endpoints/Cluster/AllocationExplain.php +++ b/src/OpenSearch/Endpoints/Cluster/AllocationExplain.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class AllocationExplain extends AbstractEndpoint { public function getURI(): string @@ -33,8 +36,13 @@ public function getURI(): string public function getParamWhitelist(): array { return [ + 'include_disk_info', 'include_yes_decisions', - 'include_disk_info' + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/Cluster/DeleteComponentTemplate.php b/src/OpenSearch/Endpoints/Cluster/DeleteComponentTemplate.php index e25194077..e8b16bdcd 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 000000000..3f17a926e --- /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 abaefabe8..5d495710e 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 000000000..66c250c5d --- /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 90ead9478..b5b66c36f 100644 --- a/src/OpenSearch/Endpoints/Cluster/GetSettings.php +++ b/src/OpenSearch/Endpoints/Cluster/GetSettings.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class GetSettings extends AbstractEndpoint { public function getURI(): string @@ -33,11 +36,16 @@ public function getURI(): string public function getParamWhitelist(): array { return [ + 'cluster_manager_timeout', 'flat_settings', + 'include_defaults', 'master_timeout', 'timeout', - 'include_defaults', - 'cluster_manager_timeout' + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -45,6 +53,7 @@ public function getMethod(): string { return 'GET'; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Cluster/GetWeightedRouting.php b/src/OpenSearch/Endpoints/Cluster/GetWeightedRouting.php new file mode 100644 index 000000000..0890735b6 --- /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 cfa4bf2fd..04d2bb8f9 100644 --- a/src/OpenSearch/Endpoints/Cluster/Health.php +++ b/src/OpenSearch/Endpoints/Cluster/Health.php @@ -23,12 +23,14 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Health extends AbstractEndpoint { public function getURI(): string { $index = $this->index ?? null; - if (isset($index)) { return "/_cluster/health/$index"; } @@ -38,18 +40,24 @@ public function getURI(): string public function getParamWhitelist(): array { return [ + 'awareness_attribute', + 'cluster_manager_timeout', 'expand_wildcards', 'level', 'local', 'master_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', - 'cluster_manager_timeout' + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -57,6 +65,7 @@ public function getMethod(): string { return 'GET'; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Cluster/PendingTasks.php b/src/OpenSearch/Endpoints/Cluster/PendingTasks.php index 2bf989812..de7f81c00 100644 --- a/src/OpenSearch/Endpoints/Cluster/PendingTasks.php +++ b/src/OpenSearch/Endpoints/Cluster/PendingTasks.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class PendingTasks extends AbstractEndpoint { public function getURI(): string @@ -33,9 +36,14 @@ public function getURI(): string public function getParamWhitelist(): array { return [ + 'cluster_manager_timeout', 'local', 'master_timeout', - 'cluster_manager_timeout' + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -43,6 +51,7 @@ public function getMethod(): string { return 'GET'; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Cluster/PostVotingConfigExclusions.php b/src/OpenSearch/Endpoints/Cluster/PostVotingConfigExclusions.php index c2243941a..9b5236622 100644 --- a/src/OpenSearch/Endpoints/Cluster/PostVotingConfigExclusions.php +++ b/src/OpenSearch/Endpoints/Cluster/PostVotingConfigExclusions.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class PostVotingConfigExclusions extends AbstractEndpoint { public function getURI(): string @@ -35,7 +38,12 @@ public function getParamWhitelist(): array return [ 'node_ids', 'node_names', - 'timeout' + 'timeout', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/Cluster/PutComponentTemplate.php b/src/OpenSearch/Endpoints/Cluster/PutComponentTemplate.php index dc9fb8629..c79a3db9a 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 000000000..c80fed513 --- /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 cc2ac482f..2a78a059e 100644 --- a/src/OpenSearch/Endpoints/Cluster/PutSettings.php +++ b/src/OpenSearch/Endpoints/Cluster/PutSettings.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class PutSettings extends AbstractEndpoint { public function getURI(): string @@ -33,10 +36,15 @@ public function getURI(): string public function getParamWhitelist(): array { return [ + 'cluster_manager_timeout', 'flat_settings', 'master_timeout', 'timeout', - 'cluster_manager_timeout' + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -54,6 +62,7 @@ public function setBody($body): PutSettings return $this; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Cluster/PutWeightedRouting.php b/src/OpenSearch/Endpoints/Cluster/PutWeightedRouting.php new file mode 100644 index 000000000..3a35b555d --- /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/RemoteInfo.php b/src/OpenSearch/Endpoints/Cluster/RemoteInfo.php index ced787df0..4341c4732 100644 --- a/src/OpenSearch/Endpoints/Cluster/RemoteInfo.php +++ b/src/OpenSearch/Endpoints/Cluster/RemoteInfo.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class RemoteInfo 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/Cluster/Reroute.php b/src/OpenSearch/Endpoints/Cluster/Reroute.php index 99d1a85c7..235e55154 100644 --- a/src/OpenSearch/Endpoints/Cluster/Reroute.php +++ b/src/OpenSearch/Endpoints/Cluster/Reroute.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Reroute extends AbstractEndpoint { public function getURI(): string @@ -33,13 +36,18 @@ public function getURI(): string public function getParamWhitelist(): array { return [ + 'cluster_manager_timeout', 'dry_run', 'explain', - 'retry_failed', - 'metric', 'master_timeout', + 'metric', + 'retry_failed', 'timeout', - 'cluster_manager_timeout' + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -57,6 +65,7 @@ public function setBody($body): Reroute return $this; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Cluster/State.php b/src/OpenSearch/Endpoints/Cluster/State.php index a682a9b27..a8b7f2ebc 100644 --- a/src/OpenSearch/Endpoints/Cluster/State.php +++ b/src/OpenSearch/Endpoints/Cluster/State.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class State extends AbstractEndpoint { protected $metric; @@ -31,7 +34,6 @@ public function getURI(): string { $metric = $this->metric ?? null; $index = $this->index ?? null; - if (isset($metric) && isset($index)) { return "/_cluster/state/$metric/$index"; } @@ -44,15 +46,20 @@ public function getURI(): string public function getParamWhitelist(): array { return [ + 'allow_no_indices', + 'cluster_manager_timeout', + 'expand_wildcards', + 'flat_settings', + 'ignore_unavailable', 'local', 'master_timeout', - 'flat_settings', 'wait_for_metadata_version', 'wait_for_timeout', - 'ignore_unavailable', - 'allow_no_indices', - 'expand_wildcards', - 'cluster_manager_timeout' + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -73,6 +80,7 @@ public function setMetric($metric): State return $this; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Cluster/Stats.php b/src/OpenSearch/Endpoints/Cluster/Stats.php index f48f0b9df..4236808ae 100644 --- a/src/OpenSearch/Endpoints/Cluster/Stats.php +++ b/src/OpenSearch/Endpoints/Cluster/Stats.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Stats extends AbstractEndpoint { protected $node_id; @@ -30,7 +33,6 @@ class Stats extends AbstractEndpoint public function getURI(): string { $node_id = $this->node_id ?? null; - if (isset($node_id)) { return "/_cluster/stats/nodes/$node_id"; } @@ -41,7 +43,12 @@ public function getParamWhitelist(): array { return [ 'flat_settings', - 'timeout' + 'timeout', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/Count.php b/src/OpenSearch/Endpoints/Count.php index ebb975a15..43abf6b74 100644 --- a/src/OpenSearch/Endpoints/Count.php +++ b/src/OpenSearch/Endpoints/Count.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Count extends AbstractEndpoint { public function getURI(): string @@ -37,20 +40,25 @@ 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', - 'terminate_after' + 'min_score', + 'preference', + 'q', + 'routing', + 'terminate_after', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/Create.php b/src/OpenSearch/Endpoints/Create.php index dbd7092aa..9fd7b60b9 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 000000000..5bebbb454 --- /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 531084fcd..000000000 --- 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 18cb8e397..bc1e1d8ad 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 75121767d..ca86f44d6 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 32dc180ed..c4edc3611 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 5fd926962..8ef0db8db 100644 --- a/src/OpenSearch/Endpoints/Delete.php +++ b/src/OpenSearch/Endpoints/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 { public function getURI(): string @@ -46,14 +49,19 @@ 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' + 'version_type', + 'wait_for_active_shards', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/DeleteAllPits.php b/src/OpenSearch/Endpoints/DeleteAllPits.php new file mode 100644 index 000000000..14360cfce --- /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 000000000..df9768d35 --- /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 5b963d709..000000000 --- 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 92c47ac6a..36d3bfd7c 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 c622c46e4..be7f3a4c6 100644 --- a/src/OpenSearch/Endpoints/Exists.php +++ b/src/OpenSearch/Endpoints/Exists.php @@ -24,6 +24,9 @@ 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 @@ -46,16 +49,21 @@ 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' + 'version_type', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/ExistsSource.php b/src/OpenSearch/Endpoints/ExistsSource.php index 538d17e02..7d2b9e7f1 100644 --- a/src/OpenSearch/Endpoints/ExistsSource.php +++ b/src/OpenSearch/Endpoints/ExistsSource.php @@ -24,6 +24,9 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class ExistsSource extends AbstractEndpoint { public function getURI(): string @@ -46,15 +49,20 @@ 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' + 'version_type', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/Explain.php b/src/OpenSearch/Endpoints/Explain.php index 06f45410e..cf5a6f1c2 100644 --- a/src/OpenSearch/Endpoints/Explain.php +++ b/src/OpenSearch/Endpoints/Explain.php @@ -24,6 +24,9 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Explain extends AbstractEndpoint { public function getURI(): string @@ -46,18 +49,23 @@ 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', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/FieldCaps.php b/src/OpenSearch/Endpoints/FieldCaps.php index c6855d07e..93cd37492 100644 --- a/src/OpenSearch/Endpoints/FieldCaps.php +++ b/src/OpenSearch/Endpoints/FieldCaps.php @@ -23,12 +23,14 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class FieldCaps extends AbstractEndpoint { public function getURI(): string { $index = $this->index ?? null; - if (isset($index)) { return "/$index/_field_caps"; } @@ -38,11 +40,16 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'fields', - 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', - 'include_unmapped' + 'fields', + 'ignore_unavailable', + 'include_unmapped', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/Get.php b/src/OpenSearch/Endpoints/Get.php index eb22b65e9..dce7661a2 100644 --- a/src/OpenSearch/Endpoints/Get.php +++ b/src/OpenSearch/Endpoints/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 { public function getURI(): string @@ -46,16 +49,21 @@ 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' + 'version_type', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/GetAllPits.php b/src/OpenSearch/Endpoints/GetAllPits.php new file mode 100644 index 000000000..6301d6746 --- /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/GetScriptContext.php b/src/OpenSearch/Endpoints/GetScriptContext.php index 5a1ce5459..325c5d320 100644 --- a/src/OpenSearch/Endpoints/GetScriptContext.php +++ b/src/OpenSearch/Endpoints/GetScriptContext.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class GetScriptContext 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/GetScriptLanguages.php b/src/OpenSearch/Endpoints/GetScriptLanguages.php index 9709b0bb0..bf4620d6f 100644 --- a/src/OpenSearch/Endpoints/GetScriptLanguages.php +++ b/src/OpenSearch/Endpoints/GetScriptLanguages.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class GetScriptLanguages 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/GetSource.php b/src/OpenSearch/Endpoints/GetSource.php index f1ab64da2..5ee7df939 100644 --- a/src/OpenSearch/Endpoints/GetSource.php +++ b/src/OpenSearch/Endpoints/GetSource.php @@ -24,6 +24,9 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class GetSource extends AbstractEndpoint { public function getURI(): string @@ -46,15 +49,20 @@ 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' + 'version_type', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/Index.php b/src/OpenSearch/Endpoints/Index.php index 5212d9d68..abeecc314 100644 --- a/src/OpenSearch/Endpoints/Index.php +++ b/src/OpenSearch/Endpoints/Index.php @@ -24,6 +24,9 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Index extends AbstractEndpoint { public function getURI(): string @@ -44,17 +47,22 @@ 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', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/Indices/AddBlock.php b/src/OpenSearch/Endpoints/Indices/AddBlock.php index b6d77d123..5c878c890 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/Analyze.php b/src/OpenSearch/Endpoints/Indices/Analyze.php index 1e5ee5620..845502ca7 100644 --- a/src/OpenSearch/Endpoints/Indices/Analyze.php +++ b/src/OpenSearch/Endpoints/Indices/Analyze.php @@ -23,12 +23,14 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Analyze extends AbstractEndpoint { public function getURI(): string { $index = $this->index ?? null; - if (isset($index)) { return "/$index/_analyze"; } @@ -38,7 +40,12 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'index' + 'index', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/Indices/ClearCache.php b/src/OpenSearch/Endpoints/Indices/ClearCache.php index ff0c01804..deafb1eb4 100644 --- a/src/OpenSearch/Endpoints/Indices/ClearCache.php +++ b/src/OpenSearch/Endpoints/Indices/ClearCache.php @@ -23,12 +23,14 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class ClearCache extends AbstractEndpoint { public function getURI(): string { $index = $this->index ?? null; - if (isset($index)) { return "/$index/_cache/clear"; } @@ -38,14 +40,19 @@ 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', - 'request' + 'query', + 'request', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/Indices/CloneIndices.php b/src/OpenSearch/Endpoints/Indices/CloneIndices.php index 52d620f78..ca94ac967 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 e7c59d4f2..a858965df 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 781ef5408..bf9e3d564 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 c3a9b0a34..0c74c24d0 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 a5a453f9b..fc3ee0399 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 78d610641..1b39192de 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 0157283a3..edce99b36 100644 --- a/src/OpenSearch/Endpoints/Indices/DeleteAlias.php +++ b/src/OpenSearch/Endpoints/Indices/DeleteAlias.php @@ -24,6 +24,9 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class DeleteAlias extends AbstractEndpoint { protected $name; @@ -42,16 +45,20 @@ public function getURI(): string ); } $name = $this->name; - return "/$index/_alias/$name"; } public function getParamWhitelist(): array { return [ - 'timeout', + 'cluster_manager_timeout', 'master_timeout', - 'cluster_manager_timeout' + 'timeout', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -72,6 +79,7 @@ public function setName($name): DeleteAlias return $this; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Indices/DeleteDataStream.php b/src/OpenSearch/Endpoints/Indices/DeleteDataStream.php index 16f9afd10..f266b1d81 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 068098fed..41f340d19 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 9acf28306..40f3c92ea 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 0ef5e6029..9d90b98f2 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 43d27b3e2..5b391dd17 100644 --- a/src/OpenSearch/Endpoints/Indices/ExistsAlias.php +++ b/src/OpenSearch/Endpoints/Indices/ExistsAlias.php @@ -24,6 +24,9 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class ExistsAlias extends AbstractEndpoint { protected $name; @@ -37,7 +40,6 @@ public function getURI(): string } $name = $this->name; $index = $this->index ?? null; - if (isset($index)) { return "/$index/_alias/$name"; } @@ -47,10 +49,15 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', - 'local' + 'ignore_unavailable', + 'local', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/Indices/ExistsIndexTemplate.php b/src/OpenSearch/Endpoints/Indices/ExistsIndexTemplate.php index 010c7226b..437baf77b 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 8b9ac82bf..023903145 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 e472e131f..b83d0112e 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 412d69570..19416ef2c 100644 --- a/src/OpenSearch/Endpoints/Indices/ForceMerge.php +++ b/src/OpenSearch/Endpoints/Indices/ForceMerge.php @@ -23,12 +23,14 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class ForceMerge extends AbstractEndpoint { public function getURI(): string { $index = $this->index ?? null; - if (isset($index)) { return "/$index/_forcemerge"; } @@ -38,12 +40,19 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'flush', - 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', + 'flush', + 'ignore_unavailable', 'max_num_segments', - 'only_expunge_deletes' + 'only_expunge_deletes', + 'primary_only', + 'wait_for_completion', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/Indices/Freeze.php b/src/OpenSearch/Endpoints/Indices/Freeze.php deleted file mode 100644 index d2dbd7c02..000000000 --- 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 5a1543ccf..fa1f85c6b 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 88261503c..1a2cdc76e 100644 --- a/src/OpenSearch/Endpoints/Indices/GetAlias.php +++ b/src/OpenSearch/Endpoints/Indices/GetAlias.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class GetAlias extends AbstractEndpoint { protected $name; @@ -31,7 +34,6 @@ public function getURI(): string { $name = $this->name ?? null; $index = $this->index ?? null; - if (isset($index) && isset($name)) { return "/$index/_alias/$name"; } @@ -47,10 +49,15 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', - 'local' + 'ignore_unavailable', + 'local', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/Indices/GetDataStream.php b/src/OpenSearch/Endpoints/Indices/GetDataStream.php index 8a3431482..0b34c6570 100644 --- a/src/OpenSearch/Endpoints/Indices/GetDataStream.php +++ b/src/OpenSearch/Endpoints/Indices/GetDataStream.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class GetDataStream extends AbstractEndpoint { protected $name; @@ -30,7 +33,6 @@ class GetDataStream extends AbstractEndpoint public function getURI(): string { $name = $this->name ?? null; - if (isset($name)) { return "/_data_stream/$name"; } @@ -40,7 +42,11 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/Indices/GetFieldMapping.php b/src/OpenSearch/Endpoints/Indices/GetFieldMapping.php index 8dc8e8b69..aa2db2de4 100644 --- a/src/OpenSearch/Endpoints/Indices/GetFieldMapping.php +++ b/src/OpenSearch/Endpoints/Indices/GetFieldMapping.php @@ -24,6 +24,9 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class GetFieldMapping extends AbstractEndpoint { protected $fields; @@ -46,11 +49,16 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'include_defaults', - 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', - 'local' + 'ignore_unavailable', + 'include_defaults', + 'local', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/Indices/GetIndexTemplate.php b/src/OpenSearch/Endpoints/Indices/GetIndexTemplate.php index 04d580481..84915edd1 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 748c153da..0641e8ed1 100644 --- a/src/OpenSearch/Endpoints/Indices/GetMapping.php +++ b/src/OpenSearch/Endpoints/Indices/GetMapping.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class GetMapping extends AbstractEndpoint { public function getURI(): string @@ -37,12 +40,17 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'ignore_unavailable', 'allow_no_indices', + 'cluster_manager_timeout', 'expand_wildcards', - 'master_timeout', + 'ignore_unavailable', 'local', - 'cluster_manager_timeout' + 'master_timeout', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -50,6 +58,7 @@ public function getMethod(): string { return 'GET'; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Indices/GetSettings.php b/src/OpenSearch/Endpoints/Indices/GetSettings.php index 9604cd65c..6f0aa1b50 100644 --- a/src/OpenSearch/Endpoints/Indices/GetSettings.php +++ b/src/OpenSearch/Endpoints/Indices/GetSettings.php @@ -23,15 +23,17 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class GetSettings extends AbstractEndpoint { protected $name; public function getURI(): string { - $index = $this->index ?? null; $name = $this->name ?? null; - + $index = $this->index ?? null; if (isset($index) && isset($name)) { return "/$index/_settings/$name"; } @@ -47,14 +49,19 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'master_timeout', - 'ignore_unavailable', 'allow_no_indices', + 'cluster_manager_timeout', 'expand_wildcards', 'flat_settings', - 'local', + 'ignore_unavailable', 'include_defaults', - 'cluster_manager_timeout' + 'local', + 'master_timeout', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -75,6 +82,7 @@ public function setName($name): GetSettings return $this; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Indices/GetTemplate.php b/src/OpenSearch/Endpoints/Indices/GetTemplate.php index 4cd500f6d..83568eb6b 100644 --- a/src/OpenSearch/Endpoints/Indices/GetTemplate.php +++ b/src/OpenSearch/Endpoints/Indices/GetTemplate.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class GetTemplate extends AbstractEndpoint { protected $name; @@ -30,7 +33,6 @@ class GetTemplate extends AbstractEndpoint public function getURI(): string { $name = $this->name ?? null; - if (isset($name)) { return "/_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): GetTemplate return $this; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Indices/GetUpgrade.php b/src/OpenSearch/Endpoints/Indices/GetUpgrade.php index ca4855b76..1fc57db59 100644 --- a/src/OpenSearch/Endpoints/Indices/GetUpgrade.php +++ b/src/OpenSearch/Endpoints/Indices/GetUpgrade.php @@ -23,12 +23,14 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class GetUpgrade extends AbstractEndpoint { public function getURI(): string { $index = $this->index ?? null; - if (isset($index)) { return "/$index/_upgrade"; } @@ -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/Open.php b/src/OpenSearch/Endpoints/Indices/Open.php index e627df62d..8b410b2cd 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 90e7cb4b8..a4d288520 100644 --- a/src/OpenSearch/Endpoints/Indices/PutAlias.php +++ b/src/OpenSearch/Endpoints/Indices/PutAlias.php @@ -24,6 +24,9 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class PutAlias extends AbstractEndpoint { protected $name; @@ -42,16 +45,20 @@ public function getURI(): string ); } $name = $this->name; - return "/$index/_alias/$name"; } public function getParamWhitelist(): array { return [ - 'timeout', + 'cluster_manager_timeout', 'master_timeout', - 'cluster_manager_timeout' + 'timeout', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -79,6 +86,7 @@ public function setName($name): PutAlias return $this; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Indices/PutIndexTemplate.php b/src/OpenSearch/Endpoints/Indices/PutIndexTemplate.php index b215ff099..527130297 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 d1a122407..fd10a8885 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 a0de5835a..332b2286e 100644 --- a/src/OpenSearch/Endpoints/Indices/PutSettings.php +++ b/src/OpenSearch/Endpoints/Indices/PutSettings.php @@ -23,12 +23,14 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class PutSettings extends AbstractEndpoint { public function getURI(): string { $index = $this->index ?? null; - if (isset($index)) { return "/$index/_settings"; } @@ -38,14 +40,19 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'master_timeout', - 'timeout', - 'preserve_existing', - 'ignore_unavailable', 'allow_no_indices', + 'cluster_manager_timeout', 'expand_wildcards', 'flat_settings', - 'cluster_manager_timeout' + 'ignore_unavailable', + 'master_timeout', + 'preserve_existing', + 'timeout', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -63,6 +70,7 @@ public function setBody($body): PutSettings return $this; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Indices/PutTemplate.php b/src/OpenSearch/Endpoints/Indices/PutTemplate.php index 26c7d14b8..90c581a39 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 9e5dcf9ee..7fd60c925 100644 --- a/src/OpenSearch/Endpoints/Indices/Recovery.php +++ b/src/OpenSearch/Endpoints/Indices/Recovery.php @@ -23,12 +23,14 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Recovery extends AbstractEndpoint { public function getURI(): string { $index = $this->index ?? null; - if (isset($index)) { return "/$index/_recovery"; } @@ -38,8 +40,13 @@ public function getURI(): string public function getParamWhitelist(): array { return [ + 'active_only', 'detailed', - 'active_only' + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/Indices/Refresh.php b/src/OpenSearch/Endpoints/Indices/Refresh.php index 14e7e1ea5..13bd3fac9 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/ResolveIndex.php b/src/OpenSearch/Endpoints/Indices/ResolveIndex.php index 204ecac79..c6d2fec0b 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 916842f5f..0f4ec259e 100644 --- a/src/OpenSearch/Endpoints/Indices/Rollover.php +++ b/src/OpenSearch/Endpoints/Indices/Rollover.php @@ -24,6 +24,9 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Rollover extends AbstractEndpoint { protected $alias; @@ -38,7 +41,6 @@ public function getURI(): string } $alias = $this->alias; $new_index = $this->new_index ?? null; - if (isset($new_index)) { return "/$alias/_rollover/$new_index"; } @@ -48,11 +50,16 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'timeout', + 'cluster_manager_timeout', 'dry_run', 'master_timeout', + 'timeout', 'wait_for_active_shards', - 'cluster_manager_timeout' + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -90,6 +97,7 @@ public function setNewIndex($new_index): Rollover return $this; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Indices/Segments.php b/src/OpenSearch/Endpoints/Indices/Segments.php index 1839a2094..1f81d605b 100644 --- a/src/OpenSearch/Endpoints/Indices/Segments.php +++ b/src/OpenSearch/Endpoints/Indices/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 "/$index/_segments"; } @@ -38,10 +40,15 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', - 'verbose' + 'ignore_unavailable', + 'verbose', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/Indices/ShardStores.php b/src/OpenSearch/Endpoints/Indices/ShardStores.php index 61e769864..97130e443 100644 --- a/src/OpenSearch/Endpoints/Indices/ShardStores.php +++ b/src/OpenSearch/Endpoints/Indices/ShardStores.php @@ -23,12 +23,14 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class ShardStores extends AbstractEndpoint { public function getURI(): string { $index = $this->index ?? null; - if (isset($index)) { return "/$index/_shard_stores"; } @@ -38,10 +40,15 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'status', - 'ignore_unavailable', 'allow_no_indices', - 'expand_wildcards' + 'expand_wildcards', + 'ignore_unavailable', + 'status', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/Indices/Shrink.php b/src/OpenSearch/Endpoints/Indices/Shrink.php index 26e833a74..8806b7e60 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 c2961c45c..cc987ae2f 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 f9834bac3..8aa2c0ffa 100644 --- a/src/OpenSearch/Endpoints/Indices/SimulateTemplate.php +++ b/src/OpenSearch/Endpoints/Indices/SimulateTemplate.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class SimulateTemplate extends AbstractEndpoint { protected $name; @@ -30,7 +33,6 @@ class SimulateTemplate extends AbstractEndpoint public function getURI(): string { $name = $this->name ?? null; - if (isset($name)) { return "/_index_template/_simulate/$name"; } @@ -40,10 +42,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' ]; } @@ -71,6 +78,7 @@ public function setName($name): SimulateTemplate return $this; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Indices/Split.php b/src/OpenSearch/Endpoints/Indices/Split.php index 500922afb..6559b8818 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 3a2525e30..86195e165 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 136864e12..000000000 --- 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 ff0d4ff46..fea7b223f 100644 --- a/src/OpenSearch/Endpoints/Indices/UpdateAliases.php +++ b/src/OpenSearch/Endpoints/Indices/UpdateAliases.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class UpdateAliases extends AbstractEndpoint { public function getURI(): string @@ -33,9 +36,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' ]; } @@ -53,6 +61,7 @@ public function setBody($body): UpdateAliases return $this; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Indices/Upgrade.php b/src/OpenSearch/Endpoints/Indices/Upgrade.php index e50baadcb..3d6ae2898 100644 --- a/src/OpenSearch/Endpoints/Indices/Upgrade.php +++ b/src/OpenSearch/Endpoints/Indices/Upgrade.php @@ -23,12 +23,14 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Upgrade extends AbstractEndpoint { public function getURI(): string { $index = $this->index ?? null; - if (isset($index)) { return "/$index/_upgrade"; } @@ -41,8 +43,13 @@ public function getParamWhitelist(): array 'allow_no_indices', 'expand_wildcards', 'ignore_unavailable', + 'only_ancient_segments', 'wait_for_completion', - 'only_ancient_segments' + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/Indices/ValidateQuery.php b/src/OpenSearch/Endpoints/Indices/ValidateQuery.php index 13a3fe82f..b6d6bda7d 100644 --- a/src/OpenSearch/Endpoints/Indices/ValidateQuery.php +++ b/src/OpenSearch/Endpoints/Indices/ValidateQuery.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class ValidateQuery extends AbstractEndpoint { public function getURI(): string @@ -37,18 +40,23 @@ 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', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/Info.php b/src/OpenSearch/Endpoints/Info.php index 4f6e5c403..91b529a2f 100644 --- a/src/OpenSearch/Endpoints/Info.php +++ b/src/OpenSearch/Endpoints/Info.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Info 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/Ingest/DeletePipeline.php b/src/OpenSearch/Endpoints/Ingest/DeletePipeline.php index 70324b58a..aacb475b7 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 590e26baf..49d7c0aaf 100644 --- a/src/OpenSearch/Endpoints/Ingest/GetPipeline.php +++ b/src/OpenSearch/Endpoints/Ingest/GetPipeline.php @@ -23,12 +23,14 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class GetPipeline extends AbstractEndpoint { public function getURI(): string { $id = $this->id ?? null; - if (isset($id)) { return "/_ingest/pipeline/$id"; } @@ -38,7 +40,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' ]; } @@ -46,6 +54,7 @@ public function getMethod(): string { return 'GET'; } + protected function getParamDeprecation(): array { return ['master_timeout' => 'cluster_manager_timeout']; diff --git a/src/OpenSearch/Endpoints/Ingest/ProcessorGrok.php b/src/OpenSearch/Endpoints/Ingest/ProcessorGrok.php index 375566e88..1d9329ff3 100644 --- a/src/OpenSearch/Endpoints/Ingest/ProcessorGrok.php +++ b/src/OpenSearch/Endpoints/Ingest/ProcessorGrok.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class ProcessorGrok 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/Ingest/PutPipeline.php b/src/OpenSearch/Endpoints/Ingest/PutPipeline.php index 38767ce22..9205cbc42 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/Ingest/Simulate.php b/src/OpenSearch/Endpoints/Ingest/Simulate.php index e2d36d4cf..afc876231 100644 --- a/src/OpenSearch/Endpoints/Ingest/Simulate.php +++ b/src/OpenSearch/Endpoints/Ingest/Simulate.php @@ -23,12 +23,14 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Simulate extends AbstractEndpoint { public function getURI(): string { $id = $this->id ?? null; - if (isset($id)) { return "/_ingest/pipeline/$id/_simulate"; } @@ -38,7 +40,12 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'verbose' + 'verbose', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/Knn/DeleteModel.php b/src/OpenSearch/Endpoints/Knn/DeleteModel.php new file mode 100644 index 000000000..e4afbc057 --- /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 000000000..c8d2e927b --- /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 000000000..23e988cd4 --- /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 000000000..a5fac1964 --- /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 000000000..19b8d8074 --- /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 000000000..7251ae6bd --- /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 bea73ca8a..11afa11e9 100644 --- a/src/OpenSearch/Endpoints/MTermVectors.php +++ b/src/OpenSearch/Endpoints/MTermVectors.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class MTermVectors extends AbstractEndpoint { public function getURI(): string @@ -37,18 +40,23 @@ 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' + 'version_type', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/MachineLearning/Models/RegisterModel.php b/src/OpenSearch/Endpoints/MachineLearning/Models/RegisterModel.php deleted file mode 100644 index aa9c11058..000000000 --- a/src/OpenSearch/Endpoints/MachineLearning/Models/RegisterModel.php +++ /dev/null @@ -1,43 +0,0 @@ -model_id ?? null; + if (isset($model_id)) { + return "/_plugins/_ml/models/$model_id"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.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/Ml/DeleteModelGroup.php b/src/OpenSearch/Endpoints/Ml/DeleteModelGroup.php new file mode 100644 index 000000000..da6af1c74 --- /dev/null +++ b/src/OpenSearch/Endpoints/Ml/DeleteModelGroup.php @@ -0,0 +1,62 @@ +model_group_id ?? null; + if (isset($model_group_id)) { + return "/_plugins/_ml/model_groups/$model_group_id"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.delete_model_group'); + } + + public function getParamWhitelist(): array + { + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setModelGroupId($model_group_id): DeleteModelGroup + { + if (isset($model_group_id) !== true) { + return $this; + } + $this->model_group_id = $model_group_id; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Ml/GetModelGroup.php b/src/OpenSearch/Endpoints/Ml/GetModelGroup.php new file mode 100644 index 000000000..f061ea6c6 --- /dev/null +++ b/src/OpenSearch/Endpoints/Ml/GetModelGroup.php @@ -0,0 +1,62 @@ +model_group_id ?? null; + if (isset($model_group_id)) { + return "/_plugins/_ml/model_groups/$model_group_id"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.get_model_group'); + } + + public function getParamWhitelist(): array + { + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setModelGroupId($model_group_id): GetModelGroup + { + if (isset($model_group_id) !== true) { + return $this; + } + $this->model_group_id = $model_group_id; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Ml/GetTask.php b/src/OpenSearch/Endpoints/Ml/GetTask.php new file mode 100644 index 000000000..43ed4c700 --- /dev/null +++ b/src/OpenSearch/Endpoints/Ml/GetTask.php @@ -0,0 +1,62 @@ +task_id ?? null; + if (isset($task_id)) { + return "/_plugins/_ml/tasks/$task_id"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.get_task'); + } + + public function getParamWhitelist(): array + { + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setTaskId($task_id): GetTask + { + if (isset($task_id) !== true) { + return $this; + } + $this->task_id = $task_id; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Ml/RegisterModel.php b/src/OpenSearch/Endpoints/Ml/RegisterModel.php new file mode 100644 index 000000000..698659c96 --- /dev/null +++ b/src/OpenSearch/Endpoints/Ml/RegisterModel.php @@ -0,0 +1,55 @@ +body = $body; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Ml/RegisterModelGroup.php b/src/OpenSearch/Endpoints/Ml/RegisterModelGroup.php new file mode 100644 index 000000000..046581e8c --- /dev/null +++ b/src/OpenSearch/Endpoints/Ml/RegisterModelGroup.php @@ -0,0 +1,55 @@ +body = $body; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Ml/SearchModels.php b/src/OpenSearch/Endpoints/Ml/SearchModels.php new file mode 100644 index 000000000..a6874ac1f --- /dev/null +++ b/src/OpenSearch/Endpoints/Ml/SearchModels.php @@ -0,0 +1,55 @@ +body = $body; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Msearch.php b/src/OpenSearch/Endpoints/Msearch.php index 753b66086..e2a5fb6e1 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 0ef260525..560c62d8f 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 ef8d8cb69..ab4e0a976 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/Info.php b/src/OpenSearch/Endpoints/Nodes/Info.php index e851fbf8c..4d8cca2c5 100644 --- a/src/OpenSearch/Endpoints/Nodes/Info.php +++ b/src/OpenSearch/Endpoints/Nodes/Info.php @@ -23,16 +23,18 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Info extends AbstractEndpoint { - protected $node_id; protected $metric; + protected $node_id; public function getURI(): string { - $node_id = $this->node_id ?? null; $metric = $this->metric ?? null; - + $node_id = $this->node_id ?? null; if (isset($node_id) && isset($metric)) { return "/_nodes/$node_id/$metric"; } @@ -49,7 +51,12 @@ public function getParamWhitelist(): array { return [ 'flat_settings', - 'timeout' + 'timeout', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } @@ -58,28 +65,28 @@ public function getMethod(): string return 'GET'; } - public function setNodeId($node_id): Info + public function setMetric($metric): Info { - if (isset($node_id) !== true) { + if (isset($metric) !== true) { return $this; } - if (is_array($node_id) === true) { - $node_id = implode(",", $node_id); + if (is_array($metric) === true) { + $metric = implode(",", $metric); } - $this->node_id = $node_id; + $this->metric = $metric; return $this; } - public function setMetric($metric): Info + public function setNodeId($node_id): Info { - if (isset($metric) !== true) { + if (isset($node_id) !== true) { return $this; } - if (is_array($metric) === true) { - $metric = implode(",", $metric); + if (is_array($node_id) === true) { + $node_id = implode(",", $node_id); } - $this->metric = $metric; + $this->node_id = $node_id; return $this; } diff --git a/src/OpenSearch/Endpoints/Nodes/ReloadSecureSettings.php b/src/OpenSearch/Endpoints/Nodes/ReloadSecureSettings.php index 81043492d..f858252db 100644 --- a/src/OpenSearch/Endpoints/Nodes/ReloadSecureSettings.php +++ b/src/OpenSearch/Endpoints/Nodes/ReloadSecureSettings.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class ReloadSecureSettings extends AbstractEndpoint { protected $node_id; @@ -30,7 +33,6 @@ class ReloadSecureSettings extends AbstractEndpoint public function getURI(): string { $node_id = $this->node_id ?? null; - if (isset($node_id)) { return "/_nodes/$node_id/reload_secure_settings"; } @@ -40,7 +42,12 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'timeout' + '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 96e7dab82..1758d29f8 100644 --- a/src/OpenSearch/Endpoints/Nodes/Stats.php +++ b/src/OpenSearch/Endpoints/Nodes/Stats.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Stats extends AbstractEndpoint { protected $node_id; @@ -34,7 +37,6 @@ public function getURI(): string $node_id = $this->node_id ?? null; $metric = $this->metric ?? null; $index_metric = $this->index_metric ?? null; - if (isset($node_id) && isset($metric) && isset($index_metric)) { return "/_nodes/$node_id/stats/$metric/$index_metric"; } @@ -60,10 +62,15 @@ public function getParamWhitelist(): array 'fielddata_fields', 'fields', 'groups', + 'include_segment_file_sizes', 'level', - 'types', 'timeout', - 'include_segment_file_sizes' + 'types', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/Nodes/Usage.php b/src/OpenSearch/Endpoints/Nodes/Usage.php index 9c05b80d8..3693c5918 100644 --- a/src/OpenSearch/Endpoints/Nodes/Usage.php +++ b/src/OpenSearch/Endpoints/Nodes/Usage.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Usage extends AbstractEndpoint { protected $node_id; @@ -32,7 +35,6 @@ public function getURI(): string { $node_id = $this->node_id ?? null; $metric = $this->metric ?? null; - if (isset($node_id) && isset($metric)) { return "/_nodes/$node_id/usage/$metric"; } @@ -48,7 +50,12 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'timeout' + 'timeout', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/Notifications/CreateConfig.php b/src/OpenSearch/Endpoints/Notifications/CreateConfig.php new file mode 100644 index 000000000..72ddf5931 --- /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 000000000..afe39ff2e --- /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 000000000..5227e2dba --- /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 000000000..34ac9b418 --- /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 000000000..f0d9864c7 --- /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 000000000..d493a5c78 --- /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/Ping.php b/src/OpenSearch/Endpoints/Ping.php index fa5210115..5f74fdb00 100644 --- a/src/OpenSearch/Endpoints/Ping.php +++ b/src/OpenSearch/Endpoints/Ping.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Ping 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/PutScript.php b/src/OpenSearch/Endpoints/PutScript.php index 3b705f963..cc779271c 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 31bb95781..ee92c79f0 100644 --- a/src/OpenSearch/Endpoints/RankEval.php +++ b/src/OpenSearch/Endpoints/RankEval.php @@ -23,12 +23,14 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class RankEval extends AbstractEndpoint { public function getURI(): string { $index = $this->index ?? null; - if (isset($index)) { return "/$index/_rank_eval"; } @@ -38,10 +40,15 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', - 'search_type' + 'ignore_unavailable', + 'search_type', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/Reindex.php b/src/OpenSearch/Endpoints/Reindex.php index 00700b0d0..8aacbcda6 100644 --- a/src/OpenSearch/Endpoints/Reindex.php +++ b/src/OpenSearch/Endpoints/Reindex.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Reindex extends AbstractEndpoint { public function getURI(): string @@ -33,14 +36,19 @@ 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', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/ReindexRethrottle.php b/src/OpenSearch/Endpoints/ReindexRethrottle.php index d99cba036..50d7bc457 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 000000000..d1c4630fc --- /dev/null +++ b/src/OpenSearch/Endpoints/RemoteStore/Restore.php @@ -0,0 +1,57 @@ +body = $body; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/RenderSearchTemplate.php b/src/OpenSearch/Endpoints/RenderSearchTemplate.php index 7f97d4c7f..80bea800e 100644 --- a/src/OpenSearch/Endpoints/RenderSearchTemplate.php +++ b/src/OpenSearch/Endpoints/RenderSearchTemplate.php @@ -23,12 +23,14 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class RenderSearchTemplate extends AbstractEndpoint { public function getURI(): string { $id = $this->id ?? null; - if (isset($id)) { return "/_render/template/$id"; } @@ -37,7 +39,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/Rollups/Delete.php b/src/OpenSearch/Endpoints/Rollups/Delete.php new file mode 100644 index 000000000..1e439bd68 --- /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 000000000..f3b4e567b --- /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 000000000..ecdf22b5c --- /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 000000000..6aa63aaf8 --- /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 000000000..cd10a70c1 --- /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 000000000..cce54a0cb --- /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/ScriptsPainlessExecute.php b/src/OpenSearch/Endpoints/ScriptsPainlessExecute.php index 898de3e6b..5a6b8b71d 100644 --- a/src/OpenSearch/Endpoints/ScriptsPainlessExecute.php +++ b/src/OpenSearch/Endpoints/ScriptsPainlessExecute.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class ScriptsPainlessExecute 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/Scroll.php b/src/OpenSearch/Endpoints/Scroll.php index b9d216f2b..907a555dc 100644 --- a/src/OpenSearch/Endpoints/Scroll.php +++ b/src/OpenSearch/Endpoints/Scroll.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Scroll extends AbstractEndpoint { protected $scroll_id; @@ -43,9 +46,14 @@ 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', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/Search.php b/src/OpenSearch/Endpoints/Search.php index fc1e7a363..0bbdf51cf 100644 --- a/src/OpenSearch/Endpoints/Search.php +++ b/src/OpenSearch/Endpoints/Search.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Search extends AbstractEndpoint { public function getURI(): string @@ -37,48 +40,57 @@ 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' + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/SearchPipeline/Delete.php b/src/OpenSearch/Endpoints/SearchPipeline/Delete.php new file mode 100644 index 000000000..f0a9927f7 --- /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 000000000..b2bc62bc6 --- /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 000000000..c194a59d4 --- /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 963f415f2..4d7d3161b 100644 --- a/src/OpenSearch/Endpoints/SearchShards.php +++ b/src/OpenSearch/Endpoints/SearchShards.php @@ -23,12 +23,14 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class SearchShards extends AbstractEndpoint { public function getURI(): string { $index = $this->index ?? null; - if (isset($index)) { return "/$index/_search_shards"; } @@ -38,12 +40,17 @@ public function getURI(): string public function getParamWhitelist(): array { return [ + 'allow_no_indices', + 'expand_wildcards', + 'ignore_unavailable', + 'local', 'preference', 'routing', - 'local', - 'ignore_unavailable', - 'allow_no_indices', - 'expand_wildcards' + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/SearchTemplate.php b/src/OpenSearch/Endpoints/SearchTemplate.php index 466cf2a93..f297b183c 100644 --- a/src/OpenSearch/Endpoints/SearchTemplate.php +++ b/src/OpenSearch/Endpoints/SearchTemplate.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class SearchTemplate extends AbstractEndpoint { public function getURI(): string @@ -37,19 +40,24 @@ 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', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/Security/Authinfo.php b/src/OpenSearch/Endpoints/Security/Authinfo.php new file mode 100644 index 000000000..617b53c7b --- /dev/null +++ b/src/OpenSearch/Endpoints/Security/Authinfo.php @@ -0,0 +1,47 @@ +body = $body; + + return $this; } } diff --git a/src/OpenSearch/Endpoints/Security/ConfigUpgradeCheck.php b/src/OpenSearch/Endpoints/Security/ConfigUpgradeCheck.php new file mode 100644 index 000000000..7f105c3d1 --- /dev/null +++ b/src/OpenSearch/Endpoints/Security/ConfigUpgradeCheck.php @@ -0,0 +1,45 @@ +body = $body; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Security/CreateActionGroup.php b/src/OpenSearch/Endpoints/Security/CreateActionGroup.php index 1b3c32562..22424f366 100644 --- a/src/OpenSearch/Endpoints/Security/CreateActionGroup.php +++ b/src/OpenSearch/Endpoints/Security/CreateActionGroup.php @@ -18,40 +18,55 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class CreateActionGroup extends AbstractEndpoint { - /** - * @var string|null - */ protected $action_group; + public function getURI(): string + { + if (isset($this->action_group) !== true) { + throw new RuntimeException( + 'action_group is required for create_action_group' + ); + } + $action_group = $this->action_group; + return "/_plugins/_security/api/actiongroups/$action_group"; + } + public function getParamWhitelist(): array { return [ - 'allowed_actions' + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } - public function getURI(): string + public function getMethod(): string { - if (!isset($this->action_group)) { - throw new RuntimeException('Missing parameter for the endpoint security.create_action_group'); - } - - return "/_plugins/_security/api/actiongroups/$this->action_group"; + return 'PUT'; } - public function getMethod(): string + public function setBody($body): CreateActionGroup { - return 'PUT'; + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; } - /** - * @param string|null $action_group - * @return CreateActionGroup - */ - public function setActionGroup(?string $action_group): CreateActionGroup + public function setActionGroup($action_group): CreateActionGroup { + if (isset($action_group) !== true) { + return $this; + } $this->action_group = $action_group; return $this; diff --git a/src/OpenSearch/Endpoints/Security/CreateAllowlist.php b/src/OpenSearch/Endpoints/Security/CreateAllowlist.php new file mode 100644 index 000000000..7562eb98d --- /dev/null +++ b/src/OpenSearch/Endpoints/Security/CreateAllowlist.php @@ -0,0 +1,55 @@ +body = $body; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Security/CreateRole.php b/src/OpenSearch/Endpoints/Security/CreateRole.php index b53a94e15..7402b3e95 100644 --- a/src/OpenSearch/Endpoints/Security/CreateRole.php +++ b/src/OpenSearch/Endpoints/Security/CreateRole.php @@ -18,43 +18,57 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class CreateRole extends AbstractEndpoint { - /** - * @var string|null - */ protected $role; + public function getURI(): string + { + if (isset($this->role) !== true) { + throw new RuntimeException( + 'role is required for create_role' + ); + } + $role = $this->role; + return "/_plugins/_security/api/roles/$role"; + } + public function getParamWhitelist(): array { return [ - 'cluster_permissions', - 'index_permissions', - 'tenant_permissions', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } - public function getURI(): string + public function getMethod(): string { - if (!isset($this->role)) { - throw new RuntimeException('Missing parameter for the endpoint security.create_role'); - } - - return "/_plugins/_security/api/roles/$this->role"; + return 'PUT'; } - public function getMethod(): string + public function setBody($body): CreateRole { - return 'PUT'; + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; } - /** - * @param string|null $role - * @return CreateRole - */ - public function setRole(?string $role): CreateRole + public function setRole($role): CreateRole { + if (isset($role) !== true) { + return $this; + } $this->role = $role; + return $this; } } diff --git a/src/OpenSearch/Endpoints/Security/CreateRoleMapping.php b/src/OpenSearch/Endpoints/Security/CreateRoleMapping.php index a138d6d1d..6fcd61b92 100644 --- a/src/OpenSearch/Endpoints/Security/CreateRoleMapping.php +++ b/src/OpenSearch/Endpoints/Security/CreateRoleMapping.php @@ -18,43 +18,57 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class CreateRoleMapping extends AbstractEndpoint { - /** - * @var string|null - */ protected $role; + public function getURI(): string + { + if (isset($this->role) !== true) { + throw new RuntimeException( + 'role is required for create_role_mapping' + ); + } + $role = $this->role; + return "/_plugins/_security/api/rolesmapping/$role"; + } + public function getParamWhitelist(): array { return [ - 'backend_roles', - 'hosts', - 'users', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } - public function getURI(): string + public function getMethod(): string { - if (!isset($this->role)) { - throw new RuntimeException('Missing parameter for the endpoint security.create_role_mapping'); - } - - return "/_plugins/_security/api/rolesmapping/$this->role"; + return 'PUT'; } - public function getMethod(): string + public function setBody($body): CreateRoleMapping { - return 'PUT'; + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; } - /** - * @param string|null $role - * @return CreateRoleMapping - */ - public function setRole(?string $role): CreateRoleMapping + public function setRole($role): CreateRoleMapping { + if (isset($role) !== true) { + return $this; + } $this->role = $role; + return $this; } } diff --git a/src/OpenSearch/Endpoints/Security/CreateTenant.php b/src/OpenSearch/Endpoints/Security/CreateTenant.php index 99da6088b..54ce0ee09 100644 --- a/src/OpenSearch/Endpoints/Security/CreateTenant.php +++ b/src/OpenSearch/Endpoints/Security/CreateTenant.php @@ -18,25 +18,33 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class CreateTenant extends AbstractEndpoint { - /** - * @var string|null - */ protected $tenant; - public function getParamWhitelist(): array - { - return ['description']; - } - public function getURI(): string { - if (!isset($this->tenant)) { - throw new RuntimeException('Missing parameter for the endpoint security.create_tenant'); + if (isset($this->tenant) !== true) { + throw new RuntimeException( + 'tenant is required for create_tenant' + ); } + $tenant = $this->tenant; + return "/_plugins/_security/api/tenants/$tenant"; + } - return "/_plugins/_security/api/tenants/$this->tenant"; + public function getParamWhitelist(): array + { + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; } public function getMethod(): string @@ -44,13 +52,23 @@ public function getMethod(): string return 'PUT'; } - /** - * @param string|null $tenant - * @return CreateTenant - */ - public function setTenant(?string $tenant): CreateTenant + public function setBody($body): CreateTenant { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setTenant($tenant): CreateTenant + { + if (isset($tenant) !== true) { + return $this; + } $this->tenant = $tenant; + return $this; } } diff --git a/src/OpenSearch/Endpoints/Security/CreateUpdateTenancyConfig.php b/src/OpenSearch/Endpoints/Security/CreateUpdateTenancyConfig.php new file mode 100644 index 000000000..3d60632f4 --- /dev/null +++ b/src/OpenSearch/Endpoints/Security/CreateUpdateTenancyConfig.php @@ -0,0 +1,55 @@ +body = $body; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Security/CreateUser.php b/src/OpenSearch/Endpoints/Security/CreateUser.php index d6990bc13..b69347047 100644 --- a/src/OpenSearch/Endpoints/Security/CreateUser.php +++ b/src/OpenSearch/Endpoints/Security/CreateUser.php @@ -18,44 +18,57 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class CreateUser extends AbstractEndpoint { - /** - * @var string|null - */ protected $username; + public function getURI(): string + { + if (isset($this->username) !== true) { + throw new RuntimeException( + 'username is required for create_user' + ); + } + $username = $this->username; + return "/_plugins/_security/api/internalusers/$username"; + } + public function getParamWhitelist(): array { return [ - 'password', - 'opendistro_security_roles', - 'backend_roles', - 'attributes', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } - public function getURI(): string + public function getMethod(): string { - if (!isset($this->username)) { - throw new RuntimeException('Missing parameter for the endpoint security.create_user'); - } - - return "/_plugins/_security/api/internalusers/$this->username"; + return 'PUT'; } - public function getMethod(): string + public function setBody($body): CreateUser { - return 'PUT'; + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; } - /** - * @param string|null $username - * @return CreateUser - */ - public function setUsername(?string $username): CreateUser + public function setUsername($username): CreateUser { + if (isset($username) !== true) { + return $this; + } $this->username = $username; + return $this; } } diff --git a/src/OpenSearch/Endpoints/Security/CreateUserLegacy.php b/src/OpenSearch/Endpoints/Security/CreateUserLegacy.php new file mode 100644 index 000000000..e3f5ea21e --- /dev/null +++ b/src/OpenSearch/Endpoints/Security/CreateUserLegacy.php @@ -0,0 +1,74 @@ +username) !== true) { + throw new RuntimeException( + 'username is required for create_user_legacy' + ); + } + $username = $this->username; + return "/_plugins/_security/api/user/$username"; + } + + public function getParamWhitelist(): array + { + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): CreateUserLegacy + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setUsername($username): CreateUserLegacy + { + if (isset($username) !== true) { + return $this; + } + $this->username = $username; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Security/DeleteActionGroup.php b/src/OpenSearch/Endpoints/Security/DeleteActionGroup.php index 412901f5e..4257f964c 100644 --- a/src/OpenSearch/Endpoints/Security/DeleteActionGroup.php +++ b/src/OpenSearch/Endpoints/Security/DeleteActionGroup.php @@ -18,25 +18,33 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class DeleteActionGroup extends AbstractEndpoint { - /** - * @var string|null - */ protected $action_group; - public function getParamWhitelist(): array - { - return []; - } - public function getURI(): string { - if (!isset($this->action_group)) { - throw new RuntimeException('Missing parameter for the endpoint security.delete_action_group'); + if (isset($this->action_group) !== true) { + throw new RuntimeException( + 'action_group is required for delete_action_group' + ); } + $action_group = $this->action_group; + return "/_plugins/_security/api/actiongroups/$action_group"; + } - return "/_plugins/_security/api/actiongroups/$this->action_group"; + public function getParamWhitelist(): array + { + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; } public function getMethod(): string @@ -44,13 +52,13 @@ public function getMethod(): string return 'DELETE'; } - /** - * @param string|null $action_group - * @return DeleteActionGroup - */ - public function setActionGroup(?string $action_group): DeleteActionGroup + public function setActionGroup($action_group): DeleteActionGroup { + if (isset($action_group) !== true) { + return $this; + } $this->action_group = $action_group; + return $this; } } diff --git a/src/OpenSearch/Endpoints/Security/UpdateDistinguishedNames.php b/src/OpenSearch/Endpoints/Security/DeleteDistinguishedName.php similarity index 52% rename from src/OpenSearch/Endpoints/Security/UpdateDistinguishedNames.php rename to src/OpenSearch/Endpoints/Security/DeleteDistinguishedName.php index bbcaabba8..8e8920729 100644 --- a/src/OpenSearch/Endpoints/Security/UpdateDistinguishedNames.php +++ b/src/OpenSearch/Endpoints/Security/DeleteDistinguishedName.php @@ -18,41 +18,47 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; -class UpdateDistinguishedNames extends AbstractEndpoint +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ +class DeleteDistinguishedName extends AbstractEndpoint { - /** - * @var string|null - */ protected $cluster_name; - public function getParamWhitelist(): array - { - return [ - 'nodes_dn', - ]; - } - public function getURI(): string { - if (!isset($this->cluster_name)) { - throw new RuntimeException('Missing parameter for the endpoint security.update_distinguished_names'); + if (isset($this->cluster_name) !== true) { + throw new RuntimeException( + 'cluster_name is required for delete_distinguished_name' + ); } + $cluster_name = $this->cluster_name; + return "/_plugins/_security/api/nodesdn/$cluster_name"; + } - return "/_plugins/_security/api/nodesdn/{$this->cluster_name}"; + public function getParamWhitelist(): array + { + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; } public function getMethod(): string { - return 'PUT'; + return 'DELETE'; } - /** - * @param string|null $cluster_name - * @return UpdateDistinguishedNames - */ - public function setClusterName(?string $cluster_name): UpdateDistinguishedNames + public function setClusterName($cluster_name): DeleteDistinguishedName { + if (isset($cluster_name) !== true) { + return $this; + } $this->cluster_name = $cluster_name; + return $this; } } diff --git a/src/OpenSearch/Endpoints/Security/DeleteDistinguishedNames.php b/src/OpenSearch/Endpoints/Security/DeleteDistinguishedNames.php deleted file mode 100644 index 38bc2a2d0..000000000 --- a/src/OpenSearch/Endpoints/Security/DeleteDistinguishedNames.php +++ /dev/null @@ -1,56 +0,0 @@ -cluster_name)) { - throw new RuntimeException('Missing parameter for the endpoint security.delete_distinguished_names'); - } - - return "/_plugins/_security/api/nodesdn/$this->cluster_name"; - } - - public function getMethod(): string - { - return 'DELETE'; - } - - /** - * @param string|null $cluster_name - * @return DeleteDistinguishedNames - */ - public function setClusterName(?string $cluster_name): DeleteDistinguishedNames - { - $this->cluster_name = $cluster_name; - return $this; - } -} diff --git a/src/OpenSearch/Endpoints/Security/DeleteRole.php b/src/OpenSearch/Endpoints/Security/DeleteRole.php index 6d1824bb6..cea84504d 100644 --- a/src/OpenSearch/Endpoints/Security/DeleteRole.php +++ b/src/OpenSearch/Endpoints/Security/DeleteRole.php @@ -18,25 +18,33 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class DeleteRole extends AbstractEndpoint { - /** - * @var string|null - */ protected $role; - public function getParamWhitelist(): array - { - return []; - } - public function getURI(): string { - if (!isset($this->role)) { - throw new RuntimeException('Missing parameter for the endpoint security.delete_role'); + if (isset($this->role) !== true) { + throw new RuntimeException( + 'role is required for delete_role' + ); } + $role = $this->role; + return "/_plugins/_security/api/roles/$role"; + } - return "/_plugins/_security/api/roles/$this->role"; + public function getParamWhitelist(): array + { + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; } public function getMethod(): string @@ -44,13 +52,13 @@ public function getMethod(): string return 'DELETE'; } - /** - * @param string|null $role - * @return DeleteRole - */ - public function setRole(?string $role): DeleteRole + public function setRole($role): DeleteRole { + if (isset($role) !== true) { + return $this; + } $this->role = $role; + return $this; } } diff --git a/src/OpenSearch/Endpoints/Security/DeleteRoleMapping.php b/src/OpenSearch/Endpoints/Security/DeleteRoleMapping.php index 81d237c48..d1ec1f134 100644 --- a/src/OpenSearch/Endpoints/Security/DeleteRoleMapping.php +++ b/src/OpenSearch/Endpoints/Security/DeleteRoleMapping.php @@ -18,25 +18,33 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class DeleteRoleMapping extends AbstractEndpoint { - /** - * @var string|null - */ protected $role; - public function getParamWhitelist(): array - { - return []; - } - public function getURI(): string { - if (!isset($this->role)) { - throw new RuntimeException('Missing parameter for the endpoint security.delete_role_mapping'); + if (isset($this->role) !== true) { + throw new RuntimeException( + 'role is required for delete_role_mapping' + ); } + $role = $this->role; + return "/_plugins/_security/api/rolesmapping/$role"; + } - return "/_plugins/_security/api/rolesmapping/$this->role"; + public function getParamWhitelist(): array + { + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; } public function getMethod(): string @@ -44,13 +52,13 @@ public function getMethod(): string return 'DELETE'; } - /** - * @param string|null $role - * @return DeleteRoleMapping - */ - public function setRole(?string $role): DeleteRoleMapping + public function setRole($role): DeleteRoleMapping { + if (isset($role) !== true) { + return $this; + } $this->role = $role; + return $this; } } diff --git a/src/OpenSearch/Endpoints/Security/DeleteTenant.php b/src/OpenSearch/Endpoints/Security/DeleteTenant.php index 81b3b9495..be3a5d840 100644 --- a/src/OpenSearch/Endpoints/Security/DeleteTenant.php +++ b/src/OpenSearch/Endpoints/Security/DeleteTenant.php @@ -18,25 +18,33 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class DeleteTenant extends AbstractEndpoint { - /** - * @var string|null - */ protected $tenant; - public function getParamWhitelist(): array - { - return []; - } - public function getURI(): string { - if (!isset($this->tenant)) { - throw new RuntimeException('Missing parameter for the endpoint security.delete_tenant'); + if (isset($this->tenant) !== true) { + throw new RuntimeException( + 'tenant is required for delete_tenant' + ); } + $tenant = $this->tenant; + return "/_plugins/_security/api/tenants/$tenant"; + } - return "/_plugins/_security/api/tenants/$this->tenant"; + public function getParamWhitelist(): array + { + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; } public function getMethod(): string @@ -44,13 +52,13 @@ public function getMethod(): string return 'DELETE'; } - /** - * @param string|null $tenant - * @return DeleteTenant - */ - public function setTenant(?string $tenant): DeleteTenant + public function setTenant($tenant): DeleteTenant { + if (isset($tenant) !== true) { + return $this; + } $this->tenant = $tenant; + return $this; } } diff --git a/src/OpenSearch/Endpoints/Security/DeleteUser.php b/src/OpenSearch/Endpoints/Security/DeleteUser.php index b5b6580d9..639dc4a99 100644 --- a/src/OpenSearch/Endpoints/Security/DeleteUser.php +++ b/src/OpenSearch/Endpoints/Security/DeleteUser.php @@ -18,25 +18,33 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class DeleteUser extends AbstractEndpoint { - /** - * @var string|null - */ protected $username; - public function getParamWhitelist(): array - { - return []; - } - public function getURI(): string { - if (!isset($this->username)) { - throw new RuntimeException('Missing parameter for the endpoint security.delete_user'); + if (isset($this->username) !== true) { + throw new RuntimeException( + 'username is required for delete_user' + ); } + $username = $this->username; + return "/_plugins/_security/api/internalusers/$username"; + } - return "/_plugins/_security/api/internalusers/$this->username"; + public function getParamWhitelist(): array + { + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; } public function getMethod(): string @@ -44,13 +52,13 @@ public function getMethod(): string return 'DELETE'; } - /** - * @param string|null $username - * @return DeleteUser - */ - public function setUsername(?string $username): DeleteUser + public function setUsername($username): DeleteUser { + if (isset($username) !== true) { + return $this; + } $this->username = $username; + return $this; } } diff --git a/src/OpenSearch/Endpoints/Security/DeleteUserLegacy.php b/src/OpenSearch/Endpoints/Security/DeleteUserLegacy.php new file mode 100644 index 000000000..590494f46 --- /dev/null +++ b/src/OpenSearch/Endpoints/Security/DeleteUserLegacy.php @@ -0,0 +1,64 @@ +username) !== true) { + throw new RuntimeException( + 'username is required for delete_user_legacy' + ); + } + $username = $this->username; + return "/_plugins/_security/api/user/$username"; + } + + public function getParamWhitelist(): array + { + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setUsername($username): DeleteUserLegacy + { + if (isset($username) !== true) { + return $this; + } + $this->username = $username; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Security/FlushCache.php b/src/OpenSearch/Endpoints/Security/FlushCache.php index 834d082e5..b1ad5705e 100644 --- a/src/OpenSearch/Endpoints/Security/FlushCache.php +++ b/src/OpenSearch/Endpoints/Security/FlushCache.php @@ -17,16 +17,25 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class FlushCache extends AbstractEndpoint { - public function getParamWhitelist(): array + public function getURI(): string { - return []; + return "/_plugins/_security/api/cache"; } - public function getURI(): string + public function getParamWhitelist(): array { - return "/_plugins/_security/api/cache"; + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; } public function getMethod(): string diff --git a/src/OpenSearch/Endpoints/Security/GenerateOboToken.php b/src/OpenSearch/Endpoints/Security/GenerateOboToken.php new file mode 100644 index 000000000..d9855ae2b --- /dev/null +++ b/src/OpenSearch/Endpoints/Security/GenerateOboToken.php @@ -0,0 +1,55 @@ +body = $body; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Security/GenerateUserToken.php b/src/OpenSearch/Endpoints/Security/GenerateUserToken.php new file mode 100644 index 000000000..476d259df --- /dev/null +++ b/src/OpenSearch/Endpoints/Security/GenerateUserToken.php @@ -0,0 +1,64 @@ +username) !== true) { + throw new RuntimeException( + 'username is required for generate_user_token' + ); + } + $username = $this->username; + return "/_plugins/_security/api/internalusers/$username/authtoken"; + } + + public function getParamWhitelist(): array + { + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setUsername($username): GenerateUserToken + { + if (isset($username) !== true) { + return $this; + } + $this->username = $username; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Security/GenerateUserTokenLegacy.php b/src/OpenSearch/Endpoints/Security/GenerateUserTokenLegacy.php new file mode 100644 index 000000000..b62ecc6e8 --- /dev/null +++ b/src/OpenSearch/Endpoints/Security/GenerateUserTokenLegacy.php @@ -0,0 +1,64 @@ +username) !== true) { + throw new RuntimeException( + 'username is required for generate_user_token_legacy' + ); + } + $username = $this->username; + return "/_plugins/_security/api/user/$username/authtoken"; + } + + public function getParamWhitelist(): array + { + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setUsername($username): GenerateUserTokenLegacy + { + if (isset($username) !== true) { + return $this; + } + $this->username = $username; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Security/GetAccountDetails.php b/src/OpenSearch/Endpoints/Security/GetAccountDetails.php new file mode 100644 index 000000000..4deb6f174 --- /dev/null +++ b/src/OpenSearch/Endpoints/Security/GetAccountDetails.php @@ -0,0 +1,45 @@ +action_group) !== true) { + throw new RuntimeException( + 'action_group is required for get_action_group' + ); + } + $action_group = $this->action_group; + return "/_plugins/_security/api/actiongroups/$action_group"; + } + + public function getParamWhitelist(): array + { + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setActionGroup($action_group): GetActionGroup + { + if (isset($action_group) !== true) { + return $this; + } + $this->action_group = $action_group; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Security/GetActionGroups.php b/src/OpenSearch/Endpoints/Security/GetActionGroups.php index e1fc67d56..9249fc6df 100644 --- a/src/OpenSearch/Endpoints/Security/GetActionGroups.php +++ b/src/OpenSearch/Endpoints/Security/GetActionGroups.php @@ -17,35 +17,29 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class GetActionGroups extends AbstractEndpoint { - /** - * @var string|null - */ - protected $action_group; - - public function getParamWhitelist(): array + public function getURI(): string { - return []; + return "/_plugins/_security/api/actiongroups"; } - public function getURI(): string + public function getParamWhitelist(): array { - return '/_plugins/_security/api/actiongroups' . ($this->action_group ? "/{$this->action_group}" : ''); + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; } public function getMethod(): string { return 'GET'; } - - /** - * @param string|null $action_group - * @return GetActionGroups - */ - public function setActionGroup(?string $action_group): GetActionGroups - { - $this->action_group = $action_group; - return $this; - } } diff --git a/src/OpenSearch/Endpoints/Security/GetAllowlist.php b/src/OpenSearch/Endpoints/Security/GetAllowlist.php new file mode 100644 index 000000000..a2c5532e7 --- /dev/null +++ b/src/OpenSearch/Endpoints/Security/GetAllowlist.php @@ -0,0 +1,45 @@ +cluster_name) !== true) { + throw new RuntimeException( + 'cluster_name is required for get_distinguished_name' + ); + } + $cluster_name = $this->cluster_name; + return "/_plugins/_security/api/nodesdn/$cluster_name"; + } + + public function getParamWhitelist(): array + { + return [ + 'show_all', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setClusterName($cluster_name): GetDistinguishedName + { + if (isset($cluster_name) !== true) { + return $this; + } + $this->cluster_name = $cluster_name; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Security/GetDistinguishedNames.php b/src/OpenSearch/Endpoints/Security/GetDistinguishedNames.php index cb009649b..1ce83583a 100644 --- a/src/OpenSearch/Endpoints/Security/GetDistinguishedNames.php +++ b/src/OpenSearch/Endpoints/Security/GetDistinguishedNames.php @@ -17,35 +17,30 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class GetDistinguishedNames extends AbstractEndpoint { - /** - * @var string|null - */ - protected $cluster_name; - - public function getParamWhitelist(): array + public function getURI(): string { - return []; + return "/_plugins/_security/api/nodesdn"; } - public function getURI(): string + public function getParamWhitelist(): array { - return '/_plugins/_security/api/nodesdn' . ($this->cluster_name ? "/{$this->cluster_name}" : ''); + return [ + 'show_all', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; } public function getMethod(): string { return 'GET'; } - - /** - * @param string|null $cluster_name - * @return GetDistinguishedNames - */ - public function setClusterName(?string $cluster_name): GetDistinguishedNames - { - $this->cluster_name = $cluster_name; - return $this; - } } diff --git a/src/OpenSearch/Endpoints/Security/GetPermissionsInfo.php b/src/OpenSearch/Endpoints/Security/GetPermissionsInfo.php new file mode 100644 index 000000000..3be1a3bba --- /dev/null +++ b/src/OpenSearch/Endpoints/Security/GetPermissionsInfo.php @@ -0,0 +1,45 @@ +role) !== true) { + throw new RuntimeException( + 'role is required for get_role' + ); + } + $role = $this->role; + return "/_plugins/_security/api/roles/$role"; + } + + public function getParamWhitelist(): array + { + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setRole($role): GetRole + { + if (isset($role) !== true) { + return $this; + } + $this->role = $role; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Security/GetRoleMapping.php b/src/OpenSearch/Endpoints/Security/GetRoleMapping.php new file mode 100644 index 000000000..34656ac79 --- /dev/null +++ b/src/OpenSearch/Endpoints/Security/GetRoleMapping.php @@ -0,0 +1,64 @@ +role) !== true) { + throw new RuntimeException( + 'role is required for get_role_mapping' + ); + } + $role = $this->role; + return "/_plugins/_security/api/rolesmapping/$role"; + } + + public function getParamWhitelist(): array + { + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setRole($role): GetRoleMapping + { + if (isset($role) !== true) { + return $this; + } + $this->role = $role; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Security/GetRoleMappings.php b/src/OpenSearch/Endpoints/Security/GetRoleMappings.php index a260ec995..82ebfbfd2 100644 --- a/src/OpenSearch/Endpoints/Security/GetRoleMappings.php +++ b/src/OpenSearch/Endpoints/Security/GetRoleMappings.php @@ -17,35 +17,29 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class GetRoleMappings extends AbstractEndpoint { - /** - * @var string|null - */ - protected $role; - - public function getParamWhitelist(): array + public function getURI(): string { - return []; + return "/_plugins/_security/api/rolesmapping"; } - public function getURI(): string + public function getParamWhitelist(): array { - return '/_plugins/_security/api/rolesmapping' . ($this->role ? "/{$this->role}" : ''); + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; } public function getMethod(): string { return 'GET'; } - - /** - * @param string|null $role - * @return GetRoleMappings - */ - public function setRole(?string $role): GetRoleMappings - { - $this->role = $role; - return $this; - } } diff --git a/src/OpenSearch/Endpoints/Security/GetRoles.php b/src/OpenSearch/Endpoints/Security/GetRoles.php index 3ad4acce1..580daac95 100644 --- a/src/OpenSearch/Endpoints/Security/GetRoles.php +++ b/src/OpenSearch/Endpoints/Security/GetRoles.php @@ -17,35 +17,29 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class GetRoles extends AbstractEndpoint { - /** - * @var string|null - */ - protected $role; - - public function getParamWhitelist(): array + public function getURI(): string { - return []; + return "/_plugins/_security/api/roles"; } - public function getURI(): string + public function getParamWhitelist(): array { - return '/_plugins/_security/api/roles' . ($this->role ? "/{$this->role}" : ''); + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; } public function getMethod(): string { return 'GET'; } - - /** - * @param string|null $role - * @return GetRoles - */ - public function setRole(?string $role): GetRoles - { - $this->role = $role; - return $this; - } } diff --git a/src/OpenSearch/Endpoints/Security/GetSslinfo.php b/src/OpenSearch/Endpoints/Security/GetSslinfo.php new file mode 100644 index 000000000..7b52bca65 --- /dev/null +++ b/src/OpenSearch/Endpoints/Security/GetSslinfo.php @@ -0,0 +1,46 @@ +tenant) !== true) { + throw new RuntimeException( + 'tenant is required for get_tenant' + ); + } + $tenant = $this->tenant; + return "/_plugins/_security/api/tenants/$tenant"; + } + + public function getParamWhitelist(): array + { + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setTenant($tenant): GetTenant + { + if (isset($tenant) !== true) { + return $this; + } + $this->tenant = $tenant; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Security/GetTenants.php b/src/OpenSearch/Endpoints/Security/GetTenants.php index 9a2487978..f7c9daf85 100644 --- a/src/OpenSearch/Endpoints/Security/GetTenants.php +++ b/src/OpenSearch/Endpoints/Security/GetTenants.php @@ -17,35 +17,29 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class GetTenants extends AbstractEndpoint { - /** - * @var string|null - */ - protected $tenant; - - public function getParamWhitelist(): array + public function getURI(): string { - return []; + return "/_plugins/_security/api/tenants"; } - public function getURI(): string + public function getParamWhitelist(): array { - return '/_plugins/_security/api/tenants' . ($this->tenant ? "/{$this->tenant}" : ''); + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; } public function getMethod(): string { return 'GET'; } - - /** - * @param string|null $tenant - * @return GetTenants - */ - public function setTenant(?string $tenant): GetTenants - { - $this->tenant = $tenant; - return $this; - } } diff --git a/src/OpenSearch/Endpoints/Security/GetUser.php b/src/OpenSearch/Endpoints/Security/GetUser.php new file mode 100644 index 000000000..71616462f --- /dev/null +++ b/src/OpenSearch/Endpoints/Security/GetUser.php @@ -0,0 +1,64 @@ +username) !== true) { + throw new RuntimeException( + 'username is required for get_user' + ); + } + $username = $this->username; + return "/_plugins/_security/api/internalusers/$username"; + } + + public function getParamWhitelist(): array + { + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setUsername($username): GetUser + { + if (isset($username) !== true) { + return $this; + } + $this->username = $username; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Security/GetUserLegacy.php b/src/OpenSearch/Endpoints/Security/GetUserLegacy.php new file mode 100644 index 000000000..285bb3535 --- /dev/null +++ b/src/OpenSearch/Endpoints/Security/GetUserLegacy.php @@ -0,0 +1,64 @@ +username) !== true) { + throw new RuntimeException( + 'username is required for get_user_legacy' + ); + } + $username = $this->username; + return "/_plugins/_security/api/user/$username"; + } + + public function getParamWhitelist(): array + { + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setUsername($username): GetUserLegacy + { + if (isset($username) !== true) { + return $this; + } + $this->username = $username; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Security/GetUsers.php b/src/OpenSearch/Endpoints/Security/GetUsers.php index a3d64269e..abd54cfe2 100644 --- a/src/OpenSearch/Endpoints/Security/GetUsers.php +++ b/src/OpenSearch/Endpoints/Security/GetUsers.php @@ -17,35 +17,29 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class GetUsers extends AbstractEndpoint { - /** - * @var string|null - */ - protected $username; - - public function getParamWhitelist(): array + public function getURI(): string { - return []; + return "/_plugins/_security/api/internalusers"; } - public function getURI(): string + public function getParamWhitelist(): array { - return '/_plugins/_security/api/internalusers' . ($this->username ? "/{$this->username}" : ''); + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; } public function getMethod(): string { return 'GET'; } - - /** - * @param string|null $username - * @return GetUsers - */ - public function setUsername(?string $username): GetUsers - { - $this->username = $username; - return $this; - } } diff --git a/src/OpenSearch/Endpoints/Security/GetUsersLegacy.php b/src/OpenSearch/Endpoints/Security/GetUsersLegacy.php new file mode 100644 index 000000000..e426be497 --- /dev/null +++ b/src/OpenSearch/Endpoints/Security/GetUsersLegacy.php @@ -0,0 +1,45 @@ +action_group) !== true) { + throw new RuntimeException( + 'action_group is required for patch_action_group' + ); + } + $action_group = $this->action_group; + return "/_plugins/_security/api/actiongroups/$action_group"; + } + + public function getParamWhitelist(): array + { + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; + } + + public function getMethod(): string + { + return 'PATCH'; + } + + public function setBody($body): PatchActionGroup + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setActionGroup($action_group): PatchActionGroup + { + if (isset($action_group) !== true) { + return $this; + } + $this->action_group = $action_group; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Security/PatchActionGroups.php b/src/OpenSearch/Endpoints/Security/PatchActionGroups.php index e7a03033a..1934ff7bb 100644 --- a/src/OpenSearch/Endpoints/Security/PatchActionGroups.php +++ b/src/OpenSearch/Endpoints/Security/PatchActionGroups.php @@ -17,21 +17,25 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class PatchActionGroups extends AbstractEndpoint { - /** - * @var string|null - */ - protected $action_group; - - public function getParamWhitelist(): array + public function getURI(): string { - return []; + return "/_plugins/_security/api/actiongroups"; } - public function getURI(): string + public function getParamWhitelist(): array { - return '/_plugins/_security/api/actiongroups' . ($this->action_group ? "/{$this->action_group}" : ''); + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; } public function getMethod(): string @@ -39,13 +43,13 @@ public function getMethod(): string return 'PATCH'; } - /** - * @param string|null $action_group - * @return PatchActionGroups - */ - public function setActionGroup(?string $action_group): PatchActionGroups + public function setBody($body): PatchActionGroups { - $this->action_group = $action_group; + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + return $this; } } diff --git a/src/OpenSearch/Endpoints/Security/PatchAllowlist.php b/src/OpenSearch/Endpoints/Security/PatchAllowlist.php new file mode 100644 index 000000000..1bf9c04fb --- /dev/null +++ b/src/OpenSearch/Endpoints/Security/PatchAllowlist.php @@ -0,0 +1,55 @@ +body = $body; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Security/PatchAuditConfiguration.php b/src/OpenSearch/Endpoints/Security/PatchAuditConfiguration.php new file mode 100644 index 000000000..b20b9d438 --- /dev/null +++ b/src/OpenSearch/Endpoints/Security/PatchAuditConfiguration.php @@ -0,0 +1,55 @@ +body = $body; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Security/PatchConfiguration.php b/src/OpenSearch/Endpoints/Security/PatchConfiguration.php new file mode 100644 index 000000000..a1ab9a697 --- /dev/null +++ b/src/OpenSearch/Endpoints/Security/PatchConfiguration.php @@ -0,0 +1,55 @@ +body = $body; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Security/PatchDistinguishedName.php b/src/OpenSearch/Endpoints/Security/PatchDistinguishedName.php new file mode 100644 index 000000000..2a25baab0 --- /dev/null +++ b/src/OpenSearch/Endpoints/Security/PatchDistinguishedName.php @@ -0,0 +1,74 @@ +cluster_name) !== true) { + throw new RuntimeException( + 'cluster_name is required for patch_distinguished_name' + ); + } + $cluster_name = $this->cluster_name; + return "/_plugins/_security/api/nodesdn/$cluster_name"; + } + + public function getParamWhitelist(): array + { + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; + } + + public function getMethod(): string + { + return 'PATCH'; + } + + public function setBody($body): PatchDistinguishedName + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setClusterName($cluster_name): PatchDistinguishedName + { + if (isset($cluster_name) !== true) { + return $this; + } + $this->cluster_name = $cluster_name; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Security/PatchDistinguishedNames.php b/src/OpenSearch/Endpoints/Security/PatchDistinguishedNames.php new file mode 100644 index 000000000..26e488a3c --- /dev/null +++ b/src/OpenSearch/Endpoints/Security/PatchDistinguishedNames.php @@ -0,0 +1,55 @@ +body = $body; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Security/PatchRole.php b/src/OpenSearch/Endpoints/Security/PatchRole.php new file mode 100644 index 000000000..5d285ec3a --- /dev/null +++ b/src/OpenSearch/Endpoints/Security/PatchRole.php @@ -0,0 +1,74 @@ +role) !== true) { + throw new RuntimeException( + 'role is required for patch_role' + ); + } + $role = $this->role; + return "/_plugins/_security/api/roles/$role"; + } + + public function getParamWhitelist(): array + { + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; + } + + public function getMethod(): string + { + return 'PATCH'; + } + + public function setBody($body): PatchRole + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setRole($role): PatchRole + { + if (isset($role) !== true) { + return $this; + } + $this->role = $role; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Security/PatchRoleMapping.php b/src/OpenSearch/Endpoints/Security/PatchRoleMapping.php new file mode 100644 index 000000000..f1e9bf4f5 --- /dev/null +++ b/src/OpenSearch/Endpoints/Security/PatchRoleMapping.php @@ -0,0 +1,74 @@ +role) !== true) { + throw new RuntimeException( + 'role is required for patch_role_mapping' + ); + } + $role = $this->role; + return "/_plugins/_security/api/rolesmapping/$role"; + } + + public function getParamWhitelist(): array + { + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; + } + + public function getMethod(): string + { + return 'PATCH'; + } + + public function setBody($body): PatchRoleMapping + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setRole($role): PatchRoleMapping + { + if (isset($role) !== true) { + return $this; + } + $this->role = $role; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Security/PatchRoleMappings.php b/src/OpenSearch/Endpoints/Security/PatchRoleMappings.php index 843359e5c..0282e9135 100644 --- a/src/OpenSearch/Endpoints/Security/PatchRoleMappings.php +++ b/src/OpenSearch/Endpoints/Security/PatchRoleMappings.php @@ -17,21 +17,25 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class PatchRoleMappings extends AbstractEndpoint { - /** - * @var string|null - */ - protected $role; - - public function getParamWhitelist(): array + public function getURI(): string { - return []; + return "/_plugins/_security/api/rolesmapping"; } - public function getURI(): string + public function getParamWhitelist(): array { - return '/_plugins/_security/api/rolesmapping' . ($this->role ? "/{$this->role}" : ''); + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; } public function getMethod(): string @@ -39,13 +43,13 @@ public function getMethod(): string return 'PATCH'; } - /** - * @param string|null $role - * @return PatchRoleMappings - */ - public function setRole(?string $role): PatchRoleMappings + public function setBody($body): PatchRoleMappings { - $this->role = $role; + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + return $this; } } diff --git a/src/OpenSearch/Endpoints/Security/PatchRoles.php b/src/OpenSearch/Endpoints/Security/PatchRoles.php index a9b40a1ae..66c129624 100644 --- a/src/OpenSearch/Endpoints/Security/PatchRoles.php +++ b/src/OpenSearch/Endpoints/Security/PatchRoles.php @@ -17,21 +17,25 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class PatchRoles extends AbstractEndpoint { - /** - * @var string|null - */ - protected $role; - - public function getParamWhitelist(): array + public function getURI(): string { - return []; + return "/_plugins/_security/api/roles"; } - public function getURI(): string + public function getParamWhitelist(): array { - return '/_plugins/_security/api/roles' . ($this->role ? "/{$this->role}" : ''); + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; } public function getMethod(): string @@ -39,13 +43,13 @@ public function getMethod(): string return 'PATCH'; } - /** - * @param string|null $role - * @return PatchRoles - */ - public function setRole(?string $role): PatchRoles + public function setBody($body): PatchRoles { - $this->role = $role; + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + return $this; } } diff --git a/src/OpenSearch/Endpoints/Security/PatchTenant.php b/src/OpenSearch/Endpoints/Security/PatchTenant.php new file mode 100644 index 000000000..b7efa65d6 --- /dev/null +++ b/src/OpenSearch/Endpoints/Security/PatchTenant.php @@ -0,0 +1,74 @@ +tenant) !== true) { + throw new RuntimeException( + 'tenant is required for patch_tenant' + ); + } + $tenant = $this->tenant; + return "/_plugins/_security/api/tenants/$tenant"; + } + + public function getParamWhitelist(): array + { + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; + } + + public function getMethod(): string + { + return 'PATCH'; + } + + public function setBody($body): PatchTenant + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setTenant($tenant): PatchTenant + { + if (isset($tenant) !== true) { + return $this; + } + $this->tenant = $tenant; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Security/PatchTenants.php b/src/OpenSearch/Endpoints/Security/PatchTenants.php index 8a4de9257..41a3dbc2b 100644 --- a/src/OpenSearch/Endpoints/Security/PatchTenants.php +++ b/src/OpenSearch/Endpoints/Security/PatchTenants.php @@ -17,21 +17,25 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class PatchTenants extends AbstractEndpoint { - /** - * @var string|null - */ - protected $tenant; - - public function getParamWhitelist(): array + public function getURI(): string { - return []; + return "/_plugins/_security/api/tenants"; } - public function getURI(): string + public function getParamWhitelist(): array { - return '/_plugins/_security/api/tenants' . ($this->tenant ? "/{$this->tenant}" : ''); + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; } public function getMethod(): string @@ -39,13 +43,13 @@ public function getMethod(): string return 'PATCH'; } - /** - * @param string|null $tenant - * @return PatchTenants - */ - public function setTenant(?string $tenant): PatchTenants + public function setBody($body): PatchTenants { - $this->tenant = $tenant; + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + return $this; } } diff --git a/src/OpenSearch/Endpoints/Security/PatchUser.php b/src/OpenSearch/Endpoints/Security/PatchUser.php new file mode 100644 index 000000000..147384652 --- /dev/null +++ b/src/OpenSearch/Endpoints/Security/PatchUser.php @@ -0,0 +1,74 @@ +username) !== true) { + throw new RuntimeException( + 'username is required for patch_user' + ); + } + $username = $this->username; + return "/_plugins/_security/api/internalusers/$username"; + } + + public function getParamWhitelist(): array + { + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; + } + + public function getMethod(): string + { + return 'PATCH'; + } + + public function setBody($body): PatchUser + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setUsername($username): PatchUser + { + if (isset($username) !== true) { + return $this; + } + $this->username = $username; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Security/PatchUsers.php b/src/OpenSearch/Endpoints/Security/PatchUsers.php index af4ae7740..dafff0a40 100644 --- a/src/OpenSearch/Endpoints/Security/PatchUsers.php +++ b/src/OpenSearch/Endpoints/Security/PatchUsers.php @@ -15,24 +15,27 @@ namespace OpenSearch\Endpoints\Security; -use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class PatchUsers extends AbstractEndpoint { - /** - * @var string|null - */ - protected $username; - - public function getParamWhitelist(): array + public function getURI(): string { - return []; + return "/_plugins/_security/api/internalusers"; } - public function getURI(): string + public function getParamWhitelist(): array { - return '/_plugins/_security/api/internalusers' . ($this->username ? "/{$this->username}" : ''); + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; } public function getMethod(): string @@ -40,13 +43,13 @@ public function getMethod(): string return 'PATCH'; } - /** - * @param string|null $username - * @return PatchUsers - */ - public function setUsername(?string $username): PatchUsers + public function setBody($body): PatchUsers { - $this->username = $username; + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + return $this; } } diff --git a/src/OpenSearch/Endpoints/Security/PostDashboardsInfo.php b/src/OpenSearch/Endpoints/Security/PostDashboardsInfo.php new file mode 100644 index 000000000..75bff2113 --- /dev/null +++ b/src/OpenSearch/Endpoints/Security/PostDashboardsInfo.php @@ -0,0 +1,55 @@ +body = $body; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Security/ReloadHttpCertificates.php b/src/OpenSearch/Endpoints/Security/ReloadHttpCertificates.php new file mode 100644 index 000000000..262686d64 --- /dev/null +++ b/src/OpenSearch/Endpoints/Security/ReloadHttpCertificates.php @@ -0,0 +1,45 @@ +body = $body; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Security/UpdateConfiguration.php b/src/OpenSearch/Endpoints/Security/UpdateConfiguration.php new file mode 100644 index 000000000..b805d6d57 --- /dev/null +++ b/src/OpenSearch/Endpoints/Security/UpdateConfiguration.php @@ -0,0 +1,55 @@ +body = $body; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Security/UpdateDistinguishedName.php b/src/OpenSearch/Endpoints/Security/UpdateDistinguishedName.php new file mode 100644 index 000000000..b78551c65 --- /dev/null +++ b/src/OpenSearch/Endpoints/Security/UpdateDistinguishedName.php @@ -0,0 +1,74 @@ +cluster_name) !== true) { + throw new RuntimeException( + 'cluster_name is required for update_distinguished_name' + ); + } + $cluster_name = $this->cluster_name; + return "/_plugins/_security/api/nodesdn/$cluster_name"; + } + + public function getParamWhitelist(): array + { + return [ + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): UpdateDistinguishedName + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setClusterName($cluster_name): UpdateDistinguishedName + { + if (isset($cluster_name) !== true) { + return $this; + } + $this->cluster_name = $cluster_name; + + return $this; + } +} diff --git a/src/OpenSearch/Endpoints/Security/Validate.php b/src/OpenSearch/Endpoints/Security/Validate.php new file mode 100644 index 000000000..753af3324 --- /dev/null +++ b/src/OpenSearch/Endpoints/Security/Validate.php @@ -0,0 +1,46 @@ +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 f1eba1cbf..9808f55ca 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 649069205..e46cbd481 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 86398538a..1fef0bed0 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 e07b0264b..f543d1a6c 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 a53928862..b4f7bd36a 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 89a1f0cef..77facdeed 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 c252dbada..d9b3442f1 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 6fa87d775..575cc3430 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 a626bea6c..183272cb6 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 57a516136..6203bc299 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 2583f79c1..83deffe9f 100644 --- a/src/OpenSearch/Endpoints/Tasks/Cancel.php +++ b/src/OpenSearch/Endpoints/Tasks/Cancel.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Cancel extends AbstractEndpoint { protected $task_id; @@ -30,7 +33,6 @@ class Cancel extends AbstractEndpoint public function getURI(): string { $task_id = $this->task_id ?? null; - if (isset($task_id)) { return "/_tasks/$task_id/_cancel"; } @@ -40,10 +42,15 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'nodes', 'actions', + 'nodes', 'parent_task_id', - 'wait_for_completion' + 'wait_for_completion', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/Tasks/Get.php b/src/OpenSearch/Endpoints/Tasks/Get.php index 7f985c943..df8e113df 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 9561b8144..04d9db5e0 100644 --- a/src/OpenSearch/Endpoints/Tasks/ListTasks.php +++ b/src/OpenSearch/Endpoints/Tasks/ListTasks.php @@ -23,6 +23,9 @@ use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class ListTasks extends AbstractEndpoint { public function getURI(): string @@ -33,13 +36,18 @@ public function getURI(): string public function getParamWhitelist(): array { return [ - 'nodes', 'actions', 'detailed', + 'group_by', + 'nodes', 'parent_task_id', + 'timeout', 'wait_for_completion', - 'group_by', - 'timeout' + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/TermVectors.php b/src/OpenSearch/Endpoints/TermVectors.php index d35803f19..c06aefdbe 100644 --- a/src/OpenSearch/Endpoints/TermVectors.php +++ b/src/OpenSearch/Endpoints/TermVectors.php @@ -24,6 +24,9 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class TermVectors extends AbstractEndpoint { public function getURI(): string @@ -44,17 +47,22 @@ 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' + 'version_type', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/Transforms/Delete.php b/src/OpenSearch/Endpoints/Transforms/Delete.php new file mode 100644 index 000000000..1eb4d8e0e --- /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 000000000..118d87f45 --- /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 000000000..2c682bb2f --- /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 000000000..7600a1c80 --- /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 000000000..e1ee0c9c7 --- /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 000000000..d26b6dbb4 --- /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 dd3cdc50b..eedb30196 100644 --- a/src/OpenSearch/Endpoints/Update.php +++ b/src/OpenSearch/Endpoints/Update.php @@ -24,6 +24,9 @@ use OpenSearch\Common\Exceptions\RuntimeException; use OpenSearch\Endpoints\AbstractEndpoint; +/** + * NOTE: This file is autogenerated using util/GenerateEndpoints.php + */ class Update extends AbstractEndpoint { public function getURI(): string @@ -46,18 +49,23 @@ 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', + 'source', + 'filter_path' ]; } diff --git a/src/OpenSearch/Endpoints/UpdateByQuery.php b/src/OpenSearch/Endpoints/UpdateByQuery.php index 535b1de46..f08a450ee 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 0ad0917ec..37d8f7ff9 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 37a5886ab..9a3196d45 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 299cdaaa9..c0e3c9fca 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 1a9436c62..ff17095b3 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/IngestNamespace.php b/src/OpenSearch/Namespaces/IngestNamespace.php index 071e2f659..927158c59 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 000000000..2d094fab1 --- /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/MlNamespace.php b/src/OpenSearch/Namespaces/MlNamespace.php new file mode 100644 index 000000000..c0b615f47 --- /dev/null +++ b/src/OpenSearch/Namespaces/MlNamespace.php @@ -0,0 +1,192 @@ +extractArgument($params, 'model_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\DeleteModel'); + $endpoint->setParams($params); + $endpoint->setModelId($model_id); + + return $this->performRequest($endpoint); + } + /** + * Deletes a model group. + * + * $params['model_group_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 deleteModelGroup(array $params = []) + { + $model_group_id = $this->extractArgument($params, 'model_group_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\DeleteModelGroup'); + $endpoint->setParams($params); + $endpoint->setModelGroupId($model_group_id); + + return $this->performRequest($endpoint); + } + /** + * Retrieves a model group. + * + * $params['model_group_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 getModelGroup(array $params = []) + { + $model_group_id = $this->extractArgument($params, 'model_group_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\GetModelGroup'); + $endpoint->setParams($params); + $endpoint->setModelGroupId($model_group_id); + + return $this->performRequest($endpoint); + } + /** + * Retrieves a task. + * + * $params['task_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 getTask(array $params = []) + { + $task_id = $this->extractArgument($params, 'task_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\GetTask'); + $endpoint->setParams($params); + $endpoint->setTaskId($task_id); + + return $this->performRequest($endpoint); + } + /** + * Registers a 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 registerModel(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\RegisterModel'); + $endpoint->setParams($params); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * Registers a model group. + * + * $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 registerModelGroup(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\RegisterModelGroup'); + $endpoint->setParams($params); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * Searches for models. + * + * $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('Ml\SearchModels'); + $endpoint->setParams($params); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } +} diff --git a/src/OpenSearch/Namespaces/NodesNamespace.php b/src/OpenSearch/Namespaces/NodesNamespace.php index 035e2b71e..6946b1ded 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 000000000..756dd2a04 --- /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 000000000..bd1b90803 --- /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 000000000..d0deb6022 --- /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 000000000..0066519de --- /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/SecurityNamespace.php b/src/OpenSearch/Namespaces/SecurityNamespace.php index d2aacb0d1..3dac4a8f7 100644 --- a/src/OpenSearch/Namespaces/SecurityNamespace.php +++ b/src/OpenSearch/Namespaces/SecurityNamespace.php @@ -1,5 +1,7 @@ endpoints; - $endpoint = $endpointBuilder('Security\ChangePassword'); - $endpoint->setBody([ - 'current_password' => $this->extractArgument($params, 'current_password'), - 'password' => $this->extractArgument($params, 'password'), - ]); + $endpoint = $endpointBuilder('Security\Authinfo'); $endpoint->setParams($params); return $this->performRequest($endpoint); } - /** - * $params['action_group'] = (string) The name of the action group to create - * $params['allowed_actions'] = (array) list of allowed actions + * Returns the authorization token. + * + * $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 createActionGroup(array $params = []) + public function authtoken(array $params = []) { $endpointBuilder = $this->endpoints; - $endpoint = $endpointBuilder('Security\CreateActionGroup'); - $endpoint->setBody([ - 'allowed_actions' => $this->extractArgument($params, 'allowed_actions'), - ]); - $endpoint->setActionGroup($this->extractArgument($params, 'action_group')); + $endpoint = $endpointBuilder('Security\Authtoken'); $endpoint->setParams($params); return $this->performRequest($endpoint); } - /** - * $params['role'] = (string) The name of the role to create - * $params['cluster_permissions'] = (array) - * $params['index_permissions'] = (array) - * $params['tenant_permissions'] = (array) + * Not supported for cache API. + * + * $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 createRole(array $params = []) + public function cache(array $params = []) { $endpointBuilder = $this->endpoints; - $endpoint = $endpointBuilder('Security\CreateRole'); - $endpoint->setBody(array_filter([ - 'cluster_permissions' => $this->extractArgument($params, 'cluster_permissions'), - 'index_permissions' => $this->extractArgument($params, 'index_permissions'), - 'tenant_permissions' => $this->extractArgument($params, 'tenant_permissions'), - ])); - $endpoint->setRole($this->extractArgument($params, 'role')); + $endpoint = $endpointBuilder('Security\Cache'); $endpoint->setParams($params); return $this->performRequest($endpoint); } - /** - * $params['role'] = (string) The name of the role mapping to create - * $params['backend_roles'] = (array) - * $params['hosts'] = (array) - * $params['users'] = (array) + * Check whether or not an upgrade can be performed and what resources can be updated. + * + * $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 createRoleMapping(array $params = []) + public function configUpgradeCheck(array $params = []) { $endpointBuilder = $this->endpoints; - $endpoint = $endpointBuilder('Security\CreateRoleMapping'); - $endpoint->setBody(array_filter([ - 'backend_roles' => $this->extractArgument($params, 'backend_roles'), - 'hosts' => $this->extractArgument($params, 'hosts'), - 'users' => $this->extractArgument($params, 'users'), - ])); - $endpoint->setRole($this->extractArgument($params, 'role')); + $endpoint = $endpointBuilder('Security\ConfigUpgradeCheck'); $endpoint->setParams($params); return $this->performRequest($endpoint); } - /** - * $params['tenant'] = (string) The name of the tenant to create - * $params['description'] = (string) + * Helps cluster operator upgrade missing defaults and stale default definitions. + * + * $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 createTenant(array $params = []) + public function configUpgradePerform(array $params = []) { + $body = $this->extractArgument($params, 'body'); + $endpointBuilder = $this->endpoints; - $endpoint = $endpointBuilder('Security\CreateTenant'); - $endpoint->setBody([ - 'description' => $this->extractArgument($params, 'description'), - ]); - $endpoint->setTenant($this->extractArgument($params, 'tenant')); + $endpoint = $endpointBuilder('Security\ConfigUpgradePerform'); $endpoint->setParams($params); + $endpoint->setBody($body); return $this->performRequest($endpoint); } + /** + * Creates or replaces the allowlisted APIs. Accessible via Super Admin certificate or REST API permission. + * + * $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 createAllowlist(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\CreateAllowlist'); + $endpoint->setParams($params); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } /** - * $params['username'] = (string) The username to give the created user - * $params['password'] = (string) - * $params['opendistro_security_roles'] = (array) - * $params['backend_roles'] = (array) - * $params['attributes'] = (array) + * Creates or replaces the multi-tenancy configuration. Only accessible to admins and users with REST API permissions. + * + * $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 createUser(array $params = []) + public function createUpdateTenancyConfig(array $params = []) { + $body = $this->extractArgument($params, 'body'); + $endpointBuilder = $this->endpoints; - $endpoint = $endpointBuilder('Security\CreateUser'); - $endpoint->setBody(array_filter([ - 'password' => $this->extractArgument($params, 'password'), - 'opendistro_security_roles' => $this->extractArgument($params, 'opendistro_security_roles'), - 'backend_roles' => $this->extractArgument($params, 'backend_roles'), - 'attributes' => $this->extractArgument($params, 'attributes'), - ])); - $endpoint->setUsername($this->extractArgument($params, 'username')); + $endpoint = $endpointBuilder('Security\CreateUpdateTenancyConfig'); $endpoint->setParams($params); + $endpoint->setBody($body); return $this->performRequest($endpoint); } + /** + * Creates or replaces the specified user. Legacy API. + * + * $params['username'] = (string) (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 createUserLegacy(array $params = []) + { + $username = $this->extractArgument($params, 'username'); + $body = $this->extractArgument($params, 'body'); + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\CreateUserLegacy'); + $endpoint->setParams($params); + $endpoint->setUsername($username); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } /** - * $params['action_group'] = (string) The name of the action group to delete + * Delete a specified action group. + * + * $params['action_group'] = (string) Action group to delete. (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 deleteActionGroup(array $params = []) { + $action_group = $this->extractArgument($params, 'action_group'); + $endpointBuilder = $this->endpoints; $endpoint = $endpointBuilder('Security\DeleteActionGroup'); - $endpoint->setActionGroup($this->extractArgument($params, 'action_group')); $endpoint->setParams($params); + $endpoint->setActionGroup($action_group); return $this->performRequest($endpoint); } - /** - * $params['cluster_name'] = (string) The name of the cluster to delete distinguished names from + * Deletes all distinguished names in the specified cluster or node allow list. Only accessible to super-admins and with rest-api permissions when enabled. + * + * $params['cluster_name'] = (string) (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 deleteDistinguishedNames(array $params = []) + public function deleteDistinguishedName(array $params = []) { + $cluster_name = $this->extractArgument($params, 'cluster_name'); + $endpointBuilder = $this->endpoints; - $endpoint = $endpointBuilder('Security\DeleteDistinguishedNames'); - $endpoint->setClusterName($this->extractArgument($params, 'cluster_name')); + $endpoint = $endpointBuilder('Security\DeleteDistinguishedName'); $endpoint->setParams($params); + $endpoint->setClusterName($cluster_name); return $this->performRequest($endpoint); } - /** - * $params['role'] = (string) The name of the role to delete + * Delete the specified role. + * + * $params['role'] = (string) (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 deleteRole(array $params = []) { + $role = $this->extractArgument($params, 'role'); + $endpointBuilder = $this->endpoints; $endpoint = $endpointBuilder('Security\DeleteRole'); - $endpoint->setRole($this->extractArgument($params, 'role')); $endpoint->setParams($params); + $endpoint->setRole($role); return $this->performRequest($endpoint); } - /** - * $params['role'] = (string) The name of the role mapping to delete + * Deletes the specified role mapping. + * + * $params['role'] = (string) (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 deleteRoleMapping(array $params = []) { + $role = $this->extractArgument($params, 'role'); + $endpointBuilder = $this->endpoints; $endpoint = $endpointBuilder('Security\DeleteRoleMapping'); - $endpoint->setRole($this->extractArgument($params, 'role')); $endpoint->setParams($params); + $endpoint->setRole($role); return $this->performRequest($endpoint); } - /** - * $params['tenant'] = (string) The name of the tenant to delete + * Delete the specified tenant. + * + * $params['tenant'] = (string) (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 deleteTenant(array $params = []) { + $tenant = $this->extractArgument($params, 'tenant'); + $endpointBuilder = $this->endpoints; $endpoint = $endpointBuilder('Security\DeleteTenant'); - $endpoint->setTenant($this->extractArgument($params, 'tenant')); $endpoint->setParams($params); + $endpoint->setTenant($tenant); return $this->performRequest($endpoint); } - /** - * $params['username'] = (string) The username of the user to delete + * Delete the specified user. + * + * $params['username'] = (string) (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 deleteUser(array $params = []) { + $username = $this->extractArgument($params, 'username'); + $endpointBuilder = $this->endpoints; $endpoint = $endpointBuilder('Security\DeleteUser'); - $endpoint->setUsername($this->extractArgument($params, 'username')); $endpoint->setParams($params); + $endpoint->setUsername($username); return $this->performRequest($endpoint); } + /** + * Delete the specified user. Legacy API. + * + * $params['username'] = (string) (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 deleteUserLegacy(array $params = []) + { + $username = $this->extractArgument($params, 'username'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\DeleteUserLegacy'); + $endpoint->setParams($params); + $endpoint->setUsername($username); + return $this->performRequest($endpoint); + } /** + * Flushes the Security plugin user, authentication, and authorization 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 */ @@ -259,296 +389,1549 @@ public function flushCache(array $params = []) return $this->performRequest($endpoint); } - /** + * Generates On-Behalf-Of token for the current user. + * + * $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 getAccount(array $params = []) + public function generateOboToken(array $params = []) { + $body = $this->extractArgument($params, 'body'); + $endpointBuilder = $this->endpoints; - $endpoint = $endpointBuilder('Security\GetAccount'); + $endpoint = $endpointBuilder('Security\GenerateOboToken'); $endpoint->setParams($params); + $endpoint->setBody($body); return $this->performRequest($endpoint); } - /** - * $params['action_group'] = (string) The name of the action group to fetch, omit to fetch all (optional) + * Generates authorization token for the given user. + * + * $params['username'] = (string) (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 getActionGroups(array $params = []) + public function generateUserToken(array $params = []) { + $username = $this->extractArgument($params, 'username'); + $endpointBuilder = $this->endpoints; - $endpoint = $endpointBuilder('Security\GetActionGroups'); - $endpoint->setActionGroup($this->extractArgument($params, 'action_group')); + $endpoint = $endpointBuilder('Security\GenerateUserToken'); $endpoint->setParams($params); + $endpoint->setUsername($username); return $this->performRequest($endpoint); } - /** + * Generates authorization token for the given user. Legacy API. + * + * $params['username'] = (string) (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 getCertificates(array $params = []) + public function generateUserTokenLegacy(array $params = []) { + $username = $this->extractArgument($params, 'username'); + $endpointBuilder = $this->endpoints; - $endpoint = $endpointBuilder('Security\GetCertificates'); + $endpoint = $endpointBuilder('Security\GenerateUserTokenLegacy'); $endpoint->setParams($params); + $endpoint->setUsername($username); return $this->performRequest($endpoint); } - /** + * Returns account details for the current user. + * + * $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 = []) + public function getAccountDetails(array $params = []) { $endpointBuilder = $this->endpoints; - $endpoint = $endpointBuilder('Security\GetConfig'); + $endpoint = $endpointBuilder('Security\GetAccountDetails'); $endpoint->setParams($params); return $this->performRequest($endpoint); } - /** - * $params['cluster_name'] = (string) The name of the cluster to get distinguished names for, omit to fetch all (optional) + * Retrieves one action group. + * + * $params['action_group'] = (string) Action group to retrieve. (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 getDistinguishedNames(array $params = []) + public function getActionGroup(array $params = []) { + $action_group = $this->extractArgument($params, 'action_group'); + $endpointBuilder = $this->endpoints; - $endpoint = $endpointBuilder('Security\GetDistinguishedNames'); - $endpoint->setClusterName($this->extractArgument($params, 'cluster_name')); + $endpoint = $endpointBuilder('Security\GetActionGroup'); $endpoint->setParams($params); + $endpoint->setActionGroup($action_group); return $this->performRequest($endpoint); } - /** - * $params['role'] = (string) The name of the role to get mappings for, omit to fetch all (optional) + * Retrieves the current list of allowed API accessible to normal user. + * + * $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 getRoleMappings(array $params = []) + public function getAllowlist(array $params = []) { $endpointBuilder = $this->endpoints; - $endpoint = $endpointBuilder('Security\GetRoleMappings'); - $endpoint->setRole($this->extractArgument($params, 'role')); + $endpoint = $endpointBuilder('Security\GetAllowlist'); $endpoint->setParams($params); return $this->performRequest($endpoint); } - /** - * $params['role'] = (string) The name of the role fetch, omit to fetch all (optional) + * Retrieves the audit configuration. + * + * $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 getRoles(array $params = []) + public function getAuditConfiguration(array $params = []) { $endpointBuilder = $this->endpoints; - $endpoint = $endpointBuilder('Security\GetRoles'); - $endpoint->setRole($this->extractArgument($params, 'role')); + $endpoint = $endpointBuilder('Security\GetAuditConfiguration'); $endpoint->setParams($params); return $this->performRequest($endpoint); } - /** - * $params['tenant'] = (string) The name of the tenant to fetch, omit to fetch all (optional) + * Retrieves the cluster security certificates. + * + * $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 getTenants(array $params = []) + public function getCertificates(array $params = []) { $endpointBuilder = $this->endpoints; - $endpoint = $endpointBuilder('Security\GetTenants'); - $endpoint->setTenant($this->extractArgument($params, 'tenant')); + $endpoint = $endpointBuilder('Security\GetCertificates'); $endpoint->setParams($params); return $this->performRequest($endpoint); } - /** - * $params['username'] = (string) The username of the user to fetch, omit to fetch all (optional) + * Returns the current Security plugin configuration in JSON format. + * + * $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 getUsers(array $params = []) + public function getConfiguration(array $params = []) { $endpointBuilder = $this->endpoints; - $endpoint = $endpointBuilder('Security\GetUsers'); - $endpoint->setUsername($this->extractArgument($params, 'username')); + $endpoint = $endpointBuilder('Security\GetConfiguration'); $endpoint->setParams($params); return $this->performRequest($endpoint); } - /** + * Retrieves the current security-dashboards plugin configuration. + * + * $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 health(array $params = []) + public function getDashboardsInfo(array $params = []) { $endpointBuilder = $this->endpoints; - $endpoint = $endpointBuilder('Security\Health'); + $endpoint = $endpointBuilder('Security\GetDashboardsInfo'); $endpoint->setParams($params); return $this->performRequest($endpoint); } + /** + * Retrieves distinguished names. Only accessible to super-admins and with rest-api permissions when enabled. + * + * $params['cluster_name'] = (string) (Required) + * $params['show_all'] = (boolean) + * $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 getDistinguishedName(array $params = []) + { + $cluster_name = $this->extractArgument($params, 'cluster_name'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\GetDistinguishedName'); + $endpoint->setParams($params); + $endpoint->setClusterName($cluster_name); + return $this->performRequest($endpoint); + } /** - * $params['action_group'] = (string) The name of the action group to update, omit to patch multiple (optional) - * $params['ops'] = (array) List of operations to execute + * Gets the evaluated REST API permissions for the currently logged in user. + * + * $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 patchActionGroups(array $params = []) + public function getPermissionsInfo(array $params = []) { $endpointBuilder = $this->endpoints; - $endpoint = $endpointBuilder('Security\PatchActionGroups'); - $endpoint->setActionGroup($this->extractArgument($params, 'action_group')); - $endpoint->setBody($this->extractArgument($params, 'ops') ?? []); + $endpoint = $endpointBuilder('Security\GetPermissionsInfo'); $endpoint->setParams($params); return $this->performRequest($endpoint); } + /** + * Retrieves one role. + * + * $params['role'] = (string) (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 getRole(array $params = []) + { + $role = $this->extractArgument($params, 'role'); + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\GetRole'); + $endpoint->setParams($params); + $endpoint->setRole($role); + + return $this->performRequest($endpoint); + } /** - * $params['ops'] = (array) List of operations to execute + * Retrieves one role mapping. + * + * $params['role'] = (string) (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 patchConfig(array $params = []) + public function getRoleMapping(array $params = []) { + $role = $this->extractArgument($params, 'role'); + $endpointBuilder = $this->endpoints; - $endpoint = $endpointBuilder('Security\PatchConfig'); - $endpoint->setBody($this->extractArgument($params, 'ops') ?? []); + $endpoint = $endpointBuilder('Security\GetRoleMapping'); $endpoint->setParams($params); + $endpoint->setRole($role); return $this->performRequest($endpoint); } + /** + * Retrieves the SSL configuration information. + * + * $params['show_dn'] = (string) The domain names from all certificates. + * $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 getSslinfo(array $params = []) + { + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\GetSslinfo'); + $endpoint->setParams($params); + return $this->performRequest($endpoint); + } /** - * $params['role'] = (string) The name of the role mappings to update, omit to patch multiple (optional) - * $params['ops'] = (array) List of operations to execute + * Retrieves multi-tenancy configuration. Only accessible to admins and users with REST API permissions. + * + * $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 patchRoleMappings(array $params = []) + public function getTenancyConfig(array $params = []) { $endpointBuilder = $this->endpoints; - $endpoint = $endpointBuilder('Security\PatchRoleMappings'); - $endpoint->setRole($this->extractArgument($params, 'role')); - $endpoint->setBody($this->extractArgument($params, 'ops') ?? []); + $endpoint = $endpointBuilder('Security\GetTenancyConfig'); $endpoint->setParams($params); return $this->performRequest($endpoint); } + /** + * Retrieves one tenant. + * + * $params['tenant'] = (string) (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 getTenant(array $params = []) + { + $tenant = $this->extractArgument($params, 'tenant'); + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\GetTenant'); + $endpoint->setParams($params); + $endpoint->setTenant($tenant); + + return $this->performRequest($endpoint); + } /** - * $params['role'] = (string) The name of the role to update, omit to patch multiple (optional) - * $params['ops'] = (array) List of operations to execute + * Retrieve one internal user. + * + * $params['username'] = (string) (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 patchRoles(array $params = []) + public function getUser(array $params = []) { + $username = $this->extractArgument($params, 'username'); + $endpointBuilder = $this->endpoints; - $endpoint = $endpointBuilder('Security\PatchRoles'); - $endpoint->setRole($this->extractArgument($params, 'role')); - $endpoint->setBody($this->extractArgument($params, 'ops') ?? []); + $endpoint = $endpointBuilder('Security\GetUser'); $endpoint->setParams($params); + $endpoint->setUsername($username); return $this->performRequest($endpoint); } + /** + * Retrieve one user. Legacy API. + * + * $params['username'] = (string) (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 getUserLegacy(array $params = []) + { + $username = $this->extractArgument($params, 'username'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\GetUserLegacy'); + $endpoint->setParams($params); + $endpoint->setUsername($username); + return $this->performRequest($endpoint); + } /** - * $params['tenant'] = (string) The name of the tenant to update, omit to patch multiple (optional) - * $params['ops'] = (array) List of operations to execute + * Retrieve all internal users. Legacy API. + * + * $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 patchTenants(array $params = []) + public function getUsersLegacy(array $params = []) { $endpointBuilder = $this->endpoints; - $endpoint = $endpointBuilder('Security\PatchTenants'); - $endpoint->setTenant($this->extractArgument($params, 'tenant')); - $endpoint->setBody($this->extractArgument($params, 'ops') ?? []); + $endpoint = $endpointBuilder('Security\GetUsersLegacy'); $endpoint->setParams($params); return $this->performRequest($endpoint); } + /** + * Checks to see if the Security plugin is up and running. + * + * $params['mode'] = (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 health(array $params = []) + { + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\Health'); + $endpoint->setParams($params); + return $this->performRequest($endpoint); + } /** - * $params['username'] = (string) The username of the user to update, omit to patch multiple (optional) - * $params['ops'] = (array) List of operations to execute + * Migrates security configuration from v6 to v7. + * + * $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 patchUsers(array $params = []) + public function migrate(array $params = []) { $endpointBuilder = $this->endpoints; - $endpoint = $endpointBuilder('Security\PatchUsers'); - $endpoint->setUsername($this->extractArgument($params, 'username')); - $endpoint->setBody($this->extractArgument($params, 'ops') ?? []); + $endpoint = $endpointBuilder('Security\Migrate'); $endpoint->setParams($params); return $this->performRequest($endpoint); } + /** + * Updates individual attributes of an action group. + * + * $params['action_group'] = (string) (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 patchActionGroup(array $params = []) + { + $action_group = $this->extractArgument($params, 'action_group'); + $body = $this->extractArgument($params, 'body'); + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\PatchActionGroup'); + $endpoint->setParams($params); + $endpoint->setActionGroup($action_group); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } /** - * $params['dynamic'] = (array) array of config options + * Updates the current list of allowed API accessible to normal user. + * + * $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 = []) + public function patchAllowlist(array $params = []) { + $body = $this->extractArgument($params, 'body'); + $endpointBuilder = $this->endpoints; - $endpoint = $endpointBuilder('Security\UpdateConfig'); - $endpoint->setBody([ - 'dynamic' => $this->extractArgument($params, 'dynamic'), - ]); + $endpoint = $endpointBuilder('Security\PatchAllowlist'); $endpoint->setParams($params); + $endpoint->setBody($body); return $this->performRequest($endpoint); } + /** + * A PATCH call is used to update specified fields in the audit configuration. + * + * $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 patchAuditConfiguration(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\PatchAuditConfiguration'); + $endpoint->setParams($params); + $endpoint->setBody($body); + return $this->performRequest($endpoint); + } /** - * $params['cluster_name'] = (string) name of cluster to add or update distinguished names for - * $params['nodes_dn'] = (array) distinguished names to add to cluster + * A PATCH call is used to update the existing configuration using the REST API. Only accessible by admins and users with rest api access and only when put or patch is enabled. + * + * $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 updateDistinguishedNames(array $params = []) + public function patchConfiguration(array $params = []) { + $body = $this->extractArgument($params, 'body'); + $endpointBuilder = $this->endpoints; - $endpoint = $endpointBuilder('Security\UpdateDistinguishedNames'); - $endpoint->setBody([ - 'nodes_dn' => $this->extractArgument($params, 'nodes_dn'), - ]); - $endpoint->setClusterName($this->extractArgument($params, 'cluster_name')); + $endpoint = $endpointBuilder('Security\PatchConfiguration'); $endpoint->setParams($params); + $endpoint->setBody($body); return $this->performRequest($endpoint); } + /** + * Updates a distinguished cluster name for a specific cluster. Only accessible to super-admins and with rest-api permissions when enabled. + * + * $params['cluster_name'] = (string) (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 patchDistinguishedName(array $params = []) + { + $cluster_name = $this->extractArgument($params, 'cluster_name'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\PatchDistinguishedName'); + $endpoint->setParams($params); + $endpoint->setClusterName($cluster_name); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * Bulk update of distinguished names. Only accessible to super-admins and with rest-api permissions when enabled. + * + * $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 patchDistinguishedNames(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\PatchDistinguishedNames'); + $endpoint->setParams($params); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * Updates individual attributes of a role. + * + * $params['role'] = (string) (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 patchRole(array $params = []) + { + $role = $this->extractArgument($params, 'role'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\PatchRole'); + $endpoint->setParams($params); + $endpoint->setRole($role); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * Updates individual attributes of a role mapping. + * + * $params['role'] = (string) (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 patchRoleMapping(array $params = []) + { + $role = $this->extractArgument($params, 'role'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\PatchRoleMapping'); + $endpoint->setParams($params); + $endpoint->setRole($role); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * Add, delete, or modify a single tenant. + * + * $params['tenant'] = (string) (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 patchTenant(array $params = []) + { + $tenant = $this->extractArgument($params, 'tenant'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\PatchTenant'); + $endpoint->setParams($params); + $endpoint->setTenant($tenant); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * Updates individual attributes of an internal user. + * + * $params['username'] = (string) (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 patchUser(array $params = []) + { + $username = $this->extractArgument($params, 'username'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\PatchUser'); + $endpoint->setParams($params); + $endpoint->setUsername($username); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * Updates the current security-dashboards plugin configuration. + * + * $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 postDashboardsInfo(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\PostDashboardsInfo'); + $endpoint->setParams($params); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * Reload HTTP layer communication certificates. + * + * $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 reloadHttpCertificates(array $params = []) + { + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\ReloadHttpCertificates'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * Reload Transport layer communication certificates. + * + * $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 reloadTransportCertificates(array $params = []) + { + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\ReloadTransportCertificates'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * Retrieves the tenant names if any exist. Only accessible to super admins or kibanaserver user. + * + * $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 tenantInfo(array $params = []) + { + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\TenantInfo'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * Updates the audit configuration. + * + * $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 updateAuditConfiguration(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\UpdateAuditConfiguration'); + $endpoint->setParams($params); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * Adds or updates the existing configuration using the REST API. Only accessible by admins and users with rest api access and only when put or patch is enabled. + * + * $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 updateConfiguration(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\UpdateConfiguration'); + $endpoint->setParams($params); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * Adds or updates the specified distinguished names in the cluster or node allow list. Only accessible to super-admins and with rest-api permissions when enabled. + * + * $params['cluster_name'] = (string) (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 updateDistinguishedName(array $params = []) + { + $cluster_name = $this->extractArgument($params, 'cluster_name'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\UpdateDistinguishedName'); + $endpoint->setParams($params); + $endpoint->setClusterName($cluster_name); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * Checks whether the v6 security configuration is valid and ready to be migrated to v7. + * + * $params['accept_invalid'] = (boolean) + * $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 validate(array $params = []) + { + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\Validate'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * Gets the user identity related information for currently logged in user. + * + * $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 whoAmI(array $params = []) + { + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\WhoAmI'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * Gets the user identity related information for currently logged in user. User needs to have access to this endpoint when authorization at REST layer is enabled. + * + * $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 whoAmIProtected(array $params = []) + { + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\WhoAmIProtected'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * Changes the password for the current user. + * + * $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['current_password'] = (string) The current password + * $params['password'] = (string) New password + * + * @param array $params Associative array of parameters + * @return array + */ + public function changePassword(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + if ($body === null) { + $body = [ + 'current_password' => $this->extractArgument($params, 'current_password'), + 'password' => $this->extractArgument($params, 'password'), + ]; + } + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\ChangePassword'); + $endpoint->setParams($params); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * Creates or replaces the specified action group. + * + * $params['action_group'] = (string) The name of the action group to create or replace. (Required) + * $params['allowed_actions'] = (array) list of allowed actions + * $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 createActionGroup(array $params = []) + { + $action_group = $this->extractArgument($params, 'action_group'); + $body = $this->extractArgument($params, 'body'); + if ($body === null) { + $body = [ + 'allowed_actions' => $this->extractArgument($params, 'allowed_actions'), + ]; + } + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\CreateActionGroup'); + $endpoint->setParams($params); + $endpoint->setActionGroup($action_group); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * Creates or replaces the specified role mapping. + * + * $params['role'] = (string) (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['backend_roles'] = (array) + * $params['hosts'] = (array) + * $params['users'] = (array) + * + * @param array $params Associative array of parameters + * @return array + */ + public function createRoleMapping(array $params = []) + { + $role = $this->extractArgument($params, 'role'); + $body = $this->extractArgument($params, 'body'); + if ($body === null) { + $body = array_filter([ + 'backend_roles' => $this->extractArgument($params, 'backend_roles'), + 'hosts' => $this->extractArgument($params, 'hosts'), + 'users' => $this->extractArgument($params, 'users'), + ]); + } + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\CreateRoleMapping'); + $endpoint->setParams($params); + $endpoint->setRole($role); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * Creates or replaces the specified role. + * + * $params['role'] = (string) (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['cluster_permissions'] = (array) + * $params['index_permissions'] = (array) + * $params['tenant_permissions'] = (array) + * + * @param array $params Associative array of parameters + * @return array + */ + public function createRole(array $params = []) + { + $role = $this->extractArgument($params, 'role'); + $body = $this->extractArgument($params, 'body'); + if ($body === null) { + $body = array_filter([ + 'cluster_permissions' => $this->extractArgument($params, 'cluster_permissions'), + 'index_permissions' => $this->extractArgument($params, 'index_permissions'), + 'tenant_permissions' => $this->extractArgument($params, 'tenant_permissions'), + ]); + } + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\CreateRole'); + $endpoint->setParams($params); + $endpoint->setRole($role); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * Creates or replaces the specified tenant. + * + * $params['tenant'] = (string) The name of the tenant to create + * $params['description'] = (string) Description of the tenant + * $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 createTenant(array $params = []) + { + $tenant = $this->extractArgument($params, 'tenant'); + $body = $this->extractArgument($params, 'body'); + if ($body === null) { + $body = [ + 'description' => $this->extractArgument($params, 'description'), + ]; + } + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\CreateTenant'); + $endpoint->setParams($params); + $endpoint->setTenant($tenant); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * Creates or replaces the specified user. + * + * $params['username'] = (string) (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['password'] = (string) + * $params['opendistro_security_roles'] = (array) + * $params['backend_roles'] = (array) + * $params['attributes'] = (array) + * + * @param array $params Associative array of parameters + * @return array + */ + public function createUser(array $params = []) + { + $username = $this->extractArgument($params, 'username'); + $body = $this->extractArgument($params, 'body'); + if ($body === null) { + $body = array_filter([ + 'password' => $this->extractArgument($params, 'password'), + 'opendistro_security_roles' => $this->extractArgument($params, 'opendistro_security_roles'), + 'backend_roles' => $this->extractArgument($params, 'backend_roles'), + 'attributes' => $this->extractArgument($params, 'attributes'), + ]); + } + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\CreateUser'); + $endpoint->setParams($params); + $endpoint->setUsername($username); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * Proxy function to deleteDistinguishedNames() to prevent BC break. + * This API will be removed in a future version. Use 'deleteDistinguishedName' API instead. + */ + public function deleteDistinguishedNames(array $params = []) + { + return $this->deleteDistinguishedName($params); + } + /** + * Proxy function to getAccount() to prevent BC break. + * This API will be removed in a future version. Use 'getAccountDetails' API instead. + */ + public function getAccount(array $params = []) + { + return $this->getAccountDetails($params); + } + /** + * Retrieves all action groups. + * If 'action_group' is provided in $params, calls 'getActionGroup'. + * + * $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 getActionGroups(array $params = []) + { + $endpointBuilder = $this->endpoints; + if (isset($params['action_group'])) { + $endpoint = $endpointBuilder('Security\GetActionGroup'); + $endpoint->setActionGroup($params['action_group']); + unset($params['action_group']); + } else { + $endpoint = $endpointBuilder('Security\GetActionGroups'); + } + $endpoint = $endpointBuilder('Security\GetActionGroups'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * Proxy function to getConfig() to prevent BC break. + * This API will be removed in a future version. Use 'getConfiguration' API instead. + */ + public function getConfig(array $params = []) + { + return $this->getConfiguration($params); + } + /** + * Retrieves distinguished names. Only accessible to super-admins and with rest-api permissions when enabled. + * If 'cluster_name' is provided in $params, calls GetDistinguishedName. + * + * $params['cluster_name'] = (string) Name of the cluster. + * $params['show_all'] = (boolean) Show all DN. + * $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 getDistinguishedNames(array $params = []) + { + $endpointBuilder = $this->endpoints; + if (isset($params['cluster_name'])) { + $endpoint = $endpointBuilder('Security\GetDistinguishedName'); + $endpoint->setClusterName($params['cluster_name']); + unset($params['cluster_name']); + } else { + $endpoint = $endpointBuilder('Security\GetDistinguishedNames'); + } + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * Retrieves role mappings. Only accessible to super-admins and with rest-api permissions when enabled. + * If 'role' is provided in $params, calls GetRoleMapping. + * + * $params['role'] = (string) Name of the role. + * $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 getRoleMappings(array $params = []) + { + $endpointBuilder = $this->endpoints; + if (isset($params['role'])) { + $endpoint = $endpointBuilder('Security\GetRoleMapping'); + $endpoint->setRole($params['role']); + unset($params['role']); + } else { + $endpoint = $endpointBuilder('Security\GetRoleMappings'); + } + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * Retrieves roles. Only accessible to super-admins and with rest-api permissions when enabled. + * If 'role' is provided in $params, calls getRole. + * + * $params['role'] = (string) Name of the role. + * $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 getRoles(array $params = []) + { + $endpointBuilder = $this->endpoints; + if (isset($params['role'])) { + $endpoint = $endpointBuilder('Security\GetRole'); + $endpoint->setRole($params['role']); + unset($params['role']); + } else { + $endpoint = $endpointBuilder('Security\GetRoles'); + } + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * Retrieves tenants. Only accessible to super-admins and with rest-api permissions when enabled. + * If 'tenant' is provided in $params, calls GetTenant. + * + * $params['tenant'] = (string) Name of the tenant. + * $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 getTenants(array $params = []) + { + $endpointBuilder = $this->endpoints; + if (isset($params['tenant'])) { + $endpoint = $endpointBuilder('Security\GetTenant'); + $endpoint->setTenant($params['tenant']); + unset($params['tenant']); + } else { + $endpoint = $endpointBuilder('Security\GetTenants'); + } + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * Retrieve all internal users. + * If 'username' is provided in $params, calls 'getUser'. + * + * $params['username'] = (string) The username of the user to fetch, omit to fetch all (optional). + * $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 getUsers(array $params = []): array + { + $endpointBuilder = $this->endpoints; + + if (isset($params['username'])) { + $endpoint = $endpointBuilder('Security\GetUser'); + $endpoint->setUsername($params['username']); + unset($params['username']); + } else { + $endpoint = $endpointBuilder('Security\GetUsers'); + } + + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } /** + * Creates, updates, or deletes multiple action groups in a single call. + * If 'action_group' is provided in $params, calls patchActionGroup. + * + * $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 patchActionGroups(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + + if ($body === null) { + $body = $this->extractArgument($params, 'ops') ?? []; + } + + $endpointBuilder = $this->endpoints; + if (isset($params['action_group'])) { + $endpoint = $endpointBuilder('Security\PatchActionGroup'); + $endpoint->setActionGroup($params['action_group']); + unset($params['action_group']); + } else { + $endpoint = $endpointBuilder('Security\PatchActionGroups'); + } + $endpoint->setParams($params); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + + /** + * Proxy function to patchConfig() to prevent BC break. + * This API will be removed in a future version. Use 'patchConfiguration' API instead. + */ + public function patchConfig(array $params = []) + { + $ops = $this->extractArgument($params, 'ops'); + if ($ops !== null) { + $params['body'] = $ops; + } + return $this->patchConfiguration($params); + } + /** + * Creates or updates multiple role mappings in a single call. + * If 'role' is provided in $params, calls patchRoleMappings. + * + * $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 patchRoleMappings(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + if ($body === null) { + $body = $this->extractArgument($params, 'ops') ?? []; + } + + $endpointBuilder = $this->endpoints; + if (isset($params['role'])) { + $endpoint = $endpointBuilder('Security\PatchRoleMapping'); + $endpoint->setRole($params['role']); + unset($params['role']); + } else { + $endpoint = $endpointBuilder('Security\PatchRoleMappings'); + } + $endpoint->setParams($params); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * Creates, updates, or deletes multiple roles in a single call. + * If 'role' is provided in $params, calls patchRole. + * + * $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 patchRoles(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + if ($body === null) { + $body = $this->extractArgument($params, 'ops') ?? []; + } + + $endpointBuilder = $this->endpoints; + if (isset($params['role'])) { + $endpoint = $endpointBuilder('Security\PatchRole'); + $endpoint->setRole($params['role']); + unset($params['role']); + } else { + $endpoint = $endpointBuilder('Security\PatchRoles'); + } + + $endpoint->setParams($params); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * Add, delete, or modify multiple tenants in a single call. + * If 'tenant' is provided in $params, calls 'patchTenant'. + * + * $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 patchTenants(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + if ($body === null) { + $body = $this->extractArgument($params, 'ops') ?? []; + } + + $endpointBuilder = $this->endpoints; + if (isset($params['tenant'])) { + $endpoint = $endpointBuilder('Security\PatchTenant'); + $endpoint->setTenant($params['tenant']); + unset($params['tenant']); + } else { + $endpoint = $endpointBuilder('Security\PatchTenants'); + } + + $endpoint->setParams($params); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * Creates, updates, or deletes multiple internal users in a single call. + * If 'username' is provided in $params, calls patchUser. + * + * $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 patchUsers(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + if ($body === null) { + $body = $this->extractArgument($params, 'ops') ?? []; + } + + $endpointBuilder = $this->endpoints; + if (isset($params['username'])) { + $endpoint = $endpointBuilder('Security\PatchUser'); + $endpoint->setUsername($params['username']); + unset($params['username']); + } else { + $endpoint = $endpointBuilder('Security\PatchUsers'); + } + + $endpoint->setParams($params); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * Proxy function to updateConfig() to prevent BC break. + * This API will be removed in a future version. Use 'updateConfiguration' API instead. + */ + public function updateConfig(array $params = []) + { + $body = [ 'dynamic' => $this->extractArgument($params, 'dynamic')]; + $params['body'] = $body; + return $this->updateConfiguration($params); + } + /** + * Proxy function to updateDistinguishedNames() to prevent BC break. + * This API will be removed in a future version. Use 'updateDistinguishedName' API instead. + */ + public function updateDistinguishedNames(array $params = []) + { + return $this->updateDistinguishedName($params); + } } diff --git a/src/OpenSearch/Namespaces/SnapshotNamespace.php b/src/OpenSearch/Namespaces/SnapshotNamespace.php index d7d96bb1f..db1dc9785 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 d278eb86d..2292ed72e 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 000000000..fa124ad5e --- /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/CreateIntegrationTest.php b/tests/Endpoints/CreateIntegrationTest.php index f3ef4eb6b..70ab46698 100644 --- a/tests/Endpoints/CreateIntegrationTest.php +++ b/tests/Endpoints/CreateIntegrationTest.php @@ -60,32 +60,4 @@ public function testCreatePassingId() 'index' => $expectedIndex, ]); } - - public function testCreateWithoutPassId() - { - // Arrange - $expectedIndex = 'movies'; - $expectedResult = 'created'; - - $client = Utility::getClient(); - - // Act - $result = $client->create([ - 'index' => $expectedIndex, - 'body' => [ - 'title' => 'Remember the Titans', - 'director' => 'Boaz Yakin', - 'year' => 2000 - ] - ]); - - // Assert - $this->assertEquals($expectedIndex, $result['_index']); - $this->assertEquals($expectedResult, $result['result']); - $this->assertNotEmpty($result['_id']); - - $client->indices()->delete([ - 'index' => $expectedIndex, - ]); - } } diff --git a/tests/Endpoints/CreatePointInTimeTest.php b/tests/Endpoints/CreatePointInTimeTest.php index 8fbaa0fee..779f68ee6 100644 --- a/tests/Endpoints/CreatePointInTimeTest.php +++ b/tests/Endpoints/CreatePointInTimeTest.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 a86fb5a8a..c5e7cfd60 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/DeletePointInTimeTest.php index d4e018559..9f095e3f0 100644 --- a/tests/Endpoints/DeletePointInTimeTest.php +++ b/tests/Endpoints/DeletePointInTimeTest.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/tests/Namespaces/MachineLearningNamespaceTest.php b/tests/Namespaces/MachineLearningNamespaceTest.php index 4b83a3d1c..0aebb4aca 100644 --- a/tests/Namespaces/MachineLearningNamespaceTest.php +++ b/tests/Namespaces/MachineLearningNamespaceTest.php @@ -15,10 +15,11 @@ use OpenSearch\Endpoints\MachineLearning\Models\GetModel; use OpenSearch\Endpoints\MachineLearning\Models\GetModels; use OpenSearch\Endpoints\MachineLearning\Models\Predict; -use OpenSearch\Endpoints\MachineLearning\Models\RegisterModel; +use OpenSearch\Endpoints\Ml\RegisterModel; use OpenSearch\Endpoints\MachineLearning\Models\UndeployModel; use OpenSearch\Endpoints\MachineLearning\Tasks\GetTask; use OpenSearch\Endpoints\Sql\Query; +use OpenSearch\Namespaces\MlNamespace; use OpenSearch\Namespaces\MachineLearningNamespace; use OpenSearch\Namespaces\SqlNamespace; use OpenSearch\Transport; @@ -145,7 +146,7 @@ public function testRegisterModelGroup(): void $transport->method('resultOrFuture') ->willReturn([]); - (new MachineLearningNamespace($transport, $func))->registerModelGroup([ + (new MlNamespace($transport, $func))->registerModelGroup([ 'body' => [ 'foo' => 'bar', ], diff --git a/tests/Namespaces/SecurityNamespaceTest.php b/tests/Namespaces/SecurityNamespaceTest.php index 496cde367..e88bcbf3f 100644 --- a/tests/Namespaces/SecurityNamespaceTest.php +++ b/tests/Namespaces/SecurityNamespaceTest.php @@ -124,7 +124,7 @@ public function testCreateActionGroup(): void public function testCreateActionGroupThrowsWithoutActionGroup(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Missing parameter for the endpoint security.create_action_group'); + $this->expectExceptionMessage('action_group is required for create_action_group'); $this->client->security()->createActionGroup([ 'allowed_actions' => ['indices:data/read*'] @@ -209,7 +209,7 @@ public function testCreateRole(): void public function testCreateRoleThrowsWithoutRole(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Missing parameter for the endpoint security.create_role'); + $this->expectExceptionMessage('role is required for create_role'); $this->client->security()->createRole([ 'cluster_permissions' => [], @@ -254,7 +254,7 @@ public function testCreateRoleMapping(): void public function testCreateRoleMappingThrowsWithoutRole(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Missing parameter for the endpoint security.create_role_mapping'); + $this->expectExceptionMessage('role is required for create_role_mapping'); $this->client->security()->createRoleMapping([ 'backend_roles' => ['starfleet', 'captains', 'defectors', 'cn=ldaprole,ou=groups,dc=example,dc=com'], @@ -289,7 +289,7 @@ public function testCreateTenant(): void public function testCreateTenantThrowsWithoutRole(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Missing parameter for the endpoint security.create_tenant'); + $this->expectExceptionMessage('tenant is required for create_tenant'); $this->client->security()->createTenant([ 'description' => 'My test tenant' @@ -334,7 +334,7 @@ public function testCreateUser(): void public function testCreateUserThrowsWithoutUsername(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Missing parameter for the endpoint security.create_user'); + $this->expectExceptionMessage('username is required for create_user'); $this->client->security()->createUser([ 'password' => 'kirkpass', @@ -370,7 +370,7 @@ public function testDeleteActionGroup(): void public function testDeleteActionGroupThrowsWithoutActionGroupName(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Missing parameter for the endpoint security.delete_action_group'); + $this->expectExceptionMessage('action_group is required for delete_action_group'); $this->client->security()->deleteActionGroup(); } @@ -398,7 +398,7 @@ public function testDeleteDistinguishedNames(): void public function testDeleteDistinguishedNamesThrowsWithoutRoleName(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Missing parameter for the endpoint security.delete_distinguished_names'); + $this->expectExceptionMessage('cluster_name is required for delete_distinguished_name'); $this->client->security()->deleteDistinguishedNames(); } @@ -426,7 +426,7 @@ public function testDeleteRole(): void public function testDeleteRoleThrowsWithoutRole(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Missing parameter for the endpoint security.delete_role'); + $this->expectExceptionMessage('role is required for delete_role'); $this->client->security()->deleteRole(); } @@ -454,7 +454,7 @@ public function testDeleteRoleMapping(): void public function testDeleteRoleMappingThrowsWithoutRoleMappingName(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Missing parameter for the endpoint security.delete_role_mapping'); + $this->expectExceptionMessage('role is required for delete_role_mapping'); $this->client->security()->deleteRoleMapping(); } @@ -482,7 +482,7 @@ public function testDeleteTenant(): void public function testDeleteTenantThrowsWithoutTenantName(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Missing parameter for the endpoint security.delete_tenant'); + $this->expectExceptionMessage('tenant is required for delete_tenant'); $this->client->security()->deleteTenant(); } @@ -510,7 +510,7 @@ public function testDeleteUser(): void public function testDeleteUserThrowsWithoutUsername(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Missing parameter for the endpoint security.delete_user'); + $this->expectExceptionMessage('username is required for delete_user'); $this->client->security()->deleteUser(); } @@ -542,7 +542,7 @@ public function testGetAccount(): void public function testGetActionGroups(): void { $this->transport->method('performRequest') - ->with('GET', '/_plugins/_security/api/actiongroups/my_test_action_group', [], null); + ->with('GET', '/_plugins/_security/api/actiongroups', [], null); $this->transport->method('resultOrFuture') ->willReturn([ 'resource' => ['test_resource'], @@ -576,7 +576,7 @@ public function testGetActionGroupsWithoutActionGroupName(): void public function testGetCertificates(): void { $this->transport->method('performRequest') - ->with('GET', '/_opendistro/_security/api/ssl/certs', [], null); + ->with('GET', '/_plugins/_security/api/ssl/certs', [], null); $this->transport->method('resultOrFuture') ->willReturn([ 'resource' => ['test_resource'],