From 763d91a3d506075316b84a38b2bed7a098da5028 Mon Sep 17 00:00:00 2001 From: Enrico Zimuel Date: Wed, 1 Apr 2020 23:45:21 +0200 Subject: [PATCH] Added XPack endpoints + fixed minor issue on endpoint generation --- .gitignore | 1 - src/Elasticsearch/Client.php | 221 +++ .../Endpoints/AsyncSearch/Delete.php | 52 + .../Endpoints/AsyncSearch/Get.php | 56 + .../Endpoints/AsyncSearch/Submit.php | 93 + .../Autoscaling/GetAutoscalingDecision.php | 37 + src/Elasticsearch/Endpoints/Bulk.php | 1 + .../Endpoints/Cat/MlDataFrameAnalytics.php | 60 + .../Endpoints/Cat/MlDatafeeds.php | 60 + src/Elasticsearch/Endpoints/Cat/MlJobs.php | 61 + .../Endpoints/Cat/MlTrainedModels.php | 63 + src/Elasticsearch/Endpoints/Cat/Transform.php | 62 + .../Endpoints/Ccr/DeleteAutoFollowPattern.php | 53 + src/Elasticsearch/Endpoints/Ccr/Follow.php | 54 + .../Endpoints/Ccr/FollowInfo.php | 42 + .../Endpoints/Ccr/FollowStats.php | 42 + .../Endpoints/Ccr/ForgetFollower.php | 52 + .../Endpoints/Ccr/GetAutoFollowPattern.php | 52 + .../Endpoints/Ccr/PauseAutoFollowPattern.php | 53 + .../Endpoints/Ccr/PauseFollow.php | 42 + .../Endpoints/Ccr/PutAutoFollowPattern.php | 63 + .../Endpoints/Ccr/ResumeAutoFollowPattern.php | 53 + .../Endpoints/Ccr/ResumeFollow.php | 52 + src/Elasticsearch/Endpoints/Ccr/Stats.php | 37 + src/Elasticsearch/Endpoints/Ccr/Unfollow.php | 42 + .../DeleteTransform.php | 55 + .../GetTransform.php | 56 + .../GetTransformStats.php | 57 + .../PreviewTransform.php | 47 + .../PutTransform.php | 65 + .../StartTransform.php | 55 + .../StopTransform.php | 57 + .../UpdateTransform.php | 65 + .../Endpoints/Enrich/DeletePolicy.php | 53 + .../Endpoints/Enrich/ExecutePolicy.php | 55 + .../Endpoints/Enrich/GetPolicy.php | 55 + .../Endpoints/Enrich/PutPolicy.php | 63 + src/Elasticsearch/Endpoints/Enrich/Stats.php | 37 + src/Elasticsearch/Endpoints/Eql/Search.php | 54 + src/Elasticsearch/Endpoints/Graph/Explore.php | 64 + .../Endpoints/Ilm/DeleteLifecycle.php | 55 + .../Endpoints/Ilm/ExplainLifecycle.php | 45 + .../Endpoints/Ilm/GetLifecycle.php | 54 + src/Elasticsearch/Endpoints/Ilm/GetStatus.php | 39 + .../Endpoints/Ilm/MoveToStep.php | 54 + .../Endpoints/Ilm/PutLifecycle.php | 65 + .../Endpoints/Ilm/RemovePolicy.php | 44 + src/Elasticsearch/Endpoints/Ilm/Retry.php | 44 + src/Elasticsearch/Endpoints/Ilm/Start.php | 39 + src/Elasticsearch/Endpoints/Ilm/Stop.php | 39 + .../Endpoints/Indices/Freeze.php | 49 + .../Indices/ReloadSearchAnalyzers.php | 46 + .../Endpoints/Indices/Unfreeze.php | 49 + .../Endpoints/License/Delete.php | 37 + src/Elasticsearch/Endpoints/License/Get.php | 40 + .../Endpoints/License/GetBasicStatus.php | 39 + .../Endpoints/License/GetTrialStatus.php | 39 + src/Elasticsearch/Endpoints/License/Post.php | 49 + .../Endpoints/License/PostStartBasic.php | 39 + .../Endpoints/License/PostStartTrial.php | 40 + .../Endpoints/Migration/Deprecations.php | 43 + src/Elasticsearch/Endpoints/Ml/CloseJob.php | 67 + .../Endpoints/Ml/DeleteCalendar.php | 53 + .../Endpoints/Ml/DeleteCalendarEvent.php | 65 + .../Endpoints/Ml/DeleteCalendarJob.php | 65 + .../Endpoints/Ml/DeleteDataFrameAnalytics.php | 54 + .../Endpoints/Ml/DeleteDatafeed.php | 55 + .../Endpoints/Ml/DeleteExpiredData.php | 37 + .../Endpoints/Ml/DeleteFilter.php | 53 + .../Endpoints/Ml/DeleteForecast.php | 73 + src/Elasticsearch/Endpoints/Ml/DeleteJob.php | 56 + .../Endpoints/Ml/DeleteModelSnapshot.php | 65 + .../Endpoints/Ml/DeleteTrainedModel.php | 53 + .../Endpoints/Ml/EstimateModelMemory.php | 49 + .../Endpoints/Ml/EvaluateDataFrame.php | 47 + .../Ml/ExplainDataFrameAnalytics.php | 61 + .../Endpoints/Ml/FindFileStructure.php | 80 + src/Elasticsearch/Endpoints/Ml/FlushJob.php | 69 + src/Elasticsearch/Endpoints/Ml/Forecast.php | 56 + src/Elasticsearch/Endpoints/Ml/GetBuckets.php | 90 + .../Endpoints/Ml/GetCalendarEvents.php | 59 + .../Endpoints/Ml/GetCalendars.php | 65 + .../Endpoints/Ml/GetCategories.php | 83 + .../Endpoints/Ml/GetDataFrameAnalytics.php | 55 + .../Ml/GetDataFrameAnalyticsStats.php | 55 + .../Endpoints/Ml/GetDatafeedStats.php | 54 + .../Endpoints/Ml/GetDatafeeds.php | 54 + src/Elasticsearch/Endpoints/Ml/GetFilters.php | 55 + .../Endpoints/Ml/GetInfluencers.php | 72 + .../Endpoints/Ml/GetJobStats.php | 54 + src/Elasticsearch/Endpoints/Ml/GetJobs.php | 54 + .../Endpoints/Ml/GetModelSnapshots.php | 87 + .../Endpoints/Ml/GetOverallBuckets.php | 71 + src/Elasticsearch/Endpoints/Ml/GetRecords.php | 72 + .../Endpoints/Ml/GetTrainedModels.php | 59 + .../Endpoints/Ml/GetTrainedModelsStats.php | 56 + src/Elasticsearch/Endpoints/Ml/Info.php | 37 + src/Elasticsearch/Endpoints/Ml/OpenJob.php | 53 + .../Endpoints/Ml/PostCalendarEvents.php | 63 + src/Elasticsearch/Endpoints/Ml/PostData.php | 84 + .../Endpoints/Ml/PreviewDatafeed.php | 53 + .../Endpoints/Ml/PutCalendar.php | 63 + .../Endpoints/Ml/PutCalendarJob.php | 65 + .../Endpoints/Ml/PutDataFrameAnalytics.php | 62 + .../Endpoints/Ml/PutDatafeed.php | 68 + src/Elasticsearch/Endpoints/Ml/PutFilter.php | 63 + src/Elasticsearch/Endpoints/Ml/PutJob.php | 63 + .../Endpoints/Ml/PutTrainedModel.php | 63 + .../Endpoints/Ml/RevertModelSnapshot.php | 77 + .../Endpoints/Ml/SetUpgradeMode.php | 40 + .../Endpoints/Ml/StartDataFrameAnalytics.php | 64 + .../Endpoints/Ml/StartDatafeed.php | 67 + .../Endpoints/Ml/StopDataFrameAnalytics.php | 66 + .../Endpoints/Ml/StopDatafeed.php | 57 + .../Endpoints/Ml/UpdateDatafeed.php | 68 + .../Endpoints/Ml/UpdateFilter.php | 63 + src/Elasticsearch/Endpoints/Ml/UpdateJob.php | 63 + .../Endpoints/Ml/UpdateModelSnapshot.php | 77 + src/Elasticsearch/Endpoints/Ml/Validate.php | 49 + .../Endpoints/Ml/ValidateDetector.php | 49 + .../Endpoints/Monitoring/Bulk.php | 76 + src/Elasticsearch/Endpoints/Msearch.php | 1 + .../Endpoints/MsearchTemplate.php | 1 + .../Endpoints/Rollup/DeleteJob.php | 52 + .../Endpoints/Rollup/GetJobs.php | 51 + .../Endpoints/Rollup/GetRollupCaps.php | 51 + .../Endpoints/Rollup/GetRollupIndexCaps.php | 42 + src/Elasticsearch/Endpoints/Rollup/PutJob.php | 62 + .../Endpoints/Rollup/RollupSearch.php | 64 + .../Endpoints/Rollup/StartJob.php | 52 + .../Endpoints/Rollup/StopJob.php | 55 + .../Endpoints/Security/Authenticate.php | 39 + .../Endpoints/Security/ChangePassword.php | 64 + .../Endpoints/Security/ClearCachedRealms.php | 58 + .../Endpoints/Security/ClearCachedRoles.php | 58 + .../Endpoints/Security/CreateApiKey.php | 49 + .../Endpoints/Security/DeletePrivileges.php | 67 + .../Endpoints/Security/DeleteRole.php | 55 + .../Endpoints/Security/DeleteRoleMapping.php | 55 + .../Endpoints/Security/DeleteUser.php | 55 + .../Endpoints/Security/DisableUser.php | 55 + .../Endpoints/Security/EnableUser.php | 55 + .../Endpoints/Security/GetApiKey.php | 43 + .../Security/GetBuiltinPrivileges.php | 39 + .../Endpoints/Security/GetPrivileges.php | 69 + .../Endpoints/Security/GetRole.php | 54 + .../Endpoints/Security/GetRoleMapping.php | 54 + .../Endpoints/Security/GetToken.php | 49 + .../Endpoints/Security/GetUser.php | 57 + .../Endpoints/Security/GetUserPrivileges.php | 39 + .../Endpoints/Security/HasPrivileges.php | 64 + .../Endpoints/Security/InvalidateApiKey.php | 47 + .../Endpoints/Security/InvalidateToken.php | 49 + .../Endpoints/Security/PutPrivileges.php | 49 + .../Endpoints/Security/PutRole.php | 65 + .../Endpoints/Security/PutRoleMapping.php | 65 + .../Endpoints/Security/PutUser.php | 65 + .../Endpoints/Slm/DeleteLifecycle.php | 55 + .../Endpoints/Slm/ExecuteLifecycle.php | 55 + .../Endpoints/Slm/ExecuteRetention.php | 39 + .../Endpoints/Slm/GetLifecycle.php | 57 + src/Elasticsearch/Endpoints/Slm/GetStats.php | 39 + src/Elasticsearch/Endpoints/Slm/GetStatus.php | 39 + .../Endpoints/Slm/PutLifecycle.php | 65 + src/Elasticsearch/Endpoints/Slm/Start.php | 39 + src/Elasticsearch/Endpoints/Slm/Stop.php | 39 + .../Endpoints/Sql/ClearCursor.php | 47 + src/Elasticsearch/Endpoints/Sql/Query.php | 49 + src/Elasticsearch/Endpoints/Sql/Translate.php | 49 + .../Endpoints/Ssl/Certificates.php | 39 + .../Endpoints/Transform/DeleteTransform.php | 55 + .../Endpoints/Transform/GetTransform.php | 56 + .../Endpoints/Transform/GetTransformStats.php | 57 + .../Endpoints/Transform/PreviewTransform.php | 47 + .../Endpoints/Transform/PutTransform.php | 65 + .../Endpoints/Transform/StartTransform.php | 55 + .../Endpoints/Transform/StopTransform.php | 59 + .../Endpoints/Transform/UpdateTransform.php | 65 + .../Endpoints/Watcher/AckWatch.php | 73 + .../Endpoints/Watcher/ActivateWatch.php | 53 + .../Endpoints/Watcher/DeactivateWatch.php | 53 + .../Endpoints/Watcher/DeleteWatch.php | 52 + .../Endpoints/Watcher/ExecuteWatch.php | 63 + .../Endpoints/Watcher/GetWatch.php | 54 + .../Endpoints/Watcher/PutWatch.php | 67 + src/Elasticsearch/Endpoints/Watcher/Start.php | 39 + src/Elasticsearch/Endpoints/Watcher/Stats.php | 58 + src/Elasticsearch/Endpoints/Watcher/Stop.php | 39 + src/Elasticsearch/Endpoints/Xpack/Info.php | 39 + src/Elasticsearch/Endpoints/Xpack/Usage.php | 39 + .../Namespaces/AsyncSearchNamespace.php | 122 ++ .../Namespaces/AutoscalingNamespace.php | 30 + src/Elasticsearch/Namespaces/CatNamespace.php | 132 ++ src/Elasticsearch/Namespaces/CcrNamespace.php | 259 +++ .../DataFrameTransformDeprecatedNamespace.php | 198 +++ .../Namespaces/EnrichNamespace.php | 106 ++ src/Elasticsearch/Namespaces/EqlNamespace.php | 45 + .../Namespaces/GraphNamespace.php | 47 + src/Elasticsearch/Namespaces/IlmNamespace.php | 200 +++ .../Namespaces/IndicesNamespace.php | 69 + .../Namespaces/LicenseNamespace.php | 129 ++ .../Namespaces/MigrationNamespace.php | 39 + src/Elasticsearch/Namespaces/MlNamespace.php | 1304 ++++++++++++++ .../Namespaces/MonitoringNamespace.php | 48 + .../Namespaces/RollupNamespace.php | 194 +++ .../Namespaces/SecurityNamespace.php | 509 ++++++ src/Elasticsearch/Namespaces/SlmNamespace.php | 171 ++ src/Elasticsearch/Namespaces/SqlNamespace.php | 69 + src/Elasticsearch/Namespaces/SslNamespace.php | 36 + .../Namespaces/TransformNamespace.php | 179 ++ .../Namespaces/WatcherNamespace.php | 210 +++ .../Namespaces/XpackNamespace.php | 53 + util/ClientEndpoint.php | 17 +- util/Endpoint.php | 19 +- util/GenerateEndpoints.php | 14 +- util/NamespaceEndpoint.php | 11 +- util/output/7.6.1/Client.php | 1529 +++++++++++++++++ util/output/7.6.1/Endpoints/Bulk.php | 86 + util/output/7.6.1/Endpoints/Cat/Aliases.php | 62 + .../output/7.6.1/Endpoints/Cat/Allocation.php | 64 + util/output/7.6.1/Endpoints/Cat/Count.php | 47 + util/output/7.6.1/Endpoints/Cat/Fielddata.php | 63 + util/output/7.6.1/Endpoints/Cat/Health.php | 45 + util/output/7.6.1/Endpoints/Cat/Help.php | 40 + util/output/7.6.1/Endpoints/Cat/Indices.php | 54 + util/output/7.6.1/Endpoints/Cat/Master.php | 45 + util/output/7.6.1/Endpoints/Cat/NodeAttrs.php | 45 + util/output/7.6.1/Endpoints/Cat/Nodes.php | 48 + .../7.6.1/Endpoints/Cat/PendingTasks.php | 46 + util/output/7.6.1/Endpoints/Cat/Plugins.php | 45 + util/output/7.6.1/Endpoints/Cat/Recovery.php | 52 + .../7.6.1/Endpoints/Cat/Repositories.php | 45 + util/output/7.6.1/Endpoints/Cat/Segments.php | 48 + util/output/7.6.1/Endpoints/Cat/Shards.php | 51 + util/output/7.6.1/Endpoints/Cat/Snapshots.php | 64 + util/output/7.6.1/Endpoints/Cat/Tasks.php | 48 + util/output/7.6.1/Endpoints/Cat/Templates.php | 60 + .../output/7.6.1/Endpoints/Cat/ThreadPool.php | 64 + .../Endpoints/Ccr/DeleteAutoFollowPattern.php | 53 + util/output/7.6.1/Endpoints/Ccr/Follow.php | 54 + .../output/7.6.1/Endpoints/Ccr/FollowInfo.php | 42 + .../7.6.1/Endpoints/Ccr/FollowStats.php | 42 + .../7.6.1/Endpoints/Ccr/ForgetFollower.php | 52 + .../Endpoints/Ccr/GetAutoFollowPattern.php | 52 + .../Endpoints/Ccr/PauseAutoFollowPattern.php | 53 + .../7.6.1/Endpoints/Ccr/PauseFollow.php | 42 + .../Endpoints/Ccr/PutAutoFollowPattern.php | 63 + .../Endpoints/Ccr/ResumeAutoFollowPattern.php | 53 + .../7.6.1/Endpoints/Ccr/ResumeFollow.php | 52 + util/output/7.6.1/Endpoints/Ccr/Stats.php | 37 + util/output/7.6.1/Endpoints/Ccr/Unfollow.php | 42 + util/output/7.6.1/Endpoints/ClearScroll.php | 70 + .../Endpoints/Cluster/AllocationExplain.php | 50 + .../7.6.1/Endpoints/Cluster/GetSettings.php | 42 + .../output/7.6.1/Endpoints/Cluster/Health.php | 53 + .../7.6.1/Endpoints/Cluster/PendingTasks.php | 40 + .../7.6.1/Endpoints/Cluster/PutSettings.php | 51 + .../7.6.1/Endpoints/Cluster/RemoteInfo.php | 39 + .../7.6.1/Endpoints/Cluster/Reroute.php | 54 + util/output/7.6.1/Endpoints/Cluster/State.php | 68 + util/output/7.6.1/Endpoints/Cluster/Stats.php | 58 + util/output/7.6.1/Endpoints/Count.php | 73 + util/output/7.6.1/Endpoints/Create.php | 85 + .../DeleteTransform.php | 55 + .../GetTransform.php | 56 + .../GetTransformStats.php | 57 + .../PreviewTransform.php | 47 + .../PutTransform.php | 65 + .../StartTransform.php | 55 + .../StopTransform.php | 57 + .../UpdateTransform.php | 65 + util/output/7.6.1/Endpoints/Delete.php | 76 + util/output/7.6.1/Endpoints/DeleteByQuery.php | 95 + .../Endpoints/DeleteByQueryRethrottle.php | 55 + util/output/7.6.1/Endpoints/DeleteScript.php | 55 + .../7.6.1/Endpoints/Enrich/DeletePolicy.php | 53 + .../7.6.1/Endpoints/Enrich/ExecutePolicy.php | 55 + .../7.6.1/Endpoints/Enrich/GetPolicy.php | 55 + .../7.6.1/Endpoints/Enrich/PutPolicy.php | 63 + util/output/7.6.1/Endpoints/Enrich/Stats.php | 37 + util/output/7.6.1/Endpoints/Exists.php | 78 + util/output/7.6.1/Endpoints/ExistsSource.php | 77 + util/output/7.6.1/Endpoints/Explain.php | 90 + util/output/7.6.1/Endpoints/FieldCaps.php | 47 + util/output/7.6.1/Endpoints/Get.php | 78 + util/output/7.6.1/Endpoints/GetScript.php | 54 + .../7.6.1/Endpoints/GetScriptContext.php | 39 + .../7.6.1/Endpoints/GetScriptLanguages.php | 39 + util/output/7.6.1/Endpoints/GetSource.php | 77 + util/output/7.6.1/Endpoints/Graph/Explore.php | 64 + .../7.6.1/Endpoints/Ilm/DeleteLifecycle.php | 55 + .../7.6.1/Endpoints/Ilm/ExplainLifecycle.php | 45 + .../7.6.1/Endpoints/Ilm/GetLifecycle.php | 54 + util/output/7.6.1/Endpoints/Ilm/GetStatus.php | 39 + .../output/7.6.1/Endpoints/Ilm/MoveToStep.php | 54 + .../7.6.1/Endpoints/Ilm/PutLifecycle.php | 65 + .../7.6.1/Endpoints/Ilm/RemovePolicy.php | 44 + util/output/7.6.1/Endpoints/Ilm/Retry.php | 44 + util/output/7.6.1/Endpoints/Ilm/Start.php | 39 + util/output/7.6.1/Endpoints/Ilm/Stop.php | 39 + util/output/7.6.1/Endpoints/Index.php | 89 + .../7.6.1/Endpoints/Indices/Analyze.php | 53 + .../7.6.1/Endpoints/Indices/ClearCache.php | 50 + .../7.6.1/Endpoints/Indices/CloneIndices.php | 68 + util/output/7.6.1/Endpoints/Indices/Close.php | 49 + .../output/7.6.1/Endpoints/Indices/Create.php | 57 + .../output/7.6.1/Endpoints/Indices/Delete.php | 48 + .../7.6.1/Endpoints/Indices/DeleteAlias.php | 67 + .../Endpoints/Indices/DeleteTemplate.php | 56 + .../output/7.6.1/Endpoints/Indices/Exists.php | 49 + .../7.6.1/Endpoints/Indices/ExistsAlias.php | 67 + .../Endpoints/Indices/ExistsTemplate.php | 60 + .../7.6.1/Endpoints/Indices/ExistsType.php | 51 + util/output/7.6.1/Endpoints/Indices/Flush.php | 47 + .../7.6.1/Endpoints/Indices/FlushSynced.php | 45 + .../7.6.1/Endpoints/Indices/ForceMerge.php | 48 + .../output/7.6.1/Endpoints/Indices/Freeze.php | 49 + util/output/7.6.1/Endpoints/Indices/Get.php | 51 + .../7.6.1/Endpoints/Indices/GetAlias.php | 67 + .../Endpoints/Indices/GetFieldMapping.php | 79 + .../7.6.1/Endpoints/Indices/GetMapping.php | 58 + .../7.6.1/Endpoints/Indices/GetSettings.php | 70 + .../7.6.1/Endpoints/Indices/GetTemplate.php | 60 + .../7.6.1/Endpoints/Indices/GetUpgrade.php | 45 + util/output/7.6.1/Endpoints/Indices/Open.php | 49 + .../7.6.1/Endpoints/Indices/PutAlias.php | 74 + .../7.6.1/Endpoints/Indices/PutMapping.php | 69 + .../7.6.1/Endpoints/Indices/PutSettings.php | 59 + .../7.6.1/Endpoints/Indices/PutTemplate.php | 70 + .../7.6.1/Endpoints/Indices/Recovery.php | 44 + .../7.6.1/Endpoints/Indices/Refresh.php | 45 + .../Indices/ReloadSearchAnalyzers.php | 46 + .../7.6.1/Endpoints/Indices/Rollover.php | 86 + .../7.6.1/Endpoints/Indices/Segments.php | 46 + .../7.6.1/Endpoints/Indices/ShardStores.php | 46 + .../output/7.6.1/Endpoints/Indices/Shrink.php | 69 + util/output/7.6.1/Endpoints/Indices/Split.php | 69 + util/output/7.6.1/Endpoints/Indices/Stats.php | 73 + .../7.6.1/Endpoints/Indices/Unfreeze.php | 49 + .../7.6.1/Endpoints/Indices/UpdateAliases.php | 50 + .../7.6.1/Endpoints/Indices/Upgrade.php | 47 + .../7.6.1/Endpoints/Indices/ValidateQuery.php | 71 + util/output/7.6.1/Endpoints/Info.php | 39 + .../7.6.1/Endpoints/Ingest/DeletePipeline.php | 55 + .../7.6.1/Endpoints/Ingest/GetPipeline.php | 53 + .../7.6.1/Endpoints/Ingest/ProcessorGrok.php | 39 + .../7.6.1/Endpoints/Ingest/PutPipeline.php | 65 + .../7.6.1/Endpoints/Ingest/Simulate.php | 63 + .../output/7.6.1/Endpoints/License/Delete.php | 37 + util/output/7.6.1/Endpoints/License/Get.php | 40 + .../Endpoints/License/GetBasicStatus.php | 39 + .../Endpoints/License/GetTrialStatus.php | 39 + util/output/7.6.1/Endpoints/License/Post.php | 49 + .../Endpoints/License/PostStartBasic.php | 39 + .../Endpoints/License/PostStartTrial.php | 40 + util/output/7.6.1/Endpoints/MTermVectors.php | 71 + util/output/7.6.1/Endpoints/Mget.php | 67 + .../Endpoints/Migration/Deprecations.php | 43 + util/output/7.6.1/Endpoints/Ml/CloseJob.php | 67 + .../7.6.1/Endpoints/Ml/DeleteCalendar.php | 53 + .../Endpoints/Ml/DeleteCalendarEvent.php | 65 + .../7.6.1/Endpoints/Ml/DeleteCalendarJob.php | 65 + .../Endpoints/Ml/DeleteDataFrameAnalytics.php | 54 + .../7.6.1/Endpoints/Ml/DeleteDatafeed.php | 55 + .../7.6.1/Endpoints/Ml/DeleteExpiredData.php | 37 + .../7.6.1/Endpoints/Ml/DeleteFilter.php | 53 + .../7.6.1/Endpoints/Ml/DeleteForecast.php | 73 + util/output/7.6.1/Endpoints/Ml/DeleteJob.php | 56 + .../Endpoints/Ml/DeleteModelSnapshot.php | 65 + .../7.6.1/Endpoints/Ml/DeleteTrainedModel.php | 53 + .../7.6.1/Endpoints/Ml/EvaluateDataFrame.php | 47 + .../Ml/ExplainDataFrameAnalytics.php | 61 + .../7.6.1/Endpoints/Ml/FindFileStructure.php | 80 + util/output/7.6.1/Endpoints/Ml/FlushJob.php | 69 + util/output/7.6.1/Endpoints/Ml/Forecast.php | 56 + util/output/7.6.1/Endpoints/Ml/GetBuckets.php | 90 + .../7.6.1/Endpoints/Ml/GetCalendarEvents.php | 59 + .../7.6.1/Endpoints/Ml/GetCalendars.php | 65 + .../7.6.1/Endpoints/Ml/GetCategories.php | 83 + .../Endpoints/Ml/GetDataFrameAnalytics.php | 55 + .../Ml/GetDataFrameAnalyticsStats.php | 55 + .../7.6.1/Endpoints/Ml/GetDatafeedStats.php | 54 + .../7.6.1/Endpoints/Ml/GetDatafeeds.php | 54 + util/output/7.6.1/Endpoints/Ml/GetFilters.php | 55 + .../7.6.1/Endpoints/Ml/GetInfluencers.php | 72 + .../output/7.6.1/Endpoints/Ml/GetJobStats.php | 54 + util/output/7.6.1/Endpoints/Ml/GetJobs.php | 54 + .../7.6.1/Endpoints/Ml/GetModelSnapshots.php | 87 + .../7.6.1/Endpoints/Ml/GetOverallBuckets.php | 71 + util/output/7.6.1/Endpoints/Ml/GetRecords.php | 72 + .../7.6.1/Endpoints/Ml/GetTrainedModels.php | 58 + .../Endpoints/Ml/GetTrainedModelsStats.php | 56 + util/output/7.6.1/Endpoints/Ml/Info.php | 37 + util/output/7.6.1/Endpoints/Ml/OpenJob.php | 53 + .../7.6.1/Endpoints/Ml/PostCalendarEvents.php | 63 + util/output/7.6.1/Endpoints/Ml/PostData.php | 82 + .../7.6.1/Endpoints/Ml/PreviewDatafeed.php | 53 + .../output/7.6.1/Endpoints/Ml/PutCalendar.php | 63 + .../7.6.1/Endpoints/Ml/PutCalendarJob.php | 65 + .../Endpoints/Ml/PutDataFrameAnalytics.php | 62 + .../output/7.6.1/Endpoints/Ml/PutDatafeed.php | 63 + util/output/7.6.1/Endpoints/Ml/PutFilter.php | 63 + util/output/7.6.1/Endpoints/Ml/PutJob.php | 63 + .../7.6.1/Endpoints/Ml/PutTrainedModel.php | 63 + .../Endpoints/Ml/RevertModelSnapshot.php | 77 + .../7.6.1/Endpoints/Ml/SetUpgradeMode.php | 40 + .../Endpoints/Ml/StartDataFrameAnalytics.php | 64 + .../7.6.1/Endpoints/Ml/StartDatafeed.php | 67 + .../Endpoints/Ml/StopDataFrameAnalytics.php | 66 + .../7.6.1/Endpoints/Ml/StopDatafeed.php | 57 + .../7.6.1/Endpoints/Ml/UpdateDatafeed.php | 63 + .../7.6.1/Endpoints/Ml/UpdateFilter.php | 63 + util/output/7.6.1/Endpoints/Ml/UpdateJob.php | 63 + .../Endpoints/Ml/UpdateModelSnapshot.php | 77 + util/output/7.6.1/Endpoints/Ml/Validate.php | 49 + .../7.6.1/Endpoints/Ml/ValidateDetector.php | 49 + .../7.6.1/Endpoints/Monitoring/Bulk.php | 76 + util/output/7.6.1/Endpoints/Msearch.php | 84 + .../7.6.1/Endpoints/MsearchTemplate.php | 82 + .../7.6.1/Endpoints/Nodes/HotThreads.php | 62 + util/output/7.6.1/Endpoints/Nodes/Info.php | 79 + .../Endpoints/Nodes/ReloadSecureSettings.php | 57 + util/output/7.6.1/Endpoints/Nodes/Stats.php | 106 ++ util/output/7.6.1/Endpoints/Nodes/Usage.php | 78 + util/output/7.6.1/Endpoints/Ping.php | 39 + util/output/7.6.1/Endpoints/PutScript.php | 83 + util/output/7.6.1/Endpoints/RankEval.php | 56 + util/output/7.6.1/Endpoints/Reindex.php | 56 + .../7.6.1/Endpoints/ReindexRethrottle.php | 55 + .../7.6.1/Endpoints/RenderSearchTemplate.php | 61 + .../7.6.1/Endpoints/Rollup/DeleteJob.php | 52 + .../output/7.6.1/Endpoints/Rollup/GetJobs.php | 51 + .../7.6.1/Endpoints/Rollup/GetRollupCaps.php | 51 + .../Endpoints/Rollup/GetRollupIndexCaps.php | 42 + util/output/7.6.1/Endpoints/Rollup/PutJob.php | 62 + .../7.6.1/Endpoints/Rollup/RollupSearch.php | 64 + .../7.6.1/Endpoints/Rollup/StartJob.php | 52 + .../output/7.6.1/Endpoints/Rollup/StopJob.php | 55 + .../Endpoints/ScriptsPainlessExecute.php | 49 + util/output/7.6.1/Endpoints/Scroll.php | 69 + util/output/7.6.1/Endpoints/Search.php | 101 ++ util/output/7.6.1/Endpoints/SearchShards.php | 48 + .../output/7.6.1/Endpoints/SearchTemplate.php | 72 + .../7.6.1/Endpoints/Security/Authenticate.php | 39 + .../Endpoints/Security/ChangePassword.php | 64 + .../Endpoints/Security/ClearCachedRealms.php | 58 + .../Endpoints/Security/ClearCachedRoles.php | 58 + .../7.6.1/Endpoints/Security/CreateApiKey.php | 49 + .../Endpoints/Security/DeletePrivileges.php | 67 + .../7.6.1/Endpoints/Security/DeleteRole.php | 55 + .../Endpoints/Security/DeleteRoleMapping.php | 55 + .../7.6.1/Endpoints/Security/DeleteUser.php | 55 + .../7.6.1/Endpoints/Security/DisableUser.php | 55 + .../7.6.1/Endpoints/Security/EnableUser.php | 55 + .../7.6.1/Endpoints/Security/GetApiKey.php | 43 + .../Security/GetBuiltinPrivileges.php | 39 + .../Endpoints/Security/GetPrivileges.php | 69 + .../7.6.1/Endpoints/Security/GetRole.php | 54 + .../Endpoints/Security/GetRoleMapping.php | 54 + .../7.6.1/Endpoints/Security/GetToken.php | 49 + .../7.6.1/Endpoints/Security/GetUser.php | 57 + .../Endpoints/Security/GetUserPrivileges.php | 39 + .../Endpoints/Security/HasPrivileges.php | 64 + .../Endpoints/Security/InvalidateApiKey.php | 47 + .../Endpoints/Security/InvalidateToken.php | 49 + .../Endpoints/Security/PutPrivileges.php | 49 + .../7.6.1/Endpoints/Security/PutRole.php | 65 + .../Endpoints/Security/PutRoleMapping.php | 65 + .../7.6.1/Endpoints/Security/PutUser.php | 65 + .../7.6.1/Endpoints/Slm/DeleteLifecycle.php | 55 + .../7.6.1/Endpoints/Slm/ExecuteLifecycle.php | 55 + .../7.6.1/Endpoints/Slm/ExecuteRetention.php | 39 + .../7.6.1/Endpoints/Slm/GetLifecycle.php | 57 + util/output/7.6.1/Endpoints/Slm/GetStats.php | 39 + util/output/7.6.1/Endpoints/Slm/GetStatus.php | 39 + .../7.6.1/Endpoints/Slm/PutLifecycle.php | 65 + util/output/7.6.1/Endpoints/Slm/Start.php | 39 + util/output/7.6.1/Endpoints/Slm/Stop.php | 39 + .../Endpoints/Snapshot/CleanupRepository.php | 56 + .../7.6.1/Endpoints/Snapshot/Create.php | 78 + .../Endpoints/Snapshot/CreateRepository.php | 67 + .../7.6.1/Endpoints/Snapshot/Delete.php | 67 + .../Endpoints/Snapshot/DeleteRepository.php | 59 + util/output/7.6.1/Endpoints/Snapshot/Get.php | 72 + .../Endpoints/Snapshot/GetRepository.php | 58 + .../7.6.1/Endpoints/Snapshot/Restore.php | 78 + .../7.6.1/Endpoints/Snapshot/Status.php | 73 + .../Endpoints/Snapshot/VerifyRepository.php | 56 + .../7.6.1/Endpoints/Sql/ClearCursor.php | 47 + util/output/7.6.1/Endpoints/Sql/Query.php | 49 + util/output/7.6.1/Endpoints/Sql/Translate.php | 49 + .../7.6.1/Endpoints/Ssl/Certificates.php | 39 + util/output/7.6.1/Endpoints/Tasks/Cancel.php | 56 + util/output/7.6.1/Endpoints/Tasks/Get.php | 56 + .../7.6.1/Endpoints/Tasks/ListTasks.php | 45 + util/output/7.6.1/Endpoints/TermVectors.php | 90 + .../Endpoints/Transform/DeleteTransform.php | 55 + .../Endpoints/Transform/GetTransform.php | 56 + .../Endpoints/Transform/GetTransformStats.php | 57 + .../Endpoints/Transform/PreviewTransform.php | 47 + .../Endpoints/Transform/PutTransform.php | 65 + .../Endpoints/Transform/StartTransform.php | 55 + .../Endpoints/Transform/StopTransform.php | 59 + .../Endpoints/Transform/UpdateTransform.php | 65 + util/output/7.6.1/Endpoints/Update.php | 89 + util/output/7.6.1/Endpoints/UpdateByQuery.php | 97 ++ .../Endpoints/UpdateByQueryRethrottle.php | 55 + .../7.6.1/Endpoints/Watcher/AckWatch.php | 73 + .../7.6.1/Endpoints/Watcher/ActivateWatch.php | 53 + .../Endpoints/Watcher/DeactivateWatch.php | 53 + .../7.6.1/Endpoints/Watcher/DeleteWatch.php | 52 + .../7.6.1/Endpoints/Watcher/ExecuteWatch.php | 63 + .../7.6.1/Endpoints/Watcher/GetWatch.php | 54 + .../7.6.1/Endpoints/Watcher/PutWatch.php | 67 + util/output/7.6.1/Endpoints/Watcher/Start.php | 39 + util/output/7.6.1/Endpoints/Watcher/Stats.php | 58 + util/output/7.6.1/Endpoints/Watcher/Stop.php | 39 + util/output/7.6.1/Endpoints/Xpack/Info.php | 39 + util/output/7.6.1/Endpoints/Xpack/Usage.php | 39 + util/output/7.6.1/Namespaces/CatNamespace.php | 503 ++++++ util/output/7.6.1/Namespaces/CcrNamespace.php | 259 +++ .../7.6.1/Namespaces/ClusterNamespace.php | 215 +++ .../DataFrameTransformDeprecatedNamespace.php | 198 +++ .../7.6.1/Namespaces/EnrichNamespace.php | 102 ++ .../7.6.1/Namespaces/GraphNamespace.php | 47 + util/output/7.6.1/Namespaces/IlmNamespace.php | 200 +++ .../7.6.1/Namespaces/IndicesNamespace.php | 1057 ++++++++++++ .../7.6.1/Namespaces/IngestNamespace.php | 120 ++ .../7.6.1/Namespaces/LicenseNamespace.php | 129 ++ .../7.6.1/Namespaces/MigrationNamespace.php | 39 + util/output/7.6.1/Namespaces/MlNamespace.php | 1278 ++++++++++++++ .../7.6.1/Namespaces/MonitoringNamespace.php | 48 + .../7.6.1/Namespaces/NodesNamespace.php | 141 ++ .../7.6.1/Namespaces/RollupNamespace.php | 202 +++ .../7.6.1/Namespaces/SecurityNamespace.php | 509 ++++++ util/output/7.6.1/Namespaces/SlmNamespace.php | 171 ++ .../7.6.1/Namespaces/SnapshotNamespace.php | 246 +++ util/output/7.6.1/Namespaces/SqlNamespace.php | 69 + util/output/7.6.1/Namespaces/SslNamespace.php | 36 + .../7.6.1/Namespaces/TasksNamespace.php | 91 + .../7.6.1/Namespaces/TransformNamespace.php | 200 +++ .../7.6.1/Namespaces/WatcherNamespace.php | 210 +++ .../7.6.1/Namespaces/XpackNamespace.php | 53 + util/template/client-class | 1 + util/template/endpoint-bulk-class | 4 +- 545 files changed, 39651 insertions(+), 26 deletions(-) create mode 100644 src/Elasticsearch/Endpoints/AsyncSearch/Delete.php create mode 100644 src/Elasticsearch/Endpoints/AsyncSearch/Get.php create mode 100644 src/Elasticsearch/Endpoints/AsyncSearch/Submit.php create mode 100644 src/Elasticsearch/Endpoints/Autoscaling/GetAutoscalingDecision.php create mode 100644 src/Elasticsearch/Endpoints/Cat/MlDataFrameAnalytics.php create mode 100644 src/Elasticsearch/Endpoints/Cat/MlDatafeeds.php create mode 100644 src/Elasticsearch/Endpoints/Cat/MlJobs.php create mode 100644 src/Elasticsearch/Endpoints/Cat/MlTrainedModels.php create mode 100644 src/Elasticsearch/Endpoints/Cat/Transform.php create mode 100644 src/Elasticsearch/Endpoints/Ccr/DeleteAutoFollowPattern.php create mode 100644 src/Elasticsearch/Endpoints/Ccr/Follow.php create mode 100644 src/Elasticsearch/Endpoints/Ccr/FollowInfo.php create mode 100644 src/Elasticsearch/Endpoints/Ccr/FollowStats.php create mode 100644 src/Elasticsearch/Endpoints/Ccr/ForgetFollower.php create mode 100644 src/Elasticsearch/Endpoints/Ccr/GetAutoFollowPattern.php create mode 100644 src/Elasticsearch/Endpoints/Ccr/PauseAutoFollowPattern.php create mode 100644 src/Elasticsearch/Endpoints/Ccr/PauseFollow.php create mode 100644 src/Elasticsearch/Endpoints/Ccr/PutAutoFollowPattern.php create mode 100644 src/Elasticsearch/Endpoints/Ccr/ResumeAutoFollowPattern.php create mode 100644 src/Elasticsearch/Endpoints/Ccr/ResumeFollow.php create mode 100644 src/Elasticsearch/Endpoints/Ccr/Stats.php create mode 100644 src/Elasticsearch/Endpoints/Ccr/Unfollow.php create mode 100644 src/Elasticsearch/Endpoints/DataFrameTransformDeprecated/DeleteTransform.php create mode 100644 src/Elasticsearch/Endpoints/DataFrameTransformDeprecated/GetTransform.php create mode 100644 src/Elasticsearch/Endpoints/DataFrameTransformDeprecated/GetTransformStats.php create mode 100644 src/Elasticsearch/Endpoints/DataFrameTransformDeprecated/PreviewTransform.php create mode 100644 src/Elasticsearch/Endpoints/DataFrameTransformDeprecated/PutTransform.php create mode 100644 src/Elasticsearch/Endpoints/DataFrameTransformDeprecated/StartTransform.php create mode 100644 src/Elasticsearch/Endpoints/DataFrameTransformDeprecated/StopTransform.php create mode 100644 src/Elasticsearch/Endpoints/DataFrameTransformDeprecated/UpdateTransform.php create mode 100644 src/Elasticsearch/Endpoints/Enrich/DeletePolicy.php create mode 100644 src/Elasticsearch/Endpoints/Enrich/ExecutePolicy.php create mode 100644 src/Elasticsearch/Endpoints/Enrich/GetPolicy.php create mode 100644 src/Elasticsearch/Endpoints/Enrich/PutPolicy.php create mode 100644 src/Elasticsearch/Endpoints/Enrich/Stats.php create mode 100644 src/Elasticsearch/Endpoints/Eql/Search.php create mode 100644 src/Elasticsearch/Endpoints/Graph/Explore.php create mode 100644 src/Elasticsearch/Endpoints/Ilm/DeleteLifecycle.php create mode 100644 src/Elasticsearch/Endpoints/Ilm/ExplainLifecycle.php create mode 100644 src/Elasticsearch/Endpoints/Ilm/GetLifecycle.php create mode 100644 src/Elasticsearch/Endpoints/Ilm/GetStatus.php create mode 100644 src/Elasticsearch/Endpoints/Ilm/MoveToStep.php create mode 100644 src/Elasticsearch/Endpoints/Ilm/PutLifecycle.php create mode 100644 src/Elasticsearch/Endpoints/Ilm/RemovePolicy.php create mode 100644 src/Elasticsearch/Endpoints/Ilm/Retry.php create mode 100644 src/Elasticsearch/Endpoints/Ilm/Start.php create mode 100644 src/Elasticsearch/Endpoints/Ilm/Stop.php create mode 100644 src/Elasticsearch/Endpoints/Indices/Freeze.php create mode 100644 src/Elasticsearch/Endpoints/Indices/ReloadSearchAnalyzers.php create mode 100644 src/Elasticsearch/Endpoints/Indices/Unfreeze.php create mode 100644 src/Elasticsearch/Endpoints/License/Delete.php create mode 100644 src/Elasticsearch/Endpoints/License/Get.php create mode 100644 src/Elasticsearch/Endpoints/License/GetBasicStatus.php create mode 100644 src/Elasticsearch/Endpoints/License/GetTrialStatus.php create mode 100644 src/Elasticsearch/Endpoints/License/Post.php create mode 100644 src/Elasticsearch/Endpoints/License/PostStartBasic.php create mode 100644 src/Elasticsearch/Endpoints/License/PostStartTrial.php create mode 100644 src/Elasticsearch/Endpoints/Migration/Deprecations.php create mode 100644 src/Elasticsearch/Endpoints/Ml/CloseJob.php create mode 100644 src/Elasticsearch/Endpoints/Ml/DeleteCalendar.php create mode 100644 src/Elasticsearch/Endpoints/Ml/DeleteCalendarEvent.php create mode 100644 src/Elasticsearch/Endpoints/Ml/DeleteCalendarJob.php create mode 100644 src/Elasticsearch/Endpoints/Ml/DeleteDataFrameAnalytics.php create mode 100644 src/Elasticsearch/Endpoints/Ml/DeleteDatafeed.php create mode 100644 src/Elasticsearch/Endpoints/Ml/DeleteExpiredData.php create mode 100644 src/Elasticsearch/Endpoints/Ml/DeleteFilter.php create mode 100644 src/Elasticsearch/Endpoints/Ml/DeleteForecast.php create mode 100644 src/Elasticsearch/Endpoints/Ml/DeleteJob.php create mode 100644 src/Elasticsearch/Endpoints/Ml/DeleteModelSnapshot.php create mode 100644 src/Elasticsearch/Endpoints/Ml/DeleteTrainedModel.php create mode 100644 src/Elasticsearch/Endpoints/Ml/EstimateModelMemory.php create mode 100644 src/Elasticsearch/Endpoints/Ml/EvaluateDataFrame.php create mode 100644 src/Elasticsearch/Endpoints/Ml/ExplainDataFrameAnalytics.php create mode 100644 src/Elasticsearch/Endpoints/Ml/FindFileStructure.php create mode 100644 src/Elasticsearch/Endpoints/Ml/FlushJob.php create mode 100644 src/Elasticsearch/Endpoints/Ml/Forecast.php create mode 100644 src/Elasticsearch/Endpoints/Ml/GetBuckets.php create mode 100644 src/Elasticsearch/Endpoints/Ml/GetCalendarEvents.php create mode 100644 src/Elasticsearch/Endpoints/Ml/GetCalendars.php create mode 100644 src/Elasticsearch/Endpoints/Ml/GetCategories.php create mode 100644 src/Elasticsearch/Endpoints/Ml/GetDataFrameAnalytics.php create mode 100644 src/Elasticsearch/Endpoints/Ml/GetDataFrameAnalyticsStats.php create mode 100644 src/Elasticsearch/Endpoints/Ml/GetDatafeedStats.php create mode 100644 src/Elasticsearch/Endpoints/Ml/GetDatafeeds.php create mode 100644 src/Elasticsearch/Endpoints/Ml/GetFilters.php create mode 100644 src/Elasticsearch/Endpoints/Ml/GetInfluencers.php create mode 100644 src/Elasticsearch/Endpoints/Ml/GetJobStats.php create mode 100644 src/Elasticsearch/Endpoints/Ml/GetJobs.php create mode 100644 src/Elasticsearch/Endpoints/Ml/GetModelSnapshots.php create mode 100644 src/Elasticsearch/Endpoints/Ml/GetOverallBuckets.php create mode 100644 src/Elasticsearch/Endpoints/Ml/GetRecords.php create mode 100644 src/Elasticsearch/Endpoints/Ml/GetTrainedModels.php create mode 100644 src/Elasticsearch/Endpoints/Ml/GetTrainedModelsStats.php create mode 100644 src/Elasticsearch/Endpoints/Ml/Info.php create mode 100644 src/Elasticsearch/Endpoints/Ml/OpenJob.php create mode 100644 src/Elasticsearch/Endpoints/Ml/PostCalendarEvents.php create mode 100644 src/Elasticsearch/Endpoints/Ml/PostData.php create mode 100644 src/Elasticsearch/Endpoints/Ml/PreviewDatafeed.php create mode 100644 src/Elasticsearch/Endpoints/Ml/PutCalendar.php create mode 100644 src/Elasticsearch/Endpoints/Ml/PutCalendarJob.php create mode 100644 src/Elasticsearch/Endpoints/Ml/PutDataFrameAnalytics.php create mode 100644 src/Elasticsearch/Endpoints/Ml/PutDatafeed.php create mode 100644 src/Elasticsearch/Endpoints/Ml/PutFilter.php create mode 100644 src/Elasticsearch/Endpoints/Ml/PutJob.php create mode 100644 src/Elasticsearch/Endpoints/Ml/PutTrainedModel.php create mode 100644 src/Elasticsearch/Endpoints/Ml/RevertModelSnapshot.php create mode 100644 src/Elasticsearch/Endpoints/Ml/SetUpgradeMode.php create mode 100644 src/Elasticsearch/Endpoints/Ml/StartDataFrameAnalytics.php create mode 100644 src/Elasticsearch/Endpoints/Ml/StartDatafeed.php create mode 100644 src/Elasticsearch/Endpoints/Ml/StopDataFrameAnalytics.php create mode 100644 src/Elasticsearch/Endpoints/Ml/StopDatafeed.php create mode 100644 src/Elasticsearch/Endpoints/Ml/UpdateDatafeed.php create mode 100644 src/Elasticsearch/Endpoints/Ml/UpdateFilter.php create mode 100644 src/Elasticsearch/Endpoints/Ml/UpdateJob.php create mode 100644 src/Elasticsearch/Endpoints/Ml/UpdateModelSnapshot.php create mode 100644 src/Elasticsearch/Endpoints/Ml/Validate.php create mode 100644 src/Elasticsearch/Endpoints/Ml/ValidateDetector.php create mode 100644 src/Elasticsearch/Endpoints/Monitoring/Bulk.php create mode 100644 src/Elasticsearch/Endpoints/Rollup/DeleteJob.php create mode 100644 src/Elasticsearch/Endpoints/Rollup/GetJobs.php create mode 100644 src/Elasticsearch/Endpoints/Rollup/GetRollupCaps.php create mode 100644 src/Elasticsearch/Endpoints/Rollup/GetRollupIndexCaps.php create mode 100644 src/Elasticsearch/Endpoints/Rollup/PutJob.php create mode 100644 src/Elasticsearch/Endpoints/Rollup/RollupSearch.php create mode 100644 src/Elasticsearch/Endpoints/Rollup/StartJob.php create mode 100644 src/Elasticsearch/Endpoints/Rollup/StopJob.php create mode 100644 src/Elasticsearch/Endpoints/Security/Authenticate.php create mode 100644 src/Elasticsearch/Endpoints/Security/ChangePassword.php create mode 100644 src/Elasticsearch/Endpoints/Security/ClearCachedRealms.php create mode 100644 src/Elasticsearch/Endpoints/Security/ClearCachedRoles.php create mode 100644 src/Elasticsearch/Endpoints/Security/CreateApiKey.php create mode 100644 src/Elasticsearch/Endpoints/Security/DeletePrivileges.php create mode 100644 src/Elasticsearch/Endpoints/Security/DeleteRole.php create mode 100644 src/Elasticsearch/Endpoints/Security/DeleteRoleMapping.php create mode 100644 src/Elasticsearch/Endpoints/Security/DeleteUser.php create mode 100644 src/Elasticsearch/Endpoints/Security/DisableUser.php create mode 100644 src/Elasticsearch/Endpoints/Security/EnableUser.php create mode 100644 src/Elasticsearch/Endpoints/Security/GetApiKey.php create mode 100644 src/Elasticsearch/Endpoints/Security/GetBuiltinPrivileges.php create mode 100644 src/Elasticsearch/Endpoints/Security/GetPrivileges.php create mode 100644 src/Elasticsearch/Endpoints/Security/GetRole.php create mode 100644 src/Elasticsearch/Endpoints/Security/GetRoleMapping.php create mode 100644 src/Elasticsearch/Endpoints/Security/GetToken.php create mode 100644 src/Elasticsearch/Endpoints/Security/GetUser.php create mode 100644 src/Elasticsearch/Endpoints/Security/GetUserPrivileges.php create mode 100644 src/Elasticsearch/Endpoints/Security/HasPrivileges.php create mode 100644 src/Elasticsearch/Endpoints/Security/InvalidateApiKey.php create mode 100644 src/Elasticsearch/Endpoints/Security/InvalidateToken.php create mode 100644 src/Elasticsearch/Endpoints/Security/PutPrivileges.php create mode 100644 src/Elasticsearch/Endpoints/Security/PutRole.php create mode 100644 src/Elasticsearch/Endpoints/Security/PutRoleMapping.php create mode 100644 src/Elasticsearch/Endpoints/Security/PutUser.php create mode 100644 src/Elasticsearch/Endpoints/Slm/DeleteLifecycle.php create mode 100644 src/Elasticsearch/Endpoints/Slm/ExecuteLifecycle.php create mode 100644 src/Elasticsearch/Endpoints/Slm/ExecuteRetention.php create mode 100644 src/Elasticsearch/Endpoints/Slm/GetLifecycle.php create mode 100644 src/Elasticsearch/Endpoints/Slm/GetStats.php create mode 100644 src/Elasticsearch/Endpoints/Slm/GetStatus.php create mode 100644 src/Elasticsearch/Endpoints/Slm/PutLifecycle.php create mode 100644 src/Elasticsearch/Endpoints/Slm/Start.php create mode 100644 src/Elasticsearch/Endpoints/Slm/Stop.php create mode 100644 src/Elasticsearch/Endpoints/Sql/ClearCursor.php create mode 100644 src/Elasticsearch/Endpoints/Sql/Query.php create mode 100644 src/Elasticsearch/Endpoints/Sql/Translate.php create mode 100644 src/Elasticsearch/Endpoints/Ssl/Certificates.php create mode 100644 src/Elasticsearch/Endpoints/Transform/DeleteTransform.php create mode 100644 src/Elasticsearch/Endpoints/Transform/GetTransform.php create mode 100644 src/Elasticsearch/Endpoints/Transform/GetTransformStats.php create mode 100644 src/Elasticsearch/Endpoints/Transform/PreviewTransform.php create mode 100644 src/Elasticsearch/Endpoints/Transform/PutTransform.php create mode 100644 src/Elasticsearch/Endpoints/Transform/StartTransform.php create mode 100644 src/Elasticsearch/Endpoints/Transform/StopTransform.php create mode 100644 src/Elasticsearch/Endpoints/Transform/UpdateTransform.php create mode 100644 src/Elasticsearch/Endpoints/Watcher/AckWatch.php create mode 100644 src/Elasticsearch/Endpoints/Watcher/ActivateWatch.php create mode 100644 src/Elasticsearch/Endpoints/Watcher/DeactivateWatch.php create mode 100644 src/Elasticsearch/Endpoints/Watcher/DeleteWatch.php create mode 100644 src/Elasticsearch/Endpoints/Watcher/ExecuteWatch.php create mode 100644 src/Elasticsearch/Endpoints/Watcher/GetWatch.php create mode 100644 src/Elasticsearch/Endpoints/Watcher/PutWatch.php create mode 100644 src/Elasticsearch/Endpoints/Watcher/Start.php create mode 100644 src/Elasticsearch/Endpoints/Watcher/Stats.php create mode 100644 src/Elasticsearch/Endpoints/Watcher/Stop.php create mode 100644 src/Elasticsearch/Endpoints/Xpack/Info.php create mode 100644 src/Elasticsearch/Endpoints/Xpack/Usage.php create mode 100644 src/Elasticsearch/Namespaces/AsyncSearchNamespace.php create mode 100644 src/Elasticsearch/Namespaces/AutoscalingNamespace.php create mode 100644 src/Elasticsearch/Namespaces/CcrNamespace.php create mode 100644 src/Elasticsearch/Namespaces/DataFrameTransformDeprecatedNamespace.php create mode 100644 src/Elasticsearch/Namespaces/EnrichNamespace.php create mode 100644 src/Elasticsearch/Namespaces/EqlNamespace.php create mode 100644 src/Elasticsearch/Namespaces/GraphNamespace.php create mode 100644 src/Elasticsearch/Namespaces/IlmNamespace.php create mode 100644 src/Elasticsearch/Namespaces/LicenseNamespace.php create mode 100644 src/Elasticsearch/Namespaces/MigrationNamespace.php create mode 100644 src/Elasticsearch/Namespaces/MlNamespace.php create mode 100644 src/Elasticsearch/Namespaces/MonitoringNamespace.php create mode 100644 src/Elasticsearch/Namespaces/RollupNamespace.php create mode 100644 src/Elasticsearch/Namespaces/SecurityNamespace.php create mode 100644 src/Elasticsearch/Namespaces/SlmNamespace.php create mode 100644 src/Elasticsearch/Namespaces/SqlNamespace.php create mode 100644 src/Elasticsearch/Namespaces/SslNamespace.php create mode 100644 src/Elasticsearch/Namespaces/TransformNamespace.php create mode 100644 src/Elasticsearch/Namespaces/WatcherNamespace.php create mode 100644 src/Elasticsearch/Namespaces/XpackNamespace.php create mode 100644 util/output/7.6.1/Client.php create mode 100644 util/output/7.6.1/Endpoints/Bulk.php create mode 100644 util/output/7.6.1/Endpoints/Cat/Aliases.php create mode 100644 util/output/7.6.1/Endpoints/Cat/Allocation.php create mode 100644 util/output/7.6.1/Endpoints/Cat/Count.php create mode 100644 util/output/7.6.1/Endpoints/Cat/Fielddata.php create mode 100644 util/output/7.6.1/Endpoints/Cat/Health.php create mode 100644 util/output/7.6.1/Endpoints/Cat/Help.php create mode 100644 util/output/7.6.1/Endpoints/Cat/Indices.php create mode 100644 util/output/7.6.1/Endpoints/Cat/Master.php create mode 100644 util/output/7.6.1/Endpoints/Cat/NodeAttrs.php create mode 100644 util/output/7.6.1/Endpoints/Cat/Nodes.php create mode 100644 util/output/7.6.1/Endpoints/Cat/PendingTasks.php create mode 100644 util/output/7.6.1/Endpoints/Cat/Plugins.php create mode 100644 util/output/7.6.1/Endpoints/Cat/Recovery.php create mode 100644 util/output/7.6.1/Endpoints/Cat/Repositories.php create mode 100644 util/output/7.6.1/Endpoints/Cat/Segments.php create mode 100644 util/output/7.6.1/Endpoints/Cat/Shards.php create mode 100644 util/output/7.6.1/Endpoints/Cat/Snapshots.php create mode 100644 util/output/7.6.1/Endpoints/Cat/Tasks.php create mode 100644 util/output/7.6.1/Endpoints/Cat/Templates.php create mode 100644 util/output/7.6.1/Endpoints/Cat/ThreadPool.php create mode 100644 util/output/7.6.1/Endpoints/Ccr/DeleteAutoFollowPattern.php create mode 100644 util/output/7.6.1/Endpoints/Ccr/Follow.php create mode 100644 util/output/7.6.1/Endpoints/Ccr/FollowInfo.php create mode 100644 util/output/7.6.1/Endpoints/Ccr/FollowStats.php create mode 100644 util/output/7.6.1/Endpoints/Ccr/ForgetFollower.php create mode 100644 util/output/7.6.1/Endpoints/Ccr/GetAutoFollowPattern.php create mode 100644 util/output/7.6.1/Endpoints/Ccr/PauseAutoFollowPattern.php create mode 100644 util/output/7.6.1/Endpoints/Ccr/PauseFollow.php create mode 100644 util/output/7.6.1/Endpoints/Ccr/PutAutoFollowPattern.php create mode 100644 util/output/7.6.1/Endpoints/Ccr/ResumeAutoFollowPattern.php create mode 100644 util/output/7.6.1/Endpoints/Ccr/ResumeFollow.php create mode 100644 util/output/7.6.1/Endpoints/Ccr/Stats.php create mode 100644 util/output/7.6.1/Endpoints/Ccr/Unfollow.php create mode 100644 util/output/7.6.1/Endpoints/ClearScroll.php create mode 100644 util/output/7.6.1/Endpoints/Cluster/AllocationExplain.php create mode 100644 util/output/7.6.1/Endpoints/Cluster/GetSettings.php create mode 100644 util/output/7.6.1/Endpoints/Cluster/Health.php create mode 100644 util/output/7.6.1/Endpoints/Cluster/PendingTasks.php create mode 100644 util/output/7.6.1/Endpoints/Cluster/PutSettings.php create mode 100644 util/output/7.6.1/Endpoints/Cluster/RemoteInfo.php create mode 100644 util/output/7.6.1/Endpoints/Cluster/Reroute.php create mode 100644 util/output/7.6.1/Endpoints/Cluster/State.php create mode 100644 util/output/7.6.1/Endpoints/Cluster/Stats.php create mode 100644 util/output/7.6.1/Endpoints/Count.php create mode 100644 util/output/7.6.1/Endpoints/Create.php create mode 100644 util/output/7.6.1/Endpoints/DataFrameTransformDeprecated/DeleteTransform.php create mode 100644 util/output/7.6.1/Endpoints/DataFrameTransformDeprecated/GetTransform.php create mode 100644 util/output/7.6.1/Endpoints/DataFrameTransformDeprecated/GetTransformStats.php create mode 100644 util/output/7.6.1/Endpoints/DataFrameTransformDeprecated/PreviewTransform.php create mode 100644 util/output/7.6.1/Endpoints/DataFrameTransformDeprecated/PutTransform.php create mode 100644 util/output/7.6.1/Endpoints/DataFrameTransformDeprecated/StartTransform.php create mode 100644 util/output/7.6.1/Endpoints/DataFrameTransformDeprecated/StopTransform.php create mode 100644 util/output/7.6.1/Endpoints/DataFrameTransformDeprecated/UpdateTransform.php create mode 100644 util/output/7.6.1/Endpoints/Delete.php create mode 100644 util/output/7.6.1/Endpoints/DeleteByQuery.php create mode 100644 util/output/7.6.1/Endpoints/DeleteByQueryRethrottle.php create mode 100644 util/output/7.6.1/Endpoints/DeleteScript.php create mode 100644 util/output/7.6.1/Endpoints/Enrich/DeletePolicy.php create mode 100644 util/output/7.6.1/Endpoints/Enrich/ExecutePolicy.php create mode 100644 util/output/7.6.1/Endpoints/Enrich/GetPolicy.php create mode 100644 util/output/7.6.1/Endpoints/Enrich/PutPolicy.php create mode 100644 util/output/7.6.1/Endpoints/Enrich/Stats.php create mode 100644 util/output/7.6.1/Endpoints/Exists.php create mode 100644 util/output/7.6.1/Endpoints/ExistsSource.php create mode 100644 util/output/7.6.1/Endpoints/Explain.php create mode 100644 util/output/7.6.1/Endpoints/FieldCaps.php create mode 100644 util/output/7.6.1/Endpoints/Get.php create mode 100644 util/output/7.6.1/Endpoints/GetScript.php create mode 100644 util/output/7.6.1/Endpoints/GetScriptContext.php create mode 100644 util/output/7.6.1/Endpoints/GetScriptLanguages.php create mode 100644 util/output/7.6.1/Endpoints/GetSource.php create mode 100644 util/output/7.6.1/Endpoints/Graph/Explore.php create mode 100644 util/output/7.6.1/Endpoints/Ilm/DeleteLifecycle.php create mode 100644 util/output/7.6.1/Endpoints/Ilm/ExplainLifecycle.php create mode 100644 util/output/7.6.1/Endpoints/Ilm/GetLifecycle.php create mode 100644 util/output/7.6.1/Endpoints/Ilm/GetStatus.php create mode 100644 util/output/7.6.1/Endpoints/Ilm/MoveToStep.php create mode 100644 util/output/7.6.1/Endpoints/Ilm/PutLifecycle.php create mode 100644 util/output/7.6.1/Endpoints/Ilm/RemovePolicy.php create mode 100644 util/output/7.6.1/Endpoints/Ilm/Retry.php create mode 100644 util/output/7.6.1/Endpoints/Ilm/Start.php create mode 100644 util/output/7.6.1/Endpoints/Ilm/Stop.php create mode 100644 util/output/7.6.1/Endpoints/Index.php create mode 100644 util/output/7.6.1/Endpoints/Indices/Analyze.php create mode 100644 util/output/7.6.1/Endpoints/Indices/ClearCache.php create mode 100644 util/output/7.6.1/Endpoints/Indices/CloneIndices.php create mode 100644 util/output/7.6.1/Endpoints/Indices/Close.php create mode 100644 util/output/7.6.1/Endpoints/Indices/Create.php create mode 100644 util/output/7.6.1/Endpoints/Indices/Delete.php create mode 100644 util/output/7.6.1/Endpoints/Indices/DeleteAlias.php create mode 100644 util/output/7.6.1/Endpoints/Indices/DeleteTemplate.php create mode 100644 util/output/7.6.1/Endpoints/Indices/Exists.php create mode 100644 util/output/7.6.1/Endpoints/Indices/ExistsAlias.php create mode 100644 util/output/7.6.1/Endpoints/Indices/ExistsTemplate.php create mode 100644 util/output/7.6.1/Endpoints/Indices/ExistsType.php create mode 100644 util/output/7.6.1/Endpoints/Indices/Flush.php create mode 100644 util/output/7.6.1/Endpoints/Indices/FlushSynced.php create mode 100644 util/output/7.6.1/Endpoints/Indices/ForceMerge.php create mode 100644 util/output/7.6.1/Endpoints/Indices/Freeze.php create mode 100644 util/output/7.6.1/Endpoints/Indices/Get.php create mode 100644 util/output/7.6.1/Endpoints/Indices/GetAlias.php create mode 100644 util/output/7.6.1/Endpoints/Indices/GetFieldMapping.php create mode 100644 util/output/7.6.1/Endpoints/Indices/GetMapping.php create mode 100644 util/output/7.6.1/Endpoints/Indices/GetSettings.php create mode 100644 util/output/7.6.1/Endpoints/Indices/GetTemplate.php create mode 100644 util/output/7.6.1/Endpoints/Indices/GetUpgrade.php create mode 100644 util/output/7.6.1/Endpoints/Indices/Open.php create mode 100644 util/output/7.6.1/Endpoints/Indices/PutAlias.php create mode 100644 util/output/7.6.1/Endpoints/Indices/PutMapping.php create mode 100644 util/output/7.6.1/Endpoints/Indices/PutSettings.php create mode 100644 util/output/7.6.1/Endpoints/Indices/PutTemplate.php create mode 100644 util/output/7.6.1/Endpoints/Indices/Recovery.php create mode 100644 util/output/7.6.1/Endpoints/Indices/Refresh.php create mode 100644 util/output/7.6.1/Endpoints/Indices/ReloadSearchAnalyzers.php create mode 100644 util/output/7.6.1/Endpoints/Indices/Rollover.php create mode 100644 util/output/7.6.1/Endpoints/Indices/Segments.php create mode 100644 util/output/7.6.1/Endpoints/Indices/ShardStores.php create mode 100644 util/output/7.6.1/Endpoints/Indices/Shrink.php create mode 100644 util/output/7.6.1/Endpoints/Indices/Split.php create mode 100644 util/output/7.6.1/Endpoints/Indices/Stats.php create mode 100644 util/output/7.6.1/Endpoints/Indices/Unfreeze.php create mode 100644 util/output/7.6.1/Endpoints/Indices/UpdateAliases.php create mode 100644 util/output/7.6.1/Endpoints/Indices/Upgrade.php create mode 100644 util/output/7.6.1/Endpoints/Indices/ValidateQuery.php create mode 100644 util/output/7.6.1/Endpoints/Info.php create mode 100644 util/output/7.6.1/Endpoints/Ingest/DeletePipeline.php create mode 100644 util/output/7.6.1/Endpoints/Ingest/GetPipeline.php create mode 100644 util/output/7.6.1/Endpoints/Ingest/ProcessorGrok.php create mode 100644 util/output/7.6.1/Endpoints/Ingest/PutPipeline.php create mode 100644 util/output/7.6.1/Endpoints/Ingest/Simulate.php create mode 100644 util/output/7.6.1/Endpoints/License/Delete.php create mode 100644 util/output/7.6.1/Endpoints/License/Get.php create mode 100644 util/output/7.6.1/Endpoints/License/GetBasicStatus.php create mode 100644 util/output/7.6.1/Endpoints/License/GetTrialStatus.php create mode 100644 util/output/7.6.1/Endpoints/License/Post.php create mode 100644 util/output/7.6.1/Endpoints/License/PostStartBasic.php create mode 100644 util/output/7.6.1/Endpoints/License/PostStartTrial.php create mode 100644 util/output/7.6.1/Endpoints/MTermVectors.php create mode 100644 util/output/7.6.1/Endpoints/Mget.php create mode 100644 util/output/7.6.1/Endpoints/Migration/Deprecations.php create mode 100644 util/output/7.6.1/Endpoints/Ml/CloseJob.php create mode 100644 util/output/7.6.1/Endpoints/Ml/DeleteCalendar.php create mode 100644 util/output/7.6.1/Endpoints/Ml/DeleteCalendarEvent.php create mode 100644 util/output/7.6.1/Endpoints/Ml/DeleteCalendarJob.php create mode 100644 util/output/7.6.1/Endpoints/Ml/DeleteDataFrameAnalytics.php create mode 100644 util/output/7.6.1/Endpoints/Ml/DeleteDatafeed.php create mode 100644 util/output/7.6.1/Endpoints/Ml/DeleteExpiredData.php create mode 100644 util/output/7.6.1/Endpoints/Ml/DeleteFilter.php create mode 100644 util/output/7.6.1/Endpoints/Ml/DeleteForecast.php create mode 100644 util/output/7.6.1/Endpoints/Ml/DeleteJob.php create mode 100644 util/output/7.6.1/Endpoints/Ml/DeleteModelSnapshot.php create mode 100644 util/output/7.6.1/Endpoints/Ml/DeleteTrainedModel.php create mode 100644 util/output/7.6.1/Endpoints/Ml/EvaluateDataFrame.php create mode 100644 util/output/7.6.1/Endpoints/Ml/ExplainDataFrameAnalytics.php create mode 100644 util/output/7.6.1/Endpoints/Ml/FindFileStructure.php create mode 100644 util/output/7.6.1/Endpoints/Ml/FlushJob.php create mode 100644 util/output/7.6.1/Endpoints/Ml/Forecast.php create mode 100644 util/output/7.6.1/Endpoints/Ml/GetBuckets.php create mode 100644 util/output/7.6.1/Endpoints/Ml/GetCalendarEvents.php create mode 100644 util/output/7.6.1/Endpoints/Ml/GetCalendars.php create mode 100644 util/output/7.6.1/Endpoints/Ml/GetCategories.php create mode 100644 util/output/7.6.1/Endpoints/Ml/GetDataFrameAnalytics.php create mode 100644 util/output/7.6.1/Endpoints/Ml/GetDataFrameAnalyticsStats.php create mode 100644 util/output/7.6.1/Endpoints/Ml/GetDatafeedStats.php create mode 100644 util/output/7.6.1/Endpoints/Ml/GetDatafeeds.php create mode 100644 util/output/7.6.1/Endpoints/Ml/GetFilters.php create mode 100644 util/output/7.6.1/Endpoints/Ml/GetInfluencers.php create mode 100644 util/output/7.6.1/Endpoints/Ml/GetJobStats.php create mode 100644 util/output/7.6.1/Endpoints/Ml/GetJobs.php create mode 100644 util/output/7.6.1/Endpoints/Ml/GetModelSnapshots.php create mode 100644 util/output/7.6.1/Endpoints/Ml/GetOverallBuckets.php create mode 100644 util/output/7.6.1/Endpoints/Ml/GetRecords.php create mode 100644 util/output/7.6.1/Endpoints/Ml/GetTrainedModels.php create mode 100644 util/output/7.6.1/Endpoints/Ml/GetTrainedModelsStats.php create mode 100644 util/output/7.6.1/Endpoints/Ml/Info.php create mode 100644 util/output/7.6.1/Endpoints/Ml/OpenJob.php create mode 100644 util/output/7.6.1/Endpoints/Ml/PostCalendarEvents.php create mode 100644 util/output/7.6.1/Endpoints/Ml/PostData.php create mode 100644 util/output/7.6.1/Endpoints/Ml/PreviewDatafeed.php create mode 100644 util/output/7.6.1/Endpoints/Ml/PutCalendar.php create mode 100644 util/output/7.6.1/Endpoints/Ml/PutCalendarJob.php create mode 100644 util/output/7.6.1/Endpoints/Ml/PutDataFrameAnalytics.php create mode 100644 util/output/7.6.1/Endpoints/Ml/PutDatafeed.php create mode 100644 util/output/7.6.1/Endpoints/Ml/PutFilter.php create mode 100644 util/output/7.6.1/Endpoints/Ml/PutJob.php create mode 100644 util/output/7.6.1/Endpoints/Ml/PutTrainedModel.php create mode 100644 util/output/7.6.1/Endpoints/Ml/RevertModelSnapshot.php create mode 100644 util/output/7.6.1/Endpoints/Ml/SetUpgradeMode.php create mode 100644 util/output/7.6.1/Endpoints/Ml/StartDataFrameAnalytics.php create mode 100644 util/output/7.6.1/Endpoints/Ml/StartDatafeed.php create mode 100644 util/output/7.6.1/Endpoints/Ml/StopDataFrameAnalytics.php create mode 100644 util/output/7.6.1/Endpoints/Ml/StopDatafeed.php create mode 100644 util/output/7.6.1/Endpoints/Ml/UpdateDatafeed.php create mode 100644 util/output/7.6.1/Endpoints/Ml/UpdateFilter.php create mode 100644 util/output/7.6.1/Endpoints/Ml/UpdateJob.php create mode 100644 util/output/7.6.1/Endpoints/Ml/UpdateModelSnapshot.php create mode 100644 util/output/7.6.1/Endpoints/Ml/Validate.php create mode 100644 util/output/7.6.1/Endpoints/Ml/ValidateDetector.php create mode 100644 util/output/7.6.1/Endpoints/Monitoring/Bulk.php create mode 100644 util/output/7.6.1/Endpoints/Msearch.php create mode 100644 util/output/7.6.1/Endpoints/MsearchTemplate.php create mode 100644 util/output/7.6.1/Endpoints/Nodes/HotThreads.php create mode 100644 util/output/7.6.1/Endpoints/Nodes/Info.php create mode 100644 util/output/7.6.1/Endpoints/Nodes/ReloadSecureSettings.php create mode 100644 util/output/7.6.1/Endpoints/Nodes/Stats.php create mode 100644 util/output/7.6.1/Endpoints/Nodes/Usage.php create mode 100644 util/output/7.6.1/Endpoints/Ping.php create mode 100644 util/output/7.6.1/Endpoints/PutScript.php create mode 100644 util/output/7.6.1/Endpoints/RankEval.php create mode 100644 util/output/7.6.1/Endpoints/Reindex.php create mode 100644 util/output/7.6.1/Endpoints/ReindexRethrottle.php create mode 100644 util/output/7.6.1/Endpoints/RenderSearchTemplate.php create mode 100644 util/output/7.6.1/Endpoints/Rollup/DeleteJob.php create mode 100644 util/output/7.6.1/Endpoints/Rollup/GetJobs.php create mode 100644 util/output/7.6.1/Endpoints/Rollup/GetRollupCaps.php create mode 100644 util/output/7.6.1/Endpoints/Rollup/GetRollupIndexCaps.php create mode 100644 util/output/7.6.1/Endpoints/Rollup/PutJob.php create mode 100644 util/output/7.6.1/Endpoints/Rollup/RollupSearch.php create mode 100644 util/output/7.6.1/Endpoints/Rollup/StartJob.php create mode 100644 util/output/7.6.1/Endpoints/Rollup/StopJob.php create mode 100644 util/output/7.6.1/Endpoints/ScriptsPainlessExecute.php create mode 100644 util/output/7.6.1/Endpoints/Scroll.php create mode 100644 util/output/7.6.1/Endpoints/Search.php create mode 100644 util/output/7.6.1/Endpoints/SearchShards.php create mode 100644 util/output/7.6.1/Endpoints/SearchTemplate.php create mode 100644 util/output/7.6.1/Endpoints/Security/Authenticate.php create mode 100644 util/output/7.6.1/Endpoints/Security/ChangePassword.php create mode 100644 util/output/7.6.1/Endpoints/Security/ClearCachedRealms.php create mode 100644 util/output/7.6.1/Endpoints/Security/ClearCachedRoles.php create mode 100644 util/output/7.6.1/Endpoints/Security/CreateApiKey.php create mode 100644 util/output/7.6.1/Endpoints/Security/DeletePrivileges.php create mode 100644 util/output/7.6.1/Endpoints/Security/DeleteRole.php create mode 100644 util/output/7.6.1/Endpoints/Security/DeleteRoleMapping.php create mode 100644 util/output/7.6.1/Endpoints/Security/DeleteUser.php create mode 100644 util/output/7.6.1/Endpoints/Security/DisableUser.php create mode 100644 util/output/7.6.1/Endpoints/Security/EnableUser.php create mode 100644 util/output/7.6.1/Endpoints/Security/GetApiKey.php create mode 100644 util/output/7.6.1/Endpoints/Security/GetBuiltinPrivileges.php create mode 100644 util/output/7.6.1/Endpoints/Security/GetPrivileges.php create mode 100644 util/output/7.6.1/Endpoints/Security/GetRole.php create mode 100644 util/output/7.6.1/Endpoints/Security/GetRoleMapping.php create mode 100644 util/output/7.6.1/Endpoints/Security/GetToken.php create mode 100644 util/output/7.6.1/Endpoints/Security/GetUser.php create mode 100644 util/output/7.6.1/Endpoints/Security/GetUserPrivileges.php create mode 100644 util/output/7.6.1/Endpoints/Security/HasPrivileges.php create mode 100644 util/output/7.6.1/Endpoints/Security/InvalidateApiKey.php create mode 100644 util/output/7.6.1/Endpoints/Security/InvalidateToken.php create mode 100644 util/output/7.6.1/Endpoints/Security/PutPrivileges.php create mode 100644 util/output/7.6.1/Endpoints/Security/PutRole.php create mode 100644 util/output/7.6.1/Endpoints/Security/PutRoleMapping.php create mode 100644 util/output/7.6.1/Endpoints/Security/PutUser.php create mode 100644 util/output/7.6.1/Endpoints/Slm/DeleteLifecycle.php create mode 100644 util/output/7.6.1/Endpoints/Slm/ExecuteLifecycle.php create mode 100644 util/output/7.6.1/Endpoints/Slm/ExecuteRetention.php create mode 100644 util/output/7.6.1/Endpoints/Slm/GetLifecycle.php create mode 100644 util/output/7.6.1/Endpoints/Slm/GetStats.php create mode 100644 util/output/7.6.1/Endpoints/Slm/GetStatus.php create mode 100644 util/output/7.6.1/Endpoints/Slm/PutLifecycle.php create mode 100644 util/output/7.6.1/Endpoints/Slm/Start.php create mode 100644 util/output/7.6.1/Endpoints/Slm/Stop.php create mode 100644 util/output/7.6.1/Endpoints/Snapshot/CleanupRepository.php create mode 100644 util/output/7.6.1/Endpoints/Snapshot/Create.php create mode 100644 util/output/7.6.1/Endpoints/Snapshot/CreateRepository.php create mode 100644 util/output/7.6.1/Endpoints/Snapshot/Delete.php create mode 100644 util/output/7.6.1/Endpoints/Snapshot/DeleteRepository.php create mode 100644 util/output/7.6.1/Endpoints/Snapshot/Get.php create mode 100644 util/output/7.6.1/Endpoints/Snapshot/GetRepository.php create mode 100644 util/output/7.6.1/Endpoints/Snapshot/Restore.php create mode 100644 util/output/7.6.1/Endpoints/Snapshot/Status.php create mode 100644 util/output/7.6.1/Endpoints/Snapshot/VerifyRepository.php create mode 100644 util/output/7.6.1/Endpoints/Sql/ClearCursor.php create mode 100644 util/output/7.6.1/Endpoints/Sql/Query.php create mode 100644 util/output/7.6.1/Endpoints/Sql/Translate.php create mode 100644 util/output/7.6.1/Endpoints/Ssl/Certificates.php create mode 100644 util/output/7.6.1/Endpoints/Tasks/Cancel.php create mode 100644 util/output/7.6.1/Endpoints/Tasks/Get.php create mode 100644 util/output/7.6.1/Endpoints/Tasks/ListTasks.php create mode 100644 util/output/7.6.1/Endpoints/TermVectors.php create mode 100644 util/output/7.6.1/Endpoints/Transform/DeleteTransform.php create mode 100644 util/output/7.6.1/Endpoints/Transform/GetTransform.php create mode 100644 util/output/7.6.1/Endpoints/Transform/GetTransformStats.php create mode 100644 util/output/7.6.1/Endpoints/Transform/PreviewTransform.php create mode 100644 util/output/7.6.1/Endpoints/Transform/PutTransform.php create mode 100644 util/output/7.6.1/Endpoints/Transform/StartTransform.php create mode 100644 util/output/7.6.1/Endpoints/Transform/StopTransform.php create mode 100644 util/output/7.6.1/Endpoints/Transform/UpdateTransform.php create mode 100644 util/output/7.6.1/Endpoints/Update.php create mode 100644 util/output/7.6.1/Endpoints/UpdateByQuery.php create mode 100644 util/output/7.6.1/Endpoints/UpdateByQueryRethrottle.php create mode 100644 util/output/7.6.1/Endpoints/Watcher/AckWatch.php create mode 100644 util/output/7.6.1/Endpoints/Watcher/ActivateWatch.php create mode 100644 util/output/7.6.1/Endpoints/Watcher/DeactivateWatch.php create mode 100644 util/output/7.6.1/Endpoints/Watcher/DeleteWatch.php create mode 100644 util/output/7.6.1/Endpoints/Watcher/ExecuteWatch.php create mode 100644 util/output/7.6.1/Endpoints/Watcher/GetWatch.php create mode 100644 util/output/7.6.1/Endpoints/Watcher/PutWatch.php create mode 100644 util/output/7.6.1/Endpoints/Watcher/Start.php create mode 100644 util/output/7.6.1/Endpoints/Watcher/Stats.php create mode 100644 util/output/7.6.1/Endpoints/Watcher/Stop.php create mode 100644 util/output/7.6.1/Endpoints/Xpack/Info.php create mode 100644 util/output/7.6.1/Endpoints/Xpack/Usage.php create mode 100644 util/output/7.6.1/Namespaces/CatNamespace.php create mode 100644 util/output/7.6.1/Namespaces/CcrNamespace.php create mode 100644 util/output/7.6.1/Namespaces/ClusterNamespace.php create mode 100644 util/output/7.6.1/Namespaces/DataFrameTransformDeprecatedNamespace.php create mode 100644 util/output/7.6.1/Namespaces/EnrichNamespace.php create mode 100644 util/output/7.6.1/Namespaces/GraphNamespace.php create mode 100644 util/output/7.6.1/Namespaces/IlmNamespace.php create mode 100644 util/output/7.6.1/Namespaces/IndicesNamespace.php create mode 100644 util/output/7.6.1/Namespaces/IngestNamespace.php create mode 100644 util/output/7.6.1/Namespaces/LicenseNamespace.php create mode 100644 util/output/7.6.1/Namespaces/MigrationNamespace.php create mode 100644 util/output/7.6.1/Namespaces/MlNamespace.php create mode 100644 util/output/7.6.1/Namespaces/MonitoringNamespace.php create mode 100644 util/output/7.6.1/Namespaces/NodesNamespace.php create mode 100644 util/output/7.6.1/Namespaces/RollupNamespace.php create mode 100644 util/output/7.6.1/Namespaces/SecurityNamespace.php create mode 100644 util/output/7.6.1/Namespaces/SlmNamespace.php create mode 100644 util/output/7.6.1/Namespaces/SnapshotNamespace.php create mode 100644 util/output/7.6.1/Namespaces/SqlNamespace.php create mode 100644 util/output/7.6.1/Namespaces/SslNamespace.php create mode 100644 util/output/7.6.1/Namespaces/TasksNamespace.php create mode 100644 util/output/7.6.1/Namespaces/TransformNamespace.php create mode 100644 util/output/7.6.1/Namespaces/WatcherNamespace.php create mode 100644 util/output/7.6.1/Namespaces/XpackNamespace.php diff --git a/.gitignore b/.gitignore index a3457d467..e417b7294 100755 --- a/.gitignore +++ b/.gitignore @@ -23,7 +23,6 @@ generator/* # Elasticsearch related util/elasticsearch/ util/cache/ -util/output # Sami docs generator /sami.phar diff --git a/src/Elasticsearch/Client.php b/src/Elasticsearch/Client.php index bf782cfaf..00928bc40 100644 --- a/src/Elasticsearch/Client.php +++ b/src/Elasticsearch/Client.php @@ -20,9 +20,30 @@ use Elasticsearch\Namespaces\NodesNamespace; use Elasticsearch\Namespaces\SnapshotNamespace; use Elasticsearch\Namespaces\TasksNamespace; +use Elasticsearch\Namespaces\AsyncSearchNamespace; +use Elasticsearch\Namespaces\AutoscalingNamespace; +use Elasticsearch\Namespaces\CcrNamespace; +use Elasticsearch\Namespaces\DataFrameTransformDeprecatedNamespace; +use Elasticsearch\Namespaces\EnrichNamespace; +use Elasticsearch\Namespaces\EqlNamespace; +use Elasticsearch\Namespaces\GraphNamespace; +use Elasticsearch\Namespaces\IlmNamespace; +use Elasticsearch\Namespaces\LicenseNamespace; +use Elasticsearch\Namespaces\MigrationNamespace; +use Elasticsearch\Namespaces\MlNamespace; +use Elasticsearch\Namespaces\MonitoringNamespace; +use Elasticsearch\Namespaces\RollupNamespace; +use Elasticsearch\Namespaces\SecurityNamespace; +use Elasticsearch\Namespaces\SlmNamespace; +use Elasticsearch\Namespaces\SqlNamespace; +use Elasticsearch\Namespaces\SslNamespace; +use Elasticsearch\Namespaces\TransformNamespace; +use Elasticsearch\Namespaces\WatcherNamespace; +use Elasticsearch\Namespaces\XpackNamespace; /** * Class Client + * Generated running $ php util/GenerateEndpoints.php 7.7 * * @category Elasticsearch * @package Elasticsearch @@ -89,6 +110,106 @@ class Client */ protected $tasks; + /** + * @var AsyncSearchNamespace + */ + protected $asyncSearch; + + /** + * @var AutoscalingNamespace + */ + protected $autoscaling; + + /** + * @var CcrNamespace + */ + protected $ccr; + + /** + * @var DataFrameTransformDeprecatedNamespace + */ + protected $dataFrameTransformDeprecated; + + /** + * @var EnrichNamespace + */ + protected $enrich; + + /** + * @var EqlNamespace + */ + protected $eql; + + /** + * @var GraphNamespace + */ + protected $graph; + + /** + * @var IlmNamespace + */ + protected $ilm; + + /** + * @var LicenseNamespace + */ + protected $license; + + /** + * @var MigrationNamespace + */ + protected $migration; + + /** + * @var MlNamespace + */ + protected $ml; + + /** + * @var MonitoringNamespace + */ + protected $monitoring; + + /** + * @var RollupNamespace + */ + protected $rollup; + + /** + * @var SecurityNamespace + */ + protected $security; + + /** + * @var SlmNamespace + */ + protected $slm; + + /** + * @var SqlNamespace + */ + protected $sql; + + /** + * @var SslNamespace + */ + protected $ssl; + + /** + * @var TransformNamespace + */ + protected $transform; + + /** + * @var WatcherNamespace + */ + protected $watcher; + + /** + * @var XpackNamespace + */ + protected $xpack; + /** * Client constructor @@ -108,6 +229,26 @@ public function __construct(Transport $transport, callable $endpoint, array $reg $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->autoscaling = new AutoscalingNamespace($transport, $endpoint); + $this->ccr = new CcrNamespace($transport, $endpoint); + $this->dataFrameTransformDeprecated = new DataFrameTransformDeprecatedNamespace($transport, $endpoint); + $this->enrich = new EnrichNamespace($transport, $endpoint); + $this->eql = new EqlNamespace($transport, $endpoint); + $this->graph = new GraphNamespace($transport, $endpoint); + $this->ilm = new IlmNamespace($transport, $endpoint); + $this->license = new LicenseNamespace($transport, $endpoint); + $this->migration = new MigrationNamespace($transport, $endpoint); + $this->ml = new MlNamespace($transport, $endpoint); + $this->monitoring = new MonitoringNamespace($transport, $endpoint); + $this->rollup = new RollupNamespace($transport, $endpoint); + $this->security = new SecurityNamespace($transport, $endpoint); + $this->slm = new SlmNamespace($transport, $endpoint); + $this->sql = new SqlNamespace($transport, $endpoint); + $this->ssl = new SslNamespace($transport, $endpoint); + $this->transform = new TransformNamespace($transport, $endpoint); + $this->watcher = new WatcherNamespace($transport, $endpoint); + $this->xpack = new XpackNamespace($transport, $endpoint); $this->registeredNamespaces = $registeredNamespaces; } @@ -1291,6 +1432,86 @@ public function tasks(): TasksNamespace { return $this->tasks; } + public function asyncSearch(): AsyncSearchNamespace + { + return $this->asyncSearch; + } + public function autoscaling(): AutoscalingNamespace + { + return $this->autoscaling; + } + public function ccr(): CcrNamespace + { + return $this->ccr; + } + public function dataFrameTransformDeprecated(): DataFrameTransformDeprecatedNamespace + { + return $this->dataFrameTransformDeprecated; + } + public function enrich(): EnrichNamespace + { + return $this->enrich; + } + public function eql(): EqlNamespace + { + return $this->eql; + } + public function graph(): GraphNamespace + { + return $this->graph; + } + public function ilm(): IlmNamespace + { + return $this->ilm; + } + public function license(): LicenseNamespace + { + return $this->license; + } + public function migration(): MigrationNamespace + { + return $this->migration; + } + public function ml(): MlNamespace + { + return $this->ml; + } + public function monitoring(): MonitoringNamespace + { + return $this->monitoring; + } + public function rollup(): RollupNamespace + { + return $this->rollup; + } + public function security(): SecurityNamespace + { + return $this->security; + } + public function slm(): SlmNamespace + { + return $this->slm; + } + public function sql(): SqlNamespace + { + return $this->sql; + } + public function ssl(): SslNamespace + { + return $this->ssl; + } + public function transform(): TransformNamespace + { + return $this->transform; + } + public function watcher(): WatcherNamespace + { + return $this->watcher; + } + public function xpack(): XpackNamespace + { + return $this->xpack; + } /** * Catchall for registered namespaces diff --git a/src/Elasticsearch/Endpoints/AsyncSearch/Delete.php b/src/Elasticsearch/Endpoints/AsyncSearch/Delete.php new file mode 100644 index 000000000..9f300cfa9 --- /dev/null +++ b/src/Elasticsearch/Endpoints/AsyncSearch/Delete.php @@ -0,0 +1,52 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Delete extends AbstractEndpoint +{ + + public function getURI(): string + { + $id = $this->id ?? null; + + if (isset($id)) { + return "/_async_search/$id"; + } + throw new RuntimeException('Missing parameter for the endpoint async_search.delete'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setId($id): Delete + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/AsyncSearch/Get.php b/src/Elasticsearch/Endpoints/AsyncSearch/Get.php new file mode 100644 index 000000000..d8361c05b --- /dev/null +++ b/src/Elasticsearch/Endpoints/AsyncSearch/Get.php @@ -0,0 +1,56 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Get extends AbstractEndpoint +{ + + public function getURI(): string + { + $id = $this->id ?? null; + + if (isset($id)) { + return "/_async_search/$id"; + } + throw new RuntimeException('Missing parameter for the endpoint async_search.get'); + } + + public function getParamWhitelist(): array + { + return [ + 'wait_for_completion_timeout', + 'keep_alive', + 'typed_keys' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setId($id): Get + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/AsyncSearch/Submit.php b/src/Elasticsearch/Endpoints/AsyncSearch/Submit.php new file mode 100644 index 000000000..aaa341a8e --- /dev/null +++ b/src/Elasticsearch/Endpoints/AsyncSearch/Submit.php @@ -0,0 +1,93 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Submit extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/$index/_async_search"; + } + return "/_async_search"; + } + + public function getParamWhitelist(): array + { + return [ + 'wait_for_completion_timeout', + 'keep_on_completion', + 'keep_alive', + 'batched_reduce_size', + 'request_cache', + 'analyzer', + 'analyze_wildcard', + 'default_operator', + 'df', + 'explain', + 'stored_fields', + 'docvalue_fields', + 'from', + 'ignore_unavailable', + 'ignore_throttled', + 'allow_no_indices', + 'expand_wildcards', + 'lenient', + 'preference', + 'q', + 'routing', + 'search_type', + 'size', + 'sort', + '_source', + '_source_excludes', + '_source_includes', + 'terminate_after', + 'stats', + 'suggest_field', + 'suggest_mode', + 'suggest_size', + 'suggest_text', + 'timeout', + 'track_scores', + 'track_total_hits', + 'allow_partial_search_results', + 'typed_keys', + 'version', + 'seq_no_primary_term', + 'max_concurrent_shard_requests' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): Submit + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Autoscaling/GetAutoscalingDecision.php b/src/Elasticsearch/Endpoints/Autoscaling/GetAutoscalingDecision.php new file mode 100644 index 000000000..101cff7d3 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Autoscaling/GetAutoscalingDecision.php @@ -0,0 +1,37 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetAutoscalingDecision extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_autoscaling/decision"; + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/src/Elasticsearch/Endpoints/Bulk.php b/src/Elasticsearch/Endpoints/Bulk.php index f277b6429..14660262d 100644 --- a/src/Elasticsearch/Endpoints/Bulk.php +++ b/src/Elasticsearch/Endpoints/Bulk.php @@ -21,6 +21,7 @@ */ class Bulk extends AbstractEndpoint { + public function __construct(SerializerInterface $serializer) { $this->serializer = $serializer; diff --git a/src/Elasticsearch/Endpoints/Cat/MlDataFrameAnalytics.php b/src/Elasticsearch/Endpoints/Cat/MlDataFrameAnalytics.php new file mode 100644 index 000000000..a91d17604 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Cat/MlDataFrameAnalytics.php @@ -0,0 +1,60 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class MlDataFrameAnalytics extends AbstractEndpoint +{ + + public function getURI(): string + { + $id = $this->id ?? null; + + if (isset($id)) { + return "/_cat/ml/data_frame/analytics/$id"; + } + return "/_cat/ml/data_frame/analytics"; + } + + public function getParamWhitelist(): array + { + return [ + 'allow_no_match', + 'bytes', + 'format', + 'h', + 'help', + 's', + 'time', + 'v' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setId($id): MlDataFrameAnalytics + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Cat/MlDatafeeds.php b/src/Elasticsearch/Endpoints/Cat/MlDatafeeds.php new file mode 100644 index 000000000..d22c137d6 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Cat/MlDatafeeds.php @@ -0,0 +1,60 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class MlDatafeeds extends AbstractEndpoint +{ + protected $datafeed_id; + + public function getURI(): string + { + $datafeed_id = $this->datafeed_id ?? null; + + if (isset($datafeed_id)) { + return "/_cat/ml/datafeeds/$datafeed_id"; + } + return "/_cat/ml/datafeeds"; + } + + public function getParamWhitelist(): array + { + return [ + 'allow_no_datafeeds', + 'format', + 'h', + 'help', + 's', + 'time', + 'v' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setDatafeedId($datafeed_id): MlDatafeeds + { + if (isset($datafeed_id) !== true) { + return $this; + } + $this->datafeed_id = $datafeed_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Cat/MlJobs.php b/src/Elasticsearch/Endpoints/Cat/MlJobs.php new file mode 100644 index 000000000..bfe2eb6c6 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Cat/MlJobs.php @@ -0,0 +1,61 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class MlJobs extends AbstractEndpoint +{ + protected $job_id; + + public function getURI(): string + { + $job_id = $this->job_id ?? null; + + if (isset($job_id)) { + return "/_cat/ml/anomaly_detectors/$job_id"; + } + return "/_cat/ml/anomaly_detectors"; + } + + public function getParamWhitelist(): array + { + return [ + 'allow_no_jobs', + 'bytes', + 'format', + 'h', + 'help', + 's', + 'time', + 'v' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setJobId($job_id): MlJobs + { + if (isset($job_id) !== true) { + return $this; + } + $this->job_id = $job_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Cat/MlTrainedModels.php b/src/Elasticsearch/Endpoints/Cat/MlTrainedModels.php new file mode 100644 index 000000000..c689a48c6 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Cat/MlTrainedModels.php @@ -0,0 +1,63 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class MlTrainedModels extends AbstractEndpoint +{ + protected $model_id; + + public function getURI(): string + { + $model_id = $this->model_id ?? null; + + if (isset($model_id)) { + return "/_cat/ml/trained_models/$model_id"; + } + return "/_cat/ml/trained_models"; + } + + public function getParamWhitelist(): array + { + return [ + 'allow_no_match', + 'from', + 'size', + 'bytes', + 'format', + 'h', + 'help', + 's', + 'time', + 'v' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setModelId($model_id): MlTrainedModels + { + if (isset($model_id) !== true) { + return $this; + } + $this->model_id = $model_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Cat/Transform.php b/src/Elasticsearch/Endpoints/Cat/Transform.php new file mode 100644 index 000000000..5ac6c7d96 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Cat/Transform.php @@ -0,0 +1,62 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Transform extends AbstractEndpoint +{ + protected $transform_id; + + public function getURI(): string + { + $transform_id = $this->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): Transform + { + if (isset($transform_id) !== true) { + return $this; + } + $this->transform_id = $transform_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ccr/DeleteAutoFollowPattern.php b/src/Elasticsearch/Endpoints/Ccr/DeleteAutoFollowPattern.php new file mode 100644 index 000000000..bbb13928a --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ccr/DeleteAutoFollowPattern.php @@ -0,0 +1,53 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeleteAutoFollowPattern extends AbstractEndpoint +{ + protected $name; + + public function getURI(): string + { + $name = $this->name ?? null; + + if (isset($name)) { + return "/_ccr/auto_follow/$name"; + } + throw new RuntimeException('Missing parameter for the endpoint ccr.delete_auto_follow_pattern'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setName($name): DeleteAutoFollowPattern + { + if (isset($name) !== true) { + return $this; + } + $this->name = $name; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ccr/Follow.php b/src/Elasticsearch/Endpoints/Ccr/Follow.php new file mode 100644 index 000000000..a8d5df578 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ccr/Follow.php @@ -0,0 +1,54 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Follow extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/$index/_ccr/follow"; + } + throw new RuntimeException('Missing parameter for the endpoint ccr.follow'); + } + + public function getParamWhitelist(): array + { + return [ + 'wait_for_active_shards' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): Follow + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ccr/FollowInfo.php b/src/Elasticsearch/Endpoints/Ccr/FollowInfo.php new file mode 100644 index 000000000..cf6942292 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ccr/FollowInfo.php @@ -0,0 +1,42 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class FollowInfo extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/$index/_ccr/info"; + } + throw new RuntimeException('Missing parameter for the endpoint ccr.follow_info'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/src/Elasticsearch/Endpoints/Ccr/FollowStats.php b/src/Elasticsearch/Endpoints/Ccr/FollowStats.php new file mode 100644 index 000000000..aa8ec2ffe --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ccr/FollowStats.php @@ -0,0 +1,42 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class FollowStats extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/$index/_ccr/stats"; + } + throw new RuntimeException('Missing parameter for the endpoint ccr.follow_stats'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/src/Elasticsearch/Endpoints/Ccr/ForgetFollower.php b/src/Elasticsearch/Endpoints/Ccr/ForgetFollower.php new file mode 100644 index 000000000..fe59015d1 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ccr/ForgetFollower.php @@ -0,0 +1,52 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class ForgetFollower extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/$index/_ccr/forget_follower"; + } + throw new RuntimeException('Missing parameter for the endpoint ccr.forget_follower'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): ForgetFollower + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ccr/GetAutoFollowPattern.php b/src/Elasticsearch/Endpoints/Ccr/GetAutoFollowPattern.php new file mode 100644 index 000000000..2ee730284 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ccr/GetAutoFollowPattern.php @@ -0,0 +1,52 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetAutoFollowPattern extends AbstractEndpoint +{ + protected $name; + + public function getURI(): string + { + $name = $this->name ?? null; + + if (isset($name)) { + return "/_ccr/auto_follow/$name"; + } + return "/_ccr/auto_follow"; + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setName($name): GetAutoFollowPattern + { + if (isset($name) !== true) { + return $this; + } + $this->name = $name; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ccr/PauseAutoFollowPattern.php b/src/Elasticsearch/Endpoints/Ccr/PauseAutoFollowPattern.php new file mode 100644 index 000000000..3e7eb2fbe --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ccr/PauseAutoFollowPattern.php @@ -0,0 +1,53 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PauseAutoFollowPattern extends AbstractEndpoint +{ + protected $name; + + public function getURI(): string + { + $name = $this->name ?? null; + + if (isset($name)) { + return "/_ccr/auto_follow/$name/pause"; + } + throw new RuntimeException('Missing parameter for the endpoint ccr.pause_auto_follow_pattern'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setName($name): PauseAutoFollowPattern + { + if (isset($name) !== true) { + return $this; + } + $this->name = $name; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ccr/PauseFollow.php b/src/Elasticsearch/Endpoints/Ccr/PauseFollow.php new file mode 100644 index 000000000..d1155815b --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ccr/PauseFollow.php @@ -0,0 +1,42 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PauseFollow extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/$index/_ccr/pause_follow"; + } + throw new RuntimeException('Missing parameter for the endpoint ccr.pause_follow'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'POST'; + } +} diff --git a/src/Elasticsearch/Endpoints/Ccr/PutAutoFollowPattern.php b/src/Elasticsearch/Endpoints/Ccr/PutAutoFollowPattern.php new file mode 100644 index 000000000..017439f14 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ccr/PutAutoFollowPattern.php @@ -0,0 +1,63 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PutAutoFollowPattern extends AbstractEndpoint +{ + protected $name; + + public function getURI(): string + { + $name = $this->name ?? null; + + if (isset($name)) { + return "/_ccr/auto_follow/$name"; + } + throw new RuntimeException('Missing parameter for the endpoint ccr.put_auto_follow_pattern'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): PutAutoFollowPattern + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setName($name): PutAutoFollowPattern + { + if (isset($name) !== true) { + return $this; + } + $this->name = $name; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ccr/ResumeAutoFollowPattern.php b/src/Elasticsearch/Endpoints/Ccr/ResumeAutoFollowPattern.php new file mode 100644 index 000000000..2003e4d80 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ccr/ResumeAutoFollowPattern.php @@ -0,0 +1,53 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class ResumeAutoFollowPattern extends AbstractEndpoint +{ + protected $name; + + public function getURI(): string + { + $name = $this->name ?? null; + + if (isset($name)) { + return "/_ccr/auto_follow/$name/resume"; + } + throw new RuntimeException('Missing parameter for the endpoint ccr.resume_auto_follow_pattern'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setName($name): ResumeAutoFollowPattern + { + if (isset($name) !== true) { + return $this; + } + $this->name = $name; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ccr/ResumeFollow.php b/src/Elasticsearch/Endpoints/Ccr/ResumeFollow.php new file mode 100644 index 000000000..c78822c9c --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ccr/ResumeFollow.php @@ -0,0 +1,52 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class ResumeFollow extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/$index/_ccr/resume_follow"; + } + throw new RuntimeException('Missing parameter for the endpoint ccr.resume_follow'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): ResumeFollow + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ccr/Stats.php b/src/Elasticsearch/Endpoints/Ccr/Stats.php new file mode 100644 index 000000000..3c56fa87d --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ccr/Stats.php @@ -0,0 +1,37 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Stats extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_ccr/stats"; + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/src/Elasticsearch/Endpoints/Ccr/Unfollow.php b/src/Elasticsearch/Endpoints/Ccr/Unfollow.php new file mode 100644 index 000000000..b7285202b --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ccr/Unfollow.php @@ -0,0 +1,42 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Unfollow extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/$index/_ccr/unfollow"; + } + throw new RuntimeException('Missing parameter for the endpoint ccr.unfollow'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'POST'; + } +} diff --git a/src/Elasticsearch/Endpoints/DataFrameTransformDeprecated/DeleteTransform.php b/src/Elasticsearch/Endpoints/DataFrameTransformDeprecated/DeleteTransform.php new file mode 100644 index 000000000..4f3f6a51b --- /dev/null +++ b/src/Elasticsearch/Endpoints/DataFrameTransformDeprecated/DeleteTransform.php @@ -0,0 +1,55 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeleteTransform extends AbstractEndpoint +{ + protected $transform_id; + + public function getURI(): string + { + $transform_id = $this->transform_id ?? null; + + if (isset($transform_id)) { + return "/_data_frame/transforms/$transform_id"; + } + throw new RuntimeException('Missing parameter for the endpoint data_frame_transform_deprecated.delete_transform'); + } + + public function getParamWhitelist(): array + { + return [ + 'force' + ]; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setTransformId($transform_id): DeleteTransform + { + if (isset($transform_id) !== true) { + return $this; + } + $this->transform_id = $transform_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/DataFrameTransformDeprecated/GetTransform.php b/src/Elasticsearch/Endpoints/DataFrameTransformDeprecated/GetTransform.php new file mode 100644 index 000000000..5c409255f --- /dev/null +++ b/src/Elasticsearch/Endpoints/DataFrameTransformDeprecated/GetTransform.php @@ -0,0 +1,56 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetTransform extends AbstractEndpoint +{ + protected $transform_id; + + public function getURI(): string + { + $transform_id = $this->transform_id ?? null; + + if (isset($transform_id)) { + return "/_data_frame/transforms/$transform_id"; + } + return "/_data_frame/transforms"; + } + + public function getParamWhitelist(): array + { + return [ + 'from', + 'size', + 'allow_no_match' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setTransformId($transform_id): GetTransform + { + if (isset($transform_id) !== true) { + return $this; + } + $this->transform_id = $transform_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/DataFrameTransformDeprecated/GetTransformStats.php b/src/Elasticsearch/Endpoints/DataFrameTransformDeprecated/GetTransformStats.php new file mode 100644 index 000000000..b75448aed --- /dev/null +++ b/src/Elasticsearch/Endpoints/DataFrameTransformDeprecated/GetTransformStats.php @@ -0,0 +1,57 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetTransformStats extends AbstractEndpoint +{ + protected $transform_id; + + public function getURI(): string + { + $transform_id = $this->transform_id ?? null; + + if (isset($transform_id)) { + return "/_data_frame/transforms/$transform_id/_stats"; + } + throw new RuntimeException('Missing parameter for the endpoint data_frame_transform_deprecated.get_transform_stats'); + } + + public function getParamWhitelist(): array + { + return [ + 'from', + 'size', + 'allow_no_match' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setTransformId($transform_id): GetTransformStats + { + if (isset($transform_id) !== true) { + return $this; + } + $this->transform_id = $transform_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/DataFrameTransformDeprecated/PreviewTransform.php b/src/Elasticsearch/Endpoints/DataFrameTransformDeprecated/PreviewTransform.php new file mode 100644 index 000000000..c5fe85418 --- /dev/null +++ b/src/Elasticsearch/Endpoints/DataFrameTransformDeprecated/PreviewTransform.php @@ -0,0 +1,47 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PreviewTransform extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_data_frame/transforms/_preview"; + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): PreviewTransform + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/DataFrameTransformDeprecated/PutTransform.php b/src/Elasticsearch/Endpoints/DataFrameTransformDeprecated/PutTransform.php new file mode 100644 index 000000000..86dcc73c2 --- /dev/null +++ b/src/Elasticsearch/Endpoints/DataFrameTransformDeprecated/PutTransform.php @@ -0,0 +1,65 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PutTransform extends AbstractEndpoint +{ + protected $transform_id; + + public function getURI(): string + { + $transform_id = $this->transform_id ?? null; + + if (isset($transform_id)) { + return "/_data_frame/transforms/$transform_id"; + } + throw new RuntimeException('Missing parameter for the endpoint data_frame_transform_deprecated.put_transform'); + } + + public function getParamWhitelist(): array + { + return [ + 'defer_validation' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): PutTransform + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setTransformId($transform_id): PutTransform + { + if (isset($transform_id) !== true) { + return $this; + } + $this->transform_id = $transform_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/DataFrameTransformDeprecated/StartTransform.php b/src/Elasticsearch/Endpoints/DataFrameTransformDeprecated/StartTransform.php new file mode 100644 index 000000000..3d43fa65b --- /dev/null +++ b/src/Elasticsearch/Endpoints/DataFrameTransformDeprecated/StartTransform.php @@ -0,0 +1,55 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class StartTransform extends AbstractEndpoint +{ + protected $transform_id; + + public function getURI(): string + { + $transform_id = $this->transform_id ?? null; + + if (isset($transform_id)) { + return "/_data_frame/transforms/$transform_id/_start"; + } + throw new RuntimeException('Missing parameter for the endpoint data_frame_transform_deprecated.start_transform'); + } + + public function getParamWhitelist(): array + { + return [ + 'timeout' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setTransformId($transform_id): StartTransform + { + if (isset($transform_id) !== true) { + return $this; + } + $this->transform_id = $transform_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/DataFrameTransformDeprecated/StopTransform.php b/src/Elasticsearch/Endpoints/DataFrameTransformDeprecated/StopTransform.php new file mode 100644 index 000000000..1e174e283 --- /dev/null +++ b/src/Elasticsearch/Endpoints/DataFrameTransformDeprecated/StopTransform.php @@ -0,0 +1,57 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class StopTransform extends AbstractEndpoint +{ + protected $transform_id; + + public function getURI(): string + { + $transform_id = $this->transform_id ?? null; + + if (isset($transform_id)) { + return "/_data_frame/transforms/$transform_id/_stop"; + } + throw new RuntimeException('Missing parameter for the endpoint data_frame_transform_deprecated.stop_transform'); + } + + public function getParamWhitelist(): array + { + return [ + 'wait_for_completion', + 'timeout', + 'allow_no_match' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setTransformId($transform_id): StopTransform + { + if (isset($transform_id) !== true) { + return $this; + } + $this->transform_id = $transform_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/DataFrameTransformDeprecated/UpdateTransform.php b/src/Elasticsearch/Endpoints/DataFrameTransformDeprecated/UpdateTransform.php new file mode 100644 index 000000000..be67fb951 --- /dev/null +++ b/src/Elasticsearch/Endpoints/DataFrameTransformDeprecated/UpdateTransform.php @@ -0,0 +1,65 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class UpdateTransform extends AbstractEndpoint +{ + protected $transform_id; + + public function getURI(): string + { + $transform_id = $this->transform_id ?? null; + + if (isset($transform_id)) { + return "/_data_frame/transforms/$transform_id/_update"; + } + throw new RuntimeException('Missing parameter for the endpoint data_frame_transform_deprecated.update_transform'); + } + + public function getParamWhitelist(): array + { + return [ + 'defer_validation' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): UpdateTransform + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setTransformId($transform_id): UpdateTransform + { + if (isset($transform_id) !== true) { + return $this; + } + $this->transform_id = $transform_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Enrich/DeletePolicy.php b/src/Elasticsearch/Endpoints/Enrich/DeletePolicy.php new file mode 100644 index 000000000..36707d094 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Enrich/DeletePolicy.php @@ -0,0 +1,53 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeletePolicy extends AbstractEndpoint +{ + protected $name; + + public function getURI(): string + { + $name = $this->name ?? null; + + if (isset($name)) { + return "/_enrich/policy/$name"; + } + throw new RuntimeException('Missing parameter for the endpoint enrich.delete_policy'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setName($name): DeletePolicy + { + if (isset($name) !== true) { + return $this; + } + $this->name = $name; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Enrich/ExecutePolicy.php b/src/Elasticsearch/Endpoints/Enrich/ExecutePolicy.php new file mode 100644 index 000000000..5ed360c18 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Enrich/ExecutePolicy.php @@ -0,0 +1,55 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class ExecutePolicy extends AbstractEndpoint +{ + protected $name; + + public function getURI(): string + { + $name = $this->name ?? null; + + if (isset($name)) { + return "/_enrich/policy/$name/_execute"; + } + throw new RuntimeException('Missing parameter for the endpoint enrich.execute_policy'); + } + + public function getParamWhitelist(): array + { + return [ + 'wait_for_completion' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setName($name): ExecutePolicy + { + if (isset($name) !== true) { + return $this; + } + $this->name = $name; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Enrich/GetPolicy.php b/src/Elasticsearch/Endpoints/Enrich/GetPolicy.php new file mode 100644 index 000000000..e2dbf2cb2 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Enrich/GetPolicy.php @@ -0,0 +1,55 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetPolicy extends AbstractEndpoint +{ + protected $name; + + public function getURI(): string + { + $name = $this->name ?? null; + + if (isset($name)) { + return "/_enrich/policy/$name"; + } + return "/_enrich/policy/"; + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setName($name): GetPolicy + { + if (isset($name) !== true) { + return $this; + } + if (is_array($name) === true) { + $name = implode(",", $name); + } + $this->name = $name; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Enrich/PutPolicy.php b/src/Elasticsearch/Endpoints/Enrich/PutPolicy.php new file mode 100644 index 000000000..fc82e6b00 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Enrich/PutPolicy.php @@ -0,0 +1,63 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PutPolicy extends AbstractEndpoint +{ + protected $name; + + public function getURI(): string + { + $name = $this->name ?? null; + + if (isset($name)) { + return "/_enrich/policy/$name"; + } + throw new RuntimeException('Missing parameter for the endpoint enrich.put_policy'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): PutPolicy + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setName($name): PutPolicy + { + if (isset($name) !== true) { + return $this; + } + $this->name = $name; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Enrich/Stats.php b/src/Elasticsearch/Endpoints/Enrich/Stats.php new file mode 100644 index 000000000..de299662b --- /dev/null +++ b/src/Elasticsearch/Endpoints/Enrich/Stats.php @@ -0,0 +1,37 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Stats extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_enrich/_stats"; + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/src/Elasticsearch/Endpoints/Eql/Search.php b/src/Elasticsearch/Endpoints/Eql/Search.php new file mode 100644 index 000000000..8f1507169 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Eql/Search.php @@ -0,0 +1,54 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Search extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/$index/_eql/search"; + } + throw new RuntimeException('Missing parameter for the endpoint eql.search'); + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return isset($this->body) ? 'POST' : 'GET'; + } + + public function setBody($body): Search + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Graph/Explore.php b/src/Elasticsearch/Endpoints/Graph/Explore.php new file mode 100644 index 000000000..c1a7a9b6d --- /dev/null +++ b/src/Elasticsearch/Endpoints/Graph/Explore.php @@ -0,0 +1,64 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Explore extends AbstractEndpoint +{ + + public function getURI(): string + { + if (isset($this->index) !== true) { + throw new RuntimeException( + 'index is required for explore' + ); + } + $index = $this->index; + $type = $this->type ?? null; + if (isset($type)) { + @trigger_error('Specifying types in urls has been deprecated', E_USER_DEPRECATED); + } + + if (isset($type)) { + return "/$index/$type/_graph/explore"; + } + return "/$index/_graph/explore"; + } + + public function getParamWhitelist(): array + { + return [ + 'routing', + 'timeout' + ]; + } + + public function getMethod(): string + { + return isset($this->body) ? 'POST' : 'GET'; + } + + public function setBody($body): Explore + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ilm/DeleteLifecycle.php b/src/Elasticsearch/Endpoints/Ilm/DeleteLifecycle.php new file mode 100644 index 000000000..484e5878d --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ilm/DeleteLifecycle.php @@ -0,0 +1,55 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeleteLifecycle extends AbstractEndpoint +{ + protected $policy; + + public function getURI(): string + { + $policy = $this->policy ?? null; + + if (isset($policy)) { + return "/_ilm/policy/$policy"; + } + throw new RuntimeException('Missing parameter for the endpoint ilm.delete_lifecycle'); + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setPolicy($policy): DeleteLifecycle + { + if (isset($policy) !== true) { + return $this; + } + $this->policy = $policy; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ilm/ExplainLifecycle.php b/src/Elasticsearch/Endpoints/Ilm/ExplainLifecycle.php new file mode 100644 index 000000000..696623c79 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ilm/ExplainLifecycle.php @@ -0,0 +1,45 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class ExplainLifecycle extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/$index/_ilm/explain"; + } + throw new RuntimeException('Missing parameter for the endpoint ilm.explain_lifecycle'); + } + + public function getParamWhitelist(): array + { + return [ + 'only_managed', + 'only_errors' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/src/Elasticsearch/Endpoints/Ilm/GetLifecycle.php b/src/Elasticsearch/Endpoints/Ilm/GetLifecycle.php new file mode 100644 index 000000000..33d691121 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ilm/GetLifecycle.php @@ -0,0 +1,54 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetLifecycle extends AbstractEndpoint +{ + protected $policy; + + public function getURI(): string + { + $policy = $this->policy ?? null; + + if (isset($policy)) { + return "/_ilm/policy/$policy"; + } + return "/_ilm/policy"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setPolicy($policy): GetLifecycle + { + if (isset($policy) !== true) { + return $this; + } + $this->policy = $policy; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ilm/GetStatus.php b/src/Elasticsearch/Endpoints/Ilm/GetStatus.php new file mode 100644 index 000000000..d65d05bbb --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ilm/GetStatus.php @@ -0,0 +1,39 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetStatus extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_ilm/status"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/src/Elasticsearch/Endpoints/Ilm/MoveToStep.php b/src/Elasticsearch/Endpoints/Ilm/MoveToStep.php new file mode 100644 index 000000000..a4d486235 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ilm/MoveToStep.php @@ -0,0 +1,54 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class MoveToStep extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/_ilm/move/$index"; + } + throw new RuntimeException('Missing parameter for the endpoint ilm.move_to_step'); + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): MoveToStep + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ilm/PutLifecycle.php b/src/Elasticsearch/Endpoints/Ilm/PutLifecycle.php new file mode 100644 index 000000000..485e291bc --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ilm/PutLifecycle.php @@ -0,0 +1,65 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PutLifecycle extends AbstractEndpoint +{ + protected $policy; + + public function getURI(): string + { + $policy = $this->policy ?? null; + + if (isset($policy)) { + return "/_ilm/policy/$policy"; + } + throw new RuntimeException('Missing parameter for the endpoint ilm.put_lifecycle'); + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): PutLifecycle + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setPolicy($policy): PutLifecycle + { + if (isset($policy) !== true) { + return $this; + } + $this->policy = $policy; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ilm/RemovePolicy.php b/src/Elasticsearch/Endpoints/Ilm/RemovePolicy.php new file mode 100644 index 000000000..7a79e21be --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ilm/RemovePolicy.php @@ -0,0 +1,44 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class RemovePolicy extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/$index/_ilm/remove"; + } + throw new RuntimeException('Missing parameter for the endpoint ilm.remove_policy'); + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'POST'; + } +} diff --git a/src/Elasticsearch/Endpoints/Ilm/Retry.php b/src/Elasticsearch/Endpoints/Ilm/Retry.php new file mode 100644 index 000000000..3928b8bff --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ilm/Retry.php @@ -0,0 +1,44 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Retry extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/$index/_ilm/retry"; + } + throw new RuntimeException('Missing parameter for the endpoint ilm.retry'); + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'POST'; + } +} diff --git a/src/Elasticsearch/Endpoints/Ilm/Start.php b/src/Elasticsearch/Endpoints/Ilm/Start.php new file mode 100644 index 000000000..fdfe76d9d --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ilm/Start.php @@ -0,0 +1,39 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Start extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_ilm/start"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'POST'; + } +} diff --git a/src/Elasticsearch/Endpoints/Ilm/Stop.php b/src/Elasticsearch/Endpoints/Ilm/Stop.php new file mode 100644 index 000000000..60cffe85e --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ilm/Stop.php @@ -0,0 +1,39 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Stop extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_ilm/stop"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'POST'; + } +} diff --git a/src/Elasticsearch/Endpoints/Indices/Freeze.php b/src/Elasticsearch/Endpoints/Indices/Freeze.php new file mode 100644 index 000000000..86ff87f84 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Indices/Freeze.php @@ -0,0 +1,49 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Freeze extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->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' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } +} diff --git a/src/Elasticsearch/Endpoints/Indices/ReloadSearchAnalyzers.php b/src/Elasticsearch/Endpoints/Indices/ReloadSearchAnalyzers.php new file mode 100644 index 000000000..728f09bb7 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Indices/ReloadSearchAnalyzers.php @@ -0,0 +1,46 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class ReloadSearchAnalyzers extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/$index/_reload_search_analyzers"; + } + throw new RuntimeException('Missing parameter for the endpoint indices.reload_search_analyzers'); + } + + public function getParamWhitelist(): array + { + return [ + 'ignore_unavailable', + 'allow_no_indices', + 'expand_wildcards' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/src/Elasticsearch/Endpoints/Indices/Unfreeze.php b/src/Elasticsearch/Endpoints/Indices/Unfreeze.php new file mode 100644 index 000000000..05bf33bdc --- /dev/null +++ b/src/Elasticsearch/Endpoints/Indices/Unfreeze.php @@ -0,0 +1,49 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Unfreeze extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->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' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } +} diff --git a/src/Elasticsearch/Endpoints/License/Delete.php b/src/Elasticsearch/Endpoints/License/Delete.php new file mode 100644 index 000000000..ad99f683e --- /dev/null +++ b/src/Elasticsearch/Endpoints/License/Delete.php @@ -0,0 +1,37 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Delete extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_license"; + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'DELETE'; + } +} diff --git a/src/Elasticsearch/Endpoints/License/Get.php b/src/Elasticsearch/Endpoints/License/Get.php new file mode 100644 index 000000000..a2b10ac57 --- /dev/null +++ b/src/Elasticsearch/Endpoints/License/Get.php @@ -0,0 +1,40 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Get extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_license"; + } + + public function getParamWhitelist(): array + { + return [ + 'local', + 'accept_enterprise' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/src/Elasticsearch/Endpoints/License/GetBasicStatus.php b/src/Elasticsearch/Endpoints/License/GetBasicStatus.php new file mode 100644 index 000000000..d11ea5c49 --- /dev/null +++ b/src/Elasticsearch/Endpoints/License/GetBasicStatus.php @@ -0,0 +1,39 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetBasicStatus extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_license/basic_status"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/src/Elasticsearch/Endpoints/License/GetTrialStatus.php b/src/Elasticsearch/Endpoints/License/GetTrialStatus.php new file mode 100644 index 000000000..3c4241590 --- /dev/null +++ b/src/Elasticsearch/Endpoints/License/GetTrialStatus.php @@ -0,0 +1,39 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetTrialStatus extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_license/trial_status"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/src/Elasticsearch/Endpoints/License/Post.php b/src/Elasticsearch/Endpoints/License/Post.php new file mode 100644 index 000000000..88ea1d4fb --- /dev/null +++ b/src/Elasticsearch/Endpoints/License/Post.php @@ -0,0 +1,49 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Post extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_license"; + } + + public function getParamWhitelist(): array + { + return [ + 'acknowledge' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): Post + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/License/PostStartBasic.php b/src/Elasticsearch/Endpoints/License/PostStartBasic.php new file mode 100644 index 000000000..6ea3607a3 --- /dev/null +++ b/src/Elasticsearch/Endpoints/License/PostStartBasic.php @@ -0,0 +1,39 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PostStartBasic extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_license/start_basic"; + } + + public function getParamWhitelist(): array + { + return [ + 'acknowledge' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } +} diff --git a/src/Elasticsearch/Endpoints/License/PostStartTrial.php b/src/Elasticsearch/Endpoints/License/PostStartTrial.php new file mode 100644 index 000000000..ae1810ceb --- /dev/null +++ b/src/Elasticsearch/Endpoints/License/PostStartTrial.php @@ -0,0 +1,40 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PostStartTrial extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_license/start_trial"; + } + + public function getParamWhitelist(): array + { + return [ + 'type', + 'acknowledge' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } +} diff --git a/src/Elasticsearch/Endpoints/Migration/Deprecations.php b/src/Elasticsearch/Endpoints/Migration/Deprecations.php new file mode 100644 index 000000000..13a654246 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Migration/Deprecations.php @@ -0,0 +1,43 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Deprecations extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/$index/_migration/deprecations"; + } + return "/_migration/deprecations"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/CloseJob.php b/src/Elasticsearch/Endpoints/Ml/CloseJob.php new file mode 100644 index 000000000..165a79d77 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/CloseJob.php @@ -0,0 +1,67 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class CloseJob extends AbstractEndpoint +{ + protected $job_id; + + public function getURI(): string + { + $job_id = $this->job_id ?? null; + + if (isset($job_id)) { + return "/_ml/anomaly_detectors/$job_id/_close"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.close_job'); + } + + public function getParamWhitelist(): array + { + return [ + 'allow_no_jobs', + 'force', + 'timeout' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): CloseJob + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setJobId($job_id): CloseJob + { + if (isset($job_id) !== true) { + return $this; + } + $this->job_id = $job_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/DeleteCalendar.php b/src/Elasticsearch/Endpoints/Ml/DeleteCalendar.php new file mode 100644 index 000000000..da980031f --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/DeleteCalendar.php @@ -0,0 +1,53 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeleteCalendar extends AbstractEndpoint +{ + protected $calendar_id; + + public function getURI(): string + { + $calendar_id = $this->calendar_id ?? null; + + if (isset($calendar_id)) { + return "/_ml/calendars/$calendar_id"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.delete_calendar'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setCalendarId($calendar_id): DeleteCalendar + { + if (isset($calendar_id) !== true) { + return $this; + } + $this->calendar_id = $calendar_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/DeleteCalendarEvent.php b/src/Elasticsearch/Endpoints/Ml/DeleteCalendarEvent.php new file mode 100644 index 000000000..b888a9126 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/DeleteCalendarEvent.php @@ -0,0 +1,65 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeleteCalendarEvent extends AbstractEndpoint +{ + protected $calendar_id; + protected $event_id; + + public function getURI(): string + { + $calendar_id = $this->calendar_id ?? null; + $event_id = $this->event_id ?? null; + + if (isset($calendar_id) && isset($event_id)) { + return "/_ml/calendars/$calendar_id/events/$event_id"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.delete_calendar_event'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setCalendarId($calendar_id): DeleteCalendarEvent + { + if (isset($calendar_id) !== true) { + return $this; + } + $this->calendar_id = $calendar_id; + + return $this; + } + + public function setEventId($event_id): DeleteCalendarEvent + { + if (isset($event_id) !== true) { + return $this; + } + $this->event_id = $event_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/DeleteCalendarJob.php b/src/Elasticsearch/Endpoints/Ml/DeleteCalendarJob.php new file mode 100644 index 000000000..feb17f4f1 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/DeleteCalendarJob.php @@ -0,0 +1,65 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeleteCalendarJob extends AbstractEndpoint +{ + protected $calendar_id; + protected $job_id; + + public function getURI(): string + { + $calendar_id = $this->calendar_id ?? null; + $job_id = $this->job_id ?? null; + + if (isset($calendar_id) && isset($job_id)) { + return "/_ml/calendars/$calendar_id/jobs/$job_id"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.delete_calendar_job'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setCalendarId($calendar_id): DeleteCalendarJob + { + if (isset($calendar_id) !== true) { + return $this; + } + $this->calendar_id = $calendar_id; + + return $this; + } + + public function setJobId($job_id): DeleteCalendarJob + { + if (isset($job_id) !== true) { + return $this; + } + $this->job_id = $job_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/DeleteDataFrameAnalytics.php b/src/Elasticsearch/Endpoints/Ml/DeleteDataFrameAnalytics.php new file mode 100644 index 000000000..3b0d2653d --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/DeleteDataFrameAnalytics.php @@ -0,0 +1,54 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeleteDataFrameAnalytics extends AbstractEndpoint +{ + + public function getURI(): string + { + $id = $this->id ?? null; + + if (isset($id)) { + return "/_ml/data_frame/analytics/$id"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.delete_data_frame_analytics'); + } + + public function getParamWhitelist(): array + { + return [ + 'force' + ]; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setId($id): DeleteDataFrameAnalytics + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/DeleteDatafeed.php b/src/Elasticsearch/Endpoints/Ml/DeleteDatafeed.php new file mode 100644 index 000000000..d6f2b59f3 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/DeleteDatafeed.php @@ -0,0 +1,55 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeleteDatafeed extends AbstractEndpoint +{ + protected $datafeed_id; + + public function getURI(): string + { + $datafeed_id = $this->datafeed_id ?? null; + + if (isset($datafeed_id)) { + return "/_ml/datafeeds/$datafeed_id"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.delete_datafeed'); + } + + public function getParamWhitelist(): array + { + return [ + 'force' + ]; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setDatafeedId($datafeed_id): DeleteDatafeed + { + if (isset($datafeed_id) !== true) { + return $this; + } + $this->datafeed_id = $datafeed_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/DeleteExpiredData.php b/src/Elasticsearch/Endpoints/Ml/DeleteExpiredData.php new file mode 100644 index 000000000..b004e6ebe --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/DeleteExpiredData.php @@ -0,0 +1,37 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeleteExpiredData extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_ml/_delete_expired_data"; + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'DELETE'; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/DeleteFilter.php b/src/Elasticsearch/Endpoints/Ml/DeleteFilter.php new file mode 100644 index 000000000..e37ac39af --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/DeleteFilter.php @@ -0,0 +1,53 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeleteFilter extends AbstractEndpoint +{ + protected $filter_id; + + public function getURI(): string + { + $filter_id = $this->filter_id ?? null; + + if (isset($filter_id)) { + return "/_ml/filters/$filter_id"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.delete_filter'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setFilterId($filter_id): DeleteFilter + { + if (isset($filter_id) !== true) { + return $this; + } + $this->filter_id = $filter_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/DeleteForecast.php b/src/Elasticsearch/Endpoints/Ml/DeleteForecast.php new file mode 100644 index 000000000..a038acc2a --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/DeleteForecast.php @@ -0,0 +1,73 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeleteForecast extends AbstractEndpoint +{ + protected $job_id; + protected $forecast_id; + + public function getURI(): string + { + if (isset($this->job_id) !== true) { + throw new RuntimeException( + 'job_id is required for delete_forecast' + ); + } + $job_id = $this->job_id; + $forecast_id = $this->forecast_id ?? null; + + if (isset($forecast_id)) { + return "/_ml/anomaly_detectors/$job_id/_forecast/$forecast_id"; + } + return "/_ml/anomaly_detectors/$job_id/_forecast"; + } + + public function getParamWhitelist(): array + { + return [ + 'allow_no_forecasts', + 'timeout' + ]; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setJobId($job_id): DeleteForecast + { + if (isset($job_id) !== true) { + return $this; + } + $this->job_id = $job_id; + + return $this; + } + + public function setForecastId($forecast_id): DeleteForecast + { + if (isset($forecast_id) !== true) { + return $this; + } + $this->forecast_id = $forecast_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/DeleteJob.php b/src/Elasticsearch/Endpoints/Ml/DeleteJob.php new file mode 100644 index 000000000..eb0fcc592 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/DeleteJob.php @@ -0,0 +1,56 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeleteJob extends AbstractEndpoint +{ + protected $job_id; + + public function getURI(): string + { + $job_id = $this->job_id ?? null; + + if (isset($job_id)) { + return "/_ml/anomaly_detectors/$job_id"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.delete_job'); + } + + public function getParamWhitelist(): array + { + return [ + 'force', + 'wait_for_completion' + ]; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setJobId($job_id): DeleteJob + { + if (isset($job_id) !== true) { + return $this; + } + $this->job_id = $job_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/DeleteModelSnapshot.php b/src/Elasticsearch/Endpoints/Ml/DeleteModelSnapshot.php new file mode 100644 index 000000000..982e80b82 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/DeleteModelSnapshot.php @@ -0,0 +1,65 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeleteModelSnapshot extends AbstractEndpoint +{ + protected $job_id; + protected $snapshot_id; + + public function getURI(): string + { + $job_id = $this->job_id ?? null; + $snapshot_id = $this->snapshot_id ?? null; + + if (isset($job_id) && isset($snapshot_id)) { + return "/_ml/anomaly_detectors/$job_id/model_snapshots/$snapshot_id"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.delete_model_snapshot'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setJobId($job_id): DeleteModelSnapshot + { + if (isset($job_id) !== true) { + return $this; + } + $this->job_id = $job_id; + + return $this; + } + + public function setSnapshotId($snapshot_id): DeleteModelSnapshot + { + if (isset($snapshot_id) !== true) { + return $this; + } + $this->snapshot_id = $snapshot_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/DeleteTrainedModel.php b/src/Elasticsearch/Endpoints/Ml/DeleteTrainedModel.php new file mode 100644 index 000000000..df6fe7d4d --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/DeleteTrainedModel.php @@ -0,0 +1,53 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeleteTrainedModel extends AbstractEndpoint +{ + protected $model_id; + + public function getURI(): string + { + $model_id = $this->model_id ?? null; + + if (isset($model_id)) { + return "/_ml/inference/$model_id"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.delete_trained_model'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setModelId($model_id): DeleteTrainedModel + { + if (isset($model_id) !== true) { + return $this; + } + $this->model_id = $model_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/EstimateModelMemory.php b/src/Elasticsearch/Endpoints/Ml/EstimateModelMemory.php new file mode 100644 index 000000000..d52aae399 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/EstimateModelMemory.php @@ -0,0 +1,49 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class EstimateModelMemory extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_ml/anomaly_detectors/_estimate_model_memory"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): EstimateModelMemory + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/EvaluateDataFrame.php b/src/Elasticsearch/Endpoints/Ml/EvaluateDataFrame.php new file mode 100644 index 000000000..7500a5a8f --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/EvaluateDataFrame.php @@ -0,0 +1,47 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class EvaluateDataFrame extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_ml/data_frame/_evaluate"; + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): EvaluateDataFrame + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/ExplainDataFrameAnalytics.php b/src/Elasticsearch/Endpoints/Ml/ExplainDataFrameAnalytics.php new file mode 100644 index 000000000..cce8be701 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/ExplainDataFrameAnalytics.php @@ -0,0 +1,61 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class ExplainDataFrameAnalytics extends AbstractEndpoint +{ + + public function getURI(): string + { + $id = $this->id ?? null; + + if (isset($id)) { + return "/_ml/data_frame/analytics/$id/_explain"; + } + return "/_ml/data_frame/analytics/_explain"; + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return isset($this->body) ? 'POST' : 'GET'; + } + + public function setBody($body): ExplainDataFrameAnalytics + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setId($id): ExplainDataFrameAnalytics + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/FindFileStructure.php b/src/Elasticsearch/Endpoints/Ml/FindFileStructure.php new file mode 100644 index 000000000..795d69281 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/FindFileStructure.php @@ -0,0 +1,80 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class FindFileStructure extends AbstractEndpoint +{ + + public function __construct(SerializerInterface $serializer) + { + $this->serializer = $serializer; + } + + public function getURI(): string + { + + return "/_ml/find_file_structure"; + } + + public function getParamWhitelist(): array + { + return [ + 'lines_to_sample', + 'line_merge_size_limit', + 'timeout', + 'charset', + 'format', + 'has_header_row', + 'column_names', + 'delimiter', + 'quote', + 'should_trim_fields', + 'grok_pattern', + 'timestamp_field', + 'timestamp_format', + 'explain' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): FindFileStructure + { + if (isset($body) !== true) { + return $this; + } + if (is_array($body) === true || $body instanceof Traversable) { + foreach ($body as $item) { + $this->body .= $this->serializer->serialize($item) . "\n"; + } + } elseif (is_string($body)) { + $this->body = $body; + if (substr($body, -1) != "\n") { + $this->body .= "\n"; + } + } else { + throw new InvalidArgumentException("Body must be an array, traversable object or string"); + } + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/FlushJob.php b/src/Elasticsearch/Endpoints/Ml/FlushJob.php new file mode 100644 index 000000000..1201bc61f --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/FlushJob.php @@ -0,0 +1,69 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class FlushJob extends AbstractEndpoint +{ + protected $job_id; + + public function getURI(): string + { + $job_id = $this->job_id ?? null; + + if (isset($job_id)) { + return "/_ml/anomaly_detectors/$job_id/_flush"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.flush_job'); + } + + public function getParamWhitelist(): array + { + return [ + 'calc_interim', + 'start', + 'end', + 'advance_time', + 'skip_time' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): FlushJob + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setJobId($job_id): FlushJob + { + if (isset($job_id) !== true) { + return $this; + } + $this->job_id = $job_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/Forecast.php b/src/Elasticsearch/Endpoints/Ml/Forecast.php new file mode 100644 index 000000000..942980097 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/Forecast.php @@ -0,0 +1,56 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Forecast extends AbstractEndpoint +{ + protected $job_id; + + public function getURI(): string + { + $job_id = $this->job_id ?? null; + + if (isset($job_id)) { + return "/_ml/anomaly_detectors/$job_id/_forecast"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.forecast'); + } + + public function getParamWhitelist(): array + { + return [ + 'duration', + 'expires_in' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setJobId($job_id): Forecast + { + if (isset($job_id) !== true) { + return $this; + } + $this->job_id = $job_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/GetBuckets.php b/src/Elasticsearch/Endpoints/Ml/GetBuckets.php new file mode 100644 index 000000000..c96e859d3 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/GetBuckets.php @@ -0,0 +1,90 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetBuckets extends AbstractEndpoint +{ + protected $job_id; + protected $timestamp; + + public function getURI(): string + { + if (isset($this->job_id) !== true) { + throw new RuntimeException( + 'job_id is required for get_buckets' + ); + } + $job_id = $this->job_id; + $timestamp = $this->timestamp ?? null; + + if (isset($timestamp)) { + return "/_ml/anomaly_detectors/$job_id/results/buckets/$timestamp"; + } + return "/_ml/anomaly_detectors/$job_id/results/buckets"; + } + + public function getParamWhitelist(): array + { + return [ + 'expand', + 'exclude_interim', + 'from', + 'size', + 'start', + 'end', + 'anomaly_score', + 'sort', + 'desc' + ]; + } + + public function getMethod(): string + { + return isset($this->body) ? 'POST' : 'GET'; + } + + public function setBody($body): GetBuckets + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setJobId($job_id): GetBuckets + { + if (isset($job_id) !== true) { + return $this; + } + $this->job_id = $job_id; + + return $this; + } + + public function setTimestamp($timestamp): GetBuckets + { + if (isset($timestamp) !== true) { + return $this; + } + $this->timestamp = $timestamp; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/GetCalendarEvents.php b/src/Elasticsearch/Endpoints/Ml/GetCalendarEvents.php new file mode 100644 index 000000000..9e17dbd13 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/GetCalendarEvents.php @@ -0,0 +1,59 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetCalendarEvents extends AbstractEndpoint +{ + protected $calendar_id; + + public function getURI(): string + { + $calendar_id = $this->calendar_id ?? null; + + if (isset($calendar_id)) { + return "/_ml/calendars/$calendar_id/events"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.get_calendar_events'); + } + + public function getParamWhitelist(): array + { + return [ + 'job_id', + 'start', + 'end', + 'from', + 'size' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setCalendarId($calendar_id): GetCalendarEvents + { + if (isset($calendar_id) !== true) { + return $this; + } + $this->calendar_id = $calendar_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/GetCalendars.php b/src/Elasticsearch/Endpoints/Ml/GetCalendars.php new file mode 100644 index 000000000..f76c1dbb5 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/GetCalendars.php @@ -0,0 +1,65 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetCalendars extends AbstractEndpoint +{ + protected $calendar_id; + + public function getURI(): string + { + $calendar_id = $this->calendar_id ?? null; + + if (isset($calendar_id)) { + return "/_ml/calendars/$calendar_id"; + } + return "/_ml/calendars"; + } + + public function getParamWhitelist(): array + { + return [ + 'from', + 'size' + ]; + } + + public function getMethod(): string + { + return isset($this->body) ? 'POST' : 'GET'; + } + + public function setBody($body): GetCalendars + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setCalendarId($calendar_id): GetCalendars + { + if (isset($calendar_id) !== true) { + return $this; + } + $this->calendar_id = $calendar_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/GetCategories.php b/src/Elasticsearch/Endpoints/Ml/GetCategories.php new file mode 100644 index 000000000..cac936f6d --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/GetCategories.php @@ -0,0 +1,83 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetCategories extends AbstractEndpoint +{ + protected $job_id; + protected $category_id; + + public function getURI(): string + { + if (isset($this->job_id) !== true) { + throw new RuntimeException( + 'job_id is required for get_categories' + ); + } + $job_id = $this->job_id; + $category_id = $this->category_id ?? null; + + if (isset($category_id)) { + return "/_ml/anomaly_detectors/$job_id/results/categories/$category_id"; + } + return "/_ml/anomaly_detectors/$job_id/results/categories/"; + } + + public function getParamWhitelist(): array + { + return [ + 'from', + 'size' + ]; + } + + public function getMethod(): string + { + return isset($this->body) ? 'POST' : 'GET'; + } + + public function setBody($body): GetCategories + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setJobId($job_id): GetCategories + { + if (isset($job_id) !== true) { + return $this; + } + $this->job_id = $job_id; + + return $this; + } + + public function setCategoryId($category_id): GetCategories + { + if (isset($category_id) !== true) { + return $this; + } + $this->category_id = $category_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/GetDataFrameAnalytics.php b/src/Elasticsearch/Endpoints/Ml/GetDataFrameAnalytics.php new file mode 100644 index 000000000..076c283e6 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/GetDataFrameAnalytics.php @@ -0,0 +1,55 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetDataFrameAnalytics extends AbstractEndpoint +{ + + public function getURI(): string + { + $id = $this->id ?? null; + + if (isset($id)) { + return "/_ml/data_frame/analytics/$id"; + } + return "/_ml/data_frame/analytics"; + } + + public function getParamWhitelist(): array + { + return [ + 'allow_no_match', + 'from', + 'size' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setId($id): GetDataFrameAnalytics + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/GetDataFrameAnalyticsStats.php b/src/Elasticsearch/Endpoints/Ml/GetDataFrameAnalyticsStats.php new file mode 100644 index 000000000..204fad89a --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/GetDataFrameAnalyticsStats.php @@ -0,0 +1,55 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetDataFrameAnalyticsStats extends AbstractEndpoint +{ + + public function getURI(): string + { + $id = $this->id ?? null; + + if (isset($id)) { + return "/_ml/data_frame/analytics/$id/_stats"; + } + return "/_ml/data_frame/analytics/_stats"; + } + + public function getParamWhitelist(): array + { + return [ + 'allow_no_match', + 'from', + 'size' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setId($id): GetDataFrameAnalyticsStats + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/GetDatafeedStats.php b/src/Elasticsearch/Endpoints/Ml/GetDatafeedStats.php new file mode 100644 index 000000000..4d3b996fd --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/GetDatafeedStats.php @@ -0,0 +1,54 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetDatafeedStats extends AbstractEndpoint +{ + protected $datafeed_id; + + public function getURI(): string + { + $datafeed_id = $this->datafeed_id ?? null; + + if (isset($datafeed_id)) { + return "/_ml/datafeeds/$datafeed_id/_stats"; + } + return "/_ml/datafeeds/_stats"; + } + + public function getParamWhitelist(): array + { + return [ + 'allow_no_datafeeds' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setDatafeedId($datafeed_id): GetDatafeedStats + { + if (isset($datafeed_id) !== true) { + return $this; + } + $this->datafeed_id = $datafeed_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/GetDatafeeds.php b/src/Elasticsearch/Endpoints/Ml/GetDatafeeds.php new file mode 100644 index 000000000..3961a157b --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/GetDatafeeds.php @@ -0,0 +1,54 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetDatafeeds extends AbstractEndpoint +{ + protected $datafeed_id; + + public function getURI(): string + { + $datafeed_id = $this->datafeed_id ?? null; + + if (isset($datafeed_id)) { + return "/_ml/datafeeds/$datafeed_id"; + } + return "/_ml/datafeeds"; + } + + public function getParamWhitelist(): array + { + return [ + 'allow_no_datafeeds' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setDatafeedId($datafeed_id): GetDatafeeds + { + if (isset($datafeed_id) !== true) { + return $this; + } + $this->datafeed_id = $datafeed_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/GetFilters.php b/src/Elasticsearch/Endpoints/Ml/GetFilters.php new file mode 100644 index 000000000..3418dd8ca --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/GetFilters.php @@ -0,0 +1,55 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetFilters extends AbstractEndpoint +{ + protected $filter_id; + + public function getURI(): string + { + $filter_id = $this->filter_id ?? null; + + if (isset($filter_id)) { + return "/_ml/filters/$filter_id"; + } + return "/_ml/filters"; + } + + public function getParamWhitelist(): array + { + return [ + 'from', + 'size' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setFilterId($filter_id): GetFilters + { + if (isset($filter_id) !== true) { + return $this; + } + $this->filter_id = $filter_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/GetInfluencers.php b/src/Elasticsearch/Endpoints/Ml/GetInfluencers.php new file mode 100644 index 000000000..1eb4880e1 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/GetInfluencers.php @@ -0,0 +1,72 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetInfluencers extends AbstractEndpoint +{ + protected $job_id; + + public function getURI(): string + { + $job_id = $this->job_id ?? null; + + if (isset($job_id)) { + return "/_ml/anomaly_detectors/$job_id/results/influencers"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.get_influencers'); + } + + public function getParamWhitelist(): array + { + return [ + 'exclude_interim', + 'from', + 'size', + 'start', + 'end', + 'influencer_score', + 'sort', + 'desc' + ]; + } + + public function getMethod(): string + { + return isset($this->body) ? 'POST' : 'GET'; + } + + public function setBody($body): GetInfluencers + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setJobId($job_id): GetInfluencers + { + if (isset($job_id) !== true) { + return $this; + } + $this->job_id = $job_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/GetJobStats.php b/src/Elasticsearch/Endpoints/Ml/GetJobStats.php new file mode 100644 index 000000000..4d3f64b52 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/GetJobStats.php @@ -0,0 +1,54 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetJobStats extends AbstractEndpoint +{ + protected $job_id; + + public function getURI(): string + { + $job_id = $this->job_id ?? null; + + if (isset($job_id)) { + return "/_ml/anomaly_detectors/$job_id/_stats"; + } + return "/_ml/anomaly_detectors/_stats"; + } + + public function getParamWhitelist(): array + { + return [ + 'allow_no_jobs' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setJobId($job_id): GetJobStats + { + if (isset($job_id) !== true) { + return $this; + } + $this->job_id = $job_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/GetJobs.php b/src/Elasticsearch/Endpoints/Ml/GetJobs.php new file mode 100644 index 000000000..594562f12 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/GetJobs.php @@ -0,0 +1,54 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetJobs extends AbstractEndpoint +{ + protected $job_id; + + public function getURI(): string + { + $job_id = $this->job_id ?? null; + + if (isset($job_id)) { + return "/_ml/anomaly_detectors/$job_id"; + } + return "/_ml/anomaly_detectors"; + } + + public function getParamWhitelist(): array + { + return [ + 'allow_no_jobs' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setJobId($job_id): GetJobs + { + if (isset($job_id) !== true) { + return $this; + } + $this->job_id = $job_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/GetModelSnapshots.php b/src/Elasticsearch/Endpoints/Ml/GetModelSnapshots.php new file mode 100644 index 000000000..4b5344793 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/GetModelSnapshots.php @@ -0,0 +1,87 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetModelSnapshots extends AbstractEndpoint +{ + protected $job_id; + protected $snapshot_id; + + public function getURI(): string + { + if (isset($this->job_id) !== true) { + throw new RuntimeException( + 'job_id is required for get_model_snapshots' + ); + } + $job_id = $this->job_id; + $snapshot_id = $this->snapshot_id ?? null; + + if (isset($snapshot_id)) { + return "/_ml/anomaly_detectors/$job_id/model_snapshots/$snapshot_id"; + } + return "/_ml/anomaly_detectors/$job_id/model_snapshots"; + } + + public function getParamWhitelist(): array + { + return [ + 'from', + 'size', + 'start', + 'end', + 'sort', + 'desc' + ]; + } + + public function getMethod(): string + { + return isset($this->body) ? 'POST' : 'GET'; + } + + public function setBody($body): GetModelSnapshots + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setJobId($job_id): GetModelSnapshots + { + if (isset($job_id) !== true) { + return $this; + } + $this->job_id = $job_id; + + return $this; + } + + public function setSnapshotId($snapshot_id): GetModelSnapshots + { + if (isset($snapshot_id) !== true) { + return $this; + } + $this->snapshot_id = $snapshot_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/GetOverallBuckets.php b/src/Elasticsearch/Endpoints/Ml/GetOverallBuckets.php new file mode 100644 index 000000000..1b3003d31 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/GetOverallBuckets.php @@ -0,0 +1,71 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetOverallBuckets extends AbstractEndpoint +{ + protected $job_id; + + public function getURI(): string + { + $job_id = $this->job_id ?? null; + + if (isset($job_id)) { + return "/_ml/anomaly_detectors/$job_id/results/overall_buckets"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.get_overall_buckets'); + } + + public function getParamWhitelist(): array + { + return [ + 'top_n', + 'bucket_span', + 'overall_score', + 'exclude_interim', + 'start', + 'end', + 'allow_no_jobs' + ]; + } + + public function getMethod(): string + { + return isset($this->body) ? 'POST' : 'GET'; + } + + public function setBody($body): GetOverallBuckets + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setJobId($job_id): GetOverallBuckets + { + if (isset($job_id) !== true) { + return $this; + } + $this->job_id = $job_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/GetRecords.php b/src/Elasticsearch/Endpoints/Ml/GetRecords.php new file mode 100644 index 000000000..fa6baa340 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/GetRecords.php @@ -0,0 +1,72 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetRecords extends AbstractEndpoint +{ + protected $job_id; + + public function getURI(): string + { + $job_id = $this->job_id ?? null; + + if (isset($job_id)) { + return "/_ml/anomaly_detectors/$job_id/results/records"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.get_records'); + } + + public function getParamWhitelist(): array + { + return [ + 'exclude_interim', + 'from', + 'size', + 'start', + 'end', + 'record_score', + 'sort', + 'desc' + ]; + } + + public function getMethod(): string + { + return isset($this->body) ? 'POST' : 'GET'; + } + + public function setBody($body): GetRecords + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setJobId($job_id): GetRecords + { + if (isset($job_id) !== true) { + return $this; + } + $this->job_id = $job_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/GetTrainedModels.php b/src/Elasticsearch/Endpoints/Ml/GetTrainedModels.php new file mode 100644 index 000000000..aefbcc044 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/GetTrainedModels.php @@ -0,0 +1,59 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetTrainedModels extends AbstractEndpoint +{ + protected $model_id; + + public function getURI(): string + { + $model_id = $this->model_id ?? null; + + if (isset($model_id)) { + return "/_ml/inference/$model_id"; + } + return "/_ml/inference"; + } + + public function getParamWhitelist(): array + { + return [ + 'allow_no_match', + 'include_model_definition', + 'decompress_definition', + 'from', + 'size', + 'tags' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setModelId($model_id): GetTrainedModels + { + if (isset($model_id) !== true) { + return $this; + } + $this->model_id = $model_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/GetTrainedModelsStats.php b/src/Elasticsearch/Endpoints/Ml/GetTrainedModelsStats.php new file mode 100644 index 000000000..16bf21cac --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/GetTrainedModelsStats.php @@ -0,0 +1,56 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetTrainedModelsStats extends AbstractEndpoint +{ + protected $model_id; + + public function getURI(): string + { + $model_id = $this->model_id ?? null; + + if (isset($model_id)) { + return "/_ml/inference/$model_id/_stats"; + } + return "/_ml/inference/_stats"; + } + + public function getParamWhitelist(): array + { + return [ + 'allow_no_match', + 'from', + 'size' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setModelId($model_id): GetTrainedModelsStats + { + if (isset($model_id) !== true) { + return $this; + } + $this->model_id = $model_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/Info.php b/src/Elasticsearch/Endpoints/Ml/Info.php new file mode 100644 index 000000000..feef85435 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/Info.php @@ -0,0 +1,37 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Info extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_ml/info"; + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/OpenJob.php b/src/Elasticsearch/Endpoints/Ml/OpenJob.php new file mode 100644 index 000000000..8b531293b --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/OpenJob.php @@ -0,0 +1,53 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class OpenJob extends AbstractEndpoint +{ + protected $job_id; + + public function getURI(): string + { + $job_id = $this->job_id ?? null; + + if (isset($job_id)) { + return "/_ml/anomaly_detectors/$job_id/_open"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.open_job'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setJobId($job_id): OpenJob + { + if (isset($job_id) !== true) { + return $this; + } + $this->job_id = $job_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/PostCalendarEvents.php b/src/Elasticsearch/Endpoints/Ml/PostCalendarEvents.php new file mode 100644 index 000000000..afcae621d --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/PostCalendarEvents.php @@ -0,0 +1,63 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PostCalendarEvents extends AbstractEndpoint +{ + protected $calendar_id; + + public function getURI(): string + { + $calendar_id = $this->calendar_id ?? null; + + if (isset($calendar_id)) { + return "/_ml/calendars/$calendar_id/events"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.post_calendar_events'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): PostCalendarEvents + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setCalendarId($calendar_id): PostCalendarEvents + { + if (isset($calendar_id) !== true) { + return $this; + } + $this->calendar_id = $calendar_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/PostData.php b/src/Elasticsearch/Endpoints/Ml/PostData.php new file mode 100644 index 000000000..cda8b424a --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/PostData.php @@ -0,0 +1,84 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PostData extends AbstractEndpoint +{ + protected $job_id; + + public function __construct(SerializerInterface $serializer) + { + $this->serializer = $serializer; + } + + public function getURI(): string + { + $job_id = $this->job_id ?? null; + + if (isset($job_id)) { + return "/_ml/anomaly_detectors/$job_id/_data"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.post_data'); + } + + public function getParamWhitelist(): array + { + return [ + 'reset_start', + 'reset_end' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): PostData + { + if (isset($body) !== true) { + return $this; + } + if (is_array($body) === true || $body instanceof Traversable) { + foreach ($body as $item) { + $this->body .= $this->serializer->serialize($item) . "\n"; + } + } elseif (is_string($body)) { + $this->body = $body; + if (substr($body, -1) != "\n") { + $this->body .= "\n"; + } + } else { + throw new InvalidArgumentException("Body must be an array, traversable object or string"); + } + return $this; + } + + public function setJobId($job_id): PostData + { + if (isset($job_id) !== true) { + return $this; + } + $this->job_id = $job_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/PreviewDatafeed.php b/src/Elasticsearch/Endpoints/Ml/PreviewDatafeed.php new file mode 100644 index 000000000..d69b32708 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/PreviewDatafeed.php @@ -0,0 +1,53 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PreviewDatafeed extends AbstractEndpoint +{ + protected $datafeed_id; + + public function getURI(): string + { + $datafeed_id = $this->datafeed_id ?? null; + + if (isset($datafeed_id)) { + return "/_ml/datafeeds/$datafeed_id/_preview"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.preview_datafeed'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setDatafeedId($datafeed_id): PreviewDatafeed + { + if (isset($datafeed_id) !== true) { + return $this; + } + $this->datafeed_id = $datafeed_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/PutCalendar.php b/src/Elasticsearch/Endpoints/Ml/PutCalendar.php new file mode 100644 index 000000000..599451aa3 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/PutCalendar.php @@ -0,0 +1,63 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PutCalendar extends AbstractEndpoint +{ + protected $calendar_id; + + public function getURI(): string + { + $calendar_id = $this->calendar_id ?? null; + + if (isset($calendar_id)) { + return "/_ml/calendars/$calendar_id"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.put_calendar'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): PutCalendar + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setCalendarId($calendar_id): PutCalendar + { + if (isset($calendar_id) !== true) { + return $this; + } + $this->calendar_id = $calendar_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/PutCalendarJob.php b/src/Elasticsearch/Endpoints/Ml/PutCalendarJob.php new file mode 100644 index 000000000..3f2a0dd67 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/PutCalendarJob.php @@ -0,0 +1,65 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PutCalendarJob extends AbstractEndpoint +{ + protected $calendar_id; + protected $job_id; + + public function getURI(): string + { + $calendar_id = $this->calendar_id ?? null; + $job_id = $this->job_id ?? null; + + if (isset($calendar_id) && isset($job_id)) { + return "/_ml/calendars/$calendar_id/jobs/$job_id"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.put_calendar_job'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setCalendarId($calendar_id): PutCalendarJob + { + if (isset($calendar_id) !== true) { + return $this; + } + $this->calendar_id = $calendar_id; + + return $this; + } + + public function setJobId($job_id): PutCalendarJob + { + if (isset($job_id) !== true) { + return $this; + } + $this->job_id = $job_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/PutDataFrameAnalytics.php b/src/Elasticsearch/Endpoints/Ml/PutDataFrameAnalytics.php new file mode 100644 index 000000000..a0b7f9528 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/PutDataFrameAnalytics.php @@ -0,0 +1,62 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PutDataFrameAnalytics extends AbstractEndpoint +{ + + public function getURI(): string + { + $id = $this->id ?? null; + + if (isset($id)) { + return "/_ml/data_frame/analytics/$id"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.put_data_frame_analytics'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): PutDataFrameAnalytics + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setId($id): PutDataFrameAnalytics + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/PutDatafeed.php b/src/Elasticsearch/Endpoints/Ml/PutDatafeed.php new file mode 100644 index 000000000..be37a1e1b --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/PutDatafeed.php @@ -0,0 +1,68 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PutDatafeed extends AbstractEndpoint +{ + protected $datafeed_id; + + public function getURI(): string + { + $datafeed_id = $this->datafeed_id ?? null; + + if (isset($datafeed_id)) { + return "/_ml/datafeeds/$datafeed_id"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.put_datafeed'); + } + + public function getParamWhitelist(): array + { + return [ + 'ignore_unavailable', + 'allow_no_indices', + 'ignore_throttled', + 'expand_wildcards' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): PutDatafeed + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setDatafeedId($datafeed_id): PutDatafeed + { + if (isset($datafeed_id) !== true) { + return $this; + } + $this->datafeed_id = $datafeed_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/PutFilter.php b/src/Elasticsearch/Endpoints/Ml/PutFilter.php new file mode 100644 index 000000000..1b6202d93 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/PutFilter.php @@ -0,0 +1,63 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PutFilter extends AbstractEndpoint +{ + protected $filter_id; + + public function getURI(): string + { + $filter_id = $this->filter_id ?? null; + + if (isset($filter_id)) { + return "/_ml/filters/$filter_id"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.put_filter'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): PutFilter + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setFilterId($filter_id): PutFilter + { + if (isset($filter_id) !== true) { + return $this; + } + $this->filter_id = $filter_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/PutJob.php b/src/Elasticsearch/Endpoints/Ml/PutJob.php new file mode 100644 index 000000000..a6bfadbf7 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/PutJob.php @@ -0,0 +1,63 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PutJob extends AbstractEndpoint +{ + protected $job_id; + + public function getURI(): string + { + $job_id = $this->job_id ?? null; + + if (isset($job_id)) { + return "/_ml/anomaly_detectors/$job_id"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.put_job'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): PutJob + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setJobId($job_id): PutJob + { + if (isset($job_id) !== true) { + return $this; + } + $this->job_id = $job_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/PutTrainedModel.php b/src/Elasticsearch/Endpoints/Ml/PutTrainedModel.php new file mode 100644 index 000000000..b65e6e486 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/PutTrainedModel.php @@ -0,0 +1,63 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PutTrainedModel extends AbstractEndpoint +{ + protected $model_id; + + public function getURI(): string + { + $model_id = $this->model_id ?? null; + + if (isset($model_id)) { + return "/_ml/inference/$model_id"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.put_trained_model'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): PutTrainedModel + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setModelId($model_id): PutTrainedModel + { + if (isset($model_id) !== true) { + return $this; + } + $this->model_id = $model_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/RevertModelSnapshot.php b/src/Elasticsearch/Endpoints/Ml/RevertModelSnapshot.php new file mode 100644 index 000000000..8e55e654b --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/RevertModelSnapshot.php @@ -0,0 +1,77 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class RevertModelSnapshot extends AbstractEndpoint +{ + protected $job_id; + protected $snapshot_id; + + public function getURI(): string + { + $job_id = $this->job_id ?? null; + $snapshot_id = $this->snapshot_id ?? null; + + if (isset($job_id) && isset($snapshot_id)) { + return "/_ml/anomaly_detectors/$job_id/model_snapshots/$snapshot_id/_revert"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.revert_model_snapshot'); + } + + public function getParamWhitelist(): array + { + return [ + 'delete_intervening_results' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): RevertModelSnapshot + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setJobId($job_id): RevertModelSnapshot + { + if (isset($job_id) !== true) { + return $this; + } + $this->job_id = $job_id; + + return $this; + } + + public function setSnapshotId($snapshot_id): RevertModelSnapshot + { + if (isset($snapshot_id) !== true) { + return $this; + } + $this->snapshot_id = $snapshot_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/SetUpgradeMode.php b/src/Elasticsearch/Endpoints/Ml/SetUpgradeMode.php new file mode 100644 index 000000000..ec49164bb --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/SetUpgradeMode.php @@ -0,0 +1,40 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class SetUpgradeMode extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_ml/set_upgrade_mode"; + } + + public function getParamWhitelist(): array + { + return [ + 'enabled', + 'timeout' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/StartDataFrameAnalytics.php b/src/Elasticsearch/Endpoints/Ml/StartDataFrameAnalytics.php new file mode 100644 index 000000000..a14380883 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/StartDataFrameAnalytics.php @@ -0,0 +1,64 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class StartDataFrameAnalytics extends AbstractEndpoint +{ + + public function getURI(): string + { + $id = $this->id ?? null; + + if (isset($id)) { + return "/_ml/data_frame/analytics/$id/_start"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.start_data_frame_analytics'); + } + + public function getParamWhitelist(): array + { + return [ + 'timeout' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): StartDataFrameAnalytics + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setId($id): StartDataFrameAnalytics + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/StartDatafeed.php b/src/Elasticsearch/Endpoints/Ml/StartDatafeed.php new file mode 100644 index 000000000..93b2be095 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/StartDatafeed.php @@ -0,0 +1,67 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class StartDatafeed extends AbstractEndpoint +{ + protected $datafeed_id; + + public function getURI(): string + { + $datafeed_id = $this->datafeed_id ?? null; + + if (isset($datafeed_id)) { + return "/_ml/datafeeds/$datafeed_id/_start"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.start_datafeed'); + } + + public function getParamWhitelist(): array + { + return [ + 'start', + 'end', + 'timeout' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): StartDatafeed + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setDatafeedId($datafeed_id): StartDatafeed + { + if (isset($datafeed_id) !== true) { + return $this; + } + $this->datafeed_id = $datafeed_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/StopDataFrameAnalytics.php b/src/Elasticsearch/Endpoints/Ml/StopDataFrameAnalytics.php new file mode 100644 index 000000000..135929256 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/StopDataFrameAnalytics.php @@ -0,0 +1,66 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class StopDataFrameAnalytics extends AbstractEndpoint +{ + + public function getURI(): string + { + $id = $this->id ?? null; + + if (isset($id)) { + return "/_ml/data_frame/analytics/$id/_stop"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.stop_data_frame_analytics'); + } + + public function getParamWhitelist(): array + { + return [ + 'allow_no_match', + 'force', + 'timeout' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): StopDataFrameAnalytics + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setId($id): StopDataFrameAnalytics + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/StopDatafeed.php b/src/Elasticsearch/Endpoints/Ml/StopDatafeed.php new file mode 100644 index 000000000..f967836d1 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/StopDatafeed.php @@ -0,0 +1,57 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class StopDatafeed extends AbstractEndpoint +{ + protected $datafeed_id; + + public function getURI(): string + { + $datafeed_id = $this->datafeed_id ?? null; + + if (isset($datafeed_id)) { + return "/_ml/datafeeds/$datafeed_id/_stop"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.stop_datafeed'); + } + + public function getParamWhitelist(): array + { + return [ + 'allow_no_datafeeds', + 'force', + 'timeout' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setDatafeedId($datafeed_id): StopDatafeed + { + if (isset($datafeed_id) !== true) { + return $this; + } + $this->datafeed_id = $datafeed_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/UpdateDatafeed.php b/src/Elasticsearch/Endpoints/Ml/UpdateDatafeed.php new file mode 100644 index 000000000..f90b6f4dc --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/UpdateDatafeed.php @@ -0,0 +1,68 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class UpdateDatafeed extends AbstractEndpoint +{ + protected $datafeed_id; + + public function getURI(): string + { + $datafeed_id = $this->datafeed_id ?? null; + + if (isset($datafeed_id)) { + return "/_ml/datafeeds/$datafeed_id/_update"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.update_datafeed'); + } + + public function getParamWhitelist(): array + { + return [ + 'ignore_unavailable', + 'allow_no_indices', + 'ignore_throttled', + 'expand_wildcards' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): UpdateDatafeed + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setDatafeedId($datafeed_id): UpdateDatafeed + { + if (isset($datafeed_id) !== true) { + return $this; + } + $this->datafeed_id = $datafeed_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/UpdateFilter.php b/src/Elasticsearch/Endpoints/Ml/UpdateFilter.php new file mode 100644 index 000000000..0713e4729 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/UpdateFilter.php @@ -0,0 +1,63 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class UpdateFilter extends AbstractEndpoint +{ + protected $filter_id; + + public function getURI(): string + { + $filter_id = $this->filter_id ?? null; + + if (isset($filter_id)) { + return "/_ml/filters/$filter_id/_update"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.update_filter'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): UpdateFilter + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setFilterId($filter_id): UpdateFilter + { + if (isset($filter_id) !== true) { + return $this; + } + $this->filter_id = $filter_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/UpdateJob.php b/src/Elasticsearch/Endpoints/Ml/UpdateJob.php new file mode 100644 index 000000000..2b8019a5b --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/UpdateJob.php @@ -0,0 +1,63 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class UpdateJob extends AbstractEndpoint +{ + protected $job_id; + + public function getURI(): string + { + $job_id = $this->job_id ?? null; + + if (isset($job_id)) { + return "/_ml/anomaly_detectors/$job_id/_update"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.update_job'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): UpdateJob + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setJobId($job_id): UpdateJob + { + if (isset($job_id) !== true) { + return $this; + } + $this->job_id = $job_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/UpdateModelSnapshot.php b/src/Elasticsearch/Endpoints/Ml/UpdateModelSnapshot.php new file mode 100644 index 000000000..7454e89b1 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/UpdateModelSnapshot.php @@ -0,0 +1,77 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class UpdateModelSnapshot extends AbstractEndpoint +{ + protected $job_id; + protected $snapshot_id; + + public function getURI(): string + { + $job_id = $this->job_id ?? null; + $snapshot_id = $this->snapshot_id ?? null; + + if (isset($job_id) && isset($snapshot_id)) { + return "/_ml/anomaly_detectors/$job_id/model_snapshots/$snapshot_id/_update"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.update_model_snapshot'); + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): UpdateModelSnapshot + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setJobId($job_id): UpdateModelSnapshot + { + if (isset($job_id) !== true) { + return $this; + } + $this->job_id = $job_id; + + return $this; + } + + public function setSnapshotId($snapshot_id): UpdateModelSnapshot + { + if (isset($snapshot_id) !== true) { + return $this; + } + $this->snapshot_id = $snapshot_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/Validate.php b/src/Elasticsearch/Endpoints/Ml/Validate.php new file mode 100644 index 000000000..18c263367 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/Validate.php @@ -0,0 +1,49 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Validate extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_ml/anomaly_detectors/_validate"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): Validate + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ml/ValidateDetector.php b/src/Elasticsearch/Endpoints/Ml/ValidateDetector.php new file mode 100644 index 000000000..10dd815c6 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ml/ValidateDetector.php @@ -0,0 +1,49 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class ValidateDetector extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_ml/anomaly_detectors/_validate/detector"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): ValidateDetector + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Monitoring/Bulk.php b/src/Elasticsearch/Endpoints/Monitoring/Bulk.php new file mode 100644 index 000000000..748aa911d --- /dev/null +++ b/src/Elasticsearch/Endpoints/Monitoring/Bulk.php @@ -0,0 +1,76 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Bulk extends AbstractEndpoint +{ + + public function __construct(SerializerInterface $serializer) + { + $this->serializer = $serializer; + } + + public function getURI(): string + { + $type = $this->type ?? null; + if (isset($type)) { + @trigger_error('Specifying types in urls has been deprecated', E_USER_DEPRECATED); + } + + if (isset($type)) { + return "/_monitoring/$type/bulk"; + } + return "/_monitoring/bulk"; + } + + public function getParamWhitelist(): array + { + return [ + 'system_id', + 'system_api_version', + 'interval' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): Bulk + { + if (isset($body) !== true) { + return $this; + } + if (is_array($body) === true || $body instanceof Traversable) { + foreach ($body as $item) { + $this->body .= $this->serializer->serialize($item) . "\n"; + } + } elseif (is_string($body)) { + $this->body = $body; + if (substr($body, -1) != "\n") { + $this->body .= "\n"; + } + } else { + throw new InvalidArgumentException("Body must be an array, traversable object or string"); + } + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Msearch.php b/src/Elasticsearch/Endpoints/Msearch.php index 672c4ed2f..e63e4ee7e 100644 --- a/src/Elasticsearch/Endpoints/Msearch.php +++ b/src/Elasticsearch/Endpoints/Msearch.php @@ -21,6 +21,7 @@ */ class Msearch extends AbstractEndpoint { + public function __construct(SerializerInterface $serializer) { $this->serializer = $serializer; diff --git a/src/Elasticsearch/Endpoints/MsearchTemplate.php b/src/Elasticsearch/Endpoints/MsearchTemplate.php index 32f105a46..16da42d9b 100644 --- a/src/Elasticsearch/Endpoints/MsearchTemplate.php +++ b/src/Elasticsearch/Endpoints/MsearchTemplate.php @@ -21,6 +21,7 @@ */ class MsearchTemplate extends AbstractEndpoint { + public function __construct(SerializerInterface $serializer) { $this->serializer = $serializer; diff --git a/src/Elasticsearch/Endpoints/Rollup/DeleteJob.php b/src/Elasticsearch/Endpoints/Rollup/DeleteJob.php new file mode 100644 index 000000000..89b3313a1 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Rollup/DeleteJob.php @@ -0,0 +1,52 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeleteJob extends AbstractEndpoint +{ + + public function getURI(): string + { + $id = $this->id ?? null; + + if (isset($id)) { + return "/_rollup/job/$id"; + } + throw new RuntimeException('Missing parameter for the endpoint rollup.delete_job'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setId($id): DeleteJob + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Rollup/GetJobs.php b/src/Elasticsearch/Endpoints/Rollup/GetJobs.php new file mode 100644 index 000000000..856887982 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Rollup/GetJobs.php @@ -0,0 +1,51 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetJobs extends AbstractEndpoint +{ + + public function getURI(): string + { + $id = $this->id ?? null; + + if (isset($id)) { + return "/_rollup/job/$id"; + } + return "/_rollup/job/"; + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setId($id): GetJobs + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Rollup/GetRollupCaps.php b/src/Elasticsearch/Endpoints/Rollup/GetRollupCaps.php new file mode 100644 index 000000000..a99500a0e --- /dev/null +++ b/src/Elasticsearch/Endpoints/Rollup/GetRollupCaps.php @@ -0,0 +1,51 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetRollupCaps extends AbstractEndpoint +{ + + public function getURI(): string + { + $id = $this->id ?? null; + + if (isset($id)) { + return "/_rollup/data/$id"; + } + return "/_rollup/data/"; + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setId($id): GetRollupCaps + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Rollup/GetRollupIndexCaps.php b/src/Elasticsearch/Endpoints/Rollup/GetRollupIndexCaps.php new file mode 100644 index 000000000..fd2a53eda --- /dev/null +++ b/src/Elasticsearch/Endpoints/Rollup/GetRollupIndexCaps.php @@ -0,0 +1,42 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetRollupIndexCaps extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/$index/_rollup/data"; + } + throw new RuntimeException('Missing parameter for the endpoint rollup.get_rollup_index_caps'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/src/Elasticsearch/Endpoints/Rollup/PutJob.php b/src/Elasticsearch/Endpoints/Rollup/PutJob.php new file mode 100644 index 000000000..4bfccfa25 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Rollup/PutJob.php @@ -0,0 +1,62 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PutJob extends AbstractEndpoint +{ + + public function getURI(): string + { + $id = $this->id ?? null; + + if (isset($id)) { + return "/_rollup/job/$id"; + } + throw new RuntimeException('Missing parameter for the endpoint rollup.put_job'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): PutJob + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setId($id): PutJob + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Rollup/RollupSearch.php b/src/Elasticsearch/Endpoints/Rollup/RollupSearch.php new file mode 100644 index 000000000..7c7ba1507 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Rollup/RollupSearch.php @@ -0,0 +1,64 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class RollupSearch extends AbstractEndpoint +{ + + public function getURI(): string + { + if (isset($this->index) !== true) { + throw new RuntimeException( + 'index is required for rollup_search' + ); + } + $index = $this->index; + $type = $this->type ?? null; + if (isset($type)) { + @trigger_error('Specifying types in urls has been deprecated', E_USER_DEPRECATED); + } + + if (isset($type)) { + return "/$index/$type/_rollup_search"; + } + return "/$index/_rollup_search"; + } + + public function getParamWhitelist(): array + { + return [ + 'typed_keys', + 'rest_total_hits_as_int' + ]; + } + + public function getMethod(): string + { + return isset($this->body) ? 'POST' : 'GET'; + } + + public function setBody($body): RollupSearch + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Rollup/StartJob.php b/src/Elasticsearch/Endpoints/Rollup/StartJob.php new file mode 100644 index 000000000..8f495a8dc --- /dev/null +++ b/src/Elasticsearch/Endpoints/Rollup/StartJob.php @@ -0,0 +1,52 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class StartJob extends AbstractEndpoint +{ + + public function getURI(): string + { + $id = $this->id ?? null; + + if (isset($id)) { + return "/_rollup/job/$id/_start"; + } + throw new RuntimeException('Missing parameter for the endpoint rollup.start_job'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setId($id): StartJob + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Rollup/StopJob.php b/src/Elasticsearch/Endpoints/Rollup/StopJob.php new file mode 100644 index 000000000..a0413531b --- /dev/null +++ b/src/Elasticsearch/Endpoints/Rollup/StopJob.php @@ -0,0 +1,55 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class StopJob extends AbstractEndpoint +{ + + public function getURI(): string + { + $id = $this->id ?? null; + + if (isset($id)) { + return "/_rollup/job/$id/_stop"; + } + throw new RuntimeException('Missing parameter for the endpoint rollup.stop_job'); + } + + public function getParamWhitelist(): array + { + return [ + 'wait_for_completion', + 'timeout' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setId($id): StopJob + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Security/Authenticate.php b/src/Elasticsearch/Endpoints/Security/Authenticate.php new file mode 100644 index 000000000..a09179124 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Security/Authenticate.php @@ -0,0 +1,39 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Authenticate extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_security/_authenticate"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/src/Elasticsearch/Endpoints/Security/ChangePassword.php b/src/Elasticsearch/Endpoints/Security/ChangePassword.php new file mode 100644 index 000000000..805b7fb10 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Security/ChangePassword.php @@ -0,0 +1,64 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class ChangePassword extends AbstractEndpoint +{ + protected $username; + + public function getURI(): string + { + $username = $this->username ?? null; + + if (isset($username)) { + return "/_security/user/$username/_password"; + } + return "/_security/user/_password"; + } + + public function getParamWhitelist(): array + { + return [ + 'refresh' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): ChangePassword + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setUsername($username): ChangePassword + { + if (isset($username) !== true) { + return $this; + } + $this->username = $username; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Security/ClearCachedRealms.php b/src/Elasticsearch/Endpoints/Security/ClearCachedRealms.php new file mode 100644 index 000000000..7320e8dc7 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Security/ClearCachedRealms.php @@ -0,0 +1,58 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class ClearCachedRealms extends AbstractEndpoint +{ + protected $realms; + + public function getURI(): string + { + $realms = $this->realms ?? null; + + if (isset($realms)) { + return "/_security/realm/$realms/_clear_cache"; + } + throw new RuntimeException('Missing parameter for the endpoint security.clear_cached_realms'); + } + + public function getParamWhitelist(): array + { + return [ + 'usernames' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setRealms($realms): ClearCachedRealms + { + if (isset($realms) !== true) { + return $this; + } + if (is_array($realms) === true) { + $realms = implode(",", $realms); + } + $this->realms = $realms; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Security/ClearCachedRoles.php b/src/Elasticsearch/Endpoints/Security/ClearCachedRoles.php new file mode 100644 index 000000000..dfd421942 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Security/ClearCachedRoles.php @@ -0,0 +1,58 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class ClearCachedRoles extends AbstractEndpoint +{ + protected $name; + + public function getURI(): string + { + $name = $this->name ?? null; + + if (isset($name)) { + return "/_security/role/$name/_clear_cache"; + } + throw new RuntimeException('Missing parameter for the endpoint security.clear_cached_roles'); + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setName($name): ClearCachedRoles + { + if (isset($name) !== true) { + return $this; + } + if (is_array($name) === true) { + $name = implode(",", $name); + } + $this->name = $name; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Security/CreateApiKey.php b/src/Elasticsearch/Endpoints/Security/CreateApiKey.php new file mode 100644 index 000000000..75a13760b --- /dev/null +++ b/src/Elasticsearch/Endpoints/Security/CreateApiKey.php @@ -0,0 +1,49 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class CreateApiKey extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_security/api_key"; + } + + public function getParamWhitelist(): array + { + return [ + 'refresh' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): CreateApiKey + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Security/DeletePrivileges.php b/src/Elasticsearch/Endpoints/Security/DeletePrivileges.php new file mode 100644 index 000000000..f12c32d55 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Security/DeletePrivileges.php @@ -0,0 +1,67 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeletePrivileges extends AbstractEndpoint +{ + protected $application; + protected $name; + + public function getURI(): string + { + $application = $this->application ?? null; + $name = $this->name ?? null; + + if (isset($application) && isset($name)) { + return "/_security/privilege/$application/$name"; + } + throw new RuntimeException('Missing parameter for the endpoint security.delete_privileges'); + } + + public function getParamWhitelist(): array + { + return [ + 'refresh' + ]; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setApplication($application): DeletePrivileges + { + if (isset($application) !== true) { + return $this; + } + $this->application = $application; + + return $this; + } + + public function setName($name): DeletePrivileges + { + if (isset($name) !== true) { + return $this; + } + $this->name = $name; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Security/DeleteRole.php b/src/Elasticsearch/Endpoints/Security/DeleteRole.php new file mode 100644 index 000000000..c25983dfc --- /dev/null +++ b/src/Elasticsearch/Endpoints/Security/DeleteRole.php @@ -0,0 +1,55 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeleteRole extends AbstractEndpoint +{ + protected $name; + + public function getURI(): string + { + $name = $this->name ?? null; + + if (isset($name)) { + return "/_security/role/$name"; + } + throw new RuntimeException('Missing parameter for the endpoint security.delete_role'); + } + + public function getParamWhitelist(): array + { + return [ + 'refresh' + ]; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setName($name): DeleteRole + { + if (isset($name) !== true) { + return $this; + } + $this->name = $name; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Security/DeleteRoleMapping.php b/src/Elasticsearch/Endpoints/Security/DeleteRoleMapping.php new file mode 100644 index 000000000..dbcbcc5f7 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Security/DeleteRoleMapping.php @@ -0,0 +1,55 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeleteRoleMapping extends AbstractEndpoint +{ + protected $name; + + public function getURI(): string + { + $name = $this->name ?? null; + + if (isset($name)) { + return "/_security/role_mapping/$name"; + } + throw new RuntimeException('Missing parameter for the endpoint security.delete_role_mapping'); + } + + public function getParamWhitelist(): array + { + return [ + 'refresh' + ]; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setName($name): DeleteRoleMapping + { + if (isset($name) !== true) { + return $this; + } + $this->name = $name; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Security/DeleteUser.php b/src/Elasticsearch/Endpoints/Security/DeleteUser.php new file mode 100644 index 000000000..dd15c8e5f --- /dev/null +++ b/src/Elasticsearch/Endpoints/Security/DeleteUser.php @@ -0,0 +1,55 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeleteUser extends AbstractEndpoint +{ + protected $username; + + public function getURI(): string + { + $username = $this->username ?? null; + + if (isset($username)) { + return "/_security/user/$username"; + } + throw new RuntimeException('Missing parameter for the endpoint security.delete_user'); + } + + public function getParamWhitelist(): array + { + return [ + 'refresh' + ]; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setUsername($username): DeleteUser + { + if (isset($username) !== true) { + return $this; + } + $this->username = $username; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Security/DisableUser.php b/src/Elasticsearch/Endpoints/Security/DisableUser.php new file mode 100644 index 000000000..4ddd00e7c --- /dev/null +++ b/src/Elasticsearch/Endpoints/Security/DisableUser.php @@ -0,0 +1,55 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DisableUser extends AbstractEndpoint +{ + protected $username; + + public function getURI(): string + { + $username = $this->username ?? null; + + if (isset($username)) { + return "/_security/user/$username/_disable"; + } + throw new RuntimeException('Missing parameter for the endpoint security.disable_user'); + } + + public function getParamWhitelist(): array + { + return [ + 'refresh' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setUsername($username): DisableUser + { + if (isset($username) !== true) { + return $this; + } + $this->username = $username; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Security/EnableUser.php b/src/Elasticsearch/Endpoints/Security/EnableUser.php new file mode 100644 index 000000000..5d8571f14 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Security/EnableUser.php @@ -0,0 +1,55 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class EnableUser extends AbstractEndpoint +{ + protected $username; + + public function getURI(): string + { + $username = $this->username ?? null; + + if (isset($username)) { + return "/_security/user/$username/_enable"; + } + throw new RuntimeException('Missing parameter for the endpoint security.enable_user'); + } + + public function getParamWhitelist(): array + { + return [ + 'refresh' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setUsername($username): EnableUser + { + if (isset($username) !== true) { + return $this; + } + $this->username = $username; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Security/GetApiKey.php b/src/Elasticsearch/Endpoints/Security/GetApiKey.php new file mode 100644 index 000000000..ef692d625 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Security/GetApiKey.php @@ -0,0 +1,43 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetApiKey extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_security/api_key"; + } + + public function getParamWhitelist(): array + { + return [ + 'id', + 'name', + 'username', + 'realm_name', + 'owner' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/src/Elasticsearch/Endpoints/Security/GetBuiltinPrivileges.php b/src/Elasticsearch/Endpoints/Security/GetBuiltinPrivileges.php new file mode 100644 index 000000000..7eededb2f --- /dev/null +++ b/src/Elasticsearch/Endpoints/Security/GetBuiltinPrivileges.php @@ -0,0 +1,39 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetBuiltinPrivileges extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_security/privilege/_builtin"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/src/Elasticsearch/Endpoints/Security/GetPrivileges.php b/src/Elasticsearch/Endpoints/Security/GetPrivileges.php new file mode 100644 index 000000000..e86eccce6 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Security/GetPrivileges.php @@ -0,0 +1,69 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetPrivileges extends AbstractEndpoint +{ + protected $application; + protected $name; + + public function getURI(): string + { + $application = $this->application ?? null; + $name = $this->name ?? null; + + if (isset($application) && isset($name)) { + return "/_security/privilege/$application/$name"; + } + if (isset($application)) { + return "/_security/privilege/$application"; + } + return "/_security/privilege"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setApplication($application): GetPrivileges + { + if (isset($application) !== true) { + return $this; + } + $this->application = $application; + + return $this; + } + + public function setName($name): GetPrivileges + { + if (isset($name) !== true) { + return $this; + } + $this->name = $name; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Security/GetRole.php b/src/Elasticsearch/Endpoints/Security/GetRole.php new file mode 100644 index 000000000..f6cf086b0 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Security/GetRole.php @@ -0,0 +1,54 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetRole extends AbstractEndpoint +{ + protected $name; + + public function getURI(): string + { + $name = $this->name ?? null; + + if (isset($name)) { + return "/_security/role/$name"; + } + return "/_security/role"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setName($name): GetRole + { + if (isset($name) !== true) { + return $this; + } + $this->name = $name; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Security/GetRoleMapping.php b/src/Elasticsearch/Endpoints/Security/GetRoleMapping.php new file mode 100644 index 000000000..ce2e3d254 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Security/GetRoleMapping.php @@ -0,0 +1,54 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetRoleMapping extends AbstractEndpoint +{ + protected $name; + + public function getURI(): string + { + $name = $this->name ?? null; + + if (isset($name)) { + return "/_security/role_mapping/$name"; + } + return "/_security/role_mapping"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setName($name): GetRoleMapping + { + if (isset($name) !== true) { + return $this; + } + $this->name = $name; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Security/GetToken.php b/src/Elasticsearch/Endpoints/Security/GetToken.php new file mode 100644 index 000000000..e786868bd --- /dev/null +++ b/src/Elasticsearch/Endpoints/Security/GetToken.php @@ -0,0 +1,49 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetToken extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_security/oauth2/token"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): GetToken + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Security/GetUser.php b/src/Elasticsearch/Endpoints/Security/GetUser.php new file mode 100644 index 000000000..e376ebd06 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Security/GetUser.php @@ -0,0 +1,57 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetUser extends AbstractEndpoint +{ + protected $username; + + public function getURI(): string + { + $username = $this->username ?? null; + + if (isset($username)) { + return "/_security/user/$username"; + } + return "/_security/user"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setUsername($username): GetUser + { + if (isset($username) !== true) { + return $this; + } + if (is_array($username) === true) { + $username = implode(",", $username); + } + $this->username = $username; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Security/GetUserPrivileges.php b/src/Elasticsearch/Endpoints/Security/GetUserPrivileges.php new file mode 100644 index 000000000..4483850b2 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Security/GetUserPrivileges.php @@ -0,0 +1,39 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetUserPrivileges extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_security/user/_privileges"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/src/Elasticsearch/Endpoints/Security/HasPrivileges.php b/src/Elasticsearch/Endpoints/Security/HasPrivileges.php new file mode 100644 index 000000000..b8f36ada5 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Security/HasPrivileges.php @@ -0,0 +1,64 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class HasPrivileges extends AbstractEndpoint +{ + protected $user; + + public function getURI(): string + { + $user = $this->user ?? null; + + if (isset($user)) { + return "/_security/user/$user/_has_privileges"; + } + return "/_security/user/_has_privileges"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return isset($this->body) ? 'POST' : 'GET'; + } + + public function setBody($body): HasPrivileges + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setUser($user): HasPrivileges + { + if (isset($user) !== true) { + return $this; + } + $this->user = $user; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Security/InvalidateApiKey.php b/src/Elasticsearch/Endpoints/Security/InvalidateApiKey.php new file mode 100644 index 000000000..8a5e743b6 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Security/InvalidateApiKey.php @@ -0,0 +1,47 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class InvalidateApiKey extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_security/api_key"; + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setBody($body): InvalidateApiKey + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Security/InvalidateToken.php b/src/Elasticsearch/Endpoints/Security/InvalidateToken.php new file mode 100644 index 000000000..e2febdd63 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Security/InvalidateToken.php @@ -0,0 +1,49 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class InvalidateToken extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_security/oauth2/token"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setBody($body): InvalidateToken + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Security/PutPrivileges.php b/src/Elasticsearch/Endpoints/Security/PutPrivileges.php new file mode 100644 index 000000000..0867dedcb --- /dev/null +++ b/src/Elasticsearch/Endpoints/Security/PutPrivileges.php @@ -0,0 +1,49 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PutPrivileges extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_security/privilege/"; + } + + public function getParamWhitelist(): array + { + return [ + 'refresh' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): PutPrivileges + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Security/PutRole.php b/src/Elasticsearch/Endpoints/Security/PutRole.php new file mode 100644 index 000000000..929428018 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Security/PutRole.php @@ -0,0 +1,65 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PutRole extends AbstractEndpoint +{ + protected $name; + + public function getURI(): string + { + $name = $this->name ?? null; + + if (isset($name)) { + return "/_security/role/$name"; + } + throw new RuntimeException('Missing parameter for the endpoint security.put_role'); + } + + public function getParamWhitelist(): array + { + return [ + 'refresh' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): PutRole + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setName($name): PutRole + { + if (isset($name) !== true) { + return $this; + } + $this->name = $name; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Security/PutRoleMapping.php b/src/Elasticsearch/Endpoints/Security/PutRoleMapping.php new file mode 100644 index 000000000..40a18008a --- /dev/null +++ b/src/Elasticsearch/Endpoints/Security/PutRoleMapping.php @@ -0,0 +1,65 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PutRoleMapping extends AbstractEndpoint +{ + protected $name; + + public function getURI(): string + { + $name = $this->name ?? null; + + if (isset($name)) { + return "/_security/role_mapping/$name"; + } + throw new RuntimeException('Missing parameter for the endpoint security.put_role_mapping'); + } + + public function getParamWhitelist(): array + { + return [ + 'refresh' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): PutRoleMapping + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setName($name): PutRoleMapping + { + if (isset($name) !== true) { + return $this; + } + $this->name = $name; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Security/PutUser.php b/src/Elasticsearch/Endpoints/Security/PutUser.php new file mode 100644 index 000000000..d6927e705 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Security/PutUser.php @@ -0,0 +1,65 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PutUser extends AbstractEndpoint +{ + protected $username; + + public function getURI(): string + { + $username = $this->username ?? null; + + if (isset($username)) { + return "/_security/user/$username"; + } + throw new RuntimeException('Missing parameter for the endpoint security.put_user'); + } + + public function getParamWhitelist(): array + { + return [ + 'refresh' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): PutUser + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setUsername($username): PutUser + { + if (isset($username) !== true) { + return $this; + } + $this->username = $username; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Slm/DeleteLifecycle.php b/src/Elasticsearch/Endpoints/Slm/DeleteLifecycle.php new file mode 100644 index 000000000..4ab2a1504 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Slm/DeleteLifecycle.php @@ -0,0 +1,55 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeleteLifecycle extends AbstractEndpoint +{ + protected $policy_id; + + public function getURI(): string + { + $policy_id = $this->policy_id ?? null; + + if (isset($policy_id)) { + return "/_slm/policy/$policy_id"; + } + throw new RuntimeException('Missing parameter for the endpoint slm.delete_lifecycle'); + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setPolicyId($policy_id): DeleteLifecycle + { + if (isset($policy_id) !== true) { + return $this; + } + $this->policy_id = $policy_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Slm/ExecuteLifecycle.php b/src/Elasticsearch/Endpoints/Slm/ExecuteLifecycle.php new file mode 100644 index 000000000..b1717887c --- /dev/null +++ b/src/Elasticsearch/Endpoints/Slm/ExecuteLifecycle.php @@ -0,0 +1,55 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class ExecuteLifecycle extends AbstractEndpoint +{ + protected $policy_id; + + public function getURI(): string + { + $policy_id = $this->policy_id ?? null; + + if (isset($policy_id)) { + return "/_slm/policy/$policy_id/_execute"; + } + throw new RuntimeException('Missing parameter for the endpoint slm.execute_lifecycle'); + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setPolicyId($policy_id): ExecuteLifecycle + { + if (isset($policy_id) !== true) { + return $this; + } + $this->policy_id = $policy_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Slm/ExecuteRetention.php b/src/Elasticsearch/Endpoints/Slm/ExecuteRetention.php new file mode 100644 index 000000000..9285614b1 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Slm/ExecuteRetention.php @@ -0,0 +1,39 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class ExecuteRetention extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_slm/_execute_retention"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'POST'; + } +} diff --git a/src/Elasticsearch/Endpoints/Slm/GetLifecycle.php b/src/Elasticsearch/Endpoints/Slm/GetLifecycle.php new file mode 100644 index 000000000..4e0e53226 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Slm/GetLifecycle.php @@ -0,0 +1,57 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetLifecycle extends AbstractEndpoint +{ + protected $policy_id; + + public function getURI(): string + { + $policy_id = $this->policy_id ?? null; + + if (isset($policy_id)) { + return "/_slm/policy/$policy_id"; + } + return "/_slm/policy"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setPolicyId($policy_id): GetLifecycle + { + if (isset($policy_id) !== true) { + return $this; + } + if (is_array($policy_id) === true) { + $policy_id = implode(",", $policy_id); + } + $this->policy_id = $policy_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Slm/GetStats.php b/src/Elasticsearch/Endpoints/Slm/GetStats.php new file mode 100644 index 000000000..62e073182 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Slm/GetStats.php @@ -0,0 +1,39 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetStats extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_slm/stats"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/src/Elasticsearch/Endpoints/Slm/GetStatus.php b/src/Elasticsearch/Endpoints/Slm/GetStatus.php new file mode 100644 index 000000000..dfaefb435 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Slm/GetStatus.php @@ -0,0 +1,39 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetStatus extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_slm/status"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/src/Elasticsearch/Endpoints/Slm/PutLifecycle.php b/src/Elasticsearch/Endpoints/Slm/PutLifecycle.php new file mode 100644 index 000000000..c4eb7afe3 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Slm/PutLifecycle.php @@ -0,0 +1,65 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PutLifecycle extends AbstractEndpoint +{ + protected $policy_id; + + public function getURI(): string + { + $policy_id = $this->policy_id ?? null; + + if (isset($policy_id)) { + return "/_slm/policy/$policy_id"; + } + throw new RuntimeException('Missing parameter for the endpoint slm.put_lifecycle'); + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): PutLifecycle + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setPolicyId($policy_id): PutLifecycle + { + if (isset($policy_id) !== true) { + return $this; + } + $this->policy_id = $policy_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Slm/Start.php b/src/Elasticsearch/Endpoints/Slm/Start.php new file mode 100644 index 000000000..b32c35510 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Slm/Start.php @@ -0,0 +1,39 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Start extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_slm/start"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'POST'; + } +} diff --git a/src/Elasticsearch/Endpoints/Slm/Stop.php b/src/Elasticsearch/Endpoints/Slm/Stop.php new file mode 100644 index 000000000..7b8635e6b --- /dev/null +++ b/src/Elasticsearch/Endpoints/Slm/Stop.php @@ -0,0 +1,39 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Stop extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_slm/stop"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'POST'; + } +} diff --git a/src/Elasticsearch/Endpoints/Sql/ClearCursor.php b/src/Elasticsearch/Endpoints/Sql/ClearCursor.php new file mode 100644 index 000000000..8030d44c1 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Sql/ClearCursor.php @@ -0,0 +1,47 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class ClearCursor extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_sql/close"; + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): ClearCursor + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Sql/Query.php b/src/Elasticsearch/Endpoints/Sql/Query.php new file mode 100644 index 000000000..2ce875a3c --- /dev/null +++ b/src/Elasticsearch/Endpoints/Sql/Query.php @@ -0,0 +1,49 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Query extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_sql"; + } + + public function getParamWhitelist(): array + { + return [ + 'format' + ]; + } + + public function getMethod(): string + { + return isset($this->body) ? 'POST' : 'GET'; + } + + public function setBody($body): Query + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Sql/Translate.php b/src/Elasticsearch/Endpoints/Sql/Translate.php new file mode 100644 index 000000000..464e5ab95 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Sql/Translate.php @@ -0,0 +1,49 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Translate extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_sql/translate"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return isset($this->body) ? 'POST' : 'GET'; + } + + public function setBody($body): Translate + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Ssl/Certificates.php b/src/Elasticsearch/Endpoints/Ssl/Certificates.php new file mode 100644 index 000000000..b412a2a2c --- /dev/null +++ b/src/Elasticsearch/Endpoints/Ssl/Certificates.php @@ -0,0 +1,39 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Certificates extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_ssl/certificates"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/src/Elasticsearch/Endpoints/Transform/DeleteTransform.php b/src/Elasticsearch/Endpoints/Transform/DeleteTransform.php new file mode 100644 index 000000000..fdf89bdd8 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Transform/DeleteTransform.php @@ -0,0 +1,55 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeleteTransform extends AbstractEndpoint +{ + protected $transform_id; + + public function getURI(): string + { + $transform_id = $this->transform_id ?? null; + + if (isset($transform_id)) { + return "/_transform/$transform_id"; + } + throw new RuntimeException('Missing parameter for the endpoint transform.delete_transform'); + } + + public function getParamWhitelist(): array + { + return [ + 'force' + ]; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setTransformId($transform_id): DeleteTransform + { + if (isset($transform_id) !== true) { + return $this; + } + $this->transform_id = $transform_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Transform/GetTransform.php b/src/Elasticsearch/Endpoints/Transform/GetTransform.php new file mode 100644 index 000000000..493f336bb --- /dev/null +++ b/src/Elasticsearch/Endpoints/Transform/GetTransform.php @@ -0,0 +1,56 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetTransform extends AbstractEndpoint +{ + protected $transform_id; + + public function getURI(): string + { + $transform_id = $this->transform_id ?? null; + + if (isset($transform_id)) { + return "/_transform/$transform_id"; + } + return "/_transform"; + } + + public function getParamWhitelist(): array + { + return [ + 'from', + 'size', + 'allow_no_match' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setTransformId($transform_id): GetTransform + { + if (isset($transform_id) !== true) { + return $this; + } + $this->transform_id = $transform_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Transform/GetTransformStats.php b/src/Elasticsearch/Endpoints/Transform/GetTransformStats.php new file mode 100644 index 000000000..6b775e6b8 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Transform/GetTransformStats.php @@ -0,0 +1,57 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetTransformStats extends AbstractEndpoint +{ + protected $transform_id; + + public function getURI(): string + { + $transform_id = $this->transform_id ?? null; + + if (isset($transform_id)) { + return "/_transform/$transform_id/_stats"; + } + throw new RuntimeException('Missing parameter for the endpoint transform.get_transform_stats'); + } + + public function getParamWhitelist(): array + { + return [ + 'from', + 'size', + 'allow_no_match' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setTransformId($transform_id): GetTransformStats + { + if (isset($transform_id) !== true) { + return $this; + } + $this->transform_id = $transform_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Transform/PreviewTransform.php b/src/Elasticsearch/Endpoints/Transform/PreviewTransform.php new file mode 100644 index 000000000..609a7e9b4 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Transform/PreviewTransform.php @@ -0,0 +1,47 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PreviewTransform extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_transform/_preview"; + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): PreviewTransform + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Transform/PutTransform.php b/src/Elasticsearch/Endpoints/Transform/PutTransform.php new file mode 100644 index 000000000..2f7d31518 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Transform/PutTransform.php @@ -0,0 +1,65 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PutTransform extends AbstractEndpoint +{ + protected $transform_id; + + public function getURI(): string + { + $transform_id = $this->transform_id ?? null; + + if (isset($transform_id)) { + return "/_transform/$transform_id"; + } + throw new RuntimeException('Missing parameter for the endpoint transform.put_transform'); + } + + public function getParamWhitelist(): array + { + return [ + 'defer_validation' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): PutTransform + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setTransformId($transform_id): PutTransform + { + if (isset($transform_id) !== true) { + return $this; + } + $this->transform_id = $transform_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Transform/StartTransform.php b/src/Elasticsearch/Endpoints/Transform/StartTransform.php new file mode 100644 index 000000000..cfe21b4a4 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Transform/StartTransform.php @@ -0,0 +1,55 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class StartTransform extends AbstractEndpoint +{ + protected $transform_id; + + public function getURI(): string + { + $transform_id = $this->transform_id ?? null; + + if (isset($transform_id)) { + return "/_transform/$transform_id/_start"; + } + throw new RuntimeException('Missing parameter for the endpoint transform.start_transform'); + } + + public function getParamWhitelist(): array + { + return [ + 'timeout' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setTransformId($transform_id): StartTransform + { + if (isset($transform_id) !== true) { + return $this; + } + $this->transform_id = $transform_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Transform/StopTransform.php b/src/Elasticsearch/Endpoints/Transform/StopTransform.php new file mode 100644 index 000000000..69fb06876 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Transform/StopTransform.php @@ -0,0 +1,59 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class StopTransform extends AbstractEndpoint +{ + protected $transform_id; + + public function getURI(): string + { + $transform_id = $this->transform_id ?? null; + + if (isset($transform_id)) { + return "/_transform/$transform_id/_stop"; + } + throw new RuntimeException('Missing parameter for the endpoint transform.stop_transform'); + } + + public function getParamWhitelist(): array + { + return [ + 'force', + 'wait_for_completion', + 'timeout', + 'allow_no_match', + 'wait_for_checkpoint' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setTransformId($transform_id): StopTransform + { + if (isset($transform_id) !== true) { + return $this; + } + $this->transform_id = $transform_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Transform/UpdateTransform.php b/src/Elasticsearch/Endpoints/Transform/UpdateTransform.php new file mode 100644 index 000000000..b7e15d118 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Transform/UpdateTransform.php @@ -0,0 +1,65 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class UpdateTransform extends AbstractEndpoint +{ + protected $transform_id; + + public function getURI(): string + { + $transform_id = $this->transform_id ?? null; + + if (isset($transform_id)) { + return "/_transform/$transform_id/_update"; + } + throw new RuntimeException('Missing parameter for the endpoint transform.update_transform'); + } + + public function getParamWhitelist(): array + { + return [ + 'defer_validation' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): UpdateTransform + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setTransformId($transform_id): UpdateTransform + { + if (isset($transform_id) !== true) { + return $this; + } + $this->transform_id = $transform_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Watcher/AckWatch.php b/src/Elasticsearch/Endpoints/Watcher/AckWatch.php new file mode 100644 index 000000000..90a7acf72 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Watcher/AckWatch.php @@ -0,0 +1,73 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class AckWatch extends AbstractEndpoint +{ + protected $watch_id; + protected $action_id; + + public function getURI(): string + { + if (isset($this->watch_id) !== true) { + throw new RuntimeException( + 'watch_id is required for ack_watch' + ); + } + $watch_id = $this->watch_id; + $action_id = $this->action_id ?? null; + + if (isset($action_id)) { + return "/_watcher/watch/$watch_id/_ack/$action_id"; + } + return "/_watcher/watch/$watch_id/_ack"; + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setWatchId($watch_id): AckWatch + { + if (isset($watch_id) !== true) { + return $this; + } + $this->watch_id = $watch_id; + + return $this; + } + + public function setActionId($action_id): AckWatch + { + if (isset($action_id) !== true) { + return $this; + } + if (is_array($action_id) === true) { + $action_id = implode(",", $action_id); + } + $this->action_id = $action_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Watcher/ActivateWatch.php b/src/Elasticsearch/Endpoints/Watcher/ActivateWatch.php new file mode 100644 index 000000000..ae81c555a --- /dev/null +++ b/src/Elasticsearch/Endpoints/Watcher/ActivateWatch.php @@ -0,0 +1,53 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class ActivateWatch extends AbstractEndpoint +{ + protected $watch_id; + + public function getURI(): string + { + $watch_id = $this->watch_id ?? null; + + if (isset($watch_id)) { + return "/_watcher/watch/$watch_id/_activate"; + } + throw new RuntimeException('Missing parameter for the endpoint watcher.activate_watch'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setWatchId($watch_id): ActivateWatch + { + if (isset($watch_id) !== true) { + return $this; + } + $this->watch_id = $watch_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Watcher/DeactivateWatch.php b/src/Elasticsearch/Endpoints/Watcher/DeactivateWatch.php new file mode 100644 index 000000000..5fba53b63 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Watcher/DeactivateWatch.php @@ -0,0 +1,53 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeactivateWatch extends AbstractEndpoint +{ + protected $watch_id; + + public function getURI(): string + { + $watch_id = $this->watch_id ?? null; + + if (isset($watch_id)) { + return "/_watcher/watch/$watch_id/_deactivate"; + } + throw new RuntimeException('Missing parameter for the endpoint watcher.deactivate_watch'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setWatchId($watch_id): DeactivateWatch + { + if (isset($watch_id) !== true) { + return $this; + } + $this->watch_id = $watch_id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Watcher/DeleteWatch.php b/src/Elasticsearch/Endpoints/Watcher/DeleteWatch.php new file mode 100644 index 000000000..5d60c1ad8 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Watcher/DeleteWatch.php @@ -0,0 +1,52 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeleteWatch extends AbstractEndpoint +{ + + public function getURI(): string + { + $id = $this->id ?? null; + + if (isset($id)) { + return "/_watcher/watch/$id"; + } + throw new RuntimeException('Missing parameter for the endpoint watcher.delete_watch'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setId($id): DeleteWatch + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Watcher/ExecuteWatch.php b/src/Elasticsearch/Endpoints/Watcher/ExecuteWatch.php new file mode 100644 index 000000000..b47af8f29 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Watcher/ExecuteWatch.php @@ -0,0 +1,63 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class ExecuteWatch extends AbstractEndpoint +{ + + public function getURI(): string + { + $id = $this->id ?? null; + + if (isset($id)) { + return "/_watcher/watch/$id/_execute"; + } + return "/_watcher/watch/_execute"; + } + + public function getParamWhitelist(): array + { + return [ + 'debug' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): ExecuteWatch + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setId($id): ExecuteWatch + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Watcher/GetWatch.php b/src/Elasticsearch/Endpoints/Watcher/GetWatch.php new file mode 100644 index 000000000..df90634aa --- /dev/null +++ b/src/Elasticsearch/Endpoints/Watcher/GetWatch.php @@ -0,0 +1,54 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetWatch extends AbstractEndpoint +{ + + public function getURI(): string + { + $id = $this->id ?? null; + + if (isset($id)) { + return "/_watcher/watch/$id"; + } + throw new RuntimeException('Missing parameter for the endpoint watcher.get_watch'); + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setId($id): GetWatch + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Watcher/PutWatch.php b/src/Elasticsearch/Endpoints/Watcher/PutWatch.php new file mode 100644 index 000000000..f643d80d5 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Watcher/PutWatch.php @@ -0,0 +1,67 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PutWatch extends AbstractEndpoint +{ + + public function getURI(): string + { + $id = $this->id ?? null; + + if (isset($id)) { + return "/_watcher/watch/$id"; + } + throw new RuntimeException('Missing parameter for the endpoint watcher.put_watch'); + } + + public function getParamWhitelist(): array + { + return [ + 'active', + 'version', + 'if_seq_no', + 'if_primary_term' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): PutWatch + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setId($id): PutWatch + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Watcher/Start.php b/src/Elasticsearch/Endpoints/Watcher/Start.php new file mode 100644 index 000000000..27d553207 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Watcher/Start.php @@ -0,0 +1,39 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Start extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_watcher/_start"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'POST'; + } +} diff --git a/src/Elasticsearch/Endpoints/Watcher/Stats.php b/src/Elasticsearch/Endpoints/Watcher/Stats.php new file mode 100644 index 000000000..5ddd2bc75 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Watcher/Stats.php @@ -0,0 +1,58 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Stats extends AbstractEndpoint +{ + protected $metric; + + public function getURI(): string + { + $metric = $this->metric ?? null; + + if (isset($metric)) { + return "/_watcher/stats/$metric"; + } + return "/_watcher/stats"; + } + + public function getParamWhitelist(): array + { + return [ + 'metric', + 'emit_stacktraces' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setMetric($metric): Stats + { + if (isset($metric) !== true) { + return $this; + } + if (is_array($metric) === true) { + $metric = implode(",", $metric); + } + $this->metric = $metric; + + return $this; + } +} diff --git a/src/Elasticsearch/Endpoints/Watcher/Stop.php b/src/Elasticsearch/Endpoints/Watcher/Stop.php new file mode 100644 index 000000000..d1216de9a --- /dev/null +++ b/src/Elasticsearch/Endpoints/Watcher/Stop.php @@ -0,0 +1,39 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Stop extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_watcher/_stop"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'POST'; + } +} diff --git a/src/Elasticsearch/Endpoints/Xpack/Info.php b/src/Elasticsearch/Endpoints/Xpack/Info.php new file mode 100644 index 000000000..df75b7ad7 --- /dev/null +++ b/src/Elasticsearch/Endpoints/Xpack/Info.php @@ -0,0 +1,39 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Info extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_xpack"; + } + + public function getParamWhitelist(): array + { + return [ + 'categories' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/src/Elasticsearch/Endpoints/Xpack/Usage.php b/src/Elasticsearch/Endpoints/Xpack/Usage.php new file mode 100644 index 000000000..564f3f0ea --- /dev/null +++ b/src/Elasticsearch/Endpoints/Xpack/Usage.php @@ -0,0 +1,39 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Usage extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_xpack/usage"; + } + + public function getParamWhitelist(): array + { + return [ + 'master_timeout' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/src/Elasticsearch/Namespaces/AsyncSearchNamespace.php b/src/Elasticsearch/Namespaces/AsyncSearchNamespace.php new file mode 100644 index 000000000..b6a64a012 --- /dev/null +++ b/src/Elasticsearch/Namespaces/AsyncSearchNamespace.php @@ -0,0 +1,122 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class AsyncSearchNamespace extends AbstractNamespace +{ + + /** + * $params['id'] = (string) The async search ID + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html + */ + public function delete(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('AsyncSearch\Delete'); + $endpoint->setParams($params); + $endpoint->setId($id); + + return $this->performRequest($endpoint); + } + /** + * $params['id'] = (string) The async search ID + * $params['wait_for_completion_timeout'] = (time) Specify the time that the request should block waiting for the final response + * $params['keep_alive'] = (time) Specify the time interval in which the results (partial or final) for this search will be available + * $params['typed_keys'] = (boolean) Specify whether aggregation and suggester names should be prefixed by their respective types in the response + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html + */ + public function get(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('AsyncSearch\Get'); + $endpoint->setParams($params); + $endpoint->setId($id); + + 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['wait_for_completion_timeout'] = (time) Specify the time that the request should block waiting for the final response (Default = 1s) + * $params['keep_on_completion'] = (boolean) Control whether the response should be stored in the cluster if it completed within the provided [wait_for_completion] time (default: false) (Default = false) + * $params['keep_alive'] = (time) Update the time interval in which the results (partial or final) for this search will be available (Default = 5d) + * $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 the granularity at which progress results will be made available. (Default = 5) + * $params['request_cache'] = (boolean) Specify if request cache should be used for this request or not, defaults to true + * $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['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,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['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['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['body'] = (array) The search definition using the Query DSL + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html + */ + public function submit(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('AsyncSearch\Submit'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } +} diff --git a/src/Elasticsearch/Namespaces/AutoscalingNamespace.php b/src/Elasticsearch/Namespaces/AutoscalingNamespace.php new file mode 100644 index 000000000..f3aa7f832 --- /dev/null +++ b/src/Elasticsearch/Namespaces/AutoscalingNamespace.php @@ -0,0 +1,30 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class AutoscalingNamespace extends AbstractNamespace +{ + + public function getAutoscalingDecision(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Autoscaling\GetAutoscalingDecision'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } +} diff --git a/src/Elasticsearch/Namespaces/CatNamespace.php b/src/Elasticsearch/Namespaces/CatNamespace.php index 4deb689a3..45289e87c 100644 --- a/src/Elasticsearch/Namespaces/CatNamespace.php +++ b/src/Elasticsearch/Namespaces/CatNamespace.php @@ -500,6 +500,138 @@ 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 (Days),h (Hours),m (Minutes),s (Seconds),ms (Milliseconds),micros (Microseconds),nanos (Nanoseconds)) + * $params['v'] = (boolean) Verbose mode. Display column headers (Default = false) + * + * @param array $params Associative array of parameters + * @return array + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-dfanalytics.html + */ + 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_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 (Days),h (Hours),m (Minutes),s (Seconds),ms (Milliseconds),micros (Microseconds),nanos (Nanoseconds)) + * $params['v'] = (boolean) Verbose mode. Display column headers (Default = false) + * + * @param array $params Associative array of parameters + * @return array + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-datafeeds.html + */ + 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_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 (Days),h (Hours),m (Minutes),s (Seconds),ms (Milliseconds),micros (Microseconds),nanos (Nanoseconds)) + * $params['v'] = (boolean) Verbose mode. Display column headers (Default = false) + * + * @param array $params Associative array of parameters + * @return array + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-anomaly-detectors.html + */ + 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 (Days),h (Hours),m (Minutes),s (Seconds),ms (Milliseconds),micros (Microseconds),nanos (Nanoseconds)) + * $params['v'] = (boolean) Verbose mode. Display column headers (Default = false) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-trained-model.html + */ + 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 (Days),h (Hours),m (Minutes),s (Seconds),ms (Milliseconds),micros (Microseconds),nanos (Nanoseconds)) + * $params['v'] = (boolean) Verbose mode. Display column headers (Default = false) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-transforms.html + */ + public function transform(array $params = []) + { + $transform_id = $this->extractArgument($params, 'transform_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Cat\Transform'); + $endpoint->setParams($params); + $endpoint->setTransformId($transform_id); + return $this->performRequest($endpoint); } } diff --git a/src/Elasticsearch/Namespaces/CcrNamespace.php b/src/Elasticsearch/Namespaces/CcrNamespace.php new file mode 100644 index 000000000..21a5491d6 --- /dev/null +++ b/src/Elasticsearch/Namespaces/CcrNamespace.php @@ -0,0 +1,259 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class CcrNamespace extends AbstractNamespace +{ + + /** + * $params['name'] = (string) The name of the auto follow pattern. + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-delete-auto-follow-pattern.html + */ + public function deleteAutoFollowPattern(array $params = []) + { + $name = $this->extractArgument($params, 'name'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ccr\DeleteAutoFollowPattern'); + $endpoint->setParams($params); + $endpoint->setName($name); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (string) The name of the follower index + * $params['wait_for_active_shards'] = (string) Sets the number of shard copies that must be active before returning. Defaults to 0. 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) (Default = 0) + * $params['body'] = (array) The name of the leader index and other optional ccr related parameters (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-follow.html + */ + public function follow(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ccr\Follow'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (list) A comma-separated list of index patterns; use `_all` to perform the operation on all indices + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-info.html + */ + public function followInfo(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ccr\FollowInfo'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (list) A comma-separated list of index patterns; use `_all` to perform the operation on all indices + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-stats.html + */ + public function followStats(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ccr\FollowStats'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (string) the name of the leader index for which specified follower retention leases should be removed + * $params['body'] = (array) the name and UUID of the follower index, the name of the cluster containing the follower index, and the alias from the perspective of that cluster for the remote cluster containing the leader index (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-forget-follower.html + */ + public function forgetFollower(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ccr\ForgetFollower'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['name'] = (string) The name of the auto follow pattern. + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-auto-follow-pattern.html + */ + public function getAutoFollowPattern(array $params = []) + { + $name = $this->extractArgument($params, 'name'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ccr\GetAutoFollowPattern'); + $endpoint->setParams($params); + $endpoint->setName($name); + + return $this->performRequest($endpoint); + } + /** + * $params['name'] = (string) The name of the auto follow pattern that should pause discovering new indices to follow. + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-pause-auto-follow-pattern.html + */ + public function pauseAutoFollowPattern(array $params = []) + { + $name = $this->extractArgument($params, 'name'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ccr\PauseAutoFollowPattern'); + $endpoint->setParams($params); + $endpoint->setName($name); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (string) The name of the follower index that should pause following its leader index. + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-pause-follow.html + */ + public function pauseFollow(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ccr\PauseFollow'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + + return $this->performRequest($endpoint); + } + /** + * $params['name'] = (string) The name of the auto follow pattern. + * $params['body'] = (array) The specification of the auto follow pattern (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-auto-follow-pattern.html + */ + public function putAutoFollowPattern(array $params = []) + { + $name = $this->extractArgument($params, 'name'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ccr\PutAutoFollowPattern'); + $endpoint->setParams($params); + $endpoint->setName($name); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['name'] = (string) The name of the auto follow pattern to resume discovering new indices to follow. + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-resume-auto-follow-pattern.html + */ + public function resumeAutoFollowPattern(array $params = []) + { + $name = $this->extractArgument($params, 'name'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ccr\ResumeAutoFollowPattern'); + $endpoint->setParams($params); + $endpoint->setName($name); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (string) The name of the follow index to resume following. + * $params['body'] = (array) The name of the leader index and other optional ccr related parameters + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-resume-follow.html + */ + public function resumeFollow(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ccr\ResumeFollow'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + public function stats(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ccr\Stats'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (string) The name of the follower index that should be turned into a regular index. + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-unfollow.html + */ + public function unfollow(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ccr\Unfollow'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + + return $this->performRequest($endpoint); + } +} diff --git a/src/Elasticsearch/Namespaces/DataFrameTransformDeprecatedNamespace.php b/src/Elasticsearch/Namespaces/DataFrameTransformDeprecatedNamespace.php new file mode 100644 index 000000000..115aff569 --- /dev/null +++ b/src/Elasticsearch/Namespaces/DataFrameTransformDeprecatedNamespace.php @@ -0,0 +1,198 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DataFrameTransformDeprecatedNamespace extends AbstractNamespace +{ + + /** + * $params['transform_id'] = (string) The id of the transform to delete + * $params['force'] = (boolean) When `true`, the transform is deleted regardless of its current state. The default value is `false`, meaning that the transform must be `stopped` before it can be deleted. + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-transform.html + * + * @note This API is BETA and may change in ways that are not backwards compatible + * + */ + public function deleteTransform(array $params = []) + { + $transform_id = $this->extractArgument($params, 'transform_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('DataFrameTransformDeprecated\DeleteTransform'); + $endpoint->setParams($params); + $endpoint->setTransformId($transform_id); + + return $this->performRequest($endpoint); + } + /** + * $params['transform_id'] = (string) The id or comma delimited list of id expressions of the transforms to get, '_all' or '*' implies get 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) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform.html + * + * @note This API is BETA and may change in ways that are not backwards compatible + * + */ + public function getTransform(array $params = []) + { + $transform_id = $this->extractArgument($params, 'transform_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('DataFrameTransformDeprecated\GetTransform'); + $endpoint->setParams($params); + $endpoint->setTransformId($transform_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'] = (number) skips a number of transform stats, defaults to 0 + * $params['size'] = (number) specifies a max number of transform stats 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) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform-stats.html + * + * @note This API is BETA and may change in ways that are not backwards compatible + * + */ + public function getTransformStats(array $params = []) + { + $transform_id = $this->extractArgument($params, 'transform_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('DataFrameTransformDeprecated\GetTransformStats'); + $endpoint->setParams($params); + $endpoint->setTransformId($transform_id); + + return $this->performRequest($endpoint); + } + public function previewTransform(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('DataFrameTransformDeprecated\PreviewTransform'); + $endpoint->setParams($params); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['transform_id'] = (string) The id of the new transform. + * $params['defer_validation'] = (boolean) If validations should be deferred until transform starts, defaults to false. + * $params['body'] = (array) The transform definition (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-transform.html + * + * @note This API is BETA and may change in ways that are not backwards compatible + * + */ + public function putTransform(array $params = []) + { + $transform_id = $this->extractArgument($params, 'transform_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('DataFrameTransformDeprecated\PutTransform'); + $endpoint->setParams($params); + $endpoint->setTransformId($transform_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['transform_id'] = (string) The id of the transform to start + * $params['timeout'] = (time) Controls the time to wait for the transform to start + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/start-transform.html + * + * @note This API is BETA and may change in ways that are not backwards compatible + * + */ + public function startTransform(array $params = []) + { + $transform_id = $this->extractArgument($params, 'transform_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('DataFrameTransformDeprecated\StartTransform'); + $endpoint->setParams($params); + $endpoint->setTransformId($transform_id); + + return $this->performRequest($endpoint); + } + /** + * $params['transform_id'] = (string) The id of the transform to stop + * $params['wait_for_completion'] = (boolean) Whether to wait for the transform to fully stop before returning or not. Default to false + * $params['timeout'] = (time) Controls the time to wait until the transform has stopped. Default to 30 seconds + * $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) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-transform.html + * + * @note This API is BETA and may change in ways that are not backwards compatible + * + */ + public function stopTransform(array $params = []) + { + $transform_id = $this->extractArgument($params, 'transform_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('DataFrameTransformDeprecated\StopTransform'); + $endpoint->setParams($params); + $endpoint->setTransformId($transform_id); + + return $this->performRequest($endpoint); + } + /** + * $params['transform_id'] = (string) The id of the transform. + * $params['defer_validation'] = (boolean) If validations should be deferred until transform starts, defaults to false. + * $params['body'] = (array) The update transform definition (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-transform.html + * + * @note This API is BETA and may change in ways that are not backwards compatible + * + */ + public function updateTransform(array $params = []) + { + $transform_id = $this->extractArgument($params, 'transform_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('DataFrameTransformDeprecated\UpdateTransform'); + $endpoint->setParams($params); + $endpoint->setTransformId($transform_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } +} diff --git a/src/Elasticsearch/Namespaces/EnrichNamespace.php b/src/Elasticsearch/Namespaces/EnrichNamespace.php new file mode 100644 index 000000000..fb0389a9f --- /dev/null +++ b/src/Elasticsearch/Namespaces/EnrichNamespace.php @@ -0,0 +1,106 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class EnrichNamespace extends AbstractNamespace +{ + + /** + * $params['name'] = (string) The name of the enrich policy + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-enrich-policy-api.html + */ + public function deletePolicy(array $params = []) + { + $name = $this->extractArgument($params, 'name'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Enrich\DeletePolicy'); + $endpoint->setParams($params); + $endpoint->setName($name); + + return $this->performRequest($endpoint); + } + /** + * $params['name'] = (string) The name of the enrich policy + * $params['wait_for_completion'] = (boolean) Should the request should block until the execution is complete. (Default = true) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/execute-enrich-policy-api.html + */ + public function executePolicy(array $params = []) + { + $name = $this->extractArgument($params, 'name'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Enrich\ExecutePolicy'); + $endpoint->setParams($params); + $endpoint->setName($name); + + return $this->performRequest($endpoint); + } + /** + * $params['name'] = (list) A comma-separated list of enrich policy names + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-enrich-policy-api.html + */ + public function getPolicy(array $params = []) + { + $name = $this->extractArgument($params, 'name'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Enrich\GetPolicy'); + $endpoint->setParams($params); + $endpoint->setName($name); + + return $this->performRequest($endpoint); + } + /** + * $params['name'] = (string) The name of the enrich policy + * $params['body'] = (array) The enrich policy to register (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-enrich-policy-api.html + */ + public function putPolicy(array $params = []) + { + $name = $this->extractArgument($params, 'name'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Enrich\PutPolicy'); + $endpoint->setParams($params); + $endpoint->setName($name); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + public function stats(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Enrich\Stats'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } +} diff --git a/src/Elasticsearch/Namespaces/EqlNamespace.php b/src/Elasticsearch/Namespaces/EqlNamespace.php new file mode 100644 index 000000000..e274f67d8 --- /dev/null +++ b/src/Elasticsearch/Namespaces/EqlNamespace.php @@ -0,0 +1,45 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class EqlNamespace extends AbstractNamespace +{ + + /** + * $params['index'] = (string) The name of the index to scope the operation + * $params['body'] = (array) Eql request body. Use the `query` to limit the query scope. (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/eql.html + * + * @note This API is BETA and may change in ways that are not backwards compatible + * + */ + public function search(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Eql\Search'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } +} diff --git a/src/Elasticsearch/Namespaces/GraphNamespace.php b/src/Elasticsearch/Namespaces/GraphNamespace.php new file mode 100644 index 000000000..048e31da7 --- /dev/null +++ b/src/Elasticsearch/Namespaces/GraphNamespace.php @@ -0,0 +1,47 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GraphNamespace extends AbstractNamespace +{ + + /** + * $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['type'] = DEPRECATED (list) A comma-separated list of document types to search; leave empty to perform the operation on all types + * $params['routing'] = (string) Specific routing value + * $params['timeout'] = (time) Explicit operation timeout + * $params['body'] = (array) Graph Query DSL + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/graph-explore-api.html + */ + public function explore(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + $type = $this->extractArgument($params, 'type'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Graph\Explore'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + $endpoint->setType($type); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } +} diff --git a/src/Elasticsearch/Namespaces/IlmNamespace.php b/src/Elasticsearch/Namespaces/IlmNamespace.php new file mode 100644 index 000000000..82aceb8c5 --- /dev/null +++ b/src/Elasticsearch/Namespaces/IlmNamespace.php @@ -0,0 +1,200 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class IlmNamespace extends AbstractNamespace +{ + + /** + * $params['policy'] = (string) The name of the index lifecycle policy + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-delete-lifecycle.html + */ + public function deleteLifecycle(array $params = []) + { + $policy = $this->extractArgument($params, 'policy'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ilm\DeleteLifecycle'); + $endpoint->setParams($params); + $endpoint->setPolicy($policy); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (string) The name of the index to explain + * $params['only_managed'] = (boolean) filters the indices included in the response to ones managed by ILM + * $params['only_errors'] = (boolean) filters the indices included in the response to ones in an ILM error state, implies only_managed + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-explain-lifecycle.html + */ + public function explainLifecycle(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ilm\ExplainLifecycle'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + + return $this->performRequest($endpoint); + } + /** + * $params['policy'] = (string) The name of the index lifecycle policy + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-lifecycle.html + */ + public function getLifecycle(array $params = []) + { + $policy = $this->extractArgument($params, 'policy'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ilm\GetLifecycle'); + $endpoint->setParams($params); + $endpoint->setPolicy($policy); + + return $this->performRequest($endpoint); + } + /** + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-status.html + */ + public function getStatus(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ilm\GetStatus'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (string) The name of the index whose lifecycle step is to change + * $params['body'] = (array) The new lifecycle step to move to + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-move-to-step.html + */ + public function moveToStep(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ilm\MoveToStep'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['policy'] = (string) The name of the index lifecycle policy + * $params['body'] = (array) The lifecycle policy definition to register + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-put-lifecycle.html + */ + public function putLifecycle(array $params = []) + { + $policy = $this->extractArgument($params, 'policy'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ilm\PutLifecycle'); + $endpoint->setParams($params); + $endpoint->setPolicy($policy); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (string) The name of the index to remove policy on + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-remove-policy.html + */ + public function removePolicy(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ilm\RemovePolicy'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (string) The name of the indices (comma-separated) whose failed lifecycle step is to be retry + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-retry-policy.html + */ + public function retry(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ilm\Retry'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + + return $this->performRequest($endpoint); + } + /** + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-start.html + */ + public function start(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ilm\Start'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-stop.html + */ + public function stop(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ilm\Stop'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } +} diff --git a/src/Elasticsearch/Namespaces/IndicesNamespace.php b/src/Elasticsearch/Namespaces/IndicesNamespace.php index d721f41b7..9224c5232 100644 --- a/src/Elasticsearch/Namespaces/IndicesNamespace.php +++ b/src/Elasticsearch/Namespaces/IndicesNamespace.php @@ -1039,6 +1039,75 @@ public function validateQuery(array $params = []) return $this->performRequest($endpoint); } + /** + * $params['index'] = (string) The name of the index to freeze + * $params['timeout'] = (time) Explicit operation timeout + * $params['master_timeout'] = (time) Specify timeout for connection to master + * $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,none,all) (Default = closed) + * $params['wait_for_active_shards'] = (string) Sets the number of active shards to wait for before the operation returns. + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/frozen.html + */ + public function freeze(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Indices\Freeze'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (list) A comma-separated list of index names to reload analyzers for + * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed) + * $params['allow_no_indices'] = (boolean) Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * $params['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both. (Options = open,closed,none,all) (Default = open) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-reload-analyzers.html + */ + public function reloadSearchAnalyzers(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Indices\ReloadSearchAnalyzers'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (string) The name of the index to unfreeze + * $params['timeout'] = (time) Explicit operation timeout + * $params['master_timeout'] = (time) Specify timeout for connection to master + * $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,none,all) (Default = closed) + * $params['wait_for_active_shards'] = (string) Sets the number of active shards to wait for before the operation returns. + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/frozen.html + */ + public function unfreeze(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Indices\Unfreeze'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + + return $this->performRequest($endpoint); + } /** * Alias function to getAlias() * diff --git a/src/Elasticsearch/Namespaces/LicenseNamespace.php b/src/Elasticsearch/Namespaces/LicenseNamespace.php new file mode 100644 index 000000000..bef3760b1 --- /dev/null +++ b/src/Elasticsearch/Namespaces/LicenseNamespace.php @@ -0,0 +1,129 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class LicenseNamespace extends AbstractNamespace +{ + + public function delete(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('License\Delete'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * $params['local'] = (boolean) Return local information, do not retrieve the state from master node (default: false) + * $params['accept_enterprise'] = (boolean) If the active license is an enterprise license, return type as 'enterprise' (default: false) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-license.html + */ + public function get(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('License\Get'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-basic-status.html + */ + public function getBasicStatus(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('License\GetBasicStatus'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-trial-status.html + */ + public function getTrialStatus(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('License\GetTrialStatus'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * $params['acknowledge'] = (boolean) whether the user has acknowledged acknowledge messages (default: false) + * $params['body'] = (array) licenses to be installed + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-license.html + */ + public function post(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('License\Post'); + $endpoint->setParams($params); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['acknowledge'] = (boolean) whether the user has acknowledged acknowledge messages (default: false) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/start-basic.html + */ + public function postStartBasic(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('License\PostStartBasic'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * $params['type'] = (string) The type of trial license to generate (default: "trial") + * $params['acknowledge'] = (boolean) whether the user has acknowledged acknowledge messages (default: false) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/start-trial.html + */ + public function postStartTrial(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('License\PostStartTrial'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } +} diff --git a/src/Elasticsearch/Namespaces/MigrationNamespace.php b/src/Elasticsearch/Namespaces/MigrationNamespace.php new file mode 100644 index 000000000..c04b489c5 --- /dev/null +++ b/src/Elasticsearch/Namespaces/MigrationNamespace.php @@ -0,0 +1,39 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class MigrationNamespace extends AbstractNamespace +{ + + /** + * $params['index'] = (string) Index pattern + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-deprecation.html + */ + public function deprecations(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Migration\Deprecations'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + + return $this->performRequest($endpoint); + } +} diff --git a/src/Elasticsearch/Namespaces/MlNamespace.php b/src/Elasticsearch/Namespaces/MlNamespace.php new file mode 100644 index 000000000..014f15739 --- /dev/null +++ b/src/Elasticsearch/Namespaces/MlNamespace.php @@ -0,0 +1,1304 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class MlNamespace extends AbstractNamespace +{ + + /** + * $params['job_id'] = (string) The name of the job to close + * $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['force'] = (boolean) True if the job should be forcefully closed + * $params['timeout'] = (time) Controls the time to wait until a job has closed. Default to 30 minutes + * $params['body'] = (array) The URL params optionally sent in the body + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-close-job.html + */ + public function closeJob(array $params = []) + { + $job_id = $this->extractArgument($params, 'job_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\CloseJob'); + $endpoint->setParams($params); + $endpoint->setJobId($job_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['calendar_id'] = (string) The ID of the calendar to delete + * + * @param array $params Associative array of parameters + * @return array + */ + public function deleteCalendar(array $params = []) + { + $calendar_id = $this->extractArgument($params, 'calendar_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\DeleteCalendar'); + $endpoint->setParams($params); + $endpoint->setCalendarId($calendar_id); + + return $this->performRequest($endpoint); + } + /** + * $params['calendar_id'] = (string) The ID of the calendar to modify + * $params['event_id'] = (string) The ID of the event to remove from the calendar + * + * @param array $params Associative array of parameters + * @return array + */ + public function deleteCalendarEvent(array $params = []) + { + $calendar_id = $this->extractArgument($params, 'calendar_id'); + $event_id = $this->extractArgument($params, 'event_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\DeleteCalendarEvent'); + $endpoint->setParams($params); + $endpoint->setCalendarId($calendar_id); + $endpoint->setEventId($event_id); + + return $this->performRequest($endpoint); + } + /** + * $params['calendar_id'] = (string) The ID of the calendar to modify + * $params['job_id'] = (string) The ID of the job to remove from the calendar + * + * @param array $params Associative array of parameters + * @return array + */ + public function deleteCalendarJob(array $params = []) + { + $calendar_id = $this->extractArgument($params, 'calendar_id'); + $job_id = $this->extractArgument($params, 'job_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\DeleteCalendarJob'); + $endpoint->setParams($params); + $endpoint->setCalendarId($calendar_id); + $endpoint->setJobId($job_id); + + return $this->performRequest($endpoint); + } + /** + * $params['id'] = (string) The ID of the data frame analytics to delete + * $params['force'] = (boolean) True if the job should be forcefully deleted (Default = false) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-dfanalytics.html + * + * @note This API is EXPERIMENTAL and may be changed or removed completely in a future release + * + */ + public function deleteDataFrameAnalytics(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\DeleteDataFrameAnalytics'); + $endpoint->setParams($params); + $endpoint->setId($id); + + return $this->performRequest($endpoint); + } + /** + * $params['datafeed_id'] = (string) The ID of the datafeed to delete + * $params['force'] = (boolean) True if the datafeed should be forcefully deleted + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-datafeed.html + */ + public function deleteDatafeed(array $params = []) + { + $datafeed_id = $this->extractArgument($params, 'datafeed_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\DeleteDatafeed'); + $endpoint->setParams($params); + $endpoint->setDatafeedId($datafeed_id); + + return $this->performRequest($endpoint); + } + public function deleteExpiredData(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\DeleteExpiredData'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * $params['filter_id'] = (string) The ID of the filter to delete + * + * @param array $params Associative array of parameters + * @return array + */ + public function deleteFilter(array $params = []) + { + $filter_id = $this->extractArgument($params, 'filter_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\DeleteFilter'); + $endpoint->setParams($params); + $endpoint->setFilterId($filter_id); + + return $this->performRequest($endpoint); + } + /** + * $params['job_id'] = (string) The ID of the job from which to delete forecasts (Required) + * $params['forecast_id'] = (string) The ID of the forecast to delete, can be comma delimited list. Leaving blank implies `_all` + * $params['allow_no_forecasts'] = (boolean) Whether to ignore if `_all` matches no forecasts + * $params['timeout'] = (time) Controls the time to wait until the forecast(s) are deleted. Default to 30 seconds + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-forecast.html + */ + public function deleteForecast(array $params = []) + { + $job_id = $this->extractArgument($params, 'job_id'); + $forecast_id = $this->extractArgument($params, 'forecast_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\DeleteForecast'); + $endpoint->setParams($params); + $endpoint->setJobId($job_id); + $endpoint->setForecastId($forecast_id); + + return $this->performRequest($endpoint); + } + /** + * $params['job_id'] = (string) The ID of the job to delete + * $params['force'] = (boolean) True if the job should be forcefully deleted (Default = false) + * $params['wait_for_completion'] = (boolean) Should this request wait until the operation has completed before returning (Default = true) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-job.html + */ + public function deleteJob(array $params = []) + { + $job_id = $this->extractArgument($params, 'job_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\DeleteJob'); + $endpoint->setParams($params); + $endpoint->setJobId($job_id); + + return $this->performRequest($endpoint); + } + /** + * $params['job_id'] = (string) The ID of the job to fetch + * $params['snapshot_id'] = (string) The ID of the snapshot to delete + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-snapshot.html + */ + public function deleteModelSnapshot(array $params = []) + { + $job_id = $this->extractArgument($params, 'job_id'); + $snapshot_id = $this->extractArgument($params, 'snapshot_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\DeleteModelSnapshot'); + $endpoint->setParams($params); + $endpoint->setJobId($job_id); + $endpoint->setSnapshotId($snapshot_id); + + return $this->performRequest($endpoint); + } + /** + * $params['model_id'] = (string) The ID of the trained model to delete + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-inference.html + * + * @note This API is EXPERIMENTAL and may be changed or removed completely in a future release + * + */ + public function deleteTrainedModel(array $params = []) + { + $model_id = $this->extractArgument($params, 'model_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\DeleteTrainedModel'); + $endpoint->setParams($params); + $endpoint->setModelId($model_id); + + return $this->performRequest($endpoint); + } + /** + * $params['body'] = (array) The analysis config, plus cardinality estimates for fields it references (Required) + * + * @param array $params Associative array of parameters + * @return array + */ + public function estimateModelMemory(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\EstimateModelMemory'); + $endpoint->setParams($params); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + public function evaluateDataFrame(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\EvaluateDataFrame'); + $endpoint->setParams($params); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['id'] = (string) The ID of the data frame analytics to explain + * $params['body'] = (array) The data frame analytics config to explain + * + * @param array $params Associative array of parameters + * @return array + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/explain-dfanalytics.html + * + * @note This API is EXPERIMENTAL and may be changed or removed completely in a future release + * + */ + public function explainDataFrameAnalytics(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\ExplainDataFrameAnalytics'); + $endpoint->setParams($params); + $endpoint->setId($id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['lines_to_sample'] = (int) How many lines of the file should be included in the analysis (Default = 1000) + * $params['line_merge_size_limit'] = (int) Maximum number of characters permitted in a single message when lines are merged to create messages. (Default = 10000) + * $params['timeout'] = (time) Timeout after which the analysis will be aborted (Default = 25s) + * $params['charset'] = (string) Optional parameter to specify the character set of the file + * $params['format'] = (enum) Optional parameter to specify the high level file format (Options = ndjson,xml,delimited,semi_structured_text) + * $params['has_header_row'] = (boolean) Optional parameter to specify whether a delimited file includes the column names in its first row + * $params['column_names'] = (list) Optional parameter containing a comma separated list of the column names for a delimited file + * $params['delimiter'] = (string) Optional parameter to specify the delimiter character for a delimited file - must be a single character + * $params['quote'] = (string) Optional parameter to specify the quote character for a delimited file - must be a single character + * $params['should_trim_fields'] = (boolean) Optional parameter to specify whether the values between delimiters in a delimited file should have whitespace trimmed from them + * $params['grok_pattern'] = (string) Optional parameter to specify the Grok pattern that should be used to extract fields from messages in a semi-structured text file + * $params['timestamp_field'] = (string) Optional parameter to specify the timestamp field in the file + * $params['timestamp_format'] = (string) Optional parameter to specify the timestamp format in the file - may be either a Joda or Java time format + * $params['explain'] = (boolean) Whether to include a commentary on how the structure was derived (Default = false) + * $params['body'] = (array) The contents of the file to be analyzed (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-find-file-structure.html + * + * @note This API is EXPERIMENTAL and may be changed or removed completely in a future release + * + */ + public function findFileStructure(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\FindFileStructure'); + $endpoint->setParams($params); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['job_id'] = (string) The name of the job to flush + * $params['calc_interim'] = (boolean) Calculates interim results for the most recent bucket or all buckets within the latency period + * $params['start'] = (string) When used in conjunction with calc_interim, specifies the range of buckets on which to calculate interim results + * $params['end'] = (string) When used in conjunction with calc_interim, specifies the range of buckets on which to calculate interim results + * $params['advance_time'] = (string) Advances time to the given value generating results and updating the model for the advanced interval + * $params['skip_time'] = (string) Skips time to the given value without generating results or updating the model for the skipped interval + * $params['body'] = (array) Flush parameters + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-flush-job.html + */ + public function flushJob(array $params = []) + { + $job_id = $this->extractArgument($params, 'job_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\FlushJob'); + $endpoint->setParams($params); + $endpoint->setJobId($job_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['job_id'] = (string) The ID of the job to forecast for + * $params['duration'] = (time) The duration of the forecast + * $params['expires_in'] = (time) The time interval after which the forecast expires. Expired forecasts will be deleted at the first opportunity. + * + * @param array $params Associative array of parameters + * @return array + */ + public function forecast(array $params = []) + { + $job_id = $this->extractArgument($params, 'job_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\Forecast'); + $endpoint->setParams($params); + $endpoint->setJobId($job_id); + + return $this->performRequest($endpoint); + } + /** + * $params['job_id'] = (string) ID of the job to get bucket results from (Required) + * $params['timestamp'] = (string) The timestamp of the desired single bucket result + * $params['expand'] = (boolean) Include anomaly records + * $params['exclude_interim'] = (boolean) Exclude interim results + * $params['from'] = (int) skips a number of buckets + * $params['size'] = (int) specifies a max number of buckets to get + * $params['start'] = (string) Start time filter for buckets + * $params['end'] = (string) End time filter for buckets + * $params['anomaly_score'] = (double) Filter for the most anomalous buckets + * $params['sort'] = (string) Sort buckets by a particular field + * $params['desc'] = (boolean) Set the sort direction + * $params['body'] = (array) Bucket selection details if not provided in URI + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-bucket.html + */ + public function getBuckets(array $params = []) + { + $job_id = $this->extractArgument($params, 'job_id'); + $timestamp = $this->extractArgument($params, 'timestamp'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\GetBuckets'); + $endpoint->setParams($params); + $endpoint->setJobId($job_id); + $endpoint->setTimestamp($timestamp); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['calendar_id'] = (string) The ID of the calendar containing the events + * $params['job_id'] = (string) Get events for the job. When this option is used calendar_id must be '_all' + * $params['start'] = (string) Get events after this time + * $params['end'] = (date) Get events before this time + * $params['from'] = (int) Skips a number of events + * $params['size'] = (int) Specifies a max number of events to get + * + * @param array $params Associative array of parameters + * @return array + */ + public function getCalendarEvents(array $params = []) + { + $calendar_id = $this->extractArgument($params, 'calendar_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\GetCalendarEvents'); + $endpoint->setParams($params); + $endpoint->setCalendarId($calendar_id); + + return $this->performRequest($endpoint); + } + /** + * $params['calendar_id'] = (string) The ID of the calendar to fetch + * $params['from'] = (int) skips a number of calendars + * $params['size'] = (int) specifies a max number of calendars to get + * $params['body'] = (array) The from and size parameters optionally sent in the body + * + * @param array $params Associative array of parameters + * @return array + */ + public function getCalendars(array $params = []) + { + $calendar_id = $this->extractArgument($params, 'calendar_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\GetCalendars'); + $endpoint->setParams($params); + $endpoint->setCalendarId($calendar_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['job_id'] = (string) The name of the job (Required) + * $params['category_id'] = (long) The identifier of the category definition of interest + * $params['from'] = (int) skips a number of categories + * $params['size'] = (int) specifies a max number of categories to get + * $params['body'] = (array) Category selection details if not provided in URI + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-category.html + */ + public function getCategories(array $params = []) + { + $job_id = $this->extractArgument($params, 'job_id'); + $category_id = $this->extractArgument($params, 'category_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\GetCategories'); + $endpoint->setParams($params); + $endpoint->setJobId($job_id); + $endpoint->setCategoryId($category_id); + $endpoint->setBody($body); + + 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 data frame analytics. (This includes `_all` string or when no data frame analytics have been specified) (Default = true) + * $params['from'] = (int) skips a number of analytics (Default = 0) + * $params['size'] = (int) specifies a max number of analytics to get (Default = 100) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-dfanalytics.html + * + * @note This API is EXPERIMENTAL and may be changed or removed completely in a future release + * + */ + public function getDataFrameAnalytics(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\GetDataFrameAnalytics'); + $endpoint->setParams($params); + $endpoint->setId($id); + + return $this->performRequest($endpoint); + } + /** + * $params['id'] = (string) The ID of the data frame analytics stats to fetch + * $params['allow_no_match'] = (boolean) Whether to ignore if a wildcard expression matches no data frame analytics. (This includes `_all` string or when no data frame analytics have been specified) (Default = true) + * $params['from'] = (int) skips a number of analytics (Default = 0) + * $params['size'] = (int) specifies a max number of analytics to get (Default = 100) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-dfanalytics-stats.html + * + * @note This API is EXPERIMENTAL and may be changed or removed completely in a future release + * + */ + public function getDataFrameAnalyticsStats(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\GetDataFrameAnalyticsStats'); + $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_datafeeds'] = (boolean) Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed-stats.html + */ + public function getDatafeedStats(array $params = []) + { + $datafeed_id = $this->extractArgument($params, 'datafeed_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\GetDatafeedStats'); + $endpoint->setParams($params); + $endpoint->setDatafeedId($datafeed_id); + + return $this->performRequest($endpoint); + } + /** + * $params['datafeed_id'] = (string) The ID of the datafeeds to fetch + * $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) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed.html + */ + public function getDatafeeds(array $params = []) + { + $datafeed_id = $this->extractArgument($params, 'datafeed_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\GetDatafeeds'); + $endpoint->setParams($params); + $endpoint->setDatafeedId($datafeed_id); + + return $this->performRequest($endpoint); + } + /** + * $params['filter_id'] = (string) The ID of the filter to fetch + * $params['from'] = (int) skips a number of filters + * $params['size'] = (int) specifies a max number of filters to get + * + * @param array $params Associative array of parameters + * @return array + */ + public function getFilters(array $params = []) + { + $filter_id = $this->extractArgument($params, 'filter_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\GetFilters'); + $endpoint->setParams($params); + $endpoint->setFilterId($filter_id); + + return $this->performRequest($endpoint); + } + /** + * $params['job_id'] = (string) + * $params['exclude_interim'] = (boolean) Exclude interim results + * $params['from'] = (int) skips a number of influencers + * $params['size'] = (int) specifies a max number of influencers to get + * $params['start'] = (string) start timestamp for the requested influencers + * $params['end'] = (string) end timestamp for the requested influencers + * $params['influencer_score'] = (double) influencer score threshold for the requested influencers + * $params['sort'] = (string) sort field for the requested influencers + * $params['desc'] = (boolean) whether the results should be sorted in decending order + * $params['body'] = (array) Influencer selection criteria + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-influencer.html + */ + public function getInfluencers(array $params = []) + { + $job_id = $this->extractArgument($params, 'job_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\GetInfluencers'); + $endpoint->setParams($params); + $endpoint->setJobId($job_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['job_id'] = (string) The ID of the jobs stats to fetch + * $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) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-stats.html + */ + public function getJobStats(array $params = []) + { + $job_id = $this->extractArgument($params, 'job_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\GetJobStats'); + $endpoint->setParams($params); + $endpoint->setJobId($job_id); + + return $this->performRequest($endpoint); + } + /** + * $params['job_id'] = (string) The ID of the jobs to fetch + * $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) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job.html + */ + public function getJobs(array $params = []) + { + $job_id = $this->extractArgument($params, 'job_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\GetJobs'); + $endpoint->setParams($params); + $endpoint->setJobId($job_id); + + return $this->performRequest($endpoint); + } + /** + * $params['job_id'] = (string) The ID of the job to fetch (Required) + * $params['snapshot_id'] = (string) The ID of the snapshot to fetch + * $params['from'] = (int) Skips a number of documents + * $params['size'] = (int) The default number of documents returned in queries as a string. + * $params['start'] = (date) The filter 'start' query parameter + * $params['end'] = (date) The filter 'end' query parameter + * $params['sort'] = (string) Name of the field to sort on + * $params['desc'] = (boolean) True if the results should be sorted in descending order + * $params['body'] = (array) Model snapshot selection criteria + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-snapshot.html + */ + public function getModelSnapshots(array $params = []) + { + $job_id = $this->extractArgument($params, 'job_id'); + $snapshot_id = $this->extractArgument($params, 'snapshot_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\GetModelSnapshots'); + $endpoint->setParams($params); + $endpoint->setJobId($job_id); + $endpoint->setSnapshotId($snapshot_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['job_id'] = (string) The job IDs for which to calculate overall bucket results + * $params['top_n'] = (int) The number of top job bucket scores to be used in the overall_score calculation + * $params['bucket_span'] = (string) The span of the overall buckets. Defaults to the longest job bucket_span + * $params['overall_score'] = (double) Returns overall buckets with overall scores higher than this value + * $params['exclude_interim'] = (boolean) If true overall buckets that include interim buckets will be excluded + * $params['start'] = (string) Returns overall buckets with timestamps after this time + * $params['end'] = (string) Returns overall buckets with timestamps earlier than this time + * $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['body'] = (array) Overall bucket selection details if not provided in URI + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-overall-buckets.html + */ + public function getOverallBuckets(array $params = []) + { + $job_id = $this->extractArgument($params, 'job_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\GetOverallBuckets'); + $endpoint->setParams($params); + $endpoint->setJobId($job_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['job_id'] = (string) + * $params['exclude_interim'] = (boolean) Exclude interim results + * $params['from'] = (int) skips a number of records + * $params['size'] = (int) specifies a max number of records to get + * $params['start'] = (string) Start time filter for records + * $params['end'] = (string) End time filter for records + * $params['record_score'] = (double) + * $params['sort'] = (string) Sort records by a particular field + * $params['desc'] = (boolean) Set the sort direction + * $params['body'] = (array) Record selection criteria + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-record.html + */ + public function getRecords(array $params = []) + { + $job_id = $this->extractArgument($params, 'job_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\GetRecords'); + $endpoint->setParams($params); + $endpoint->setJobId($job_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['model_id'] = (string) The ID of the trained models 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['include_model_definition'] = (boolean) Should the full model definition be included in the results. These definitions can be large. So be cautious when including them. Defaults to false. (Default = false) + * $params['decompress_definition'] = (boolean) Should the model definition be decompressed into valid JSON or returned in a custom compressed format. Defaults to true. (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['tags'] = (list) A comma-separated list of tags that the model must have. + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-inference.html + * + * @note This API is EXPERIMENTAL and may be changed or removed completely in a future release + * + */ + public function getTrainedModels(array $params = []) + { + $model_id = $this->extractArgument($params, 'model_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\GetTrainedModels'); + $endpoint->setParams($params); + $endpoint->setModelId($model_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) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-inference-stats.html + * + * @note This API is EXPERIMENTAL and may be changed or removed completely in a future release + * + */ + public function getTrainedModelsStats(array $params = []) + { + $model_id = $this->extractArgument($params, 'model_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\GetTrainedModelsStats'); + $endpoint->setParams($params); + $endpoint->setModelId($model_id); + + return $this->performRequest($endpoint); + } + public function info(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\Info'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * $params['job_id'] = (string) The ID of the job to open + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-open-job.html + */ + public function openJob(array $params = []) + { + $job_id = $this->extractArgument($params, 'job_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\OpenJob'); + $endpoint->setParams($params); + $endpoint->setJobId($job_id); + + return $this->performRequest($endpoint); + } + /** + * $params['calendar_id'] = (string) The ID of the calendar to modify + * $params['body'] = (array) A list of events (Required) + * + * @param array $params Associative array of parameters + * @return array + */ + public function postCalendarEvents(array $params = []) + { + $calendar_id = $this->extractArgument($params, 'calendar_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\PostCalendarEvents'); + $endpoint->setParams($params); + $endpoint->setCalendarId($calendar_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['job_id'] = (string) The name of the job receiving the data + * $params['reset_start'] = (string) Optional parameter to specify the start of the bucket resetting range + * $params['reset_end'] = (string) Optional parameter to specify the end of the bucket resetting range + * $params['body'] = (array) The data to process (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-post-data.html + */ + public function postData(array $params = []) + { + $job_id = $this->extractArgument($params, 'job_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\PostData'); + $endpoint->setParams($params); + $endpoint->setJobId($job_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['datafeed_id'] = (string) The ID of the datafeed to preview + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-preview-datafeed.html + */ + public function previewDatafeed(array $params = []) + { + $datafeed_id = $this->extractArgument($params, 'datafeed_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\PreviewDatafeed'); + $endpoint->setParams($params); + $endpoint->setDatafeedId($datafeed_id); + + return $this->performRequest($endpoint); + } + /** + * $params['calendar_id'] = (string) The ID of the calendar to create + * $params['body'] = (array) The calendar details + * + * @param array $params Associative array of parameters + * @return array + */ + public function putCalendar(array $params = []) + { + $calendar_id = $this->extractArgument($params, 'calendar_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\PutCalendar'); + $endpoint->setParams($params); + $endpoint->setCalendarId($calendar_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['calendar_id'] = (string) The ID of the calendar to modify + * $params['job_id'] = (string) The ID of the job to add to the calendar + * + * @param array $params Associative array of parameters + * @return array + */ + public function putCalendarJob(array $params = []) + { + $calendar_id = $this->extractArgument($params, 'calendar_id'); + $job_id = $this->extractArgument($params, 'job_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\PutCalendarJob'); + $endpoint->setParams($params); + $endpoint->setCalendarId($calendar_id); + $endpoint->setJobId($job_id); + + return $this->performRequest($endpoint); + } + /** + * $params['id'] = (string) The ID of the data frame analytics to create + * $params['body'] = (array) The data frame analytics configuration (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-dfanalytics.html + * + * @note This API is EXPERIMENTAL and may be changed or removed completely in a future release + * + */ + public function putDataFrameAnalytics(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\PutDataFrameAnalytics'); + $endpoint->setParams($params); + $endpoint->setId($id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['datafeed_id'] = (string) The ID of the datafeed to create + * $params['ignore_unavailable'] = (boolean) Ignore unavailable indexes (default: false) + * $params['allow_no_indices'] = (boolean) Ignore if the source indices expressions resolves to no concrete indices (default: true) + * $params['ignore_throttled'] = (boolean) Ignore indices that are marked as throttled (default: true) + * $params['expand_wildcards'] = (enum) Whether source index expressions should get expanded to open or closed indices (default: open) (Options = open,closed,hidden,none,all) + * $params['body'] = (array) The datafeed config (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-datafeed.html + */ + public function putDatafeed(array $params = []) + { + $datafeed_id = $this->extractArgument($params, 'datafeed_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\PutDatafeed'); + $endpoint->setParams($params); + $endpoint->setDatafeedId($datafeed_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['filter_id'] = (string) The ID of the filter to create + * $params['body'] = (array) The filter details (Required) + * + * @param array $params Associative array of parameters + * @return array + */ + public function putFilter(array $params = []) + { + $filter_id = $this->extractArgument($params, 'filter_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\PutFilter'); + $endpoint->setParams($params); + $endpoint->setFilterId($filter_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['job_id'] = (string) The ID of the job to create + * $params['body'] = (array) The job (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-job.html + */ + public function putJob(array $params = []) + { + $job_id = $this->extractArgument($params, 'job_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\PutJob'); + $endpoint->setParams($params); + $endpoint->setJobId($job_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['model_id'] = (string) The ID of the trained models to store + * $params['body'] = (array) The trained model configuration (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see TODO + * + * @note This API is EXPERIMENTAL and may be changed or removed completely in a future release + * + */ + public function putTrainedModel(array $params = []) + { + $model_id = $this->extractArgument($params, 'model_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\PutTrainedModel'); + $endpoint->setParams($params); + $endpoint->setModelId($model_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['job_id'] = (string) The ID of the job to fetch + * $params['snapshot_id'] = (string) The ID of the snapshot to revert to + * $params['delete_intervening_results'] = (boolean) Should we reset the results back to the time of the snapshot? + * $params['body'] = (array) Reversion options + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-revert-snapshot.html + */ + public function revertModelSnapshot(array $params = []) + { + $job_id = $this->extractArgument($params, 'job_id'); + $snapshot_id = $this->extractArgument($params, 'snapshot_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\RevertModelSnapshot'); + $endpoint->setParams($params); + $endpoint->setJobId($job_id); + $endpoint->setSnapshotId($snapshot_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['enabled'] = (boolean) Whether to enable upgrade_mode ML setting or not. Defaults to false. + * $params['timeout'] = (time) Controls the time to wait before action times out. Defaults to 30 seconds + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-set-upgrade-mode.html + */ + public function setUpgradeMode(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\SetUpgradeMode'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * $params['id'] = (string) The ID of the data frame analytics to start + * $params['timeout'] = (time) Controls the time to wait until the task has started. Defaults to 20 seconds + * $params['body'] = (array) The start data frame analytics parameters + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/start-dfanalytics.html + * + * @note This API is EXPERIMENTAL and may be changed or removed completely in a future release + * + */ + public function startDataFrameAnalytics(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\StartDataFrameAnalytics'); + $endpoint->setParams($params); + $endpoint->setId($id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['datafeed_id'] = (string) The ID of the datafeed to start + * $params['start'] = (string) The start time from where the datafeed should begin + * $params['end'] = (string) The end time when the datafeed should stop. When not set, the datafeed continues in real time + * $params['timeout'] = (time) Controls the time to wait until a datafeed has started. Default to 20 seconds + * $params['body'] = (array) The start datafeed parameters + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-start-datafeed.html + */ + public function startDatafeed(array $params = []) + { + $datafeed_id = $this->extractArgument($params, 'datafeed_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\StartDatafeed'); + $endpoint->setParams($params); + $endpoint->setDatafeedId($datafeed_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['id'] = (string) The ID of the data frame analytics to stop + * $params['allow_no_match'] = (boolean) Whether to ignore if a wildcard expression matches no data frame analytics. (This includes `_all` string or when no data frame analytics have been specified) + * $params['force'] = (boolean) True if the data frame analytics should be forcefully stopped + * $params['timeout'] = (time) Controls the time to wait until the task has stopped. Defaults to 20 seconds + * $params['body'] = (array) The stop data frame analytics parameters + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-dfanalytics.html + * + * @note This API is EXPERIMENTAL and may be changed or removed completely in a future release + * + */ + public function stopDataFrameAnalytics(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\StopDataFrameAnalytics'); + $endpoint->setParams($params); + $endpoint->setId($id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['datafeed_id'] = (string) The ID of the datafeed to stop + * $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['force'] = (boolean) True if the datafeed should be forcefully stopped. + * $params['timeout'] = (time) Controls the time to wait until a datafeed has stopped. Default to 20 seconds + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-stop-datafeed.html + */ + public function stopDatafeed(array $params = []) + { + $datafeed_id = $this->extractArgument($params, 'datafeed_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\StopDatafeed'); + $endpoint->setParams($params); + $endpoint->setDatafeedId($datafeed_id); + + return $this->performRequest($endpoint); + } + /** + * $params['datafeed_id'] = (string) The ID of the datafeed to update + * $params['ignore_unavailable'] = (boolean) Ignore unavailable indexes (default: false) + * $params['allow_no_indices'] = (boolean) Ignore if the source indices expressions resolves to no concrete indices (default: true) + * $params['ignore_throttled'] = (boolean) Ignore indices that are marked as throttled (default: true) + * $params['expand_wildcards'] = (enum) Whether source index expressions should get expanded to open or closed indices (default: open) (Options = open,closed,hidden,none,all) + * $params['body'] = (array) The datafeed update settings (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-datafeed.html + */ + public function updateDatafeed(array $params = []) + { + $datafeed_id = $this->extractArgument($params, 'datafeed_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\UpdateDatafeed'); + $endpoint->setParams($params); + $endpoint->setDatafeedId($datafeed_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['filter_id'] = (string) The ID of the filter to update + * $params['body'] = (array) The filter update (Required) + * + * @param array $params Associative array of parameters + * @return array + */ + public function updateFilter(array $params = []) + { + $filter_id = $this->extractArgument($params, 'filter_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\UpdateFilter'); + $endpoint->setParams($params); + $endpoint->setFilterId($filter_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['job_id'] = (string) The ID of the job to create + * $params['body'] = (array) The job update settings (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-job.html + */ + public function updateJob(array $params = []) + { + $job_id = $this->extractArgument($params, 'job_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\UpdateJob'); + $endpoint->setParams($params); + $endpoint->setJobId($job_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['job_id'] = (string) The ID of the job to fetch + * $params['snapshot_id'] = (string) The ID of the snapshot to update + * $params['body'] = (array) The model snapshot properties to update (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-snapshot.html + */ + public function updateModelSnapshot(array $params = []) + { + $job_id = $this->extractArgument($params, 'job_id'); + $snapshot_id = $this->extractArgument($params, 'snapshot_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\UpdateModelSnapshot'); + $endpoint->setParams($params); + $endpoint->setJobId($job_id); + $endpoint->setSnapshotId($snapshot_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['body'] = (array) The job config (Required) + * + * @param array $params Associative array of parameters + * @return array + */ + public function validate(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\Validate'); + $endpoint->setParams($params); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['body'] = (array) The detector (Required) + * + * @param array $params Associative array of parameters + * @return array + */ + public function validateDetector(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\ValidateDetector'); + $endpoint->setParams($params); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } +} diff --git a/src/Elasticsearch/Namespaces/MonitoringNamespace.php b/src/Elasticsearch/Namespaces/MonitoringNamespace.php new file mode 100644 index 000000000..045974f3b --- /dev/null +++ b/src/Elasticsearch/Namespaces/MonitoringNamespace.php @@ -0,0 +1,48 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class MonitoringNamespace extends AbstractNamespace +{ + + /** + * $params['type'] = DEPRECATED (string) Default document type for items which don't provide one + * $params['system_id'] = (string) Identifier of the monitored system + * $params['system_api_version'] = (string) API Version of the monitored system + * $params['interval'] = (string) Collection interval (e.g., '10s' or '10000ms') of the payload + * $params['body'] = (array) The operation definition and data (action-data pairs), separated by newlines (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/monitor-elasticsearch-cluster.html + * + * @note This API is EXPERIMENTAL and may be changed or removed completely in a future release + * + */ + public function bulk(array $params = []) + { + $type = $this->extractArgument($params, 'type'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Monitoring\Bulk'); + $endpoint->setParams($params); + $endpoint->setType($type); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } +} diff --git a/src/Elasticsearch/Namespaces/RollupNamespace.php b/src/Elasticsearch/Namespaces/RollupNamespace.php new file mode 100644 index 000000000..19263f566 --- /dev/null +++ b/src/Elasticsearch/Namespaces/RollupNamespace.php @@ -0,0 +1,194 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class RollupNamespace extends AbstractNamespace +{ + + /** + * $params['id'] = (string) The ID of the job to delete + * + * @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 deleteJob(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Rollup\DeleteJob'); + $endpoint->setParams($params); + $endpoint->setId($id); + + return $this->performRequest($endpoint); + } + /** + * $params['id'] = (string) The ID of the job(s) to fetch. Accepts glob patterns, or left blank for all jobs + * + * @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 getJobs(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Rollup\GetJobs'); + $endpoint->setParams($params); + $endpoint->setId($id); + + return $this->performRequest($endpoint); + } + /** + * $params['id'] = (string) The ID of the index to check rollup capabilities on, or left blank for all jobs + * + * @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 getRollupCaps(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Rollup\GetRollupCaps'); + $endpoint->setParams($params); + $endpoint->setId($id); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (string) The rollup index or index pattern to obtain rollup capabilities from. + * + * @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 getRollupIndexCaps(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Rollup\GetRollupIndexCaps'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + + return $this->performRequest($endpoint); + } + /** + * $params['id'] = (string) The ID of the job to create + * $params['body'] = (array) The job configuration (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 putJob(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Rollup\PutJob'); + $endpoint->setParams($params); + $endpoint->setId($id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (list) The indices or index-pattern(s) (containing rollup or regular data) that should be searched (Required) + * $params['type'] = DEPRECATED (string) The doc type inside the index + * $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['body'] = (array) The search request body (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 rollupSearch(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + $type = $this->extractArgument($params, 'type'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Rollup\RollupSearch'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + $endpoint->setType($type); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['id'] = (string) The ID of the job to start + * + * @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 startJob(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Rollup\StartJob'); + $endpoint->setParams($params); + $endpoint->setId($id); + + return $this->performRequest($endpoint); + } + /** + * $params['id'] = (string) The ID of the job to stop + * $params['wait_for_completion'] = (boolean) True if the API should block until the job has fully stopped, false if should be executed async. Defaults to false. + * $params['timeout'] = (time) Block for (at maximum) the specified duration while waiting for the job to stop. Defaults to 30s. + * + * @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 stopJob(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Rollup\StopJob'); + $endpoint->setParams($params); + $endpoint->setId($id); + + return $this->performRequest($endpoint); + } +} diff --git a/src/Elasticsearch/Namespaces/SecurityNamespace.php b/src/Elasticsearch/Namespaces/SecurityNamespace.php new file mode 100644 index 000000000..545371158 --- /dev/null +++ b/src/Elasticsearch/Namespaces/SecurityNamespace.php @@ -0,0 +1,509 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class SecurityNamespace extends AbstractNamespace +{ + + /** + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-authenticate.html + */ + public function authenticate(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\Authenticate'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * $params['username'] = (string) The username of the user to change the password for + * $params['refresh'] = (enum) If `true` (the default) 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` then do nothing with refreshes. (Options = true,false,wait_for) + * $params['body'] = (array) the new password for the user (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-change-password.html + */ + public function changePassword(array $params = []) + { + $username = $this->extractArgument($params, 'username'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\ChangePassword'); + $endpoint->setParams($params); + $endpoint->setUsername($username); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['realms'] = (list) Comma-separated list of realms to clear + * $params['usernames'] = (list) Comma-separated list of usernames to clear from the cache + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-cache.html + */ + public function clearCachedRealms(array $params = []) + { + $realms = $this->extractArgument($params, 'realms'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\ClearCachedRealms'); + $endpoint->setParams($params); + $endpoint->setRealms($realms); + + return $this->performRequest($endpoint); + } + /** + * $params['name'] = (list) Role name + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-role-cache.html + */ + public function clearCachedRoles(array $params = []) + { + $name = $this->extractArgument($params, 'name'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\ClearCachedRoles'); + $endpoint->setParams($params); + $endpoint->setName($name); + + return $this->performRequest($endpoint); + } + /** + * $params['refresh'] = (enum) If `true` (the default) 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` then do nothing with refreshes. (Options = true,false,wait_for) + * $params['body'] = (array) The api key request to create an API key (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html + */ + public function createApiKey(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\CreateApiKey'); + $endpoint->setParams($params); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['application'] = (string) Application name + * $params['name'] = (string) Privilege name + * $params['refresh'] = (enum) If `true` (the default) 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` then do nothing with refreshes. (Options = true,false,wait_for) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-privilege.html + */ + public function deletePrivileges(array $params = []) + { + $application = $this->extractArgument($params, 'application'); + $name = $this->extractArgument($params, 'name'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\DeletePrivileges'); + $endpoint->setParams($params); + $endpoint->setApplication($application); + $endpoint->setName($name); + + return $this->performRequest($endpoint); + } + /** + * $params['name'] = (string) Role name + * $params['refresh'] = (enum) If `true` (the default) 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` then do nothing with refreshes. (Options = true,false,wait_for) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role.html + */ + public function deleteRole(array $params = []) + { + $name = $this->extractArgument($params, 'name'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\DeleteRole'); + $endpoint->setParams($params); + $endpoint->setName($name); + + return $this->performRequest($endpoint); + } + /** + * $params['name'] = (string) Role-mapping name + * $params['refresh'] = (enum) If `true` (the default) 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` then do nothing with refreshes. (Options = true,false,wait_for) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role-mapping.html + */ + public function deleteRoleMapping(array $params = []) + { + $name = $this->extractArgument($params, 'name'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\DeleteRoleMapping'); + $endpoint->setParams($params); + $endpoint->setName($name); + + return $this->performRequest($endpoint); + } + /** + * $params['username'] = (string) username + * $params['refresh'] = (enum) If `true` (the default) 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` then do nothing with refreshes. (Options = true,false,wait_for) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-user.html + */ + public function deleteUser(array $params = []) + { + $username = $this->extractArgument($params, 'username'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\DeleteUser'); + $endpoint->setParams($params); + $endpoint->setUsername($username); + + return $this->performRequest($endpoint); + } + /** + * $params['username'] = (string) The username of the user to disable + * $params['refresh'] = (enum) If `true` (the default) 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` then do nothing with refreshes. (Options = true,false,wait_for) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-disable-user.html + */ + public function disableUser(array $params = []) + { + $username = $this->extractArgument($params, 'username'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\DisableUser'); + $endpoint->setParams($params); + $endpoint->setUsername($username); + + return $this->performRequest($endpoint); + } + /** + * $params['username'] = (string) The username of the user to enable + * $params['refresh'] = (enum) If `true` (the default) 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` then do nothing with refreshes. (Options = true,false,wait_for) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-enable-user.html + */ + public function enableUser(array $params = []) + { + $username = $this->extractArgument($params, 'username'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\EnableUser'); + $endpoint->setParams($params); + $endpoint->setUsername($username); + + return $this->performRequest($endpoint); + } + /** + * $params['id'] = (string) API key id of the API key to be retrieved + * $params['name'] = (string) API key name of the API key to be retrieved + * $params['username'] = (string) user name of the user who created this API key to be retrieved + * $params['realm_name'] = (string) realm name of the user who created this API key to be retrieved + * $params['owner'] = (boolean) flag to query API keys owned by the currently authenticated user (Default = false) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-api-key.html + */ + public function getApiKey(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\GetApiKey'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-builtin-privileges.html + */ + public function getBuiltinPrivileges(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\GetBuiltinPrivileges'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * $params['application'] = (string) Application name + * $params['name'] = (string) Privilege name + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-privileges.html + */ + public function getPrivileges(array $params = []) + { + $application = $this->extractArgument($params, 'application'); + $name = $this->extractArgument($params, 'name'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\GetPrivileges'); + $endpoint->setParams($params); + $endpoint->setApplication($application); + $endpoint->setName($name); + + return $this->performRequest($endpoint); + } + /** + * $params['name'] = (string) Role name + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role.html + */ + public function getRole(array $params = []) + { + $name = $this->extractArgument($params, 'name'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\GetRole'); + $endpoint->setParams($params); + $endpoint->setName($name); + + return $this->performRequest($endpoint); + } + /** + * $params['name'] = (string) Role-Mapping name + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role-mapping.html + */ + public function getRoleMapping(array $params = []) + { + $name = $this->extractArgument($params, 'name'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\GetRoleMapping'); + $endpoint->setParams($params); + $endpoint->setName($name); + + return $this->performRequest($endpoint); + } + /** + * $params['body'] = (array) The token request to get (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-token.html + */ + public function getToken(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\GetToken'); + $endpoint->setParams($params); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['username'] = (list) A comma-separated list of usernames + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user.html + */ + public function getUser(array $params = []) + { + $username = $this->extractArgument($params, 'username'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\GetUser'); + $endpoint->setParams($params); + $endpoint->setUsername($username); + + return $this->performRequest($endpoint); + } + /** + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-privileges.html + */ + public function getUserPrivileges(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\GetUserPrivileges'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * $params['user'] = (string) Username + * $params['body'] = (array) The privileges to test (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges.html + */ + public function hasPrivileges(array $params = []) + { + $user = $this->extractArgument($params, 'user'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\HasPrivileges'); + $endpoint->setParams($params); + $endpoint->setUser($user); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + public function invalidateApiKey(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\InvalidateApiKey'); + $endpoint->setParams($params); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['body'] = (array) The token to invalidate (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-token.html + */ + public function invalidateToken(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\InvalidateToken'); + $endpoint->setParams($params); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['refresh'] = (enum) If `true` (the default) 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` then do nothing with refreshes. (Options = true,false,wait_for) + * $params['body'] = (array) The privilege(s) to add (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-privileges.html + */ + public function putPrivileges(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\PutPrivileges'); + $endpoint->setParams($params); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['name'] = (string) Role name + * $params['refresh'] = (enum) If `true` (the default) 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` then do nothing with refreshes. (Options = true,false,wait_for) + * $params['body'] = (array) The role to add (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role.html + */ + public function putRole(array $params = []) + { + $name = $this->extractArgument($params, 'name'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\PutRole'); + $endpoint->setParams($params); + $endpoint->setName($name); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['name'] = (string) Role-mapping name + * $params['refresh'] = (enum) If `true` (the default) 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` then do nothing with refreshes. (Options = true,false,wait_for) + * $params['body'] = (array) The role mapping to add (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role-mapping.html + */ + public function putRoleMapping(array $params = []) + { + $name = $this->extractArgument($params, 'name'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\PutRoleMapping'); + $endpoint->setParams($params); + $endpoint->setName($name); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['username'] = (string) The username of the User + * $params['refresh'] = (enum) If `true` (the default) 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` then do nothing with refreshes. (Options = true,false,wait_for) + * $params['body'] = (array) The user to add (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-user.html + */ + public function putUser(array $params = []) + { + $username = $this->extractArgument($params, 'username'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\PutUser'); + $endpoint->setParams($params); + $endpoint->setUsername($username); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } +} diff --git a/src/Elasticsearch/Namespaces/SlmNamespace.php b/src/Elasticsearch/Namespaces/SlmNamespace.php new file mode 100644 index 000000000..017e9e84b --- /dev/null +++ b/src/Elasticsearch/Namespaces/SlmNamespace.php @@ -0,0 +1,171 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class SlmNamespace extends AbstractNamespace +{ + + /** + * $params['policy_id'] = (string) The id of the snapshot lifecycle policy to remove + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-delete-policy.html + */ + public function deleteLifecycle(array $params = []) + { + $policy_id = $this->extractArgument($params, 'policy_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Slm\DeleteLifecycle'); + $endpoint->setParams($params); + $endpoint->setPolicyId($policy_id); + + return $this->performRequest($endpoint); + } + /** + * $params['policy_id'] = (string) The id of the snapshot lifecycle policy to be executed + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-execute-lifecycle.html + */ + public function executeLifecycle(array $params = []) + { + $policy_id = $this->extractArgument($params, 'policy_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Slm\ExecuteLifecycle'); + $endpoint->setParams($params); + $endpoint->setPolicyId($policy_id); + + return $this->performRequest($endpoint); + } + /** + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-execute-retention.html + */ + public function executeRetention(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Slm\ExecuteRetention'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * $params['policy_id'] = (list) Comma-separated list of snapshot lifecycle policies to retrieve + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-get-policy.html + */ + public function getLifecycle(array $params = []) + { + $policy_id = $this->extractArgument($params, 'policy_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Slm\GetLifecycle'); + $endpoint->setParams($params); + $endpoint->setPolicyId($policy_id); + + return $this->performRequest($endpoint); + } + /** + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/slm-api-get-stats.html + */ + public function getStats(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Slm\GetStats'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-get-status.html + */ + public function getStatus(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Slm\GetStatus'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * $params['policy_id'] = (string) The id of the snapshot lifecycle policy + * $params['body'] = (array) The snapshot lifecycle policy definition to register + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-put-policy.html + */ + public function putLifecycle(array $params = []) + { + $policy_id = $this->extractArgument($params, 'policy_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Slm\PutLifecycle'); + $endpoint->setParams($params); + $endpoint->setPolicyId($policy_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-start.html + */ + public function start(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Slm\Start'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-stop.html + */ + public function stop(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Slm\Stop'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } +} diff --git a/src/Elasticsearch/Namespaces/SqlNamespace.php b/src/Elasticsearch/Namespaces/SqlNamespace.php new file mode 100644 index 000000000..10b8b35d8 --- /dev/null +++ b/src/Elasticsearch/Namespaces/SqlNamespace.php @@ -0,0 +1,69 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class SqlNamespace extends AbstractNamespace +{ + + public function clearCursor(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Sql\ClearCursor'); + $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['body'] = (array) Use the `query` element to start a query. Use the `cursor` element to continue a query. (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-rest-overview.html + */ + public function query(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Sql\Query'); + $endpoint->setParams($params); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['body'] = (array) Specify the query in the `query` element. (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-translate.html + */ + public function translate(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Sql\Translate'); + $endpoint->setParams($params); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } +} diff --git a/src/Elasticsearch/Namespaces/SslNamespace.php b/src/Elasticsearch/Namespaces/SslNamespace.php new file mode 100644 index 000000000..83f1fb6e8 --- /dev/null +++ b/src/Elasticsearch/Namespaces/SslNamespace.php @@ -0,0 +1,36 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class SslNamespace extends AbstractNamespace +{ + + /** + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-ssl.html + */ + public function certificates(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ssl\Certificates'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } +} diff --git a/src/Elasticsearch/Namespaces/TransformNamespace.php b/src/Elasticsearch/Namespaces/TransformNamespace.php new file mode 100644 index 000000000..b34b44fac --- /dev/null +++ b/src/Elasticsearch/Namespaces/TransformNamespace.php @@ -0,0 +1,179 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class TransformNamespace extends AbstractNamespace +{ + + /** + * $params['transform_id'] = (string) The id of the transform to delete + * $params['force'] = (boolean) When `true`, the transform is deleted regardless of its current state. The default value is `false`, meaning that the transform must be `stopped` before it can be deleted. + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-transform.html + */ + public function deleteTransform(array $params = []) + { + $transform_id = $this->extractArgument($params, 'transform_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Transform\DeleteTransform'); + $endpoint->setParams($params); + $endpoint->setTransformId($transform_id); + + return $this->performRequest($endpoint); + } + /** + * $params['transform_id'] = (string) The id or comma delimited list of id expressions of the transforms to get, '_all' or '*' implies get 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) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform.html + */ + public function getTransform(array $params = []) + { + $transform_id = $this->extractArgument($params, 'transform_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Transform\GetTransform'); + $endpoint->setParams($params); + $endpoint->setTransformId($transform_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'] = (number) skips a number of transform stats, defaults to 0 + * $params['size'] = (number) specifies a max number of transform stats 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) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform-stats.html + */ + public function getTransformStats(array $params = []) + { + $transform_id = $this->extractArgument($params, 'transform_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Transform\GetTransformStats'); + $endpoint->setParams($params); + $endpoint->setTransformId($transform_id); + + return $this->performRequest($endpoint); + } + public function previewTransform(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Transform\PreviewTransform'); + $endpoint->setParams($params); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['transform_id'] = (string) The id of the new transform. + * $params['defer_validation'] = (boolean) If validations should be deferred until transform starts, defaults to false. + * $params['body'] = (array) The transform definition (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-transform.html + */ + public function putTransform(array $params = []) + { + $transform_id = $this->extractArgument($params, 'transform_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Transform\PutTransform'); + $endpoint->setParams($params); + $endpoint->setTransformId($transform_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['transform_id'] = (string) The id of the transform to start + * $params['timeout'] = (time) Controls the time to wait for the transform to start + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/start-transform.html + */ + public function startTransform(array $params = []) + { + $transform_id = $this->extractArgument($params, 'transform_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Transform\StartTransform'); + $endpoint->setParams($params); + $endpoint->setTransformId($transform_id); + + return $this->performRequest($endpoint); + } + /** + * $params['transform_id'] = (string) The id of the transform to stop + * $params['force'] = (boolean) Whether to force stop a failed transform or not. Default to false + * $params['wait_for_completion'] = (boolean) Whether to wait for the transform to fully stop before returning or not. Default to false + * $params['timeout'] = (time) Controls the time to wait until the transform has stopped. Default to 30 seconds + * $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['wait_for_checkpoint'] = (boolean) Whether to wait for the transform to reach a checkpoint before stopping. Default to false + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-transform.html + */ + public function stopTransform(array $params = []) + { + $transform_id = $this->extractArgument($params, 'transform_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Transform\StopTransform'); + $endpoint->setParams($params); + $endpoint->setTransformId($transform_id); + + return $this->performRequest($endpoint); + } + /** + * $params['transform_id'] = (string) The id of the transform. + * $params['defer_validation'] = (boolean) If validations should be deferred until transform starts, defaults to false. + * $params['body'] = (array) The update transform definition (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-transform.html + */ + public function updateTransform(array $params = []) + { + $transform_id = $this->extractArgument($params, 'transform_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Transform\UpdateTransform'); + $endpoint->setParams($params); + $endpoint->setTransformId($transform_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } +} diff --git a/src/Elasticsearch/Namespaces/WatcherNamespace.php b/src/Elasticsearch/Namespaces/WatcherNamespace.php new file mode 100644 index 000000000..8ba519c2d --- /dev/null +++ b/src/Elasticsearch/Namespaces/WatcherNamespace.php @@ -0,0 +1,210 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class WatcherNamespace extends AbstractNamespace +{ + + /** + * $params['watch_id'] = (string) Watch ID (Required) + * $params['action_id'] = (list) A comma-separated list of the action ids to be acked + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-ack-watch.html + */ + public function ackWatch(array $params = []) + { + $watch_id = $this->extractArgument($params, 'watch_id'); + $action_id = $this->extractArgument($params, 'action_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Watcher\AckWatch'); + $endpoint->setParams($params); + $endpoint->setWatchId($watch_id); + $endpoint->setActionId($action_id); + + return $this->performRequest($endpoint); + } + /** + * $params['watch_id'] = (string) Watch ID + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-activate-watch.html + */ + public function activateWatch(array $params = []) + { + $watch_id = $this->extractArgument($params, 'watch_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Watcher\ActivateWatch'); + $endpoint->setParams($params); + $endpoint->setWatchId($watch_id); + + return $this->performRequest($endpoint); + } + /** + * $params['watch_id'] = (string) Watch ID + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-deactivate-watch.html + */ + public function deactivateWatch(array $params = []) + { + $watch_id = $this->extractArgument($params, 'watch_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Watcher\DeactivateWatch'); + $endpoint->setParams($params); + $endpoint->setWatchId($watch_id); + + return $this->performRequest($endpoint); + } + /** + * $params['id'] = (string) Watch ID + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-delete-watch.html + */ + public function deleteWatch(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Watcher\DeleteWatch'); + $endpoint->setParams($params); + $endpoint->setId($id); + + return $this->performRequest($endpoint); + } + /** + * $params['id'] = (string) Watch ID + * $params['debug'] = (boolean) indicates whether the watch should execute in debug mode + * $params['body'] = (array) Execution control + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-execute-watch.html + */ + public function executeWatch(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Watcher\ExecuteWatch'); + $endpoint->setParams($params); + $endpoint->setId($id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['id'] = (string) Watch ID + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-get-watch.html + */ + public function getWatch(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Watcher\GetWatch'); + $endpoint->setParams($params); + $endpoint->setId($id); + + return $this->performRequest($endpoint); + } + /** + * $params['id'] = (string) Watch ID + * $params['active'] = (boolean) Specify whether the watch is in/active by default + * $params['version'] = (number) Explicit version number for concurrency control + * $params['if_seq_no'] = (number) only update the watch if the last operation that has changed the watch has the specified sequence number + * $params['if_primary_term'] = (number) only update the watch if the last operation that has changed the watch has the specified primary term + * $params['body'] = (array) The watch + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-put-watch.html + */ + public function putWatch(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Watcher\PutWatch'); + $endpoint->setParams($params); + $endpoint->setId($id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-start.html + */ + public function start(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Watcher\Start'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * $params['metric'] = (list) Controls what additional stat metrics should be include in the response + * $params['emit_stacktraces'] = (boolean) Emits stack traces of currently running watches + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stats.html + */ + public function stats(array $params = []) + { + $metric = $this->extractArgument($params, 'metric'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Watcher\Stats'); + $endpoint->setParams($params); + $endpoint->setMetric($metric); + + return $this->performRequest($endpoint); + } + /** + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stop.html + */ + public function stop(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Watcher\Stop'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } +} diff --git a/src/Elasticsearch/Namespaces/XpackNamespace.php b/src/Elasticsearch/Namespaces/XpackNamespace.php new file mode 100644 index 000000000..ab158a241 --- /dev/null +++ b/src/Elasticsearch/Namespaces/XpackNamespace.php @@ -0,0 +1,53 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class XpackNamespace extends AbstractNamespace +{ + + /** + * $params['categories'] = (list) Comma-separated list of info categories. Can be any of: build, license, features + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/info-api.html + */ + public function info(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Xpack\Info'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * $params['master_timeout'] = (time) Specify timeout for watch write operation + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/usage-api.html + */ + public function usage(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Xpack\Usage'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } +} diff --git a/util/ClientEndpoint.php b/util/ClientEndpoint.php index 507bcb4df..e54a8963b 100644 --- a/util/ClientEndpoint.php +++ b/util/ClientEndpoint.php @@ -40,7 +40,7 @@ public function renderClass(): string if (empty($name)) { continue; } - $useNamespace .= sprintf("use Elasticsearch\Namespaces\%sNamespace;\n", ucfirst($name)); + $useNamespace .= sprintf("use Elasticsearch\Namespaces\%sNamespace;\n", NamespaceEndpoint::normalizeName($name)); } $class = str_replace(':use-namespaces', $useNamespace, $class); @@ -50,9 +50,10 @@ public function renderClass(): string if (empty($name)) { continue; } + $normNamespace = NamespaceEndpoint::normalizeName($name); $newName = file_get_contents(self::NEW_NAMESPACE_TEMPLATE); - $newName = str_replace(':namespace', ucfirst($name) . 'Namespace', $newName); - $newName = str_replace(':name', $name, $newName); + $newName = str_replace(':namespace',$normNamespace . 'Namespace', $newName); + $newName = str_replace(':name', lcfirst($normNamespace), $newName); $newNamespace .= $newName; } $class = str_replace(':new-namespaces', $newNamespace, $class); @@ -63,9 +64,10 @@ public function renderClass(): string if (empty($name)) { continue; } + $normNamespace = NamespaceEndpoint::normalizeName($name); $prop = file_get_contents(self::PROPERTY_CLASS_TEMPLATE); - $prop = str_replace(':namespace', ucfirst($name), $prop); - $prop = str_replace(':var_namespace', $name, $prop); + $prop = str_replace(':namespace', $normNamespace, $prop); + $prop = str_replace(':var_namespace', lcfirst($normNamespace), $prop); $properties .= $prop . "\n"; } $class = str_replace(':namespace_properties', $properties, $class); @@ -83,9 +85,10 @@ public function renderClass(): string if (empty($name)) { continue; } + $normNamespace = NamespaceEndpoint::normalizeName($name); $func = file_get_contents(self::NAMESPACE_FUNC_TEMPLATE); - $func = str_replace(':namespace', ucfirst($name) . 'Namespace', $func); - $func = str_replace(':name', $name, $func); + $func = str_replace(':namespace', $normNamespace . 'Namespace', $func); + $func = str_replace(':name', lcfirst($normNamespace), $func); $functions .= $func; } $class = str_replace(':functions', $functions, $class); diff --git a/util/Endpoint.php b/util/Endpoint.php index a0bf96713..9cbf425a9 100644 --- a/util/Endpoint.php +++ b/util/Endpoint.php @@ -9,6 +9,7 @@ namespace Elasticsearch\Util; use Exception; +use JsonException; class Endpoint { @@ -128,7 +129,6 @@ public function renderClass(): string } else { $class = file_get_contents(self::ENDPOINT_CLASS_TEMPLATE); } - $class = str_replace( ':uri', $this->extractUrl($this->content['url']['paths']), @@ -142,17 +142,18 @@ public function renderClass(): string $class = str_replace( ':namespace', $this->namespace === '' - ? ucfirst($this->namespace) - : '\\' . ucfirst($this->namespace), + ? $this->normalizeName($this->namespace) + : '\\' . $this->normalizeName($this->namespace), $class ); + // Set the HTTP method + $action = $this->getMethod(); if (!empty($this->content['body']) && - ($this->getMethod() === ['GET', 'POST'] || $this->getMethod() === ['POST', 'GET'])) { + ($action === ['GET', 'POST'] || $action === ['POST', 'GET'])) { $method = 'isset($this->body) ? \'POST\' : \'GET\''; } else { - $m = $this->getMethod(); - $method = "'{$m[0]}'"; + $method = sprintf("'%s'", reset($action)); } $class = str_replace(':method', $method, $class); @@ -187,7 +188,11 @@ public function renderClass(): string public function getMethod(): array { - return $this->content['url']['paths'][0]['methods']; + $methods = $this->content['url']['paths'][0]['methods']; + foreach ($this->content['url']['paths'] as $path) { + $methods = array_intersect($methods, $path['methods']); + } + return $methods; } private function extractParameters(): string diff --git a/util/GenerateEndpoints.php b/util/GenerateEndpoints.php index 96b33c6db..532f31f50 100644 --- a/util/GenerateEndpoints.php +++ b/util/GenerateEndpoints.php @@ -46,11 +46,13 @@ $git->run('checkout', [$version]); $result = $git->run( 'ls-files', - [ "rest-api-spec/src/main/resources/rest-api-spec/api/*.json" ] + [ + "rest-api-spec/src/main/resources/rest-api-spec/api/*.json", + "x-pack/plugin/src/test/resources/rest-api-spec/api/*.json" + ] ); $files = explode("\n", $result); - -$outputDir = __DIR__ . '/output'; +$outputDir = __DIR__ . "/output/$ver"; // Remove the output directory printf ("Removing %s folder\n", $outputDir); @@ -73,7 +75,7 @@ $endpoint = new Endpoint($file, $git->run('show', [':' . trim($file)]), $ver); - $dir = $endpointDir . ucfirst($endpoint->namespace); + $dir = $endpointDir . NamespaceEndpoint::normalizeName($endpoint->namespace); if (!file_exists($dir)) { mkdir($dir); } @@ -114,7 +116,7 @@ $namespace->addEndpoint($ep); } file_put_contents( - $namespaceDir . ucfirst($name) . 'Namespace.php', + $namespaceDir . $namespace->getNamespaceName() . 'Namespace.php', $namespace->renderClass() ); $countNamespace++; @@ -128,7 +130,7 @@ function print_usage_msg(): void { printf("Usage: php %s \n", basename(__FILE__)); - printf("where is the Elasticsearch version to check. The version must be >= 7.4.0.\n"); + printf("where is the Elasticsearch version to check (version must be >= 7.4.0).\n"); } // Remove directory recursively diff --git a/util/NamespaceEndpoint.php b/util/NamespaceEndpoint.php index 373e13fce..b1dc1f59f 100644 --- a/util/NamespaceEndpoint.php +++ b/util/NamespaceEndpoint.php @@ -35,7 +35,7 @@ public function renderClass(): string throw new Exception("No endpoints has been added. I cannot render the class"); } $class = file_get_contents(static::NAMESPACE_CLASS_TEMPLATE); - $class = str_replace(':namespace', ucfirst($this->name) . 'Namespace', $class); + $class = str_replace(':namespace', $this->getNamespaceName() . 'Namespace', $class); $endpoints = ''; foreach ($this->endpoints as $endpoint) { @@ -101,16 +101,21 @@ protected function renderEndpoint(Endpoint $endpoint): string if (empty($endpoint->namespace)) { $endpointClass = $endpoint->getClassName(); } else { - $endpointClass = ucfirst($endpoint->namespace) . '\\' . $endpoint->getClassName(); + $endpointClass = NamespaceEndpoint::normalizeName($endpoint->namespace) . '\\' . $endpoint->getClassName(); } return str_replace(':EndpointClass', $endpointClass, $code); } - protected function normalizeName(string $name): string + public static function normalizeName(string $name): string { return str_replace('_', '', ucwords($name, '_')); } + public function getNamespaceName(): string + { + return $this->normalizeName($this->name); + } + protected function getEndpointName(string $name): string { return preg_replace_callback( diff --git a/util/output/7.6.1/Client.php b/util/output/7.6.1/Client.php new file mode 100644 index 000000000..ac455be33 --- /dev/null +++ b/util/output/7.6.1/Client.php @@ -0,0 +1,1529 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Client +{ + const VERSION = '7.6.1'; + + /** + * @var Transport + */ + public $transport; + + /** + * @var array + */ + protected $params; + + /** + * @var callable + */ + protected $endpoints; + + /** + * @var NamespaceBuilderInterface[] + */ + protected $registeredNamespaces = []; + + /** + * @var CatNamespace + */ + protected $cat; + + /** + * @var ClusterNamespace + */ + protected $cluster; + + /** + * @var IndicesNamespace + */ + protected $indices; + + /** + * @var IngestNamespace + */ + protected $ingest; + + /** + * @var NodesNamespace + */ + protected $nodes; + + /** + * @var SnapshotNamespace + */ + protected $snapshot; + + /** + * @var TasksNamespace + */ + protected $tasks; + + /** + * @var CcrNamespace + */ + protected $ccr; + + /** + * @var DataFrameTransformDeprecatedNamespace + */ + protected $dataFrameTransformDeprecated; + + /** + * @var EnrichNamespace + */ + protected $enrich; + + /** + * @var GraphNamespace + */ + protected $graph; + + /** + * @var IlmNamespace + */ + protected $ilm; + + /** + * @var LicenseNamespace + */ + protected $license; + + /** + * @var MigrationNamespace + */ + protected $migration; + + /** + * @var MlNamespace + */ + protected $ml; + + /** + * @var MonitoringNamespace + */ + protected $monitoring; + + /** + * @var RollupNamespace + */ + protected $rollup; + + /** + * @var SecurityNamespace + */ + protected $security; + + /** + * @var SlmNamespace + */ + protected $slm; + + /** + * @var SqlNamespace + */ + protected $sql; + + /** + * @var SslNamespace + */ + protected $ssl; + + /** + * @var TransformNamespace + */ + protected $transform; + + /** + * @var WatcherNamespace + */ + protected $watcher; + + /** + * @var XpackNamespace + */ + protected $xpack; + + + /** + * Client constructor + * + * @param Transport $transport + * @param callable $endpoint + * @param AbstractNamespace[] $registeredNamespaces + */ + public function __construct(Transport $transport, callable $endpoint, array $registeredNamespaces) + { + $this->transport = $transport; + $this->endpoints = $endpoint; + $this->cat = new CatNamespace($transport, $endpoint); + $this->cluster = new ClusterNamespace($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->ccr = new CcrNamespace($transport, $endpoint); + $this->dataFrameTransformDeprecated = new DataFrameTransformDeprecatedNamespace($transport, $endpoint); + $this->enrich = new EnrichNamespace($transport, $endpoint); + $this->graph = new GraphNamespace($transport, $endpoint); + $this->ilm = new IlmNamespace($transport, $endpoint); + $this->license = new LicenseNamespace($transport, $endpoint); + $this->migration = new MigrationNamespace($transport, $endpoint); + $this->ml = new MlNamespace($transport, $endpoint); + $this->monitoring = new MonitoringNamespace($transport, $endpoint); + $this->rollup = new RollupNamespace($transport, $endpoint); + $this->security = new SecurityNamespace($transport, $endpoint); + $this->slm = new SlmNamespace($transport, $endpoint); + $this->sql = new SqlNamespace($transport, $endpoint); + $this->ssl = new SslNamespace($transport, $endpoint); + $this->transform = new TransformNamespace($transport, $endpoint); + $this->watcher = new WatcherNamespace($transport, $endpoint); + $this->xpack = new XpackNamespace($transport, $endpoint); + + $this->registeredNamespaces = $registeredNamespaces; + } + + /** + * $params['index'] = (string) Default index for items which don't provide one + * $params['type'] = DEPRECATED (string) Default document type 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['body'] = (array) The operation definition and data (action-data pairs), separated by newlines (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-bulk.html + */ + public function bulk(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + $type = $this->extractArgument($params, 'type'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Bulk'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + $endpoint->setType($type); + $endpoint->setBody($body); + + 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 + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-body.html#_clear_scroll_api + */ + public function clearScroll(array $params = []) + { + $scroll_id = $this->extractArgument($params, 'scroll_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('ClearScroll'); + $endpoint->setParams($params); + $endpoint->setScrollId($scroll_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (list) A comma-separated list of indices to restrict the results + * $params['type'] = DEPRECATED (list) A comma-separated list of types 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,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) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/search-count.html + */ + public function count(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + $type = $this->extractArgument($params, 'type'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Count'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + $endpoint->setType($type); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['id'] = (string) Document ID (Required) + * $params['index'] = (string) The name of the index (Required) + * $params['type'] = DEPRECATED (string) The type of the document + * $params['wait_for_active_shards'] = (string) Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) + * $params['refresh'] = (enum) If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. (Options = true,false,wait_for) + * $params['routing'] = (string) Specific routing value + * $params['timeout'] = (time) Explicit operation timeout + * $params['version'] = (number) Explicit version number for concurrency control + * $params['version_type'] = (enum) Specific version type (Options = internal,external,external_gte) + * $params['pipeline'] = (string) The pipeline id to preprocess incoming documents with + * $params['body'] = (array) The document (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html + */ + public function create(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + $index = $this->extractArgument($params, 'index'); + $type = $this->extractArgument($params, 'type'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Create'); + $endpoint->setParams($params); + $endpoint->setId($id); + $endpoint->setIndex($index); + $endpoint->setType($type); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['id'] = (string) The document ID (Required) + * $params['index'] = (string) The name of the index (Required) + * $params['type'] = DEPRECATED (string) The type of the document + * $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) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete.html + */ + public function delete(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + $index = $this->extractArgument($params, 'index'); + $type = $this->extractArgument($params, 'type'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Delete'); + $endpoint->setParams($params); + $endpoint->setId($id); + $endpoint->setIndex($index); + $endpoint->setType($type); + + 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['type'] = DEPRECATED (list) A comma-separated list of document types to search; leave empty to perform the operation on all types + * $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,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 + * $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) The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. (Default = 1) + * $params['body'] = (array) The search definition using the Query DSL (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete-by-query.html + */ + public function deleteByQuery(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + $type = $this->extractArgument($params, 'type'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('DeleteByQuery'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + $endpoint->setType($type); + $endpoint->setBody($body); + + 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) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete-by-query.html + */ + public function deleteByQueryRethrottle(array $params = []) + { + $task_id = $this->extractArgument($params, 'task_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('DeleteByQueryRethrottle'); + $endpoint->setParams($params); + $endpoint->setTaskId($task_id); + + return $this->performRequest($endpoint); + } + /** + * $params['id'] = (string) Script ID + * $params['timeout'] = (time) Explicit operation timeout + * $params['master_timeout'] = (time) Specify timeout for connection to master + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html + */ + public function deleteScript(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('DeleteScript'); + $endpoint->setParams($params); + $endpoint->setId($id); + + return $this->performRequest($endpoint); + } + /** + * $params['id'] = (string) The document ID (Required) + * $params['index'] = (string) The name of the index (Required) + * $params['type'] = DEPRECATED (string) The type of the document (use `_all` to fetch the first document matching the ID across all types) + * $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) + * + * @param array $params Associative array of parameters + * @return bool + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html + */ + public function exists(array $params = []): bool + { + $id = $this->extractArgument($params, 'id'); + $index = $this->extractArgument($params, 'index'); + $type = $this->extractArgument($params, 'type'); + + // manually make this verbose so we can check status code + $params['client']['verbose'] = true; + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Exists'); + $endpoint->setParams($params); + $endpoint->setId($id); + $endpoint->setIndex($index); + $endpoint->setType($type); + + return BooleanRequestWrapper::performRequest($endpoint, $this->transport); + } + /** + * $params['id'] = (string) The document ID (Required) + * $params['index'] = (string) The name of the index (Required) + * $params['type'] = DEPRECATED (string) The type of the document; deprecated and optional starting with 7.0 + * $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) + * + * @param array $params Associative array of parameters + * @return bool + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html + */ + public function existsSource(array $params = []): bool + { + $id = $this->extractArgument($params, 'id'); + $index = $this->extractArgument($params, 'index'); + $type = $this->extractArgument($params, 'type'); + + // manually make this verbose so we can check status code + $params['client']['verbose'] = true; + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('ExistsSource'); + $endpoint->setParams($params); + $endpoint->setId($id); + $endpoint->setIndex($index); + $endpoint->setType($type); + + return BooleanRequestWrapper::performRequest($endpoint, $this->transport); + } + /** + * $params['id'] = (string) The document ID (Required) + * $params['index'] = (string) The name of the index (Required) + * $params['type'] = DEPRECATED (string) The type of the document + * $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 + * $params['body'] = (array) The query definition using the Query DSL + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/search-explain.html + */ + public function explain(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + $index = $this->extractArgument($params, 'index'); + $type = $this->extractArgument($params, 'type'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Explain'); + $endpoint->setParams($params); + $endpoint->setId($id); + $endpoint->setIndex($index); + $endpoint->setType($type); + $endpoint->setBody($body); + + 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,none,all) (Default = open) + * $params['include_unmapped'] = (boolean) Indicates whether unmapped fields should be included in the response. (Default = false) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/search-field-caps.html + */ + public function fieldCaps(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('FieldCaps'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + + return $this->performRequest($endpoint); + } + /** + * $params['id'] = (string) The document ID (Required) + * $params['index'] = (string) The name of the index (Required) + * $params['type'] = DEPRECATED (string) The type of the document (use `_all` to fetch the first document matching the ID across all types) + * $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) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html + */ + public function get(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + $index = $this->extractArgument($params, 'index'); + $type = $this->extractArgument($params, 'type'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Get'); + $endpoint->setParams($params); + $endpoint->setId($id); + $endpoint->setIndex($index); + $endpoint->setType($type); + + return $this->performRequest($endpoint); + } + /** + * $params['id'] = (string) Script ID + * $params['master_timeout'] = (time) Specify timeout for connection to master + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html + */ + public function getScript(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('GetScript'); + $endpoint->setParams($params); + $endpoint->setId($id); + + return $this->performRequest($endpoint); + } + /** + * + * @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 = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('GetScriptContext'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * + * @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 = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('GetScriptLanguages'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * $params['id'] = (string) The document ID (Required) + * $params['index'] = (string) The name of the index (Required) + * $params['type'] = DEPRECATED (string) The type of the document; deprecated and optional starting with 7.0 + * $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) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html + */ + public function getSource(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + $index = $this->extractArgument($params, 'index'); + $type = $this->extractArgument($params, 'type'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('GetSource'); + $endpoint->setParams($params); + $endpoint->setId($id); + $endpoint->setIndex($index); + $endpoint->setType($type); + + return $this->performRequest($endpoint); + } + /** + * $params['id'] = (string) Document ID + * $params['index'] = (string) The name of the index (Required) + * $params['type'] = DEPRECATED (string) The type of the document + * $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['body'] = (array) The document (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html + */ + public function index(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + $index = $this->extractArgument($params, 'index'); + $type = $this->extractArgument($params, 'type'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Index'); + $endpoint->setParams($params); + $endpoint->setId($id); + $endpoint->setIndex($index); + $endpoint->setType($type); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html + */ + public function info(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Info'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (string) The name of the index + * $params['type'] = DEPRECATED (string) The type of the document + * $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) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-get.html + */ + public function mget(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + $type = $this->extractArgument($params, 'type'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Mget'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + $endpoint->setType($type); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (list) A comma-separated list of index names to use as default + * $params['type'] = DEPRECATED (list) A comma-separated list of document types 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 it's rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint. (Default = 128) + * $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) + * $params['body'] = (array) The request definitions (metadata-search request definition pairs), separated by newlines (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/search-multi-search.html + */ + public function msearch(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + $type = $this->extractArgument($params, 'type'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Msearch'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + $endpoint->setType($type); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (list) A comma-separated list of index names to use as default + * $params['type'] = DEPRECATED (list) A comma-separated list of document types 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) + * $params['body'] = (array) The request definitions (metadata-search request definition pairs), separated by newlines (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-multi-search.html + */ + public function msearchTemplate(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + $type = $this->extractArgument($params, 'type'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('MsearchTemplate'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + $endpoint->setType($type); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (string) The index in which the document resides. + * $params['type'] = DEPRECATED (string) The type of the document. + * $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) + * $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 + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-termvectors.html + */ + public function mtermvectors(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + $type = $this->extractArgument($params, 'type'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('MTermVectors'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + $endpoint->setType($type); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * + * @param array $params Associative array of parameters + * @return bool + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html + */ + public function ping(array $params = []): bool + { + + // manually make this verbose so we can check status code + $params['client']['verbose'] = true; + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ping'); + $endpoint->setParams($params); + + return BooleanRequestWrapper::performRequest($endpoint, $this->transport); + } + /** + * $params['id'] = (string) Script ID (Required) + * $params['context'] = (string) Script context + * $params['timeout'] = (time) Explicit operation timeout + * $params['master_timeout'] = (time) Specify timeout for connection to master + * $params['body'] = (array) The document (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html + */ + public function putScript(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + $context = $this->extractArgument($params, 'context'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('PutScript'); + $endpoint->setParams($params); + $endpoint->setId($id); + $endpoint->setContext($context); + $endpoint->setBody($body); + + 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,none,all) (Default = open) + * $params['search_type'] = (enum) Search operation type (Options = query_then_fetch,dfs_query_then_fetch) + * $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 + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/search-rank-eval.html + * + * @note This API is EXPERIMENTAL and may be changed or removed completely in a future release + * + */ + public function rankEval(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('RankEval'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + $endpoint->setBody($body); + + 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) The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. (Default = 1) + * $params['max_docs'] = (number) Maximum number of documents to process (default: all documents) + * $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 + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-reindex.html + */ + public function reindex(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Reindex'); + $endpoint->setParams($params); + $endpoint->setBody($body); + + 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) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-reindex.html + */ + public function reindexRethrottle(array $params = []) + { + $task_id = $this->extractArgument($params, 'task_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('ReindexRethrottle'); + $endpoint->setParams($params); + $endpoint->setTaskId($task_id); + + return $this->performRequest($endpoint); + } + /** + * $params['id'] = (string) The id of the stored search template + * $params['body'] = (array) The search definition template and its params + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html#_validating_templates + */ + public function renderSearchTemplate(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('RenderSearchTemplate'); + $endpoint->setParams($params); + $endpoint->setId($id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['body'] = (array) The script to execute + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/painless/master/painless-execute-api.html + * + * @note This API is EXPERIMENTAL and may be changed or removed completely in a future release + * + */ + public function scriptsPainlessExecute(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('ScriptsPainlessExecute'); + $endpoint->setParams($params); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $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['body'] = (array) The scroll ID if not passed by URL or query parameter. + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-body.html#request-body-search-scroll + */ + public function scroll(array $params = []) + { + $scroll_id = $this->extractArgument($params, 'scroll_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Scroll'); + $endpoint->setParams($params); + $endpoint->setScrollId($scroll_id); + $endpoint->setBody($body); + + 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['type'] = DEPRECATED (list) A comma-separated list of document types to search; leave empty to perform the operation on all types + * $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,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 it's rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint. (Default = 128) + * $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['body'] = (array) The search definition using the Query DSL + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/search-search.html + */ + public function search(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + $type = $this->extractArgument($params, 'type'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Search'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + $endpoint->setType($type); + $endpoint->setBody($body); + + 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 master 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,none,all) (Default = open) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/search-shards.html + */ + public function searchShards(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('SearchShards'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + + 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['type'] = DEPRECATED (list) A comma-separated list of document types to search; leave empty to perform the operation on all types + * $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,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) + * $params['body'] = (array) The search definition template and its params (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html + */ + public function searchTemplate(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + $type = $this->extractArgument($params, 'type'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('SearchTemplate'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + $endpoint->setType($type); + $endpoint->setBody($body); + + 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['type'] = DEPRECATED (string) The type of the document. + * $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) + * $params['body'] = (array) Define parameters and or supply a document to get termvectors for. See documentation. + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-termvectors.html + */ + public function termvectors(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + $id = $this->extractArgument($params, 'id'); + $type = $this->extractArgument($params, 'type'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('TermVectors'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + $endpoint->setId($id); + $endpoint->setType($type); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['id'] = (string) Document ID (Required) + * $params['index'] = (string) The name of the index (Required) + * $params['type'] = DEPRECATED (string) The type of the document + * $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['body'] = (array) The request definition requires either `script` or partial `doc` (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update.html + */ + public function update(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + $index = $this->extractArgument($params, 'index'); + $type = $this->extractArgument($params, 'type'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Update'); + $endpoint->setParams($params); + $endpoint->setId($id); + $endpoint->setIndex($index); + $endpoint->setType($type); + $endpoint->setBody($body); + + 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['type'] = DEPRECATED (list) A comma-separated list of document types to search; leave empty to perform the operation on all types + * $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,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 + * $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) The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. (Default = 1) + * $params['body'] = (array) The search definition using the Query DSL + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update-by-query.html + */ + public function updateByQuery(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + $type = $this->extractArgument($params, 'type'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('UpdateByQuery'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + $endpoint->setType($type); + $endpoint->setBody($body); + + 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) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update-by-query.html + */ + public function updateByQueryRethrottle(array $params = []) + { + $task_id = $this->extractArgument($params, 'task_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('UpdateByQueryRethrottle'); + $endpoint->setParams($params); + $endpoint->setTaskId($task_id); + + return $this->performRequest($endpoint); + } + public function cat(): CatNamespace + { + return $this->cat; + } + public function cluster(): ClusterNamespace + { + return $this->cluster; + } + public function indices(): IndicesNamespace + { + return $this->indices; + } + public function ingest(): IngestNamespace + { + return $this->ingest; + } + public function nodes(): NodesNamespace + { + return $this->nodes; + } + public function snapshot(): SnapshotNamespace + { + return $this->snapshot; + } + public function tasks(): TasksNamespace + { + return $this->tasks; + } + public function ccr(): CcrNamespace + { + return $this->ccr; + } + public function dataFrameTransformDeprecated(): DataFrameTransformDeprecatedNamespace + { + return $this->dataFrameTransformDeprecated; + } + public function enrich(): EnrichNamespace + { + return $this->enrich; + } + public function graph(): GraphNamespace + { + return $this->graph; + } + public function ilm(): IlmNamespace + { + return $this->ilm; + } + public function license(): LicenseNamespace + { + return $this->license; + } + public function migration(): MigrationNamespace + { + return $this->migration; + } + public function ml(): MlNamespace + { + return $this->ml; + } + public function monitoring(): MonitoringNamespace + { + return $this->monitoring; + } + public function rollup(): RollupNamespace + { + return $this->rollup; + } + public function security(): SecurityNamespace + { + return $this->security; + } + public function slm(): SlmNamespace + { + return $this->slm; + } + public function sql(): SqlNamespace + { + return $this->sql; + } + public function ssl(): SslNamespace + { + return $this->ssl; + } + public function transform(): TransformNamespace + { + return $this->transform; + } + public function watcher(): WatcherNamespace + { + return $this->watcher; + } + public function xpack(): XpackNamespace + { + return $this->xpack; + } + + /** + * Catchall for registered namespaces + * + * @return object + * @throws BadMethodCallException if the namespace cannot be found + */ + public function __call(string $name, array $arguments) + { + if (isset($this->registeredNamespaces[$name])) { + return $this->registeredNamespaces[$name]; + } + throw new BadMethodCallException("Namespace [$name] not found"); + } + + /** + * @return null|mixed + */ + public function extractArgument(array &$params, string $arg) + { + if (array_key_exists($arg, $params) === true) { + $value = $params[$arg]; + $value = (is_object($value) && !is_iterable($value)) ? + (array) $value : + $value; + unset($params[$arg]); + return $value; + } else { + return null; + } + } + + /** + * @return callable|array + */ + private function performRequest(AbstractEndpoint $endpoint) + { + $promise = $this->transport->performRequest( + $endpoint->getMethod(), + $endpoint->getURI(), + $endpoint->getParams(), + $endpoint->getBody(), + $endpoint->getOptions() + ); + + return $this->transport->resultOrFuture($promise, $endpoint->getOptions()); + } +} diff --git a/util/output/7.6.1/Endpoints/Bulk.php b/util/output/7.6.1/Endpoints/Bulk.php new file mode 100644 index 000000000..79a5f7800 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Bulk.php @@ -0,0 +1,86 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Bulk extends AbstractEndpoint +{ + public function __construct(SerializerInterface $serializer) + { + $this->serializer = $serializer; + } + + public function getURI(): string + { + $index = $this->index ?? null; + $type = $this->type ?? null; + if (isset($type)) { + @trigger_error('Specifying types in urls has been deprecated', E_USER_DEPRECATED); + } + + if (isset($index) && isset($type)) { + return "/$index/$type/_bulk"; + } + if (isset($index)) { + return "/$index/_bulk"; + } + return "/_bulk"; + } + + public function getParamWhitelist(): array + { + return [ + 'wait_for_active_shards', + 'refresh', + 'routing', + 'timeout', + 'type', + '_source', + '_source_excludes', + '_source_includes', + 'pipeline' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): Bulk + { + if (isset($body) !== true) { + return $this; + } + if (is_array($body) === true || $body instanceof Traversable) { + foreach ($body as $item) { + $this->body .= $this->serializer->serialize($item) . "\n"; + } + } elseif (is_string($body)) { + $this->body = $body; + if (substr($body, -1) != "\n") { + $this->body .= "\n"; + } + } else { + throw new InvalidArgumentException("Body must be an array, traversable object or string"); + } + return $this; + } + +} diff --git a/util/output/7.6.1/Endpoints/Cat/Aliases.php b/util/output/7.6.1/Endpoints/Cat/Aliases.php new file mode 100644 index 000000000..35ab27471 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Cat/Aliases.php @@ -0,0 +1,62 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Aliases extends AbstractEndpoint +{ + protected $name; + + public function getURI(): string + { + $name = $this->name ?? null; + + if (isset($name)) { + return "/_cat/aliases/$name"; + } + return "/_cat/aliases"; + } + + public function getParamWhitelist(): array + { + return [ + 'format', + 'local', + 'h', + 'help', + 's', + 'v' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setName($name): Aliases + { + if (isset($name) !== true) { + return $this; + } + if (is_array($name) === true) { + $name = implode(",", $name); + } + $this->name = $name; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Cat/Allocation.php b/util/output/7.6.1/Endpoints/Cat/Allocation.php new file mode 100644 index 000000000..ca967d630 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Cat/Allocation.php @@ -0,0 +1,64 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Allocation extends AbstractEndpoint +{ + protected $node_id; + + public function getURI(): string + { + $node_id = $this->node_id ?? null; + + if (isset($node_id)) { + return "/_cat/allocation/$node_id"; + } + return "/_cat/allocation"; + } + + public function getParamWhitelist(): array + { + return [ + 'format', + 'bytes', + 'local', + 'master_timeout', + 'h', + 'help', + 's', + 'v' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setNodeId($node_id): Allocation + { + 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; + } +} diff --git a/util/output/7.6.1/Endpoints/Cat/Count.php b/util/output/7.6.1/Endpoints/Cat/Count.php new file mode 100644 index 000000000..22aa7f35e --- /dev/null +++ b/util/output/7.6.1/Endpoints/Cat/Count.php @@ -0,0 +1,47 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Count extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/_cat/count/$index"; + } + return "/_cat/count"; + } + + public function getParamWhitelist(): array + { + return [ + 'format', + 'h', + 'help', + 's', + 'v' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Endpoints/Cat/Fielddata.php b/util/output/7.6.1/Endpoints/Cat/Fielddata.php new file mode 100644 index 000000000..518c29935 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Cat/Fielddata.php @@ -0,0 +1,63 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Fielddata extends AbstractEndpoint +{ + protected $fields; + + public function getURI(): string + { + $fields = $this->fields ?? null; + + if (isset($fields)) { + return "/_cat/fielddata/$fields"; + } + return "/_cat/fielddata"; + } + + public function getParamWhitelist(): array + { + return [ + 'format', + 'bytes', + 'h', + 'help', + 's', + 'v', + 'fields' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setFields($fields): Fielddata + { + if (isset($fields) !== true) { + return $this; + } + if (is_array($fields) === true) { + $fields = implode(",", $fields); + } + $this->fields = $fields; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Cat/Health.php b/util/output/7.6.1/Endpoints/Cat/Health.php new file mode 100644 index 000000000..470b88c44 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Cat/Health.php @@ -0,0 +1,45 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Health extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_cat/health"; + } + + public function getParamWhitelist(): array + { + return [ + 'format', + 'h', + 'help', + 's', + 'time', + 'ts', + 'v' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Endpoints/Cat/Help.php b/util/output/7.6.1/Endpoints/Cat/Help.php new file mode 100644 index 000000000..104a062cd --- /dev/null +++ b/util/output/7.6.1/Endpoints/Cat/Help.php @@ -0,0 +1,40 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Help extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_cat"; + } + + public function getParamWhitelist(): array + { + return [ + 'help', + 's' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Endpoints/Cat/Indices.php b/util/output/7.6.1/Endpoints/Cat/Indices.php new file mode 100644 index 000000000..999f96c54 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Cat/Indices.php @@ -0,0 +1,54 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Indices extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/_cat/indices/$index"; + } + return "/_cat/indices"; + } + + public function getParamWhitelist(): array + { + return [ + 'format', + 'bytes', + 'local', + 'master_timeout', + 'h', + 'health', + 'help', + 'pri', + 's', + 'time', + 'v', + 'include_unloaded_segments' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Endpoints/Cat/Master.php b/util/output/7.6.1/Endpoints/Cat/Master.php new file mode 100644 index 000000000..e8fd91de7 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Cat/Master.php @@ -0,0 +1,45 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Master extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_cat/master"; + } + + public function getParamWhitelist(): array + { + return [ + 'format', + 'local', + 'master_timeout', + 'h', + 'help', + 's', + 'v' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Endpoints/Cat/NodeAttrs.php b/util/output/7.6.1/Endpoints/Cat/NodeAttrs.php new file mode 100644 index 000000000..374e3ce72 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Cat/NodeAttrs.php @@ -0,0 +1,45 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class NodeAttrs extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_cat/nodeattrs"; + } + + public function getParamWhitelist(): array + { + return [ + 'format', + 'local', + 'master_timeout', + 'h', + 'help', + 's', + 'v' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Endpoints/Cat/Nodes.php b/util/output/7.6.1/Endpoints/Cat/Nodes.php new file mode 100644 index 000000000..84c855116 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Cat/Nodes.php @@ -0,0 +1,48 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Nodes extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_cat/nodes"; + } + + public function getParamWhitelist(): array + { + return [ + 'bytes', + 'format', + 'full_id', + 'local', + 'master_timeout', + 'h', + 'help', + 's', + 'time', + 'v' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Endpoints/Cat/PendingTasks.php b/util/output/7.6.1/Endpoints/Cat/PendingTasks.php new file mode 100644 index 000000000..47ae0178e --- /dev/null +++ b/util/output/7.6.1/Endpoints/Cat/PendingTasks.php @@ -0,0 +1,46 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PendingTasks extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_cat/pending_tasks"; + } + + public function getParamWhitelist(): array + { + return [ + 'format', + 'local', + 'master_timeout', + 'h', + 'help', + 's', + 'time', + 'v' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Endpoints/Cat/Plugins.php b/util/output/7.6.1/Endpoints/Cat/Plugins.php new file mode 100644 index 000000000..7b68a9fe8 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Cat/Plugins.php @@ -0,0 +1,45 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Plugins extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_cat/plugins"; + } + + public function getParamWhitelist(): array + { + return [ + 'format', + 'local', + 'master_timeout', + 'h', + 'help', + 's', + 'v' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Endpoints/Cat/Recovery.php b/util/output/7.6.1/Endpoints/Cat/Recovery.php new file mode 100644 index 000000000..748b749b4 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Cat/Recovery.php @@ -0,0 +1,52 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Recovery extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/_cat/recovery/$index"; + } + return "/_cat/recovery"; + } + + public function getParamWhitelist(): array + { + return [ + 'format', + 'active_only', + 'bytes', + 'detailed', + 'h', + 'help', + 'index', + 's', + 'time', + 'v' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Endpoints/Cat/Repositories.php b/util/output/7.6.1/Endpoints/Cat/Repositories.php new file mode 100644 index 000000000..c804ca0c0 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Cat/Repositories.php @@ -0,0 +1,45 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Repositories extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_cat/repositories"; + } + + public function getParamWhitelist(): array + { + return [ + 'format', + 'local', + 'master_timeout', + 'h', + 'help', + 's', + 'v' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Endpoints/Cat/Segments.php b/util/output/7.6.1/Endpoints/Cat/Segments.php new file mode 100644 index 000000000..1aa30681a --- /dev/null +++ b/util/output/7.6.1/Endpoints/Cat/Segments.php @@ -0,0 +1,48 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Segments extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/_cat/segments/$index"; + } + return "/_cat/segments"; + } + + public function getParamWhitelist(): array + { + return [ + 'format', + 'bytes', + 'h', + 'help', + 's', + 'v' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Endpoints/Cat/Shards.php b/util/output/7.6.1/Endpoints/Cat/Shards.php new file mode 100644 index 000000000..7fff235bc --- /dev/null +++ b/util/output/7.6.1/Endpoints/Cat/Shards.php @@ -0,0 +1,51 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Shards extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/_cat/shards/$index"; + } + return "/_cat/shards"; + } + + public function getParamWhitelist(): array + { + return [ + 'format', + 'bytes', + 'local', + 'master_timeout', + 'h', + 'help', + 's', + 'time', + 'v' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Endpoints/Cat/Snapshots.php b/util/output/7.6.1/Endpoints/Cat/Snapshots.php new file mode 100644 index 000000000..04e30cd35 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Cat/Snapshots.php @@ -0,0 +1,64 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Snapshots extends AbstractEndpoint +{ + protected $repository; + + public function getURI(): string + { + $repository = $this->repository ?? null; + + if (isset($repository)) { + return "/_cat/snapshots/$repository"; + } + return "/_cat/snapshots"; + } + + public function getParamWhitelist(): array + { + return [ + 'format', + 'ignore_unavailable', + 'master_timeout', + 'h', + 'help', + 's', + 'time', + 'v' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setRepository($repository): Snapshots + { + if (isset($repository) !== true) { + return $this; + } + if (is_array($repository) === true) { + $repository = implode(",", $repository); + } + $this->repository = $repository; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Cat/Tasks.php b/util/output/7.6.1/Endpoints/Cat/Tasks.php new file mode 100644 index 000000000..12066721d --- /dev/null +++ b/util/output/7.6.1/Endpoints/Cat/Tasks.php @@ -0,0 +1,48 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Tasks extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_cat/tasks"; + } + + public function getParamWhitelist(): array + { + return [ + 'format', + 'node_id', + 'actions', + 'detailed', + 'parent_task', + 'h', + 'help', + 's', + 'time', + 'v' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Endpoints/Cat/Templates.php b/util/output/7.6.1/Endpoints/Cat/Templates.php new file mode 100644 index 000000000..3fcb7a0ff --- /dev/null +++ b/util/output/7.6.1/Endpoints/Cat/Templates.php @@ -0,0 +1,60 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Templates extends AbstractEndpoint +{ + protected $name; + + public function getURI(): string + { + $name = $this->name ?? null; + + if (isset($name)) { + return "/_cat/templates/$name"; + } + return "/_cat/templates"; + } + + public function getParamWhitelist(): array + { + return [ + 'format', + 'local', + 'master_timeout', + 'h', + 'help', + 's', + 'v' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setName($name): Templates + { + if (isset($name) !== true) { + return $this; + } + $this->name = $name; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Cat/ThreadPool.php b/util/output/7.6.1/Endpoints/Cat/ThreadPool.php new file mode 100644 index 000000000..8f5f3aedb --- /dev/null +++ b/util/output/7.6.1/Endpoints/Cat/ThreadPool.php @@ -0,0 +1,64 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class ThreadPool extends AbstractEndpoint +{ + protected $thread_pool_patterns; + + public function getURI(): string + { + $thread_pool_patterns = $this->thread_pool_patterns ?? null; + + if (isset($thread_pool_patterns)) { + return "/_cat/thread_pool/$thread_pool_patterns"; + } + return "/_cat/thread_pool"; + } + + public function getParamWhitelist(): array + { + return [ + 'format', + 'size', + 'local', + 'master_timeout', + 'h', + 'help', + 's', + 'v' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setThreadPoolPatterns($thread_pool_patterns): ThreadPool + { + if (isset($thread_pool_patterns) !== true) { + return $this; + } + if (is_array($thread_pool_patterns) === true) { + $thread_pool_patterns = implode(",", $thread_pool_patterns); + } + $this->thread_pool_patterns = $thread_pool_patterns; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ccr/DeleteAutoFollowPattern.php b/util/output/7.6.1/Endpoints/Ccr/DeleteAutoFollowPattern.php new file mode 100644 index 000000000..9ac3b037c --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ccr/DeleteAutoFollowPattern.php @@ -0,0 +1,53 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeleteAutoFollowPattern extends AbstractEndpoint +{ + protected $name; + + public function getURI(): string + { + $name = $this->name ?? null; + + if (isset($name)) { + return "/_ccr/auto_follow/$name"; + } + throw new RuntimeException('Missing parameter for the endpoint ccr.delete_auto_follow_pattern'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setName($name): DeleteAutoFollowPattern + { + if (isset($name) !== true) { + return $this; + } + $this->name = $name; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ccr/Follow.php b/util/output/7.6.1/Endpoints/Ccr/Follow.php new file mode 100644 index 000000000..e99aee9d6 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ccr/Follow.php @@ -0,0 +1,54 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Follow extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/$index/_ccr/follow"; + } + throw new RuntimeException('Missing parameter for the endpoint ccr.follow'); + } + + public function getParamWhitelist(): array + { + return [ + 'wait_for_active_shards' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): Follow + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ccr/FollowInfo.php b/util/output/7.6.1/Endpoints/Ccr/FollowInfo.php new file mode 100644 index 000000000..733262fd0 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ccr/FollowInfo.php @@ -0,0 +1,42 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class FollowInfo extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/$index/_ccr/info"; + } + throw new RuntimeException('Missing parameter for the endpoint ccr.follow_info'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Endpoints/Ccr/FollowStats.php b/util/output/7.6.1/Endpoints/Ccr/FollowStats.php new file mode 100644 index 000000000..6c6917ab0 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ccr/FollowStats.php @@ -0,0 +1,42 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class FollowStats extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/$index/_ccr/stats"; + } + throw new RuntimeException('Missing parameter for the endpoint ccr.follow_stats'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Endpoints/Ccr/ForgetFollower.php b/util/output/7.6.1/Endpoints/Ccr/ForgetFollower.php new file mode 100644 index 000000000..f60b48723 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ccr/ForgetFollower.php @@ -0,0 +1,52 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class ForgetFollower extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/$index/_ccr/forget_follower"; + } + throw new RuntimeException('Missing parameter for the endpoint ccr.forget_follower'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): ForgetFollower + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ccr/GetAutoFollowPattern.php b/util/output/7.6.1/Endpoints/Ccr/GetAutoFollowPattern.php new file mode 100644 index 000000000..cda9ebed3 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ccr/GetAutoFollowPattern.php @@ -0,0 +1,52 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetAutoFollowPattern extends AbstractEndpoint +{ + protected $name; + + public function getURI(): string + { + $name = $this->name ?? null; + + if (isset($name)) { + return "/_ccr/auto_follow/$name"; + } + return "/_ccr/auto_follow"; + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setName($name): GetAutoFollowPattern + { + if (isset($name) !== true) { + return $this; + } + $this->name = $name; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ccr/PauseAutoFollowPattern.php b/util/output/7.6.1/Endpoints/Ccr/PauseAutoFollowPattern.php new file mode 100644 index 000000000..af1622004 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ccr/PauseAutoFollowPattern.php @@ -0,0 +1,53 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PauseAutoFollowPattern extends AbstractEndpoint +{ + protected $name; + + public function getURI(): string + { + $name = $this->name ?? null; + + if (isset($name)) { + return "/_ccr/auto_follow/$name/pause"; + } + throw new RuntimeException('Missing parameter for the endpoint ccr.pause_auto_follow_pattern'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setName($name): PauseAutoFollowPattern + { + if (isset($name) !== true) { + return $this; + } + $this->name = $name; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ccr/PauseFollow.php b/util/output/7.6.1/Endpoints/Ccr/PauseFollow.php new file mode 100644 index 000000000..b3c1859b3 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ccr/PauseFollow.php @@ -0,0 +1,42 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PauseFollow extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/$index/_ccr/pause_follow"; + } + throw new RuntimeException('Missing parameter for the endpoint ccr.pause_follow'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'POST'; + } +} diff --git a/util/output/7.6.1/Endpoints/Ccr/PutAutoFollowPattern.php b/util/output/7.6.1/Endpoints/Ccr/PutAutoFollowPattern.php new file mode 100644 index 000000000..7f9d98f40 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ccr/PutAutoFollowPattern.php @@ -0,0 +1,63 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PutAutoFollowPattern extends AbstractEndpoint +{ + protected $name; + + public function getURI(): string + { + $name = $this->name ?? null; + + if (isset($name)) { + return "/_ccr/auto_follow/$name"; + } + throw new RuntimeException('Missing parameter for the endpoint ccr.put_auto_follow_pattern'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): PutAutoFollowPattern + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setName($name): PutAutoFollowPattern + { + if (isset($name) !== true) { + return $this; + } + $this->name = $name; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ccr/ResumeAutoFollowPattern.php b/util/output/7.6.1/Endpoints/Ccr/ResumeAutoFollowPattern.php new file mode 100644 index 000000000..c3f77cff1 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ccr/ResumeAutoFollowPattern.php @@ -0,0 +1,53 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class ResumeAutoFollowPattern extends AbstractEndpoint +{ + protected $name; + + public function getURI(): string + { + $name = $this->name ?? null; + + if (isset($name)) { + return "/_ccr/auto_follow/$name/resume"; + } + throw new RuntimeException('Missing parameter for the endpoint ccr.resume_auto_follow_pattern'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setName($name): ResumeAutoFollowPattern + { + if (isset($name) !== true) { + return $this; + } + $this->name = $name; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ccr/ResumeFollow.php b/util/output/7.6.1/Endpoints/Ccr/ResumeFollow.php new file mode 100644 index 000000000..dbdb2e1b0 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ccr/ResumeFollow.php @@ -0,0 +1,52 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class ResumeFollow extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/$index/_ccr/resume_follow"; + } + throw new RuntimeException('Missing parameter for the endpoint ccr.resume_follow'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): ResumeFollow + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ccr/Stats.php b/util/output/7.6.1/Endpoints/Ccr/Stats.php new file mode 100644 index 000000000..9bda20772 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ccr/Stats.php @@ -0,0 +1,37 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Stats extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_ccr/stats"; + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Endpoints/Ccr/Unfollow.php b/util/output/7.6.1/Endpoints/Ccr/Unfollow.php new file mode 100644 index 000000000..f6545d6ca --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ccr/Unfollow.php @@ -0,0 +1,42 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Unfollow extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/$index/_ccr/unfollow"; + } + throw new RuntimeException('Missing parameter for the endpoint ccr.unfollow'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'POST'; + } +} diff --git a/util/output/7.6.1/Endpoints/ClearScroll.php b/util/output/7.6.1/Endpoints/ClearScroll.php new file mode 100644 index 000000000..18485d2e5 --- /dev/null +++ b/util/output/7.6.1/Endpoints/ClearScroll.php @@ -0,0 +1,70 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class ClearScroll extends AbstractEndpoint +{ + protected $scroll_id; + + public function getURI(): string + { + $scroll_id = $this->scroll_id ?? null; + if (isset($scroll_id)) { + @trigger_error('A scroll id can be quite large and should be specified as part of the body', E_USER_DEPRECATED); + } + + if (isset($scroll_id)) { + return "/_search/scroll/$scroll_id"; + } + return "/_search/scroll"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setBody($body): ClearScroll + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setScrollId($scroll_id): ClearScroll + { + if (isset($scroll_id) !== true) { + return $this; + } + if (is_array($scroll_id) === true) { + $scroll_id = implode(",", $scroll_id); + } + $this->scroll_id = $scroll_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Cluster/AllocationExplain.php b/util/output/7.6.1/Endpoints/Cluster/AllocationExplain.php new file mode 100644 index 000000000..9dc916f61 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Cluster/AllocationExplain.php @@ -0,0 +1,50 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class AllocationExplain extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_cluster/allocation/explain"; + } + + public function getParamWhitelist(): array + { + return [ + 'include_yes_decisions', + 'include_disk_info' + ]; + } + + public function getMethod(): string + { + return isset($this->body) ? 'POST' : 'GET'; + } + + public function setBody($body): AllocationExplain + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Cluster/GetSettings.php b/util/output/7.6.1/Endpoints/Cluster/GetSettings.php new file mode 100644 index 000000000..ffcd185aa --- /dev/null +++ b/util/output/7.6.1/Endpoints/Cluster/GetSettings.php @@ -0,0 +1,42 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetSettings extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_cluster/settings"; + } + + public function getParamWhitelist(): array + { + return [ + 'flat_settings', + 'master_timeout', + 'timeout', + 'include_defaults' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Endpoints/Cluster/Health.php b/util/output/7.6.1/Endpoints/Cluster/Health.php new file mode 100644 index 000000000..723fa2edf --- /dev/null +++ b/util/output/7.6.1/Endpoints/Cluster/Health.php @@ -0,0 +1,53 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Health extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/_cluster/health/$index"; + } + return "/_cluster/health"; + } + + public function getParamWhitelist(): array + { + return [ + '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_status' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Endpoints/Cluster/PendingTasks.php b/util/output/7.6.1/Endpoints/Cluster/PendingTasks.php new file mode 100644 index 000000000..a628061c2 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Cluster/PendingTasks.php @@ -0,0 +1,40 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PendingTasks extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_cluster/pending_tasks"; + } + + public function getParamWhitelist(): array + { + return [ + 'local', + 'master_timeout' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Endpoints/Cluster/PutSettings.php b/util/output/7.6.1/Endpoints/Cluster/PutSettings.php new file mode 100644 index 000000000..620840bcb --- /dev/null +++ b/util/output/7.6.1/Endpoints/Cluster/PutSettings.php @@ -0,0 +1,51 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PutSettings extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_cluster/settings"; + } + + public function getParamWhitelist(): array + { + return [ + 'flat_settings', + 'master_timeout', + 'timeout' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): PutSettings + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Cluster/RemoteInfo.php b/util/output/7.6.1/Endpoints/Cluster/RemoteInfo.php new file mode 100644 index 000000000..af3c93644 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Cluster/RemoteInfo.php @@ -0,0 +1,39 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class RemoteInfo extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_remote/info"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Endpoints/Cluster/Reroute.php b/util/output/7.6.1/Endpoints/Cluster/Reroute.php new file mode 100644 index 000000000..5b8e9d4ca --- /dev/null +++ b/util/output/7.6.1/Endpoints/Cluster/Reroute.php @@ -0,0 +1,54 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Reroute extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_cluster/reroute"; + } + + public function getParamWhitelist(): array + { + return [ + 'dry_run', + 'explain', + 'retry_failed', + 'metric', + 'master_timeout', + 'timeout' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): Reroute + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Cluster/State.php b/util/output/7.6.1/Endpoints/Cluster/State.php new file mode 100644 index 000000000..ea81524de --- /dev/null +++ b/util/output/7.6.1/Endpoints/Cluster/State.php @@ -0,0 +1,68 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class State extends AbstractEndpoint +{ + protected $metric; + + public function getURI(): string + { + $metric = $this->metric ?? null; + $index = $this->index ?? null; + + if (isset($metric) && isset($index)) { + return "/_cluster/state/$metric/$index"; + } + if (isset($metric)) { + return "/_cluster/state/$metric"; + } + return "/_cluster/state"; + } + + public function getParamWhitelist(): array + { + return [ + 'local', + 'master_timeout', + 'flat_settings', + 'wait_for_metadata_version', + 'wait_for_timeout', + 'ignore_unavailable', + 'allow_no_indices', + 'expand_wildcards' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setMetric($metric): State + { + if (isset($metric) !== true) { + return $this; + } + if (is_array($metric) === true) { + $metric = implode(",", $metric); + } + $this->metric = $metric; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Cluster/Stats.php b/util/output/7.6.1/Endpoints/Cluster/Stats.php new file mode 100644 index 000000000..1751190e9 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Cluster/Stats.php @@ -0,0 +1,58 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Stats extends AbstractEndpoint +{ + protected $node_id; + + public function getURI(): string + { + $node_id = $this->node_id ?? null; + + if (isset($node_id)) { + return "/_cluster/stats/nodes/$node_id"; + } + return "/_cluster/stats"; + } + + public function getParamWhitelist(): array + { + return [ + 'flat_settings', + 'timeout' + ]; + } + + 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; + } +} diff --git a/util/output/7.6.1/Endpoints/Count.php b/util/output/7.6.1/Endpoints/Count.php new file mode 100644 index 000000000..5d0c51812 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Count.php @@ -0,0 +1,73 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Count extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + $type = $this->type ?? null; + if (isset($type)) { + @trigger_error('Specifying types in urls has been deprecated', E_USER_DEPRECATED); + } + + if (isset($index) && isset($type)) { + return "/$index/$type/_count"; + } + if (isset($index)) { + return "/$index/_count"; + } + return "/_count"; + } + + public function getParamWhitelist(): array + { + return [ + 'ignore_unavailable', + 'ignore_throttled', + 'allow_no_indices', + 'expand_wildcards', + 'min_score', + 'preference', + 'routing', + 'q', + 'analyzer', + 'analyze_wildcard', + 'default_operator', + 'df', + 'lenient', + 'terminate_after' + ]; + } + + public function getMethod(): string + { + return isset($this->body) ? 'POST' : 'GET'; + } + + public function setBody($body): Count + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Create.php b/util/output/7.6.1/Endpoints/Create.php new file mode 100644 index 000000000..99f22987c --- /dev/null +++ b/util/output/7.6.1/Endpoints/Create.php @@ -0,0 +1,85 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +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; + $type = $this->type ?? null; + if (isset($type)) { + @trigger_error('Specifying types in urls has been deprecated', E_USER_DEPRECATED); + } + + if (isset($type)) { + return "/$index/$type/$id/_create"; + } + return "/$index/_create/$id"; + } + + public function getParamWhitelist(): array + { + return [ + 'wait_for_active_shards', + 'refresh', + 'routing', + 'timeout', + 'version', + 'version_type', + 'pipeline' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): Create + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setId($id): Create + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/DataFrameTransformDeprecated/DeleteTransform.php b/util/output/7.6.1/Endpoints/DataFrameTransformDeprecated/DeleteTransform.php new file mode 100644 index 000000000..4cd59b998 --- /dev/null +++ b/util/output/7.6.1/Endpoints/DataFrameTransformDeprecated/DeleteTransform.php @@ -0,0 +1,55 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeleteTransform extends AbstractEndpoint +{ + protected $transform_id; + + public function getURI(): string + { + $transform_id = $this->transform_id ?? null; + + if (isset($transform_id)) { + return "/_data_frame/transforms/$transform_id"; + } + throw new RuntimeException('Missing parameter for the endpoint data_frame_transform_deprecated.delete_transform'); + } + + public function getParamWhitelist(): array + { + return [ + 'force' + ]; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setTransformId($transform_id): DeleteTransform + { + if (isset($transform_id) !== true) { + return $this; + } + $this->transform_id = $transform_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/DataFrameTransformDeprecated/GetTransform.php b/util/output/7.6.1/Endpoints/DataFrameTransformDeprecated/GetTransform.php new file mode 100644 index 000000000..36f59d257 --- /dev/null +++ b/util/output/7.6.1/Endpoints/DataFrameTransformDeprecated/GetTransform.php @@ -0,0 +1,56 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetTransform extends AbstractEndpoint +{ + protected $transform_id; + + public function getURI(): string + { + $transform_id = $this->transform_id ?? null; + + if (isset($transform_id)) { + return "/_data_frame/transforms/$transform_id"; + } + return "/_data_frame/transforms"; + } + + public function getParamWhitelist(): array + { + return [ + 'from', + 'size', + 'allow_no_match' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setTransformId($transform_id): GetTransform + { + if (isset($transform_id) !== true) { + return $this; + } + $this->transform_id = $transform_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/DataFrameTransformDeprecated/GetTransformStats.php b/util/output/7.6.1/Endpoints/DataFrameTransformDeprecated/GetTransformStats.php new file mode 100644 index 000000000..206ab03a7 --- /dev/null +++ b/util/output/7.6.1/Endpoints/DataFrameTransformDeprecated/GetTransformStats.php @@ -0,0 +1,57 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetTransformStats extends AbstractEndpoint +{ + protected $transform_id; + + public function getURI(): string + { + $transform_id = $this->transform_id ?? null; + + if (isset($transform_id)) { + return "/_data_frame/transforms/$transform_id/_stats"; + } + throw new RuntimeException('Missing parameter for the endpoint data_frame_transform_deprecated.get_transform_stats'); + } + + public function getParamWhitelist(): array + { + return [ + 'from', + 'size', + 'allow_no_match' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setTransformId($transform_id): GetTransformStats + { + if (isset($transform_id) !== true) { + return $this; + } + $this->transform_id = $transform_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/DataFrameTransformDeprecated/PreviewTransform.php b/util/output/7.6.1/Endpoints/DataFrameTransformDeprecated/PreviewTransform.php new file mode 100644 index 000000000..d858fcea1 --- /dev/null +++ b/util/output/7.6.1/Endpoints/DataFrameTransformDeprecated/PreviewTransform.php @@ -0,0 +1,47 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PreviewTransform extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_data_frame/transforms/_preview"; + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): PreviewTransform + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/DataFrameTransformDeprecated/PutTransform.php b/util/output/7.6.1/Endpoints/DataFrameTransformDeprecated/PutTransform.php new file mode 100644 index 000000000..d6f720f58 --- /dev/null +++ b/util/output/7.6.1/Endpoints/DataFrameTransformDeprecated/PutTransform.php @@ -0,0 +1,65 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PutTransform extends AbstractEndpoint +{ + protected $transform_id; + + public function getURI(): string + { + $transform_id = $this->transform_id ?? null; + + if (isset($transform_id)) { + return "/_data_frame/transforms/$transform_id"; + } + throw new RuntimeException('Missing parameter for the endpoint data_frame_transform_deprecated.put_transform'); + } + + public function getParamWhitelist(): array + { + return [ + 'defer_validation' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): PutTransform + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setTransformId($transform_id): PutTransform + { + if (isset($transform_id) !== true) { + return $this; + } + $this->transform_id = $transform_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/DataFrameTransformDeprecated/StartTransform.php b/util/output/7.6.1/Endpoints/DataFrameTransformDeprecated/StartTransform.php new file mode 100644 index 000000000..c66ed571c --- /dev/null +++ b/util/output/7.6.1/Endpoints/DataFrameTransformDeprecated/StartTransform.php @@ -0,0 +1,55 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class StartTransform extends AbstractEndpoint +{ + protected $transform_id; + + public function getURI(): string + { + $transform_id = $this->transform_id ?? null; + + if (isset($transform_id)) { + return "/_data_frame/transforms/$transform_id/_start"; + } + throw new RuntimeException('Missing parameter for the endpoint data_frame_transform_deprecated.start_transform'); + } + + public function getParamWhitelist(): array + { + return [ + 'timeout' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setTransformId($transform_id): StartTransform + { + if (isset($transform_id) !== true) { + return $this; + } + $this->transform_id = $transform_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/DataFrameTransformDeprecated/StopTransform.php b/util/output/7.6.1/Endpoints/DataFrameTransformDeprecated/StopTransform.php new file mode 100644 index 000000000..c80b13175 --- /dev/null +++ b/util/output/7.6.1/Endpoints/DataFrameTransformDeprecated/StopTransform.php @@ -0,0 +1,57 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class StopTransform extends AbstractEndpoint +{ + protected $transform_id; + + public function getURI(): string + { + $transform_id = $this->transform_id ?? null; + + if (isset($transform_id)) { + return "/_data_frame/transforms/$transform_id/_stop"; + } + throw new RuntimeException('Missing parameter for the endpoint data_frame_transform_deprecated.stop_transform'); + } + + public function getParamWhitelist(): array + { + return [ + 'wait_for_completion', + 'timeout', + 'allow_no_match' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setTransformId($transform_id): StopTransform + { + if (isset($transform_id) !== true) { + return $this; + } + $this->transform_id = $transform_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/DataFrameTransformDeprecated/UpdateTransform.php b/util/output/7.6.1/Endpoints/DataFrameTransformDeprecated/UpdateTransform.php new file mode 100644 index 000000000..0dae280cc --- /dev/null +++ b/util/output/7.6.1/Endpoints/DataFrameTransformDeprecated/UpdateTransform.php @@ -0,0 +1,65 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class UpdateTransform extends AbstractEndpoint +{ + protected $transform_id; + + public function getURI(): string + { + $transform_id = $this->transform_id ?? null; + + if (isset($transform_id)) { + return "/_data_frame/transforms/$transform_id/_update"; + } + throw new RuntimeException('Missing parameter for the endpoint data_frame_transform_deprecated.update_transform'); + } + + public function getParamWhitelist(): array + { + return [ + 'defer_validation' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): UpdateTransform + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setTransformId($transform_id): UpdateTransform + { + if (isset($transform_id) !== true) { + return $this; + } + $this->transform_id = $transform_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Delete.php b/util/output/7.6.1/Endpoints/Delete.php new file mode 100644 index 000000000..85eda3ea1 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Delete.php @@ -0,0 +1,76 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Delete extends AbstractEndpoint +{ + + public function getURI(): string + { + if (isset($this->id) !== true) { + throw new RuntimeException( + 'id is required for delete' + ); + } + $id = $this->id; + if (isset($this->index) !== true) { + throw new RuntimeException( + 'index is required for delete' + ); + } + $index = $this->index; + $type = $this->type ?? null; + if (isset($type)) { + @trigger_error('Specifying types in urls has been deprecated', E_USER_DEPRECATED); + } + + if (isset($type)) { + return "/$index/$type/$id"; + } + return "/$index/_doc/$id"; + } + + public function getParamWhitelist(): array + { + return [ + 'wait_for_active_shards', + 'refresh', + 'routing', + 'timeout', + 'if_seq_no', + 'if_primary_term', + 'version', + 'version_type' + ]; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setId($id): Delete + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/DeleteByQuery.php b/util/output/7.6.1/Endpoints/DeleteByQuery.php new file mode 100644 index 000000000..74ce4fb32 --- /dev/null +++ b/util/output/7.6.1/Endpoints/DeleteByQuery.php @@ -0,0 +1,95 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeleteByQuery extends AbstractEndpoint +{ + + public function getURI(): string + { + if (isset($this->index) !== true) { + throw new RuntimeException( + 'index is required for delete_by_query' + ); + } + $index = $this->index; + $type = $this->type ?? null; + if (isset($type)) { + @trigger_error('Specifying types in urls has been deprecated', E_USER_DEPRECATED); + } + + if (isset($type)) { + return "/$index/$type/_delete_by_query"; + } + return "/$index/_delete_by_query"; + } + + public function getParamWhitelist(): array + { + return [ + 'analyzer', + 'analyze_wildcard', + 'default_operator', + 'df', + 'from', + 'ignore_unavailable', + 'allow_no_indices', + 'conflicts', + 'expand_wildcards', + 'lenient', + 'preference', + 'q', + 'routing', + 'scroll', + 'search_type', + 'search_timeout', + 'size', + 'max_docs', + 'sort', + '_source', + '_source_excludes', + '_source_includes', + 'terminate_after', + 'stats', + 'version', + 'request_cache', + 'refresh', + 'timeout', + 'wait_for_active_shards', + 'scroll_size', + 'wait_for_completion', + 'requests_per_second', + 'slices' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): DeleteByQuery + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/DeleteByQueryRethrottle.php b/util/output/7.6.1/Endpoints/DeleteByQueryRethrottle.php new file mode 100644 index 000000000..ad05e7820 --- /dev/null +++ b/util/output/7.6.1/Endpoints/DeleteByQueryRethrottle.php @@ -0,0 +1,55 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeleteByQueryRethrottle extends AbstractEndpoint +{ + protected $task_id; + + public function getURI(): string + { + $task_id = $this->task_id ?? null; + + if (isset($task_id)) { + return "/_delete_by_query/$task_id/_rethrottle"; + } + throw new RuntimeException('Missing parameter for the endpoint delete_by_query_rethrottle'); + } + + public function getParamWhitelist(): array + { + return [ + 'requests_per_second' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setTaskId($task_id): DeleteByQueryRethrottle + { + if (isset($task_id) !== true) { + return $this; + } + $this->task_id = $task_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/DeleteScript.php b/util/output/7.6.1/Endpoints/DeleteScript.php new file mode 100644 index 000000000..571120118 --- /dev/null +++ b/util/output/7.6.1/Endpoints/DeleteScript.php @@ -0,0 +1,55 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeleteScript extends AbstractEndpoint +{ + + public function getURI(): string + { + $id = $this->id ?? null; + + if (isset($id)) { + return "/_scripts/$id"; + } + throw new RuntimeException('Missing parameter for the endpoint delete_script'); + } + + public function getParamWhitelist(): array + { + return [ + 'timeout', + 'master_timeout' + ]; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setId($id): DeleteScript + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Enrich/DeletePolicy.php b/util/output/7.6.1/Endpoints/Enrich/DeletePolicy.php new file mode 100644 index 000000000..12400c784 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Enrich/DeletePolicy.php @@ -0,0 +1,53 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeletePolicy extends AbstractEndpoint +{ + protected $name; + + public function getURI(): string + { + $name = $this->name ?? null; + + if (isset($name)) { + return "/_enrich/policy/$name"; + } + throw new RuntimeException('Missing parameter for the endpoint enrich.delete_policy'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setName($name): DeletePolicy + { + if (isset($name) !== true) { + return $this; + } + $this->name = $name; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Enrich/ExecutePolicy.php b/util/output/7.6.1/Endpoints/Enrich/ExecutePolicy.php new file mode 100644 index 000000000..0eb8614d5 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Enrich/ExecutePolicy.php @@ -0,0 +1,55 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class ExecutePolicy extends AbstractEndpoint +{ + protected $name; + + public function getURI(): string + { + $name = $this->name ?? null; + + if (isset($name)) { + return "/_enrich/policy/$name/_execute"; + } + throw new RuntimeException('Missing parameter for the endpoint enrich.execute_policy'); + } + + public function getParamWhitelist(): array + { + return [ + 'wait_for_completion' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setName($name): ExecutePolicy + { + if (isset($name) !== true) { + return $this; + } + $this->name = $name; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Enrich/GetPolicy.php b/util/output/7.6.1/Endpoints/Enrich/GetPolicy.php new file mode 100644 index 000000000..8f800f789 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Enrich/GetPolicy.php @@ -0,0 +1,55 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetPolicy extends AbstractEndpoint +{ + protected $name; + + public function getURI(): string + { + $name = $this->name ?? null; + + if (isset($name)) { + return "/_enrich/policy/$name"; + } + return "/_enrich/policy/"; + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setName($name): GetPolicy + { + if (isset($name) !== true) { + return $this; + } + if (is_array($name) === true) { + $name = implode(",", $name); + } + $this->name = $name; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Enrich/PutPolicy.php b/util/output/7.6.1/Endpoints/Enrich/PutPolicy.php new file mode 100644 index 000000000..a54066c2e --- /dev/null +++ b/util/output/7.6.1/Endpoints/Enrich/PutPolicy.php @@ -0,0 +1,63 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PutPolicy extends AbstractEndpoint +{ + protected $name; + + public function getURI(): string + { + $name = $this->name ?? null; + + if (isset($name)) { + return "/_enrich/policy/$name"; + } + throw new RuntimeException('Missing parameter for the endpoint enrich.put_policy'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): PutPolicy + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setName($name): PutPolicy + { + if (isset($name) !== true) { + return $this; + } + $this->name = $name; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Enrich/Stats.php b/util/output/7.6.1/Endpoints/Enrich/Stats.php new file mode 100644 index 000000000..e167d50bc --- /dev/null +++ b/util/output/7.6.1/Endpoints/Enrich/Stats.php @@ -0,0 +1,37 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Stats extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_enrich/_stats"; + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Endpoints/Exists.php b/util/output/7.6.1/Endpoints/Exists.php new file mode 100644 index 000000000..1d58c337b --- /dev/null +++ b/util/output/7.6.1/Endpoints/Exists.php @@ -0,0 +1,78 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Exists extends AbstractEndpoint +{ + + public function getURI(): string + { + if (isset($this->id) !== true) { + throw new RuntimeException( + 'id is required for exists' + ); + } + $id = $this->id; + if (isset($this->index) !== true) { + throw new RuntimeException( + 'index is required for exists' + ); + } + $index = $this->index; + $type = $this->type ?? null; + if (isset($type)) { + @trigger_error('Specifying types in urls has been deprecated', E_USER_DEPRECATED); + } + + if (isset($type)) { + return "/$index/$type/$id"; + } + return "/$index/_doc/$id"; + } + + public function getParamWhitelist(): array + { + return [ + 'stored_fields', + 'preference', + 'realtime', + 'refresh', + 'routing', + '_source', + '_source_excludes', + '_source_includes', + 'version', + 'version_type' + ]; + } + + public function getMethod(): string + { + return 'HEAD'; + } + + public function setId($id): Exists + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/ExistsSource.php b/util/output/7.6.1/Endpoints/ExistsSource.php new file mode 100644 index 000000000..b5448a415 --- /dev/null +++ b/util/output/7.6.1/Endpoints/ExistsSource.php @@ -0,0 +1,77 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class ExistsSource extends AbstractEndpoint +{ + + public function getURI(): string + { + if (isset($this->id) !== true) { + throw new RuntimeException( + 'id is required for exists_source' + ); + } + $id = $this->id; + if (isset($this->index) !== true) { + throw new RuntimeException( + 'index is required for exists_source' + ); + } + $index = $this->index; + $type = $this->type ?? null; + if (isset($type)) { + @trigger_error('Specifying types in urls has been deprecated', E_USER_DEPRECATED); + } + + if (isset($type)) { + return "/$index/$type/$id/_source"; + } + return "/$index/_source/$id"; + } + + public function getParamWhitelist(): array + { + return [ + 'preference', + 'realtime', + 'refresh', + 'routing', + '_source', + '_source_excludes', + '_source_includes', + 'version', + 'version_type' + ]; + } + + public function getMethod(): string + { + return 'HEAD'; + } + + public function setId($id): ExistsSource + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Explain.php b/util/output/7.6.1/Endpoints/Explain.php new file mode 100644 index 000000000..d68e54953 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Explain.php @@ -0,0 +1,90 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Explain extends AbstractEndpoint +{ + + public function getURI(): string + { + if (isset($this->id) !== true) { + throw new RuntimeException( + 'id is required for explain' + ); + } + $id = $this->id; + if (isset($this->index) !== true) { + throw new RuntimeException( + 'index is required for explain' + ); + } + $index = $this->index; + $type = $this->type ?? null; + if (isset($type)) { + @trigger_error('Specifying types in urls has been deprecated', E_USER_DEPRECATED); + } + + if (isset($type)) { + return "/$index/$type/$id/_explain"; + } + return "/$index/_explain/$id"; + } + + public function getParamWhitelist(): array + { + return [ + 'analyze_wildcard', + 'analyzer', + 'default_operator', + 'df', + 'stored_fields', + 'lenient', + 'preference', + 'q', + 'routing', + '_source', + '_source_excludes', + '_source_includes' + ]; + } + + public function getMethod(): string + { + return isset($this->body) ? 'POST' : 'GET'; + } + + public function setBody($body): Explain + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setId($id): Explain + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/FieldCaps.php b/util/output/7.6.1/Endpoints/FieldCaps.php new file mode 100644 index 000000000..074f0d568 --- /dev/null +++ b/util/output/7.6.1/Endpoints/FieldCaps.php @@ -0,0 +1,47 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class FieldCaps extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/$index/_field_caps"; + } + return "/_field_caps"; + } + + public function getParamWhitelist(): array + { + return [ + 'fields', + 'ignore_unavailable', + 'allow_no_indices', + 'expand_wildcards', + 'include_unmapped' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Endpoints/Get.php b/util/output/7.6.1/Endpoints/Get.php new file mode 100644 index 000000000..0419f28fe --- /dev/null +++ b/util/output/7.6.1/Endpoints/Get.php @@ -0,0 +1,78 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Get extends AbstractEndpoint +{ + + public function getURI(): string + { + if (isset($this->id) !== true) { + throw new RuntimeException( + 'id is required for get' + ); + } + $id = $this->id; + if (isset($this->index) !== true) { + throw new RuntimeException( + 'index is required for get' + ); + } + $index = $this->index; + $type = $this->type ?? null; + if (isset($type)) { + @trigger_error('Specifying types in urls has been deprecated', E_USER_DEPRECATED); + } + + if (isset($type)) { + return "/$index/$type/$id"; + } + return "/$index/_doc/$id"; + } + + public function getParamWhitelist(): array + { + return [ + 'stored_fields', + 'preference', + 'realtime', + 'refresh', + 'routing', + '_source', + '_source_excludes', + '_source_includes', + 'version', + 'version_type' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setId($id): Get + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/GetScript.php b/util/output/7.6.1/Endpoints/GetScript.php new file mode 100644 index 000000000..12520e29e --- /dev/null +++ b/util/output/7.6.1/Endpoints/GetScript.php @@ -0,0 +1,54 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetScript extends AbstractEndpoint +{ + + public function getURI(): string + { + $id = $this->id ?? null; + + if (isset($id)) { + return "/_scripts/$id"; + } + throw new RuntimeException('Missing parameter for the endpoint get_script'); + } + + public function getParamWhitelist(): array + { + return [ + 'master_timeout' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setId($id): GetScript + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/GetScriptContext.php b/util/output/7.6.1/Endpoints/GetScriptContext.php new file mode 100644 index 000000000..4bafa4e8d --- /dev/null +++ b/util/output/7.6.1/Endpoints/GetScriptContext.php @@ -0,0 +1,39 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetScriptContext extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_script_context"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Endpoints/GetScriptLanguages.php b/util/output/7.6.1/Endpoints/GetScriptLanguages.php new file mode 100644 index 000000000..3a641a925 --- /dev/null +++ b/util/output/7.6.1/Endpoints/GetScriptLanguages.php @@ -0,0 +1,39 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetScriptLanguages extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_script_language"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Endpoints/GetSource.php b/util/output/7.6.1/Endpoints/GetSource.php new file mode 100644 index 000000000..213563901 --- /dev/null +++ b/util/output/7.6.1/Endpoints/GetSource.php @@ -0,0 +1,77 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetSource extends AbstractEndpoint +{ + + public function getURI(): string + { + if (isset($this->id) !== true) { + throw new RuntimeException( + 'id is required for get_source' + ); + } + $id = $this->id; + if (isset($this->index) !== true) { + throw new RuntimeException( + 'index is required for get_source' + ); + } + $index = $this->index; + $type = $this->type ?? null; + if (isset($type)) { + @trigger_error('Specifying types in urls has been deprecated', E_USER_DEPRECATED); + } + + if (isset($type)) { + return "/$index/$type/$id/_source"; + } + return "/$index/_source/$id"; + } + + public function getParamWhitelist(): array + { + return [ + 'preference', + 'realtime', + 'refresh', + 'routing', + '_source', + '_source_excludes', + '_source_includes', + 'version', + 'version_type' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setId($id): GetSource + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Graph/Explore.php b/util/output/7.6.1/Endpoints/Graph/Explore.php new file mode 100644 index 000000000..3c927d5c9 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Graph/Explore.php @@ -0,0 +1,64 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Explore extends AbstractEndpoint +{ + + public function getURI(): string + { + if (isset($this->index) !== true) { + throw new RuntimeException( + 'index is required for explore' + ); + } + $index = $this->index; + $type = $this->type ?? null; + if (isset($type)) { + @trigger_error('Specifying types in urls has been deprecated', E_USER_DEPRECATED); + } + + if (isset($type)) { + return "/$index/$type/_graph/explore"; + } + return "/$index/_graph/explore"; + } + + public function getParamWhitelist(): array + { + return [ + 'routing', + 'timeout' + ]; + } + + public function getMethod(): string + { + return isset($this->body) ? 'POST' : 'GET'; + } + + public function setBody($body): Explore + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ilm/DeleteLifecycle.php b/util/output/7.6.1/Endpoints/Ilm/DeleteLifecycle.php new file mode 100644 index 000000000..d432e0f04 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ilm/DeleteLifecycle.php @@ -0,0 +1,55 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeleteLifecycle extends AbstractEndpoint +{ + protected $policy; + + public function getURI(): string + { + $policy = $this->policy ?? null; + + if (isset($policy)) { + return "/_ilm/policy/$policy"; + } + throw new RuntimeException('Missing parameter for the endpoint ilm.delete_lifecycle'); + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setPolicy($policy): DeleteLifecycle + { + if (isset($policy) !== true) { + return $this; + } + $this->policy = $policy; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ilm/ExplainLifecycle.php b/util/output/7.6.1/Endpoints/Ilm/ExplainLifecycle.php new file mode 100644 index 000000000..f2ccf99da --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ilm/ExplainLifecycle.php @@ -0,0 +1,45 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class ExplainLifecycle extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/$index/_ilm/explain"; + } + throw new RuntimeException('Missing parameter for the endpoint ilm.explain_lifecycle'); + } + + public function getParamWhitelist(): array + { + return [ + 'only_managed', + 'only_errors' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Endpoints/Ilm/GetLifecycle.php b/util/output/7.6.1/Endpoints/Ilm/GetLifecycle.php new file mode 100644 index 000000000..ba87f6d7c --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ilm/GetLifecycle.php @@ -0,0 +1,54 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetLifecycle extends AbstractEndpoint +{ + protected $policy; + + public function getURI(): string + { + $policy = $this->policy ?? null; + + if (isset($policy)) { + return "/_ilm/policy/$policy"; + } + return "/_ilm/policy"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setPolicy($policy): GetLifecycle + { + if (isset($policy) !== true) { + return $this; + } + $this->policy = $policy; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ilm/GetStatus.php b/util/output/7.6.1/Endpoints/Ilm/GetStatus.php new file mode 100644 index 000000000..7d3b804f7 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ilm/GetStatus.php @@ -0,0 +1,39 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetStatus extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_ilm/status"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Endpoints/Ilm/MoveToStep.php b/util/output/7.6.1/Endpoints/Ilm/MoveToStep.php new file mode 100644 index 000000000..974fc3af6 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ilm/MoveToStep.php @@ -0,0 +1,54 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class MoveToStep extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/_ilm/move/$index"; + } + throw new RuntimeException('Missing parameter for the endpoint ilm.move_to_step'); + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): MoveToStep + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ilm/PutLifecycle.php b/util/output/7.6.1/Endpoints/Ilm/PutLifecycle.php new file mode 100644 index 000000000..b3bc360e6 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ilm/PutLifecycle.php @@ -0,0 +1,65 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PutLifecycle extends AbstractEndpoint +{ + protected $policy; + + public function getURI(): string + { + $policy = $this->policy ?? null; + + if (isset($policy)) { + return "/_ilm/policy/$policy"; + } + throw new RuntimeException('Missing parameter for the endpoint ilm.put_lifecycle'); + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): PutLifecycle + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setPolicy($policy): PutLifecycle + { + if (isset($policy) !== true) { + return $this; + } + $this->policy = $policy; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ilm/RemovePolicy.php b/util/output/7.6.1/Endpoints/Ilm/RemovePolicy.php new file mode 100644 index 000000000..dcd87207b --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ilm/RemovePolicy.php @@ -0,0 +1,44 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class RemovePolicy extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/$index/_ilm/remove"; + } + throw new RuntimeException('Missing parameter for the endpoint ilm.remove_policy'); + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'POST'; + } +} diff --git a/util/output/7.6.1/Endpoints/Ilm/Retry.php b/util/output/7.6.1/Endpoints/Ilm/Retry.php new file mode 100644 index 000000000..9a06b0a4b --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ilm/Retry.php @@ -0,0 +1,44 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Retry extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/$index/_ilm/retry"; + } + throw new RuntimeException('Missing parameter for the endpoint ilm.retry'); + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'POST'; + } +} diff --git a/util/output/7.6.1/Endpoints/Ilm/Start.php b/util/output/7.6.1/Endpoints/Ilm/Start.php new file mode 100644 index 000000000..3f23bba84 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ilm/Start.php @@ -0,0 +1,39 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Start extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_ilm/start"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'POST'; + } +} diff --git a/util/output/7.6.1/Endpoints/Ilm/Stop.php b/util/output/7.6.1/Endpoints/Ilm/Stop.php new file mode 100644 index 000000000..015efffba --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ilm/Stop.php @@ -0,0 +1,39 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Stop extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_ilm/stop"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'POST'; + } +} diff --git a/util/output/7.6.1/Endpoints/Index.php b/util/output/7.6.1/Endpoints/Index.php new file mode 100644 index 000000000..f14e945bc --- /dev/null +++ b/util/output/7.6.1/Endpoints/Index.php @@ -0,0 +1,89 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Index extends AbstractEndpoint +{ + + public function getURI(): string + { + if (isset($this->index) !== true) { + throw new RuntimeException( + 'index is required for index' + ); + } + $index = $this->index; + $id = $this->id ?? null; + $type = $this->type ?? null; + if (isset($type)) { + @trigger_error('Specifying types in urls has been deprecated', E_USER_DEPRECATED); + } + + if (isset($type) && isset($id)) { + return "/$index/$type/$id"; + } + if (isset($id)) { + return "/$index/_doc/$id"; + } + if (isset($type)) { + return "/$index/$type"; + } + return "/$index/_doc"; + } + + public function getParamWhitelist(): array + { + return [ + 'wait_for_active_shards', + 'op_type', + 'refresh', + 'routing', + 'timeout', + 'version', + 'version_type', + 'if_seq_no', + 'if_primary_term', + 'pipeline' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): Index + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setId($id): Index + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Indices/Analyze.php b/util/output/7.6.1/Endpoints/Indices/Analyze.php new file mode 100644 index 000000000..0eb18f4ce --- /dev/null +++ b/util/output/7.6.1/Endpoints/Indices/Analyze.php @@ -0,0 +1,53 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Analyze extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/$index/_analyze"; + } + return "/_analyze"; + } + + public function getParamWhitelist(): array + { + return [ + 'index' + ]; + } + + public function getMethod(): string + { + return isset($this->body) ? 'POST' : 'GET'; + } + + public function setBody($body): Analyze + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Indices/ClearCache.php b/util/output/7.6.1/Endpoints/Indices/ClearCache.php new file mode 100644 index 000000000..72c025e0d --- /dev/null +++ b/util/output/7.6.1/Endpoints/Indices/ClearCache.php @@ -0,0 +1,50 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class ClearCache extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/$index/_cache/clear"; + } + return "/_cache/clear"; + } + + public function getParamWhitelist(): array + { + return [ + 'fielddata', + 'fields', + 'query', + 'ignore_unavailable', + 'allow_no_indices', + 'expand_wildcards', + 'index', + 'request' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } +} diff --git a/util/output/7.6.1/Endpoints/Indices/CloneIndices.php b/util/output/7.6.1/Endpoints/Indices/CloneIndices.php new file mode 100644 index 000000000..e57a549af --- /dev/null +++ b/util/output/7.6.1/Endpoints/Indices/CloneIndices.php @@ -0,0 +1,68 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class CloneIndices extends AbstractEndpoint +{ + protected $target; + + public function getURI(): string + { + $index = $this->index ?? null; + $target = $this->target ?? null; + + if (isset($index) && isset($target)) { + return "/$index/_clone/$target"; + } + throw new RuntimeException('Missing parameter for the endpoint indices.clone'); + } + + public function getParamWhitelist(): array + { + return [ + 'timeout', + 'master_timeout', + 'wait_for_active_shards' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): CloneIndices + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setTarget($target): CloneIndices + { + if (isset($target) !== true) { + return $this; + } + $this->target = $target; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Indices/Close.php b/util/output/7.6.1/Endpoints/Indices/Close.php new file mode 100644 index 000000000..bce0cd596 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Indices/Close.php @@ -0,0 +1,49 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Close extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/$index/_close"; + } + throw new RuntimeException('Missing parameter for the endpoint indices.close'); + } + + public function getParamWhitelist(): array + { + return [ + 'timeout', + 'master_timeout', + 'ignore_unavailable', + 'allow_no_indices', + 'expand_wildcards', + 'wait_for_active_shards' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } +} diff --git a/util/output/7.6.1/Endpoints/Indices/Create.php b/util/output/7.6.1/Endpoints/Indices/Create.php new file mode 100644 index 000000000..af1319052 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Indices/Create.php @@ -0,0 +1,57 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Create extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/$index"; + } + throw new RuntimeException('Missing parameter for the endpoint indices.create'); + } + + public function getParamWhitelist(): array + { + return [ + 'include_type_name', + 'wait_for_active_shards', + 'timeout', + 'master_timeout' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): Create + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Indices/Delete.php b/util/output/7.6.1/Endpoints/Indices/Delete.php new file mode 100644 index 000000000..f58c4dd82 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Indices/Delete.php @@ -0,0 +1,48 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Delete extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/$index"; + } + throw new RuntimeException('Missing parameter for the endpoint indices.delete'); + } + + public function getParamWhitelist(): array + { + return [ + 'timeout', + 'master_timeout', + 'ignore_unavailable', + 'allow_no_indices', + 'expand_wildcards' + ]; + } + + public function getMethod(): string + { + return 'DELETE'; + } +} diff --git a/util/output/7.6.1/Endpoints/Indices/DeleteAlias.php b/util/output/7.6.1/Endpoints/Indices/DeleteAlias.php new file mode 100644 index 000000000..b71ec62b8 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Indices/DeleteAlias.php @@ -0,0 +1,67 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeleteAlias extends AbstractEndpoint +{ + protected $name; + + public function getURI(): string + { + if (isset($this->index) !== true) { + throw new RuntimeException( + 'index is required for delete_alias' + ); + } + $index = $this->index; + if (isset($this->name) !== true) { + throw new RuntimeException( + 'name is required for delete_alias' + ); + } + $name = $this->name; + + return "/$index/_alias/$name"; + } + + public function getParamWhitelist(): array + { + return [ + 'timeout', + 'master_timeout' + ]; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setName($name): DeleteAlias + { + if (isset($name) !== true) { + return $this; + } + if (is_array($name) === true) { + $name = implode(",", $name); + } + $this->name = $name; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Indices/DeleteTemplate.php b/util/output/7.6.1/Endpoints/Indices/DeleteTemplate.php new file mode 100644 index 000000000..452d9fe8f --- /dev/null +++ b/util/output/7.6.1/Endpoints/Indices/DeleteTemplate.php @@ -0,0 +1,56 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeleteTemplate extends AbstractEndpoint +{ + protected $name; + + public function getURI(): string + { + $name = $this->name ?? null; + + if (isset($name)) { + return "/_template/$name"; + } + throw new RuntimeException('Missing parameter for the endpoint indices.delete_template'); + } + + public function getParamWhitelist(): array + { + return [ + 'timeout', + 'master_timeout' + ]; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setName($name): DeleteTemplate + { + if (isset($name) !== true) { + return $this; + } + $this->name = $name; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Indices/Exists.php b/util/output/7.6.1/Endpoints/Indices/Exists.php new file mode 100644 index 000000000..a64ba49b0 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Indices/Exists.php @@ -0,0 +1,49 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Exists extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/$index"; + } + throw new RuntimeException('Missing parameter for the endpoint indices.exists'); + } + + public function getParamWhitelist(): array + { + return [ + 'local', + 'ignore_unavailable', + 'allow_no_indices', + 'expand_wildcards', + 'flat_settings', + 'include_defaults' + ]; + } + + public function getMethod(): string + { + return 'HEAD'; + } +} diff --git a/util/output/7.6.1/Endpoints/Indices/ExistsAlias.php b/util/output/7.6.1/Endpoints/Indices/ExistsAlias.php new file mode 100644 index 000000000..fb462a965 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Indices/ExistsAlias.php @@ -0,0 +1,67 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class ExistsAlias extends AbstractEndpoint +{ + protected $name; + + public function getURI(): string + { + if (isset($this->name) !== true) { + throw new RuntimeException( + 'name is required for exists_alias' + ); + } + $name = $this->name; + $index = $this->index ?? null; + + if (isset($index)) { + return "/$index/_alias/$name"; + } + return "/_alias/$name"; + } + + public function getParamWhitelist(): array + { + return [ + 'ignore_unavailable', + 'allow_no_indices', + 'expand_wildcards', + 'local' + ]; + } + + public function getMethod(): string + { + return 'HEAD'; + } + + public function setName($name): ExistsAlias + { + if (isset($name) !== true) { + return $this; + } + if (is_array($name) === true) { + $name = implode(",", $name); + } + $this->name = $name; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Indices/ExistsTemplate.php b/util/output/7.6.1/Endpoints/Indices/ExistsTemplate.php new file mode 100644 index 000000000..7bf756cb9 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Indices/ExistsTemplate.php @@ -0,0 +1,60 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class ExistsTemplate extends AbstractEndpoint +{ + protected $name; + + public function getURI(): string + { + $name = $this->name ?? null; + + if (isset($name)) { + return "/_template/$name"; + } + throw new RuntimeException('Missing parameter for the endpoint indices.exists_template'); + } + + public function getParamWhitelist(): array + { + return [ + 'flat_settings', + 'master_timeout', + 'local' + ]; + } + + public function getMethod(): string + { + return 'HEAD'; + } + + public function setName($name): ExistsTemplate + { + if (isset($name) !== true) { + return $this; + } + if (is_array($name) === true) { + $name = implode(",", $name); + } + $this->name = $name; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Indices/ExistsType.php b/util/output/7.6.1/Endpoints/Indices/ExistsType.php new file mode 100644 index 000000000..057d2803d --- /dev/null +++ b/util/output/7.6.1/Endpoints/Indices/ExistsType.php @@ -0,0 +1,51 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class ExistsType extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + $type = $this->type ?? null; + if (isset($type)) { + @trigger_error('Specifying types in urls has been deprecated', E_USER_DEPRECATED); + } + + if (isset($index) && isset($type)) { + return "/$index/_mapping/$type"; + } + throw new RuntimeException('Missing parameter for the endpoint indices.exists_type'); + } + + public function getParamWhitelist(): array + { + return [ + 'ignore_unavailable', + 'allow_no_indices', + 'expand_wildcards', + 'local' + ]; + } + + public function getMethod(): string + { + return 'HEAD'; + } +} diff --git a/util/output/7.6.1/Endpoints/Indices/Flush.php b/util/output/7.6.1/Endpoints/Indices/Flush.php new file mode 100644 index 000000000..351f2250c --- /dev/null +++ b/util/output/7.6.1/Endpoints/Indices/Flush.php @@ -0,0 +1,47 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Flush extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/$index/_flush"; + } + return "/_flush"; + } + + public function getParamWhitelist(): array + { + return [ + 'force', + 'wait_if_ongoing', + 'ignore_unavailable', + 'allow_no_indices', + 'expand_wildcards' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } +} diff --git a/util/output/7.6.1/Endpoints/Indices/FlushSynced.php b/util/output/7.6.1/Endpoints/Indices/FlushSynced.php new file mode 100644 index 000000000..25ede0cbe --- /dev/null +++ b/util/output/7.6.1/Endpoints/Indices/FlushSynced.php @@ -0,0 +1,45 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class FlushSynced extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/$index/_flush/synced"; + } + return "/_flush/synced"; + } + + public function getParamWhitelist(): array + { + return [ + 'ignore_unavailable', + 'allow_no_indices', + 'expand_wildcards' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } +} diff --git a/util/output/7.6.1/Endpoints/Indices/ForceMerge.php b/util/output/7.6.1/Endpoints/Indices/ForceMerge.php new file mode 100644 index 000000000..c62336463 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Indices/ForceMerge.php @@ -0,0 +1,48 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class ForceMerge extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/$index/_forcemerge"; + } + return "/_forcemerge"; + } + + public function getParamWhitelist(): array + { + return [ + 'flush', + 'ignore_unavailable', + 'allow_no_indices', + 'expand_wildcards', + 'max_num_segments', + 'only_expunge_deletes' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } +} diff --git a/util/output/7.6.1/Endpoints/Indices/Freeze.php b/util/output/7.6.1/Endpoints/Indices/Freeze.php new file mode 100644 index 000000000..110925ee9 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Indices/Freeze.php @@ -0,0 +1,49 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Freeze extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->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' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } +} diff --git a/util/output/7.6.1/Endpoints/Indices/Get.php b/util/output/7.6.1/Endpoints/Indices/Get.php new file mode 100644 index 000000000..bce01a352 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Indices/Get.php @@ -0,0 +1,51 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Get extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/$index"; + } + throw new RuntimeException('Missing parameter for the endpoint indices.get'); + } + + public function getParamWhitelist(): array + { + return [ + 'include_type_name', + 'local', + 'ignore_unavailable', + 'allow_no_indices', + 'expand_wildcards', + 'flat_settings', + 'include_defaults', + 'master_timeout' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Endpoints/Indices/GetAlias.php b/util/output/7.6.1/Endpoints/Indices/GetAlias.php new file mode 100644 index 000000000..17aa51b22 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Indices/GetAlias.php @@ -0,0 +1,67 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetAlias extends AbstractEndpoint +{ + protected $name; + + public function getURI(): string + { + $name = $this->name ?? null; + $index = $this->index ?? null; + + if (isset($index) && isset($name)) { + return "/$index/_alias/$name"; + } + if (isset($index)) { + return "/$index/_alias"; + } + if (isset($name)) { + return "/_alias/$name"; + } + return "/_alias"; + } + + public function getParamWhitelist(): array + { + return [ + 'ignore_unavailable', + 'allow_no_indices', + 'expand_wildcards', + 'local' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setName($name): GetAlias + { + if (isset($name) !== true) { + return $this; + } + if (is_array($name) === true) { + $name = implode(",", $name); + } + $this->name = $name; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Indices/GetFieldMapping.php b/util/output/7.6.1/Endpoints/Indices/GetFieldMapping.php new file mode 100644 index 000000000..ef019adab --- /dev/null +++ b/util/output/7.6.1/Endpoints/Indices/GetFieldMapping.php @@ -0,0 +1,79 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetFieldMapping extends AbstractEndpoint +{ + protected $fields; + + public function getURI(): string + { + if (isset($this->fields) !== true) { + throw new RuntimeException( + 'fields is required for get_field_mapping' + ); + } + $fields = $this->fields; + $index = $this->index ?? null; + $type = $this->type ?? null; + if (isset($type)) { + @trigger_error('Specifying types in urls has been deprecated', E_USER_DEPRECATED); + } + + if (isset($index) && isset($type)) { + return "/$index/_mapping/$type/field/$fields"; + } + if (isset($index)) { + return "/$index/_mapping/field/$fields"; + } + if (isset($type)) { + return "/_mapping/$type/field/$fields"; + } + return "/_mapping/field/$fields"; + } + + public function getParamWhitelist(): array + { + return [ + 'include_type_name', + 'include_defaults', + 'ignore_unavailable', + 'allow_no_indices', + 'expand_wildcards', + 'local' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setFields($fields): GetFieldMapping + { + if (isset($fields) !== true) { + return $this; + } + if (is_array($fields) === true) { + $fields = implode(",", $fields); + } + $this->fields = $fields; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Indices/GetMapping.php b/util/output/7.6.1/Endpoints/Indices/GetMapping.php new file mode 100644 index 000000000..5f91c124b --- /dev/null +++ b/util/output/7.6.1/Endpoints/Indices/GetMapping.php @@ -0,0 +1,58 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetMapping extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + $type = $this->type ?? null; + if (isset($type)) { + @trigger_error('Specifying types in urls has been deprecated', E_USER_DEPRECATED); + } + + if (isset($index) && isset($type)) { + return "/$index/_mapping/$type"; + } + if (isset($index)) { + return "/$index/_mapping"; + } + if (isset($type)) { + return "/_mapping/$type"; + } + return "/_mapping"; + } + + public function getParamWhitelist(): array + { + return [ + 'include_type_name', + 'ignore_unavailable', + 'allow_no_indices', + 'expand_wildcards', + 'master_timeout', + 'local' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Endpoints/Indices/GetSettings.php b/util/output/7.6.1/Endpoints/Indices/GetSettings.php new file mode 100644 index 000000000..8baff7040 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Indices/GetSettings.php @@ -0,0 +1,70 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetSettings extends AbstractEndpoint +{ + protected $name; + + public function getURI(): string + { + $index = $this->index ?? null; + $name = $this->name ?? null; + + if (isset($index) && isset($name)) { + return "/$index/_settings/$name"; + } + if (isset($index)) { + return "/$index/_settings"; + } + if (isset($name)) { + return "/_settings/$name"; + } + return "/_settings"; + } + + public function getParamWhitelist(): array + { + return [ + 'master_timeout', + 'ignore_unavailable', + 'allow_no_indices', + 'expand_wildcards', + 'flat_settings', + 'local', + 'include_defaults' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setName($name): GetSettings + { + if (isset($name) !== true) { + return $this; + } + if (is_array($name) === true) { + $name = implode(",", $name); + } + $this->name = $name; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Indices/GetTemplate.php b/util/output/7.6.1/Endpoints/Indices/GetTemplate.php new file mode 100644 index 000000000..82c2da612 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Indices/GetTemplate.php @@ -0,0 +1,60 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetTemplate extends AbstractEndpoint +{ + protected $name; + + public function getURI(): string + { + $name = $this->name ?? null; + + if (isset($name)) { + return "/_template/$name"; + } + return "/_template"; + } + + public function getParamWhitelist(): array + { + return [ + 'include_type_name', + 'flat_settings', + 'master_timeout', + 'local' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setName($name): GetTemplate + { + if (isset($name) !== true) { + return $this; + } + if (is_array($name) === true) { + $name = implode(",", $name); + } + $this->name = $name; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Indices/GetUpgrade.php b/util/output/7.6.1/Endpoints/Indices/GetUpgrade.php new file mode 100644 index 000000000..79e7035a8 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Indices/GetUpgrade.php @@ -0,0 +1,45 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetUpgrade extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/$index/_upgrade"; + } + return "/_upgrade"; + } + + public function getParamWhitelist(): array + { + return [ + 'ignore_unavailable', + 'allow_no_indices', + 'expand_wildcards' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Endpoints/Indices/Open.php b/util/output/7.6.1/Endpoints/Indices/Open.php new file mode 100644 index 000000000..2c3014260 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Indices/Open.php @@ -0,0 +1,49 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Open extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/$index/_open"; + } + throw new RuntimeException('Missing parameter for the endpoint indices.open'); + } + + public function getParamWhitelist(): array + { + return [ + 'timeout', + 'master_timeout', + 'ignore_unavailable', + 'allow_no_indices', + 'expand_wildcards', + 'wait_for_active_shards' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } +} diff --git a/util/output/7.6.1/Endpoints/Indices/PutAlias.php b/util/output/7.6.1/Endpoints/Indices/PutAlias.php new file mode 100644 index 000000000..36a4c4055 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Indices/PutAlias.php @@ -0,0 +1,74 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PutAlias extends AbstractEndpoint +{ + protected $name; + + public function getURI(): string + { + if (isset($this->index) !== true) { + throw new RuntimeException( + 'index is required for put_alias' + ); + } + $index = $this->index; + if (isset($this->name) !== true) { + throw new RuntimeException( + 'name is required for put_alias' + ); + } + $name = $this->name; + + return "/$index/_alias/$name"; + } + + public function getParamWhitelist(): array + { + return [ + 'timeout', + 'master_timeout' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): PutAlias + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setName($name): PutAlias + { + if (isset($name) !== true) { + return $this; + } + $this->name = $name; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Indices/PutMapping.php b/util/output/7.6.1/Endpoints/Indices/PutMapping.php new file mode 100644 index 000000000..449b87ee9 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Indices/PutMapping.php @@ -0,0 +1,69 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PutMapping extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + $type = $this->type ?? null; + if (isset($type)) { + @trigger_error('Specifying types in urls has been deprecated', E_USER_DEPRECATED); + } + + if (isset($index) && isset($type)) { + return "/$index/$type/_mapping"; + } + if (isset($index)) { + return "/$index/_mapping"; + } + if (isset($type)) { + return "/_mappings/$type"; + } + throw new RuntimeException('Missing parameter for the endpoint indices.put_mapping'); + } + + public function getParamWhitelist(): array + { + return [ + 'include_type_name', + 'timeout', + 'master_timeout', + 'ignore_unavailable', + 'allow_no_indices', + 'expand_wildcards' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): PutMapping + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Indices/PutSettings.php b/util/output/7.6.1/Endpoints/Indices/PutSettings.php new file mode 100644 index 000000000..47406ab95 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Indices/PutSettings.php @@ -0,0 +1,59 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PutSettings extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/$index/_settings"; + } + return "/_settings"; + } + + public function getParamWhitelist(): array + { + return [ + 'master_timeout', + 'timeout', + 'preserve_existing', + 'ignore_unavailable', + 'allow_no_indices', + 'expand_wildcards', + 'flat_settings' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): PutSettings + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Indices/PutTemplate.php b/util/output/7.6.1/Endpoints/Indices/PutTemplate.php new file mode 100644 index 000000000..d29cf9200 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Indices/PutTemplate.php @@ -0,0 +1,70 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PutTemplate extends AbstractEndpoint +{ + protected $name; + + public function getURI(): string + { + $name = $this->name ?? null; + + if (isset($name)) { + return "/_template/$name"; + } + throw new RuntimeException('Missing parameter for the endpoint indices.put_template'); + } + + public function getParamWhitelist(): array + { + return [ + 'include_type_name', + 'order', + 'create', + 'timeout', + 'master_timeout', + 'flat_settings' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): PutTemplate + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setName($name): PutTemplate + { + if (isset($name) !== true) { + return $this; + } + $this->name = $name; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Indices/Recovery.php b/util/output/7.6.1/Endpoints/Indices/Recovery.php new file mode 100644 index 000000000..7a5e056ad --- /dev/null +++ b/util/output/7.6.1/Endpoints/Indices/Recovery.php @@ -0,0 +1,44 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Recovery extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/$index/_recovery"; + } + return "/_recovery"; + } + + public function getParamWhitelist(): array + { + return [ + 'detailed', + 'active_only' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Endpoints/Indices/Refresh.php b/util/output/7.6.1/Endpoints/Indices/Refresh.php new file mode 100644 index 000000000..c8acf20a4 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Indices/Refresh.php @@ -0,0 +1,45 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Refresh extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/$index/_refresh"; + } + return "/_refresh"; + } + + public function getParamWhitelist(): array + { + return [ + 'ignore_unavailable', + 'allow_no_indices', + 'expand_wildcards' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } +} diff --git a/util/output/7.6.1/Endpoints/Indices/ReloadSearchAnalyzers.php b/util/output/7.6.1/Endpoints/Indices/ReloadSearchAnalyzers.php new file mode 100644 index 000000000..a2775aec0 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Indices/ReloadSearchAnalyzers.php @@ -0,0 +1,46 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class ReloadSearchAnalyzers extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/$index/_reload_search_analyzers"; + } + throw new RuntimeException('Missing parameter for the endpoint indices.reload_search_analyzers'); + } + + public function getParamWhitelist(): array + { + return [ + 'ignore_unavailable', + 'allow_no_indices', + 'expand_wildcards' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Endpoints/Indices/Rollover.php b/util/output/7.6.1/Endpoints/Indices/Rollover.php new file mode 100644 index 000000000..dfed6498a --- /dev/null +++ b/util/output/7.6.1/Endpoints/Indices/Rollover.php @@ -0,0 +1,86 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Rollover extends AbstractEndpoint +{ + protected $alias; + protected $new_index; + + public function getURI(): string + { + if (isset($this->alias) !== true) { + throw new RuntimeException( + 'alias is required for rollover' + ); + } + $alias = $this->alias; + $new_index = $this->new_index ?? null; + + if (isset($new_index)) { + return "/$alias/_rollover/$new_index"; + } + return "/$alias/_rollover"; + } + + public function getParamWhitelist(): array + { + return [ + 'include_type_name', + 'timeout', + 'dry_run', + 'master_timeout', + 'wait_for_active_shards' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): Rollover + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setAlias($alias): Rollover + { + if (isset($alias) !== true) { + return $this; + } + $this->alias = $alias; + + return $this; + } + + public function setNewIndex($new_index): Rollover + { + if (isset($new_index) !== true) { + return $this; + } + $this->new_index = $new_index; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Indices/Segments.php b/util/output/7.6.1/Endpoints/Indices/Segments.php new file mode 100644 index 000000000..3ccfa96a1 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Indices/Segments.php @@ -0,0 +1,46 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Segments extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/$index/_segments"; + } + return "/_segments"; + } + + public function getParamWhitelist(): array + { + return [ + 'ignore_unavailable', + 'allow_no_indices', + 'expand_wildcards', + 'verbose' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Endpoints/Indices/ShardStores.php b/util/output/7.6.1/Endpoints/Indices/ShardStores.php new file mode 100644 index 000000000..0f861a46d --- /dev/null +++ b/util/output/7.6.1/Endpoints/Indices/ShardStores.php @@ -0,0 +1,46 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class ShardStores extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/$index/_shard_stores"; + } + return "/_shard_stores"; + } + + public function getParamWhitelist(): array + { + return [ + 'status', + 'ignore_unavailable', + 'allow_no_indices', + 'expand_wildcards' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Endpoints/Indices/Shrink.php b/util/output/7.6.1/Endpoints/Indices/Shrink.php new file mode 100644 index 000000000..2b1926913 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Indices/Shrink.php @@ -0,0 +1,69 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Shrink extends AbstractEndpoint +{ + protected $target; + + public function getURI(): string + { + $index = $this->index ?? null; + $target = $this->target ?? null; + + if (isset($index) && isset($target)) { + return "/$index/_shrink/$target"; + } + throw new RuntimeException('Missing parameter for the endpoint indices.shrink'); + } + + public function getParamWhitelist(): array + { + return [ + 'copy_settings', + 'timeout', + 'master_timeout', + 'wait_for_active_shards' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): Shrink + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setTarget($target): Shrink + { + if (isset($target) !== true) { + return $this; + } + $this->target = $target; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Indices/Split.php b/util/output/7.6.1/Endpoints/Indices/Split.php new file mode 100644 index 000000000..b50abe281 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Indices/Split.php @@ -0,0 +1,69 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Split extends AbstractEndpoint +{ + protected $target; + + public function getURI(): string + { + $index = $this->index ?? null; + $target = $this->target ?? null; + + if (isset($index) && isset($target)) { + return "/$index/_split/$target"; + } + throw new RuntimeException('Missing parameter for the endpoint indices.split'); + } + + public function getParamWhitelist(): array + { + return [ + 'copy_settings', + 'timeout', + 'master_timeout', + 'wait_for_active_shards' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): Split + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setTarget($target): Split + { + if (isset($target) !== true) { + return $this; + } + $this->target = $target; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Indices/Stats.php b/util/output/7.6.1/Endpoints/Indices/Stats.php new file mode 100644 index 000000000..401276807 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Indices/Stats.php @@ -0,0 +1,73 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Stats extends AbstractEndpoint +{ + protected $metric; + + public function getURI(): string + { + $metric = $this->metric ?? null; + $index = $this->index ?? null; + + if (isset($index) && isset($metric)) { + return "/$index/_stats/$metric"; + } + if (isset($metric)) { + return "/_stats/$metric"; + } + if (isset($index)) { + return "/$index/_stats"; + } + return "/_stats"; + } + + public function getParamWhitelist(): array + { + return [ + 'completion_fields', + 'fielddata_fields', + 'fields', + 'groups', + 'level', + 'types', + 'include_segment_file_sizes', + 'include_unloaded_segments', + 'expand_wildcards', + 'forbid_closed_indices' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setMetric($metric): Stats + { + if (isset($metric) !== true) { + return $this; + } + if (is_array($metric) === true) { + $metric = implode(",", $metric); + } + $this->metric = $metric; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Indices/Unfreeze.php b/util/output/7.6.1/Endpoints/Indices/Unfreeze.php new file mode 100644 index 000000000..848d2d259 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Indices/Unfreeze.php @@ -0,0 +1,49 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Unfreeze extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->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' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } +} diff --git a/util/output/7.6.1/Endpoints/Indices/UpdateAliases.php b/util/output/7.6.1/Endpoints/Indices/UpdateAliases.php new file mode 100644 index 000000000..62a722585 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Indices/UpdateAliases.php @@ -0,0 +1,50 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class UpdateAliases extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_aliases"; + } + + public function getParamWhitelist(): array + { + return [ + 'timeout', + 'master_timeout' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): UpdateAliases + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Indices/Upgrade.php b/util/output/7.6.1/Endpoints/Indices/Upgrade.php new file mode 100644 index 000000000..8d46c3351 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Indices/Upgrade.php @@ -0,0 +1,47 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Upgrade extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/$index/_upgrade"; + } + return "/_upgrade"; + } + + public function getParamWhitelist(): array + { + return [ + 'allow_no_indices', + 'expand_wildcards', + 'ignore_unavailable', + 'wait_for_completion', + 'only_ancient_segments' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } +} diff --git a/util/output/7.6.1/Endpoints/Indices/ValidateQuery.php b/util/output/7.6.1/Endpoints/Indices/ValidateQuery.php new file mode 100644 index 000000000..7679fbf14 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Indices/ValidateQuery.php @@ -0,0 +1,71 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class ValidateQuery extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + $type = $this->type ?? null; + if (isset($type)) { + @trigger_error('Specifying types in urls has been deprecated', E_USER_DEPRECATED); + } + + if (isset($index) && isset($type)) { + return "/$index/$type/_validate/query"; + } + if (isset($index)) { + return "/$index/_validate/query"; + } + return "/_validate/query"; + } + + public function getParamWhitelist(): array + { + return [ + 'explain', + 'ignore_unavailable', + 'allow_no_indices', + 'expand_wildcards', + 'q', + 'analyzer', + 'analyze_wildcard', + 'default_operator', + 'df', + 'lenient', + 'rewrite', + 'all_shards' + ]; + } + + public function getMethod(): string + { + return isset($this->body) ? 'POST' : 'GET'; + } + + public function setBody($body): ValidateQuery + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Info.php b/util/output/7.6.1/Endpoints/Info.php new file mode 100644 index 000000000..0f1a67288 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Info.php @@ -0,0 +1,39 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Info extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Endpoints/Ingest/DeletePipeline.php b/util/output/7.6.1/Endpoints/Ingest/DeletePipeline.php new file mode 100644 index 000000000..fddad74fb --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ingest/DeletePipeline.php @@ -0,0 +1,55 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeletePipeline extends AbstractEndpoint +{ + + public function getURI(): string + { + $id = $this->id ?? null; + + if (isset($id)) { + return "/_ingest/pipeline/$id"; + } + throw new RuntimeException('Missing parameter for the endpoint ingest.delete_pipeline'); + } + + public function getParamWhitelist(): array + { + return [ + 'master_timeout', + 'timeout' + ]; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setId($id): DeletePipeline + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ingest/GetPipeline.php b/util/output/7.6.1/Endpoints/Ingest/GetPipeline.php new file mode 100644 index 000000000..a1ee58388 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ingest/GetPipeline.php @@ -0,0 +1,53 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetPipeline extends AbstractEndpoint +{ + + public function getURI(): string + { + $id = $this->id ?? null; + + if (isset($id)) { + return "/_ingest/pipeline/$id"; + } + return "/_ingest/pipeline"; + } + + public function getParamWhitelist(): array + { + return [ + 'master_timeout' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setId($id): GetPipeline + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ingest/ProcessorGrok.php b/util/output/7.6.1/Endpoints/Ingest/ProcessorGrok.php new file mode 100644 index 000000000..2ffe7b868 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ingest/ProcessorGrok.php @@ -0,0 +1,39 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class ProcessorGrok extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_ingest/processor/grok"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Endpoints/Ingest/PutPipeline.php b/util/output/7.6.1/Endpoints/Ingest/PutPipeline.php new file mode 100644 index 000000000..8624b6f1f --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ingest/PutPipeline.php @@ -0,0 +1,65 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PutPipeline extends AbstractEndpoint +{ + + public function getURI(): string + { + $id = $this->id ?? null; + + if (isset($id)) { + return "/_ingest/pipeline/$id"; + } + throw new RuntimeException('Missing parameter for the endpoint ingest.put_pipeline'); + } + + public function getParamWhitelist(): array + { + return [ + 'master_timeout', + 'timeout' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): PutPipeline + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setId($id): PutPipeline + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ingest/Simulate.php b/util/output/7.6.1/Endpoints/Ingest/Simulate.php new file mode 100644 index 000000000..515bd8b7a --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ingest/Simulate.php @@ -0,0 +1,63 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Simulate extends AbstractEndpoint +{ + + public function getURI(): string + { + $id = $this->id ?? null; + + if (isset($id)) { + return "/_ingest/pipeline/$id/_simulate"; + } + return "/_ingest/pipeline/_simulate"; + } + + public function getParamWhitelist(): array + { + return [ + 'verbose' + ]; + } + + public function getMethod(): string + { + return isset($this->body) ? 'POST' : 'GET'; + } + + public function setBody($body): Simulate + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setId($id): Simulate + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/License/Delete.php b/util/output/7.6.1/Endpoints/License/Delete.php new file mode 100644 index 000000000..bc098a2f2 --- /dev/null +++ b/util/output/7.6.1/Endpoints/License/Delete.php @@ -0,0 +1,37 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Delete extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_license"; + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'DELETE'; + } +} diff --git a/util/output/7.6.1/Endpoints/License/Get.php b/util/output/7.6.1/Endpoints/License/Get.php new file mode 100644 index 000000000..f5f17ea32 --- /dev/null +++ b/util/output/7.6.1/Endpoints/License/Get.php @@ -0,0 +1,40 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Get extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_license"; + } + + public function getParamWhitelist(): array + { + return [ + 'local', + 'accept_enterprise' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Endpoints/License/GetBasicStatus.php b/util/output/7.6.1/Endpoints/License/GetBasicStatus.php new file mode 100644 index 000000000..65e9bc3c3 --- /dev/null +++ b/util/output/7.6.1/Endpoints/License/GetBasicStatus.php @@ -0,0 +1,39 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetBasicStatus extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_license/basic_status"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Endpoints/License/GetTrialStatus.php b/util/output/7.6.1/Endpoints/License/GetTrialStatus.php new file mode 100644 index 000000000..2bcdb7b87 --- /dev/null +++ b/util/output/7.6.1/Endpoints/License/GetTrialStatus.php @@ -0,0 +1,39 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetTrialStatus extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_license/trial_status"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Endpoints/License/Post.php b/util/output/7.6.1/Endpoints/License/Post.php new file mode 100644 index 000000000..e3c4b8bbf --- /dev/null +++ b/util/output/7.6.1/Endpoints/License/Post.php @@ -0,0 +1,49 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Post extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_license"; + } + + public function getParamWhitelist(): array + { + return [ + 'acknowledge' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): Post + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/License/PostStartBasic.php b/util/output/7.6.1/Endpoints/License/PostStartBasic.php new file mode 100644 index 000000000..0ca0a2101 --- /dev/null +++ b/util/output/7.6.1/Endpoints/License/PostStartBasic.php @@ -0,0 +1,39 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PostStartBasic extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_license/start_basic"; + } + + public function getParamWhitelist(): array + { + return [ + 'acknowledge' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } +} diff --git a/util/output/7.6.1/Endpoints/License/PostStartTrial.php b/util/output/7.6.1/Endpoints/License/PostStartTrial.php new file mode 100644 index 000000000..4b30a474f --- /dev/null +++ b/util/output/7.6.1/Endpoints/License/PostStartTrial.php @@ -0,0 +1,40 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PostStartTrial extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_license/start_trial"; + } + + public function getParamWhitelist(): array + { + return [ + 'type', + 'acknowledge' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } +} diff --git a/util/output/7.6.1/Endpoints/MTermVectors.php b/util/output/7.6.1/Endpoints/MTermVectors.php new file mode 100644 index 000000000..719860506 --- /dev/null +++ b/util/output/7.6.1/Endpoints/MTermVectors.php @@ -0,0 +1,71 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class MTermVectors extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + $type = $this->type ?? null; + if (isset($type)) { + @trigger_error('Specifying types in urls has been deprecated', E_USER_DEPRECATED); + } + + if (isset($index) && isset($type)) { + return "/$index/$type/_mtermvectors"; + } + if (isset($index)) { + return "/$index/_mtermvectors"; + } + return "/_mtermvectors"; + } + + public function getParamWhitelist(): array + { + return [ + 'ids', + 'term_statistics', + 'field_statistics', + 'fields', + 'offsets', + 'positions', + 'payloads', + 'preference', + 'routing', + 'realtime', + 'version', + 'version_type' + ]; + } + + public function getMethod(): string + { + return isset($this->body) ? 'POST' : 'GET'; + } + + public function setBody($body): MTermVectors + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Mget.php b/util/output/7.6.1/Endpoints/Mget.php new file mode 100644 index 000000000..69b89659d --- /dev/null +++ b/util/output/7.6.1/Endpoints/Mget.php @@ -0,0 +1,67 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Mget extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + $type = $this->type ?? null; + if (isset($type)) { + @trigger_error('Specifying types in urls has been deprecated', E_USER_DEPRECATED); + } + + if (isset($index) && isset($type)) { + return "/$index/$type/_mget"; + } + if (isset($index)) { + return "/$index/_mget"; + } + return "/_mget"; + } + + public function getParamWhitelist(): array + { + return [ + 'stored_fields', + 'preference', + 'realtime', + 'refresh', + 'routing', + '_source', + '_source_excludes', + '_source_includes' + ]; + } + + public function getMethod(): string + { + return isset($this->body) ? 'POST' : 'GET'; + } + + public function setBody($body): Mget + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Migration/Deprecations.php b/util/output/7.6.1/Endpoints/Migration/Deprecations.php new file mode 100644 index 000000000..2c8b33de8 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Migration/Deprecations.php @@ -0,0 +1,43 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Deprecations extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/$index/_migration/deprecations"; + } + return "/_migration/deprecations"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/CloseJob.php b/util/output/7.6.1/Endpoints/Ml/CloseJob.php new file mode 100644 index 000000000..c67058909 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/CloseJob.php @@ -0,0 +1,67 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class CloseJob extends AbstractEndpoint +{ + protected $job_id; + + public function getURI(): string + { + $job_id = $this->job_id ?? null; + + if (isset($job_id)) { + return "/_ml/anomaly_detectors/$job_id/_close"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.close_job'); + } + + public function getParamWhitelist(): array + { + return [ + 'allow_no_jobs', + 'force', + 'timeout' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): CloseJob + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setJobId($job_id): CloseJob + { + if (isset($job_id) !== true) { + return $this; + } + $this->job_id = $job_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/DeleteCalendar.php b/util/output/7.6.1/Endpoints/Ml/DeleteCalendar.php new file mode 100644 index 000000000..489929dcd --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/DeleteCalendar.php @@ -0,0 +1,53 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeleteCalendar extends AbstractEndpoint +{ + protected $calendar_id; + + public function getURI(): string + { + $calendar_id = $this->calendar_id ?? null; + + if (isset($calendar_id)) { + return "/_ml/calendars/$calendar_id"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.delete_calendar'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setCalendarId($calendar_id): DeleteCalendar + { + if (isset($calendar_id) !== true) { + return $this; + } + $this->calendar_id = $calendar_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/DeleteCalendarEvent.php b/util/output/7.6.1/Endpoints/Ml/DeleteCalendarEvent.php new file mode 100644 index 000000000..8eb6761e4 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/DeleteCalendarEvent.php @@ -0,0 +1,65 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeleteCalendarEvent extends AbstractEndpoint +{ + protected $calendar_id; + protected $event_id; + + public function getURI(): string + { + $calendar_id = $this->calendar_id ?? null; + $event_id = $this->event_id ?? null; + + if (isset($calendar_id) && isset($event_id)) { + return "/_ml/calendars/$calendar_id/events/$event_id"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.delete_calendar_event'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setCalendarId($calendar_id): DeleteCalendarEvent + { + if (isset($calendar_id) !== true) { + return $this; + } + $this->calendar_id = $calendar_id; + + return $this; + } + + public function setEventId($event_id): DeleteCalendarEvent + { + if (isset($event_id) !== true) { + return $this; + } + $this->event_id = $event_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/DeleteCalendarJob.php b/util/output/7.6.1/Endpoints/Ml/DeleteCalendarJob.php new file mode 100644 index 000000000..ad99cf7ef --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/DeleteCalendarJob.php @@ -0,0 +1,65 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeleteCalendarJob extends AbstractEndpoint +{ + protected $calendar_id; + protected $job_id; + + public function getURI(): string + { + $calendar_id = $this->calendar_id ?? null; + $job_id = $this->job_id ?? null; + + if (isset($calendar_id) && isset($job_id)) { + return "/_ml/calendars/$calendar_id/jobs/$job_id"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.delete_calendar_job'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setCalendarId($calendar_id): DeleteCalendarJob + { + if (isset($calendar_id) !== true) { + return $this; + } + $this->calendar_id = $calendar_id; + + return $this; + } + + public function setJobId($job_id): DeleteCalendarJob + { + if (isset($job_id) !== true) { + return $this; + } + $this->job_id = $job_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/DeleteDataFrameAnalytics.php b/util/output/7.6.1/Endpoints/Ml/DeleteDataFrameAnalytics.php new file mode 100644 index 000000000..629340022 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/DeleteDataFrameAnalytics.php @@ -0,0 +1,54 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeleteDataFrameAnalytics extends AbstractEndpoint +{ + + public function getURI(): string + { + $id = $this->id ?? null; + + if (isset($id)) { + return "/_ml/data_frame/analytics/$id"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.delete_data_frame_analytics'); + } + + public function getParamWhitelist(): array + { + return [ + 'force' + ]; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setId($id): DeleteDataFrameAnalytics + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/DeleteDatafeed.php b/util/output/7.6.1/Endpoints/Ml/DeleteDatafeed.php new file mode 100644 index 000000000..1ef558760 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/DeleteDatafeed.php @@ -0,0 +1,55 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeleteDatafeed extends AbstractEndpoint +{ + protected $datafeed_id; + + public function getURI(): string + { + $datafeed_id = $this->datafeed_id ?? null; + + if (isset($datafeed_id)) { + return "/_ml/datafeeds/$datafeed_id"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.delete_datafeed'); + } + + public function getParamWhitelist(): array + { + return [ + 'force' + ]; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setDatafeedId($datafeed_id): DeleteDatafeed + { + if (isset($datafeed_id) !== true) { + return $this; + } + $this->datafeed_id = $datafeed_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/DeleteExpiredData.php b/util/output/7.6.1/Endpoints/Ml/DeleteExpiredData.php new file mode 100644 index 000000000..647c288fd --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/DeleteExpiredData.php @@ -0,0 +1,37 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeleteExpiredData extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_ml/_delete_expired_data"; + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'DELETE'; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/DeleteFilter.php b/util/output/7.6.1/Endpoints/Ml/DeleteFilter.php new file mode 100644 index 000000000..e415a2376 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/DeleteFilter.php @@ -0,0 +1,53 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeleteFilter extends AbstractEndpoint +{ + protected $filter_id; + + public function getURI(): string + { + $filter_id = $this->filter_id ?? null; + + if (isset($filter_id)) { + return "/_ml/filters/$filter_id"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.delete_filter'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setFilterId($filter_id): DeleteFilter + { + if (isset($filter_id) !== true) { + return $this; + } + $this->filter_id = $filter_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/DeleteForecast.php b/util/output/7.6.1/Endpoints/Ml/DeleteForecast.php new file mode 100644 index 000000000..01c01e394 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/DeleteForecast.php @@ -0,0 +1,73 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeleteForecast extends AbstractEndpoint +{ + protected $job_id; + protected $forecast_id; + + public function getURI(): string + { + if (isset($this->job_id) !== true) { + throw new RuntimeException( + 'job_id is required for delete_forecast' + ); + } + $job_id = $this->job_id; + $forecast_id = $this->forecast_id ?? null; + + if (isset($forecast_id)) { + return "/_ml/anomaly_detectors/$job_id/_forecast/$forecast_id"; + } + return "/_ml/anomaly_detectors/$job_id/_forecast"; + } + + public function getParamWhitelist(): array + { + return [ + 'allow_no_forecasts', + 'timeout' + ]; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setJobId($job_id): DeleteForecast + { + if (isset($job_id) !== true) { + return $this; + } + $this->job_id = $job_id; + + return $this; + } + + public function setForecastId($forecast_id): DeleteForecast + { + if (isset($forecast_id) !== true) { + return $this; + } + $this->forecast_id = $forecast_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/DeleteJob.php b/util/output/7.6.1/Endpoints/Ml/DeleteJob.php new file mode 100644 index 000000000..2b3c68220 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/DeleteJob.php @@ -0,0 +1,56 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeleteJob extends AbstractEndpoint +{ + protected $job_id; + + public function getURI(): string + { + $job_id = $this->job_id ?? null; + + if (isset($job_id)) { + return "/_ml/anomaly_detectors/$job_id"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.delete_job'); + } + + public function getParamWhitelist(): array + { + return [ + 'force', + 'wait_for_completion' + ]; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setJobId($job_id): DeleteJob + { + if (isset($job_id) !== true) { + return $this; + } + $this->job_id = $job_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/DeleteModelSnapshot.php b/util/output/7.6.1/Endpoints/Ml/DeleteModelSnapshot.php new file mode 100644 index 000000000..f10478f56 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/DeleteModelSnapshot.php @@ -0,0 +1,65 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeleteModelSnapshot extends AbstractEndpoint +{ + protected $job_id; + protected $snapshot_id; + + public function getURI(): string + { + $job_id = $this->job_id ?? null; + $snapshot_id = $this->snapshot_id ?? null; + + if (isset($job_id) && isset($snapshot_id)) { + return "/_ml/anomaly_detectors/$job_id/model_snapshots/$snapshot_id"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.delete_model_snapshot'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setJobId($job_id): DeleteModelSnapshot + { + if (isset($job_id) !== true) { + return $this; + } + $this->job_id = $job_id; + + return $this; + } + + public function setSnapshotId($snapshot_id): DeleteModelSnapshot + { + if (isset($snapshot_id) !== true) { + return $this; + } + $this->snapshot_id = $snapshot_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/DeleteTrainedModel.php b/util/output/7.6.1/Endpoints/Ml/DeleteTrainedModel.php new file mode 100644 index 000000000..6d1c95413 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/DeleteTrainedModel.php @@ -0,0 +1,53 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeleteTrainedModel extends AbstractEndpoint +{ + protected $model_id; + + public function getURI(): string + { + $model_id = $this->model_id ?? null; + + if (isset($model_id)) { + return "/_ml/inference/$model_id"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.delete_trained_model'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setModelId($model_id): DeleteTrainedModel + { + if (isset($model_id) !== true) { + return $this; + } + $this->model_id = $model_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/EvaluateDataFrame.php b/util/output/7.6.1/Endpoints/Ml/EvaluateDataFrame.php new file mode 100644 index 000000000..54b014c4b --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/EvaluateDataFrame.php @@ -0,0 +1,47 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class EvaluateDataFrame extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_ml/data_frame/_evaluate"; + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): EvaluateDataFrame + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/ExplainDataFrameAnalytics.php b/util/output/7.6.1/Endpoints/Ml/ExplainDataFrameAnalytics.php new file mode 100644 index 000000000..4c4bdd7a3 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/ExplainDataFrameAnalytics.php @@ -0,0 +1,61 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class ExplainDataFrameAnalytics extends AbstractEndpoint +{ + + public function getURI(): string + { + $id = $this->id ?? null; + + if (isset($id)) { + return "/_ml/data_frame/analytics/$id/_explain"; + } + return "/_ml/data_frame/analytics/_explain"; + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return isset($this->body) ? 'POST' : 'GET'; + } + + public function setBody($body): ExplainDataFrameAnalytics + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setId($id): ExplainDataFrameAnalytics + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/FindFileStructure.php b/util/output/7.6.1/Endpoints/Ml/FindFileStructure.php new file mode 100644 index 000000000..ec3bd54c5 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/FindFileStructure.php @@ -0,0 +1,80 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class FindFileStructure extends AbstractEndpoint +{ + public function __construct(SerializerInterface $serializer) + { + $this->serializer = $serializer; + } + + public function getURI(): string + { + + return "/_ml/find_file_structure"; + } + + public function getParamWhitelist(): array + { + return [ + 'lines_to_sample', + 'line_merge_size_limit', + 'timeout', + 'charset', + 'format', + 'has_header_row', + 'column_names', + 'delimiter', + 'quote', + 'should_trim_fields', + 'grok_pattern', + 'timestamp_field', + 'timestamp_format', + 'explain' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): FindFileStructure + { + if (isset($body) !== true) { + return $this; + } + if (is_array($body) === true || $body instanceof Traversable) { + foreach ($body as $item) { + $this->body .= $this->serializer->serialize($item) . "\n"; + } + } elseif (is_string($body)) { + $this->body = $body; + if (substr($body, -1) != "\n") { + $this->body .= "\n"; + } + } else { + throw new InvalidArgumentException("Body must be an array, traversable object or string"); + } + return $this; + } + +} diff --git a/util/output/7.6.1/Endpoints/Ml/FlushJob.php b/util/output/7.6.1/Endpoints/Ml/FlushJob.php new file mode 100644 index 000000000..761bdb351 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/FlushJob.php @@ -0,0 +1,69 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class FlushJob extends AbstractEndpoint +{ + protected $job_id; + + public function getURI(): string + { + $job_id = $this->job_id ?? null; + + if (isset($job_id)) { + return "/_ml/anomaly_detectors/$job_id/_flush"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.flush_job'); + } + + public function getParamWhitelist(): array + { + return [ + 'calc_interim', + 'start', + 'end', + 'advance_time', + 'skip_time' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): FlushJob + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setJobId($job_id): FlushJob + { + if (isset($job_id) !== true) { + return $this; + } + $this->job_id = $job_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/Forecast.php b/util/output/7.6.1/Endpoints/Ml/Forecast.php new file mode 100644 index 000000000..340dafc0d --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/Forecast.php @@ -0,0 +1,56 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Forecast extends AbstractEndpoint +{ + protected $job_id; + + public function getURI(): string + { + $job_id = $this->job_id ?? null; + + if (isset($job_id)) { + return "/_ml/anomaly_detectors/$job_id/_forecast"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.forecast'); + } + + public function getParamWhitelist(): array + { + return [ + 'duration', + 'expires_in' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setJobId($job_id): Forecast + { + if (isset($job_id) !== true) { + return $this; + } + $this->job_id = $job_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/GetBuckets.php b/util/output/7.6.1/Endpoints/Ml/GetBuckets.php new file mode 100644 index 000000000..530ef0391 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/GetBuckets.php @@ -0,0 +1,90 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetBuckets extends AbstractEndpoint +{ + protected $job_id; + protected $timestamp; + + public function getURI(): string + { + if (isset($this->job_id) !== true) { + throw new RuntimeException( + 'job_id is required for get_buckets' + ); + } + $job_id = $this->job_id; + $timestamp = $this->timestamp ?? null; + + if (isset($timestamp)) { + return "/_ml/anomaly_detectors/$job_id/results/buckets/$timestamp"; + } + return "/_ml/anomaly_detectors/$job_id/results/buckets"; + } + + public function getParamWhitelist(): array + { + return [ + 'expand', + 'exclude_interim', + 'from', + 'size', + 'start', + 'end', + 'anomaly_score', + 'sort', + 'desc' + ]; + } + + public function getMethod(): string + { + return isset($this->body) ? 'POST' : 'GET'; + } + + public function setBody($body): GetBuckets + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setJobId($job_id): GetBuckets + { + if (isset($job_id) !== true) { + return $this; + } + $this->job_id = $job_id; + + return $this; + } + + public function setTimestamp($timestamp): GetBuckets + { + if (isset($timestamp) !== true) { + return $this; + } + $this->timestamp = $timestamp; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/GetCalendarEvents.php b/util/output/7.6.1/Endpoints/Ml/GetCalendarEvents.php new file mode 100644 index 000000000..274742f1d --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/GetCalendarEvents.php @@ -0,0 +1,59 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetCalendarEvents extends AbstractEndpoint +{ + protected $calendar_id; + + public function getURI(): string + { + $calendar_id = $this->calendar_id ?? null; + + if (isset($calendar_id)) { + return "/_ml/calendars/$calendar_id/events"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.get_calendar_events'); + } + + public function getParamWhitelist(): array + { + return [ + 'job_id', + 'start', + 'end', + 'from', + 'size' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setCalendarId($calendar_id): GetCalendarEvents + { + if (isset($calendar_id) !== true) { + return $this; + } + $this->calendar_id = $calendar_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/GetCalendars.php b/util/output/7.6.1/Endpoints/Ml/GetCalendars.php new file mode 100644 index 000000000..8c3011e91 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/GetCalendars.php @@ -0,0 +1,65 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetCalendars extends AbstractEndpoint +{ + protected $calendar_id; + + public function getURI(): string + { + $calendar_id = $this->calendar_id ?? null; + + if (isset($calendar_id)) { + return "/_ml/calendars/$calendar_id"; + } + return "/_ml/calendars"; + } + + public function getParamWhitelist(): array + { + return [ + 'from', + 'size' + ]; + } + + public function getMethod(): string + { + return isset($this->body) ? 'POST' : 'GET'; + } + + public function setBody($body): GetCalendars + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setCalendarId($calendar_id): GetCalendars + { + if (isset($calendar_id) !== true) { + return $this; + } + $this->calendar_id = $calendar_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/GetCategories.php b/util/output/7.6.1/Endpoints/Ml/GetCategories.php new file mode 100644 index 000000000..9fa34fa02 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/GetCategories.php @@ -0,0 +1,83 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetCategories extends AbstractEndpoint +{ + protected $job_id; + protected $category_id; + + public function getURI(): string + { + if (isset($this->job_id) !== true) { + throw new RuntimeException( + 'job_id is required for get_categories' + ); + } + $job_id = $this->job_id; + $category_id = $this->category_id ?? null; + + if (isset($category_id)) { + return "/_ml/anomaly_detectors/$job_id/results/categories/$category_id"; + } + return "/_ml/anomaly_detectors/$job_id/results/categories/"; + } + + public function getParamWhitelist(): array + { + return [ + 'from', + 'size' + ]; + } + + public function getMethod(): string + { + return isset($this->body) ? 'POST' : 'GET'; + } + + public function setBody($body): GetCategories + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setJobId($job_id): GetCategories + { + if (isset($job_id) !== true) { + return $this; + } + $this->job_id = $job_id; + + return $this; + } + + public function setCategoryId($category_id): GetCategories + { + if (isset($category_id) !== true) { + return $this; + } + $this->category_id = $category_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/GetDataFrameAnalytics.php b/util/output/7.6.1/Endpoints/Ml/GetDataFrameAnalytics.php new file mode 100644 index 000000000..2e1b40f95 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/GetDataFrameAnalytics.php @@ -0,0 +1,55 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetDataFrameAnalytics extends AbstractEndpoint +{ + + public function getURI(): string + { + $id = $this->id ?? null; + + if (isset($id)) { + return "/_ml/data_frame/analytics/$id"; + } + return "/_ml/data_frame/analytics"; + } + + public function getParamWhitelist(): array + { + return [ + 'allow_no_match', + 'from', + 'size' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setId($id): GetDataFrameAnalytics + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/GetDataFrameAnalyticsStats.php b/util/output/7.6.1/Endpoints/Ml/GetDataFrameAnalyticsStats.php new file mode 100644 index 000000000..0baf98ada --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/GetDataFrameAnalyticsStats.php @@ -0,0 +1,55 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetDataFrameAnalyticsStats extends AbstractEndpoint +{ + + public function getURI(): string + { + $id = $this->id ?? null; + + if (isset($id)) { + return "/_ml/data_frame/analytics/$id/_stats"; + } + return "/_ml/data_frame/analytics/_stats"; + } + + public function getParamWhitelist(): array + { + return [ + 'allow_no_match', + 'from', + 'size' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setId($id): GetDataFrameAnalyticsStats + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/GetDatafeedStats.php b/util/output/7.6.1/Endpoints/Ml/GetDatafeedStats.php new file mode 100644 index 000000000..7422a4946 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/GetDatafeedStats.php @@ -0,0 +1,54 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetDatafeedStats extends AbstractEndpoint +{ + protected $datafeed_id; + + public function getURI(): string + { + $datafeed_id = $this->datafeed_id ?? null; + + if (isset($datafeed_id)) { + return "/_ml/datafeeds/$datafeed_id/_stats"; + } + return "/_ml/datafeeds/_stats"; + } + + public function getParamWhitelist(): array + { + return [ + 'allow_no_datafeeds' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setDatafeedId($datafeed_id): GetDatafeedStats + { + if (isset($datafeed_id) !== true) { + return $this; + } + $this->datafeed_id = $datafeed_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/GetDatafeeds.php b/util/output/7.6.1/Endpoints/Ml/GetDatafeeds.php new file mode 100644 index 000000000..4a79b02ce --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/GetDatafeeds.php @@ -0,0 +1,54 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetDatafeeds extends AbstractEndpoint +{ + protected $datafeed_id; + + public function getURI(): string + { + $datafeed_id = $this->datafeed_id ?? null; + + if (isset($datafeed_id)) { + return "/_ml/datafeeds/$datafeed_id"; + } + return "/_ml/datafeeds"; + } + + public function getParamWhitelist(): array + { + return [ + 'allow_no_datafeeds' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setDatafeedId($datafeed_id): GetDatafeeds + { + if (isset($datafeed_id) !== true) { + return $this; + } + $this->datafeed_id = $datafeed_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/GetFilters.php b/util/output/7.6.1/Endpoints/Ml/GetFilters.php new file mode 100644 index 000000000..56973ccf6 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/GetFilters.php @@ -0,0 +1,55 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetFilters extends AbstractEndpoint +{ + protected $filter_id; + + public function getURI(): string + { + $filter_id = $this->filter_id ?? null; + + if (isset($filter_id)) { + return "/_ml/filters/$filter_id"; + } + return "/_ml/filters"; + } + + public function getParamWhitelist(): array + { + return [ + 'from', + 'size' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setFilterId($filter_id): GetFilters + { + if (isset($filter_id) !== true) { + return $this; + } + $this->filter_id = $filter_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/GetInfluencers.php b/util/output/7.6.1/Endpoints/Ml/GetInfluencers.php new file mode 100644 index 000000000..4f15bd090 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/GetInfluencers.php @@ -0,0 +1,72 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetInfluencers extends AbstractEndpoint +{ + protected $job_id; + + public function getURI(): string + { + $job_id = $this->job_id ?? null; + + if (isset($job_id)) { + return "/_ml/anomaly_detectors/$job_id/results/influencers"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.get_influencers'); + } + + public function getParamWhitelist(): array + { + return [ + 'exclude_interim', + 'from', + 'size', + 'start', + 'end', + 'influencer_score', + 'sort', + 'desc' + ]; + } + + public function getMethod(): string + { + return isset($this->body) ? 'POST' : 'GET'; + } + + public function setBody($body): GetInfluencers + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setJobId($job_id): GetInfluencers + { + if (isset($job_id) !== true) { + return $this; + } + $this->job_id = $job_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/GetJobStats.php b/util/output/7.6.1/Endpoints/Ml/GetJobStats.php new file mode 100644 index 000000000..d5aafb440 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/GetJobStats.php @@ -0,0 +1,54 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetJobStats extends AbstractEndpoint +{ + protected $job_id; + + public function getURI(): string + { + $job_id = $this->job_id ?? null; + + if (isset($job_id)) { + return "/_ml/anomaly_detectors/$job_id/_stats"; + } + return "/_ml/anomaly_detectors/_stats"; + } + + public function getParamWhitelist(): array + { + return [ + 'allow_no_jobs' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setJobId($job_id): GetJobStats + { + if (isset($job_id) !== true) { + return $this; + } + $this->job_id = $job_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/GetJobs.php b/util/output/7.6.1/Endpoints/Ml/GetJobs.php new file mode 100644 index 000000000..c8d6a1601 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/GetJobs.php @@ -0,0 +1,54 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetJobs extends AbstractEndpoint +{ + protected $job_id; + + public function getURI(): string + { + $job_id = $this->job_id ?? null; + + if (isset($job_id)) { + return "/_ml/anomaly_detectors/$job_id"; + } + return "/_ml/anomaly_detectors"; + } + + public function getParamWhitelist(): array + { + return [ + 'allow_no_jobs' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setJobId($job_id): GetJobs + { + if (isset($job_id) !== true) { + return $this; + } + $this->job_id = $job_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/GetModelSnapshots.php b/util/output/7.6.1/Endpoints/Ml/GetModelSnapshots.php new file mode 100644 index 000000000..ae957c57d --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/GetModelSnapshots.php @@ -0,0 +1,87 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetModelSnapshots extends AbstractEndpoint +{ + protected $job_id; + protected $snapshot_id; + + public function getURI(): string + { + if (isset($this->job_id) !== true) { + throw new RuntimeException( + 'job_id is required for get_model_snapshots' + ); + } + $job_id = $this->job_id; + $snapshot_id = $this->snapshot_id ?? null; + + if (isset($snapshot_id)) { + return "/_ml/anomaly_detectors/$job_id/model_snapshots/$snapshot_id"; + } + return "/_ml/anomaly_detectors/$job_id/model_snapshots"; + } + + public function getParamWhitelist(): array + { + return [ + 'from', + 'size', + 'start', + 'end', + 'sort', + 'desc' + ]; + } + + public function getMethod(): string + { + return isset($this->body) ? 'POST' : 'GET'; + } + + public function setBody($body): GetModelSnapshots + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setJobId($job_id): GetModelSnapshots + { + if (isset($job_id) !== true) { + return $this; + } + $this->job_id = $job_id; + + return $this; + } + + public function setSnapshotId($snapshot_id): GetModelSnapshots + { + if (isset($snapshot_id) !== true) { + return $this; + } + $this->snapshot_id = $snapshot_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/GetOverallBuckets.php b/util/output/7.6.1/Endpoints/Ml/GetOverallBuckets.php new file mode 100644 index 000000000..1e4824d1d --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/GetOverallBuckets.php @@ -0,0 +1,71 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetOverallBuckets extends AbstractEndpoint +{ + protected $job_id; + + public function getURI(): string + { + $job_id = $this->job_id ?? null; + + if (isset($job_id)) { + return "/_ml/anomaly_detectors/$job_id/results/overall_buckets"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.get_overall_buckets'); + } + + public function getParamWhitelist(): array + { + return [ + 'top_n', + 'bucket_span', + 'overall_score', + 'exclude_interim', + 'start', + 'end', + 'allow_no_jobs' + ]; + } + + public function getMethod(): string + { + return isset($this->body) ? 'POST' : 'GET'; + } + + public function setBody($body): GetOverallBuckets + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setJobId($job_id): GetOverallBuckets + { + if (isset($job_id) !== true) { + return $this; + } + $this->job_id = $job_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/GetRecords.php b/util/output/7.6.1/Endpoints/Ml/GetRecords.php new file mode 100644 index 000000000..47f3dc849 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/GetRecords.php @@ -0,0 +1,72 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetRecords extends AbstractEndpoint +{ + protected $job_id; + + public function getURI(): string + { + $job_id = $this->job_id ?? null; + + if (isset($job_id)) { + return "/_ml/anomaly_detectors/$job_id/results/records"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.get_records'); + } + + public function getParamWhitelist(): array + { + return [ + 'exclude_interim', + 'from', + 'size', + 'start', + 'end', + 'record_score', + 'sort', + 'desc' + ]; + } + + public function getMethod(): string + { + return isset($this->body) ? 'POST' : 'GET'; + } + + public function setBody($body): GetRecords + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setJobId($job_id): GetRecords + { + if (isset($job_id) !== true) { + return $this; + } + $this->job_id = $job_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/GetTrainedModels.php b/util/output/7.6.1/Endpoints/Ml/GetTrainedModels.php new file mode 100644 index 000000000..9bb96a9bb --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/GetTrainedModels.php @@ -0,0 +1,58 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetTrainedModels extends AbstractEndpoint +{ + protected $model_id; + + public function getURI(): string + { + $model_id = $this->model_id ?? null; + + if (isset($model_id)) { + return "/_ml/inference/$model_id"; + } + return "/_ml/inference"; + } + + public function getParamWhitelist(): array + { + return [ + 'allow_no_match', + 'include_model_definition', + 'decompress_definition', + 'from', + 'size' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setModelId($model_id): GetTrainedModels + { + if (isset($model_id) !== true) { + return $this; + } + $this->model_id = $model_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/GetTrainedModelsStats.php b/util/output/7.6.1/Endpoints/Ml/GetTrainedModelsStats.php new file mode 100644 index 000000000..defe72098 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/GetTrainedModelsStats.php @@ -0,0 +1,56 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetTrainedModelsStats extends AbstractEndpoint +{ + protected $model_id; + + public function getURI(): string + { + $model_id = $this->model_id ?? null; + + if (isset($model_id)) { + return "/_ml/inference/$model_id/_stats"; + } + return "/_ml/inference/_stats"; + } + + public function getParamWhitelist(): array + { + return [ + 'allow_no_match', + 'from', + 'size' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setModelId($model_id): GetTrainedModelsStats + { + if (isset($model_id) !== true) { + return $this; + } + $this->model_id = $model_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/Info.php b/util/output/7.6.1/Endpoints/Ml/Info.php new file mode 100644 index 000000000..b2b27c152 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/Info.php @@ -0,0 +1,37 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Info extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_ml/info"; + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/OpenJob.php b/util/output/7.6.1/Endpoints/Ml/OpenJob.php new file mode 100644 index 000000000..ccff693e5 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/OpenJob.php @@ -0,0 +1,53 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class OpenJob extends AbstractEndpoint +{ + protected $job_id; + + public function getURI(): string + { + $job_id = $this->job_id ?? null; + + if (isset($job_id)) { + return "/_ml/anomaly_detectors/$job_id/_open"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.open_job'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setJobId($job_id): OpenJob + { + if (isset($job_id) !== true) { + return $this; + } + $this->job_id = $job_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/PostCalendarEvents.php b/util/output/7.6.1/Endpoints/Ml/PostCalendarEvents.php new file mode 100644 index 000000000..e4b69a081 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/PostCalendarEvents.php @@ -0,0 +1,63 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PostCalendarEvents extends AbstractEndpoint +{ + protected $calendar_id; + + public function getURI(): string + { + $calendar_id = $this->calendar_id ?? null; + + if (isset($calendar_id)) { + return "/_ml/calendars/$calendar_id/events"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.post_calendar_events'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): PostCalendarEvents + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setCalendarId($calendar_id): PostCalendarEvents + { + if (isset($calendar_id) !== true) { + return $this; + } + $this->calendar_id = $calendar_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/PostData.php b/util/output/7.6.1/Endpoints/Ml/PostData.php new file mode 100644 index 000000000..f6372a387 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/PostData.php @@ -0,0 +1,82 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PostData extends AbstractEndpoint +{ + public function __construct(SerializerInterface $serializer) + { + $this->serializer = $serializer; + } + + public function getURI(): string + { + $job_id = $this->job_id ?? null; + + if (isset($job_id)) { + return "/_ml/anomaly_detectors/$job_id/_data"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.post_data'); + } + + public function getParamWhitelist(): array + { + return [ + 'reset_start', + 'reset_end' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): PostData + { + if (isset($body) !== true) { + return $this; + } + if (is_array($body) === true || $body instanceof Traversable) { + foreach ($body as $item) { + $this->body .= $this->serializer->serialize($item) . "\n"; + } + } elseif (is_string($body)) { + $this->body = $body; + if (substr($body, -1) != "\n") { + $this->body .= "\n"; + } + } else { + throw new InvalidArgumentException("Body must be an array, traversable object or string"); + } + return $this; + } + + public function setJobId($job_id): PostData + { + if (isset($job_id) !== true) { + return $this; + } + $this->job_id = $job_id; + + return $this; + } + +} diff --git a/util/output/7.6.1/Endpoints/Ml/PreviewDatafeed.php b/util/output/7.6.1/Endpoints/Ml/PreviewDatafeed.php new file mode 100644 index 000000000..4a9413bd8 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/PreviewDatafeed.php @@ -0,0 +1,53 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PreviewDatafeed extends AbstractEndpoint +{ + protected $datafeed_id; + + public function getURI(): string + { + $datafeed_id = $this->datafeed_id ?? null; + + if (isset($datafeed_id)) { + return "/_ml/datafeeds/$datafeed_id/_preview"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.preview_datafeed'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setDatafeedId($datafeed_id): PreviewDatafeed + { + if (isset($datafeed_id) !== true) { + return $this; + } + $this->datafeed_id = $datafeed_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/PutCalendar.php b/util/output/7.6.1/Endpoints/Ml/PutCalendar.php new file mode 100644 index 000000000..be5a79f31 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/PutCalendar.php @@ -0,0 +1,63 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PutCalendar extends AbstractEndpoint +{ + protected $calendar_id; + + public function getURI(): string + { + $calendar_id = $this->calendar_id ?? null; + + if (isset($calendar_id)) { + return "/_ml/calendars/$calendar_id"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.put_calendar'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): PutCalendar + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setCalendarId($calendar_id): PutCalendar + { + if (isset($calendar_id) !== true) { + return $this; + } + $this->calendar_id = $calendar_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/PutCalendarJob.php b/util/output/7.6.1/Endpoints/Ml/PutCalendarJob.php new file mode 100644 index 000000000..258b7956e --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/PutCalendarJob.php @@ -0,0 +1,65 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PutCalendarJob extends AbstractEndpoint +{ + protected $calendar_id; + protected $job_id; + + public function getURI(): string + { + $calendar_id = $this->calendar_id ?? null; + $job_id = $this->job_id ?? null; + + if (isset($calendar_id) && isset($job_id)) { + return "/_ml/calendars/$calendar_id/jobs/$job_id"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.put_calendar_job'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setCalendarId($calendar_id): PutCalendarJob + { + if (isset($calendar_id) !== true) { + return $this; + } + $this->calendar_id = $calendar_id; + + return $this; + } + + public function setJobId($job_id): PutCalendarJob + { + if (isset($job_id) !== true) { + return $this; + } + $this->job_id = $job_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/PutDataFrameAnalytics.php b/util/output/7.6.1/Endpoints/Ml/PutDataFrameAnalytics.php new file mode 100644 index 000000000..da647a857 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/PutDataFrameAnalytics.php @@ -0,0 +1,62 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PutDataFrameAnalytics extends AbstractEndpoint +{ + + public function getURI(): string + { + $id = $this->id ?? null; + + if (isset($id)) { + return "/_ml/data_frame/analytics/$id"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.put_data_frame_analytics'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): PutDataFrameAnalytics + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setId($id): PutDataFrameAnalytics + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/PutDatafeed.php b/util/output/7.6.1/Endpoints/Ml/PutDatafeed.php new file mode 100644 index 000000000..7511ec2ba --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/PutDatafeed.php @@ -0,0 +1,63 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PutDatafeed extends AbstractEndpoint +{ + protected $datafeed_id; + + public function getURI(): string + { + $datafeed_id = $this->datafeed_id ?? null; + + if (isset($datafeed_id)) { + return "/_ml/datafeeds/$datafeed_id"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.put_datafeed'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): PutDatafeed + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setDatafeedId($datafeed_id): PutDatafeed + { + if (isset($datafeed_id) !== true) { + return $this; + } + $this->datafeed_id = $datafeed_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/PutFilter.php b/util/output/7.6.1/Endpoints/Ml/PutFilter.php new file mode 100644 index 000000000..a48d50ac4 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/PutFilter.php @@ -0,0 +1,63 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PutFilter extends AbstractEndpoint +{ + protected $filter_id; + + public function getURI(): string + { + $filter_id = $this->filter_id ?? null; + + if (isset($filter_id)) { + return "/_ml/filters/$filter_id"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.put_filter'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): PutFilter + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setFilterId($filter_id): PutFilter + { + if (isset($filter_id) !== true) { + return $this; + } + $this->filter_id = $filter_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/PutJob.php b/util/output/7.6.1/Endpoints/Ml/PutJob.php new file mode 100644 index 000000000..d1d947b79 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/PutJob.php @@ -0,0 +1,63 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PutJob extends AbstractEndpoint +{ + protected $job_id; + + public function getURI(): string + { + $job_id = $this->job_id ?? null; + + if (isset($job_id)) { + return "/_ml/anomaly_detectors/$job_id"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.put_job'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): PutJob + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setJobId($job_id): PutJob + { + if (isset($job_id) !== true) { + return $this; + } + $this->job_id = $job_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/PutTrainedModel.php b/util/output/7.6.1/Endpoints/Ml/PutTrainedModel.php new file mode 100644 index 000000000..9a6c224fa --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/PutTrainedModel.php @@ -0,0 +1,63 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PutTrainedModel extends AbstractEndpoint +{ + protected $model_id; + + public function getURI(): string + { + $model_id = $this->model_id ?? null; + + if (isset($model_id)) { + return "/_ml/inference/$model_id"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.put_trained_model'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): PutTrainedModel + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setModelId($model_id): PutTrainedModel + { + if (isset($model_id) !== true) { + return $this; + } + $this->model_id = $model_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/RevertModelSnapshot.php b/util/output/7.6.1/Endpoints/Ml/RevertModelSnapshot.php new file mode 100644 index 000000000..9faaef4af --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/RevertModelSnapshot.php @@ -0,0 +1,77 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class RevertModelSnapshot extends AbstractEndpoint +{ + protected $job_id; + protected $snapshot_id; + + public function getURI(): string + { + $job_id = $this->job_id ?? null; + $snapshot_id = $this->snapshot_id ?? null; + + if (isset($job_id) && isset($snapshot_id)) { + return "/_ml/anomaly_detectors/$job_id/model_snapshots/$snapshot_id/_revert"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.revert_model_snapshot'); + } + + public function getParamWhitelist(): array + { + return [ + 'delete_intervening_results' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): RevertModelSnapshot + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setJobId($job_id): RevertModelSnapshot + { + if (isset($job_id) !== true) { + return $this; + } + $this->job_id = $job_id; + + return $this; + } + + public function setSnapshotId($snapshot_id): RevertModelSnapshot + { + if (isset($snapshot_id) !== true) { + return $this; + } + $this->snapshot_id = $snapshot_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/SetUpgradeMode.php b/util/output/7.6.1/Endpoints/Ml/SetUpgradeMode.php new file mode 100644 index 000000000..52faf4b5d --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/SetUpgradeMode.php @@ -0,0 +1,40 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class SetUpgradeMode extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_ml/set_upgrade_mode"; + } + + public function getParamWhitelist(): array + { + return [ + 'enabled', + 'timeout' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/StartDataFrameAnalytics.php b/util/output/7.6.1/Endpoints/Ml/StartDataFrameAnalytics.php new file mode 100644 index 000000000..678c4b923 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/StartDataFrameAnalytics.php @@ -0,0 +1,64 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class StartDataFrameAnalytics extends AbstractEndpoint +{ + + public function getURI(): string + { + $id = $this->id ?? null; + + if (isset($id)) { + return "/_ml/data_frame/analytics/$id/_start"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.start_data_frame_analytics'); + } + + public function getParamWhitelist(): array + { + return [ + 'timeout' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): StartDataFrameAnalytics + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setId($id): StartDataFrameAnalytics + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/StartDatafeed.php b/util/output/7.6.1/Endpoints/Ml/StartDatafeed.php new file mode 100644 index 000000000..cf130e4b8 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/StartDatafeed.php @@ -0,0 +1,67 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class StartDatafeed extends AbstractEndpoint +{ + protected $datafeed_id; + + public function getURI(): string + { + $datafeed_id = $this->datafeed_id ?? null; + + if (isset($datafeed_id)) { + return "/_ml/datafeeds/$datafeed_id/_start"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.start_datafeed'); + } + + public function getParamWhitelist(): array + { + return [ + 'start', + 'end', + 'timeout' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): StartDatafeed + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setDatafeedId($datafeed_id): StartDatafeed + { + if (isset($datafeed_id) !== true) { + return $this; + } + $this->datafeed_id = $datafeed_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/StopDataFrameAnalytics.php b/util/output/7.6.1/Endpoints/Ml/StopDataFrameAnalytics.php new file mode 100644 index 000000000..de8953ba8 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/StopDataFrameAnalytics.php @@ -0,0 +1,66 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class StopDataFrameAnalytics extends AbstractEndpoint +{ + + public function getURI(): string + { + $id = $this->id ?? null; + + if (isset($id)) { + return "/_ml/data_frame/analytics/$id/_stop"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.stop_data_frame_analytics'); + } + + public function getParamWhitelist(): array + { + return [ + 'allow_no_match', + 'force', + 'timeout' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): StopDataFrameAnalytics + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setId($id): StopDataFrameAnalytics + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/StopDatafeed.php b/util/output/7.6.1/Endpoints/Ml/StopDatafeed.php new file mode 100644 index 000000000..dc752653a --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/StopDatafeed.php @@ -0,0 +1,57 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class StopDatafeed extends AbstractEndpoint +{ + protected $datafeed_id; + + public function getURI(): string + { + $datafeed_id = $this->datafeed_id ?? null; + + if (isset($datafeed_id)) { + return "/_ml/datafeeds/$datafeed_id/_stop"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.stop_datafeed'); + } + + public function getParamWhitelist(): array + { + return [ + 'allow_no_datafeeds', + 'force', + 'timeout' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setDatafeedId($datafeed_id): StopDatafeed + { + if (isset($datafeed_id) !== true) { + return $this; + } + $this->datafeed_id = $datafeed_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/UpdateDatafeed.php b/util/output/7.6.1/Endpoints/Ml/UpdateDatafeed.php new file mode 100644 index 000000000..76d3c035d --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/UpdateDatafeed.php @@ -0,0 +1,63 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class UpdateDatafeed extends AbstractEndpoint +{ + protected $datafeed_id; + + public function getURI(): string + { + $datafeed_id = $this->datafeed_id ?? null; + + if (isset($datafeed_id)) { + return "/_ml/datafeeds/$datafeed_id/_update"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.update_datafeed'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): UpdateDatafeed + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setDatafeedId($datafeed_id): UpdateDatafeed + { + if (isset($datafeed_id) !== true) { + return $this; + } + $this->datafeed_id = $datafeed_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/UpdateFilter.php b/util/output/7.6.1/Endpoints/Ml/UpdateFilter.php new file mode 100644 index 000000000..f9da8f0da --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/UpdateFilter.php @@ -0,0 +1,63 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class UpdateFilter extends AbstractEndpoint +{ + protected $filter_id; + + public function getURI(): string + { + $filter_id = $this->filter_id ?? null; + + if (isset($filter_id)) { + return "/_ml/filters/$filter_id/_update"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.update_filter'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): UpdateFilter + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setFilterId($filter_id): UpdateFilter + { + if (isset($filter_id) !== true) { + return $this; + } + $this->filter_id = $filter_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/UpdateJob.php b/util/output/7.6.1/Endpoints/Ml/UpdateJob.php new file mode 100644 index 000000000..b96f20aa1 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/UpdateJob.php @@ -0,0 +1,63 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class UpdateJob extends AbstractEndpoint +{ + protected $job_id; + + public function getURI(): string + { + $job_id = $this->job_id ?? null; + + if (isset($job_id)) { + return "/_ml/anomaly_detectors/$job_id/_update"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.update_job'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): UpdateJob + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setJobId($job_id): UpdateJob + { + if (isset($job_id) !== true) { + return $this; + } + $this->job_id = $job_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/UpdateModelSnapshot.php b/util/output/7.6.1/Endpoints/Ml/UpdateModelSnapshot.php new file mode 100644 index 000000000..feefbe20a --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/UpdateModelSnapshot.php @@ -0,0 +1,77 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class UpdateModelSnapshot extends AbstractEndpoint +{ + protected $job_id; + protected $snapshot_id; + + public function getURI(): string + { + $job_id = $this->job_id ?? null; + $snapshot_id = $this->snapshot_id ?? null; + + if (isset($job_id) && isset($snapshot_id)) { + return "/_ml/anomaly_detectors/$job_id/model_snapshots/$snapshot_id/_update"; + } + throw new RuntimeException('Missing parameter for the endpoint ml.update_model_snapshot'); + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): UpdateModelSnapshot + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setJobId($job_id): UpdateModelSnapshot + { + if (isset($job_id) !== true) { + return $this; + } + $this->job_id = $job_id; + + return $this; + } + + public function setSnapshotId($snapshot_id): UpdateModelSnapshot + { + if (isset($snapshot_id) !== true) { + return $this; + } + $this->snapshot_id = $snapshot_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/Validate.php b/util/output/7.6.1/Endpoints/Ml/Validate.php new file mode 100644 index 000000000..0b8807341 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/Validate.php @@ -0,0 +1,49 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Validate extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_ml/anomaly_detectors/_validate"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): Validate + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ml/ValidateDetector.php b/util/output/7.6.1/Endpoints/Ml/ValidateDetector.php new file mode 100644 index 000000000..ca816e4e3 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ml/ValidateDetector.php @@ -0,0 +1,49 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class ValidateDetector extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_ml/anomaly_detectors/_validate/detector"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): ValidateDetector + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Monitoring/Bulk.php b/util/output/7.6.1/Endpoints/Monitoring/Bulk.php new file mode 100644 index 000000000..43e314b08 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Monitoring/Bulk.php @@ -0,0 +1,76 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Bulk extends AbstractEndpoint +{ + public function __construct(SerializerInterface $serializer) + { + $this->serializer = $serializer; + } + + public function getURI(): string + { + $type = $this->type ?? null; + if (isset($type)) { + @trigger_error('Specifying types in urls has been deprecated', E_USER_DEPRECATED); + } + + if (isset($type)) { + return "/_monitoring/$type/bulk"; + } + return "/_monitoring/bulk"; + } + + public function getParamWhitelist(): array + { + return [ + 'system_id', + 'system_api_version', + 'interval' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): Bulk + { + if (isset($body) !== true) { + return $this; + } + if (is_array($body) === true || $body instanceof Traversable) { + foreach ($body as $item) { + $this->body .= $this->serializer->serialize($item) . "\n"; + } + } elseif (is_string($body)) { + $this->body = $body; + if (substr($body, -1) != "\n") { + $this->body .= "\n"; + } + } else { + throw new InvalidArgumentException("Body must be an array, traversable object or string"); + } + return $this; + } + +} diff --git a/util/output/7.6.1/Endpoints/Msearch.php b/util/output/7.6.1/Endpoints/Msearch.php new file mode 100644 index 000000000..55b833622 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Msearch.php @@ -0,0 +1,84 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Msearch extends AbstractEndpoint +{ + public function __construct(SerializerInterface $serializer) + { + $this->serializer = $serializer; + } + + public function getURI(): string + { + $index = $this->index ?? null; + $type = $this->type ?? null; + if (isset($type)) { + @trigger_error('Specifying types in urls has been deprecated', E_USER_DEPRECATED); + } + + if (isset($index) && isset($type)) { + return "/$index/$type/_msearch"; + } + if (isset($index)) { + return "/$index/_msearch"; + } + return "/_msearch"; + } + + public function getParamWhitelist(): array + { + return [ + 'search_type', + 'max_concurrent_searches', + 'typed_keys', + 'pre_filter_shard_size', + 'max_concurrent_shard_requests', + 'rest_total_hits_as_int', + 'ccs_minimize_roundtrips' + ]; + } + + public function getMethod(): string + { + return isset($this->body) ? 'POST' : 'GET'; + } + + public function setBody($body): Msearch + { + if (isset($body) !== true) { + return $this; + } + if (is_array($body) === true || $body instanceof Traversable) { + foreach ($body as $item) { + $this->body .= $this->serializer->serialize($item) . "\n"; + } + } elseif (is_string($body)) { + $this->body = $body; + if (substr($body, -1) != "\n") { + $this->body .= "\n"; + } + } else { + throw new InvalidArgumentException("Body must be an array, traversable object or string"); + } + return $this; + } + +} diff --git a/util/output/7.6.1/Endpoints/MsearchTemplate.php b/util/output/7.6.1/Endpoints/MsearchTemplate.php new file mode 100644 index 000000000..6cf0b76bc --- /dev/null +++ b/util/output/7.6.1/Endpoints/MsearchTemplate.php @@ -0,0 +1,82 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class MsearchTemplate extends AbstractEndpoint +{ + public function __construct(SerializerInterface $serializer) + { + $this->serializer = $serializer; + } + + public function getURI(): string + { + $index = $this->index ?? null; + $type = $this->type ?? null; + if (isset($type)) { + @trigger_error('Specifying types in urls has been deprecated', E_USER_DEPRECATED); + } + + if (isset($index) && isset($type)) { + return "/$index/$type/_msearch/template"; + } + if (isset($index)) { + return "/$index/_msearch/template"; + } + return "/_msearch/template"; + } + + public function getParamWhitelist(): array + { + return [ + 'search_type', + 'typed_keys', + 'max_concurrent_searches', + 'rest_total_hits_as_int', + 'ccs_minimize_roundtrips' + ]; + } + + public function getMethod(): string + { + return isset($this->body) ? 'POST' : 'GET'; + } + + public function setBody($body): MsearchTemplate + { + if (isset($body) !== true) { + return $this; + } + if (is_array($body) === true || $body instanceof Traversable) { + foreach ($body as $item) { + $this->body .= $this->serializer->serialize($item) . "\n"; + } + } elseif (is_string($body)) { + $this->body = $body; + if (substr($body, -1) != "\n") { + $this->body .= "\n"; + } + } else { + throw new InvalidArgumentException("Body must be an array, traversable object or string"); + } + return $this; + } + +} diff --git a/util/output/7.6.1/Endpoints/Nodes/HotThreads.php b/util/output/7.6.1/Endpoints/Nodes/HotThreads.php new file mode 100644 index 000000000..d843f254f --- /dev/null +++ b/util/output/7.6.1/Endpoints/Nodes/HotThreads.php @@ -0,0 +1,62 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class HotThreads extends AbstractEndpoint +{ + protected $node_id; + + public function getURI(): string + { + $node_id = $this->node_id ?? null; + + if (isset($node_id)) { + return "/_nodes/$node_id/hot_threads"; + } + return "/_nodes/hot_threads"; + } + + public function getParamWhitelist(): array + { + return [ + 'interval', + 'snapshots', + 'threads', + 'ignore_idle_threads', + 'type', + 'timeout' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setNodeId($node_id): HotThreads + { + 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; + } +} diff --git a/util/output/7.6.1/Endpoints/Nodes/Info.php b/util/output/7.6.1/Endpoints/Nodes/Info.php new file mode 100644 index 000000000..d12ac30cd --- /dev/null +++ b/util/output/7.6.1/Endpoints/Nodes/Info.php @@ -0,0 +1,79 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Info extends AbstractEndpoint +{ + protected $node_id; + protected $metric; + + public function getURI(): string + { + $node_id = $this->node_id ?? null; + $metric = $this->metric ?? null; + + if (isset($node_id) && isset($metric)) { + return "/_nodes/$node_id/$metric"; + } + if (isset($node_id)) { + return "/_nodes/$node_id"; + } + if (isset($metric)) { + return "/_nodes/$metric"; + } + return "/_nodes"; + } + + public function getParamWhitelist(): array + { + return [ + 'flat_settings', + 'timeout' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setNodeId($node_id): Info + { + 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 setMetric($metric): Info + { + if (isset($metric) !== true) { + return $this; + } + if (is_array($metric) === true) { + $metric = implode(",", $metric); + } + $this->metric = $metric; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Nodes/ReloadSecureSettings.php b/util/output/7.6.1/Endpoints/Nodes/ReloadSecureSettings.php new file mode 100644 index 000000000..fc5290c2e --- /dev/null +++ b/util/output/7.6.1/Endpoints/Nodes/ReloadSecureSettings.php @@ -0,0 +1,57 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class ReloadSecureSettings extends AbstractEndpoint +{ + protected $node_id; + + public function getURI(): string + { + $node_id = $this->node_id ?? null; + + if (isset($node_id)) { + return "/_nodes/$node_id/reload_secure_settings"; + } + return "/_nodes/reload_secure_settings"; + } + + public function getParamWhitelist(): array + { + return [ + 'timeout' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setNodeId($node_id): ReloadSecureSettings + { + 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; + } +} diff --git a/util/output/7.6.1/Endpoints/Nodes/Stats.php b/util/output/7.6.1/Endpoints/Nodes/Stats.php new file mode 100644 index 000000000..d0959aa60 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Nodes/Stats.php @@ -0,0 +1,106 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Stats extends AbstractEndpoint +{ + protected $node_id; + protected $metric; + protected $index_metric; + + 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"; + } + if (isset($metric) && isset($index_metric)) { + return "/_nodes/stats/$metric/$index_metric"; + } + if (isset($node_id) && isset($metric)) { + return "/_nodes/$node_id/stats/$metric"; + } + if (isset($node_id)) { + return "/_nodes/$node_id/stats"; + } + if (isset($metric)) { + return "/_nodes/stats/$metric"; + } + return "/_nodes/stats"; + } + + public function getParamWhitelist(): array + { + return [ + 'completion_fields', + 'fielddata_fields', + 'fields', + 'groups', + 'level', + 'types', + 'timeout', + 'include_segment_file_sizes' + ]; + } + + 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 setMetric($metric): Stats + { + if (isset($metric) !== true) { + return $this; + } + if (is_array($metric) === true) { + $metric = implode(",", $metric); + } + $this->metric = $metric; + + return $this; + } + + public function setIndexMetric($index_metric): Stats + { + if (isset($index_metric) !== true) { + return $this; + } + if (is_array($index_metric) === true) { + $index_metric = implode(",", $index_metric); + } + $this->index_metric = $index_metric; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Nodes/Usage.php b/util/output/7.6.1/Endpoints/Nodes/Usage.php new file mode 100644 index 000000000..1a75fd935 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Nodes/Usage.php @@ -0,0 +1,78 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Usage extends AbstractEndpoint +{ + protected $node_id; + protected $metric; + + 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"; + } + if (isset($node_id)) { + return "/_nodes/$node_id/usage"; + } + if (isset($metric)) { + return "/_nodes/usage/$metric"; + } + return "/_nodes/usage"; + } + + public function getParamWhitelist(): array + { + return [ + 'timeout' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setNodeId($node_id): Usage + { + 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 setMetric($metric): Usage + { + if (isset($metric) !== true) { + return $this; + } + if (is_array($metric) === true) { + $metric = implode(",", $metric); + } + $this->metric = $metric; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ping.php b/util/output/7.6.1/Endpoints/Ping.php new file mode 100644 index 000000000..578419f33 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ping.php @@ -0,0 +1,39 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Ping extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'HEAD'; + } +} diff --git a/util/output/7.6.1/Endpoints/PutScript.php b/util/output/7.6.1/Endpoints/PutScript.php new file mode 100644 index 000000000..f60b94491 --- /dev/null +++ b/util/output/7.6.1/Endpoints/PutScript.php @@ -0,0 +1,83 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PutScript extends AbstractEndpoint +{ + protected $context; + + public function getURI(): string + { + if (isset($this->id) !== true) { + throw new RuntimeException( + 'id is required for put_script' + ); + } + $id = $this->id; + $context = $this->context ?? null; + + if (isset($context)) { + return "/_scripts/$id/$context"; + } + return "/_scripts/$id"; + } + + public function getParamWhitelist(): array + { + return [ + 'timeout', + 'master_timeout', + 'context' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): PutScript + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setId($id): PutScript + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } + + public function setContext($context): PutScript + { + if (isset($context) !== true) { + return $this; + } + $this->context = $context; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/RankEval.php b/util/output/7.6.1/Endpoints/RankEval.php new file mode 100644 index 000000000..5c2c45a4c --- /dev/null +++ b/util/output/7.6.1/Endpoints/RankEval.php @@ -0,0 +1,56 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class RankEval extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/$index/_rank_eval"; + } + return "/_rank_eval"; + } + + public function getParamWhitelist(): array + { + return [ + 'ignore_unavailable', + 'allow_no_indices', + 'expand_wildcards', + 'search_type' + ]; + } + + public function getMethod(): string + { + return isset($this->body) ? 'POST' : 'GET'; + } + + public function setBody($body): RankEval + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Reindex.php b/util/output/7.6.1/Endpoints/Reindex.php new file mode 100644 index 000000000..ef6fcd785 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Reindex.php @@ -0,0 +1,56 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Reindex extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_reindex"; + } + + public function getParamWhitelist(): array + { + return [ + 'refresh', + 'timeout', + 'wait_for_active_shards', + 'wait_for_completion', + 'requests_per_second', + 'scroll', + 'slices', + 'max_docs' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): Reindex + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/ReindexRethrottle.php b/util/output/7.6.1/Endpoints/ReindexRethrottle.php new file mode 100644 index 000000000..72204de03 --- /dev/null +++ b/util/output/7.6.1/Endpoints/ReindexRethrottle.php @@ -0,0 +1,55 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +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"; + } + throw new RuntimeException('Missing parameter for the endpoint reindex_rethrottle'); + } + + public function getParamWhitelist(): array + { + return [ + 'requests_per_second' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setTaskId($task_id): ReindexRethrottle + { + if (isset($task_id) !== true) { + return $this; + } + $this->task_id = $task_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/RenderSearchTemplate.php b/util/output/7.6.1/Endpoints/RenderSearchTemplate.php new file mode 100644 index 000000000..e841efbbb --- /dev/null +++ b/util/output/7.6.1/Endpoints/RenderSearchTemplate.php @@ -0,0 +1,61 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class RenderSearchTemplate extends AbstractEndpoint +{ + + public function getURI(): string + { + $id = $this->id ?? null; + + if (isset($id)) { + return "/_render/template/$id"; + } + return "/_render/template"; + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return isset($this->body) ? 'POST' : 'GET'; + } + + public function setBody($body): RenderSearchTemplate + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setId($id): RenderSearchTemplate + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Rollup/DeleteJob.php b/util/output/7.6.1/Endpoints/Rollup/DeleteJob.php new file mode 100644 index 000000000..5b6a2250b --- /dev/null +++ b/util/output/7.6.1/Endpoints/Rollup/DeleteJob.php @@ -0,0 +1,52 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeleteJob extends AbstractEndpoint +{ + + public function getURI(): string + { + $id = $this->id ?? null; + + if (isset($id)) { + return "/_rollup/job/$id"; + } + throw new RuntimeException('Missing parameter for the endpoint rollup.delete_job'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setId($id): DeleteJob + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Rollup/GetJobs.php b/util/output/7.6.1/Endpoints/Rollup/GetJobs.php new file mode 100644 index 000000000..358eaa05c --- /dev/null +++ b/util/output/7.6.1/Endpoints/Rollup/GetJobs.php @@ -0,0 +1,51 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetJobs extends AbstractEndpoint +{ + + public function getURI(): string + { + $id = $this->id ?? null; + + if (isset($id)) { + return "/_rollup/job/$id"; + } + return "/_rollup/job/"; + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setId($id): GetJobs + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Rollup/GetRollupCaps.php b/util/output/7.6.1/Endpoints/Rollup/GetRollupCaps.php new file mode 100644 index 000000000..d71653118 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Rollup/GetRollupCaps.php @@ -0,0 +1,51 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetRollupCaps extends AbstractEndpoint +{ + + public function getURI(): string + { + $id = $this->id ?? null; + + if (isset($id)) { + return "/_rollup/data/$id"; + } + return "/_rollup/data/"; + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setId($id): GetRollupCaps + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Rollup/GetRollupIndexCaps.php b/util/output/7.6.1/Endpoints/Rollup/GetRollupIndexCaps.php new file mode 100644 index 000000000..b0d32b33d --- /dev/null +++ b/util/output/7.6.1/Endpoints/Rollup/GetRollupIndexCaps.php @@ -0,0 +1,42 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetRollupIndexCaps extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/$index/_rollup/data"; + } + throw new RuntimeException('Missing parameter for the endpoint rollup.get_rollup_index_caps'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Endpoints/Rollup/PutJob.php b/util/output/7.6.1/Endpoints/Rollup/PutJob.php new file mode 100644 index 000000000..98859b9e2 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Rollup/PutJob.php @@ -0,0 +1,62 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PutJob extends AbstractEndpoint +{ + + public function getURI(): string + { + $id = $this->id ?? null; + + if (isset($id)) { + return "/_rollup/job/$id"; + } + throw new RuntimeException('Missing parameter for the endpoint rollup.put_job'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): PutJob + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setId($id): PutJob + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Rollup/RollupSearch.php b/util/output/7.6.1/Endpoints/Rollup/RollupSearch.php new file mode 100644 index 000000000..f28258cba --- /dev/null +++ b/util/output/7.6.1/Endpoints/Rollup/RollupSearch.php @@ -0,0 +1,64 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class RollupSearch extends AbstractEndpoint +{ + + public function getURI(): string + { + if (isset($this->index) !== true) { + throw new RuntimeException( + 'index is required for rollup_search' + ); + } + $index = $this->index; + $type = $this->type ?? null; + if (isset($type)) { + @trigger_error('Specifying types in urls has been deprecated', E_USER_DEPRECATED); + } + + if (isset($type)) { + return "/$index/$type/_rollup_search"; + } + return "/$index/_rollup_search"; + } + + public function getParamWhitelist(): array + { + return [ + 'typed_keys', + 'rest_total_hits_as_int' + ]; + } + + public function getMethod(): string + { + return isset($this->body) ? 'POST' : 'GET'; + } + + public function setBody($body): RollupSearch + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Rollup/StartJob.php b/util/output/7.6.1/Endpoints/Rollup/StartJob.php new file mode 100644 index 000000000..2de9c4ca2 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Rollup/StartJob.php @@ -0,0 +1,52 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class StartJob extends AbstractEndpoint +{ + + public function getURI(): string + { + $id = $this->id ?? null; + + if (isset($id)) { + return "/_rollup/job/$id/_start"; + } + throw new RuntimeException('Missing parameter for the endpoint rollup.start_job'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setId($id): StartJob + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Rollup/StopJob.php b/util/output/7.6.1/Endpoints/Rollup/StopJob.php new file mode 100644 index 000000000..e7bfc4057 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Rollup/StopJob.php @@ -0,0 +1,55 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class StopJob extends AbstractEndpoint +{ + + public function getURI(): string + { + $id = $this->id ?? null; + + if (isset($id)) { + return "/_rollup/job/$id/_stop"; + } + throw new RuntimeException('Missing parameter for the endpoint rollup.stop_job'); + } + + public function getParamWhitelist(): array + { + return [ + 'wait_for_completion', + 'timeout' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setId($id): StopJob + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/ScriptsPainlessExecute.php b/util/output/7.6.1/Endpoints/ScriptsPainlessExecute.php new file mode 100644 index 000000000..574458980 --- /dev/null +++ b/util/output/7.6.1/Endpoints/ScriptsPainlessExecute.php @@ -0,0 +1,49 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class ScriptsPainlessExecute extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_scripts/painless/_execute"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return isset($this->body) ? 'POST' : 'GET'; + } + + public function setBody($body): ScriptsPainlessExecute + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Scroll.php b/util/output/7.6.1/Endpoints/Scroll.php new file mode 100644 index 000000000..8f14eb545 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Scroll.php @@ -0,0 +1,69 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Scroll extends AbstractEndpoint +{ + protected $scroll_id; + + public function getURI(): string + { + $scroll_id = $this->scroll_id ?? null; + if (isset($scroll_id)) { + @trigger_error('A scroll id can be quite large and should be specified as part of the body', E_USER_DEPRECATED); + } + + if (isset($scroll_id)) { + return "/_search/scroll/$scroll_id"; + } + return "/_search/scroll"; + } + + public function getParamWhitelist(): array + { + return [ + 'scroll', + 'scroll_id', + 'rest_total_hits_as_int' + ]; + } + + public function getMethod(): string + { + return isset($this->body) ? 'POST' : 'GET'; + } + + public function setBody($body): Scroll + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setScrollId($scroll_id): Scroll + { + if (isset($scroll_id) !== true) { + return $this; + } + $this->scroll_id = $scroll_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Search.php b/util/output/7.6.1/Endpoints/Search.php new file mode 100644 index 000000000..4337d9e83 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Search.php @@ -0,0 +1,101 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Search extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + $type = $this->type ?? null; + if (isset($type)) { + @trigger_error('Specifying types in urls has been deprecated', E_USER_DEPRECATED); + } + + if (isset($index) && isset($type)) { + return "/$index/$type/_search"; + } + if (isset($index)) { + return "/$index/_search"; + } + return "/_search"; + } + + public function getParamWhitelist(): array + { + return [ + 'analyzer', + 'analyze_wildcard', + 'ccs_minimize_roundtrips', + 'default_operator', + 'df', + 'explain', + 'stored_fields', + 'docvalue_fields', + 'from', + 'ignore_unavailable', + 'ignore_throttled', + 'allow_no_indices', + 'expand_wildcards', + 'lenient', + 'preference', + 'q', + 'routing', + 'scroll', + 'search_type', + 'size', + 'sort', + '_source', + '_source_excludes', + '_source_includes', + 'terminate_after', + 'stats', + 'suggest_field', + 'suggest_mode', + 'suggest_size', + 'suggest_text', + 'timeout', + 'track_scores', + 'track_total_hits', + 'allow_partial_search_results', + 'typed_keys', + 'version', + 'seq_no_primary_term', + 'request_cache', + 'batched_reduce_size', + 'max_concurrent_shard_requests', + 'pre_filter_shard_size', + 'rest_total_hits_as_int' + ]; + } + + public function getMethod(): string + { + return isset($this->body) ? 'POST' : 'GET'; + } + + public function setBody($body): Search + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/SearchShards.php b/util/output/7.6.1/Endpoints/SearchShards.php new file mode 100644 index 000000000..bb823b3ed --- /dev/null +++ b/util/output/7.6.1/Endpoints/SearchShards.php @@ -0,0 +1,48 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class SearchShards extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + + if (isset($index)) { + return "/$index/_search_shards"; + } + return "/_search_shards"; + } + + public function getParamWhitelist(): array + { + return [ + 'preference', + 'routing', + 'local', + 'ignore_unavailable', + 'allow_no_indices', + 'expand_wildcards' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Endpoints/SearchTemplate.php b/util/output/7.6.1/Endpoints/SearchTemplate.php new file mode 100644 index 000000000..cac298758 --- /dev/null +++ b/util/output/7.6.1/Endpoints/SearchTemplate.php @@ -0,0 +1,72 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class SearchTemplate extends AbstractEndpoint +{ + + public function getURI(): string + { + $index = $this->index ?? null; + $type = $this->type ?? null; + if (isset($type)) { + @trigger_error('Specifying types in urls has been deprecated', E_USER_DEPRECATED); + } + + if (isset($index) && isset($type)) { + return "/$index/$type/_search/template"; + } + if (isset($index)) { + return "/$index/_search/template"; + } + return "/_search/template"; + } + + public function getParamWhitelist(): array + { + return [ + 'ignore_unavailable', + 'ignore_throttled', + 'allow_no_indices', + 'expand_wildcards', + 'preference', + 'routing', + 'scroll', + 'search_type', + 'explain', + 'profile', + 'typed_keys', + 'rest_total_hits_as_int', + 'ccs_minimize_roundtrips' + ]; + } + + public function getMethod(): string + { + return isset($this->body) ? 'POST' : 'GET'; + } + + public function setBody($body): SearchTemplate + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Security/Authenticate.php b/util/output/7.6.1/Endpoints/Security/Authenticate.php new file mode 100644 index 000000000..57285af22 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Security/Authenticate.php @@ -0,0 +1,39 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Authenticate extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_security/_authenticate"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Endpoints/Security/ChangePassword.php b/util/output/7.6.1/Endpoints/Security/ChangePassword.php new file mode 100644 index 000000000..e565443d2 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Security/ChangePassword.php @@ -0,0 +1,64 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class ChangePassword extends AbstractEndpoint +{ + protected $username; + + public function getURI(): string + { + $username = $this->username ?? null; + + if (isset($username)) { + return "/_security/user/$username/_password"; + } + return "/_security/user/_password"; + } + + public function getParamWhitelist(): array + { + return [ + 'refresh' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): ChangePassword + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setUsername($username): ChangePassword + { + if (isset($username) !== true) { + return $this; + } + $this->username = $username; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Security/ClearCachedRealms.php b/util/output/7.6.1/Endpoints/Security/ClearCachedRealms.php new file mode 100644 index 000000000..1a8aac92d --- /dev/null +++ b/util/output/7.6.1/Endpoints/Security/ClearCachedRealms.php @@ -0,0 +1,58 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class ClearCachedRealms extends AbstractEndpoint +{ + protected $realms; + + public function getURI(): string + { + $realms = $this->realms ?? null; + + if (isset($realms)) { + return "/_security/realm/$realms/_clear_cache"; + } + throw new RuntimeException('Missing parameter for the endpoint security.clear_cached_realms'); + } + + public function getParamWhitelist(): array + { + return [ + 'usernames' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setRealms($realms): ClearCachedRealms + { + if (isset($realms) !== true) { + return $this; + } + if (is_array($realms) === true) { + $realms = implode(",", $realms); + } + $this->realms = $realms; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Security/ClearCachedRoles.php b/util/output/7.6.1/Endpoints/Security/ClearCachedRoles.php new file mode 100644 index 000000000..4c52b551b --- /dev/null +++ b/util/output/7.6.1/Endpoints/Security/ClearCachedRoles.php @@ -0,0 +1,58 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class ClearCachedRoles extends AbstractEndpoint +{ + protected $name; + + public function getURI(): string + { + $name = $this->name ?? null; + + if (isset($name)) { + return "/_security/role/$name/_clear_cache"; + } + throw new RuntimeException('Missing parameter for the endpoint security.clear_cached_roles'); + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setName($name): ClearCachedRoles + { + if (isset($name) !== true) { + return $this; + } + if (is_array($name) === true) { + $name = implode(",", $name); + } + $this->name = $name; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Security/CreateApiKey.php b/util/output/7.6.1/Endpoints/Security/CreateApiKey.php new file mode 100644 index 000000000..3ce540dab --- /dev/null +++ b/util/output/7.6.1/Endpoints/Security/CreateApiKey.php @@ -0,0 +1,49 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class CreateApiKey extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_security/api_key"; + } + + public function getParamWhitelist(): array + { + return [ + 'refresh' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): CreateApiKey + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Security/DeletePrivileges.php b/util/output/7.6.1/Endpoints/Security/DeletePrivileges.php new file mode 100644 index 000000000..533a25343 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Security/DeletePrivileges.php @@ -0,0 +1,67 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeletePrivileges extends AbstractEndpoint +{ + protected $application; + protected $name; + + public function getURI(): string + { + $application = $this->application ?? null; + $name = $this->name ?? null; + + if (isset($application) && isset($name)) { + return "/_security/privilege/$application/$name"; + } + throw new RuntimeException('Missing parameter for the endpoint security.delete_privileges'); + } + + public function getParamWhitelist(): array + { + return [ + 'refresh' + ]; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setApplication($application): DeletePrivileges + { + if (isset($application) !== true) { + return $this; + } + $this->application = $application; + + return $this; + } + + public function setName($name): DeletePrivileges + { + if (isset($name) !== true) { + return $this; + } + $this->name = $name; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Security/DeleteRole.php b/util/output/7.6.1/Endpoints/Security/DeleteRole.php new file mode 100644 index 000000000..2824e19fa --- /dev/null +++ b/util/output/7.6.1/Endpoints/Security/DeleteRole.php @@ -0,0 +1,55 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeleteRole extends AbstractEndpoint +{ + protected $name; + + public function getURI(): string + { + $name = $this->name ?? null; + + if (isset($name)) { + return "/_security/role/$name"; + } + throw new RuntimeException('Missing parameter for the endpoint security.delete_role'); + } + + public function getParamWhitelist(): array + { + return [ + 'refresh' + ]; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setName($name): DeleteRole + { + if (isset($name) !== true) { + return $this; + } + $this->name = $name; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Security/DeleteRoleMapping.php b/util/output/7.6.1/Endpoints/Security/DeleteRoleMapping.php new file mode 100644 index 000000000..9ce0b81c4 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Security/DeleteRoleMapping.php @@ -0,0 +1,55 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeleteRoleMapping extends AbstractEndpoint +{ + protected $name; + + public function getURI(): string + { + $name = $this->name ?? null; + + if (isset($name)) { + return "/_security/role_mapping/$name"; + } + throw new RuntimeException('Missing parameter for the endpoint security.delete_role_mapping'); + } + + public function getParamWhitelist(): array + { + return [ + 'refresh' + ]; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setName($name): DeleteRoleMapping + { + if (isset($name) !== true) { + return $this; + } + $this->name = $name; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Security/DeleteUser.php b/util/output/7.6.1/Endpoints/Security/DeleteUser.php new file mode 100644 index 000000000..b475d073f --- /dev/null +++ b/util/output/7.6.1/Endpoints/Security/DeleteUser.php @@ -0,0 +1,55 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeleteUser extends AbstractEndpoint +{ + protected $username; + + public function getURI(): string + { + $username = $this->username ?? null; + + if (isset($username)) { + return "/_security/user/$username"; + } + throw new RuntimeException('Missing parameter for the endpoint security.delete_user'); + } + + public function getParamWhitelist(): array + { + return [ + 'refresh' + ]; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setUsername($username): DeleteUser + { + if (isset($username) !== true) { + return $this; + } + $this->username = $username; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Security/DisableUser.php b/util/output/7.6.1/Endpoints/Security/DisableUser.php new file mode 100644 index 000000000..cf036aa0f --- /dev/null +++ b/util/output/7.6.1/Endpoints/Security/DisableUser.php @@ -0,0 +1,55 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DisableUser extends AbstractEndpoint +{ + protected $username; + + public function getURI(): string + { + $username = $this->username ?? null; + + if (isset($username)) { + return "/_security/user/$username/_disable"; + } + throw new RuntimeException('Missing parameter for the endpoint security.disable_user'); + } + + public function getParamWhitelist(): array + { + return [ + 'refresh' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setUsername($username): DisableUser + { + if (isset($username) !== true) { + return $this; + } + $this->username = $username; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Security/EnableUser.php b/util/output/7.6.1/Endpoints/Security/EnableUser.php new file mode 100644 index 000000000..bcbdf590f --- /dev/null +++ b/util/output/7.6.1/Endpoints/Security/EnableUser.php @@ -0,0 +1,55 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class EnableUser extends AbstractEndpoint +{ + protected $username; + + public function getURI(): string + { + $username = $this->username ?? null; + + if (isset($username)) { + return "/_security/user/$username/_enable"; + } + throw new RuntimeException('Missing parameter for the endpoint security.enable_user'); + } + + public function getParamWhitelist(): array + { + return [ + 'refresh' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setUsername($username): EnableUser + { + if (isset($username) !== true) { + return $this; + } + $this->username = $username; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Security/GetApiKey.php b/util/output/7.6.1/Endpoints/Security/GetApiKey.php new file mode 100644 index 000000000..db43dd52b --- /dev/null +++ b/util/output/7.6.1/Endpoints/Security/GetApiKey.php @@ -0,0 +1,43 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetApiKey extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_security/api_key"; + } + + public function getParamWhitelist(): array + { + return [ + 'id', + 'name', + 'username', + 'realm_name', + 'owner' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Endpoints/Security/GetBuiltinPrivileges.php b/util/output/7.6.1/Endpoints/Security/GetBuiltinPrivileges.php new file mode 100644 index 000000000..d3cc1ce69 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Security/GetBuiltinPrivileges.php @@ -0,0 +1,39 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetBuiltinPrivileges extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_security/privilege/_builtin"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Endpoints/Security/GetPrivileges.php b/util/output/7.6.1/Endpoints/Security/GetPrivileges.php new file mode 100644 index 000000000..64492d7f5 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Security/GetPrivileges.php @@ -0,0 +1,69 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetPrivileges extends AbstractEndpoint +{ + protected $application; + protected $name; + + public function getURI(): string + { + $application = $this->application ?? null; + $name = $this->name ?? null; + + if (isset($application) && isset($name)) { + return "/_security/privilege/$application/$name"; + } + if (isset($application)) { + return "/_security/privilege/$application"; + } + return "/_security/privilege"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setApplication($application): GetPrivileges + { + if (isset($application) !== true) { + return $this; + } + $this->application = $application; + + return $this; + } + + public function setName($name): GetPrivileges + { + if (isset($name) !== true) { + return $this; + } + $this->name = $name; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Security/GetRole.php b/util/output/7.6.1/Endpoints/Security/GetRole.php new file mode 100644 index 000000000..c5448f990 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Security/GetRole.php @@ -0,0 +1,54 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetRole extends AbstractEndpoint +{ + protected $name; + + public function getURI(): string + { + $name = $this->name ?? null; + + if (isset($name)) { + return "/_security/role/$name"; + } + return "/_security/role"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setName($name): GetRole + { + if (isset($name) !== true) { + return $this; + } + $this->name = $name; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Security/GetRoleMapping.php b/util/output/7.6.1/Endpoints/Security/GetRoleMapping.php new file mode 100644 index 000000000..914003a26 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Security/GetRoleMapping.php @@ -0,0 +1,54 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetRoleMapping extends AbstractEndpoint +{ + protected $name; + + public function getURI(): string + { + $name = $this->name ?? null; + + if (isset($name)) { + return "/_security/role_mapping/$name"; + } + return "/_security/role_mapping"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setName($name): GetRoleMapping + { + if (isset($name) !== true) { + return $this; + } + $this->name = $name; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Security/GetToken.php b/util/output/7.6.1/Endpoints/Security/GetToken.php new file mode 100644 index 000000000..c19c00306 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Security/GetToken.php @@ -0,0 +1,49 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetToken extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_security/oauth2/token"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): GetToken + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Security/GetUser.php b/util/output/7.6.1/Endpoints/Security/GetUser.php new file mode 100644 index 000000000..697c526b2 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Security/GetUser.php @@ -0,0 +1,57 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetUser extends AbstractEndpoint +{ + protected $username; + + public function getURI(): string + { + $username = $this->username ?? null; + + if (isset($username)) { + return "/_security/user/$username"; + } + return "/_security/user"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setUsername($username): GetUser + { + if (isset($username) !== true) { + return $this; + } + if (is_array($username) === true) { + $username = implode(",", $username); + } + $this->username = $username; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Security/GetUserPrivileges.php b/util/output/7.6.1/Endpoints/Security/GetUserPrivileges.php new file mode 100644 index 000000000..6782dc82d --- /dev/null +++ b/util/output/7.6.1/Endpoints/Security/GetUserPrivileges.php @@ -0,0 +1,39 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetUserPrivileges extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_security/user/_privileges"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Endpoints/Security/HasPrivileges.php b/util/output/7.6.1/Endpoints/Security/HasPrivileges.php new file mode 100644 index 000000000..0f1ed2ffe --- /dev/null +++ b/util/output/7.6.1/Endpoints/Security/HasPrivileges.php @@ -0,0 +1,64 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class HasPrivileges extends AbstractEndpoint +{ + protected $user; + + public function getURI(): string + { + $user = $this->user ?? null; + + if (isset($user)) { + return "/_security/user/$user/_has_privileges"; + } + return "/_security/user/_has_privileges"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return isset($this->body) ? 'POST' : 'GET'; + } + + public function setBody($body): HasPrivileges + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setUser($user): HasPrivileges + { + if (isset($user) !== true) { + return $this; + } + $this->user = $user; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Security/InvalidateApiKey.php b/util/output/7.6.1/Endpoints/Security/InvalidateApiKey.php new file mode 100644 index 000000000..90b26d49b --- /dev/null +++ b/util/output/7.6.1/Endpoints/Security/InvalidateApiKey.php @@ -0,0 +1,47 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class InvalidateApiKey extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_security/api_key"; + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setBody($body): InvalidateApiKey + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Security/InvalidateToken.php b/util/output/7.6.1/Endpoints/Security/InvalidateToken.php new file mode 100644 index 000000000..4db056542 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Security/InvalidateToken.php @@ -0,0 +1,49 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class InvalidateToken extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_security/oauth2/token"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setBody($body): InvalidateToken + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Security/PutPrivileges.php b/util/output/7.6.1/Endpoints/Security/PutPrivileges.php new file mode 100644 index 000000000..ca4185d84 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Security/PutPrivileges.php @@ -0,0 +1,49 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PutPrivileges extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_security/privilege/"; + } + + public function getParamWhitelist(): array + { + return [ + 'refresh' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): PutPrivileges + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Security/PutRole.php b/util/output/7.6.1/Endpoints/Security/PutRole.php new file mode 100644 index 000000000..60e7cc858 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Security/PutRole.php @@ -0,0 +1,65 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PutRole extends AbstractEndpoint +{ + protected $name; + + public function getURI(): string + { + $name = $this->name ?? null; + + if (isset($name)) { + return "/_security/role/$name"; + } + throw new RuntimeException('Missing parameter for the endpoint security.put_role'); + } + + public function getParamWhitelist(): array + { + return [ + 'refresh' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): PutRole + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setName($name): PutRole + { + if (isset($name) !== true) { + return $this; + } + $this->name = $name; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Security/PutRoleMapping.php b/util/output/7.6.1/Endpoints/Security/PutRoleMapping.php new file mode 100644 index 000000000..bf84f68c8 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Security/PutRoleMapping.php @@ -0,0 +1,65 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PutRoleMapping extends AbstractEndpoint +{ + protected $name; + + public function getURI(): string + { + $name = $this->name ?? null; + + if (isset($name)) { + return "/_security/role_mapping/$name"; + } + throw new RuntimeException('Missing parameter for the endpoint security.put_role_mapping'); + } + + public function getParamWhitelist(): array + { + return [ + 'refresh' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): PutRoleMapping + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setName($name): PutRoleMapping + { + if (isset($name) !== true) { + return $this; + } + $this->name = $name; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Security/PutUser.php b/util/output/7.6.1/Endpoints/Security/PutUser.php new file mode 100644 index 000000000..862b0723c --- /dev/null +++ b/util/output/7.6.1/Endpoints/Security/PutUser.php @@ -0,0 +1,65 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PutUser extends AbstractEndpoint +{ + protected $username; + + public function getURI(): string + { + $username = $this->username ?? null; + + if (isset($username)) { + return "/_security/user/$username"; + } + throw new RuntimeException('Missing parameter for the endpoint security.put_user'); + } + + public function getParamWhitelist(): array + { + return [ + 'refresh' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): PutUser + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setUsername($username): PutUser + { + if (isset($username) !== true) { + return $this; + } + $this->username = $username; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Slm/DeleteLifecycle.php b/util/output/7.6.1/Endpoints/Slm/DeleteLifecycle.php new file mode 100644 index 000000000..48d63cdd3 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Slm/DeleteLifecycle.php @@ -0,0 +1,55 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeleteLifecycle extends AbstractEndpoint +{ + protected $policy_id; + + public function getURI(): string + { + $policy_id = $this->policy_id ?? null; + + if (isset($policy_id)) { + return "/_slm/policy/$policy_id"; + } + throw new RuntimeException('Missing parameter for the endpoint slm.delete_lifecycle'); + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setPolicyId($policy_id): DeleteLifecycle + { + if (isset($policy_id) !== true) { + return $this; + } + $this->policy_id = $policy_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Slm/ExecuteLifecycle.php b/util/output/7.6.1/Endpoints/Slm/ExecuteLifecycle.php new file mode 100644 index 000000000..c2425e3f5 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Slm/ExecuteLifecycle.php @@ -0,0 +1,55 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class ExecuteLifecycle extends AbstractEndpoint +{ + protected $policy_id; + + public function getURI(): string + { + $policy_id = $this->policy_id ?? null; + + if (isset($policy_id)) { + return "/_slm/policy/$policy_id/_execute"; + } + throw new RuntimeException('Missing parameter for the endpoint slm.execute_lifecycle'); + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setPolicyId($policy_id): ExecuteLifecycle + { + if (isset($policy_id) !== true) { + return $this; + } + $this->policy_id = $policy_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Slm/ExecuteRetention.php b/util/output/7.6.1/Endpoints/Slm/ExecuteRetention.php new file mode 100644 index 000000000..ea68e88e6 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Slm/ExecuteRetention.php @@ -0,0 +1,39 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class ExecuteRetention extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_slm/_execute_retention"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'POST'; + } +} diff --git a/util/output/7.6.1/Endpoints/Slm/GetLifecycle.php b/util/output/7.6.1/Endpoints/Slm/GetLifecycle.php new file mode 100644 index 000000000..b829dd452 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Slm/GetLifecycle.php @@ -0,0 +1,57 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetLifecycle extends AbstractEndpoint +{ + protected $policy_id; + + public function getURI(): string + { + $policy_id = $this->policy_id ?? null; + + if (isset($policy_id)) { + return "/_slm/policy/$policy_id"; + } + return "/_slm/policy"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setPolicyId($policy_id): GetLifecycle + { + if (isset($policy_id) !== true) { + return $this; + } + if (is_array($policy_id) === true) { + $policy_id = implode(",", $policy_id); + } + $this->policy_id = $policy_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Slm/GetStats.php b/util/output/7.6.1/Endpoints/Slm/GetStats.php new file mode 100644 index 000000000..c0f9af609 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Slm/GetStats.php @@ -0,0 +1,39 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetStats extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_slm/stats"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Endpoints/Slm/GetStatus.php b/util/output/7.6.1/Endpoints/Slm/GetStatus.php new file mode 100644 index 000000000..e2b4715fe --- /dev/null +++ b/util/output/7.6.1/Endpoints/Slm/GetStatus.php @@ -0,0 +1,39 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetStatus extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_slm/status"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Endpoints/Slm/PutLifecycle.php b/util/output/7.6.1/Endpoints/Slm/PutLifecycle.php new file mode 100644 index 000000000..4daad0e3b --- /dev/null +++ b/util/output/7.6.1/Endpoints/Slm/PutLifecycle.php @@ -0,0 +1,65 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PutLifecycle extends AbstractEndpoint +{ + protected $policy_id; + + public function getURI(): string + { + $policy_id = $this->policy_id ?? null; + + if (isset($policy_id)) { + return "/_slm/policy/$policy_id"; + } + throw new RuntimeException('Missing parameter for the endpoint slm.put_lifecycle'); + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): PutLifecycle + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setPolicyId($policy_id): PutLifecycle + { + if (isset($policy_id) !== true) { + return $this; + } + $this->policy_id = $policy_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Slm/Start.php b/util/output/7.6.1/Endpoints/Slm/Start.php new file mode 100644 index 000000000..54a20f1a8 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Slm/Start.php @@ -0,0 +1,39 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Start extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_slm/start"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'POST'; + } +} diff --git a/util/output/7.6.1/Endpoints/Slm/Stop.php b/util/output/7.6.1/Endpoints/Slm/Stop.php new file mode 100644 index 000000000..7c308db4c --- /dev/null +++ b/util/output/7.6.1/Endpoints/Slm/Stop.php @@ -0,0 +1,39 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Stop extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_slm/stop"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'POST'; + } +} diff --git a/util/output/7.6.1/Endpoints/Snapshot/CleanupRepository.php b/util/output/7.6.1/Endpoints/Snapshot/CleanupRepository.php new file mode 100644 index 000000000..b0f5e9353 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Snapshot/CleanupRepository.php @@ -0,0 +1,56 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class CleanupRepository extends AbstractEndpoint +{ + protected $repository; + + public function getURI(): string + { + $repository = $this->repository ?? null; + + if (isset($repository)) { + return "/_snapshot/$repository/_cleanup"; + } + throw new RuntimeException('Missing parameter for the endpoint snapshot.cleanup_repository'); + } + + public function getParamWhitelist(): array + { + return [ + 'master_timeout', + 'timeout' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setRepository($repository): CleanupRepository + { + if (isset($repository) !== true) { + return $this; + } + $this->repository = $repository; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Snapshot/Create.php b/util/output/7.6.1/Endpoints/Snapshot/Create.php new file mode 100644 index 000000000..a408e4e5f --- /dev/null +++ b/util/output/7.6.1/Endpoints/Snapshot/Create.php @@ -0,0 +1,78 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Create extends AbstractEndpoint +{ + protected $repository; + protected $snapshot; + + public function getURI(): string + { + $repository = $this->repository ?? null; + $snapshot = $this->snapshot ?? null; + + if (isset($repository) && isset($snapshot)) { + return "/_snapshot/$repository/$snapshot"; + } + throw new RuntimeException('Missing parameter for the endpoint snapshot.create'); + } + + public function getParamWhitelist(): array + { + return [ + 'master_timeout', + 'wait_for_completion' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): Create + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setRepository($repository): Create + { + if (isset($repository) !== true) { + return $this; + } + $this->repository = $repository; + + return $this; + } + + public function setSnapshot($snapshot): Create + { + if (isset($snapshot) !== true) { + return $this; + } + $this->snapshot = $snapshot; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Snapshot/CreateRepository.php b/util/output/7.6.1/Endpoints/Snapshot/CreateRepository.php new file mode 100644 index 000000000..3243b57c9 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Snapshot/CreateRepository.php @@ -0,0 +1,67 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class CreateRepository extends AbstractEndpoint +{ + protected $repository; + + public function getURI(): string + { + $repository = $this->repository ?? null; + + if (isset($repository)) { + return "/_snapshot/$repository"; + } + throw new RuntimeException('Missing parameter for the endpoint snapshot.create_repository'); + } + + public function getParamWhitelist(): array + { + return [ + 'master_timeout', + 'timeout', + 'verify' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): CreateRepository + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setRepository($repository): CreateRepository + { + if (isset($repository) !== true) { + return $this; + } + $this->repository = $repository; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Snapshot/Delete.php b/util/output/7.6.1/Endpoints/Snapshot/Delete.php new file mode 100644 index 000000000..35e2904c6 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Snapshot/Delete.php @@ -0,0 +1,67 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Delete extends AbstractEndpoint +{ + protected $repository; + protected $snapshot; + + public function getURI(): string + { + $repository = $this->repository ?? null; + $snapshot = $this->snapshot ?? null; + + if (isset($repository) && isset($snapshot)) { + return "/_snapshot/$repository/$snapshot"; + } + throw new RuntimeException('Missing parameter for the endpoint snapshot.delete'); + } + + public function getParamWhitelist(): array + { + return [ + 'master_timeout' + ]; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setRepository($repository): Delete + { + if (isset($repository) !== true) { + return $this; + } + $this->repository = $repository; + + return $this; + } + + public function setSnapshot($snapshot): Delete + { + if (isset($snapshot) !== true) { + return $this; + } + $this->snapshot = $snapshot; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Snapshot/DeleteRepository.php b/util/output/7.6.1/Endpoints/Snapshot/DeleteRepository.php new file mode 100644 index 000000000..06500eed3 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Snapshot/DeleteRepository.php @@ -0,0 +1,59 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeleteRepository extends AbstractEndpoint +{ + protected $repository; + + public function getURI(): string + { + $repository = $this->repository ?? null; + + if (isset($repository)) { + return "/_snapshot/$repository"; + } + throw new RuntimeException('Missing parameter for the endpoint snapshot.delete_repository'); + } + + public function getParamWhitelist(): array + { + return [ + 'master_timeout', + 'timeout' + ]; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setRepository($repository): DeleteRepository + { + if (isset($repository) !== true) { + return $this; + } + if (is_array($repository) === true) { + $repository = implode(",", $repository); + } + $this->repository = $repository; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Snapshot/Get.php b/util/output/7.6.1/Endpoints/Snapshot/Get.php new file mode 100644 index 000000000..8fa1938d8 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Snapshot/Get.php @@ -0,0 +1,72 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Get extends AbstractEndpoint +{ + protected $repository; + protected $snapshot; + + public function getURI(): string + { + $repository = $this->repository ?? null; + $snapshot = $this->snapshot ?? null; + + if (isset($repository) && isset($snapshot)) { + return "/_snapshot/$repository/$snapshot"; + } + throw new RuntimeException('Missing parameter for the endpoint snapshot.get'); + } + + public function getParamWhitelist(): array + { + return [ + 'master_timeout', + 'ignore_unavailable', + 'verbose' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setRepository($repository): Get + { + if (isset($repository) !== true) { + return $this; + } + $this->repository = $repository; + + return $this; + } + + public function setSnapshot($snapshot): Get + { + if (isset($snapshot) !== true) { + return $this; + } + if (is_array($snapshot) === true) { + $snapshot = implode(",", $snapshot); + } + $this->snapshot = $snapshot; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Snapshot/GetRepository.php b/util/output/7.6.1/Endpoints/Snapshot/GetRepository.php new file mode 100644 index 000000000..92a62e426 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Snapshot/GetRepository.php @@ -0,0 +1,58 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetRepository extends AbstractEndpoint +{ + protected $repository; + + public function getURI(): string + { + $repository = $this->repository ?? null; + + if (isset($repository)) { + return "/_snapshot/$repository"; + } + return "/_snapshot"; + } + + public function getParamWhitelist(): array + { + return [ + 'master_timeout', + 'local' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setRepository($repository): GetRepository + { + if (isset($repository) !== true) { + return $this; + } + if (is_array($repository) === true) { + $repository = implode(",", $repository); + } + $this->repository = $repository; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Snapshot/Restore.php b/util/output/7.6.1/Endpoints/Snapshot/Restore.php new file mode 100644 index 000000000..157ad0e88 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Snapshot/Restore.php @@ -0,0 +1,78 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Restore extends AbstractEndpoint +{ + protected $repository; + protected $snapshot; + + public function getURI(): string + { + $repository = $this->repository ?? null; + $snapshot = $this->snapshot ?? null; + + if (isset($repository) && isset($snapshot)) { + return "/_snapshot/$repository/$snapshot/_restore"; + } + throw new RuntimeException('Missing parameter for the endpoint snapshot.restore'); + } + + public function getParamWhitelist(): array + { + return [ + 'master_timeout', + 'wait_for_completion' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): Restore + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setRepository($repository): Restore + { + if (isset($repository) !== true) { + return $this; + } + $this->repository = $repository; + + return $this; + } + + public function setSnapshot($snapshot): Restore + { + if (isset($snapshot) !== true) { + return $this; + } + $this->snapshot = $snapshot; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Snapshot/Status.php b/util/output/7.6.1/Endpoints/Snapshot/Status.php new file mode 100644 index 000000000..b628c06e6 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Snapshot/Status.php @@ -0,0 +1,73 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Status extends AbstractEndpoint +{ + protected $repository; + protected $snapshot; + + public function getURI(): string + { + $repository = $this->repository ?? null; + $snapshot = $this->snapshot ?? null; + + if (isset($repository) && isset($snapshot)) { + return "/_snapshot/$repository/$snapshot/_status"; + } + if (isset($repository)) { + return "/_snapshot/$repository/_status"; + } + return "/_snapshot/_status"; + } + + public function getParamWhitelist(): array + { + return [ + 'master_timeout', + 'ignore_unavailable' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setRepository($repository): Status + { + if (isset($repository) !== true) { + return $this; + } + $this->repository = $repository; + + return $this; + } + + public function setSnapshot($snapshot): Status + { + if (isset($snapshot) !== true) { + return $this; + } + if (is_array($snapshot) === true) { + $snapshot = implode(",", $snapshot); + } + $this->snapshot = $snapshot; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Snapshot/VerifyRepository.php b/util/output/7.6.1/Endpoints/Snapshot/VerifyRepository.php new file mode 100644 index 000000000..f0008e579 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Snapshot/VerifyRepository.php @@ -0,0 +1,56 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class VerifyRepository extends AbstractEndpoint +{ + protected $repository; + + public function getURI(): string + { + $repository = $this->repository ?? null; + + if (isset($repository)) { + return "/_snapshot/$repository/_verify"; + } + throw new RuntimeException('Missing parameter for the endpoint snapshot.verify_repository'); + } + + public function getParamWhitelist(): array + { + return [ + 'master_timeout', + 'timeout' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setRepository($repository): VerifyRepository + { + if (isset($repository) !== true) { + return $this; + } + $this->repository = $repository; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Sql/ClearCursor.php b/util/output/7.6.1/Endpoints/Sql/ClearCursor.php new file mode 100644 index 000000000..f6f86e6f3 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Sql/ClearCursor.php @@ -0,0 +1,47 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class ClearCursor extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_sql/close"; + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): ClearCursor + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Sql/Query.php b/util/output/7.6.1/Endpoints/Sql/Query.php new file mode 100644 index 000000000..87fb1e0e5 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Sql/Query.php @@ -0,0 +1,49 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Query extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_sql"; + } + + public function getParamWhitelist(): array + { + return [ + 'format' + ]; + } + + public function getMethod(): string + { + return isset($this->body) ? 'POST' : 'GET'; + } + + public function setBody($body): Query + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Sql/Translate.php b/util/output/7.6.1/Endpoints/Sql/Translate.php new file mode 100644 index 000000000..dc01f7d7d --- /dev/null +++ b/util/output/7.6.1/Endpoints/Sql/Translate.php @@ -0,0 +1,49 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Translate extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_sql/translate"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return isset($this->body) ? 'POST' : 'GET'; + } + + public function setBody($body): Translate + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Ssl/Certificates.php b/util/output/7.6.1/Endpoints/Ssl/Certificates.php new file mode 100644 index 000000000..921908a25 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Ssl/Certificates.php @@ -0,0 +1,39 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Certificates extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_ssl/certificates"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Endpoints/Tasks/Cancel.php b/util/output/7.6.1/Endpoints/Tasks/Cancel.php new file mode 100644 index 000000000..926c804e7 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Tasks/Cancel.php @@ -0,0 +1,56 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Cancel extends AbstractEndpoint +{ + protected $task_id; + + public function getURI(): string + { + $task_id = $this->task_id ?? null; + + if (isset($task_id)) { + return "/_tasks/$task_id/_cancel"; + } + return "/_tasks/_cancel"; + } + + public function getParamWhitelist(): array + { + return [ + 'nodes', + 'actions', + 'parent_task_id' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setTaskId($task_id): Cancel + { + if (isset($task_id) !== true) { + return $this; + } + $this->task_id = $task_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Tasks/Get.php b/util/output/7.6.1/Endpoints/Tasks/Get.php new file mode 100644 index 000000000..798c22d44 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Tasks/Get.php @@ -0,0 +1,56 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Get extends AbstractEndpoint +{ + protected $task_id; + + public function getURI(): string + { + $task_id = $this->task_id ?? null; + + if (isset($task_id)) { + return "/_tasks/$task_id"; + } + throw new RuntimeException('Missing parameter for the endpoint tasks.get'); + } + + public function getParamWhitelist(): array + { + return [ + 'wait_for_completion', + 'timeout' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setTaskId($task_id): Get + { + if (isset($task_id) !== true) { + return $this; + } + $this->task_id = $task_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Tasks/ListTasks.php b/util/output/7.6.1/Endpoints/Tasks/ListTasks.php new file mode 100644 index 000000000..2741d2c53 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Tasks/ListTasks.php @@ -0,0 +1,45 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class ListTasks extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_tasks"; + } + + public function getParamWhitelist(): array + { + return [ + 'nodes', + 'actions', + 'detailed', + 'parent_task_id', + 'wait_for_completion', + 'group_by', + 'timeout' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Endpoints/TermVectors.php b/util/output/7.6.1/Endpoints/TermVectors.php new file mode 100644 index 000000000..e9d899fdf --- /dev/null +++ b/util/output/7.6.1/Endpoints/TermVectors.php @@ -0,0 +1,90 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class TermVectors extends AbstractEndpoint +{ + + public function getURI(): string + { + if (isset($this->index) !== true) { + throw new RuntimeException( + 'index is required for termvectors' + ); + } + $index = $this->index; + $id = $this->id ?? null; + $type = $this->type ?? null; + if (isset($type)) { + @trigger_error('Specifying types in urls has been deprecated', E_USER_DEPRECATED); + } + + if (isset($type) && isset($id)) { + return "/$index/$type/$id/_termvectors"; + } + if (isset($type)) { + return "/$index/$type/_termvectors"; + } + if (isset($id)) { + return "/$index/_termvectors/$id"; + } + return "/$index/_termvectors"; + } + + public function getParamWhitelist(): array + { + return [ + 'term_statistics', + 'field_statistics', + 'fields', + 'offsets', + 'positions', + 'payloads', + 'preference', + 'routing', + 'realtime', + 'version', + 'version_type' + ]; + } + + public function getMethod(): string + { + return isset($this->body) ? 'POST' : 'GET'; + } + + public function setBody($body): TermVectors + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setId($id): TermVectors + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Transform/DeleteTransform.php b/util/output/7.6.1/Endpoints/Transform/DeleteTransform.php new file mode 100644 index 000000000..1c6fe073d --- /dev/null +++ b/util/output/7.6.1/Endpoints/Transform/DeleteTransform.php @@ -0,0 +1,55 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeleteTransform extends AbstractEndpoint +{ + protected $transform_id; + + public function getURI(): string + { + $transform_id = $this->transform_id ?? null; + + if (isset($transform_id)) { + return "/_transform/$transform_id"; + } + throw new RuntimeException('Missing parameter for the endpoint transform.delete_transform'); + } + + public function getParamWhitelist(): array + { + return [ + 'force' + ]; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setTransformId($transform_id): DeleteTransform + { + if (isset($transform_id) !== true) { + return $this; + } + $this->transform_id = $transform_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Transform/GetTransform.php b/util/output/7.6.1/Endpoints/Transform/GetTransform.php new file mode 100644 index 000000000..40f59a0dd --- /dev/null +++ b/util/output/7.6.1/Endpoints/Transform/GetTransform.php @@ -0,0 +1,56 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetTransform extends AbstractEndpoint +{ + protected $transform_id; + + public function getURI(): string + { + $transform_id = $this->transform_id ?? null; + + if (isset($transform_id)) { + return "/_transform/$transform_id"; + } + return "/_transform"; + } + + public function getParamWhitelist(): array + { + return [ + 'from', + 'size', + 'allow_no_match' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setTransformId($transform_id): GetTransform + { + if (isset($transform_id) !== true) { + return $this; + } + $this->transform_id = $transform_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Transform/GetTransformStats.php b/util/output/7.6.1/Endpoints/Transform/GetTransformStats.php new file mode 100644 index 000000000..3f3372822 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Transform/GetTransformStats.php @@ -0,0 +1,57 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetTransformStats extends AbstractEndpoint +{ + protected $transform_id; + + public function getURI(): string + { + $transform_id = $this->transform_id ?? null; + + if (isset($transform_id)) { + return "/_transform/$transform_id/_stats"; + } + throw new RuntimeException('Missing parameter for the endpoint transform.get_transform_stats'); + } + + public function getParamWhitelist(): array + { + return [ + 'from', + 'size', + 'allow_no_match' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setTransformId($transform_id): GetTransformStats + { + if (isset($transform_id) !== true) { + return $this; + } + $this->transform_id = $transform_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Transform/PreviewTransform.php b/util/output/7.6.1/Endpoints/Transform/PreviewTransform.php new file mode 100644 index 000000000..f4fa37faa --- /dev/null +++ b/util/output/7.6.1/Endpoints/Transform/PreviewTransform.php @@ -0,0 +1,47 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PreviewTransform extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_transform/_preview"; + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): PreviewTransform + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Transform/PutTransform.php b/util/output/7.6.1/Endpoints/Transform/PutTransform.php new file mode 100644 index 000000000..557b837dc --- /dev/null +++ b/util/output/7.6.1/Endpoints/Transform/PutTransform.php @@ -0,0 +1,65 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PutTransform extends AbstractEndpoint +{ + protected $transform_id; + + public function getURI(): string + { + $transform_id = $this->transform_id ?? null; + + if (isset($transform_id)) { + return "/_transform/$transform_id"; + } + throw new RuntimeException('Missing parameter for the endpoint transform.put_transform'); + } + + public function getParamWhitelist(): array + { + return [ + 'defer_validation' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): PutTransform + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setTransformId($transform_id): PutTransform + { + if (isset($transform_id) !== true) { + return $this; + } + $this->transform_id = $transform_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Transform/StartTransform.php b/util/output/7.6.1/Endpoints/Transform/StartTransform.php new file mode 100644 index 000000000..b27a97d4f --- /dev/null +++ b/util/output/7.6.1/Endpoints/Transform/StartTransform.php @@ -0,0 +1,55 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class StartTransform extends AbstractEndpoint +{ + protected $transform_id; + + public function getURI(): string + { + $transform_id = $this->transform_id ?? null; + + if (isset($transform_id)) { + return "/_transform/$transform_id/_start"; + } + throw new RuntimeException('Missing parameter for the endpoint transform.start_transform'); + } + + public function getParamWhitelist(): array + { + return [ + 'timeout' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setTransformId($transform_id): StartTransform + { + if (isset($transform_id) !== true) { + return $this; + } + $this->transform_id = $transform_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Transform/StopTransform.php b/util/output/7.6.1/Endpoints/Transform/StopTransform.php new file mode 100644 index 000000000..87c73f575 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Transform/StopTransform.php @@ -0,0 +1,59 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class StopTransform extends AbstractEndpoint +{ + protected $transform_id; + + public function getURI(): string + { + $transform_id = $this->transform_id ?? null; + + if (isset($transform_id)) { + return "/_transform/$transform_id/_stop"; + } + throw new RuntimeException('Missing parameter for the endpoint transform.stop_transform'); + } + + public function getParamWhitelist(): array + { + return [ + 'force', + 'wait_for_completion', + 'timeout', + 'allow_no_match', + 'wait_for_checkpoint' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setTransformId($transform_id): StopTransform + { + if (isset($transform_id) !== true) { + return $this; + } + $this->transform_id = $transform_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Transform/UpdateTransform.php b/util/output/7.6.1/Endpoints/Transform/UpdateTransform.php new file mode 100644 index 000000000..25f1e1799 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Transform/UpdateTransform.php @@ -0,0 +1,65 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class UpdateTransform extends AbstractEndpoint +{ + protected $transform_id; + + public function getURI(): string + { + $transform_id = $this->transform_id ?? null; + + if (isset($transform_id)) { + return "/_transform/$transform_id/_update"; + } + throw new RuntimeException('Missing parameter for the endpoint transform.update_transform'); + } + + public function getParamWhitelist(): array + { + return [ + 'defer_validation' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): UpdateTransform + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setTransformId($transform_id): UpdateTransform + { + if (isset($transform_id) !== true) { + return $this; + } + $this->transform_id = $transform_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Update.php b/util/output/7.6.1/Endpoints/Update.php new file mode 100644 index 000000000..237fdd868 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Update.php @@ -0,0 +1,89 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Update extends AbstractEndpoint +{ + + public function getURI(): string + { + if (isset($this->id) !== true) { + throw new RuntimeException( + 'id is required for update' + ); + } + $id = $this->id; + if (isset($this->index) !== true) { + throw new RuntimeException( + 'index is required for update' + ); + } + $index = $this->index; + $type = $this->type ?? null; + if (isset($type)) { + @trigger_error('Specifying types in urls has been deprecated', E_USER_DEPRECATED); + } + + if (isset($type)) { + return "/$index/$type/$id/_update"; + } + return "/$index/_update/$id"; + } + + public function getParamWhitelist(): array + { + return [ + 'wait_for_active_shards', + '_source', + '_source_excludes', + '_source_includes', + 'lang', + 'refresh', + 'retry_on_conflict', + 'routing', + 'timeout', + 'if_seq_no', + 'if_primary_term' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): Update + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setId($id): Update + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/UpdateByQuery.php b/util/output/7.6.1/Endpoints/UpdateByQuery.php new file mode 100644 index 000000000..06778e8f2 --- /dev/null +++ b/util/output/7.6.1/Endpoints/UpdateByQuery.php @@ -0,0 +1,97 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class UpdateByQuery extends AbstractEndpoint +{ + + public function getURI(): string + { + if (isset($this->index) !== true) { + throw new RuntimeException( + 'index is required for update_by_query' + ); + } + $index = $this->index; + $type = $this->type ?? null; + if (isset($type)) { + @trigger_error('Specifying types in urls has been deprecated', E_USER_DEPRECATED); + } + + if (isset($type)) { + return "/$index/$type/_update_by_query"; + } + return "/$index/_update_by_query"; + } + + public function getParamWhitelist(): array + { + return [ + 'analyzer', + 'analyze_wildcard', + 'default_operator', + 'df', + 'from', + 'ignore_unavailable', + 'allow_no_indices', + 'conflicts', + 'expand_wildcards', + 'lenient', + 'pipeline', + 'preference', + 'q', + 'routing', + 'scroll', + 'search_type', + 'search_timeout', + 'size', + 'max_docs', + 'sort', + '_source', + '_source_excludes', + '_source_includes', + 'terminate_after', + 'stats', + 'version', + 'version_type', + 'request_cache', + 'refresh', + 'timeout', + 'wait_for_active_shards', + 'scroll_size', + 'wait_for_completion', + 'requests_per_second', + 'slices' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setBody($body): UpdateByQuery + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/UpdateByQueryRethrottle.php b/util/output/7.6.1/Endpoints/UpdateByQueryRethrottle.php new file mode 100644 index 000000000..a70485f8f --- /dev/null +++ b/util/output/7.6.1/Endpoints/UpdateByQueryRethrottle.php @@ -0,0 +1,55 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +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"; + } + throw new RuntimeException('Missing parameter for the endpoint update_by_query_rethrottle'); + } + + public function getParamWhitelist(): array + { + return [ + 'requests_per_second' + ]; + } + + public function getMethod(): string + { + return 'POST'; + } + + public function setTaskId($task_id): UpdateByQueryRethrottle + { + if (isset($task_id) !== true) { + return $this; + } + $this->task_id = $task_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Watcher/AckWatch.php b/util/output/7.6.1/Endpoints/Watcher/AckWatch.php new file mode 100644 index 000000000..08455bb9a --- /dev/null +++ b/util/output/7.6.1/Endpoints/Watcher/AckWatch.php @@ -0,0 +1,73 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class AckWatch extends AbstractEndpoint +{ + protected $watch_id; + protected $action_id; + + public function getURI(): string + { + if (isset($this->watch_id) !== true) { + throw new RuntimeException( + 'watch_id is required for ack_watch' + ); + } + $watch_id = $this->watch_id; + $action_id = $this->action_id ?? null; + + if (isset($action_id)) { + return "/_watcher/watch/$watch_id/_ack/$action_id"; + } + return "/_watcher/watch/$watch_id/_ack"; + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setWatchId($watch_id): AckWatch + { + if (isset($watch_id) !== true) { + return $this; + } + $this->watch_id = $watch_id; + + return $this; + } + + public function setActionId($action_id): AckWatch + { + if (isset($action_id) !== true) { + return $this; + } + if (is_array($action_id) === true) { + $action_id = implode(",", $action_id); + } + $this->action_id = $action_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Watcher/ActivateWatch.php b/util/output/7.6.1/Endpoints/Watcher/ActivateWatch.php new file mode 100644 index 000000000..0d20108da --- /dev/null +++ b/util/output/7.6.1/Endpoints/Watcher/ActivateWatch.php @@ -0,0 +1,53 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class ActivateWatch extends AbstractEndpoint +{ + protected $watch_id; + + public function getURI(): string + { + $watch_id = $this->watch_id ?? null; + + if (isset($watch_id)) { + return "/_watcher/watch/$watch_id/_activate"; + } + throw new RuntimeException('Missing parameter for the endpoint watcher.activate_watch'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setWatchId($watch_id): ActivateWatch + { + if (isset($watch_id) !== true) { + return $this; + } + $this->watch_id = $watch_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Watcher/DeactivateWatch.php b/util/output/7.6.1/Endpoints/Watcher/DeactivateWatch.php new file mode 100644 index 000000000..822d8861a --- /dev/null +++ b/util/output/7.6.1/Endpoints/Watcher/DeactivateWatch.php @@ -0,0 +1,53 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeactivateWatch extends AbstractEndpoint +{ + protected $watch_id; + + public function getURI(): string + { + $watch_id = $this->watch_id ?? null; + + if (isset($watch_id)) { + return "/_watcher/watch/$watch_id/_deactivate"; + } + throw new RuntimeException('Missing parameter for the endpoint watcher.deactivate_watch'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setWatchId($watch_id): DeactivateWatch + { + if (isset($watch_id) !== true) { + return $this; + } + $this->watch_id = $watch_id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Watcher/DeleteWatch.php b/util/output/7.6.1/Endpoints/Watcher/DeleteWatch.php new file mode 100644 index 000000000..02114ae8b --- /dev/null +++ b/util/output/7.6.1/Endpoints/Watcher/DeleteWatch.php @@ -0,0 +1,52 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DeleteWatch extends AbstractEndpoint +{ + + public function getURI(): string + { + $id = $this->id ?? null; + + if (isset($id)) { + return "/_watcher/watch/$id"; + } + throw new RuntimeException('Missing parameter for the endpoint watcher.delete_watch'); + } + + public function getParamWhitelist(): array + { + return []; + } + + public function getMethod(): string + { + return 'DELETE'; + } + + public function setId($id): DeleteWatch + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Watcher/ExecuteWatch.php b/util/output/7.6.1/Endpoints/Watcher/ExecuteWatch.php new file mode 100644 index 000000000..b17c4b877 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Watcher/ExecuteWatch.php @@ -0,0 +1,63 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class ExecuteWatch extends AbstractEndpoint +{ + + public function getURI(): string + { + $id = $this->id ?? null; + + if (isset($id)) { + return "/_watcher/watch/$id/_execute"; + } + return "/_watcher/watch/_execute"; + } + + public function getParamWhitelist(): array + { + return [ + 'debug' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): ExecuteWatch + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setId($id): ExecuteWatch + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Watcher/GetWatch.php b/util/output/7.6.1/Endpoints/Watcher/GetWatch.php new file mode 100644 index 000000000..3f73ded39 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Watcher/GetWatch.php @@ -0,0 +1,54 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GetWatch extends AbstractEndpoint +{ + + public function getURI(): string + { + $id = $this->id ?? null; + + if (isset($id)) { + return "/_watcher/watch/$id"; + } + throw new RuntimeException('Missing parameter for the endpoint watcher.get_watch'); + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setId($id): GetWatch + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Watcher/PutWatch.php b/util/output/7.6.1/Endpoints/Watcher/PutWatch.php new file mode 100644 index 000000000..5d3050ee6 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Watcher/PutWatch.php @@ -0,0 +1,67 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class PutWatch extends AbstractEndpoint +{ + + public function getURI(): string + { + $id = $this->id ?? null; + + if (isset($id)) { + return "/_watcher/watch/$id"; + } + throw new RuntimeException('Missing parameter for the endpoint watcher.put_watch'); + } + + public function getParamWhitelist(): array + { + return [ + 'active', + 'version', + 'if_seq_no', + 'if_primary_term' + ]; + } + + public function getMethod(): string + { + return 'PUT'; + } + + public function setBody($body): PutWatch + { + if (isset($body) !== true) { + return $this; + } + $this->body = $body; + + return $this; + } + + public function setId($id): PutWatch + { + if (isset($id) !== true) { + return $this; + } + $this->id = $id; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Watcher/Start.php b/util/output/7.6.1/Endpoints/Watcher/Start.php new file mode 100644 index 000000000..98c39a41c --- /dev/null +++ b/util/output/7.6.1/Endpoints/Watcher/Start.php @@ -0,0 +1,39 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Start extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_watcher/_start"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'POST'; + } +} diff --git a/util/output/7.6.1/Endpoints/Watcher/Stats.php b/util/output/7.6.1/Endpoints/Watcher/Stats.php new file mode 100644 index 000000000..7a374e098 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Watcher/Stats.php @@ -0,0 +1,58 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Stats extends AbstractEndpoint +{ + protected $metric; + + public function getURI(): string + { + $metric = $this->metric ?? null; + + if (isset($metric)) { + return "/_watcher/stats/$metric"; + } + return "/_watcher/stats"; + } + + public function getParamWhitelist(): array + { + return [ + 'metric', + 'emit_stacktraces' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } + + public function setMetric($metric): Stats + { + if (isset($metric) !== true) { + return $this; + } + if (is_array($metric) === true) { + $metric = implode(",", $metric); + } + $this->metric = $metric; + + return $this; + } +} diff --git a/util/output/7.6.1/Endpoints/Watcher/Stop.php b/util/output/7.6.1/Endpoints/Watcher/Stop.php new file mode 100644 index 000000000..b6c7226a0 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Watcher/Stop.php @@ -0,0 +1,39 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Stop extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_watcher/_stop"; + } + + public function getParamWhitelist(): array + { + return [ + + ]; + } + + public function getMethod(): string + { + return 'POST'; + } +} diff --git a/util/output/7.6.1/Endpoints/Xpack/Info.php b/util/output/7.6.1/Endpoints/Xpack/Info.php new file mode 100644 index 000000000..16ef6d340 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Xpack/Info.php @@ -0,0 +1,39 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Info extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_xpack"; + } + + public function getParamWhitelist(): array + { + return [ + 'categories' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Endpoints/Xpack/Usage.php b/util/output/7.6.1/Endpoints/Xpack/Usage.php new file mode 100644 index 000000000..f21f8b719 --- /dev/null +++ b/util/output/7.6.1/Endpoints/Xpack/Usage.php @@ -0,0 +1,39 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class Usage extends AbstractEndpoint +{ + + public function getURI(): string + { + + return "/_xpack/usage"; + } + + public function getParamWhitelist(): array + { + return [ + 'master_timeout' + ]; + } + + public function getMethod(): string + { + return 'GET'; + } +} diff --git a/util/output/7.6.1/Namespaces/CatNamespace.php b/util/output/7.6.1/Namespaces/CatNamespace.php new file mode 100644 index 000000000..e5d4cc3ef --- /dev/null +++ b/util/output/7.6.1/Namespaces/CatNamespace.php @@ -0,0 +1,503 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +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 master 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) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-alias.html + */ + public function aliases(array $params = []) + { + $name = $this->extractArgument($params, 'name'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Cat\Aliases'); + $endpoint->setParams($params); + $endpoint->setName($name); + + 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 master node (default: false) + * $params['master_timeout'] = (time) Explicit operation timeout for connection to master 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) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-allocation.html + */ + public function allocation(array $params = []) + { + $node_id = $this->extractArgument($params, 'node_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Cat\Allocation'); + $endpoint->setParams($params); + $endpoint->setNodeId($node_id); + + 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) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-count.html + */ + public function count(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Cat\Count'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + + 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) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-fielddata.html + */ + public function fielddata(array $params = []) + { + $fields = $this->extractArgument($params, 'fields'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Cat\Fielddata'); + $endpoint->setParams($params); + $endpoint->setFields($fields); + + 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 (Days),h (Hours),m (Minutes),s (Seconds),ms (Milliseconds),micros (Microseconds),nanos (Nanoseconds)) + * $params['ts'] = (boolean) Set to false to disable timestamping (Default = true) + * $params['v'] = (boolean) Verbose mode. Display column headers (Default = false) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-health.html + */ + public function health(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Cat\Health'); + $endpoint->setParams($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 + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat.html + */ + public function help(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Cat\Help'); + $endpoint->setParams($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 master node (default: false) + * $params['master_timeout'] = (time) Explicit operation timeout for connection to master 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 (Days),h (Hours),m (Minutes),s (Seconds),ms (Milliseconds),micros (Microseconds),nanos (Nanoseconds)) + * $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) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-indices.html + */ + public function indices(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Cat\Indices'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + + 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 master node (default: false) + * $params['master_timeout'] = (time) Explicit operation timeout for connection to master 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) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-master.html + */ + public function master(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Cat\Master'); + $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 master node (default: false) + * $params['master_timeout'] = (time) Explicit operation timeout for connection to master 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) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodeattrs.html + */ + public function nodeattrs(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Cat\NodeAttrs'); + $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 master node (default: false) + * $params['master_timeout'] = (time) Explicit operation timeout for connection to master 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 (Days),h (Hours),m (Minutes),s (Seconds),ms (Milliseconds),micros (Microseconds),nanos (Nanoseconds)) + * $params['v'] = (boolean) Verbose mode. Display column headers (Default = false) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodes.html + */ + public function nodes(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Cat\Nodes'); + $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 master node (default: false) + * $params['master_timeout'] = (time) Explicit operation timeout for connection to master 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 (Days),h (Hours),m (Minutes),s (Seconds),ms (Milliseconds),micros (Microseconds),nanos (Nanoseconds)) + * $params['v'] = (boolean) Verbose mode. Display column headers (Default = false) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-pending-tasks.html + */ + public function pendingTasks(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $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 master node (default: false) + * $params['master_timeout'] = (time) Explicit operation timeout for connection to master 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) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-plugins.html + */ + public function plugins(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Cat\Plugins'); + $endpoint->setParams($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 (Days),h (Hours),m (Minutes),s (Seconds),ms (Milliseconds),micros (Microseconds),nanos (Nanoseconds)) + * $params['v'] = (boolean) Verbose mode. Display column headers (Default = false) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-recovery.html + */ + public function recovery(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Cat\Recovery'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + + 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 master node (Default = false) + * $params['master_timeout'] = (time) Explicit operation timeout for connection to master 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) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-repositories.html + */ + public function repositories(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Cat\Repositories'); + $endpoint->setParams($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) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-segments.html + */ + public function segments(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Cat\Segments'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + + 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 master node (default: false) + * $params['master_timeout'] = (time) Explicit operation timeout for connection to master 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 (Days),h (Hours),m (Minutes),s (Seconds),ms (Milliseconds),micros (Microseconds),nanos (Nanoseconds)) + * $params['v'] = (boolean) Verbose mode. Display column headers (Default = false) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-shards.html + */ + public function shards(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Cat\Shards'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + + 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['master_timeout'] = (time) Explicit operation timeout for connection to master 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 (Days),h (Hours),m (Minutes),s (Seconds),ms (Milliseconds),micros (Microseconds),nanos (Nanoseconds)) + * $params['v'] = (boolean) Verbose mode. Display column headers (Default = false) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-snapshots.html + */ + public function snapshots(array $params = []) + { + $repository = $this->extractArgument($params, 'repository'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Cat\Snapshots'); + $endpoint->setParams($params); + $endpoint->setRepository($repository); + + 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 (Days),h (Hours),m (Minutes),s (Seconds),ms (Milliseconds),micros (Microseconds),nanos (Nanoseconds)) + * $params['v'] = (boolean) Verbose mode. Display column headers (Default = false) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html + */ + public function tasks(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Cat\Tasks'); + $endpoint->setParams($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 master node (default: false) + * $params['master_timeout'] = (time) Explicit operation timeout for connection to master 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) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-templates.html + */ + public function templates(array $params = []) + { + $name = $this->extractArgument($params, 'name'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Cat\Templates'); + $endpoint->setParams($params); + $endpoint->setName($name); + + 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 master node (default: false) + * $params['master_timeout'] = (time) Explicit operation timeout for connection to master 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) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-thread-pool.html + */ + public function threadPool(array $params = []) + { + $thread_pool_patterns = $this->extractArgument($params, 'thread_pool_patterns'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Cat\ThreadPool'); + $endpoint->setParams($params); + $endpoint->setThreadPoolPatterns($thread_pool_patterns); + + return $this->performRequest($endpoint); + } +} diff --git a/util/output/7.6.1/Namespaces/CcrNamespace.php b/util/output/7.6.1/Namespaces/CcrNamespace.php new file mode 100644 index 000000000..9b5177811 --- /dev/null +++ b/util/output/7.6.1/Namespaces/CcrNamespace.php @@ -0,0 +1,259 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class CcrNamespace extends AbstractNamespace +{ + + /** + * $params['name'] = (string) The name of the auto follow pattern. + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-delete-auto-follow-pattern.html + */ + public function deleteAutoFollowPattern(array $params = []) + { + $name = $this->extractArgument($params, 'name'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ccr\DeleteAutoFollowPattern'); + $endpoint->setParams($params); + $endpoint->setName($name); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (string) The name of the follower index + * $params['wait_for_active_shards'] = (string) Sets the number of shard copies that must be active before returning. Defaults to 0. 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) (Default = 0) + * $params['body'] = (array) The name of the leader index and other optional ccr related parameters (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-follow.html + */ + public function follow(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ccr\Follow'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (list) A comma-separated list of index patterns; use `_all` to perform the operation on all indices + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-info.html + */ + public function followInfo(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ccr\FollowInfo'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (list) A comma-separated list of index patterns; use `_all` to perform the operation on all indices + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-stats.html + */ + public function followStats(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ccr\FollowStats'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (string) the name of the leader index for which specified follower retention leases should be removed + * $params['body'] = (array) the name and UUID of the follower index, the name of the cluster containing the follower index, and the alias from the perspective of that cluster for the remote cluster containing the leader index (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current + */ + public function forgetFollower(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ccr\ForgetFollower'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['name'] = (string) The name of the auto follow pattern. + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-auto-follow-pattern.html + */ + public function getAutoFollowPattern(array $params = []) + { + $name = $this->extractArgument($params, 'name'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ccr\GetAutoFollowPattern'); + $endpoint->setParams($params); + $endpoint->setName($name); + + return $this->performRequest($endpoint); + } + /** + * $params['name'] = (string) The name of the auto follow pattern that should pause discovering new indices to follow. + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-pause-auto-follow-pattern.html + */ + public function pauseAutoFollowPattern(array $params = []) + { + $name = $this->extractArgument($params, 'name'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ccr\PauseAutoFollowPattern'); + $endpoint->setParams($params); + $endpoint->setName($name); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (string) The name of the follower index that should pause following its leader index. + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-pause-follow.html + */ + public function pauseFollow(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ccr\PauseFollow'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + + return $this->performRequest($endpoint); + } + /** + * $params['name'] = (string) The name of the auto follow pattern. + * $params['body'] = (array) The specification of the auto follow pattern (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-auto-follow-pattern.html + */ + public function putAutoFollowPattern(array $params = []) + { + $name = $this->extractArgument($params, 'name'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ccr\PutAutoFollowPattern'); + $endpoint->setParams($params); + $endpoint->setName($name); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['name'] = (string) The name of the auto follow pattern to resume discovering new indices to follow. + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-resume-auto-follow-pattern.html + */ + public function resumeAutoFollowPattern(array $params = []) + { + $name = $this->extractArgument($params, 'name'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ccr\ResumeAutoFollowPattern'); + $endpoint->setParams($params); + $endpoint->setName($name); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (string) The name of the follow index to resume following. + * $params['body'] = (array) The name of the leader index and other optional ccr related parameters + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-resume-follow.html + */ + public function resumeFollow(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ccr\ResumeFollow'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + public function stats(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ccr\Stats'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (string) The name of the follower index that should be turned into a regular index. + * + * @param array $params Associative array of parameters + * @return array + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current + */ + public function unfollow(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ccr\Unfollow'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + + return $this->performRequest($endpoint); + } +} diff --git a/util/output/7.6.1/Namespaces/ClusterNamespace.php b/util/output/7.6.1/Namespaces/ClusterNamespace.php new file mode 100644 index 000000000..097a42c71 --- /dev/null +++ b/util/output/7.6.1/Namespaces/ClusterNamespace.php @@ -0,0 +1,215 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +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) + * $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 + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-allocation-explain.html + */ + public function allocationExplain(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Cluster\AllocationExplain'); + $endpoint->setParams($params); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['flat_settings'] = (boolean) Return settings in flat format (default: false) + * $params['master_timeout'] = (time) Explicit operation timeout for connection to master node + * $params['timeout'] = (time) Explicit operation timeout + * $params['include_defaults'] = (boolean) Whether to return all default clusters setting. (Default = false) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html + */ + public function getSettings(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Cluster\GetSettings'); + $endpoint->setParams($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,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 master node (default: false) + * $params['master_timeout'] = (time) Explicit operation timeout for connection to master 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) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-health.html + */ + public function health(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Cluster\Health'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + + return $this->performRequest($endpoint); + } + /** + * $params['local'] = (boolean) Return local information, do not retrieve the state from master node (default: false) + * $params['master_timeout'] = (time) Specify timeout for connection to master + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-pending.html + */ + public function pendingTasks(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Cluster\PendingTasks'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * $params['flat_settings'] = (boolean) Return settings in flat format (default: false) + * $params['master_timeout'] = (time) Explicit operation timeout for connection to master 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) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html + */ + public function putSettings(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Cluster\PutSettings'); + $endpoint->setParams($params); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-remote-info.html + */ + public function remoteInfo(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Cluster\RemoteInfo'); + $endpoint->setParams($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,version) + * $params['master_timeout'] = (time) Explicit operation timeout for connection to master node + * $params['timeout'] = (time) Explicit operation timeout + * $params['body'] = (array) The definition of `commands` to perform (`move`, `cancel`, `allocate`) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-reroute.html + */ + public function reroute(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Cluster\Reroute'); + $endpoint->setParams($params); + $endpoint->setBody($body); + + 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 master node (default: false) + * $params['master_timeout'] = (time) Specify timeout for connection to master + * $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) + * $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,none,all) (Default = open) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-state.html + */ + public function state(array $params = []) + { + $metric = $this->extractArgument($params, 'metric'); + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Cluster\State'); + $endpoint->setParams($params); + $endpoint->setMetric($metric); + $endpoint->setIndex($index); + + 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 + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-stats.html + */ + public function stats(array $params = []) + { + $node_id = $this->extractArgument($params, 'node_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Cluster\Stats'); + $endpoint->setParams($params); + $endpoint->setNodeId($node_id); + + return $this->performRequest($endpoint); + } +} diff --git a/util/output/7.6.1/Namespaces/DataFrameTransformDeprecatedNamespace.php b/util/output/7.6.1/Namespaces/DataFrameTransformDeprecatedNamespace.php new file mode 100644 index 000000000..5c617744a --- /dev/null +++ b/util/output/7.6.1/Namespaces/DataFrameTransformDeprecatedNamespace.php @@ -0,0 +1,198 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class DataFrameTransformDeprecatedNamespace extends AbstractNamespace +{ + + /** + * $params['transform_id'] = (string) The id of the transform to delete + * $params['force'] = (boolean) When `true`, the transform is deleted regardless of its current state. The default value is `false`, meaning that the transform must be `stopped` before it can be deleted. + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-transform.html + * + * @note This API is BETA and may change in ways that are not backwards compatible + * + */ + public function deleteTransform(array $params = []) + { + $transform_id = $this->extractArgument($params, 'transform_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('DataFrameTransformDeprecated\DeleteTransform'); + $endpoint->setParams($params); + $endpoint->setTransformId($transform_id); + + return $this->performRequest($endpoint); + } + /** + * $params['transform_id'] = (string) The id or comma delimited list of id expressions of the transforms to get, '_all' or '*' implies get 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) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform.html + * + * @note This API is BETA and may change in ways that are not backwards compatible + * + */ + public function getTransform(array $params = []) + { + $transform_id = $this->extractArgument($params, 'transform_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('DataFrameTransformDeprecated\GetTransform'); + $endpoint->setParams($params); + $endpoint->setTransformId($transform_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'] = (number) skips a number of transform stats, defaults to 0 + * $params['size'] = (number) specifies a max number of transform stats 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) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform-stats.html + * + * @note This API is BETA and may change in ways that are not backwards compatible + * + */ + public function getTransformStats(array $params = []) + { + $transform_id = $this->extractArgument($params, 'transform_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('DataFrameTransformDeprecated\GetTransformStats'); + $endpoint->setParams($params); + $endpoint->setTransformId($transform_id); + + return $this->performRequest($endpoint); + } + public function previewTransform(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('DataFrameTransformDeprecated\PreviewTransform'); + $endpoint->setParams($params); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['transform_id'] = (string) The id of the new transform. + * $params['defer_validation'] = (boolean) If validations should be deferred until transform starts, defaults to false. + * $params['body'] = (array) The transform definition (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-transform.html + * + * @note This API is BETA and may change in ways that are not backwards compatible + * + */ + public function putTransform(array $params = []) + { + $transform_id = $this->extractArgument($params, 'transform_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('DataFrameTransformDeprecated\PutTransform'); + $endpoint->setParams($params); + $endpoint->setTransformId($transform_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['transform_id'] = (string) The id of the transform to start + * $params['timeout'] = (time) Controls the time to wait for the transform to start + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/start-transform.html + * + * @note This API is BETA and may change in ways that are not backwards compatible + * + */ + public function startTransform(array $params = []) + { + $transform_id = $this->extractArgument($params, 'transform_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('DataFrameTransformDeprecated\StartTransform'); + $endpoint->setParams($params); + $endpoint->setTransformId($transform_id); + + return $this->performRequest($endpoint); + } + /** + * $params['transform_id'] = (string) The id of the transform to stop + * $params['wait_for_completion'] = (boolean) Whether to wait for the transform to fully stop before returning or not. Default to false + * $params['timeout'] = (time) Controls the time to wait until the transform has stopped. Default to 30 seconds + * $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) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-transform.html + * + * @note This API is BETA and may change in ways that are not backwards compatible + * + */ + public function stopTransform(array $params = []) + { + $transform_id = $this->extractArgument($params, 'transform_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('DataFrameTransformDeprecated\StopTransform'); + $endpoint->setParams($params); + $endpoint->setTransformId($transform_id); + + return $this->performRequest($endpoint); + } + /** + * $params['transform_id'] = (string) The id of the transform. + * $params['defer_validation'] = (boolean) If validations should be deferred until transform starts, defaults to false. + * $params['body'] = (array) The update transform definition (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-transform.html + * + * @note This API is BETA and may change in ways that are not backwards compatible + * + */ + public function updateTransform(array $params = []) + { + $transform_id = $this->extractArgument($params, 'transform_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('DataFrameTransformDeprecated\UpdateTransform'); + $endpoint->setParams($params); + $endpoint->setTransformId($transform_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } +} diff --git a/util/output/7.6.1/Namespaces/EnrichNamespace.php b/util/output/7.6.1/Namespaces/EnrichNamespace.php new file mode 100644 index 000000000..0578e5247 --- /dev/null +++ b/util/output/7.6.1/Namespaces/EnrichNamespace.php @@ -0,0 +1,102 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class EnrichNamespace extends AbstractNamespace +{ + + /** + * $params['name'] = (string) The name of the enrich policy + * + * @param array $params Associative array of parameters + * @return array + */ + public function deletePolicy(array $params = []) + { + $name = $this->extractArgument($params, 'name'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Enrich\DeletePolicy'); + $endpoint->setParams($params); + $endpoint->setName($name); + + return $this->performRequest($endpoint); + } + /** + * $params['name'] = (string) The name of the enrich policy + * $params['wait_for_completion'] = (boolean) Should the request should block until the execution is complete. (Default = true) + * + * @param array $params Associative array of parameters + * @return array + */ + public function executePolicy(array $params = []) + { + $name = $this->extractArgument($params, 'name'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Enrich\ExecutePolicy'); + $endpoint->setParams($params); + $endpoint->setName($name); + + return $this->performRequest($endpoint); + } + /** + * $params['name'] = (list) A comma-separated list of enrich policy names + * + * @param array $params Associative array of parameters + * @return array + */ + public function getPolicy(array $params = []) + { + $name = $this->extractArgument($params, 'name'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Enrich\GetPolicy'); + $endpoint->setParams($params); + $endpoint->setName($name); + + return $this->performRequest($endpoint); + } + /** + * $params['name'] = (string) The name of the enrich policy + * $params['body'] = (array) The enrich policy to register (Required) + * + * @param array $params Associative array of parameters + * @return array + */ + public function putPolicy(array $params = []) + { + $name = $this->extractArgument($params, 'name'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Enrich\PutPolicy'); + $endpoint->setParams($params); + $endpoint->setName($name); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + public function stats(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Enrich\Stats'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } +} diff --git a/util/output/7.6.1/Namespaces/GraphNamespace.php b/util/output/7.6.1/Namespaces/GraphNamespace.php new file mode 100644 index 000000000..bf9bd8c96 --- /dev/null +++ b/util/output/7.6.1/Namespaces/GraphNamespace.php @@ -0,0 +1,47 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class GraphNamespace extends AbstractNamespace +{ + + /** + * $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['type'] = DEPRECATED (list) A comma-separated list of document types to search; leave empty to perform the operation on all types + * $params['routing'] = (string) Specific routing value + * $params['timeout'] = (time) Explicit operation timeout + * $params['body'] = (array) Graph Query DSL + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/graph-explore-api.html + */ + public function explore(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + $type = $this->extractArgument($params, 'type'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Graph\Explore'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + $endpoint->setType($type); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } +} diff --git a/util/output/7.6.1/Namespaces/IlmNamespace.php b/util/output/7.6.1/Namespaces/IlmNamespace.php new file mode 100644 index 000000000..18257c9e1 --- /dev/null +++ b/util/output/7.6.1/Namespaces/IlmNamespace.php @@ -0,0 +1,200 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class IlmNamespace extends AbstractNamespace +{ + + /** + * $params['policy'] = (string) The name of the index lifecycle policy + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-delete-lifecycle.html + */ + public function deleteLifecycle(array $params = []) + { + $policy = $this->extractArgument($params, 'policy'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ilm\DeleteLifecycle'); + $endpoint->setParams($params); + $endpoint->setPolicy($policy); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (string) The name of the index to explain + * $params['only_managed'] = (boolean) filters the indices included in the response to ones managed by ILM + * $params['only_errors'] = (boolean) filters the indices included in the response to ones in an ILM error state, implies only_managed + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-explain-lifecycle.html + */ + public function explainLifecycle(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ilm\ExplainLifecycle'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + + return $this->performRequest($endpoint); + } + /** + * $params['policy'] = (string) The name of the index lifecycle policy + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-lifecycle.html + */ + public function getLifecycle(array $params = []) + { + $policy = $this->extractArgument($params, 'policy'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ilm\GetLifecycle'); + $endpoint->setParams($params); + $endpoint->setPolicy($policy); + + return $this->performRequest($endpoint); + } + /** + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-status.html + */ + public function getStatus(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ilm\GetStatus'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (string) The name of the index whose lifecycle step is to change + * $params['body'] = (array) The new lifecycle step to move to + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-move-to-step.html + */ + public function moveToStep(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ilm\MoveToStep'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['policy'] = (string) The name of the index lifecycle policy + * $params['body'] = (array) The lifecycle policy definition to register + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-put-lifecycle.html + */ + public function putLifecycle(array $params = []) + { + $policy = $this->extractArgument($params, 'policy'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ilm\PutLifecycle'); + $endpoint->setParams($params); + $endpoint->setPolicy($policy); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (string) The name of the index to remove policy on + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-remove-policy.html + */ + public function removePolicy(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ilm\RemovePolicy'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (string) The name of the indices (comma-separated) whose failed lifecycle step is to be retry + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-retry-policy.html + */ + public function retry(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ilm\Retry'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + + return $this->performRequest($endpoint); + } + /** + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-start.html + */ + public function start(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ilm\Start'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-stop.html + */ + public function stop(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ilm\Stop'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } +} diff --git a/util/output/7.6.1/Namespaces/IndicesNamespace.php b/util/output/7.6.1/Namespaces/IndicesNamespace.php new file mode 100644 index 000000000..525696052 --- /dev/null +++ b/util/output/7.6.1/Namespaces/IndicesNamespace.php @@ -0,0 +1,1057 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class IndicesNamespace extends AbstractNamespace +{ + + /** + * $params['index'] = (string) The name of the index to scope the operation + * $params['body'] = (array) Define analyzer/tokenizer parameters and the text on which the analysis should be performed + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-analyze.html + */ + public function analyze(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Indices\Analyze'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (list) A comma-separated list of index name to limit the operation + * $params['fielddata'] = (boolean) Clear field data + * $params['fields'] = (list) A comma-separated list of fields to clear when using the `fielddata` parameter (default: all) + * $params['query'] = (boolean) Clear query caches + * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed) + * $params['allow_no_indices'] = (boolean) Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * $params['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both. (Options = open,closed,none,all) (Default = open) + * $params['request'] = (boolean) Clear request cache + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-clearcache.html + */ + public function clearCache(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Indices\ClearCache'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (string) The name of the source index to clone + * $params['target'] = (string) The name of the target index to clone into + * $params['timeout'] = (time) Explicit operation timeout + * $params['master_timeout'] = (time) Specify timeout for connection to master + * $params['wait_for_active_shards'] = (string) Set the number of active shards to wait for on the cloned index before the operation returns. + * $params['body'] = (array) The configuration for the target index (`settings` and `aliases`) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-clone-index.html + */ + public function clone(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + $target = $this->extractArgument($params, 'target'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Indices\CloneIndices'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + $endpoint->setTarget($target); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (list) A comma separated list of indices to close + * $params['timeout'] = (time) Explicit operation timeout + * $params['master_timeout'] = (time) Specify timeout for connection to master + * $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,none,all) (Default = open) + * $params['wait_for_active_shards'] = (string) Sets the number of active shards to wait for before the operation returns. + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html + */ + public function close(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Indices\Close'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (string) The name of the index + * $params['include_type_name'] = (boolean) Whether a type should be expected in the body of the mappings. + * $params['wait_for_active_shards'] = (string) Set the number of active shards to wait for before the operation returns. + * $params['timeout'] = (time) Explicit operation timeout + * $params['master_timeout'] = (time) Specify timeout for connection to master + * $params['body'] = (array) The configuration for the index (`settings` and `mappings`) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-create-index.html + */ + public function create(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Indices\Create'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (list) A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices + * $params['timeout'] = (time) Explicit operation timeout + * $params['master_timeout'] = (time) Specify timeout for connection to master + * $params['ignore_unavailable'] = (boolean) Ignore unavailable indexes (default: false) + * $params['allow_no_indices'] = (boolean) Ignore if a wildcard expression resolves to no concrete indices (default: false) + * $params['expand_wildcards'] = (enum) Whether wildcard expressions should get expanded to open or closed indices (default: open) (Options = open,closed,none,all) (Default = open) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-delete-index.html + */ + public function delete(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Indices\Delete'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (list) A comma-separated list of index names (supports wildcards); use `_all` for all indices (Required) + * $params['name'] = (list) A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices. (Required) + * $params['timeout'] = (time) Explicit timestamp for the document + * $params['master_timeout'] = (time) Specify timeout for connection to master + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html + */ + public function deleteAlias(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + $name = $this->extractArgument($params, 'name'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Indices\DeleteAlias'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + $endpoint->setName($name); + + return $this->performRequest($endpoint); + } + /** + * $params['name'] = (string) The name of the template + * $params['timeout'] = (time) Explicit operation timeout + * $params['master_timeout'] = (time) Specify timeout for connection to master + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html + */ + public function deleteTemplate(array $params = []) + { + $name = $this->extractArgument($params, 'name'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Indices\DeleteTemplate'); + $endpoint->setParams($params); + $endpoint->setName($name); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (list) A comma-separated list of index names + * $params['local'] = (boolean) Return local information, do not retrieve the state from master node (default: false) + * $params['ignore_unavailable'] = (boolean) Ignore unavailable indexes (default: false) + * $params['allow_no_indices'] = (boolean) Ignore if a wildcard expression resolves to no concrete indices (default: false) + * $params['expand_wildcards'] = (enum) Whether wildcard expressions should get expanded to open or closed indices (default: open) (Options = open,closed,none,all) (Default = open) + * $params['flat_settings'] = (boolean) Return settings in flat format (default: false) + * $params['include_defaults'] = (boolean) Whether to return all default setting for each of the indices. (Default = false) + * + * @param array $params Associative array of parameters + * @return bool + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-exists.html + */ + public function exists(array $params = []): bool + { + $index = $this->extractArgument($params, 'index'); + + // manually make this verbose so we can check status code + $params['client']['verbose'] = true; + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Indices\Exists'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + + return BooleanRequestWrapper::performRequest($endpoint, $this->transport); + } + /** + * $params['name'] = (list) A comma-separated list of alias names to return (Required) + * $params['index'] = (list) A comma-separated list of index names to filter aliases + * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed) + * $params['allow_no_indices'] = (boolean) Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * $params['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both. (Options = open,closed,none,all) (Default = all) + * $params['local'] = (boolean) Return local information, do not retrieve the state from master node (default: false) + * + * @param array $params Associative array of parameters + * @return bool + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html + */ + public function existsAlias(array $params = []): bool + { + $name = $this->extractArgument($params, 'name'); + $index = $this->extractArgument($params, 'index'); + + // manually make this verbose so we can check status code + $params['client']['verbose'] = true; + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Indices\ExistsAlias'); + $endpoint->setParams($params); + $endpoint->setName($name); + $endpoint->setIndex($index); + + return BooleanRequestWrapper::performRequest($endpoint, $this->transport); + } + /** + * $params['name'] = (list) The comma separated names of the index templates + * $params['flat_settings'] = (boolean) Return settings in flat format (default: false) + * $params['master_timeout'] = (time) Explicit operation timeout for connection to master node + * $params['local'] = (boolean) Return local information, do not retrieve the state from master node (default: false) + * + * @param array $params Associative array of parameters + * @return bool + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html + */ + public function existsTemplate(array $params = []): bool + { + $name = $this->extractArgument($params, 'name'); + + // manually make this verbose so we can check status code + $params['client']['verbose'] = true; + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Indices\ExistsTemplate'); + $endpoint->setParams($params); + $endpoint->setName($name); + + return BooleanRequestWrapper::performRequest($endpoint, $this->transport); + } + /** + * $params['index'] = (list) A comma-separated list of index names; use `_all` to check the types across all indices + * $params['type'] = DEPRECATED (list) A comma-separated list of document types to check + * $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,none,all) (Default = open) + * $params['local'] = (boolean) Return local information, do not retrieve the state from master node (default: false) + * + * @param array $params Associative array of parameters + * @return bool + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-types-exists.html + */ + public function existsType(array $params = []): bool + { + $index = $this->extractArgument($params, 'index'); + $type = $this->extractArgument($params, 'type'); + + // manually make this verbose so we can check status code + $params['client']['verbose'] = true; + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Indices\ExistsType'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + $endpoint->setType($type); + + return BooleanRequestWrapper::performRequest($endpoint, $this->transport); + } + /** + * $params['index'] = (list) A comma-separated list of index names; use `_all` or empty string for all indices + * $params['force'] = (boolean) Whether a flush should be forced even if it is not necessarily needed ie. if no changes will be committed to the index. This is useful if transaction log IDs should be incremented even if no uncommitted changes are present. (This setting can be considered as internal) + * $params['wait_if_ongoing'] = (boolean) If set to true the flush operation will block until the flush can be executed if another flush operation is already executing. The default is true. If set to false the flush will be skipped iff if another flush operation is already running. + * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed) + * $params['allow_no_indices'] = (boolean) Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * $params['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both. (Options = open,closed,none,all) (Default = open) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-flush.html + */ + public function flush(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Indices\Flush'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (list) A comma-separated list of index names; use `_all` or empty string for 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,none,all) (Default = open) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-synced-flush-api.html + */ + public function flushSynced(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Indices\FlushSynced'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (list) A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + * $params['flush'] = (boolean) Specify whether the index should be flushed after performing the operation (default: true) + * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed) + * $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,none,all) (Default = open) + * $params['max_num_segments'] = (number) The number of segments the index should be merged into (default: dynamic) + * $params['only_expunge_deletes'] = (boolean) Specify whether the operation should only expunge deleted documents + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-forcemerge.html + */ + public function forcemerge(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Indices\ForceMerge'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (list) A comma-separated list of index names + * $params['include_type_name'] = (boolean) Whether to add the type name to the response (default: false) + * $params['local'] = (boolean) Return local information, do not retrieve the state from master node (default: false) + * $params['ignore_unavailable'] = (boolean) Ignore unavailable indexes (default: false) + * $params['allow_no_indices'] = (boolean) Ignore if a wildcard expression resolves to no concrete indices (default: false) + * $params['expand_wildcards'] = (enum) Whether wildcard expressions should get expanded to open or closed indices (default: open) (Options = open,closed,none,all) (Default = open) + * $params['flat_settings'] = (boolean) Return settings in flat format (default: false) + * $params['include_defaults'] = (boolean) Whether to return all default setting for each of the indices. (Default = false) + * $params['master_timeout'] = (time) Specify timeout for connection to master + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-index.html + */ + public function get(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Indices\Get'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + + return $this->performRequest($endpoint); + } + /** + * $params['name'] = (list) A comma-separated list of alias names to return + * $params['index'] = (list) A comma-separated list of index names to filter aliases + * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed) + * $params['allow_no_indices'] = (boolean) Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * $params['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both. (Options = open,closed,none,all) (Default = all) + * $params['local'] = (boolean) Return local information, do not retrieve the state from master node (default: false) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html + */ + public function getAlias(array $params = []) + { + $name = $this->extractArgument($params, 'name'); + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Indices\GetAlias'); + $endpoint->setParams($params); + $endpoint->setName($name); + $endpoint->setIndex($index); + + return $this->performRequest($endpoint); + } + /** + * $params['fields'] = (list) A comma-separated list of fields (Required) + * $params['index'] = (list) A comma-separated list of index names + * $params['type'] = DEPRECATED (list) A comma-separated list of document types + * $params['include_type_name'] = (boolean) Whether a type should be returned in the body of the mappings. + * $params['include_defaults'] = (boolean) Whether the default mapping values should be returned as well + * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed) + * $params['allow_no_indices'] = (boolean) Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * $params['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both. (Options = open,closed,none,all) (Default = open) + * $params['local'] = (boolean) Return local information, do not retrieve the state from master node (default: false) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-field-mapping.html + */ + public function getFieldMapping(array $params = []) + { + $fields = $this->extractArgument($params, 'fields'); + $index = $this->extractArgument($params, 'index'); + $type = $this->extractArgument($params, 'type'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Indices\GetFieldMapping'); + $endpoint->setParams($params); + $endpoint->setFields($fields); + $endpoint->setIndex($index); + $endpoint->setType($type); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (list) A comma-separated list of index names + * $params['type'] = DEPRECATED (list) A comma-separated list of document types + * $params['include_type_name'] = (boolean) Whether to add the type name to the response (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,none,all) (Default = open) + * $params['master_timeout'] = (time) Specify timeout for connection to master + * $params['local'] = (boolean) Return local information, do not retrieve the state from master node (default: false) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-mapping.html + */ + public function getMapping(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + $type = $this->extractArgument($params, 'type'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Indices\GetMapping'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + $endpoint->setType($type); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (list) A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + * $params['name'] = (list) The name of the settings that should be included + * $params['master_timeout'] = (time) Specify timeout for connection to master + * $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,none,all) (Default = open,closed) + * $params['flat_settings'] = (boolean) Return settings in flat format (default: false) + * $params['local'] = (boolean) Return local information, do not retrieve the state from master node (default: false) + * $params['include_defaults'] = (boolean) Whether to return all default setting for each of the indices. (Default = false) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-settings.html + */ + public function getSettings(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + $name = $this->extractArgument($params, 'name'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Indices\GetSettings'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + $endpoint->setName($name); + + return $this->performRequest($endpoint); + } + /** + * $params['name'] = (list) The comma separated names of the index templates + * $params['include_type_name'] = (boolean) Whether a type should be returned in the body of the mappings. + * $params['flat_settings'] = (boolean) Return settings in flat format (default: false) + * $params['master_timeout'] = (time) Explicit operation timeout for connection to master node + * $params['local'] = (boolean) Return local information, do not retrieve the state from master node (default: false) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html + */ + public function getTemplate(array $params = []) + { + $name = $this->extractArgument($params, 'name'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Indices\GetTemplate'); + $endpoint->setParams($params); + $endpoint->setName($name); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (list) A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed) + * $params['allow_no_indices'] = (boolean) Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * $params['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both. (Options = open,closed,none,all) (Default = open) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-upgrade.html + */ + public function getUpgrade(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Indices\GetUpgrade'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (list) A comma separated list of indices to open + * $params['timeout'] = (time) Explicit operation timeout + * $params['master_timeout'] = (time) Specify timeout for connection to master + * $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,none,all) (Default = closed) + * $params['wait_for_active_shards'] = (string) Sets the number of active shards to wait for before the operation returns. + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html + */ + public function open(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Indices\Open'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (list) A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the operation on all indices. (Required) + * $params['name'] = (string) The name of the alias to be created or updated (Required) + * $params['timeout'] = (time) Explicit timestamp for the document + * $params['master_timeout'] = (time) Specify timeout for connection to master + * $params['body'] = (array) The settings for the alias, such as `routing` or `filter` + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html + */ + public function putAlias(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + $name = $this->extractArgument($params, 'name'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Indices\PutAlias'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + $endpoint->setName($name); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (list) A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices. + * $params['type'] = DEPRECATED (string) The name of the document type + * $params['include_type_name'] = (boolean) Whether a type should be expected in the body of the mappings. + * $params['timeout'] = (time) Explicit operation timeout + * $params['master_timeout'] = (time) Specify timeout for connection to master + * $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,none,all) (Default = open) + * $params['body'] = (array) The mapping definition (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-put-mapping.html + */ + public function putMapping(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + $type = $this->extractArgument($params, 'type'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Indices\PutMapping'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + $endpoint->setType($type); + $endpoint->setBody($body); + + 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['master_timeout'] = (time) Specify timeout for connection to master + * $params['timeout'] = (time) Explicit operation timeout + * $params['preserve_existing'] = (boolean) Whether to update existing settings. If set to `true` existing settings on an index remain unchanged, the default is `false` + * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed) + * $params['allow_no_indices'] = (boolean) Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * $params['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both. (Options = open,closed,none,all) (Default = open) + * $params['flat_settings'] = (boolean) Return settings in flat format (default: false) + * $params['body'] = (array) The index settings to be updated (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-update-settings.html + */ + public function putSettings(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Indices\PutSettings'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['name'] = (string) The name of the template + * $params['include_type_name'] = (boolean) Whether a type should be returned in the body of the mappings. + * $params['order'] = (number) The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers) + * $params['create'] = (boolean) Whether the index template should only be added if new or can also replace an existing one (Default = false) + * $params['timeout'] = (time) Explicit operation timeout + * $params['master_timeout'] = (time) Specify timeout for connection to master + * $params['flat_settings'] = (boolean) Return settings in flat format (default: false) + * $params['body'] = (array) The template definition (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html + */ + public function putTemplate(array $params = []) + { + $name = $this->extractArgument($params, 'name'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Indices\PutTemplate'); + $endpoint->setParams($params); + $endpoint->setName($name); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (list) A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + * $params['detailed'] = (boolean) Whether to display detailed information about shard recovery (Default = false) + * $params['active_only'] = (boolean) Display only those recoveries that are currently on-going (Default = false) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-recovery.html + */ + public function recovery(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Indices\Recovery'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (list) A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed) + * $params['allow_no_indices'] = (boolean) Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * $params['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both. (Options = open,closed,none,all) (Default = open) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-refresh.html + */ + public function refresh(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Indices\Refresh'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + + return $this->performRequest($endpoint); + } + /** + * $params['alias'] = (string) The name of the alias to rollover (Required) + * $params['new_index'] = (string) The name of the rollover index + * $params['include_type_name'] = (boolean) Whether a type should be included in the body of the mappings. + * $params['timeout'] = (time) Explicit operation timeout + * $params['dry_run'] = (boolean) If set to true the rollover action will only be validated but not actually performed even if a condition matches. The default is false + * $params['master_timeout'] = (time) Specify timeout for connection to master + * $params['wait_for_active_shards'] = (string) Set the number of active shards to wait for on the newly created rollover index before the operation returns. + * $params['body'] = (array) The conditions that needs to be met for executing rollover + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-rollover-index.html + */ + public function rollover(array $params = []) + { + $alias = $this->extractArgument($params, 'alias'); + $new_index = $this->extractArgument($params, 'new_index'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Indices\Rollover'); + $endpoint->setParams($params); + $endpoint->setAlias($alias); + $endpoint->setNewIndex($new_index); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (list) A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed) + * $params['allow_no_indices'] = (boolean) Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * $params['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both. (Options = open,closed,none,all) (Default = open) + * $params['verbose'] = (boolean) Includes detailed memory usage by Lucene. (Default = false) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-segments.html + */ + public function segments(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Indices\Segments'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (list) A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + * $params['status'] = (list) A comma-separated list of statuses used to filter on shards to get store information for (Options = green,yellow,red,all) + * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed) + * $params['allow_no_indices'] = (boolean) Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * $params['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both. (Options = open,closed,none,all) (Default = open) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-shards-stores.html + */ + public function shardStores(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Indices\ShardStores'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (string) The name of the source index to shrink + * $params['target'] = (string) The name of the target index to shrink into + * $params['copy_settings'] = (boolean) whether or not to copy settings from the source index (defaults to false) + * $params['timeout'] = (time) Explicit operation timeout + * $params['master_timeout'] = (time) Specify timeout for connection to master + * $params['wait_for_active_shards'] = (string) Set the number of active shards to wait for on the shrunken index before the operation returns. + * $params['body'] = (array) The configuration for the target index (`settings` and `aliases`) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-shrink-index.html + */ + public function shrink(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + $target = $this->extractArgument($params, 'target'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Indices\Shrink'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + $endpoint->setTarget($target); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (string) The name of the source index to split + * $params['target'] = (string) The name of the target index to split into + * $params['copy_settings'] = (boolean) whether or not to copy settings from the source index (defaults to false) + * $params['timeout'] = (time) Explicit operation timeout + * $params['master_timeout'] = (time) Specify timeout for connection to master + * $params['wait_for_active_shards'] = (string) Set the number of active shards to wait for on the shrunken index before the operation returns. + * $params['body'] = (array) The configuration for the target index (`settings` and `aliases`) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-split-index.html + */ + public function split(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + $target = $this->extractArgument($params, 'target'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Indices\Split'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + $endpoint->setTarget($target); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['metric'] = (list) Limit the information returned the specific metrics. + * $params['index'] = (list) A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + * $params['completion_fields'] = (list) A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) + * $params['fielddata_fields'] = (list) A comma-separated list of fields for `fielddata` index metric (supports wildcards) + * $params['fields'] = (list) A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) + * $params['groups'] = (list) A comma-separated list of search groups for `search` index metric + * $params['level'] = (enum) Return stats aggregated at cluster, index or shard level (Options = cluster,indices,shards) (Default = indices) + * $params['types'] = (list) A comma-separated list of document types for the `indexing` index metric + * $params['include_segment_file_sizes'] = (boolean) Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested) (Default = false) + * $params['include_unloaded_segments'] = (boolean) If set to true segment stats will include stats for segments that are not currently loaded into memory (Default = false) + * $params['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both. (Options = open,closed,none,all) (Default = open) + * $params['forbid_closed_indices'] = (boolean) If set to false stats will also collected from closed indices if explicitly specified or if expand_wildcards expands to closed indices (Default = true) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-stats.html + */ + public function stats(array $params = []) + { + $metric = $this->extractArgument($params, 'metric'); + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Indices\Stats'); + $endpoint->setParams($params); + $endpoint->setMetric($metric); + $endpoint->setIndex($index); + + return $this->performRequest($endpoint); + } + /** + * $params['timeout'] = (time) Request timeout + * $params['master_timeout'] = (time) Specify timeout for connection to master + * $params['body'] = (array) The definition of `actions` to perform (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html + */ + public function updateAliases(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Indices\UpdateAliases'); + $endpoint->setParams($params); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (list) A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + * $params['allow_no_indices'] = (boolean) Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * $params['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both. (Options = open,closed,none,all) (Default = open) + * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed) + * $params['wait_for_completion'] = (boolean) Specify whether the request should block until the all segments are upgraded (default: false) + * $params['only_ancient_segments'] = (boolean) If true, only ancient (an older Lucene major release) segments will be upgraded + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-upgrade.html + */ + public function upgrade(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Indices\Upgrade'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (list) A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices + * $params['type'] = DEPRECATED (list) A comma-separated list of document types to restrict the operation; leave empty to perform the operation on all types + * $params['explain'] = (boolean) Return detailed information about the error + * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed) + * $params['allow_no_indices'] = (boolean) Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * $params['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both. (Options = open,closed,none,all) (Default = open) + * $params['q'] = (string) Query in the Lucene query string syntax + * $params['analyzer'] = (string) The analyzer to use for the query string + * $params['analyze_wildcard'] = (boolean) Specify whether wildcard and prefix queries should be analyzed (default: false) + * $params['default_operator'] = (enum) The default operator for query string query (AND or OR) (Options = AND,OR) (Default = OR) + * $params['df'] = (string) The field to use as default where no field prefix is given in the query string + * $params['lenient'] = (boolean) Specify whether format-based query failures (such as providing text to a numeric field) should be ignored + * $params['rewrite'] = (boolean) Provide a more detailed explanation showing the actual Lucene query that will be executed. + * $params['all_shards'] = (boolean) Execute validation on all shards instead of one random shard per index + * $params['body'] = (array) The query definition specified with the Query DSL + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/search-validate.html + */ + public function validateQuery(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + $type = $this->extractArgument($params, 'type'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Indices\ValidateQuery'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + $endpoint->setType($type); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (string) The name of the index to freeze + * $params['timeout'] = (time) Explicit operation timeout + * $params['master_timeout'] = (time) Specify timeout for connection to master + * $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,none,all) (Default = closed) + * $params['wait_for_active_shards'] = (string) Sets the number of active shards to wait for before the operation returns. + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/frozen.html + */ + public function freeze(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Indices\Freeze'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (list) A comma-separated list of index names to reload analyzers for + * $params['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed) + * $params['allow_no_indices'] = (boolean) Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * $params['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both. (Options = open,closed,none,all) (Default = open) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-reload-analyzers.html + */ + public function reloadSearchAnalyzers(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Indices\ReloadSearchAnalyzers'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (string) The name of the index to unfreeze + * $params['timeout'] = (time) Explicit operation timeout + * $params['master_timeout'] = (time) Specify timeout for connection to master + * $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,none,all) (Default = closed) + * $params['wait_for_active_shards'] = (string) Sets the number of active shards to wait for before the operation returns. + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/frozen.html + */ + public function unfreeze(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Indices\Unfreeze'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + + return $this->performRequest($endpoint); + } + /** + * Alias function to getAlias() + * + * @deprecated added to prevent BC break introduced in 7.2.0 + * @see https://github.com/elastic/elasticsearch-php/issues/940 + */ + public function getAliases(array $params = []) + { + return $this->getAlias($params); + } +} diff --git a/util/output/7.6.1/Namespaces/IngestNamespace.php b/util/output/7.6.1/Namespaces/IngestNamespace.php new file mode 100644 index 000000000..424329f0e --- /dev/null +++ b/util/output/7.6.1/Namespaces/IngestNamespace.php @@ -0,0 +1,120 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class IngestNamespace extends AbstractNamespace +{ + + /** + * $params['id'] = (string) Pipeline ID + * $params['master_timeout'] = (time) Explicit operation timeout for connection to master node + * $params['timeout'] = (time) Explicit operation timeout + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-pipeline-api.html + */ + public function deletePipeline(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ingest\DeletePipeline'); + $endpoint->setParams($params); + $endpoint->setId($id); + + return $this->performRequest($endpoint); + } + /** + * $params['id'] = (string) Comma separated list of pipeline ids. Wildcards supported + * $params['master_timeout'] = (time) Explicit operation timeout for connection to master node + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-pipeline-api.html + */ + public function getPipeline(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ingest\GetPipeline'); + $endpoint->setParams($params); + $endpoint->setId($id); + + return $this->performRequest($endpoint); + } + /** + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/grok-processor.html#grok-processor-rest-get + */ + public function processorGrok(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ingest\ProcessorGrok'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * $params['id'] = (string) Pipeline ID + * $params['master_timeout'] = (time) Explicit operation timeout for connection to master node + * $params['timeout'] = (time) Explicit operation timeout + * $params['body'] = (array) The ingest definition (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/put-pipeline-api.html + */ + public function putPipeline(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ingest\PutPipeline'); + $endpoint->setParams($params); + $endpoint->setId($id); + $endpoint->setBody($body); + + 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) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/simulate-pipeline-api.html + */ + public function simulate(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ingest\Simulate'); + $endpoint->setParams($params); + $endpoint->setId($id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } +} diff --git a/util/output/7.6.1/Namespaces/LicenseNamespace.php b/util/output/7.6.1/Namespaces/LicenseNamespace.php new file mode 100644 index 000000000..791a9922f --- /dev/null +++ b/util/output/7.6.1/Namespaces/LicenseNamespace.php @@ -0,0 +1,129 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class LicenseNamespace extends AbstractNamespace +{ + + public function delete(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('License\Delete'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * $params['local'] = (boolean) Return local information, do not retrieve the state from master node (default: false) + * $params['accept_enterprise'] = (boolean) If the active license is an enterprise license, return type as 'enterprise' (default: false) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-license.html + */ + public function get(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('License\Get'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-basic-status.html + */ + public function getBasicStatus(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('License\GetBasicStatus'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-trial-status.html + */ + public function getTrialStatus(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('License\GetTrialStatus'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * $params['acknowledge'] = (boolean) whether the user has acknowledged acknowledge messages (default: false) + * $params['body'] = (array) licenses to be installed + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/update-license.html + */ + public function post(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('License\Post'); + $endpoint->setParams($params); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['acknowledge'] = (boolean) whether the user has acknowledged acknowledge messages (default: false) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/start-basic.html + */ + public function postStartBasic(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('License\PostStartBasic'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * $params['type'] = (string) The type of trial license to generate (default: "trial") + * $params['acknowledge'] = (boolean) whether the user has acknowledged acknowledge messages (default: false) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/start-trial.html + */ + public function postStartTrial(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('License\PostStartTrial'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } +} diff --git a/util/output/7.6.1/Namespaces/MigrationNamespace.php b/util/output/7.6.1/Namespaces/MigrationNamespace.php new file mode 100644 index 000000000..a3a9b3a3a --- /dev/null +++ b/util/output/7.6.1/Namespaces/MigrationNamespace.php @@ -0,0 +1,39 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class MigrationNamespace extends AbstractNamespace +{ + + /** + * $params['index'] = (string) Index pattern + * + * @param array $params Associative array of parameters + * @return array + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-deprecation.html + */ + public function deprecations(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Migration\Deprecations'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + + return $this->performRequest($endpoint); + } +} diff --git a/util/output/7.6.1/Namespaces/MlNamespace.php b/util/output/7.6.1/Namespaces/MlNamespace.php new file mode 100644 index 000000000..7f4564044 --- /dev/null +++ b/util/output/7.6.1/Namespaces/MlNamespace.php @@ -0,0 +1,1278 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class MlNamespace extends AbstractNamespace +{ + + /** + * $params['job_id'] = (string) The name of the job to close + * $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['force'] = (boolean) True if the job should be forcefully closed + * $params['timeout'] = (time) Controls the time to wait until a job has closed. Default to 30 minutes + * $params['body'] = (array) The URL params optionally sent in the body + * + * @param array $params Associative array of parameters + * @return array + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-close-job.html + */ + public function closeJob(array $params = []) + { + $job_id = $this->extractArgument($params, 'job_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\CloseJob'); + $endpoint->setParams($params); + $endpoint->setJobId($job_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['calendar_id'] = (string) The ID of the calendar to delete + * + * @param array $params Associative array of parameters + * @return array + */ + public function deleteCalendar(array $params = []) + { + $calendar_id = $this->extractArgument($params, 'calendar_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\DeleteCalendar'); + $endpoint->setParams($params); + $endpoint->setCalendarId($calendar_id); + + return $this->performRequest($endpoint); + } + /** + * $params['calendar_id'] = (string) The ID of the calendar to modify + * $params['event_id'] = (string) The ID of the event to remove from the calendar + * + * @param array $params Associative array of parameters + * @return array + */ + public function deleteCalendarEvent(array $params = []) + { + $calendar_id = $this->extractArgument($params, 'calendar_id'); + $event_id = $this->extractArgument($params, 'event_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\DeleteCalendarEvent'); + $endpoint->setParams($params); + $endpoint->setCalendarId($calendar_id); + $endpoint->setEventId($event_id); + + return $this->performRequest($endpoint); + } + /** + * $params['calendar_id'] = (string) The ID of the calendar to modify + * $params['job_id'] = (string) The ID of the job to remove from the calendar + * + * @param array $params Associative array of parameters + * @return array + */ + public function deleteCalendarJob(array $params = []) + { + $calendar_id = $this->extractArgument($params, 'calendar_id'); + $job_id = $this->extractArgument($params, 'job_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\DeleteCalendarJob'); + $endpoint->setParams($params); + $endpoint->setCalendarId($calendar_id); + $endpoint->setJobId($job_id); + + return $this->performRequest($endpoint); + } + /** + * $params['id'] = (string) The ID of the data frame analytics to delete + * $params['force'] = (boolean) True if the job should be forcefully deleted (Default = false) + * + * @param array $params Associative array of parameters + * @return array + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/delete-dfanalytics.html + * + * @note This API is EXPERIMENTAL and may be changed or removed completely in a future release + * + */ + public function deleteDataFrameAnalytics(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\DeleteDataFrameAnalytics'); + $endpoint->setParams($params); + $endpoint->setId($id); + + return $this->performRequest($endpoint); + } + /** + * $params['datafeed_id'] = (string) The ID of the datafeed to delete + * $params['force'] = (boolean) True if the datafeed should be forcefully deleted + * + * @param array $params Associative array of parameters + * @return array + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-datafeed.html + */ + public function deleteDatafeed(array $params = []) + { + $datafeed_id = $this->extractArgument($params, 'datafeed_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\DeleteDatafeed'); + $endpoint->setParams($params); + $endpoint->setDatafeedId($datafeed_id); + + return $this->performRequest($endpoint); + } + public function deleteExpiredData(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\DeleteExpiredData'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * $params['filter_id'] = (string) The ID of the filter to delete + * + * @param array $params Associative array of parameters + * @return array + */ + public function deleteFilter(array $params = []) + { + $filter_id = $this->extractArgument($params, 'filter_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\DeleteFilter'); + $endpoint->setParams($params); + $endpoint->setFilterId($filter_id); + + return $this->performRequest($endpoint); + } + /** + * $params['job_id'] = (string) The ID of the job from which to delete forecasts (Required) + * $params['forecast_id'] = (string) The ID of the forecast to delete, can be comma delimited list. Leaving blank implies `_all` + * $params['allow_no_forecasts'] = (boolean) Whether to ignore if `_all` matches no forecasts + * $params['timeout'] = (time) Controls the time to wait until the forecast(s) are deleted. Default to 30 seconds + * + * @param array $params Associative array of parameters + * @return array + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-forecast.html + */ + public function deleteForecast(array $params = []) + { + $job_id = $this->extractArgument($params, 'job_id'); + $forecast_id = $this->extractArgument($params, 'forecast_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\DeleteForecast'); + $endpoint->setParams($params); + $endpoint->setJobId($job_id); + $endpoint->setForecastId($forecast_id); + + return $this->performRequest($endpoint); + } + /** + * $params['job_id'] = (string) The ID of the job to delete + * $params['force'] = (boolean) True if the job should be forcefully deleted (Default = false) + * $params['wait_for_completion'] = (boolean) Should this request wait until the operation has completed before returning (Default = true) + * + * @param array $params Associative array of parameters + * @return array + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-job.html + */ + public function deleteJob(array $params = []) + { + $job_id = $this->extractArgument($params, 'job_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\DeleteJob'); + $endpoint->setParams($params); + $endpoint->setJobId($job_id); + + return $this->performRequest($endpoint); + } + /** + * $params['job_id'] = (string) The ID of the job to fetch + * $params['snapshot_id'] = (string) The ID of the snapshot to delete + * + * @param array $params Associative array of parameters + * @return array + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-snapshot.html + */ + public function deleteModelSnapshot(array $params = []) + { + $job_id = $this->extractArgument($params, 'job_id'); + $snapshot_id = $this->extractArgument($params, 'snapshot_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\DeleteModelSnapshot'); + $endpoint->setParams($params); + $endpoint->setJobId($job_id); + $endpoint->setSnapshotId($snapshot_id); + + return $this->performRequest($endpoint); + } + /** + * $params['model_id'] = (string) The ID of the trained model to delete + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-inference.html + * + * @note This API is EXPERIMENTAL and may be changed or removed completely in a future release + * + */ + public function deleteTrainedModel(array $params = []) + { + $model_id = $this->extractArgument($params, 'model_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\DeleteTrainedModel'); + $endpoint->setParams($params); + $endpoint->setModelId($model_id); + + return $this->performRequest($endpoint); + } + public function evaluateDataFrame(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\EvaluateDataFrame'); + $endpoint->setParams($params); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['id'] = (string) The ID of the data frame analytics to explain + * $params['body'] = (array) The data frame analytics config to explain + * + * @param array $params Associative array of parameters + * @return array + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/explain-dfanalytics.html + * + * @note This API is EXPERIMENTAL and may be changed or removed completely in a future release + * + */ + public function explainDataFrameAnalytics(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\ExplainDataFrameAnalytics'); + $endpoint->setParams($params); + $endpoint->setId($id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['lines_to_sample'] = (int) How many lines of the file should be included in the analysis (Default = 1000) + * $params['line_merge_size_limit'] = (int) Maximum number of characters permitted in a single message when lines are merged to create messages. (Default = 10000) + * $params['timeout'] = (time) Timeout after which the analysis will be aborted (Default = 25s) + * $params['charset'] = (string) Optional parameter to specify the character set of the file + * $params['format'] = (enum) Optional parameter to specify the high level file format (Options = ndjson,xml,delimited,semi_structured_text) + * $params['has_header_row'] = (boolean) Optional parameter to specify whether a delimited file includes the column names in its first row + * $params['column_names'] = (list) Optional parameter containing a comma separated list of the column names for a delimited file + * $params['delimiter'] = (string) Optional parameter to specify the delimiter character for a delimited file - must be a single character + * $params['quote'] = (string) Optional parameter to specify the quote character for a delimited file - must be a single character + * $params['should_trim_fields'] = (boolean) Optional parameter to specify whether the values between delimiters in a delimited file should have whitespace trimmed from them + * $params['grok_pattern'] = (string) Optional parameter to specify the Grok pattern that should be used to extract fields from messages in a semi-structured text file + * $params['timestamp_field'] = (string) Optional parameter to specify the timestamp field in the file + * $params['timestamp_format'] = (string) Optional parameter to specify the timestamp format in the file - may be either a Joda or Java time format + * $params['explain'] = (boolean) Whether to include a commentary on how the structure was derived (Default = false) + * $params['body'] = (array) The contents of the file to be analyzed (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-find-file-structure.html + * + * @note This API is EXPERIMENTAL and may be changed or removed completely in a future release + * + */ + public function findFileStructure(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\FindFileStructure'); + $endpoint->setParams($params); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['job_id'] = (string) The name of the job to flush + * $params['calc_interim'] = (boolean) Calculates interim results for the most recent bucket or all buckets within the latency period + * $params['start'] = (string) When used in conjunction with calc_interim, specifies the range of buckets on which to calculate interim results + * $params['end'] = (string) When used in conjunction with calc_interim, specifies the range of buckets on which to calculate interim results + * $params['advance_time'] = (string) Advances time to the given value generating results and updating the model for the advanced interval + * $params['skip_time'] = (string) Skips time to the given value without generating results or updating the model for the skipped interval + * $params['body'] = (array) Flush parameters + * + * @param array $params Associative array of parameters + * @return array + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-flush-job.html + */ + public function flushJob(array $params = []) + { + $job_id = $this->extractArgument($params, 'job_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\FlushJob'); + $endpoint->setParams($params); + $endpoint->setJobId($job_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['job_id'] = (string) The ID of the job to forecast for + * $params['duration'] = (time) The duration of the forecast + * $params['expires_in'] = (time) The time interval after which the forecast expires. Expired forecasts will be deleted at the first opportunity. + * + * @param array $params Associative array of parameters + * @return array + */ + public function forecast(array $params = []) + { + $job_id = $this->extractArgument($params, 'job_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\Forecast'); + $endpoint->setParams($params); + $endpoint->setJobId($job_id); + + return $this->performRequest($endpoint); + } + /** + * $params['job_id'] = (string) ID of the job to get bucket results from (Required) + * $params['timestamp'] = (string) The timestamp of the desired single bucket result + * $params['expand'] = (boolean) Include anomaly records + * $params['exclude_interim'] = (boolean) Exclude interim results + * $params['from'] = (int) skips a number of buckets + * $params['size'] = (int) specifies a max number of buckets to get + * $params['start'] = (string) Start time filter for buckets + * $params['end'] = (string) End time filter for buckets + * $params['anomaly_score'] = (double) Filter for the most anomalous buckets + * $params['sort'] = (string) Sort buckets by a particular field + * $params['desc'] = (boolean) Set the sort direction + * $params['body'] = (array) Bucket selection details if not provided in URI + * + * @param array $params Associative array of parameters + * @return array + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-bucket.html + */ + public function getBuckets(array $params = []) + { + $job_id = $this->extractArgument($params, 'job_id'); + $timestamp = $this->extractArgument($params, 'timestamp'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\GetBuckets'); + $endpoint->setParams($params); + $endpoint->setJobId($job_id); + $endpoint->setTimestamp($timestamp); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['calendar_id'] = (string) The ID of the calendar containing the events + * $params['job_id'] = (string) Get events for the job. When this option is used calendar_id must be '_all' + * $params['start'] = (string) Get events after this time + * $params['end'] = (date) Get events before this time + * $params['from'] = (int) Skips a number of events + * $params['size'] = (int) Specifies a max number of events to get + * + * @param array $params Associative array of parameters + * @return array + */ + public function getCalendarEvents(array $params = []) + { + $calendar_id = $this->extractArgument($params, 'calendar_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\GetCalendarEvents'); + $endpoint->setParams($params); + $endpoint->setCalendarId($calendar_id); + + return $this->performRequest($endpoint); + } + /** + * $params['calendar_id'] = (string) The ID of the calendar to fetch + * $params['from'] = (int) skips a number of calendars + * $params['size'] = (int) specifies a max number of calendars to get + * $params['body'] = (array) The from and size parameters optionally sent in the body + * + * @param array $params Associative array of parameters + * @return array + */ + public function getCalendars(array $params = []) + { + $calendar_id = $this->extractArgument($params, 'calendar_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\GetCalendars'); + $endpoint->setParams($params); + $endpoint->setCalendarId($calendar_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['job_id'] = (string) The name of the job (Required) + * $params['category_id'] = (long) The identifier of the category definition of interest + * $params['from'] = (int) skips a number of categories + * $params['size'] = (int) specifies a max number of categories to get + * $params['body'] = (array) Category selection details if not provided in URI + * + * @param array $params Associative array of parameters + * @return array + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-category.html + */ + public function getCategories(array $params = []) + { + $job_id = $this->extractArgument($params, 'job_id'); + $category_id = $this->extractArgument($params, 'category_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\GetCategories'); + $endpoint->setParams($params); + $endpoint->setJobId($job_id); + $endpoint->setCategoryId($category_id); + $endpoint->setBody($body); + + 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 data frame analytics. (This includes `_all` string or when no data frame analytics have been specified) (Default = true) + * $params['from'] = (int) skips a number of analytics (Default = 0) + * $params['size'] = (int) specifies a max number of analytics to get (Default = 100) + * + * @param array $params Associative array of parameters + * @return array + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/get-dfanalytics.html + * + * @note This API is EXPERIMENTAL and may be changed or removed completely in a future release + * + */ + public function getDataFrameAnalytics(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\GetDataFrameAnalytics'); + $endpoint->setParams($params); + $endpoint->setId($id); + + return $this->performRequest($endpoint); + } + /** + * $params['id'] = (string) The ID of the data frame analytics stats to fetch + * $params['allow_no_match'] = (boolean) Whether to ignore if a wildcard expression matches no data frame analytics. (This includes `_all` string or when no data frame analytics have been specified) (Default = true) + * $params['from'] = (int) skips a number of analytics (Default = 0) + * $params['size'] = (int) specifies a max number of analytics to get (Default = 100) + * + * @param array $params Associative array of parameters + * @return array + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/get-dfanalytics-stats.html + * + * @note This API is EXPERIMENTAL and may be changed or removed completely in a future release + * + */ + public function getDataFrameAnalyticsStats(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\GetDataFrameAnalyticsStats'); + $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_datafeeds'] = (boolean) Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified) + * + * @param array $params Associative array of parameters + * @return array + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed-stats.html + */ + public function getDatafeedStats(array $params = []) + { + $datafeed_id = $this->extractArgument($params, 'datafeed_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\GetDatafeedStats'); + $endpoint->setParams($params); + $endpoint->setDatafeedId($datafeed_id); + + return $this->performRequest($endpoint); + } + /** + * $params['datafeed_id'] = (string) The ID of the datafeeds to fetch + * $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) + * + * @param array $params Associative array of parameters + * @return array + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed.html + */ + public function getDatafeeds(array $params = []) + { + $datafeed_id = $this->extractArgument($params, 'datafeed_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\GetDatafeeds'); + $endpoint->setParams($params); + $endpoint->setDatafeedId($datafeed_id); + + return $this->performRequest($endpoint); + } + /** + * $params['filter_id'] = (string) The ID of the filter to fetch + * $params['from'] = (int) skips a number of filters + * $params['size'] = (int) specifies a max number of filters to get + * + * @param array $params Associative array of parameters + * @return array + */ + public function getFilters(array $params = []) + { + $filter_id = $this->extractArgument($params, 'filter_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\GetFilters'); + $endpoint->setParams($params); + $endpoint->setFilterId($filter_id); + + return $this->performRequest($endpoint); + } + /** + * $params['job_id'] = (string) + * $params['exclude_interim'] = (boolean) Exclude interim results + * $params['from'] = (int) skips a number of influencers + * $params['size'] = (int) specifies a max number of influencers to get + * $params['start'] = (string) start timestamp for the requested influencers + * $params['end'] = (string) end timestamp for the requested influencers + * $params['influencer_score'] = (double) influencer score threshold for the requested influencers + * $params['sort'] = (string) sort field for the requested influencers + * $params['desc'] = (boolean) whether the results should be sorted in decending order + * $params['body'] = (array) Influencer selection criteria + * + * @param array $params Associative array of parameters + * @return array + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-influencer.html + */ + public function getInfluencers(array $params = []) + { + $job_id = $this->extractArgument($params, 'job_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\GetInfluencers'); + $endpoint->setParams($params); + $endpoint->setJobId($job_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['job_id'] = (string) The ID of the jobs stats to fetch + * $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) + * + * @param array $params Associative array of parameters + * @return array + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-stats.html + */ + public function getJobStats(array $params = []) + { + $job_id = $this->extractArgument($params, 'job_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\GetJobStats'); + $endpoint->setParams($params); + $endpoint->setJobId($job_id); + + return $this->performRequest($endpoint); + } + /** + * $params['job_id'] = (string) The ID of the jobs to fetch + * $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) + * + * @param array $params Associative array of parameters + * @return array + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job.html + */ + public function getJobs(array $params = []) + { + $job_id = $this->extractArgument($params, 'job_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\GetJobs'); + $endpoint->setParams($params); + $endpoint->setJobId($job_id); + + return $this->performRequest($endpoint); + } + /** + * $params['job_id'] = (string) The ID of the job to fetch (Required) + * $params['snapshot_id'] = (string) The ID of the snapshot to fetch + * $params['from'] = (int) Skips a number of documents + * $params['size'] = (int) The default number of documents returned in queries as a string. + * $params['start'] = (date) The filter 'start' query parameter + * $params['end'] = (date) The filter 'end' query parameter + * $params['sort'] = (string) Name of the field to sort on + * $params['desc'] = (boolean) True if the results should be sorted in descending order + * $params['body'] = (array) Model snapshot selection criteria + * + * @param array $params Associative array of parameters + * @return array + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-snapshot.html + */ + public function getModelSnapshots(array $params = []) + { + $job_id = $this->extractArgument($params, 'job_id'); + $snapshot_id = $this->extractArgument($params, 'snapshot_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\GetModelSnapshots'); + $endpoint->setParams($params); + $endpoint->setJobId($job_id); + $endpoint->setSnapshotId($snapshot_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['job_id'] = (string) The job IDs for which to calculate overall bucket results + * $params['top_n'] = (int) The number of top job bucket scores to be used in the overall_score calculation + * $params['bucket_span'] = (string) The span of the overall buckets. Defaults to the longest job bucket_span + * $params['overall_score'] = (double) Returns overall buckets with overall scores higher than this value + * $params['exclude_interim'] = (boolean) If true overall buckets that include interim buckets will be excluded + * $params['start'] = (string) Returns overall buckets with timestamps after this time + * $params['end'] = (string) Returns overall buckets with timestamps earlier than this time + * $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['body'] = (array) Overall bucket selection details if not provided in URI + * + * @param array $params Associative array of parameters + * @return array + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-overall-buckets.html + */ + public function getOverallBuckets(array $params = []) + { + $job_id = $this->extractArgument($params, 'job_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\GetOverallBuckets'); + $endpoint->setParams($params); + $endpoint->setJobId($job_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['job_id'] = (string) + * $params['exclude_interim'] = (boolean) Exclude interim results + * $params['from'] = (int) skips a number of records + * $params['size'] = (int) specifies a max number of records to get + * $params['start'] = (string) Start time filter for records + * $params['end'] = (string) End time filter for records + * $params['record_score'] = (double) + * $params['sort'] = (string) Sort records by a particular field + * $params['desc'] = (boolean) Set the sort direction + * $params['body'] = (array) Record selection criteria + * + * @param array $params Associative array of parameters + * @return array + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-record.html + */ + public function getRecords(array $params = []) + { + $job_id = $this->extractArgument($params, 'job_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\GetRecords'); + $endpoint->setParams($params); + $endpoint->setJobId($job_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['model_id'] = (string) The ID of the trained models 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['include_model_definition'] = (boolean) Should the full model definition be included in the results. These definitions can be large. So be cautious when including them. Defaults to false. (Default = false) + * $params['decompress_definition'] = (boolean) Should the model definition be decompressed into valid JSON or returned in a custom compressed format. Defaults to true. (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) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-inference.html + * + * @note This API is EXPERIMENTAL and may be changed or removed completely in a future release + * + */ + public function getTrainedModels(array $params = []) + { + $model_id = $this->extractArgument($params, 'model_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\GetTrainedModels'); + $endpoint->setParams($params); + $endpoint->setModelId($model_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) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-inference-stats.html + * + * @note This API is EXPERIMENTAL and may be changed or removed completely in a future release + * + */ + public function getTrainedModelsStats(array $params = []) + { + $model_id = $this->extractArgument($params, 'model_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\GetTrainedModelsStats'); + $endpoint->setParams($params); + $endpoint->setModelId($model_id); + + return $this->performRequest($endpoint); + } + public function info(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\Info'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * $params['job_id'] = (string) The ID of the job to open + * + * @param array $params Associative array of parameters + * @return array + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-open-job.html + */ + public function openJob(array $params = []) + { + $job_id = $this->extractArgument($params, 'job_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\OpenJob'); + $endpoint->setParams($params); + $endpoint->setJobId($job_id); + + return $this->performRequest($endpoint); + } + /** + * $params['calendar_id'] = (string) The ID of the calendar to modify + * $params['body'] = (array) A list of events (Required) + * + * @param array $params Associative array of parameters + * @return array + */ + public function postCalendarEvents(array $params = []) + { + $calendar_id = $this->extractArgument($params, 'calendar_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\PostCalendarEvents'); + $endpoint->setParams($params); + $endpoint->setCalendarId($calendar_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['job_id'] = (string) The name of the job receiving the data + * $params['reset_start'] = (string) Optional parameter to specify the start of the bucket resetting range + * $params['reset_end'] = (string) Optional parameter to specify the end of the bucket resetting range + * $params['body'] = (array) The data to process (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-post-data.html + */ + public function postData(array $params = []) + { + $job_id = $this->extractArgument($params, 'job_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\PostData'); + $endpoint->setParams($params); + $endpoint->setJobId($job_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['datafeed_id'] = (string) The ID of the datafeed to preview + * + * @param array $params Associative array of parameters + * @return array + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-preview-datafeed.html + */ + public function previewDatafeed(array $params = []) + { + $datafeed_id = $this->extractArgument($params, 'datafeed_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\PreviewDatafeed'); + $endpoint->setParams($params); + $endpoint->setDatafeedId($datafeed_id); + + return $this->performRequest($endpoint); + } + /** + * $params['calendar_id'] = (string) The ID of the calendar to create + * $params['body'] = (array) The calendar details + * + * @param array $params Associative array of parameters + * @return array + */ + public function putCalendar(array $params = []) + { + $calendar_id = $this->extractArgument($params, 'calendar_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\PutCalendar'); + $endpoint->setParams($params); + $endpoint->setCalendarId($calendar_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['calendar_id'] = (string) The ID of the calendar to modify + * $params['job_id'] = (string) The ID of the job to add to the calendar + * + * @param array $params Associative array of parameters + * @return array + */ + public function putCalendarJob(array $params = []) + { + $calendar_id = $this->extractArgument($params, 'calendar_id'); + $job_id = $this->extractArgument($params, 'job_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\PutCalendarJob'); + $endpoint->setParams($params); + $endpoint->setCalendarId($calendar_id); + $endpoint->setJobId($job_id); + + return $this->performRequest($endpoint); + } + /** + * $params['id'] = (string) The ID of the data frame analytics to create + * $params['body'] = (array) The data frame analytics configuration (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/put-dfanalytics.html + * + * @note This API is EXPERIMENTAL and may be changed or removed completely in a future release + * + */ + public function putDataFrameAnalytics(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\PutDataFrameAnalytics'); + $endpoint->setParams($params); + $endpoint->setId($id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['datafeed_id'] = (string) The ID of the datafeed to create + * $params['body'] = (array) The datafeed config (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-datafeed.html + */ + public function putDatafeed(array $params = []) + { + $datafeed_id = $this->extractArgument($params, 'datafeed_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\PutDatafeed'); + $endpoint->setParams($params); + $endpoint->setDatafeedId($datafeed_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['filter_id'] = (string) The ID of the filter to create + * $params['body'] = (array) The filter details (Required) + * + * @param array $params Associative array of parameters + * @return array + */ + public function putFilter(array $params = []) + { + $filter_id = $this->extractArgument($params, 'filter_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\PutFilter'); + $endpoint->setParams($params); + $endpoint->setFilterId($filter_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['job_id'] = (string) The ID of the job to create + * $params['body'] = (array) The job (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-job.html + */ + public function putJob(array $params = []) + { + $job_id = $this->extractArgument($params, 'job_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\PutJob'); + $endpoint->setParams($params); + $endpoint->setJobId($job_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['model_id'] = (string) The ID of the trained models to store + * $params['body'] = (array) The trained model configuration (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see TODO + * + * @note This API is EXPERIMENTAL and may be changed or removed completely in a future release + * + */ + public function putTrainedModel(array $params = []) + { + $model_id = $this->extractArgument($params, 'model_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\PutTrainedModel'); + $endpoint->setParams($params); + $endpoint->setModelId($model_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['job_id'] = (string) The ID of the job to fetch + * $params['snapshot_id'] = (string) The ID of the snapshot to revert to + * $params['delete_intervening_results'] = (boolean) Should we reset the results back to the time of the snapshot? + * $params['body'] = (array) Reversion options + * + * @param array $params Associative array of parameters + * @return array + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-revert-snapshot.html + */ + public function revertModelSnapshot(array $params = []) + { + $job_id = $this->extractArgument($params, 'job_id'); + $snapshot_id = $this->extractArgument($params, 'snapshot_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\RevertModelSnapshot'); + $endpoint->setParams($params); + $endpoint->setJobId($job_id); + $endpoint->setSnapshotId($snapshot_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['enabled'] = (boolean) Whether to enable upgrade_mode ML setting or not. Defaults to false. + * $params['timeout'] = (time) Controls the time to wait before action times out. Defaults to 30 seconds + * + * @param array $params Associative array of parameters + * @return array + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-set-upgrade-mode.html + */ + public function setUpgradeMode(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\SetUpgradeMode'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * $params['id'] = (string) The ID of the data frame analytics to start + * $params['timeout'] = (time) Controls the time to wait until the task has started. Defaults to 20 seconds + * $params['body'] = (array) The start data frame analytics parameters + * + * @param array $params Associative array of parameters + * @return array + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/start-dfanalytics.html + * + * @note This API is EXPERIMENTAL and may be changed or removed completely in a future release + * + */ + public function startDataFrameAnalytics(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\StartDataFrameAnalytics'); + $endpoint->setParams($params); + $endpoint->setId($id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['datafeed_id'] = (string) The ID of the datafeed to start + * $params['start'] = (string) The start time from where the datafeed should begin + * $params['end'] = (string) The end time when the datafeed should stop. When not set, the datafeed continues in real time + * $params['timeout'] = (time) Controls the time to wait until a datafeed has started. Default to 20 seconds + * $params['body'] = (array) The start datafeed parameters + * + * @param array $params Associative array of parameters + * @return array + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-start-datafeed.html + */ + public function startDatafeed(array $params = []) + { + $datafeed_id = $this->extractArgument($params, 'datafeed_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\StartDatafeed'); + $endpoint->setParams($params); + $endpoint->setDatafeedId($datafeed_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['id'] = (string) The ID of the data frame analytics to stop + * $params['allow_no_match'] = (boolean) Whether to ignore if a wildcard expression matches no data frame analytics. (This includes `_all` string or when no data frame analytics have been specified) + * $params['force'] = (boolean) True if the data frame analytics should be forcefully stopped + * $params['timeout'] = (time) Controls the time to wait until the task has stopped. Defaults to 20 seconds + * $params['body'] = (array) The stop data frame analytics parameters + * + * @param array $params Associative array of parameters + * @return array + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/stop-dfanalytics.html + * + * @note This API is EXPERIMENTAL and may be changed or removed completely in a future release + * + */ + public function stopDataFrameAnalytics(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\StopDataFrameAnalytics'); + $endpoint->setParams($params); + $endpoint->setId($id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['datafeed_id'] = (string) The ID of the datafeed to stop + * $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['force'] = (boolean) True if the datafeed should be forcefully stopped. + * $params['timeout'] = (time) Controls the time to wait until a datafeed has stopped. Default to 20 seconds + * + * @param array $params Associative array of parameters + * @return array + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-stop-datafeed.html + */ + public function stopDatafeed(array $params = []) + { + $datafeed_id = $this->extractArgument($params, 'datafeed_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\StopDatafeed'); + $endpoint->setParams($params); + $endpoint->setDatafeedId($datafeed_id); + + return $this->performRequest($endpoint); + } + /** + * $params['datafeed_id'] = (string) The ID of the datafeed to update + * $params['body'] = (array) The datafeed update settings (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-datafeed.html + */ + public function updateDatafeed(array $params = []) + { + $datafeed_id = $this->extractArgument($params, 'datafeed_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\UpdateDatafeed'); + $endpoint->setParams($params); + $endpoint->setDatafeedId($datafeed_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['filter_id'] = (string) The ID of the filter to update + * $params['body'] = (array) The filter update (Required) + * + * @param array $params Associative array of parameters + * @return array + */ + public function updateFilter(array $params = []) + { + $filter_id = $this->extractArgument($params, 'filter_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\UpdateFilter'); + $endpoint->setParams($params); + $endpoint->setFilterId($filter_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['job_id'] = (string) The ID of the job to create + * $params['body'] = (array) The job update settings (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-job.html + */ + public function updateJob(array $params = []) + { + $job_id = $this->extractArgument($params, 'job_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\UpdateJob'); + $endpoint->setParams($params); + $endpoint->setJobId($job_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['job_id'] = (string) The ID of the job to fetch + * $params['snapshot_id'] = (string) The ID of the snapshot to update + * $params['body'] = (array) The model snapshot properties to update (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-snapshot.html + */ + public function updateModelSnapshot(array $params = []) + { + $job_id = $this->extractArgument($params, 'job_id'); + $snapshot_id = $this->extractArgument($params, 'snapshot_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\UpdateModelSnapshot'); + $endpoint->setParams($params); + $endpoint->setJobId($job_id); + $endpoint->setSnapshotId($snapshot_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['body'] = (array) The job config (Required) + * + * @param array $params Associative array of parameters + * @return array + */ + public function validate(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\Validate'); + $endpoint->setParams($params); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['body'] = (array) The detector (Required) + * + * @param array $params Associative array of parameters + * @return array + */ + public function validateDetector(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ml\ValidateDetector'); + $endpoint->setParams($params); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } +} diff --git a/util/output/7.6.1/Namespaces/MonitoringNamespace.php b/util/output/7.6.1/Namespaces/MonitoringNamespace.php new file mode 100644 index 000000000..d6158a45b --- /dev/null +++ b/util/output/7.6.1/Namespaces/MonitoringNamespace.php @@ -0,0 +1,48 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class MonitoringNamespace extends AbstractNamespace +{ + + /** + * $params['type'] = DEPRECATED (string) Default document type for items which don't provide one + * $params['system_id'] = (string) Identifier of the monitored system + * $params['system_api_version'] = (string) API Version of the monitored system + * $params['interval'] = (string) Collection interval (e.g., '10s' or '10000ms') of the payload + * $params['body'] = (array) The operation definition and data (action-data pairs), separated by newlines (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/monitor-elasticsearch-cluster.html + * + * @note This API is EXPERIMENTAL and may be changed or removed completely in a future release + * + */ + public function bulk(array $params = []) + { + $type = $this->extractArgument($params, 'type'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Monitoring\Bulk'); + $endpoint->setParams($params); + $endpoint->setType($type); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } +} diff --git a/util/output/7.6.1/Namespaces/NodesNamespace.php b/util/output/7.6.1/Namespaces/NodesNamespace.php new file mode 100644 index 000000000..efa59e5eb --- /dev/null +++ b/util/output/7.6.1/Namespaces/NodesNamespace.php @@ -0,0 +1,141 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +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 + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-hot-threads.html + */ + public function hotThreads(array $params = []) + { + $node_id = $this->extractArgument($params, 'node_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Nodes\HotThreads'); + $endpoint->setParams($params); + $endpoint->setNodeId($node_id); + + 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 + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-info.html + */ + public function info(array $params = []) + { + $node_id = $this->extractArgument($params, 'node_id'); + $metric = $this->extractArgument($params, 'metric'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Nodes\Info'); + $endpoint->setParams($params); + $endpoint->setNodeId($node_id); + $endpoint->setMetric($metric); + + 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 + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/secure-settings.html#reloadable-secure-settings + */ + public function reloadSecureSettings(array $params = []) + { + $node_id = $this->extractArgument($params, 'node_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Nodes\ReloadSecureSettings'); + $endpoint->setParams($params); + $endpoint->setNodeId($node_id); + + 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) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-stats.html + */ + public function stats(array $params = []) + { + $node_id = $this->extractArgument($params, 'node_id'); + $metric = $this->extractArgument($params, 'metric'); + $index_metric = $this->extractArgument($params, 'index_metric'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Nodes\Stats'); + $endpoint->setParams($params); + $endpoint->setNodeId($node_id); + $endpoint->setMetric($metric); + $endpoint->setIndexMetric($index_metric); + + 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 + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-usage.html + */ + public function usage(array $params = []) + { + $node_id = $this->extractArgument($params, 'node_id'); + $metric = $this->extractArgument($params, 'metric'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Nodes\Usage'); + $endpoint->setParams($params); + $endpoint->setNodeId($node_id); + $endpoint->setMetric($metric); + + return $this->performRequest($endpoint); + } +} diff --git a/util/output/7.6.1/Namespaces/RollupNamespace.php b/util/output/7.6.1/Namespaces/RollupNamespace.php new file mode 100644 index 000000000..094cb34f7 --- /dev/null +++ b/util/output/7.6.1/Namespaces/RollupNamespace.php @@ -0,0 +1,202 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class RollupNamespace extends AbstractNamespace +{ + + /** + * $params['id'] = (string) The ID of the job to delete + * + * @param array $params Associative array of parameters + * @return array + * @see + * + * @note This API is EXPERIMENTAL and may be changed or removed completely in a future release + * + */ + public function deleteJob(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Rollup\DeleteJob'); + $endpoint->setParams($params); + $endpoint->setId($id); + + return $this->performRequest($endpoint); + } + /** + * $params['id'] = (string) The ID of the job(s) to fetch. Accepts glob patterns, or left blank for all jobs + * + * @param array $params Associative array of parameters + * @return array + * @see + * + * @note This API is EXPERIMENTAL and may be changed or removed completely in a future release + * + */ + public function getJobs(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Rollup\GetJobs'); + $endpoint->setParams($params); + $endpoint->setId($id); + + return $this->performRequest($endpoint); + } + /** + * $params['id'] = (string) The ID of the index to check rollup capabilities on, or left blank for all jobs + * + * @param array $params Associative array of parameters + * @return array + * @see + * + * @note This API is EXPERIMENTAL and may be changed or removed completely in a future release + * + */ + public function getRollupCaps(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Rollup\GetRollupCaps'); + $endpoint->setParams($params); + $endpoint->setId($id); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (string) The rollup index or index pattern to obtain rollup capabilities from. + * + * @param array $params Associative array of parameters + * @return array + * @see + * + * @note This API is EXPERIMENTAL and may be changed or removed completely in a future release + * + */ + public function getRollupIndexCaps(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Rollup\GetRollupIndexCaps'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + + return $this->performRequest($endpoint); + } + /** + * $params['id'] = (string) The ID of the job to create + * $params['body'] = (array) The job configuration (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see + * + * @note This API is EXPERIMENTAL and may be changed or removed completely in a future release + * + */ + public function putJob(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Rollup\PutJob'); + $endpoint->setParams($params); + $endpoint->setId($id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['index'] = (list) The indices or index-pattern(s) (containing rollup or regular data) that should be searched (Required) + * $params['type'] = DEPRECATED (string) The doc type inside the index + * $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['body'] = (array) The search request body (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see + * + * @note This API is EXPERIMENTAL and may be changed or removed completely in a future release + * + */ + public function rollupSearch(array $params = []) + { + $index = $this->extractArgument($params, 'index'); + $type = $this->extractArgument($params, 'type'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Rollup\RollupSearch'); + $endpoint->setParams($params); + $endpoint->setIndex($index); + $endpoint->setType($type); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['id'] = (string) The ID of the job to start + * + * @param array $params Associative array of parameters + * @return array + * @see + * + * @note This API is EXPERIMENTAL and may be changed or removed completely in a future release + * + */ + public function startJob(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Rollup\StartJob'); + $endpoint->setParams($params); + $endpoint->setId($id); + + return $this->performRequest($endpoint); + } + /** + * $params['id'] = (string) The ID of the job to stop + * $params['wait_for_completion'] = (boolean) True if the API should block until the job has fully stopped, false if should be executed async. Defaults to false. + * $params['timeout'] = (time) Block for (at maximum) the specified duration while waiting for the job to stop. Defaults to 30s. + * + * @param array $params Associative array of parameters + * @return array + * @see + * + * @note This API is EXPERIMENTAL and may be changed or removed completely in a future release + * + */ + public function stopJob(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Rollup\StopJob'); + $endpoint->setParams($params); + $endpoint->setId($id); + + return $this->performRequest($endpoint); + } +} diff --git a/util/output/7.6.1/Namespaces/SecurityNamespace.php b/util/output/7.6.1/Namespaces/SecurityNamespace.php new file mode 100644 index 000000000..5fe8d1d80 --- /dev/null +++ b/util/output/7.6.1/Namespaces/SecurityNamespace.php @@ -0,0 +1,509 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class SecurityNamespace extends AbstractNamespace +{ + + /** + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-authenticate.html + */ + public function authenticate(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\Authenticate'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * $params['username'] = (string) The username of the user to change the password for + * $params['refresh'] = (enum) If `true` (the default) 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` then do nothing with refreshes. (Options = true,false,wait_for) + * $params['body'] = (array) the new password for the user (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-change-password.html + */ + public function changePassword(array $params = []) + { + $username = $this->extractArgument($params, 'username'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\ChangePassword'); + $endpoint->setParams($params); + $endpoint->setUsername($username); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['realms'] = (list) Comma-separated list of realms to clear + * $params['usernames'] = (list) Comma-separated list of usernames to clear from the cache + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-cache.html + */ + public function clearCachedRealms(array $params = []) + { + $realms = $this->extractArgument($params, 'realms'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\ClearCachedRealms'); + $endpoint->setParams($params); + $endpoint->setRealms($realms); + + return $this->performRequest($endpoint); + } + /** + * $params['name'] = (list) Role name + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-role-cache.html + */ + public function clearCachedRoles(array $params = []) + { + $name = $this->extractArgument($params, 'name'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\ClearCachedRoles'); + $endpoint->setParams($params); + $endpoint->setName($name); + + return $this->performRequest($endpoint); + } + /** + * $params['refresh'] = (enum) If `true` (the default) 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` then do nothing with refreshes. (Options = true,false,wait_for) + * $params['body'] = (array) The api key request to create an API key (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html + */ + public function createApiKey(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\CreateApiKey'); + $endpoint->setParams($params); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['application'] = (string) Application name + * $params['name'] = (string) Privilege name + * $params['refresh'] = (enum) If `true` (the default) 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` then do nothing with refreshes. (Options = true,false,wait_for) + * + * @param array $params Associative array of parameters + * @return array + * @see TODO + */ + public function deletePrivileges(array $params = []) + { + $application = $this->extractArgument($params, 'application'); + $name = $this->extractArgument($params, 'name'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\DeletePrivileges'); + $endpoint->setParams($params); + $endpoint->setApplication($application); + $endpoint->setName($name); + + return $this->performRequest($endpoint); + } + /** + * $params['name'] = (string) Role name + * $params['refresh'] = (enum) If `true` (the default) 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` then do nothing with refreshes. (Options = true,false,wait_for) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role.html + */ + public function deleteRole(array $params = []) + { + $name = $this->extractArgument($params, 'name'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\DeleteRole'); + $endpoint->setParams($params); + $endpoint->setName($name); + + return $this->performRequest($endpoint); + } + /** + * $params['name'] = (string) Role-mapping name + * $params['refresh'] = (enum) If `true` (the default) 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` then do nothing with refreshes. (Options = true,false,wait_for) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role-mapping.html + */ + public function deleteRoleMapping(array $params = []) + { + $name = $this->extractArgument($params, 'name'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\DeleteRoleMapping'); + $endpoint->setParams($params); + $endpoint->setName($name); + + return $this->performRequest($endpoint); + } + /** + * $params['username'] = (string) username + * $params['refresh'] = (enum) If `true` (the default) 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` then do nothing with refreshes. (Options = true,false,wait_for) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-user.html + */ + public function deleteUser(array $params = []) + { + $username = $this->extractArgument($params, 'username'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\DeleteUser'); + $endpoint->setParams($params); + $endpoint->setUsername($username); + + return $this->performRequest($endpoint); + } + /** + * $params['username'] = (string) The username of the user to disable + * $params['refresh'] = (enum) If `true` (the default) 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` then do nothing with refreshes. (Options = true,false,wait_for) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-disable-user.html + */ + public function disableUser(array $params = []) + { + $username = $this->extractArgument($params, 'username'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\DisableUser'); + $endpoint->setParams($params); + $endpoint->setUsername($username); + + return $this->performRequest($endpoint); + } + /** + * $params['username'] = (string) The username of the user to enable + * $params['refresh'] = (enum) If `true` (the default) 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` then do nothing with refreshes. (Options = true,false,wait_for) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-enable-user.html + */ + public function enableUser(array $params = []) + { + $username = $this->extractArgument($params, 'username'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\EnableUser'); + $endpoint->setParams($params); + $endpoint->setUsername($username); + + return $this->performRequest($endpoint); + } + /** + * $params['id'] = (string) API key id of the API key to be retrieved + * $params['name'] = (string) API key name of the API key to be retrieved + * $params['username'] = (string) user name of the user who created this API key to be retrieved + * $params['realm_name'] = (string) realm name of the user who created this API key to be retrieved + * $params['owner'] = (boolean) flag to query API keys owned by the currently authenticated user (Default = false) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-api-key.html + */ + public function getApiKey(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\GetApiKey'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-builtin-privileges.html + */ + public function getBuiltinPrivileges(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\GetBuiltinPrivileges'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * $params['application'] = (string) Application name + * $params['name'] = (string) Privilege name + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-privileges.html + */ + public function getPrivileges(array $params = []) + { + $application = $this->extractArgument($params, 'application'); + $name = $this->extractArgument($params, 'name'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\GetPrivileges'); + $endpoint->setParams($params); + $endpoint->setApplication($application); + $endpoint->setName($name); + + return $this->performRequest($endpoint); + } + /** + * $params['name'] = (string) Role name + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role.html + */ + public function getRole(array $params = []) + { + $name = $this->extractArgument($params, 'name'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\GetRole'); + $endpoint->setParams($params); + $endpoint->setName($name); + + return $this->performRequest($endpoint); + } + /** + * $params['name'] = (string) Role-Mapping name + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role-mapping.html + */ + public function getRoleMapping(array $params = []) + { + $name = $this->extractArgument($params, 'name'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\GetRoleMapping'); + $endpoint->setParams($params); + $endpoint->setName($name); + + return $this->performRequest($endpoint); + } + /** + * $params['body'] = (array) The token request to get (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-token.html + */ + public function getToken(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\GetToken'); + $endpoint->setParams($params); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['username'] = (list) A comma-separated list of usernames + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user.html + */ + public function getUser(array $params = []) + { + $username = $this->extractArgument($params, 'username'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\GetUser'); + $endpoint->setParams($params); + $endpoint->setUsername($username); + + return $this->performRequest($endpoint); + } + /** + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-privileges.html + */ + public function getUserPrivileges(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\GetUserPrivileges'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * $params['user'] = (string) Username + * $params['body'] = (array) The privileges to test (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges.html + */ + public function hasPrivileges(array $params = []) + { + $user = $this->extractArgument($params, 'user'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\HasPrivileges'); + $endpoint->setParams($params); + $endpoint->setUser($user); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + public function invalidateApiKey(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\InvalidateApiKey'); + $endpoint->setParams($params); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['body'] = (array) The token to invalidate (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-token.html + */ + public function invalidateToken(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\InvalidateToken'); + $endpoint->setParams($params); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['refresh'] = (enum) If `true` (the default) 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` then do nothing with refreshes. (Options = true,false,wait_for) + * $params['body'] = (array) The privilege(s) to add (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see TODO + */ + public function putPrivileges(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\PutPrivileges'); + $endpoint->setParams($params); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['name'] = (string) Role name + * $params['refresh'] = (enum) If `true` (the default) 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` then do nothing with refreshes. (Options = true,false,wait_for) + * $params['body'] = (array) The role to add (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role.html + */ + public function putRole(array $params = []) + { + $name = $this->extractArgument($params, 'name'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\PutRole'); + $endpoint->setParams($params); + $endpoint->setName($name); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['name'] = (string) Role-mapping name + * $params['refresh'] = (enum) If `true` (the default) 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` then do nothing with refreshes. (Options = true,false,wait_for) + * $params['body'] = (array) The role mapping to add (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role-mapping.html + */ + public function putRoleMapping(array $params = []) + { + $name = $this->extractArgument($params, 'name'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\PutRoleMapping'); + $endpoint->setParams($params); + $endpoint->setName($name); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['username'] = (string) The username of the User + * $params['refresh'] = (enum) If `true` (the default) 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` then do nothing with refreshes. (Options = true,false,wait_for) + * $params['body'] = (array) The user to add (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-user.html + */ + public function putUser(array $params = []) + { + $username = $this->extractArgument($params, 'username'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Security\PutUser'); + $endpoint->setParams($params); + $endpoint->setUsername($username); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } +} diff --git a/util/output/7.6.1/Namespaces/SlmNamespace.php b/util/output/7.6.1/Namespaces/SlmNamespace.php new file mode 100644 index 000000000..d8c502585 --- /dev/null +++ b/util/output/7.6.1/Namespaces/SlmNamespace.php @@ -0,0 +1,171 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class SlmNamespace extends AbstractNamespace +{ + + /** + * $params['policy_id'] = (string) The id of the snapshot lifecycle policy to remove + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-delete-policy.html + */ + public function deleteLifecycle(array $params = []) + { + $policy_id = $this->extractArgument($params, 'policy_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Slm\DeleteLifecycle'); + $endpoint->setParams($params); + $endpoint->setPolicyId($policy_id); + + return $this->performRequest($endpoint); + } + /** + * $params['policy_id'] = (string) The id of the snapshot lifecycle policy to be executed + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-execute-lifecycle.html + */ + public function executeLifecycle(array $params = []) + { + $policy_id = $this->extractArgument($params, 'policy_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Slm\ExecuteLifecycle'); + $endpoint->setParams($params); + $endpoint->setPolicyId($policy_id); + + return $this->performRequest($endpoint); + } + /** + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-execute-retention.html + */ + public function executeRetention(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Slm\ExecuteRetention'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * $params['policy_id'] = (list) Comma-separated list of snapshot lifecycle policies to retrieve + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-get-policy.html + */ + public function getLifecycle(array $params = []) + { + $policy_id = $this->extractArgument($params, 'policy_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Slm\GetLifecycle'); + $endpoint->setParams($params); + $endpoint->setPolicyId($policy_id); + + return $this->performRequest($endpoint); + } + /** + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/slm-api-get-stats.html + */ + public function getStats(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Slm\GetStats'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-get-status.html + */ + public function getStatus(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Slm\GetStatus'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * $params['policy_id'] = (string) The id of the snapshot lifecycle policy + * $params['body'] = (array) The snapshot lifecycle policy definition to register + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-put-policy.html + */ + public function putLifecycle(array $params = []) + { + $policy_id = $this->extractArgument($params, 'policy_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Slm\PutLifecycle'); + $endpoint->setParams($params); + $endpoint->setPolicyId($policy_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-start.html + */ + public function start(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Slm\Start'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-stop.html + */ + public function stop(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Slm\Stop'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } +} diff --git a/util/output/7.6.1/Namespaces/SnapshotNamespace.php b/util/output/7.6.1/Namespaces/SnapshotNamespace.php new file mode 100644 index 000000000..d091593f6 --- /dev/null +++ b/util/output/7.6.1/Namespaces/SnapshotNamespace.php @@ -0,0 +1,246 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class SnapshotNamespace extends AbstractNamespace +{ + + /** + * $params['repository'] = (string) A repository name + * $params['master_timeout'] = (time) Explicit operation timeout for connection to master node + * $params['timeout'] = (time) Explicit operation timeout + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html + */ + public function cleanupRepository(array $params = []) + { + $repository = $this->extractArgument($params, 'repository'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Snapshot\CleanupRepository'); + $endpoint->setParams($params); + $endpoint->setRepository($repository); + + return $this->performRequest($endpoint); + } + /** + * $params['repository'] = (string) A repository name + * $params['snapshot'] = (string) A snapshot name + * $params['master_timeout'] = (time) 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['body'] = (array) The snapshot definition + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html + */ + public function create(array $params = []) + { + $repository = $this->extractArgument($params, 'repository'); + $snapshot = $this->extractArgument($params, 'snapshot'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Snapshot\Create'); + $endpoint->setParams($params); + $endpoint->setRepository($repository); + $endpoint->setSnapshot($snapshot); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['repository'] = (string) A repository name + * $params['master_timeout'] = (time) Explicit operation timeout for connection to master node + * $params['timeout'] = (time) Explicit operation timeout + * $params['verify'] = (boolean) Whether to verify the repository after creation + * $params['body'] = (array) The repository definition (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html + */ + public function createRepository(array $params = []) + { + $repository = $this->extractArgument($params, 'repository'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Snapshot\CreateRepository'); + $endpoint->setParams($params); + $endpoint->setRepository($repository); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['repository'] = (string) A repository name + * $params['snapshot'] = (string) A snapshot name + * $params['master_timeout'] = (time) Explicit operation timeout for connection to master node + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html + */ + public function delete(array $params = []) + { + $repository = $this->extractArgument($params, 'repository'); + $snapshot = $this->extractArgument($params, 'snapshot'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Snapshot\Delete'); + $endpoint->setParams($params); + $endpoint->setRepository($repository); + $endpoint->setSnapshot($snapshot); + + return $this->performRequest($endpoint); + } + /** + * $params['repository'] = (list) A comma-separated list of repository names + * $params['master_timeout'] = (time) Explicit operation timeout for connection to master node + * $params['timeout'] = (time) Explicit operation timeout + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html + */ + public function deleteRepository(array $params = []) + { + $repository = $this->extractArgument($params, 'repository'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Snapshot\DeleteRepository'); + $endpoint->setParams($params); + $endpoint->setRepository($repository); + + return $this->performRequest($endpoint); + } + /** + * $params['repository'] = (string) A repository name + * $params['snapshot'] = (list) A comma-separated list of snapshot names + * $params['master_timeout'] = (time) Explicit operation timeout for connection to master 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 + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html + */ + public function get(array $params = []) + { + $repository = $this->extractArgument($params, 'repository'); + $snapshot = $this->extractArgument($params, 'snapshot'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Snapshot\Get'); + $endpoint->setParams($params); + $endpoint->setRepository($repository); + $endpoint->setSnapshot($snapshot); + + return $this->performRequest($endpoint); + } + /** + * $params['repository'] = (list) A comma-separated list of repository names + * $params['master_timeout'] = (time) Explicit operation timeout for connection to master node + * $params['local'] = (boolean) Return local information, do not retrieve the state from master node (default: false) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html + */ + public function getRepository(array $params = []) + { + $repository = $this->extractArgument($params, 'repository'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Snapshot\GetRepository'); + $endpoint->setParams($params); + $endpoint->setRepository($repository); + + return $this->performRequest($endpoint); + } + /** + * $params['repository'] = (string) A repository name + * $params['snapshot'] = (string) A snapshot name + * $params['master_timeout'] = (time) 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['body'] = (array) Details of what to restore + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html + */ + public function restore(array $params = []) + { + $repository = $this->extractArgument($params, 'repository'); + $snapshot = $this->extractArgument($params, 'snapshot'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Snapshot\Restore'); + $endpoint->setParams($params); + $endpoint->setRepository($repository); + $endpoint->setSnapshot($snapshot); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['repository'] = (string) A repository name + * $params['snapshot'] = (list) A comma-separated list of snapshot names + * $params['master_timeout'] = (time) Explicit operation timeout for connection to master node + * $params['ignore_unavailable'] = (boolean) Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html + */ + public function status(array $params = []) + { + $repository = $this->extractArgument($params, 'repository'); + $snapshot = $this->extractArgument($params, 'snapshot'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Snapshot\Status'); + $endpoint->setParams($params); + $endpoint->setRepository($repository); + $endpoint->setSnapshot($snapshot); + + return $this->performRequest($endpoint); + } + /** + * $params['repository'] = (string) A repository name + * $params['master_timeout'] = (time) Explicit operation timeout for connection to master node + * $params['timeout'] = (time) Explicit operation timeout + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html + */ + public function verifyRepository(array $params = []) + { + $repository = $this->extractArgument($params, 'repository'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Snapshot\VerifyRepository'); + $endpoint->setParams($params); + $endpoint->setRepository($repository); + + return $this->performRequest($endpoint); + } +} diff --git a/util/output/7.6.1/Namespaces/SqlNamespace.php b/util/output/7.6.1/Namespaces/SqlNamespace.php new file mode 100644 index 000000000..927a2c521 --- /dev/null +++ b/util/output/7.6.1/Namespaces/SqlNamespace.php @@ -0,0 +1,69 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class SqlNamespace extends AbstractNamespace +{ + + public function clearCursor(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Sql\ClearCursor'); + $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['body'] = (array) Use the `query` element to start a query. Use the `cursor` element to continue a query. (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see Execute SQL + */ + public function query(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Sql\Query'); + $endpoint->setParams($params); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['body'] = (array) Specify the query in the `query` element. (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see Translate SQL into Elasticsearch queries + */ + public function translate(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Sql\Translate'); + $endpoint->setParams($params); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } +} diff --git a/util/output/7.6.1/Namespaces/SslNamespace.php b/util/output/7.6.1/Namespaces/SslNamespace.php new file mode 100644 index 000000000..89715c3ca --- /dev/null +++ b/util/output/7.6.1/Namespaces/SslNamespace.php @@ -0,0 +1,36 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class SslNamespace extends AbstractNamespace +{ + + /** + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-ssl.html + */ + public function certificates(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Ssl\Certificates'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } +} diff --git a/util/output/7.6.1/Namespaces/TasksNamespace.php b/util/output/7.6.1/Namespaces/TasksNamespace.php new file mode 100644 index 000000000..7da91987f --- /dev/null +++ b/util/output/7.6.1/Namespaces/TasksNamespace.php @@ -0,0 +1,91 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +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. + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html + */ + public function cancel(array $params = []) + { + $task_id = $this->extractArgument($params, 'task_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Tasks\Cancel'); + $endpoint->setParams($params); + $endpoint->setTaskId($task_id); + + 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 + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html + */ + public function get(array $params = []) + { + $task_id = $this->extractArgument($params, 'task_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Tasks\Get'); + $endpoint->setParams($params); + $endpoint->setTaskId($task_id); + + 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 + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html + */ + public function list(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Tasks\ListTasks'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * Proxy function to list() to prevent BC break since 7.4.0 + */ + public function tasksList(array $params = []) + { + return $this->list($params); + } +} diff --git a/util/output/7.6.1/Namespaces/TransformNamespace.php b/util/output/7.6.1/Namespaces/TransformNamespace.php new file mode 100644 index 000000000..91a600338 --- /dev/null +++ b/util/output/7.6.1/Namespaces/TransformNamespace.php @@ -0,0 +1,200 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class TransformNamespace extends AbstractNamespace +{ + + /** + * $params['transform_id'] = (string) The id of the transform to delete + * $params['force'] = (boolean) When `true`, the transform is deleted regardless of its current state. The default value is `false`, meaning that the transform must be `stopped` before it can be deleted. + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-transform.html + * + * @note This API is BETA and may change in ways that are not backwards compatible + * + */ + public function deleteTransform(array $params = []) + { + $transform_id = $this->extractArgument($params, 'transform_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Transform\DeleteTransform'); + $endpoint->setParams($params); + $endpoint->setTransformId($transform_id); + + return $this->performRequest($endpoint); + } + /** + * $params['transform_id'] = (string) The id or comma delimited list of id expressions of the transforms to get, '_all' or '*' implies get 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) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform.html + * + * @note This API is BETA and may change in ways that are not backwards compatible + * + */ + public function getTransform(array $params = []) + { + $transform_id = $this->extractArgument($params, 'transform_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Transform\GetTransform'); + $endpoint->setParams($params); + $endpoint->setTransformId($transform_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'] = (number) skips a number of transform stats, defaults to 0 + * $params['size'] = (number) specifies a max number of transform stats 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) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform-stats.html + * + * @note This API is BETA and may change in ways that are not backwards compatible + * + */ + public function getTransformStats(array $params = []) + { + $transform_id = $this->extractArgument($params, 'transform_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Transform\GetTransformStats'); + $endpoint->setParams($params); + $endpoint->setTransformId($transform_id); + + return $this->performRequest($endpoint); + } + public function previewTransform(array $params = []) + { + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Transform\PreviewTransform'); + $endpoint->setParams($params); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['transform_id'] = (string) The id of the new transform. + * $params['defer_validation'] = (boolean) If validations should be deferred until transform starts, defaults to false. + * $params['body'] = (array) The transform definition (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-transform.html + * + * @note This API is BETA and may change in ways that are not backwards compatible + * + */ + public function putTransform(array $params = []) + { + $transform_id = $this->extractArgument($params, 'transform_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Transform\PutTransform'); + $endpoint->setParams($params); + $endpoint->setTransformId($transform_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['transform_id'] = (string) The id of the transform to start + * $params['timeout'] = (time) Controls the time to wait for the transform to start + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/start-transform.html + * + * @note This API is BETA and may change in ways that are not backwards compatible + * + */ + public function startTransform(array $params = []) + { + $transform_id = $this->extractArgument($params, 'transform_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Transform\StartTransform'); + $endpoint->setParams($params); + $endpoint->setTransformId($transform_id); + + return $this->performRequest($endpoint); + } + /** + * $params['transform_id'] = (string) The id of the transform to stop + * $params['force'] = (boolean) Whether to force stop a failed transform or not. Default to false + * $params['wait_for_completion'] = (boolean) Whether to wait for the transform to fully stop before returning or not. Default to false + * $params['timeout'] = (time) Controls the time to wait until the transform has stopped. Default to 30 seconds + * $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['wait_for_checkpoint'] = (boolean) Whether to wait for the transform to reach a checkpoint before stopping. Default to false + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-transform.html + * + * @note This API is BETA and may change in ways that are not backwards compatible + * + */ + public function stopTransform(array $params = []) + { + $transform_id = $this->extractArgument($params, 'transform_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Transform\StopTransform'); + $endpoint->setParams($params); + $endpoint->setTransformId($transform_id); + + return $this->performRequest($endpoint); + } + /** + * $params['transform_id'] = (string) The id of the transform. + * $params['defer_validation'] = (boolean) If validations should be deferred until transform starts, defaults to false. + * $params['body'] = (array) The update transform definition (Required) + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-transform.html + * + * @note This API is BETA and may change in ways that are not backwards compatible + * + */ + public function updateTransform(array $params = []) + { + $transform_id = $this->extractArgument($params, 'transform_id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Transform\UpdateTransform'); + $endpoint->setParams($params); + $endpoint->setTransformId($transform_id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } +} diff --git a/util/output/7.6.1/Namespaces/WatcherNamespace.php b/util/output/7.6.1/Namespaces/WatcherNamespace.php new file mode 100644 index 000000000..e8abdf694 --- /dev/null +++ b/util/output/7.6.1/Namespaces/WatcherNamespace.php @@ -0,0 +1,210 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class WatcherNamespace extends AbstractNamespace +{ + + /** + * $params['watch_id'] = (string) Watch ID (Required) + * $params['action_id'] = (list) A comma-separated list of the action ids to be acked + * + * @param array $params Associative array of parameters + * @return array + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-ack-watch.html + */ + public function ackWatch(array $params = []) + { + $watch_id = $this->extractArgument($params, 'watch_id'); + $action_id = $this->extractArgument($params, 'action_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Watcher\AckWatch'); + $endpoint->setParams($params); + $endpoint->setWatchId($watch_id); + $endpoint->setActionId($action_id); + + return $this->performRequest($endpoint); + } + /** + * $params['watch_id'] = (string) Watch ID + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-activate-watch.html + */ + public function activateWatch(array $params = []) + { + $watch_id = $this->extractArgument($params, 'watch_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Watcher\ActivateWatch'); + $endpoint->setParams($params); + $endpoint->setWatchId($watch_id); + + return $this->performRequest($endpoint); + } + /** + * $params['watch_id'] = (string) Watch ID + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-deactivate-watch.html + */ + public function deactivateWatch(array $params = []) + { + $watch_id = $this->extractArgument($params, 'watch_id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Watcher\DeactivateWatch'); + $endpoint->setParams($params); + $endpoint->setWatchId($watch_id); + + return $this->performRequest($endpoint); + } + /** + * $params['id'] = (string) Watch ID + * + * @param array $params Associative array of parameters + * @return array + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-delete-watch.html + */ + public function deleteWatch(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Watcher\DeleteWatch'); + $endpoint->setParams($params); + $endpoint->setId($id); + + return $this->performRequest($endpoint); + } + /** + * $params['id'] = (string) Watch ID + * $params['debug'] = (boolean) indicates whether the watch should execute in debug mode + * $params['body'] = (array) Execution control + * + * @param array $params Associative array of parameters + * @return array + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-execute-watch.html + */ + public function executeWatch(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Watcher\ExecuteWatch'); + $endpoint->setParams($params); + $endpoint->setId($id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * $params['id'] = (string) Watch ID + * + * @param array $params Associative array of parameters + * @return array + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-get-watch.html + */ + public function getWatch(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Watcher\GetWatch'); + $endpoint->setParams($params); + $endpoint->setId($id); + + return $this->performRequest($endpoint); + } + /** + * $params['id'] = (string) Watch ID + * $params['active'] = (boolean) Specify whether the watch is in/active by default + * $params['version'] = (number) Explicit version number for concurrency control + * $params['if_seq_no'] = (number) only update the watch if the last operation that has changed the watch has the specified sequence number + * $params['if_primary_term'] = (number) only update the watch if the last operation that has changed the watch has the specified primary term + * $params['body'] = (array) The watch + * + * @param array $params Associative array of parameters + * @return array + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-put-watch.html + */ + public function putWatch(array $params = []) + { + $id = $this->extractArgument($params, 'id'); + $body = $this->extractArgument($params, 'body'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Watcher\PutWatch'); + $endpoint->setParams($params); + $endpoint->setId($id); + $endpoint->setBody($body); + + return $this->performRequest($endpoint); + } + /** + * + * @param array $params Associative array of parameters + * @return array + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-start.html + */ + public function start(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Watcher\Start'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * $params['metric'] = (list) Controls what additional stat metrics should be include in the response + * $params['emit_stacktraces'] = (boolean) Emits stack traces of currently running watches + * + * @param array $params Associative array of parameters + * @return array + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stats.html + */ + public function stats(array $params = []) + { + $metric = $this->extractArgument($params, 'metric'); + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Watcher\Stats'); + $endpoint->setParams($params); + $endpoint->setMetric($metric); + + return $this->performRequest($endpoint); + } + /** + * + * @param array $params Associative array of parameters + * @return array + * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stop.html + */ + public function stop(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Watcher\Stop'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } +} diff --git a/util/output/7.6.1/Namespaces/XpackNamespace.php b/util/output/7.6.1/Namespaces/XpackNamespace.php new file mode 100644 index 000000000..9c4299e9d --- /dev/null +++ b/util/output/7.6.1/Namespaces/XpackNamespace.php @@ -0,0 +1,53 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 + * @link http://elastic.co + */ +class XpackNamespace extends AbstractNamespace +{ + + /** + * $params['categories'] = (list) Comma-separated list of info categories. Can be any of: build, license, features + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/info-api.html + */ + public function info(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Xpack\Info'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } + /** + * $params['master_timeout'] = (time) Specify timeout for watch write operation + * + * @param array $params Associative array of parameters + * @return array + * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/usage-api.html + */ + public function usage(array $params = []) + { + + $endpointBuilder = $this->endpoints; + $endpoint = $endpointBuilder('Xpack\Usage'); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } +} diff --git a/util/template/client-class b/util/template/client-class index be8335726..3d6863720 100644 --- a/util/template/client-class +++ b/util/template/client-class @@ -16,6 +16,7 @@ use Elasticsearch\Namespaces\BooleanRequestWrapper; :use-namespaces /** * Class Client + * Generated running $ php util/GenerateEndpoints.php :version * * @category Elasticsearch * @package Elasticsearch diff --git a/util/template/endpoint-bulk-class b/util/template/endpoint-bulk-class index 457e62e6e..08b334f86 100644 --- a/util/template/endpoint-bulk-class +++ b/util/template/endpoint-bulk-class @@ -2,8 +2,7 @@ declare(strict_types = 1); namespace Elasticsearch\Endpoints:namespace; - -use Elasticsearch\Common\Exceptions\InvalidArgumentException; +:use-namespace use Elasticsearch\Endpoints\AbstractEndpoint; use Elasticsearch\Serializers\SerializerInterface; use Traversable; @@ -21,6 +20,7 @@ use Traversable; */ class :endpoint extends AbstractEndpoint { +:properties public function __construct(SerializerInterface $serializer) { $this->serializer = $serializer;