From 92c4b3e74187b64d9ee25f8409af060b506f9b2e Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Tue, 5 Dec 2023 03:22:57 +1300 Subject: [PATCH] [Backport 1.x] Re-add ApiGenerator (#460) * Revert "Remove ApiGenerator (#156)" (#222) * Revert "Remove ApiGenerator (#156)" This reverts commit 7db02e979b19c748879b74485f04f6c352a0d967. Signed-off-by: Thomas Farr * Update packages.lock.json Signed-off-by: Thomas Farr --------- Signed-off-by: Thomas Farr * Bump Spectre.Console from 0.30.0 to 0.47.0 (#227) Signed-off-by: Thomas Farr * Implement parsing OpenAPI to internal model (#228) Signed-off-by: Thomas Farr * Bump Newtonsoft.Json from 13.0.1 to 13.0.3 (#232) * Bump Newtonsoft.Json from 13.0.1 to 13.0.3 Bumps [Newtonsoft.Json](https://github.com/JamesNK/Newtonsoft.Json) from 13.0.1 to 13.0.3. - [Release notes](https://github.com/JamesNK/Newtonsoft.Json/releases) - [Commits](https://github.com/JamesNK/Newtonsoft.Json/compare/13.0.1...13.0.3) --- updated-dependencies: - dependency-name: Newtonsoft.Json dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Update changelog & packages.lock.json Signed-off-by: dependabot[bot] --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] * Upgrade RazorLight and use embedded resource project (#233) Signed-off-by: Thomas Farr * Remove support for the `net461` target (#256) * Remove support for the `net461` target Signed-off-by: Thomas Farr * Add changelog entry Signed-off-by: Thomas Farr --------- Signed-off-by: Thomas Farr * Bump Microsoft.CodeAnalysis.CSharp from 4.2.0 to 4.6.0 (#270) * Bump Microsoft.CodeAnalysis.CSharp from 4.2.0 to 4.6.0 Bumps [Microsoft.CodeAnalysis.CSharp](https://github.com/dotnet/roslyn) from 4.2.0 to 4.6.0. - [Release notes](https://github.com/dotnet/roslyn/releases) - [Changelog](https://github.com/dotnet/roslyn/blob/main/docs/Breaking%20API%20Changes.md) - [Commits](https://github.com/dotnet/roslyn/commits) --- updated-dependencies: - dependency-name: Microsoft.CodeAnalysis.CSharp dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Update changelog & packages.lock.json Signed-off-by: dependabot[bot] --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] * Remove packages.lock.json & fix CI caching (#265) * Remove packages.lock.json & remove redundant caching Signed-off-by: Thomas Farr * Re-add caching Signed-off-by: Thomas Farr * Include all proj files in caching Signed-off-by: Thomas Farr --------- Signed-off-by: Thomas Farr * Add ability to generate only a subset of operations (#278) Signed-off-by: Thomas Farr * Clean up old rest specification files (#319) Signed-off-by: Thomas Farr * Re-generate tasks namespace (#320) Signed-off-by: Thomas Farr * Bump NSwag.Core.Yaml from 13.19.0 to 13.20.0 (#336) * Bump NSwag.Core.Yaml from 13.19.0 to 13.20.0 Bumps [NSwag.Core.Yaml](https://github.com/RicoSuter/NSwag) from 13.19.0 to 13.20.0. - [Release notes](https://github.com/RicoSuter/NSwag/releases) - [Changelog](https://github.com/RicoSuter/NSwag/blob/master/CHANGELOG.md) - [Commits](https://github.com/RicoSuter/NSwag/compare/v13.19.0...v13.20.0) --- updated-dependencies: - dependency-name: NSwag.Core.Yaml dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Update changelog Signed-off-by: dependabot[bot] --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] * Re-generate `dangling_indices` namespace (#333) * Correct handling of deprecated parameters Signed-off-by: Thomas Farr * Re-generate `dangling_indices` namespace Signed-off-by: Thomas Farr * Add remarks about when cluster_manager_timeout is supported Signed-off-by: Thomas Farr * Delete missed old file Signed-off-by: Thomas Farr --------- Signed-off-by: Thomas Farr * Re-generate `ingest` namespace (#340) Signed-off-by: Thomas Farr * Re-generate `snapshot` namespace (#351) Signed-off-by: Thomas Farr * Re-generate `nodes` namespace (#352) * Use specification naming for enums Signed-off-by: Thomas Farr * Handle deprecated paths Signed-off-by: Thomas Farr * Re-generate `nodes.hot_threads` Signed-off-by: Thomas Farr * Handle overloaded param Signed-off-by: Thomas Farr * Better sorting Signed-off-by: Thomas Farr * Re-generate `nodes.info` Signed-off-by: Thomas Farr * Re-generate `nodes.reload_secure_settings` Signed-off-by: Thomas Farr * Sort URL parts Signed-off-by: Thomas Farr * Re-generate `nodes.stats` Signed-off-by: Thomas Farr * Correctly handle URL part enum options Signed-off-by: Thomas Farr * Make ApiUrls readonly Signed-off-by: Thomas Farr * Re-generate `nodes.usage` Signed-off-by: Thomas Farr --------- Signed-off-by: Thomas Farr * Re-generate `cluster` namespace (part 1) (#356) * Re-generate `cluster.allocation_explain` Signed-off-by: Thomas Farr * Re-generate `cluster.delete_component_template` Signed-off-by: Thomas Farr * Re-generate `cluster.delete_voting_config_exclusions` Signed-off-by: Thomas Farr * Re-generate `cluster.exists_component_template` Signed-off-by: Thomas Farr * Re-generate `cluster.get_component_template` Signed-off-by: Thomas Farr * Re-generate `cluster.get_settings` Signed-off-by: Thomas Farr * Re-generate `cluster.health` Signed-off-by: Thomas Farr * Re-generate `cluster.pending_tasks` Signed-off-by: Thomas Farr --------- Signed-off-by: Thomas Farr * Support deprecation and added versions for API methods in ApiGenerator (#402) * Handle generating deprecation notices on high-level API methods Signed-off-by: Thomas Farr * Improve formatting Signed-off-by: Thomas Farr * Better URL path handling and support x-version-added on APIs Signed-off-by: Thomas Farr * Re-generate Signed-off-by: Thomas Farr --------- Signed-off-by: Thomas Farr * Add support for Point In Time APIs (#405) * Add `CreatePit` & `DeletePit` methods Signed-off-by: Thomas Farr * Add `DeleteAllPits` and `GetAllPits` methods Signed-off-by: Thomas Farr * Add PIT search support Signed-off-by: Thomas Farr * Add integration tests Signed-off-by: Thomas Farr * Add docs Signed-off-by: Thomas Farr * Add changelog entry Signed-off-by: Thomas Farr * Correct Signed-off-by: Thomas Farr * Fix changelog typo Signed-off-by: Thomas Farr * Add tests for CreatePit Signed-off-by: Thomas Farr * Add tests for DeletePit Signed-off-by: Thomas Farr * Fixing tests Signed-off-by: Thomas Farr * Cleanup Signed-off-by: Thomas Farr * Add tests for GetAllPits & DeleteAllPits Signed-off-by: Thomas Farr * PitSearch tests Signed-off-by: Thomas Farr * call isolated Signed-off-by: Thomas Farr * writable cluster Signed-off-by: Thomas Farr --------- Signed-off-by: Thomas Farr * Revert breaking namespace changes (#425) Reverts #200, #202, #203, #205, #206, #207, #208, #209 Signed-off-by: Thomas Farr * Bump CSharpier.Core from 0.25.0 to 0.26.1 (#430) * Bump CSharpier.Core from 0.25.0 to 0.26.1 Bumps [CSharpier.Core](https://github.com/belav/csharpier) from 0.25.0 to 0.26.1. - [Release notes](https://github.com/belav/csharpier/releases) - [Changelog](https://github.com/belav/csharpier/blob/main/CHANGELOG.md) - [Commits](https://github.com/belav/csharpier/compare/0.25.0...0.26.1) --- updated-dependencies: - dependency-name: CSharpier.Core dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Update changelog Signed-off-by: dependabot[bot] --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] * Add support for component template APIs (#411) * Generate `cluster.put_component_template` Signed-off-by: Thomas Farr * Implement high-level DeleteComponentTemplate Signed-off-by: Thomas Farr * Implement high-level ComponentTemplateExists Signed-off-by: Thomas Farr * Fix license Signed-off-by: Thomas Farr * Remove old put_component_template Signed-off-by: Thomas Farr * Implement high-level GetComponentTemplate Signed-off-by: Thomas Farr * Add tests for ComponentTemplateExists Signed-off-by: Thomas Farr * Add tests for DeleteComponentTemplate Signed-off-by: Thomas Farr * Add tests for GetComponentTemplate Signed-off-by: Thomas Farr * Implement high-level PutComponentTemplate Signed-off-by: Thomas Farr * Add component template CRUD tests Signed-off-by: Thomas Farr * Add naming convention exception for ComponentTemplateExists Signed-off-by: Thomas Farr * Update guide Signed-off-by: Thomas Farr * Formatting Signed-off-by: Thomas Farr * Add changelog entry Signed-off-by: Thomas Farr * Fix license header Signed-off-by: Thomas Farr * Fix namespaces Signed-off-by: Thomas Farr * Fix license header Signed-off-by: Thomas Farr --------- Signed-off-by: Thomas Farr * Add support for composable index templates (#437) * Allow renaming URL path parts in generator Signed-off-by: Thomas Farr * Generate {delete,exists,get,put}_index_template as *ComposableTemplate Signed-off-by: Thomas Farr * Add resp/req bodies for *ComposableIndexTemplate Signed-off-by: Thomas Farr * Fix tests Signed-off-by: Thomas Farr * Add ComposableIndexTemplateCrudTests Signed-off-by: Thomas Farr * Add ComposableIndexTemplateExists tests Signed-off-by: Thomas Farr * Add DeleteComposableIndexTemplate tests Signed-off-by: Thomas Farr * Add GetComposableIndexTemplate tests Signed-off-by: Thomas Farr * Add PutComposableIndexTemplate tests Signed-off-by: Thomas Farr * Non-overlapping templates Signed-off-by: Thomas Farr * Fix tests Signed-off-by: Thomas Farr * Test data_stream template mapping serialization Signed-off-by: Thomas Farr * Update guide and add sample Signed-off-by: Thomas Farr * Add changelog entry Signed-off-by: Thomas Farr * Tidy generated code Signed-off-by: Thomas Farr * Review feedback Signed-off-by: Thomas Farr --------- Signed-off-by: Thomas Farr * Re-generate `cluster` namespace (part 2) (#385) * Re-generate `cluster.post_voting_config_exclusions` Signed-off-by: Thomas Farr * Re-generate `cluster.put_settings` Signed-off-by: Thomas Farr * Re-generate `cluster.remote_info` Signed-off-by: Thomas Farr * Re-generate `cluster.reroute` Signed-off-by: Thomas Farr * Re-generate `cluster.state` Signed-off-by: Thomas Farr * Re-generate `cluster.stats` Signed-off-by: Thomas Farr * Generate missing cluster weighted routing & decommission awareness operations Signed-off-by: Thomas Farr --------- Signed-off-by: Thomas Farr * Bump Spectre.Console from 0.47.0 to 0.48.0 (#450) * Bump Spectre.Console from 0.47.0 to 0.48.0 Bumps [Spectre.Console](https://github.com/spectreconsole/spectre.console) from 0.47.0 to 0.48.0. - [Release notes](https://github.com/spectreconsole/spectre.console/releases) - [Commits](https://github.com/spectreconsole/spectre.console/compare/0.47.0...0.48.0) --- updated-dependencies: - dependency-name: Spectre.Console dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Update changelog Signed-off-by: dependabot[bot] --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] * Bump CSharpier.Core from 0.26.1 to 0.26.3 (#448) * Bump CSharpier.Core from 0.26.1 to 0.26.3 Bumps [CSharpier.Core](https://github.com/belav/csharpier) from 0.26.1 to 0.26.3. - [Release notes](https://github.com/belav/csharpier/releases) - [Changelog](https://github.com/belav/csharpier/blob/main/CHANGELOG.md) - [Commits](https://github.com/belav/csharpier/compare/0.26.1...0.26.3) --- updated-dependencies: - dependency-name: CSharpier.Core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Update changelog Signed-off-by: dependabot[bot] --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] * Add higher-level HTTP DSL methods (#447) * Lay foundations Signed-off-by: Thomas Farr * Implement generation Signed-off-by: Thomas Farr * Run generator Signed-off-by: Thomas Farr * Update samples Signed-off-by: Thomas Farr * Update guide Signed-off-by: Thomas Farr * Add changelog entry Signed-off-by: Thomas Farr * PR comments Signed-off-by: Thomas Farr * Fix naming tests Signed-off-by: Thomas Farr * Why is the ordering of these statements load-bearing??? Signed-off-by: Thomas Farr --------- Signed-off-by: Thomas Farr --------- Signed-off-by: Thomas Farr Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] --- OpenSearch.sln | 7 + build/scripts/Commandline.fs | 3 + build/scripts/ReposTooling.fs | 8 + build/scripts/Targets.fs | 3 + src/ApiGenerator/ApiGenerator.csproj | 26 + src/ApiGenerator/CodeTemplatePage.cs | 42 + .../Configuration/CodeConfiguration.cs | 228 + .../Configuration/GeneratorLocations.cs | 74 + .../Overrides/EndpointOverridesBase.cs | 46 + .../Endpoints/DeleteByQueryOverrides.cs | 37 + .../Overrides/Endpoints/FlushJobOverrides.cs | 43 + .../Endpoints/ForecastJobOverrides.cs | 41 + .../Endpoints/GetAnomalyRecordsOverrides.cs | 47 + .../Endpoints/GetBucketsOverrides.cs | 49 + .../Endpoints/GetCalendarEventsOverrides.cs | 41 + .../Endpoints/GetCalendarsOverrides.cs | 41 + .../Endpoints/GetCategoriesOverrides.cs | 41 + .../Endpoints/GetInfluencersOverrides.cs | 47 + .../Endpoints/GetModelSnapshotsOverrides.cs | 45 + .../Endpoints/GetOverallBucketsOverrides.cs | 46 + .../Endpoints/IndicesStatsOverrides.cs | 41 + .../Endpoints/MultiTermVectorsOverrides.cs | 41 + .../Endpoints/PutIndexTemplateOverrides.cs | 41 + .../Endpoints/ReindexOnServerOverrides.cs | 37 + .../Endpoints/RevertModelSnapshotOverrides.cs | 40 + .../Overrides/Endpoints/ScrollOverrides.cs | 41 + .../Overrides/Endpoints/SearchOverrides.cs | 56 + .../Endpoints/UpdateByQueryOverrides.cs | 37 + .../Overrides/Endpoints/UpdateOverrides.cs | 42 + .../Overrides/GlobalOverrides.cs | 80 + .../Overrides/IEndpointOverrides.cs | 65 + .../Configuration/ViewLocations.cs | 37 + .../Domain/ApiRequestParametersPatcher.cs | 164 + src/ApiGenerator/Domain/Code/CsharpNames.cs | 207 + .../HighLevel/Methods/BoundFluentMethod.cs | 65 + .../Code/HighLevel/Methods/FluentMethod.cs | 47 + .../HighLevel/Methods/FluentSyntaxBase.cs | 166 + .../HighLevel/Methods/FluentSyntaxView.cs | 39 + .../Code/HighLevel/Methods/HighLevelModel.cs | 39 + .../HighLevel/Methods/InitializerMethod.cs | 75 + .../Methods/InitializerSyntaxView.cs | 40 + .../HighLevel/Methods/MethodSyntaxBase.cs | 59 + .../Code/HighLevel/Requests/Constructor.cs | 135 + .../DescriptorPartialImplementation.cs | 96 + .../HighLevel/Requests/FluentRouteSetter.cs | 36 + .../HighLevel/Requests/RequestInterface.cs | 56 + .../RequestParameterImplementation.cs | 41 + .../Requests/RequestPartialImplementation.cs | 55 + .../Code/LowLevel/LowLevelClientMethod.cs | 78 + src/ApiGenerator/Domain/RestApiSpec.cs | 102 + .../Domain/Specification/ApiEndpoint.cs | 221 + src/ApiGenerator/Domain/Specification/Body.cs | 36 + .../Domain/Specification/Deprecation.cs | 45 + .../Domain/Specification/Documentation.cs | 42 + .../Domain/Specification/QueryParameters.cs | 186 + .../Domain/Specification/Stability.cs | 53 + .../Domain/Specification/UrlInformation.cs | 72 + .../Domain/Specification/UrlPart.cs | 158 + .../Domain/Specification/UrlPath.cs | 97 + src/ApiGenerator/Extensions.cs | 78 + .../Generator/ApiEndpointFactory.cs | 284 + src/ApiGenerator/Generator/ApiGenerator.cs | 116 + src/ApiGenerator/Generator/CodeGenerator.cs | 122 + .../Razor/ApiUrlsLookupsGenerator.cs | 49 + .../Generator/Razor/DescriptorsGenerator.cs | 64 + .../Generator/Razor/EnumsGenerator.cs | 49 + .../HighLevelClientImplementationGenerator.cs | 67 + .../HighLevelClientInterfaceGenerator.cs | 49 + .../LowLevelClientImplementationGenerator.cs | 65 + .../Razor/LowLevelClientInterfaceGenerator.cs | 49 + .../Generator/Razor/RazorGeneratorBase.cs | 99 + .../Razor/RequestParametersGenerator.cs | 62 + .../Generator/Razor/RequestsGenerator.cs | 68 + src/ApiGenerator/OpenSearch.openapi.json | 32606 ++++++++++++++++ src/ApiGenerator/Program.cs | 184 + src/ApiGenerator/RestSpecDownloader.cs | 51 + src/ApiGenerator/Views/GeneratorNotice.cshtml | 47 + .../Client/FluentSyntax/FluentMethod.cshtml | 18 + .../FluentSyntax/FluentMethodHeader.cshtml | 14 + .../MethodImplementation.cshtml | 19 + .../OpenSearchClient.Namespace.cshtml | 35 + .../Implementation/OpenSearchClient.cshtml | 59 + .../InitializerMethod.cshtml | 20 + .../InitializerMethodHeader.cshtml | 15 + .../Client/Interface/IOpenSearchClient.cshtml | 44 + .../Client/Interface/MethodInterface.cshtml | 29 + .../HighLevel/Client/MethodXmlDocs.cshtml | 18 + .../Views/HighLevel/Client/Usings.cshtml | 14 + .../HighLevel/Descriptors/Descriptor.cshtml | 86 + .../HighLevel/Descriptors/Descriptors.cshtml | 36 + .../Descriptors/RequestDescriptorBase.cshtml | 12 + .../HighLevel/Descriptors/XmlDocs.cshtml | 24 + .../HighLevel/Requests/ApiUrlsLookup.cshtml | 24 + .../Requests/PlainRequestBase.cshtml | 21 + .../Requests/RequestImplementations.cshtml | 82 + .../Requests/RequestInterface.cshtml | 25 + .../Views/HighLevel/Requests/Requests.cshtml | 37 + .../OpenSearchLowLevelClient.Namespace.cshtml | 49 + .../OpenSearchLowLevelClient.cshtml | 63 + .../IOpenSearchLowLevelClient.cshtml | 47 + .../LowLevel/Client/Methods/MethodDocs.cshtml | 39 + .../Methods/MethodImplementation.cshtml | 13 + .../Client/Methods/MethodInterface.cshtml | 7 + .../Views/LowLevel/Client/Usings.cshtml | 14 + src/ApiGenerator/Views/LowLevel/Enums.cshtml | 122 + .../RequestParameters.cshtml | 40 + 106 files changed, 39018 insertions(+) create mode 100644 src/ApiGenerator/ApiGenerator.csproj create mode 100644 src/ApiGenerator/CodeTemplatePage.cs create mode 100644 src/ApiGenerator/Configuration/CodeConfiguration.cs create mode 100644 src/ApiGenerator/Configuration/GeneratorLocations.cs create mode 100644 src/ApiGenerator/Configuration/Overrides/EndpointOverridesBase.cs create mode 100644 src/ApiGenerator/Configuration/Overrides/Endpoints/DeleteByQueryOverrides.cs create mode 100644 src/ApiGenerator/Configuration/Overrides/Endpoints/FlushJobOverrides.cs create mode 100644 src/ApiGenerator/Configuration/Overrides/Endpoints/ForecastJobOverrides.cs create mode 100644 src/ApiGenerator/Configuration/Overrides/Endpoints/GetAnomalyRecordsOverrides.cs create mode 100644 src/ApiGenerator/Configuration/Overrides/Endpoints/GetBucketsOverrides.cs create mode 100644 src/ApiGenerator/Configuration/Overrides/Endpoints/GetCalendarEventsOverrides.cs create mode 100644 src/ApiGenerator/Configuration/Overrides/Endpoints/GetCalendarsOverrides.cs create mode 100644 src/ApiGenerator/Configuration/Overrides/Endpoints/GetCategoriesOverrides.cs create mode 100644 src/ApiGenerator/Configuration/Overrides/Endpoints/GetInfluencersOverrides.cs create mode 100644 src/ApiGenerator/Configuration/Overrides/Endpoints/GetModelSnapshotsOverrides.cs create mode 100644 src/ApiGenerator/Configuration/Overrides/Endpoints/GetOverallBucketsOverrides.cs create mode 100644 src/ApiGenerator/Configuration/Overrides/Endpoints/IndicesStatsOverrides.cs create mode 100644 src/ApiGenerator/Configuration/Overrides/Endpoints/MultiTermVectorsOverrides.cs create mode 100644 src/ApiGenerator/Configuration/Overrides/Endpoints/PutIndexTemplateOverrides.cs create mode 100644 src/ApiGenerator/Configuration/Overrides/Endpoints/ReindexOnServerOverrides.cs create mode 100644 src/ApiGenerator/Configuration/Overrides/Endpoints/RevertModelSnapshotOverrides.cs create mode 100644 src/ApiGenerator/Configuration/Overrides/Endpoints/ScrollOverrides.cs create mode 100644 src/ApiGenerator/Configuration/Overrides/Endpoints/SearchOverrides.cs create mode 100644 src/ApiGenerator/Configuration/Overrides/Endpoints/UpdateByQueryOverrides.cs create mode 100644 src/ApiGenerator/Configuration/Overrides/Endpoints/UpdateOverrides.cs create mode 100644 src/ApiGenerator/Configuration/Overrides/GlobalOverrides.cs create mode 100644 src/ApiGenerator/Configuration/Overrides/IEndpointOverrides.cs create mode 100644 src/ApiGenerator/Configuration/ViewLocations.cs create mode 100644 src/ApiGenerator/Domain/ApiRequestParametersPatcher.cs create mode 100644 src/ApiGenerator/Domain/Code/CsharpNames.cs create mode 100644 src/ApiGenerator/Domain/Code/HighLevel/Methods/BoundFluentMethod.cs create mode 100644 src/ApiGenerator/Domain/Code/HighLevel/Methods/FluentMethod.cs create mode 100644 src/ApiGenerator/Domain/Code/HighLevel/Methods/FluentSyntaxBase.cs create mode 100644 src/ApiGenerator/Domain/Code/HighLevel/Methods/FluentSyntaxView.cs create mode 100644 src/ApiGenerator/Domain/Code/HighLevel/Methods/HighLevelModel.cs create mode 100644 src/ApiGenerator/Domain/Code/HighLevel/Methods/InitializerMethod.cs create mode 100644 src/ApiGenerator/Domain/Code/HighLevel/Methods/InitializerSyntaxView.cs create mode 100644 src/ApiGenerator/Domain/Code/HighLevel/Methods/MethodSyntaxBase.cs create mode 100644 src/ApiGenerator/Domain/Code/HighLevel/Requests/Constructor.cs create mode 100644 src/ApiGenerator/Domain/Code/HighLevel/Requests/DescriptorPartialImplementation.cs create mode 100644 src/ApiGenerator/Domain/Code/HighLevel/Requests/FluentRouteSetter.cs create mode 100644 src/ApiGenerator/Domain/Code/HighLevel/Requests/RequestInterface.cs create mode 100644 src/ApiGenerator/Domain/Code/HighLevel/Requests/RequestParameterImplementation.cs create mode 100644 src/ApiGenerator/Domain/Code/HighLevel/Requests/RequestPartialImplementation.cs create mode 100644 src/ApiGenerator/Domain/Code/LowLevel/LowLevelClientMethod.cs create mode 100644 src/ApiGenerator/Domain/RestApiSpec.cs create mode 100644 src/ApiGenerator/Domain/Specification/ApiEndpoint.cs create mode 100644 src/ApiGenerator/Domain/Specification/Body.cs create mode 100644 src/ApiGenerator/Domain/Specification/Deprecation.cs create mode 100644 src/ApiGenerator/Domain/Specification/Documentation.cs create mode 100644 src/ApiGenerator/Domain/Specification/QueryParameters.cs create mode 100644 src/ApiGenerator/Domain/Specification/Stability.cs create mode 100644 src/ApiGenerator/Domain/Specification/UrlInformation.cs create mode 100644 src/ApiGenerator/Domain/Specification/UrlPart.cs create mode 100644 src/ApiGenerator/Domain/Specification/UrlPath.cs create mode 100644 src/ApiGenerator/Extensions.cs create mode 100644 src/ApiGenerator/Generator/ApiEndpointFactory.cs create mode 100644 src/ApiGenerator/Generator/ApiGenerator.cs create mode 100644 src/ApiGenerator/Generator/CodeGenerator.cs create mode 100644 src/ApiGenerator/Generator/Razor/ApiUrlsLookupsGenerator.cs create mode 100644 src/ApiGenerator/Generator/Razor/DescriptorsGenerator.cs create mode 100644 src/ApiGenerator/Generator/Razor/EnumsGenerator.cs create mode 100644 src/ApiGenerator/Generator/Razor/HighLevelClientImplementationGenerator.cs create mode 100644 src/ApiGenerator/Generator/Razor/HighLevelClientInterfaceGenerator.cs create mode 100644 src/ApiGenerator/Generator/Razor/LowLevelClientImplementationGenerator.cs create mode 100644 src/ApiGenerator/Generator/Razor/LowLevelClientInterfaceGenerator.cs create mode 100644 src/ApiGenerator/Generator/Razor/RazorGeneratorBase.cs create mode 100644 src/ApiGenerator/Generator/Razor/RequestParametersGenerator.cs create mode 100644 src/ApiGenerator/Generator/Razor/RequestsGenerator.cs create mode 100644 src/ApiGenerator/OpenSearch.openapi.json create mode 100644 src/ApiGenerator/Program.cs create mode 100644 src/ApiGenerator/RestSpecDownloader.cs create mode 100644 src/ApiGenerator/Views/GeneratorNotice.cshtml create mode 100644 src/ApiGenerator/Views/HighLevel/Client/FluentSyntax/FluentMethod.cshtml create mode 100644 src/ApiGenerator/Views/HighLevel/Client/FluentSyntax/FluentMethodHeader.cshtml create mode 100644 src/ApiGenerator/Views/HighLevel/Client/Implementation/MethodImplementation.cshtml create mode 100644 src/ApiGenerator/Views/HighLevel/Client/Implementation/OpenSearchClient.Namespace.cshtml create mode 100644 src/ApiGenerator/Views/HighLevel/Client/Implementation/OpenSearchClient.cshtml create mode 100644 src/ApiGenerator/Views/HighLevel/Client/InitializerSyntax/InitializerMethod.cshtml create mode 100644 src/ApiGenerator/Views/HighLevel/Client/InitializerSyntax/InitializerMethodHeader.cshtml create mode 100644 src/ApiGenerator/Views/HighLevel/Client/Interface/IOpenSearchClient.cshtml create mode 100644 src/ApiGenerator/Views/HighLevel/Client/Interface/MethodInterface.cshtml create mode 100644 src/ApiGenerator/Views/HighLevel/Client/MethodXmlDocs.cshtml create mode 100644 src/ApiGenerator/Views/HighLevel/Client/Usings.cshtml create mode 100644 src/ApiGenerator/Views/HighLevel/Descriptors/Descriptor.cshtml create mode 100644 src/ApiGenerator/Views/HighLevel/Descriptors/Descriptors.cshtml create mode 100644 src/ApiGenerator/Views/HighLevel/Descriptors/RequestDescriptorBase.cshtml create mode 100644 src/ApiGenerator/Views/HighLevel/Descriptors/XmlDocs.cshtml create mode 100644 src/ApiGenerator/Views/HighLevel/Requests/ApiUrlsLookup.cshtml create mode 100644 src/ApiGenerator/Views/HighLevel/Requests/PlainRequestBase.cshtml create mode 100644 src/ApiGenerator/Views/HighLevel/Requests/RequestImplementations.cshtml create mode 100644 src/ApiGenerator/Views/HighLevel/Requests/RequestInterface.cshtml create mode 100644 src/ApiGenerator/Views/HighLevel/Requests/Requests.cshtml create mode 100644 src/ApiGenerator/Views/LowLevel/Client/Implementation/OpenSearchLowLevelClient.Namespace.cshtml create mode 100644 src/ApiGenerator/Views/LowLevel/Client/Implementation/OpenSearchLowLevelClient.cshtml create mode 100644 src/ApiGenerator/Views/LowLevel/Client/Interface/IOpenSearchLowLevelClient.cshtml create mode 100644 src/ApiGenerator/Views/LowLevel/Client/Methods/MethodDocs.cshtml create mode 100644 src/ApiGenerator/Views/LowLevel/Client/Methods/MethodImplementation.cshtml create mode 100644 src/ApiGenerator/Views/LowLevel/Client/Methods/MethodInterface.cshtml create mode 100644 src/ApiGenerator/Views/LowLevel/Client/Usings.cshtml create mode 100644 src/ApiGenerator/Views/LowLevel/Enums.cshtml create mode 100644 src/ApiGenerator/Views/LowLevel/RequestParameters/RequestParameters.cshtml diff --git a/OpenSearch.sln b/OpenSearch.sln index fe1794c95f..de0aba5da9 100644 --- a/OpenSearch.sln +++ b/OpenSearch.sln @@ -61,6 +61,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{3EA11364-051 src\_PublishArtifacts.Build.props = src\_PublishArtifacts.Build.props EndProjectSection EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ApiGenerator", "src\ApiGenerator\ApiGenerator.csproj", "{CA508E92-50AE-4858-BD94-8637E88A8FAC}" +EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSearch.Net.VirtualizedCluster", "src\OpenSearch.Net.VirtualizedCluster\OpenSearch.Net.VirtualizedCluster.csproj", "{CFE97627-8DD3-470B-B7CF-78B62E1D305D}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{29E53C13-34F7-4F0D-8D28-41EF768793E7}" @@ -124,6 +126,7 @@ Global {81473437-5722-4829-A5CD-125B17CCA238} = {6C4A2627-AF22-4388-9DF7-7A9AEACFD635} {E97CCF40-0BA6-43FE-9F2D-58D454134088} = {3EA11364-0513-44B7-AD6D-A675485E7448} {072BA7DA-7B60-407D-8B6E-95E3186BE70C} = {3EA11364-0513-44B7-AD6D-A675485E7448} + {CA508E92-50AE-4858-BD94-8637E88A8FAC} = {3EA11364-0513-44B7-AD6D-A675485E7448} {CFE97627-8DD3-470B-B7CF-78B62E1D305D} = {3EA11364-0513-44B7-AD6D-A675485E7448} {D6997ADC-E933-418E-831C-DE1A78897493} = {29E53C13-34F7-4F0D-8D28-41EF768793E7} {432D5575-2347-4D3C-BF8C-3E38410C46CA} = {29E53C13-34F7-4F0D-8D28-41EF768793E7} @@ -189,6 +192,10 @@ Global {81473437-5722-4829-A5CD-125B17CCA238}.Debug|Any CPU.Build.0 = Debug|Any CPU {81473437-5722-4829-A5CD-125B17CCA238}.Release|Any CPU.ActiveCfg = Release|Any CPU {81473437-5722-4829-A5CD-125B17CCA238}.Release|Any CPU.Build.0 = Release|Any CPU + {CA508E92-50AE-4858-BD94-8637E88A8FAC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CA508E92-50AE-4858-BD94-8637E88A8FAC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CA508E92-50AE-4858-BD94-8637E88A8FAC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CA508E92-50AE-4858-BD94-8637E88A8FAC}.Release|Any CPU.Build.0 = Release|Any CPU {CFE97627-8DD3-470B-B7CF-78B62E1D305D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {CFE97627-8DD3-470B-B7CF-78B62E1D305D}.Debug|Any CPU.Build.0 = Debug|Any CPU {CFE97627-8DD3-470B-B7CF-78B62E1D305D}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/build/scripts/Commandline.fs b/build/scripts/Commandline.fs index 72d32ef25d..23f7edf9b7 100644 --- a/build/scripts/Commandline.fs +++ b/build/scripts/Commandline.fs @@ -62,6 +62,8 @@ Targets: * benchmark [non-interactive] [url] [username] [password] - Runs a benchmark from Tests.Benchmarking and indexes the results to [url] when provided. If non-interactive runs all benchmarks without prompting +* codegen + - runs the code generator interactively NOTE: both the `test` and `integrate` targets can be suffixed with `-all` to force the tests against all suported TFM's @@ -193,6 +195,7 @@ Execution hints can be provided anywhere on the command line | ["clean"] | ["benchmark"] | ["profile"] -> parsed + | "codegen" :: tail -> { parsed with RemainingArguments = tail } | "rest-spec-tests" :: tail -> { parsed with RemainingArguments = tail } | ["release"; version] -> { parsed with CommandArguments = SetVersion { Version = version; OutputLocation = None }; } diff --git a/build/scripts/ReposTooling.fs b/build/scripts/ReposTooling.fs index edfb546426..cdd01f8cfe 100644 --- a/build/scripts/ReposTooling.fs +++ b/build/scripts/ReposTooling.fs @@ -52,6 +52,14 @@ module ReposTooling = Shell.deleteDir tempDir + let GenerateApi args = + //TODO allow branch name to be passed for CI + let folder = Path.getDirectory (Paths.ProjFile "ApiGenerator") + let timeout = TimeSpan.FromMinutes(120.) + // Building to make sure XML docs files are there, faster then relying on the ApiGenerator to emit these + // from a compilation unit + Tooling.DotNet.ExecInWithTimeout folder (["run"; "-c"; " Release"; "--" ] @ args) timeout |> ignore + let RestSpecTests args = let folder = Path.getDirectory (Paths.TestProjFile "Tests.YamlRunner") let timeout = TimeSpan.FromMinutes(120.) diff --git a/build/scripts/Targets.fs b/build/scripts/Targets.fs index 3dad848804..fc74f328b9 100644 --- a/build/scripts/Targets.fs +++ b/build/scripts/Targets.fs @@ -133,6 +133,9 @@ module Main = command "cluster" [ "restore"; "full-build" ] <| fun _ -> ReposTooling.LaunchCluster parsed + command "codegen" [ ] <| fun _ -> + ReposTooling.GenerateApi parsed.RemainingArguments + command "rest-spec-tests" [ ] <| fun _ -> ReposTooling.RestSpecTests parsed.RemainingArguments diff --git a/src/ApiGenerator/ApiGenerator.csproj b/src/ApiGenerator/ApiGenerator.csproj new file mode 100644 index 0000000000..fbf0fbab81 --- /dev/null +++ b/src/ApiGenerator/ApiGenerator.csproj @@ -0,0 +1,26 @@ + + + + Exe + net6.0 + false + + CS1591;NU1701 + true + + + + + + + + + + + + + + + + + diff --git a/src/ApiGenerator/CodeTemplatePage.cs b/src/ApiGenerator/CodeTemplatePage.cs new file mode 100644 index 0000000000..62e88b6de3 --- /dev/null +++ b/src/ApiGenerator/CodeTemplatePage.cs @@ -0,0 +1,42 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System.Threading.Tasks; +using RazorLight; + +namespace ApiGenerator; + +public abstract class CodeTemplatePage : TemplatePage +{ + protected new Task IncludeAsync(string key, object model = null) + => base.IncludeAsync(key.Replace('/', '.'), model); + + protected async Task IncludeLegacyGeneratorNotice() => await IncludeAsync("GeneratorNotice", true); + + protected async Task IncludeGeneratorNotice() => await IncludeAsync("GeneratorNotice", false); +} diff --git a/src/ApiGenerator/Configuration/CodeConfiguration.cs b/src/ApiGenerator/Configuration/CodeConfiguration.cs new file mode 100644 index 0000000000..b09c34bb95 --- /dev/null +++ b/src/ApiGenerator/Configuration/CodeConfiguration.cs @@ -0,0 +1,228 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text.RegularExpressions; +using GlobExpressions; + +namespace ApiGenerator.Configuration +{ + public static class CodeConfiguration + { + private static readonly Glob[] OperationsToInclude = + { + new("{create,delete}_pit"), + new("{delete,get}_all_pits"), + + new("cluster.*"), + new("dangling_indices.*"), + + new("indices.{delete,exists,get,put}_index_template"), + + new("ingest.*"), + new("nodes.*"), + new("snapshot.*"), + new("tasks.*") + }; + + public static bool IncludeOperation(string name) => OperationsToInclude.Any(g => g.IsMatch(name)); + + /// + /// Map API default names for API's we are only supporting on the low level client first + /// + private static readonly Dictionary LowLevelApiNameMapping = new() + { + }; + + /// + /// Scan all OSC source code files for Requests and look for the [MapsApi(filename)] attribute. + /// The class name minus Request is used as the canonical .NET name for the API. + /// + public static readonly Dictionary HighLevelApiNameMapping = + (from f in new DirectoryInfo(GeneratorLocations.OpenSearchClientFolder).GetFiles("*.cs", SearchOption.AllDirectories) + let contents = File.ReadAllText(f.FullName) + let c = Regex.Replace(contents, @"^.+\[MapsApi\(""([^ \r\n]+)""\)\].*$", "$1", RegexOptions.Singleline) + where !c.Contains(" ") //filter results that did not match + select new { Value = f.Name.Replace("Request", ""), Key = c.Replace(".json", "") }) + .DistinctBy(v => v.Key) + .ToDictionary(k => k.Key, v => v.Value.Replace(".cs", "")); + + public static readonly HashSet EnableHighLevelCodeGen = new HashSet(); + + public static bool IsNewHighLevelApi(string apiFileName) => + // no requests with [MapsApi("filename.json")] found + !HighLevelApiNameMapping.ContainsKey(apiFileName.Replace(".json", "")); + + public static bool IgnoreHighLevelApi(string apiFileName) + { + //always generate already mapped requests + + if (HighLevelApiNameMapping.ContainsKey(apiFileName.Replace(".json", ""))) return false; + + return !EnableHighLevelCodeGen.Contains(apiFileName); + } + + private static Dictionary _apiNameMapping; + + public static Dictionary ApiNameMapping + { + get + { + if (_apiNameMapping != null) return _apiNameMapping; + lock (LowLevelApiNameMapping) + { + if (_apiNameMapping == null) + { + var mapping = new Dictionary(HighLevelApiNameMapping); + foreach (var (k, v) in LowLevelApiNameMapping) + mapping[k] = v; + _apiNameMapping = mapping; + } + return _apiNameMapping; + } + } + } + + private static readonly string ResponseBuilderAttributeRegex = @"^.+\[ResponseBuilderWithGeneric\(""([^ \r\n]+)""\)\].*$"; + /// + /// Scan all OSC source code files for Requests and look for the [MapsApi(filename)] attribute. + /// The class name minus Request is used as the canonical .NET name for the API. + /// + public static readonly Dictionary ResponseBuilderInClientCalls = + (from f in new DirectoryInfo(GeneratorLocations.OpenSearchClientFolder).GetFiles("*.cs", SearchOption.AllDirectories) + from l in File.ReadLines(f.FullName) + where Regex.IsMatch(l, ResponseBuilderAttributeRegex) + let c = Regex.Replace(l, @"^.+\[ResponseBuilderWithGeneric\(""([^ \r\n]+)""\)\].*$", "$1", RegexOptions.Singleline) + select new { Key = f.Name.Replace(".cs", ""), Value = c }) + .DistinctBy(v => v.Key) + .ToDictionary(k => k.Key, v => v.Value); + + public static readonly Dictionary DescriptorGenericsLookup = + (from f in new DirectoryInfo(GeneratorLocations.OpenSearchClientFolder).GetFiles("*Request.cs", SearchOption.AllDirectories) + let name = Path.GetFileNameWithoutExtension(f.Name).Replace("Request", "") + let contents = File.ReadAllText(f.FullName) + let c = Regex.Replace(contents, $@"^.+class ({name}Descriptor(?:<[^>\r\n]+>)?[^ \r\n]*).*$", "$1", RegexOptions.Singleline) + let key = $"{name}Descriptor" + select new { Key = key, Value = Regex.Replace(c, @"^.*?(?:(\<.+>).*?)?$", "$1") }) + .DistinctBy(v => v.Key) + .OrderBy(v => v.Key) + .ToDictionary(k => k.Key, v => v.Value); + + /// Scan all OSC files for request interfaces and note any generics declared on them + private static readonly List> AllKnownRequestInterfaces = ( + // find all files in OSC ending with Request.cs + from f in new DirectoryInfo(GeneratorLocations.OpenSearchClientFolder).GetFiles("*Request.cs", SearchOption.AllDirectories) + from l in File.ReadLines(f.FullName) + // attempt to locate all Request interfaces lines + where Regex.IsMatch(l, @"^.+interface [^ \r\n]+Request") + //grab the interface name including any generics declared on it + let c = Regex.Replace(l, @"^.+interface ([^ \r\n]+Request(?:<[^>\r\n]+>)?[^ \r\n]*).*$", "$1", RegexOptions.Singleline) + where c.StartsWith("I") && c.Contains("Request") + let request = Regex.Replace(c, "<.*$", "") + let generics = Regex.Replace(c, @"^.*?(?:(\<.+>).*?)?$", "$1") + select Tuple.Create(request, generics) + ) + .OrderBy(v=>v.Item1) + .ToList(); + + public static readonly HashSet GenericOnlyInterfaces = new HashSet(AllKnownRequestInterfaces + .GroupBy(v => v.Item1) + .Where(g => g.All(v => !string.IsNullOrEmpty(v.Item2))) + .Select(g => g.Key) + .ToList()); + + public static readonly HashSet DocumentRequests = new HashSet(( + // find all files in OSC ending with Request.cs + from f in new DirectoryInfo(GeneratorLocations.OpenSearchClientFolder).GetFiles("*Request.cs", SearchOption.AllDirectories) + from l in File.ReadLines(f.FullName) + // attempt to locate all Request interfaces lines + where Regex.IsMatch(l, @"^.+interface [^ \r\n]+Request") + where l.Contains("IDocumentRequest") + let c = Regex.Replace(l, @"^.+interface ([^ \r\n]+Request(?:<[^>\r\n]+>)?[^ \r\n]*).*$", "$1", RegexOptions.Singleline) + //grab the interface name including any generics declared on it + let request = Regex.Replace(c, "<.*$", "") + select request + ) + .ToList()); + + public static readonly Dictionary DescriptorConstructors = ( + // find all files in OSC ending with Request.cs + from f in new DirectoryInfo(GeneratorLocations.OpenSearchClientFolder).GetFiles("*Request.cs", SearchOption.AllDirectories) + let descriptor = Path.GetFileNameWithoutExtension(f.Name).Replace("Request", "Descriptor") + let re = $@"^.+public {descriptor}\(([^\r\n\)]+?)\).*$" + from l in File.ReadLines(f.FullName) + where Regex.IsMatch(l, re) + let args = Regex.Replace(l, re, "$1", RegexOptions.Singleline) + where !string.IsNullOrWhiteSpace(args) && !args.Contains(": base") + select (Descriptor: descriptor, Args: args) + ) + .ToDictionary(r => r.Descriptor, r => r.Args); + + public static readonly Dictionary RequestInterfaceGenericsLookup = + AllKnownRequestInterfaces + .GroupBy(v=>v.Item1) + .Select(g=>g.Last()) + .ToDictionary(k => k.Item1, v => v.Item2); + + /// + /// Some API's reuse response this is a hardcoded map of these cases + /// + private static Dictionary ResponseReroute = new Dictionary + { + {"UpdateByQueryRethrottleResponse", ("ListTasksResponse", "")}, + {"DeleteByQueryRethrottleResponse", ("ListTasksResponse", "")}, + {"MultiSearchTemplateResponse", ("MultiSearchResponse", "")}, + {"ScrollResponse", ("SearchResponse", "")}, + {"SearchTemplateResponse", ("SearchResponse", "")}, + + }; + + + /// Create a dictionary lookup of all responses and their generics + public static readonly SortedDictionary ResponseLookup = new SortedDictionary( + ( + // find all files in OSC ending with Request.cs + from f in new DirectoryInfo(GeneratorLocations.OpenSearchClientFolder).GetFiles("*Response.cs", SearchOption.AllDirectories) + from l in File.ReadLines(f.FullName) + // attempt to locate all Response class lines + where Regex.IsMatch(l, @"^.+public class [^ \r\n]+Response") + //grab the response name including any generics declared on it + let c = Regex.Replace(l, @"^.+public class ([^ \r\n]+Response(?:<[^>\r\n]+>)?[^ \r\n]*).*$", "$1", RegexOptions.Singleline) + where c.Contains("Response") + let response = Regex.Replace(c, "<.*$", "") + let generics = Regex.Replace(c, @"^.*?(?:(\<.+>).*?)?$", "$1") + select (response, (response, generics)) + ) + .Concat(ResponseReroute.Select(kv=>(kv.Key, (kv.Value.Item1, kv.Value.Item2)))) + .ToDictionary(t=>t.Item1, t=>t.Item2)); + + } +} diff --git a/src/ApiGenerator/Configuration/GeneratorLocations.cs b/src/ApiGenerator/Configuration/GeneratorLocations.cs new file mode 100644 index 0000000000..f97b7d80df --- /dev/null +++ b/src/ApiGenerator/Configuration/GeneratorLocations.cs @@ -0,0 +1,74 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System.IO; +using System.Reflection; + +namespace ApiGenerator.Configuration +{ + public static class GeneratorLocations + { + // @formatter:off — disable formatter after this line + public static string OpenApiSpecFile { get; } = $@"{Root}OpenSearch.openapi.json"; + + public static string OpenSearchNetFolder { get; } = $@"{Root}../../src/OpenSearch.Net/"; + + public static string OpenSearchClientFolder { get; } = $@"{Root}../../src/OpenSearch.Client/"; + + public static string LowLevelGeneratedFolder { get; } = $"{OpenSearchNetFolder}_Generated/"; + + public static string HighLevelGeneratedFolder { get; } = $"{OpenSearchClientFolder}_Generated/"; + + // @formatter:on — enable formatter after this line + + public static string HighLevel(params string[] paths) => HighLevelGeneratedFolder + string.Join("/", paths); + public static string LowLevel(params string[] paths) => LowLevelGeneratedFolder + string.Join("/", paths); + + public static readonly Assembly Assembly = typeof(Generator.ApiGenerator).Assembly; + + private static string _root; + public static string Root + { + get + { + if (_root != null) return _root; + + var directoryInfo = new DirectoryInfo(Directory.GetCurrentDirectory()); + + var dotnetRun = + directoryInfo.Name == "ApiGenerator" && + directoryInfo.Parent != null && + directoryInfo.Parent.Name == "src"; + + _root = dotnetRun ? "" : @"../../../"; + return _root; + } + } + + } +} diff --git a/src/ApiGenerator/Configuration/Overrides/EndpointOverridesBase.cs b/src/ApiGenerator/Configuration/Overrides/EndpointOverridesBase.cs new file mode 100644 index 0000000000..db2f891293 --- /dev/null +++ b/src/ApiGenerator/Configuration/Overrides/EndpointOverridesBase.cs @@ -0,0 +1,46 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System.Collections.Generic; +using System.Linq; + +namespace ApiGenerator.Configuration.Overrides +{ + public abstract class EndpointOverridesBase : IEndpointOverrides + { + public virtual IDictionary RenameUrlParts { get; } = new SortedDictionary(); + + public virtual IDictionary ObsoleteQueryStringParams { get; set; } = new SortedDictionary(); + + public virtual IDictionary RenameQueryStringParams { get; } = new SortedDictionary(); + + public virtual IEnumerable RenderPartial { get; } = Enumerable.Empty(); + + public virtual IEnumerable SkipQueryStringParams { get; } = Enumerable.Empty(); + } +} diff --git a/src/ApiGenerator/Configuration/Overrides/Endpoints/DeleteByQueryOverrides.cs b/src/ApiGenerator/Configuration/Overrides/Endpoints/DeleteByQueryOverrides.cs new file mode 100644 index 0000000000..a14ebe66e2 --- /dev/null +++ b/src/ApiGenerator/Configuration/Overrides/Endpoints/DeleteByQueryOverrides.cs @@ -0,0 +1,37 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System.Collections.Generic; + +namespace ApiGenerator.Configuration.Overrides.Endpoints +{ + public class DeleteByQueryOverrides : EndpointOverridesBase + { + public override IEnumerable SkipQueryStringParams => new[] { "max_docs", }; + } +} diff --git a/src/ApiGenerator/Configuration/Overrides/Endpoints/FlushJobOverrides.cs b/src/ApiGenerator/Configuration/Overrides/Endpoints/FlushJobOverrides.cs new file mode 100644 index 0000000000..cca328708e --- /dev/null +++ b/src/ApiGenerator/Configuration/Overrides/Endpoints/FlushJobOverrides.cs @@ -0,0 +1,43 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System.Collections.Generic; + +namespace ApiGenerator.Configuration.Overrides.Endpoints +{ + public class FlushJobOverrides : EndpointOverridesBase + { + public override IEnumerable SkipQueryStringParams => new[] + { + "advance_time", + "end", + "start", + "calc_interim", + }; + } +} diff --git a/src/ApiGenerator/Configuration/Overrides/Endpoints/ForecastJobOverrides.cs b/src/ApiGenerator/Configuration/Overrides/Endpoints/ForecastJobOverrides.cs new file mode 100644 index 0000000000..b557f41009 --- /dev/null +++ b/src/ApiGenerator/Configuration/Overrides/Endpoints/ForecastJobOverrides.cs @@ -0,0 +1,41 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System.Collections.Generic; + +namespace ApiGenerator.Configuration.Overrides.Endpoints +{ + public class ForecastJobOverrides : EndpointOverridesBase + { + public override IEnumerable SkipQueryStringParams => new[] + { + "duration", + "expires_in" + }; + } +} diff --git a/src/ApiGenerator/Configuration/Overrides/Endpoints/GetAnomalyRecordsOverrides.cs b/src/ApiGenerator/Configuration/Overrides/Endpoints/GetAnomalyRecordsOverrides.cs new file mode 100644 index 0000000000..64e5023532 --- /dev/null +++ b/src/ApiGenerator/Configuration/Overrides/Endpoints/GetAnomalyRecordsOverrides.cs @@ -0,0 +1,47 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System.Collections.Generic; + +namespace ApiGenerator.Configuration.Overrides.Endpoints +{ + public class GetAnomalyRecordsOverrides : EndpointOverridesBase + { + public override IEnumerable SkipQueryStringParams => new[] + { + "exclude_interim", + "from", + "size", + "start", + "end", + "record_score", + "sort", + "desc" + }; + } +} diff --git a/src/ApiGenerator/Configuration/Overrides/Endpoints/GetBucketsOverrides.cs b/src/ApiGenerator/Configuration/Overrides/Endpoints/GetBucketsOverrides.cs new file mode 100644 index 0000000000..9c57062f1e --- /dev/null +++ b/src/ApiGenerator/Configuration/Overrides/Endpoints/GetBucketsOverrides.cs @@ -0,0 +1,49 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System.Collections.Generic; + +namespace ApiGenerator.Configuration.Overrides.Endpoints +{ + public class GetBucketsOverrides : EndpointOverridesBase + { + public override IEnumerable SkipQueryStringParams => new[] + { + "expand", + "exclude_interim", + "from", + "size", + "start", + "timestamp", + "end", + "anomaly_score", + "sort", + "desc" + }; + } +} diff --git a/src/ApiGenerator/Configuration/Overrides/Endpoints/GetCalendarEventsOverrides.cs b/src/ApiGenerator/Configuration/Overrides/Endpoints/GetCalendarEventsOverrides.cs new file mode 100644 index 0000000000..7087c15488 --- /dev/null +++ b/src/ApiGenerator/Configuration/Overrides/Endpoints/GetCalendarEventsOverrides.cs @@ -0,0 +1,41 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System.Collections.Generic; + +namespace ApiGenerator.Configuration.Overrides.Endpoints +{ + public class GetCalendarEventsOverrides : EndpointOverridesBase + { + public override IEnumerable SkipQueryStringParams => new[] + { + "from", + "size" + }; + } +} diff --git a/src/ApiGenerator/Configuration/Overrides/Endpoints/GetCalendarsOverrides.cs b/src/ApiGenerator/Configuration/Overrides/Endpoints/GetCalendarsOverrides.cs new file mode 100644 index 0000000000..80b28d8a23 --- /dev/null +++ b/src/ApiGenerator/Configuration/Overrides/Endpoints/GetCalendarsOverrides.cs @@ -0,0 +1,41 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System.Collections.Generic; + +namespace ApiGenerator.Configuration.Overrides.Endpoints +{ + public class GetCalendarsOverrides : EndpointOverridesBase + { + public override IEnumerable SkipQueryStringParams => new[] + { + "from", + "size" + }; + } +} diff --git a/src/ApiGenerator/Configuration/Overrides/Endpoints/GetCategoriesOverrides.cs b/src/ApiGenerator/Configuration/Overrides/Endpoints/GetCategoriesOverrides.cs new file mode 100644 index 0000000000..b753e6838a --- /dev/null +++ b/src/ApiGenerator/Configuration/Overrides/Endpoints/GetCategoriesOverrides.cs @@ -0,0 +1,41 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System.Collections.Generic; + +namespace ApiGenerator.Configuration.Overrides.Endpoints +{ + public class GetCategoriesOverrides : EndpointOverridesBase + { + public override IEnumerable SkipQueryStringParams => new[] + { + "from", + "size" + }; + } +} diff --git a/src/ApiGenerator/Configuration/Overrides/Endpoints/GetInfluencersOverrides.cs b/src/ApiGenerator/Configuration/Overrides/Endpoints/GetInfluencersOverrides.cs new file mode 100644 index 0000000000..41e6e1b518 --- /dev/null +++ b/src/ApiGenerator/Configuration/Overrides/Endpoints/GetInfluencersOverrides.cs @@ -0,0 +1,47 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System.Collections.Generic; + +namespace ApiGenerator.Configuration.Overrides.Endpoints +{ + public class GetInfluencersOverrides : EndpointOverridesBase + { + public override IEnumerable SkipQueryStringParams => new[] + { + "exclude_interim", + "from", + "size", + "start", + "end", + "influencer_score", + "sort", + "desc" + }; + } +} diff --git a/src/ApiGenerator/Configuration/Overrides/Endpoints/GetModelSnapshotsOverrides.cs b/src/ApiGenerator/Configuration/Overrides/Endpoints/GetModelSnapshotsOverrides.cs new file mode 100644 index 0000000000..5873a548f7 --- /dev/null +++ b/src/ApiGenerator/Configuration/Overrides/Endpoints/GetModelSnapshotsOverrides.cs @@ -0,0 +1,45 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System.Collections.Generic; + +namespace ApiGenerator.Configuration.Overrides.Endpoints +{ + public class GetModelSnapshotsOverrides : EndpointOverridesBase + { + public override IEnumerable SkipQueryStringParams => new[] + { + "from", + "size", + "start", + "end", + "sort", + "desc" + }; + } +} diff --git a/src/ApiGenerator/Configuration/Overrides/Endpoints/GetOverallBucketsOverrides.cs b/src/ApiGenerator/Configuration/Overrides/Endpoints/GetOverallBucketsOverrides.cs new file mode 100644 index 0000000000..7dd3ccb5e6 --- /dev/null +++ b/src/ApiGenerator/Configuration/Overrides/Endpoints/GetOverallBucketsOverrides.cs @@ -0,0 +1,46 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System.Collections.Generic; + +namespace ApiGenerator.Configuration.Overrides.Endpoints +{ + public class GetOverallBucketsOverrides : EndpointOverridesBase + { + public override IEnumerable SkipQueryStringParams => new[] + { + "allow_no_jobs", + "bucket_span", + "end", + "exclude_interim", + "overall_score", + "start", + "top_n" + }; + } +} diff --git a/src/ApiGenerator/Configuration/Overrides/Endpoints/IndicesStatsOverrides.cs b/src/ApiGenerator/Configuration/Overrides/Endpoints/IndicesStatsOverrides.cs new file mode 100644 index 0000000000..bb14a30b68 --- /dev/null +++ b/src/ApiGenerator/Configuration/Overrides/Endpoints/IndicesStatsOverrides.cs @@ -0,0 +1,41 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System.Collections.Generic; + +namespace ApiGenerator.Configuration.Overrides.Endpoints +{ + // ReSharper disable once UnusedMember.Global + public class IndicesStatsOverrides : EndpointOverridesBase + { + public override IEnumerable SkipQueryStringParams => new[] + { + "types" + }; + } +} diff --git a/src/ApiGenerator/Configuration/Overrides/Endpoints/MultiTermVectorsOverrides.cs b/src/ApiGenerator/Configuration/Overrides/Endpoints/MultiTermVectorsOverrides.cs new file mode 100644 index 0000000000..8e73e34373 --- /dev/null +++ b/src/ApiGenerator/Configuration/Overrides/Endpoints/MultiTermVectorsOverrides.cs @@ -0,0 +1,41 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System.Collections.Generic; + +namespace ApiGenerator.Configuration.Overrides.Endpoints +{ + // ReSharper disable once UnusedMember.Global + public class MultiTermVectorsOverrides : EndpointOverridesBase + { + public override IEnumerable SkipQueryStringParams => new[] + { + "ids" + }; + } +} diff --git a/src/ApiGenerator/Configuration/Overrides/Endpoints/PutIndexTemplateOverrides.cs b/src/ApiGenerator/Configuration/Overrides/Endpoints/PutIndexTemplateOverrides.cs new file mode 100644 index 0000000000..9bce58506e --- /dev/null +++ b/src/ApiGenerator/Configuration/Overrides/Endpoints/PutIndexTemplateOverrides.cs @@ -0,0 +1,41 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System.Collections.Generic; + +namespace ApiGenerator.Configuration.Overrides.Endpoints +{ + // ReSharper disable once UnusedMember.Global + public class PutIndexTemplateOverrides : EndpointOverridesBase + { + public override IEnumerable SkipQueryStringParams => new[] + { + "order" + }; + } +} diff --git a/src/ApiGenerator/Configuration/Overrides/Endpoints/ReindexOnServerOverrides.cs b/src/ApiGenerator/Configuration/Overrides/Endpoints/ReindexOnServerOverrides.cs new file mode 100644 index 0000000000..ebdffd7dc8 --- /dev/null +++ b/src/ApiGenerator/Configuration/Overrides/Endpoints/ReindexOnServerOverrides.cs @@ -0,0 +1,37 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System.Collections.Generic; + +namespace ApiGenerator.Configuration.Overrides.Endpoints +{ + public class ReindexOnServerOverrides : EndpointOverridesBase + { + public override IEnumerable SkipQueryStringParams => new[] { "max_docs", }; + } +} diff --git a/src/ApiGenerator/Configuration/Overrides/Endpoints/RevertModelSnapshotOverrides.cs b/src/ApiGenerator/Configuration/Overrides/Endpoints/RevertModelSnapshotOverrides.cs new file mode 100644 index 0000000000..125fe24163 --- /dev/null +++ b/src/ApiGenerator/Configuration/Overrides/Endpoints/RevertModelSnapshotOverrides.cs @@ -0,0 +1,40 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System.Collections.Generic; + +namespace ApiGenerator.Configuration.Overrides.Endpoints +{ + public class RevertModelSnapshotOverrides : EndpointOverridesBase + { + public override IEnumerable SkipQueryStringParams => new[] + { + "delete_intervening_results" + }; + } +} diff --git a/src/ApiGenerator/Configuration/Overrides/Endpoints/ScrollOverrides.cs b/src/ApiGenerator/Configuration/Overrides/Endpoints/ScrollOverrides.cs new file mode 100644 index 0000000000..274bc3d643 --- /dev/null +++ b/src/ApiGenerator/Configuration/Overrides/Endpoints/ScrollOverrides.cs @@ -0,0 +1,41 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System.Collections.Generic; + +namespace ApiGenerator.Configuration.Overrides.Endpoints +{ + // ReSharper disable once UnusedMember.Global + public class ScrollOverrides : EndpointOverridesBase + { + public override IEnumerable SkipQueryStringParams => new[] + { + "scroll_id", "scroll" + }; + } +} diff --git a/src/ApiGenerator/Configuration/Overrides/Endpoints/SearchOverrides.cs b/src/ApiGenerator/Configuration/Overrides/Endpoints/SearchOverrides.cs new file mode 100644 index 0000000000..2e728e4bfc --- /dev/null +++ b/src/ApiGenerator/Configuration/Overrides/Endpoints/SearchOverrides.cs @@ -0,0 +1,56 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System.Collections.Generic; + +namespace ApiGenerator.Configuration.Overrides.Endpoints +{ + // ReSharper disable once UnusedMember.Global + public class SearchOverrides : EndpointOverridesBase + { + public override IEnumerable SkipQueryStringParams => new[] + { + "size", + "from", + "timeout", + "explain", + "version", + "sort", + "_source", + "_source_includes", + "_source_excludes", + "track_scores", + "terminate_after", + }; + + public override IEnumerable RenderPartial => new[] + { + "track_total_hits" + }; + } +} diff --git a/src/ApiGenerator/Configuration/Overrides/Endpoints/UpdateByQueryOverrides.cs b/src/ApiGenerator/Configuration/Overrides/Endpoints/UpdateByQueryOverrides.cs new file mode 100644 index 0000000000..316231d1dd --- /dev/null +++ b/src/ApiGenerator/Configuration/Overrides/Endpoints/UpdateByQueryOverrides.cs @@ -0,0 +1,37 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System.Collections.Generic; + +namespace ApiGenerator.Configuration.Overrides.Endpoints +{ + public class UpdateByQueryOverrides : EndpointOverridesBase + { + public override IEnumerable SkipQueryStringParams => new[] { "max_docs", }; + } +} diff --git a/src/ApiGenerator/Configuration/Overrides/Endpoints/UpdateOverrides.cs b/src/ApiGenerator/Configuration/Overrides/Endpoints/UpdateOverrides.cs new file mode 100644 index 0000000000..f7ca9fd10e --- /dev/null +++ b/src/ApiGenerator/Configuration/Overrides/Endpoints/UpdateOverrides.cs @@ -0,0 +1,42 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System.Collections.Generic; + +namespace ApiGenerator.Configuration.Overrides.Endpoints +{ + // ReSharper disable once UnusedMember.Global + public class UpdateOverrides : EndpointOverridesBase + { + public override IEnumerable SkipQueryStringParams => new[] + { + "fields", + "_source_includes", "_source_excludes" + }; + } +} diff --git a/src/ApiGenerator/Configuration/Overrides/GlobalOverrides.cs b/src/ApiGenerator/Configuration/Overrides/GlobalOverrides.cs new file mode 100644 index 0000000000..22fa44eb5e --- /dev/null +++ b/src/ApiGenerator/Configuration/Overrides/GlobalOverrides.cs @@ -0,0 +1,80 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System.Collections.Generic; + +namespace ApiGenerator.Configuration.Overrides +{ + public class GlobalOverrides : EndpointOverridesBase + { + public static readonly GlobalOverrides Instance = new(); + + private GlobalOverrides() { } + + public IDictionary> ObsoleteEnumMembers { get; set; } = new Dictionary>() + { + { "VersionType", new Dictionary() { { "force", "Force is no longer accepted by the server as of 7.5.0 and will result in an error when used" } } } + }; + + public override IDictionary ObsoleteQueryStringParams { get; set; } = new Dictionary + { + { "copy_settings", "" } + }; + + public override IDictionary RenameQueryStringParams { get; } = new Dictionary + { + { "_source", "source_enabled" }, + { "_source_includes", "source_includes" }, + { "_source_excludes", "source_excludes" }, + { "rest_total_hits_as_int", "total_hits_as_integer" }, + { "docvalue_fields", "doc_value_fields" }, + { "q", "query_on_query_string" }, + //make cat parameters more descriptive + { "h", "Headers" }, + { "s", "sort_by_columns" }, + { "v", "verbose" }, + { "ts", "include_timestamp" }, + { "if_seq_no", "if_sequence_number" }, + { "seq_no_primary_term", "sequence_number_primary_term" }, + }; + + public override IEnumerable RenderPartial => new[] + { + "stored_fields", + "docvalue_fields" + }; + + public override IEnumerable SkipQueryStringParams { get; } = new[] + { + "copy_settings", //this still needs a PR? + "source", // allows the body to be specified as a request param, we do not want to advertise this with a strongly typed method + "timestamp", + "time" + }; + } +} diff --git a/src/ApiGenerator/Configuration/Overrides/IEndpointOverrides.cs b/src/ApiGenerator/Configuration/Overrides/IEndpointOverrides.cs new file mode 100644 index 0000000000..82946907db --- /dev/null +++ b/src/ApiGenerator/Configuration/Overrides/IEndpointOverrides.cs @@ -0,0 +1,65 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System.Collections.Generic; + +namespace ApiGenerator.Configuration.Overrides +{ + /// + /// Tweaks the generated descriptors + /// + public interface IEndpointOverrides + { + /// + /// Override how the url part is exposed to the client. + /// + IDictionary RenameUrlParts { get; } + + /// + /// A map of key -> obsolete message for properties in the spec that should not be used any longer + /// + IDictionary ObsoleteQueryStringParams { get; } + + /// + /// Override how the query param name is exposed to the client. + /// + IDictionary RenameQueryStringParams { get; } + + /// + /// Force these be rendered as interface properties only, so that they'd have to be implemented manually + /// and become part of the body. This only takes affect on requests that take a body (e.g not GET or HEAD). + /// + IEnumerable RenderPartial { get; } + + /// + /// Sometimes params can be defined on the body as well as on the querystring + /// We favor specifying params on the body so here we can specify params we don't want on the querystring. + /// + IEnumerable SkipQueryStringParams { get; } + } +} diff --git a/src/ApiGenerator/Configuration/ViewLocations.cs b/src/ApiGenerator/Configuration/ViewLocations.cs new file mode 100644 index 0000000000..3339f85d1d --- /dev/null +++ b/src/ApiGenerator/Configuration/ViewLocations.cs @@ -0,0 +1,37 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +namespace ApiGenerator.Configuration +{ + public static class ViewLocations + { + public static string HighLevel(params string[] paths) => "HighLevel." + string.Join(".", paths); + + public static string LowLevel(params string[] paths) => "LowLevel." + string.Join(".", paths); + } +} diff --git a/src/ApiGenerator/Domain/ApiRequestParametersPatcher.cs b/src/ApiGenerator/Domain/ApiRequestParametersPatcher.cs new file mode 100644 index 0000000000..e4be8819ac --- /dev/null +++ b/src/ApiGenerator/Domain/ApiRequestParametersPatcher.cs @@ -0,0 +1,164 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System; +using System.Collections.Generic; +using System.Linq; +using ApiGenerator.Configuration.Overrides; +using ApiGenerator.Domain.Specification; + +namespace ApiGenerator.Domain +{ + public static class ApiRequestParametersPatcher + { + public static void PatchUrlPaths(string endpointName, IList source, IEndpointOverrides overrides) + { + var declaredKeys = source.SelectMany(p => p.Parts).Select(p => p.Name).ToHashSet(); + var renameLookup = CreateUrlPartRenameLookup(overrides, declaredKeys); + + foreach (var path in source) + { + foreach (var part in path.Parts) + { + if (!renameLookup.TryGetValue(part.Name, out var newName)) continue; + + path.Path = path.Path.Replace($"{{{part.Name}}}", $"{{{newName}}}"); + part.Name = newName; + } + } + } + + public static SortedDictionary PatchQueryParameters( + string endpointName, + IDictionary source, + IEndpointOverrides overrides + ) + { + var declaredKeys = source.Keys; + var skipList = CreateSkipList(overrides, declaredKeys); + var partialList = CreatePartialList(overrides, declaredKeys); + + var renameLookup = CreateRenameLookup(overrides, declaredKeys); + var obsoleteLookup = CreateObsoleteLookup(overrides, declaredKeys); + + var patchedParams = new SortedDictionary(); + foreach (var (queryStringKey, value) in source) + { + value.QueryStringKey = queryStringKey; + + if (!renameLookup.TryGetValue(queryStringKey, out var preferredName)) preferredName = queryStringKey; + + value.ClsName ??= CreateCSharpName(preferredName, endpointName); + + if (skipList.Contains(queryStringKey)) value.Skip = true; + + if (partialList.Contains(queryStringKey)) value.RenderPartial = true; + + if (obsoleteLookup.TryGetValue(queryStringKey, out var obsolete)) value.Obsolete = obsolete; + + //make sure source_enabled takes a boolean only + if (preferredName == "source_enabled") value.Type = "boolean"; + + patchedParams[preferredName] = value; + } + + return patchedParams; + } + + private static string CreateCSharpName(string queryStringKey, string endpointName) + { + if (string.IsNullOrWhiteSpace(queryStringKey)) return "UNKNOWN"; + + if (queryStringKey == "format" && endpointName == "text_structure.find_structure") + return "TextStructureFindStructureFormat"; + + var cased = queryStringKey.ToPascalCase(); + switch (cased) + { + case "Type": + case "Index": + case "Source": + case "Script": + return cased + "QueryString"; + default: + return cased; + } + } + + private static IList CreateSkipList(IEndpointOverrides local, ICollection declaredKeys) => + CreateList(local, "skip", e => e.SkipQueryStringParams, declaredKeys); + + private static IList CreatePartialList(IEndpointOverrides local, ICollection declaredKeys) => + CreateList(local, "partial", e => e.RenderPartial, declaredKeys); + + private static IDictionary CreateLookup(IEndpointOverrides local, string type, + Func> @from, ICollection declaredKeys + ) + { + var d = new SortedDictionary(); + foreach (var kv in from(GlobalOverrides.Instance)) d[kv.Key] = kv.Value; + + if (local == null) return d; + + var localDictionary = from(local); + foreach (var kv in localDictionary) d[kv.Key] = kv.Value; + + var name = local.GetType().Name; + foreach (var p in localDictionary.Keys.Except(declaredKeys)) + Generator.ApiGenerator.Warnings.Add($"On {name} {type} key '{p}' is not found in spec"); + + return d; + } + + private static IList CreateList(IEndpointOverrides local, string type, + Func> @from, ICollection declaredKeys + ) + { + var list = new List(); + list.AddRange(from(GlobalOverrides.Instance)); + if (local != null) + { + var localList = from(local).ToList(); + list.AddRange(localList); + var name = local.GetType().Name; + foreach (var p in localList.Except(declaredKeys)) + Generator.ApiGenerator.Warnings.Add($"On {name} {type} key '{p}' is not found in spec"); + } + return list.Distinct().ToList(); + } + + private static IDictionary CreateUrlPartRenameLookup(IEndpointOverrides local, ICollection declaredKeys) => + CreateLookup(local, "url_part_rename", e => e.RenameUrlParts, declaredKeys); + + private static IDictionary CreateRenameLookup(IEndpointOverrides local, ICollection declaredKeys) => + CreateLookup(local, "rename", e => e.RenameQueryStringParams, declaredKeys); + + private static IDictionary CreateObsoleteLookup(IEndpointOverrides local, ICollection declaredKeys) => + CreateLookup(local, "obsolete", e => e.ObsoleteQueryStringParams, declaredKeys); + } +} diff --git a/src/ApiGenerator/Domain/Code/CsharpNames.cs b/src/ApiGenerator/Domain/Code/CsharpNames.cs new file mode 100644 index 0000000000..46a77cbabe --- /dev/null +++ b/src/ApiGenerator/Domain/Code/CsharpNames.cs @@ -0,0 +1,207 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System; +using System.Collections.Generic; +using System.Linq; +using ApiGenerator.Configuration; +using ApiGenerator.Generator; + +namespace ApiGenerator.Domain.Code +{ + public class CsharpNames + { + public CsharpNames(string name, string endpointMethodName, string endpointNamespace) + { + RestSpecName = string.IsNullOrWhiteSpace(endpointNamespace) ? endpointMethodName : $"{endpointNamespace}.{endpointMethodName}"; + Namespace = CreateCSharpNamespace(endpointNamespace); + if (CodeConfiguration.ApiNameMapping.TryGetValue(name, out var mapsApiMethodName)) + ApiName = mapsApiMethodName; + else ApiName = endpointMethodName.ToPascalCase(); + + //if the api name starts with the namespace do not repeat it in the method name + string Replace(string original, string ns, string find, string replace, string[] exceptions) + { + if (ns != null && Namespace != ns) return original; + if (exceptions.Contains(original)) return original; + + var replaced = original.Replace(find, replace); + if (string.IsNullOrEmpty(replaced)) return original; + + return replaced; + } + + MethodName = Replace(ApiName, null, Namespace, "", new string[0]); + + var namespaceRenames = new Dictionary + { + { "Indices", (find: "Index", replace: "", exceptions: new [] { "SimulateIndexTemplate" }) }, + }; + foreach (var (ns, (find, replace, exceptions)) in namespaceRenames) + MethodName = Replace(MethodName, ns, find, replace, exceptions); + } + + /// Pascal cased version of the namespace from the specification + public string Namespace { get; } + + public string RestSpecName { get; } + + /// + /// The pascal cased method name as loaded by + ///
Uses  mapping of request implementations in the OSC code base
+ ///
+ public string MethodName { get; } + + public string ApiName { get; } + + public string RequestName => $"{ApiName}Request"; + + public string ResponseName + { + get + { + if (Namespace == "Cat") return $"CatResponse<{ApiName}Record>"; + else if (ApiName.EndsWith("Exists")) return $"ExistsResponse"; + + var generatedName = $"{ApiName}Response"; + var name = CodeConfiguration.ResponseLookup.TryGetValue(generatedName, out var lookup) ? lookup.Item1 : generatedName; + return name; + } + } + public string RequestInterfaceName => $"I{RequestName}"; + public string ParametersName => $"{RequestName}Parameters"; + public string DescriptorName => $"{ApiName}Descriptor"; + + public const string ApiNamespace = "Specification"; + public const string ApiNamespaceSuffix = "Api"; + public const string RootNamespace = "NoNamespace"; + public const string LowLevelClientNamespacePrefix = "LowLevel"; + public const string HighLevelClientNamespacePrefix = ""; + public const string ClientNamespaceSuffix = "Namespace"; + private static string CreateCSharpNamespace(string endpointNamespace) + { + switch (endpointNamespace) + { + case null: + case "": return RootNamespace; + default: return endpointNamespace.ToPascalCase(); + } + } + + public string PerPathMethodName(string path) + { + Func ms = s => Namespace != null && Namespace.StartsWith(s); + Func pc = path.Contains; + + var method = MethodName; + // This is temporary for transition period + // TODO: remove in branch once it in opensearch is scrubbed + if (path.Contains("{type}") && !method.Contains("Type")) method += "UsingType"; + + if (ms("Indices") && !pc("{index}")) + return (method + "ForAll").Replace("AsyncForAll", "ForAllAsync"); + + if (ms("Nodes") && !pc("{node_id}")) + return (method + "ForAll").Replace("AsyncForAll", "ForAllAsync"); + + return method; + } + + + public string GenericsDeclaredOnRequest => + CodeConfiguration.RequestInterfaceGenericsLookup.TryGetValue(RequestInterfaceName, out var requestGeneric) ? requestGeneric : null; + + public string GenericsDeclaredOnResponse => + CodeConfiguration.ResponseLookup.TryGetValue(ResponseName, out var requestGeneric) ? requestGeneric.Item2 : null; + + public string GenericsDeclaredOnDescriptor => + CodeConfiguration.DescriptorGenericsLookup.TryGetValue(DescriptorName, out var generic) ? generic : null; + + public List ResponseGenerics => + !CodeConfiguration.ResponseLookup.TryGetValue(ResponseName, out var responseGeneric) + || string.IsNullOrEmpty(responseGeneric.Item2) + ? new List() + : SplitGeneric(responseGeneric.Item2); + + public List DescriptorGenerics => + CodeConfiguration.DescriptorGenericsLookup.TryGetValue(DescriptorName, out var generic) ? SplitGeneric(generic) : new List(); + + public bool DescriptorBindsOverMultipleDocuments => + HighLevelDescriptorMethodGenerics.Count == 2 && HighLevelDescriptorMethodGenerics.All(g => g.Contains("Document")); + //&& ResponseGenerics.FirstOrDefault() == DescriptorBoundDocumentGeneric ; + + public string DescriptorBoundDocumentGeneric => + HighLevelDescriptorMethodGenerics.FirstOrDefault(g=>g == "TDocument") ?? HighLevelDescriptorMethodGenerics.Last(); + + public List HighLevelDescriptorMethodGenerics => DescriptorGenerics + .Concat(ResponseGenerics) + .Distinct() + .ToList(); + + public static List SplitGeneric(string generic) => (generic ?? string.Empty) + .Replace("<", "") + .Replace(">", "") + .Split(",") + .Where(g => !string.IsNullOrWhiteSpace(g)) + .Distinct() + .ToList(); + + + public bool DescriptorNotFoundInCodebase => !CodeConfiguration.DescriptorGenericsLookup.TryGetValue(DescriptorName, out _); + + public string GenericDescriptorName => GenericsDeclaredOnDescriptor.IsNullOrEmpty() ? null : $"{DescriptorName}{GenericsDeclaredOnDescriptor}"; + public string GenericRequestName => GenericsDeclaredOnRequest.IsNullOrEmpty() ? null : $"{RequestName}{GenericsDeclaredOnRequest}"; + public string GenericInterfaceName => GenericsDeclaredOnRequest.IsNullOrEmpty() ? null : $"I{GenericRequestName}"; + public string GenericResponseName => GenericsDeclaredOnResponse.IsNullOrEmpty() ? null : $"{ResponseName}{GenericsDeclaredOnResponse}"; + + public string GenericOrNonGenericDescriptorName => GenericDescriptorName ?? DescriptorName; + public string GenericOrNonGenericInterfaceName => GenericInterfaceName ?? RequestInterfaceName; + public string GenericOrNonGenericResponseName + { + get + { + var full = GenericResponseName ?? ResponseName; + if (full.StartsWith("SearchResponse<")) + full = "I" + full; + return full; + } + } + + /// If matching Request.cs only defined generic interface make the client method only accept said interface + public string GenericOrNonGenericInterfacePreference => CodeConfiguration.GenericOnlyInterfaces.Contains(RequestInterfaceName) + ? GenericInterfaceName + : RequestInterfaceName; + + /// If matching Request.cs only defined generic interface make the client method only accept said interface + public string GenericOrNonGenericRequestPreference => CodeConfiguration.GenericOnlyInterfaces.Contains(RequestInterfaceName) + ? GenericRequestName + : RequestName; + + public bool CustomResponseBuilderPerRequestOverride(out string call) => CodeConfiguration.ResponseBuilderInClientCalls.TryGetValue(RequestName, out call); + } +} diff --git a/src/ApiGenerator/Domain/Code/HighLevel/Methods/BoundFluentMethod.cs b/src/ApiGenerator/Domain/Code/HighLevel/Methods/BoundFluentMethod.cs new file mode 100644 index 0000000000..54e96d8645 --- /dev/null +++ b/src/ApiGenerator/Domain/Code/HighLevel/Methods/BoundFluentMethod.cs @@ -0,0 +1,65 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System.Collections.Generic; +using System.Linq; +using ApiGenerator.Configuration; +using ApiGenerator.Domain.Specification; +using SemanticVersioning; + +namespace ApiGenerator.Domain.Code.HighLevel.Methods +{ + public class BoundFluentMethod : FluentSyntaxBase + { + public BoundFluentMethod(CsharpNames names, IReadOnlyCollection parts, bool selectorIsOptional, string link, string summary, Deprecation deprecated, Version versionAdded) + : base(names, parts, selectorIsOptional, link, summary, deprecated, versionAdded) { } + + private string DescriptorTypeParams => string.Join(", ", CsharpNames.DescriptorGenerics + .Select(e => CsharpNames.DescriptorBoundDocumentGeneric)); + + private string RequestTypeParams => string.Join(", ", CsharpNames.SplitGeneric(CsharpNames.GenericsDeclaredOnRequest) + .Select(e => CsharpNames.DescriptorBoundDocumentGeneric)); + + private string SelectorReturn => string.IsNullOrWhiteSpace(CsharpNames.GenericsDeclaredOnRequest) + || !CodeConfiguration.GenericOnlyInterfaces.Contains(CsharpNames.RequestInterfaceName) + ? CsharpNames.RequestInterfaceName + : $"{CsharpNames.RequestInterfaceName}<{RequestTypeParams}>"; + + public override string DescriptorName => $"{CsharpNames.DescriptorName}<{DescriptorTypeParams}>"; + public override string GenericWhereClause => $"where {CsharpNames.DescriptorBoundDocumentGeneric} : class"; + public override string MethodGenerics => $"<{CsharpNames.DescriptorBoundDocumentGeneric}>"; + + public override string RequestMethodGenerics => !string.IsNullOrWhiteSpace(RequestTypeParams) + ? $"<{RequestTypeParams}>" + : base.RequestMethodGenerics; + + public override string Selector => $"Func<{DescriptorName}, {SelectorReturn}>"; + + + } +} diff --git a/src/ApiGenerator/Domain/Code/HighLevel/Methods/FluentMethod.cs b/src/ApiGenerator/Domain/Code/HighLevel/Methods/FluentMethod.cs new file mode 100644 index 0000000000..fe7f3a3690 --- /dev/null +++ b/src/ApiGenerator/Domain/Code/HighLevel/Methods/FluentMethod.cs @@ -0,0 +1,47 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System.Collections.Generic; +using System.Linq; +using ApiGenerator.Domain.Specification; +using SemanticVersioning; + +namespace ApiGenerator.Domain.Code.HighLevel.Methods +{ + public class FluentMethod : FluentSyntaxBase + { + public FluentMethod(CsharpNames names, IReadOnlyCollection parts, bool selectorIsOptional, string link, string summary, Deprecation deprecated, Version versionAdded) + : base(names, parts, selectorIsOptional, link, summary, deprecated, versionAdded) { } + + public override string GenericWhereClause => + string.Join(" ", CsharpNames.HighLevelDescriptorMethodGenerics + .Where(g => g.Contains("Document")) + .Select(g => $"where {g} : class") + ); + } +} diff --git a/src/ApiGenerator/Domain/Code/HighLevel/Methods/FluentSyntaxBase.cs b/src/ApiGenerator/Domain/Code/HighLevel/Methods/FluentSyntaxBase.cs new file mode 100644 index 0000000000..e3f9d02765 --- /dev/null +++ b/src/ApiGenerator/Domain/Code/HighLevel/Methods/FluentSyntaxBase.cs @@ -0,0 +1,166 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System.Collections.Generic; +using System.Linq; +using ApiGenerator.Configuration; +using ApiGenerator.Domain.Specification; +using SemanticVersioning; + +namespace ApiGenerator.Domain.Code.HighLevel.Methods +{ + public abstract class FluentSyntaxBase : MethodSyntaxBase + { + private readonly bool _selectorIsOptional; + + protected FluentSyntaxBase(CsharpNames names, IReadOnlyCollection parts, bool selectorIsOptional, string link, string summary, Deprecation deprecated, Version versionAdded) + : base(names, link, summary, deprecated, versionAdded) => + (UrlParts, _selectorIsOptional) = (CreateDescriptorArgs(parts), selectorIsOptional); + + private IReadOnlyCollection UrlParts { get; } + + /// + /// The selector is optional if so set by (has no or optional body) + /// Or if there is a custom constructor on the descriptor in which case we assume that constructor holds all the required + /// values + /// + private bool SelectorIsOptional => _selectorIsOptional || CodeConfiguration.DescriptorConstructors.ContainsKey(CsharpNames.DescriptorName); + + public string MethodName => CsharpNames.MethodName; + + public string OptionalSelectorSuffix => SelectorIsOptional ? " = null" : string.Empty; + + public virtual string DescriptorName => CsharpNames.GenericOrNonGenericDescriptorName; + public virtual string Selector => $"Func<{DescriptorName}, {CsharpNames.GenericOrNonGenericInterfacePreference}>"; + + public override string MethodGenerics => + CodeConfiguration.GenericOnlyInterfaces.Contains(CsharpNames.RequestInterfaceName) + ? CsharpNames.GenericsDeclaredOnRequest + : DescriptorGenerics; + + public virtual string RequestMethodGenerics => + CodeConfiguration.GenericOnlyInterfaces.Contains(CsharpNames.RequestInterfaceName) + ? CsharpNames.GenericsDeclaredOnRequest + : CsharpNames.GenericsDeclaredOnResponse; + + private string DescriptorGenerics => CsharpNames.HighLevelDescriptorMethodGenerics.Any() + ? $"<{string.Join(", ", CsharpNames.HighLevelDescriptorMethodGenerics)}>" + : null; + + private List CreateDescriptorArgs(IReadOnlyCollection parts) + { + var requiredParts = parts.Where(p => p.Required).ToList(); + + //Many api's return ALOT of information by default e.g get_alias or get_mapping + //the client methods that take a descriptor default to forcing a choice on the user. + //except for cat api's where the amount of information returned is manageable + + var willInferFromDocument = CsharpNames.GenericsDeclaredOnDescriptor?.Contains("Document") ?? false; + if (!requiredParts.Any() && CsharpNames.Namespace != "Cat") + { + var candidates = new[] + { + //only make index part the first argument if the descriptor is not generic on T.*?Document + parts.FirstOrDefault(p => p.Type == "list" && (p.Name == "index" || p.Name == "indices") && !willInferFromDocument), + parts.FirstOrDefault(p => p.Name == "name"), + }; + requiredParts = candidates.Where(p=>p!= null).Take(1).ToList(); + } + if (!willInferFromDocument) return requiredParts; + + //if index, indices is required but the descriptor is generic these will be inferred so no need to pass explicitly + requiredParts = requiredParts.Where(p => p.Name != "index" && p.Name != "indices").ToList(); + var idPart = requiredParts.FirstOrDefault(i => i.Name == "id"); + if ((idPart != null && UrlInformation.IsADocumentRoute(parts)) || IsDocumentRequest) + { + if (requiredParts.Contains(idPart)) requiredParts.Remove(idPart); + var generic = GenericFirstArgument; + var typeName = IsDocumentRequest ? generic : $"DocumentPath<{generic}>"; + var arg = IsDocumentRequest ? "document" : idPart.Name; + requiredParts.Add(new UrlPart + { + Name = arg, + Required = true, + ClrTypeNameOverride = typeName + }); + } + + return requiredParts; + } + + private bool IsDocumentRequest => CodeConfiguration.DocumentRequests.Contains(CsharpNames.RequestInterfaceName); + private string GenericFirstArgument => + CsharpNames.GenericsDeclaredOnDescriptor.Replace("<", "").Replace(">", "").Split(",").First().Trim(); + + public string DescriptorArguments() + { + string codeArgs; + if (CodeConfiguration.DescriptorConstructors.TryGetValue(CsharpNames.DescriptorName, out codeArgs)) + codeArgs += ","; + + if (!UrlParts.Any()) return codeArgs; + + string Optional(UrlPart p) => !p.Required && SelectorIsOptional ? " = null" : string.Empty; + return codeArgs + string.Join(", ", UrlParts.Select(p => $"{p.HighLevelTypeName} {p.Name.ToCamelCase()}{Optional(p)}")) + ", "; + } + + public string SelectorArguments() + { + string codeArgs = null; + if (CodeConfiguration.DescriptorConstructors.TryGetValue(CsharpNames.DescriptorName, out codeArgs)) + { + codeArgs = string.Join(", ", codeArgs.Split(',').Select(a=>a.Split(' ').Last())); + return codeArgs; + } + + var parts = UrlParts.Where(p => p.Required).ToList(); + if (!parts.Any()) return null; + + string ToArg(UrlPart p) + { + if (IsDocumentRequest) return "documentWithId: document"; + + if (p.HighLevelTypeName.StartsWith("DocumentPath")) + return "documentWithId: id?.Document, index: id?.Self?.Index, id: id?.Self?.Id"; + + + return $"{p.Name.ToCamelCase()}: {p.Name.ToCamelCase()}"; + } + + return string.Join(", ", parts.Select(p => ToArg(p))); + } + + public string SelectorChainedDefaults() + { + var parts = UrlParts.Where(p => !p.Required).ToList(); + if (!parts.Any()) return null; + + return "." + string.Join(".", parts.Select(p => $"{p.Name.ToPascalCase()}({p.Name.ToCamelCase()}: {p.Name.ToCamelCase()})")); + } + } +} diff --git a/src/ApiGenerator/Domain/Code/HighLevel/Methods/FluentSyntaxView.cs b/src/ApiGenerator/Domain/Code/HighLevel/Methods/FluentSyntaxView.cs new file mode 100644 index 0000000000..8d25af9807 --- /dev/null +++ b/src/ApiGenerator/Domain/Code/HighLevel/Methods/FluentSyntaxView.cs @@ -0,0 +1,39 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +namespace ApiGenerator.Domain.Code.HighLevel.Methods +{ + public class FluentSyntaxView + { + public FluentSyntaxView(FluentSyntaxBase syntax, bool async) => (Syntax , Async) = (syntax, async); + + public FluentSyntaxBase Syntax { get; } + + public bool Async { get; } + } +} diff --git a/src/ApiGenerator/Domain/Code/HighLevel/Methods/HighLevelModel.cs b/src/ApiGenerator/Domain/Code/HighLevel/Methods/HighLevelModel.cs new file mode 100644 index 0000000000..30693dbfd3 --- /dev/null +++ b/src/ApiGenerator/Domain/Code/HighLevel/Methods/HighLevelModel.cs @@ -0,0 +1,39 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +namespace ApiGenerator.Domain.Code.HighLevel.Methods +{ + public class HighLevelModel + { + public CsharpNames CsharpNames { get; set; } + public FluentMethod Fluent { get; set; } + public BoundFluentMethod FluentBound { get; set; } + public InitializerMethod Initializer { get; set; } + + } +} diff --git a/src/ApiGenerator/Domain/Code/HighLevel/Methods/InitializerMethod.cs b/src/ApiGenerator/Domain/Code/HighLevel/Methods/InitializerMethod.cs new file mode 100644 index 0000000000..f0f048e494 --- /dev/null +++ b/src/ApiGenerator/Domain/Code/HighLevel/Methods/InitializerMethod.cs @@ -0,0 +1,75 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System.Linq; +using ApiGenerator.Configuration; +using ApiGenerator.Domain.Specification; +using SemanticVersioning; + +namespace ApiGenerator.Domain.Code.HighLevel.Methods +{ + public class InitializerMethod : MethodSyntaxBase + { + public InitializerMethod(CsharpNames names, string link, string summary, Deprecation deprecated, Version versionAdded) : base(names, link, summary, deprecated, versionAdded) { } + + public string MethodName => CsharpNames.MethodName; + + public string ArgumentType => CsharpNames.GenericOrNonGenericInterfacePreference; + + public override string MethodGenerics => + CodeConfiguration.GenericOnlyInterfaces.Contains(CsharpNames.RequestInterfaceName) + ? CsharpNames.GenericsDeclaredOnRequest + : CsharpNames.GenericsDeclaredOnResponse; + + public override string GenericWhereClause => + string.Join(" ", CsharpNames.SplitGeneric(MethodGenerics) + .Where(g=>g.Contains("Document")) + .Select(g=>$"where {g} : class") + ); + + private bool IsCatMethod => CsharpNames.Namespace == "Cat"; + + public string DispatchMethod => IsCatMethod ? "DoCat" : "DoRequest"; + + /// + /// Dispatch needs a class instance so if the response is an interface transform it to the concrete implementation + /// when calling into DoRequest + /// + private string DispatchResponseName => InterfaceResponse ? ResponseName.Substring(1, ResponseName.Length - 1) : ResponseName; + + public string DispatchGenerics => IsCatMethod + ? $"<{ArgumentType},{CsharpNames.ParametersName},{CsharpNames.RequestName.Replace("Request", "Record")}>" + : $"<{ArgumentType},{DispatchResponseName}>"; + + public string DispatchParameters => IsCatMethod + ? "request" + : CsharpNames.CustomResponseBuilderPerRequestOverride(out var builder) + ? $"request, ResponseBuilder(request.RequestParameters, {builder})" + : "request, request.RequestParameters"; + } +} diff --git a/src/ApiGenerator/Domain/Code/HighLevel/Methods/InitializerSyntaxView.cs b/src/ApiGenerator/Domain/Code/HighLevel/Methods/InitializerSyntaxView.cs new file mode 100644 index 0000000000..8469d23544 --- /dev/null +++ b/src/ApiGenerator/Domain/Code/HighLevel/Methods/InitializerSyntaxView.cs @@ -0,0 +1,40 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +namespace ApiGenerator.Domain.Code.HighLevel.Methods +{ + public class InitializerSyntaxView + { + public InitializerSyntaxView(InitializerMethod syntax, bool async) => (Syntax , Async) = (syntax, async); + + public InitializerMethod Syntax { get; } + + public bool Async { get; } + } + +} diff --git a/src/ApiGenerator/Domain/Code/HighLevel/Methods/MethodSyntaxBase.cs b/src/ApiGenerator/Domain/Code/HighLevel/Methods/MethodSyntaxBase.cs new file mode 100644 index 0000000000..a0b1f329df --- /dev/null +++ b/src/ApiGenerator/Domain/Code/HighLevel/Methods/MethodSyntaxBase.cs @@ -0,0 +1,59 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using ApiGenerator.Domain.Specification; +using SemanticVersioning; + +namespace ApiGenerator.Domain.Code.HighLevel.Methods +{ + public abstract class MethodSyntaxBase + { + protected MethodSyntaxBase(CsharpNames names, string link, string summary, Deprecation deprecated, Version versionAdded) => + (CsharpNames, DocumentationLink, XmlDocSummary, Deprecated, VersionAdded) = (names, link, summary, deprecated, versionAdded); + + public string DocumentationLink { get; } + + public string XmlDocSummary { get; } + + public Deprecation Deprecated { get; } + + public Version VersionAdded { get; set; } + + protected CsharpNames CsharpNames { get; } + + public bool InterfaceResponse => ResponseName.StartsWith("ISearchResponse<"); + + public string ResponseName => CsharpNames.GenericOrNonGenericResponseName; + + public string DocumentationCref => CsharpNames.GenericOrNonGenericInterfacePreference; + + public abstract string MethodGenerics { get; } + + public abstract string GenericWhereClause { get; } + } +} diff --git a/src/ApiGenerator/Domain/Code/HighLevel/Requests/Constructor.cs b/src/ApiGenerator/Domain/Code/HighLevel/Requests/Constructor.cs new file mode 100644 index 0000000000..fcf1562b36 --- /dev/null +++ b/src/ApiGenerator/Domain/Code/HighLevel/Requests/Constructor.cs @@ -0,0 +1,135 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System; +using System.Collections.Generic; +using System.Linq; +using ApiGenerator.Configuration; +using ApiGenerator.Domain.Specification; + +namespace ApiGenerator.Domain.Code.HighLevel.Requests +{ + public class Constructor + { + private static readonly string Indent = $"{Environment.NewLine}\t\t"; + public string AdditionalCode { get; set; } = string.Empty; + public bool Parameterless { get; set; } + public string Body { get; set; } + public string Description { get; set; } + public string Generated { get; set; } + + public static IEnumerable DescriptorConstructors(CsharpNames names, UrlInformation url) + { + var m = names.DescriptorName; + var generic = FirstGeneric(names.GenericsDeclaredOnDescriptor); + var generateGeneric = !string.IsNullOrEmpty(generic); + return GenerateConstructors(url, true, generateGeneric, m, generic); + } + + public static IEnumerable RequestConstructors(CsharpNames names, UrlInformation url, bool inheritsFromPlainRequestBase) + { + var generic = FirstGeneric(names.GenericsDeclaredOnRequest); + var generateGeneric = CodeConfiguration.GenericOnlyInterfaces.Contains(names.RequestInterfaceName) || !inheritsFromPlainRequestBase; + return GenerateConstructors(url, inheritsFromPlainRequestBase, generateGeneric, names.RequestName, generic); + } + + private static string FirstGeneric(string fullGenericString) => + fullGenericString?.Replace("<", "").Replace(">", "").Split(",").First().Trim(); + + private static IEnumerable GenerateConstructors( + UrlInformation url, + bool inheritsFromPlainRequestBase, + bool generateGeneric, + string typeName, + string generic + ) + { + var ctors = new List(); + + var paths = url.Paths.ToList(); + + if (url.IsPartless) return ctors; + + ctors.AddRange(from path in paths + let baseArgs = inheritsFromPlainRequestBase ? path.RequestBaseArguments : path.TypedSubClassBaseArguments + let constParams = path.ConstructorArguments + let generated = $"public {typeName}({constParams}) : base({baseArgs})" + select new Constructor + { + Parameterless = string.IsNullOrEmpty(constParams), + Generated = generated, + Description = path.GetXmlDocs(Indent), + //Body = isDocumentApi ? $" => Q(\"routing\", new Routing(() => AutoRouteDocument()));" : string.Empty + Body = string.Empty + }); + + if (generateGeneric && !string.IsNullOrWhiteSpace(generic)) + { + ctors.AddRange(from path in paths.Where(path => path.HasResolvableArguments) + let baseArgs = path.AutoResolveBaseArguments(generic) + let constructorArgs = path.AutoResolveConstructorArguments + let baseOrThis = inheritsFromPlainRequestBase + ? "this" + : "base" + let generated = $"public {typeName}({constructorArgs}) : {baseOrThis}({baseArgs})" + select new Constructor + { + Parameterless = string.IsNullOrEmpty(constructorArgs), + Generated = generated, + Description = path.GetXmlDocs(Indent, skipResolvable: true), + Body = string.Empty + }); + + if (url.TryGetDocumentApiPath(out var docPath)) + { + var docPathBaseArgs = docPath.DocumentPathBaseArgument(generic); + var docPathConstArgs = docPath.DocumentPathConstructorArgument(generic); + ctors.Add(new Constructor + { + Parameterless = string.IsNullOrEmpty(docPathConstArgs), + Generated = $"public {typeName}({docPathConstArgs}) : this({docPathBaseArgs})", + + AdditionalCode = $"partial void DocumentFromPath({generic} document);", + Description = docPath.GetXmlDocs(Indent, skipResolvable: true, documentConstructor: true), + Body = "=> DocumentFromPath(documentWithId);" + }); + } + } + var constructors = ctors.GroupBy(c => c.Generated.Split(new[] { ':' }, 2)[0]).Select(g => g.Last()).ToList(); + if (!constructors.Any(c=>c.Parameterless)) + constructors.Add(new Constructor + { + Parameterless = true, + Generated = $"protected {typeName}() : base()", + Description = + $"/// Used for serialization purposes, making sure we have a parameterless constructor{Indent}[SerializationConstructor]", + }); + return constructors; + } + } +} diff --git a/src/ApiGenerator/Domain/Code/HighLevel/Requests/DescriptorPartialImplementation.cs b/src/ApiGenerator/Domain/Code/HighLevel/Requests/DescriptorPartialImplementation.cs new file mode 100644 index 0000000000..3f5a39882d --- /dev/null +++ b/src/ApiGenerator/Domain/Code/HighLevel/Requests/DescriptorPartialImplementation.cs @@ -0,0 +1,96 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System.Collections.Generic; +using System.Linq; +using ApiGenerator.Domain.Specification; + +namespace ApiGenerator.Domain.Code.HighLevel.Requests +{ + public class DescriptorPartialImplementation + { + public CsharpNames CsharpNames { get; set; } + public string OfficialDocumentationLink { get; set; } + public IReadOnlyCollection Constructors { get; set; } + public IReadOnlyCollection Parts { get; set; } + public IReadOnlyCollection Paths { get; set; } + public IReadOnlyCollection Params { get; set; } + public bool HasBody { get; set; } + + public IEnumerable GetFluentRouteSetters() + { + var setters = new List(); + if (!Parts.Any()) return setters; + + var alwaysGenerate = new[] { "index" }; + var parts = Parts + .Where(p => !p.Required || alwaysGenerate.Contains(p.Name)) + .Where(p => !string.IsNullOrEmpty(p.Name)) + .ToList(); + var returnType = CsharpNames.GenericOrNonGenericDescriptorName; + foreach (var part in parts) + { + var p = part; + var paramName = p.Name.ToPascalCase(); + if (paramName.Length > 1) + paramName = paramName.Substring(0, 1).ToLowerInvariant() + paramName.Substring(1); + else + paramName = paramName.ToLowerInvariant(); + + var routeValue = "v"; + var routeSetter = p.Required ? "Required" : "Optional"; + + var code = + $"public {returnType} {p.InterfaceName}({p.HighLevelTypeName} {paramName}) => Assign({paramName}, (a,v)=>a.RouteValues.{routeSetter}(\"{p.Name}\", {routeValue}));"; + var xmlDoc = $"/// {p.Description}"; + setters.Add(new FluentRouteSetter { Code = code, XmlDoc = xmlDoc }); + if (paramName == "index") + { + code = $"public {returnType} {p.InterfaceName}() where TOther : class "; + code += $"=> Assign(typeof(TOther), (a,v)=>a.RouteValues.{routeSetter}(\"{p.Name}\", ({p.HighLevelTypeName})v));"; + xmlDoc = $"/// a shortcut into calling {p.InterfaceName}(typeof(TOther))"; + setters.Add(new FluentRouteSetter { Code = code, XmlDoc = xmlDoc }); + } + if (paramName == "index" && p.Type == "list") + { + code = $"public {returnType} AllIndices() => Index(Indices.All);"; + xmlDoc = $"/// A shortcut into calling Index(Indices.All)"; + setters.Add(new FluentRouteSetter { Code = code, XmlDoc = xmlDoc }); + } + if (paramName == "fields" && p.Type == "list") + { + code = $"public {returnType} Fields(params Expression>[] fields) "; + code += $"=> Assign(fields, (a,v)=>a.RouteValues.{routeSetter}(\"fields\", (Fields)v));"; + xmlDoc = $"/// {p.Description}"; + setters.Add(new FluentRouteSetter { Code = code, XmlDoc = xmlDoc }); + } + } + return setters; + } + } +} diff --git a/src/ApiGenerator/Domain/Code/HighLevel/Requests/FluentRouteSetter.cs b/src/ApiGenerator/Domain/Code/HighLevel/Requests/FluentRouteSetter.cs new file mode 100644 index 0000000000..e696e61ad3 --- /dev/null +++ b/src/ApiGenerator/Domain/Code/HighLevel/Requests/FluentRouteSetter.cs @@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +namespace ApiGenerator.Domain.Code.HighLevel.Requests +{ + public class FluentRouteSetter + { + public string Code { get; set; } + public string XmlDoc { get; set; } + } +} diff --git a/src/ApiGenerator/Domain/Code/HighLevel/Requests/RequestInterface.cs b/src/ApiGenerator/Domain/Code/HighLevel/Requests/RequestInterface.cs new file mode 100644 index 0000000000..cd07352c91 --- /dev/null +++ b/src/ApiGenerator/Domain/Code/HighLevel/Requests/RequestInterface.cs @@ -0,0 +1,56 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System.Collections.Generic; +using ApiGenerator.Configuration; +using ApiGenerator.Domain.Specification; + +namespace ApiGenerator.Domain.Code.HighLevel.Requests +{ + public class RequestInterface + { + public IReadOnlyCollection UrlParts { get; set; } + + /// + /// Partial parameters are query string parameters we prefer to send over the body of a request. + /// We declare these on the generated interfaces so that we don't forget to implement them in our request + /// implementations + /// + public IReadOnlyCollection PartialParameters { get; set; } + + public string OfficialDocumentationLink { get; set; } + + public CsharpNames CsharpNames { get; set; } + + private bool GenerateOnlyGenericInterface => CodeConfiguration.GenericOnlyInterfaces.Contains(CsharpNames.RequestInterfaceName); + + public bool NeedsGenericInterface => !GenerateOnlyGenericInterface && !string.IsNullOrWhiteSpace(CsharpNames.GenericsDeclaredOnRequest); + + public string Name => CsharpNames.GenericOrNonGenericInterfacePreference; + } +} diff --git a/src/ApiGenerator/Domain/Code/HighLevel/Requests/RequestParameterImplementation.cs b/src/ApiGenerator/Domain/Code/HighLevel/Requests/RequestParameterImplementation.cs new file mode 100644 index 0000000000..e39ca7586d --- /dev/null +++ b/src/ApiGenerator/Domain/Code/HighLevel/Requests/RequestParameterImplementation.cs @@ -0,0 +1,41 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System.Collections.Generic; +using ApiGenerator.Domain.Specification; + +namespace ApiGenerator.Domain.Code.HighLevel.Requests +{ + public class RequestParameterImplementation + { + public CsharpNames CsharpNames { get; set; } + public string OfficialDocumentationLink { get; set; } + public IReadOnlyCollection Params { get; set; } + public string HttpMethod { get; set; } + } +} diff --git a/src/ApiGenerator/Domain/Code/HighLevel/Requests/RequestPartialImplementation.cs b/src/ApiGenerator/Domain/Code/HighLevel/Requests/RequestPartialImplementation.cs new file mode 100644 index 0000000000..ec38435a91 --- /dev/null +++ b/src/ApiGenerator/Domain/Code/HighLevel/Requests/RequestPartialImplementation.cs @@ -0,0 +1,55 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System.Collections.Generic; +using ApiGenerator.Configuration; +using ApiGenerator.Domain.Specification; + +namespace ApiGenerator.Domain.Code.HighLevel.Requests +{ + public class RequestPartialImplementation + { + public CsharpNames CsharpNames { get; set; } + public string OfficialDocumentationLink { get; set; } + public Stability Stability { get; set; } + public IReadOnlyCollection Parts { get; set; } + public IReadOnlyCollection Paths { get; set; } + public IReadOnlyCollection Params { get; set; } + public IReadOnlyCollection Constructors { get; set; } + public IReadOnlyCollection GenericConstructors { get; set; } + public bool HasBody { get; set; } + + private bool GenerateOnlyGenericInterface => CodeConfiguration.GenericOnlyInterfaces.Contains(CsharpNames.RequestInterfaceName); + + public bool NeedsGenericImplementation => !GenerateOnlyGenericInterface && !string.IsNullOrWhiteSpace(CsharpNames.GenericsDeclaredOnRequest); + + public string Name => CsharpNames.GenericOrNonGenericRequestPreference; + + public string InterfaceName => CsharpNames.GenericOrNonGenericInterfacePreference; + } +} diff --git a/src/ApiGenerator/Domain/Code/LowLevel/LowLevelClientMethod.cs b/src/ApiGenerator/Domain/Code/LowLevel/LowLevelClientMethod.cs new file mode 100644 index 0000000000..a81e269163 --- /dev/null +++ b/src/ApiGenerator/Domain/Code/LowLevel/LowLevelClientMethod.cs @@ -0,0 +1,78 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System.Collections.Generic; +using System.Linq; +using System.Text.RegularExpressions; +using ApiGenerator.Domain.Specification; +using SemanticVersioning; + +namespace ApiGenerator.Domain.Code.LowLevel +{ + public class LowLevelClientMethod + { + public CsharpNames CsharpNames { get; set; } + + public string Arguments { get; set; } + public string OfficialDocumentationLink { get; set; } + + public Stability Stability { get; set; } + public string PerPathMethodName { get; set; } + public string HttpMethod { get; set; } + + public Deprecation Deprecation { get; set; } + public UrlInformation Url { get; set; } + public bool HasBody { get; set; } + public IEnumerable Parts { get; set; } + public string Path { get; set; } + + public Version VersionAdded { get; set; } + + public string UrlInCode + { + get + { + var url = Path.TrimStart('/'); + var options = Url.AllPaths.SelectMany(p => p.Parts).Select(p => p.Name).Distinct(); + + var pattern = string.Join("|", options); + var urlCode = $"\"{url}\""; + if (!Path.Contains('{')) return urlCode; + + var patchedUrl = Regex.Replace(url, "{(" + pattern + ")}", m => + { + var arg = m.Groups[^1].Value.ToCamelCase(); + return $"{{{arg}:{arg}}}"; + }); + return $"Url($\"{patchedUrl}\")"; + } + } + + public string MapsApiArguments { get; set; } + } +} diff --git a/src/ApiGenerator/Domain/RestApiSpec.cs b/src/ApiGenerator/Domain/RestApiSpec.cs new file mode 100644 index 0000000000..042910cefb --- /dev/null +++ b/src/ApiGenerator/Domain/RestApiSpec.cs @@ -0,0 +1,102 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Collections.ObjectModel; +using System.Linq; +using ApiGenerator.Configuration; +using ApiGenerator.Domain.Specification; + +namespace ApiGenerator.Domain +{ + public class EnumDescription + { + public string Name { get; set; } + public IEnumerable Options { get; set; } + } + + public class RestApiSpec + { + public ImmutableSortedDictionary Endpoints { get; set; } + + public ImmutableSortedDictionary> EndpointsPerNamespaceLowLevel => + Endpoints.Values.GroupBy(e=>e.CsharpNames.Namespace) + .ToImmutableSortedDictionary(kv => kv.Key, kv => kv.ToList().AsReadOnly()); + + public ImmutableSortedDictionary> EndpointsPerNamespaceHighLevel => + Endpoints.Values + .Where(v => !CodeConfiguration.IgnoreHighLevelApi(v.Name)) + .GroupBy(e => e.CsharpNames.Namespace) + .ToImmutableSortedDictionary(kv => kv.Key, kv => kv.ToList().AsReadOnly()); + + + private IEnumerable _enumDescriptions; + public IEnumerable EnumsInTheSpec + { + get + { + if (_enumDescriptions != null) return _enumDescriptions; + + var urlParameterEnums = Endpoints + .Values + .SelectMany(e => e.Url.Params.Values) + .Where(p => !p.Skip && p.Options != null && p.Options.Any()) + .Select(p => new EnumDescription + { + Name = p.ClsName, + Options = p.Options + }) + .ToList(); + + var urlPartEnums = Endpoints + .Values + .SelectMany(e => e.Url.Parts, (e, part) => new { e, part }) + .Where(p => p.part.Options != null && p.part.Options.Any()) + .Select(p => + { + var ns = p.e.CsharpNames.Namespace; + var m = p.e.CsharpNames.MethodName; + return new EnumDescription + { + Name = (!m.StartsWith(ns) ? ns : string.Empty) + m + p.part.Name.ToPascalCase(), + Options = p.part.Options + }; + }). + ToList(); + + _enumDescriptions = urlPartEnums + .Concat(urlParameterEnums) + .DistinctBy(e => e.Name) + .ToList(); + + return _enumDescriptions; + } + } + } +} diff --git a/src/ApiGenerator/Domain/Specification/ApiEndpoint.cs b/src/ApiGenerator/Domain/Specification/ApiEndpoint.cs new file mode 100644 index 0000000000..f22c15731f --- /dev/null +++ b/src/ApiGenerator/Domain/Specification/ApiEndpoint.cs @@ -0,0 +1,221 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System.Collections.Generic; +using System.Linq; +using ApiGenerator.Configuration.Overrides; +using ApiGenerator.Domain.Code; +using ApiGenerator.Domain.Code.HighLevel.Methods; +using ApiGenerator.Domain.Code.HighLevel.Requests; +using ApiGenerator.Domain.Code.LowLevel; +using SemanticVersioning; + +namespace ApiGenerator.Domain.Specification +{ + public class ApiEndpoint + { + /// The original name as declared in the spec + public string Name { get; set; } + + /// The original namespace as declared in the spec + public string Namespace { get; set; } + + /// The original method name as declared in the spec + public string MethodName { get; set; } + + /// Computed Csharp identifier names + public CsharpNames CsharpNames { get; set; } + + public Stability Stability { get; set; } + + public Documentation OfficialDocumentationLink { get; set; } + + public UrlInformation Url { get; set; } + + public Body Body { get; set; } + + public IReadOnlyCollection HttpMethods { get; set; } + + public IEndpointOverrides Overrides { get; internal set; } + + private IEnumerable ParamsToGenerate => Url.Params.Values.Where(p => !p.Skip).OrderBy(p => p.ClsName); + + public RequestInterface RequestInterface => new() + { + CsharpNames = CsharpNames, + UrlParts = Url.Parts, + PartialParameters = + Body == null ? Enumerable.Empty().ToList() : ParamsToGenerate.Where(p => p.RenderPartial).ToList(), + OfficialDocumentationLink = OfficialDocumentationLink?.Url + }; + + public RequestPartialImplementation RequestPartialImplementation => new() + { + CsharpNames = CsharpNames, + OfficialDocumentationLink = OfficialDocumentationLink?.Url, + Stability = Stability, + Paths = Url.Paths.ToList(), + Parts = Url.Parts, + Params = ParamsToGenerate.ToList(), + Constructors = Constructor.RequestConstructors(CsharpNames, Url, inheritsFromPlainRequestBase: true).ToList(), + GenericConstructors = Constructor.RequestConstructors(CsharpNames, Url, inheritsFromPlainRequestBase: false).ToList(), + HasBody = Body != null, + }; + + public DescriptorPartialImplementation DescriptorPartialImplementation => new() + { + CsharpNames = CsharpNames, + OfficialDocumentationLink = OfficialDocumentationLink?.Url, + Constructors = Constructor.DescriptorConstructors(CsharpNames, Url).ToList(), + Paths = Url.Paths.ToList(), + Parts = Url.Parts, + Params = ParamsToGenerate.ToList(), + HasBody = Body != null, + }; + + public RequestParameterImplementation RequestParameterImplementation => new() + { + CsharpNames = CsharpNames, + OfficialDocumentationLink = OfficialDocumentationLink?.Url, + Params = ParamsToGenerate.ToList(), + HttpMethod = PreferredHttpMethod + }; + + public string PreferredHttpMethod => + HttpMethods.OrderByDescending(m => m switch + { + "GET" => 0, + "POST" => 1, + "PUT" or "DELETE" or "PATCH" or "HEAD" => 2, // Prefer "resource" methods over GET/POST methods + _ => -1 + }).First(); + + public string HighLevelMethodXmlDocDescription => + $"{PreferredHttpMethod} request to the {Name} API, read more about this API online:"; + + private bool BodyIsOptional => Body is not { Required: true } || HttpMethods.Contains("GET"); + + private Deprecation Deprecated => + !Url.Paths.Any() && Url.AllPaths.Count > 0 + ? Url.DeprecatedPaths + .Select(p => p.Deprecation) + .MaxBy(d => d.Version) + : null; + + private Version VersionAdded => + Url.AllPaths + .Select(p => p.VersionAdded) + .Where(v => v != null) + .Min(); + + public HighLevelModel HighLevelModel => new() + { + CsharpNames = CsharpNames, + Fluent = new FluentMethod(CsharpNames, Url.Parts, + selectorIsOptional: BodyIsOptional, + link: OfficialDocumentationLink?.Url, + summary: HighLevelMethodXmlDocDescription, + deprecated: Deprecated, + versionAdded: VersionAdded + ), + FluentBound = !CsharpNames.DescriptorBindsOverMultipleDocuments + ? null + : new BoundFluentMethod(CsharpNames, Url.Parts, + selectorIsOptional: BodyIsOptional, + link: OfficialDocumentationLink?.Url, + summary: HighLevelMethodXmlDocDescription, + deprecated: Deprecated, + versionAdded: VersionAdded + ), + Initializer = new InitializerMethod(CsharpNames, + link: OfficialDocumentationLink?.Url, + summary: HighLevelMethodXmlDocDescription, + deprecated: Deprecated, + versionAdded: VersionAdded + ) + }; + + private List _lowLevelClientMethods; + + public IReadOnlyCollection LowLevelClientMethods + { + get + { + if (_lowLevelClientMethods != null && _lowLevelClientMethods.Count > 0) return _lowLevelClientMethods; + + // enumerate once and cache + _lowLevelClientMethods = new List(); + + if (OfficialDocumentationLink == null) + Generator.ApiGenerator.Warnings.Add($"API '{Name}' has no documentation"); + + var httpMethod = PreferredHttpMethod; + foreach (var path in Url.AllPaths) + { + var methodName = CsharpNames.PerPathMethodName(path.Path); + var parts = new List(path.Parts); + var mapsApiArgumentHints = parts.Select(p => p.Name).ToList(); + // TODO This is hack until we stop transforming the new spec format into the old + if (Name == "index" && !mapsApiArgumentHints.Contains("id")) + httpMethod = "POST"; + else if (Name == "index") httpMethod = PreferredHttpMethod; + + if (Body != null) + { + parts.Add(new UrlPart { Name = "body", Type = "PostData", Description = Body.Description }); + mapsApiArgumentHints.Add("body"); + } + + var args = parts + .Select(p => p.Argument) + .Concat(new[] { CsharpNames.ParametersName + " requestParameters = null" }) + .ToList(); + + var apiMethod = new LowLevelClientMethod + { + Arguments = string.Join(", ", args), + MapsApiArguments = string.Join(", ", mapsApiArgumentHints), + CsharpNames = CsharpNames, + PerPathMethodName = methodName, + HttpMethod = httpMethod, + OfficialDocumentationLink = OfficialDocumentationLink?.Url, + Stability = Stability, + Deprecation = path.Deprecation, + Path = path.Path, + Parts = parts, + Url = Url, + HasBody = Body != null, + VersionAdded = path.VersionAdded, + }; + _lowLevelClientMethods.Add(apiMethod); + } + return _lowLevelClientMethods; + } + } + } +} diff --git a/src/ApiGenerator/Domain/Specification/Body.cs b/src/ApiGenerator/Domain/Specification/Body.cs new file mode 100644 index 0000000000..02ed3081c3 --- /dev/null +++ b/src/ApiGenerator/Domain/Specification/Body.cs @@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +namespace ApiGenerator.Domain.Specification +{ + public class Body + { + public string Description { get; set; } + public bool Required { get; set; } + } +} diff --git a/src/ApiGenerator/Domain/Specification/Deprecation.cs b/src/ApiGenerator/Domain/Specification/Deprecation.cs new file mode 100644 index 0000000000..96ac03c7d7 --- /dev/null +++ b/src/ApiGenerator/Domain/Specification/Deprecation.cs @@ -0,0 +1,45 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +namespace ApiGenerator.Domain.Specification; + +public class Deprecation +{ + public string Version { get; set; } + + public string Description { get; set; } + + public override string ToString() => + (!string.IsNullOrEmpty(Version), !string.IsNullOrEmpty(Description)) switch + { + (true, true) => $"Deprecated as of: {Version}, reason: {Description}", + (true, false) => $"Deprecated as of: {Version}", + (false, true) => $"reason: {Description}", + _ => "deprecated" + }; +} diff --git a/src/ApiGenerator/Domain/Specification/Documentation.cs b/src/ApiGenerator/Domain/Specification/Documentation.cs new file mode 100644 index 0000000000..3e38065101 --- /dev/null +++ b/src/ApiGenerator/Domain/Specification/Documentation.cs @@ -0,0 +1,42 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +namespace ApiGenerator.Domain.Specification +{ + public class Documentation + { + public string Description { get; set; } + + private string _url; + public string Url + { + get => _url; + set => _url = value?.Replace("http://", "https://"); + } + } +} diff --git a/src/ApiGenerator/Domain/Specification/QueryParameters.cs b/src/ApiGenerator/Domain/Specification/QueryParameters.cs new file mode 100644 index 0000000000..71fae53ebd --- /dev/null +++ b/src/ApiGenerator/Domain/Specification/QueryParameters.cs @@ -0,0 +1,186 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System; +using System.Collections.Generic; +using System.Linq; +using ApiGenerator.Generator; +using Version = SemanticVersioning.Version; + +namespace ApiGenerator.Domain.Specification +{ + public class QueryParameters + { + private static readonly string[] FieldsParams = { "fields", "_source_includes", "_source_excludes", }; + + public bool Skip { get; set; } + + public string ClsArgumentName => ClsName.ToCamelCase(); + + public string ClsName { get; set; } + + public string Description { get; set; } + + public Version VersionAdded { get; set; } + + public IEnumerable DescriptionHighLevel + { + get + { + switch (QueryStringKey) + { + case "routing": + yield return "A document is routed to a particular shard in an index using the following formula"; + yield return " shard_num = hash(_routing) % num_primary_shards"; + yield return "OpenSearch will use the document id if not provided. "; + yield return "For requests that are constructed from/for a document OpenSearch.Client will automatically infer the routing key"; + yield return + "if that document has a or a routing mapping on for its type exists on "; + + yield break; + case "_source": + yield return "Whether the _source should be included in the response."; + + yield break; + case "filter_path": + yield return Description; + yield return "Use of response filtering can result in a response from OpenSearch "; + yield return "that cannot be correctly deserialized to the respective response type for the request. "; + yield return "In such situations, use the low level client to issue the request and handle response deserialization"; + + yield break; + default: + yield return Description ?? "TODO"; + + yield break; + } + } + } + + public bool IsArray => Type == "list" && TypeHighLevel.EndsWith("[]"); + + public string DescriptorArgumentType => IsArray ? "params " + TypeHighLevel : TypeHighLevel; + + public string DescriptorEnumerableArgumentType => + IsArray + ? $"IEnumerable<{TypeHighLevel.TrimEnd('[', ']')}>" + : throw new InvalidOperationException("Only array arguments have IEnumerable overload"); + + public Func FluentGenerator { get; set; } + public bool IsFieldParam => TypeHighLevel == "Field"; + + public bool IsFieldsParam => TypeHighLevel == "Fields"; + + public string Obsolete + { + get => !string.IsNullOrEmpty(_obsolete) + ? _obsolete + : Deprecated?.ToString(); + set => _obsolete = value; + } + + public Deprecation Deprecated { get; set; } + + public IEnumerable Options { get; set; } + public string QueryStringKey { get; set; } + + public bool RenderPartial { get; set; } + public string SetterHighLevel => "value"; + + public string SetterLowLevel => "value"; + + private string _type; + private string _obsolete; + + public string Type + { + // TODO support unions + get => !_type.Contains("|") + ? _type + : _type.Split('|', StringSplitOptions.RemoveEmptyEntries).First().Trim(); + set => _type = value; + } + + public string TypeHighLevel + { + get + { + if (QueryStringKey == "routing") return "Routing"; + + var isFields = FieldsParams.Contains(QueryStringKey) || QueryStringKey.EndsWith("_fields"); + + var csharpType = TypeLowLevel; + switch (csharpType) + { + case "TimeSpan": return "Time"; + } + + switch (Type) + { + case "list" when isFields: + case "string" when isFields: return "Fields"; + case "string" when QueryStringKey.Contains("field"): return "Field"; + default: + return csharpType; + } + } + } + + public string TypeLowLevel + { + get + { + switch (Type) + { + case "boolean": return "bool?"; + case "list": return "string[]"; + case "int": return "int?"; + case "date": return "DateTimeOffset?"; + case "enum": return $"{ClsName}?"; + case "number": + return new[] { "boost", "percen", "score" }.Any(s => QueryStringKey.ToLowerInvariant().Contains(s)) + ? "double?" + : "long?"; + case "duration": + case "time": + return "TimeSpan"; + case "text": + case "": + case null: + return "string"; + default: + return Type; + } + } + } + + + public string InitializerGenerator(string @namespace, string type, string name, string key, string setter, Version versionAdded, params string[] doc) => + CodeGenerator.Property(@namespace, type, name, key, setter, Obsolete, versionAdded, doc); + } +} diff --git a/src/ApiGenerator/Domain/Specification/Stability.cs b/src/ApiGenerator/Domain/Specification/Stability.cs new file mode 100644 index 0000000000..5283854e3c --- /dev/null +++ b/src/ApiGenerator/Domain/Specification/Stability.cs @@ -0,0 +1,53 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System.Runtime.Serialization; + +namespace ApiGenerator.Domain.Specification +{ + public enum Stability + { + /// + /// Highly likely to break in the near future (minor/path), no BWC guarantees. Possibly removed in the future. + /// + [EnumMember(Value = "experimental")] + Experimental, + + /// + /// Less likely to break or be removed but still reserve the right to do so. + /// + [EnumMember(Value = "beta")] + Beta, + + /// + /// No backwards breaking changes in a minor. + /// + [EnumMember(Value = "stable")] + Stable + } +} diff --git a/src/ApiGenerator/Domain/Specification/UrlInformation.cs b/src/ApiGenerator/Domain/Specification/UrlInformation.cs new file mode 100644 index 0000000000..34f7c55591 --- /dev/null +++ b/src/ApiGenerator/Domain/Specification/UrlInformation.cs @@ -0,0 +1,72 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System.Collections.Generic; +using System.Linq; + +namespace ApiGenerator.Domain.Specification +{ + + // ReSharper disable once ClassNeverInstantiated.Global + public class UrlInformation + { + public IDictionary Params { get; set; } = new SortedDictionary(); + + public IEnumerable Paths => AllPaths.Where(p => p.Deprecation == null); + public IEnumerable DeprecatedPaths => AllPaths.Where(p => p.Deprecation != null); + + public IList AllPaths = new List(); + + public IReadOnlyCollection Parts => Paths + .SelectMany(p => p.Parts) + .DistinctBy(p => p.Name) + .OrderBy(p => p.Name) + .ToList(); + + public bool IsPartless => !Parts.Any(); + + private static readonly string[] DocumentApiParts = { "index", "id" }; + + public bool IsDocumentApi => IsADocumentRoute(Parts); + + public static bool IsADocumentRoute(IReadOnlyCollection parts) => + parts.Count == DocumentApiParts.Length + && parts.All(p => DocumentApiParts.Contains(p.Name)); + + + public bool TryGetDocumentApiPath(out UrlPath path) + { + path = null; + if (!IsDocumentApi) return false; + + var mostVerbosePath = Paths.OrderByDescending(p => p.Parts.Count).First(); + path = new UrlPath(mostVerbosePath.Path, mostVerbosePath.Parts, mostVerbosePath.Deprecation, mostVerbosePath.VersionAdded, mostVerbosePath.Parts); + return true; + } + } +} diff --git a/src/ApiGenerator/Domain/Specification/UrlPart.cs b/src/ApiGenerator/Domain/Specification/UrlPart.cs new file mode 100644 index 0000000000..08a3d02089 --- /dev/null +++ b/src/ApiGenerator/Domain/Specification/UrlPart.cs @@ -0,0 +1,158 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System.Collections.Generic; + +namespace ApiGenerator.Domain.Specification +{ + public class UrlPart + { + private string _description; + + public string Argument => $"{LowLevelTypeName} {NameAsArgument}"; + + public string LowLevelTypeName + { + get + { + //TODO treat list with fixed options as Flags Enum + switch (Type) + { + case "int": //does not occur on part + case "number": //does not occur on part + case "string": + return Type; + case "list": + return "string"; + case "enum": + return Name.ToPascalCase(); + default: + return Type; + } + } + } + + public string HighLevelTypeName + { + get + { + if (ClrTypeNameOverride != null) return ClrTypeNameOverride; + + switch (Name) + { + case "category_id": return "LongId"; + case "timestamp": return "Timestamp"; + case "index_metric": return "IndexMetrics"; + case "metric": return "Metrics"; + + case "node_id" when Type == "list": + return "NodeIds"; + + case "fields" when Type == "list": + return "Fields"; + + case "parent_task_id": + case "task_id": + return "TaskId"; + + case "forecast_id": + case "action_id": + case "ids" when Type == "list": + return "Ids"; + + case "index": + case "new_index": + case "target": + return Type == "string" ? "IndexName" : "Indices"; + + case "job_id": + case "calendar_id": + case "event_id": + case "snapshot_id": + case "filter_id": + case "model_id": + case "id": + return "Id"; + + case "policy_id": + return Type == "string" ? "Id" : "Ids"; + + case "application": + case "repository": + case "snapshot": + case "target_snapshot": + case "user": + case "username": + case "realms": + case "alias": + case "context": + case "name": + case "thread_pool_patterns": + case "type": + return Type == "string" ? "Name" : "Names"; + + case "block": + return "IndexBlock"; + + case "index_uuid": + return "IndexUuid"; + + //This forces a compilation error post code generation as intended + default: return Type + "_"; + } + } + } + + public string ClrTypeNameOverride { get; set; } + + public string Description + { + get => _description; + set => _description = CleanUpDescription(value); + } + + public string InterfaceName => + Name switch + { + "repository" => "RepositoryName", + _ => Name.ToPascalCase() + }; + + public string Name { get; set; } + public string NameAsArgument => Name.ToCamelCase(); + public IEnumerable Options { get; set; } + public bool Required { get; set; } + public bool Deprecated { get; set; } + public string Type { get; set; } + + private static string CleanUpDescription(string value) => + string.IsNullOrWhiteSpace(value) + ? value + : value.Replace("use `_all` or empty string", "use the special string `_all` or Indices.All"); + } +} diff --git a/src/ApiGenerator/Domain/Specification/UrlPath.cs b/src/ApiGenerator/Domain/Specification/UrlPath.cs new file mode 100644 index 0000000000..7d77290b07 --- /dev/null +++ b/src/ApiGenerator/Domain/Specification/UrlPath.cs @@ -0,0 +1,97 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System.Collections.Generic; +using System.Linq; +using SemanticVersioning; + +namespace ApiGenerator.Domain.Specification +{ + public class UrlPath + { + private readonly IList _additionalPartsForConstructor; + public string Path { get; set; } + public Deprecation Deprecation { get; } + public Version VersionAdded { get; } + public IList Parts { get; } + + public UrlPath(string path, IList parts, Deprecation deprecation, Version versionAdded, IList additionalPartsForConstructor = null) + { + _additionalPartsForConstructor = additionalPartsForConstructor ?? new List(); + Path = LeadingBackslash(path); + Parts = parts; + Deprecation = deprecation; + VersionAdded = versionAdded; + } + + public string ConstructorArguments => string.Join(", ", Parts.Select(p => $"{p.HighLevelTypeName} {p.NameAsArgument}")); + public string RequestBaseArguments => + !Parts.Any() ? string.Empty + : "r => r." + string.Join(".", Parts.Select(p => $"{(p.Required ? "Required" : "Optional")}(\"{p.Name}\", {p.NameAsArgument})")); + + public string TypedSubClassBaseArguments => string.Join(", ", Parts.Select(p => p.NameAsArgument)); + + private static string[] ResolvabeFromT = { "index"}; + + + public bool HasResolvableArguments => Parts.Any(p => ResolvabeFromT.Contains(p.Name)); + public string AutoResolveConstructorArguments => string.Join(", ", Parts.Where(p => !ResolvabeFromT.Contains(p.Name)).Select(p => $"{p.HighLevelTypeName} {p.NameAsArgument}")); + + public string AutoResolveBaseArguments(string generic) => string.Join(", ", Parts.Select(p => !ResolvabeFromT.Contains(p.Name) ? p.Name : $"typeof({generic})")); + + public string DocumentPathBaseArgument(string generic) => string.Join(", ", + _additionalPartsForConstructor.Select(p => p.Name =="id" ? $"id ?? OpenSearch.Client.Id.From(documentWithId)" + : ResolvabeFromT.Contains(p.Name) ? $"{p.Name} ?? typeof({generic})" : p.Name)); + + public string DocumentPathConstructorArgument(string generic) => string.Join(", ", + new [] { $"{generic} documentWithId" }.Concat(_additionalPartsForConstructor.Select(p => $"{p.HighLevelTypeName} {p.NameAsArgument} = null"))); + + public string GetXmlDocs(string indent, bool skipResolvable = false, bool documentConstructor = false) + { + var doc = $@"/// {Path}"; + var parts = Parts.Where(p => !skipResolvable || !ResolvabeFromT.Contains(p.Name)).ToList(); + if (!parts.Any()) return doc; + + doc += indent; + doc += string.Join(indent, parts.Select(ParamDoc)); + return doc; + + string ParamDoc(UrlPart p) => P(p.NameAsArgument, GetDescription(p)); + + string GetDescription(UrlPart p) + { + if (documentConstructor) return "The document used to resolve the path from"; + return p.Required ? "this parameter is required" : "Optional, accepts null"; + } + } + + private string P(string name, string description) => $"/// {description}"; + + private string LeadingBackslash(string p) => p.StartsWith("/") ? p : $"/{p}"; + } +} diff --git a/src/ApiGenerator/Extensions.cs b/src/ApiGenerator/Extensions.cs new file mode 100644 index 0000000000..9484b5b428 --- /dev/null +++ b/src/ApiGenerator/Extensions.cs @@ -0,0 +1,78 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text.RegularExpressions; + +namespace ApiGenerator +{ + public static class Extensions + { + /// + /// Removes _ . but not an underscore at the start of the string, unless the string is _all or removeLeadingUnderscore == true. + /// + private static readonly Regex RemovePunctuationExceptFirstUnderScore = new Regex(@"(?!^_(?!All$))[_\.]"); + + public static IEnumerable DistinctBy(this IEnumerable items, Func property) => + items.GroupBy(property).Select(x => x.First()); + + public static string ToPascalCase(this string s, bool removeLeadingUnderscore = false) + { + if (string.IsNullOrEmpty(s)) return s; + + var textInfo = new CultureInfo("en-US").TextInfo; + var titleCased = textInfo.ToTitleCase(s.ToLowerInvariant()); + var result = RemovePunctuationExceptFirstUnderScore.Replace(titleCased, ""); + if (removeLeadingUnderscore) + result = result.TrimStart('_'); + return result; + } + + public static string ToCamelCase(this string s) + { + if (string.IsNullOrEmpty(s)) return s; + + var pascal = s.ToPascalCase(true); + if (pascal.Length <= 1) return pascal; + + return char.ToLower(pascal[0]) + pascal.Substring(1); + } + + public static string SplitPascalCase(this string s) => + Regex.Replace(s, "([A-Z]+[a-z]*)", " $1").Trim(); + + public static bool IsNullOrEmpty(this string s) => + string.IsNullOrEmpty(s); + + public static void SortBy(this List list, Func selector) => + list.Sort((a, b) => Comparer.Default.Compare(selector(a), selector(b))); + } +} diff --git a/src/ApiGenerator/Generator/ApiEndpointFactory.cs b/src/ApiGenerator/Generator/ApiEndpointFactory.cs new file mode 100644 index 0000000000..bb6915f39f --- /dev/null +++ b/src/ApiGenerator/Generator/ApiEndpointFactory.cs @@ -0,0 +1,284 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net.Mime; +using ApiGenerator.Configuration; +using ApiGenerator.Configuration.Overrides; +using ApiGenerator.Domain; +using ApiGenerator.Domain.Code; +using ApiGenerator.Domain.Specification; +using NJsonSchema; +using NJsonSchema.References; +using NSwag; +using Version = SemanticVersioning.Version; + +namespace ApiGenerator.Generator +{ + public static class ApiEndpointFactory + { + public static ApiEndpoint From(string name, List<(string HttpPath, OpenApiPathItem Path, string HttpMethod, OpenApiOperation Operation)> variants) + { + var tokens = name.Split("."); + var methodName = tokens[^1]; + var ns = tokens.Length > 1 ? tokens[0] : null; + var names = new CsharpNames(name, methodName, ns); + var overrides = LoadOverrides(name, names.MethodName); + + HashSet requiredPathParts = null; + var allParts = new Dictionary(); + var canonicalPaths = new Dictionary, UrlPath>(HashSet.CreateSetComparer()); + var deprecatedPaths = new Dictionary, UrlPath>(HashSet.CreateSetComparer()); + var overloads = new List<(UrlPath Path, List<(string From, string To)> Renames)>(); + + foreach (var (httpPath, path, _, operation) in variants.DistinctBy(v => v.HttpPath)) + { + var parts = new List(); + var partNames = new HashSet(); + var overloadedParts = new List<(string From, string To)>(); + + foreach (var param in path.Parameters + .Concat(operation.Parameters) + .Where(p => p.Kind == OpenApiParameterKind.Path)) + { + var partName = param.Name; + if (!allParts.TryGetValue(partName, out var part)) + { + part = allParts[partName] = new UrlPart + { + ClrTypeNameOverride = null, + Deprecated = param.IsDeprecated, + Description = param.Description, + Name = partName, + Type = GetOpenSearchType(param.Schema), + Options = GetEnumOptions(param.Schema) + }; + } + partNames.Add(partName); + parts.Add(part); + + if (param.Schema.XOverloadedParam() is {} overloadedParam) overloadedParts.Add((partName, overloadedParam)); + } + + parts.SortBy(p => httpPath.IndexOf($"{{{p.Name}}}", StringComparison.Ordinal)); + + var urlPath = new UrlPath(httpPath, parts, GetDeprecation(operation), operation.XVersionAdded()); + (urlPath.Deprecation == null ? canonicalPaths : deprecatedPaths).TryAdd(partNames, urlPath); + + if (overloadedParts.Count > 0) + overloads.Add((urlPath, overloadedParts)); + + if (requiredPathParts != null) + requiredPathParts.IntersectWith(partNames); + else + requiredPathParts = partNames; + } + + foreach (var (path, renames) in overloads) + { + foreach (var (from, to) in renames) + { + var newPath = path.Path.Replace($"{{{from}}}", $"{{{to}}}"); + var newParts = path.Parts.Select(p => p.Name == from ? allParts[to] : p).ToList(); + var newPartNames = newParts.Select(p => p.Name).ToHashSet(); + var newUrlPath = new UrlPath(newPath, newParts, path.Deprecation, path.VersionAdded); + (newUrlPath.Deprecation == null ? canonicalPaths : deprecatedPaths).TryAdd(newPartNames, newUrlPath); + } + } + + //some deprecated paths describe aliases to the canonical using the same path e.g + // PUT /{index}/_mapping/{type} + // PUT /{index}/{type}/_mappings + // + //The following routine dedups these occasions and prefers either the canonical path + //or the first duplicate deprecated path + + var paths = canonicalPaths.Values + .Concat(deprecatedPaths + .Where(p => !canonicalPaths.ContainsKey(p.Key)) + .Select(p => p.Value)) + .ToList(); + + ApiRequestParametersPatcher.PatchUrlPaths(name, paths, overrides); + + paths.Sort((p1, p2) => p1.Parts + .Zip(p2.Parts) + .Select(t => string.Compare(t.First.Name, t.Second.Name, StringComparison.Ordinal)) + .SkipWhile(c => c == 0) + .FirstOrDefault()); + + // // now, check for and prefer deprecated URLs + // + // var finalPathsWithDeprecations = new List(_pathsWithDeprecation.Count); + // + // foreach (var path in _pathsWithDeprecation) + // { + // if (path.Deprecation is null && + // DeprecatedPaths.SingleOrDefault(p => p.Path.Equals(path.Path, StringComparison.OrdinalIgnoreCase)) is { } match) + // { + // finalPathsWithDeprecations.Add(new UrlPath(match, OriginalParts, Paths)); + // } + // else + // { + // finalPathsWithDeprecations.Add(path); + // } + // } + + foreach (var partName in requiredPathParts ?? Enumerable.Empty()) allParts[partName].Required = true; + + IDictionary queryParams = variants.SelectMany(v => v.Path.Parameters.Concat(v.Operation.Parameters)) + .Where(p => p.Kind == OpenApiParameterKind.Query) + .DistinctBy(p => p.Name) + .ToDictionary(p => p.Name, BuildQueryParam); + queryParams = ApiRequestParametersPatcher.PatchQueryParameters(name, queryParams, overrides); + + return new ApiEndpoint + { + Name = name, + Namespace = ns, + MethodName = methodName, + CsharpNames = names, + Overrides = overrides, + Stability = Stability.Stable, // TODO: for realsies + OfficialDocumentationLink = new Documentation + { + Description = variants[0].Operation.Description, + Url = variants[0].Operation.ExternalDocumentation?.Url + }, + Url = new UrlInformation + { + AllPaths = paths, + Params = queryParams + }, + Body = variants + .Select(v => v.Operation.RequestBody) + .FirstOrDefault(b => b != null) is { } reqBody + ? new Body { Description = GetDescription(reqBody), Required = reqBody.IsRequired } + : null, + HttpMethods = variants.Select(v => v.HttpMethod.ToString().ToUpper()).Distinct().ToList(), + }; + } + + private static IEndpointOverrides LoadOverrides(string endpointName, string methodName) + { + if (CodeConfiguration.ApiNameMapping.TryGetValue(endpointName, out var mapsApiMethodName)) + methodName = mapsApiMethodName; + + var namespacePrefix = $"{typeof(GlobalOverrides).Namespace}.Endpoints."; + var typeName = $"{namespacePrefix}{methodName}Overrides"; + var type = GeneratorLocations.Assembly.GetType(typeName); + + return type != null && Activator.CreateInstance(type) is IEndpointOverrides overrides ? overrides : null; + } + + private static QueryParameters BuildQueryParam(OpenApiParameter p) + { + var param = new QueryParameters + { + Type = GetOpenSearchType(p.Schema), + Description = p.Description, + Options = GetEnumOptions(p.Schema), + Deprecated = GetDeprecation(p.Schema), + VersionAdded = p.Schema.XVersionAdded(), + }; + + if (param.Type == "enum" && p.Schema.HasReference) + param.ClsName = ((IJsonReference)p.Schema).ReferencePath.Split('/').Last(); + + return param; + } + + private static string GetOpenSearchType(JsonSchema schema) + { + schema = schema.ActualSchema; + + if (schema.XDataType() is {} dataType) + return dataType == "array" ? "list" : dataType; + + return schema.Type switch + { + JsonObjectType.String when schema.Enumeration is { Count: > 0 } => "enum", + JsonObjectType.Integer => "number", + JsonObjectType.Array => "list", + var t => t.ToString().ToLowerInvariant() + }; + } + + private static IEnumerable GetEnumOptions(JsonSchema schema) => + schema.ActualSchema.XEnumOptions() + ?? schema.ActualSchema.Enumeration?.Select(e => e.ToString()) + ?? Enumerable.Empty(); + + private static Deprecation GetDeprecation(IJsonExtensionObject schema) => + (schema.XDeprecationMessage(), schema.XVersionDeprecated()) switch + { + (null, null) => null, + var (m, v) => new Deprecation { Description = m, Version = v } + }; + + private static string GetDescription(OpenApiRequestBody requestBody) + { + if (!string.IsNullOrWhiteSpace(requestBody.Description)) + return requestBody.Description; + + return requestBody.Content.TryGetValue(MediaTypeNames.Application.Json, out var content) + ? content.Schema?.ActualSchema.Description + : null; + } + + private static string XDeprecationMessage(this IJsonExtensionObject schema) => + schema.GetExtension("x-deprecation-message") as string; + + private static string XVersionDeprecated(this IJsonExtensionObject schema) => + schema.GetExtension("x-version-deprecated") as string; + + private static Version XVersionAdded(this IJsonExtensionObject schema) => + schema.GetExtension("x-version-added") is string s + ? s.Split('.').Length switch + { + 1 => new Version($"{s}.0.0"), + 2 => new Version($"{s}.0"), + _ => new Version(s), + } + : null; + + private static string XDataType(this IJsonExtensionObject schema) => + schema.GetExtension("x-data-type") as string; + + private static string XOverloadedParam(this IJsonExtensionObject schema) => + schema.GetExtension("x-overloaded-param") as string; + + private static IEnumerable XEnumOptions(this IJsonExtensionObject schema) => + schema.GetExtension("x-enum-options") is object[] opts ? opts.Cast() : null; + + private static object GetExtension(this IJsonExtensionObject schema, string key) => + schema.ExtensionData?.TryGetValue(key, out var value) ?? false ? value : null; + } +} diff --git a/src/ApiGenerator/Generator/ApiGenerator.cs b/src/ApiGenerator/Generator/ApiGenerator.cs new file mode 100644 index 0000000000..9b0d7d4f13 --- /dev/null +++ b/src/ApiGenerator/Generator/ApiGenerator.cs @@ -0,0 +1,116 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.IO; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using ApiGenerator.Configuration; +using ApiGenerator.Domain; +using ApiGenerator.Generator.Razor; +using NJsonSchema; +using NSwag; +using ShellProgressBar; + +namespace ApiGenerator.Generator +{ + public class ApiGenerator + { + public static List Warnings { get; private set; } = new(); + + public static async Task Generate(bool lowLevelOnly, RestApiSpec spec, CancellationToken token) + { + async Task DoGenerate(IReadOnlyCollection generators, bool highLevel) + { + var pbarOpts = new ProgressBarOptions { ProgressCharacter = '─', BackgroundColor = ConsoleColor.Yellow }; + var message = $"Generating {(highLevel ? "high" : "low")} level code"; + using var pbar = new ProgressBar(generators.Count, message, pbarOpts); + foreach (var generator in generators) + { + pbar.Message = "Generating " + generator.Title; + await generator.Generate(spec, pbar, token); + pbar.Tick("Generated " + generator.Title); + } + } + + RecursiveDelete(GeneratorLocations.LowLevelGeneratedFolder); + await DoGenerate( + new RazorGeneratorBase[] { + //low level client + new LowLevelClientInterfaceGenerator(), + new LowLevelClientImplementationGenerator(), + new RequestParametersGenerator(), + new EnumsGenerator() + }, + highLevel: false + ); + + if (lowLevelOnly) return; + + RecursiveDelete(GeneratorLocations.HighLevelGeneratedFolder); + await DoGenerate( + new RazorGeneratorBase[] + { + //high level client + new ApiUrlsLookupsGenerator(), + new HighLevelClientInterfaceGenerator(), + new HighLevelClientImplementationGenerator(), + new DescriptorsGenerator(), + new RequestsGenerator(), + }, + highLevel: true + ); + } + + public static async Task CreateRestApiSpecModel(CancellationToken token = default) + { + var document = await OpenApiYamlDocument.FromFileAsync(GeneratorLocations.OpenApiSpecFile, token); + JsonSchemaReferenceUtilities.UpdateSchemaReferencePaths(document); + + var endpoints = document.Paths + .Select(kv => new { HttpPath = kv.Key, PathItem = kv.Value }) + .SelectMany(p => p.PathItem.Select(kv => new { p.HttpPath, p.PathItem, HttpMethod = kv.Key, Operation = kv.Value })) + .GroupBy(o => o.Operation.ExtensionData["x-operation-group"].ToString()) + .Where(o => CodeConfiguration.IncludeOperation(o.Key)) + .Select(o => ApiEndpointFactory.From(o.Key, o.Select(i => (i.HttpPath, i.PathItem, i.HttpMethod, i.Operation)).ToList())) + .ToImmutableSortedDictionary(e => e.Name, e => e); + + return new RestApiSpec { Endpoints = endpoints }; + } + + private static void RecursiveDelete(string path) + { + if (!Directory.Exists(path)) return; + + Directory.Delete(path, true); + } + } +} diff --git a/src/ApiGenerator/Generator/CodeGenerator.cs b/src/ApiGenerator/Generator/CodeGenerator.cs new file mode 100644 index 0000000000..9a0a5cb025 --- /dev/null +++ b/src/ApiGenerator/Generator/CodeGenerator.cs @@ -0,0 +1,122 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System; +using System.Collections.Generic; +using System.Linq; +using ApiGenerator.Domain.Code.HighLevel.Requests; +using Version = SemanticVersioning.Version; + +namespace ApiGenerator.Generator +{ + //TODO this should be in views and models + public static class CodeGenerator + { + public static string CatFormatPropertyGenerator(string type, string name, string key, string setter) => + $"public {type} {name} {{ " + + $" get => Q<{type}>(\"{key}\");" + + $" set {{ Q(\"{key}\", {setter}); SetAcceptHeader({setter}); }}" + + $"}}"; + + public static string PropertyGenerator(string type, string name, string key, string setter) => + $"public {type} {name} {{ get => Q<{type}>(\"{key}\"); set => Q(\"{key}\", {setter}); }}"; + + public static string Property(string @namespace, string type, string name, string key, string setter, string obsolete, Version versionAdded, params string[] doc) + { + var components = new List(); + foreach (var d in RenderDocumentation(doc)) A(d); + if (versionAdded != null) A($"/// Supported by OpenSearch servers of version {versionAdded} or greater."); + if (!string.IsNullOrWhiteSpace(obsolete)) A($"[Obsolete(\"{obsolete}\")]"); + + var generated = @namespace != null && @namespace == "Cat" && name == "Format" + ? CatFormatPropertyGenerator(type, name, key, setter) + : PropertyGenerator(type, name, key, setter); + + A(generated); + return string.Join($"{Environment.NewLine}\t\t", components); + + void A(string s) + { + components.Add(s); + } + } + + public static string Constructor(Constructor c) + { + var components = new List(); + if (!c.Description.IsNullOrEmpty()) A(c.Description); + var generated = c.Generated; + if (c.Body.IsNullOrEmpty()) generated += "{}"; + A(generated); + if (!c.Body.IsNullOrEmpty()) A(c.Body); + if (!c.AdditionalCode.IsNullOrEmpty()) A(c.AdditionalCode); + return string.Join($"{Environment.NewLine}\t\t", components); + + void A(string s) + { + components.Add(s); + } + } + + private static IEnumerable RenderDocumentation(params string[] doc) + { + doc = (doc?.SelectMany(WrapDocumentation) ?? Enumerable.Empty()).ToArray(); + switch (doc.Length) + { + case 0: yield break; + case 1: + yield return $"/// {doc[0]}"; + + yield break; + default: + yield return "/// "; + + foreach (var d in doc) yield return $"/// {d}"; + + yield return "/// "; + + yield break; + } + } + + private static string[] WrapDocumentation(string documentation) + { + if (string.IsNullOrWhiteSpace(documentation)) return Array.Empty(); + const int max = 140; + var lines = documentation.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); + var charCount = 0; + return lines.GroupBy(Wrap).Select(l => string.Join(" ", l.ToArray())).ToArray(); + + int Wrap(string w) + { + var increase = charCount % max + w.Length + 1 >= max ? max - charCount % max : 0; + return (charCount += increase + w.Length + 1) / max; + } + } + } +} diff --git a/src/ApiGenerator/Generator/Razor/ApiUrlsLookupsGenerator.cs b/src/ApiGenerator/Generator/Razor/ApiUrlsLookupsGenerator.cs new file mode 100644 index 0000000000..3a05ab54fb --- /dev/null +++ b/src/ApiGenerator/Generator/Razor/ApiUrlsLookupsGenerator.cs @@ -0,0 +1,49 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System.Threading; +using System.Threading.Tasks; +using ApiGenerator.Configuration; +using ApiGenerator.Domain; +using ShellProgressBar; + +namespace ApiGenerator.Generator.Razor +{ + public class ApiUrlsLookupsGenerator : RazorGeneratorBase + { + public override string Title => "OpenSearch.Client static url lookups"; + + public override async Task Generate(RestApiSpec spec, ProgressBar progressBar, CancellationToken token) + { + var view = ViewLocations.HighLevel("Requests", "ApiUrlsLookup.cshtml"); + var target = GeneratorLocations.HighLevel("ApiUrlsLookup.cs"); + + await DoRazor(spec, view, target, token); + } + } +} diff --git a/src/ApiGenerator/Generator/Razor/DescriptorsGenerator.cs b/src/ApiGenerator/Generator/Razor/DescriptorsGenerator.cs new file mode 100644 index 0000000000..647022027d --- /dev/null +++ b/src/ApiGenerator/Generator/Razor/DescriptorsGenerator.cs @@ -0,0 +1,64 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using ApiGenerator.Configuration; +using ApiGenerator.Domain; +using ApiGenerator.Domain.Code; +using ShellProgressBar; + +namespace ApiGenerator.Generator.Razor; + +public class DescriptorsGenerator : RazorGeneratorBase +{ + public override string Title => "OpenSearch.Client descriptors"; + + public override async Task Generate(RestApiSpec spec, ProgressBar progressBar, CancellationToken token) + { + await DoRazor(spec, View("RequestDescriptorBase"), Target(), token); + + await DoRazor(HttpMethod.All, View("Descriptors.Http"), Target("Http"), token); + + await DoRazorDependantFiles( + progressBar, + spec.EndpointsPerNamespaceHighLevel.ToList(), + View("Descriptors"), + kv => kv.Key, + Target, + token + ); + + return; + + string View(string name) => ViewLocations.HighLevel("Descriptors", $"{name}.cshtml"); + + string Target(string id = null) => GeneratorLocations.HighLevel($"Descriptors{(id != null ? $".{id}" : string.Empty)}.cs"); + } +} diff --git a/src/ApiGenerator/Generator/Razor/EnumsGenerator.cs b/src/ApiGenerator/Generator/Razor/EnumsGenerator.cs new file mode 100644 index 0000000000..46b45e65d8 --- /dev/null +++ b/src/ApiGenerator/Generator/Razor/EnumsGenerator.cs @@ -0,0 +1,49 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System.Threading; +using System.Threading.Tasks; +using ApiGenerator.Configuration; +using ApiGenerator.Domain; +using ShellProgressBar; + +namespace ApiGenerator.Generator.Razor +{ + public class EnumsGenerator : RazorGeneratorBase + { + public override string Title => "OpenSearch.Net enums"; + + public override async Task Generate(RestApiSpec spec, ProgressBar progressBar, CancellationToken token) + { + var view = ViewLocations.LowLevel("Enums.cshtml"); + var target = GeneratorLocations.LowLevel("Api", "Enums.cs"); + + await DoRazor(spec, view, target, token); + } + } +} diff --git a/src/ApiGenerator/Generator/Razor/HighLevelClientImplementationGenerator.cs b/src/ApiGenerator/Generator/Razor/HighLevelClientImplementationGenerator.cs new file mode 100644 index 0000000000..945de9ae74 --- /dev/null +++ b/src/ApiGenerator/Generator/Razor/HighLevelClientImplementationGenerator.cs @@ -0,0 +1,67 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using ApiGenerator.Configuration; +using ApiGenerator.Domain; +using ApiGenerator.Domain.Code; +using ApiGenerator.Domain.Specification; +using ShellProgressBar; + +namespace ApiGenerator.Generator.Razor; + +public class HighLevelClientImplementationGenerator : RazorGeneratorBase +{ + public override string Title => "OpenSearch.Client client implementation"; + + public override async Task Generate(RestApiSpec spec, ProgressBar progressBar, CancellationToken token) + { + await DoRazor(spec, View(), Target(), token); + + await DoRazor(HttpMethod.All, View("Http"), Target("Http"), token); + + await DoRazorDependantFiles( + progressBar, + spec.EndpointsPerNamespaceHighLevel.Where(kv => kv.Key != CsharpNames.RootNamespace).ToList(), + View("Namespace"), + kv => kv.Key, + Target, + token + ); + + return; + + string View(string ns = null) => ViewLocations.HighLevel("Client", "Implementation", $"OpenSearchClient{(ns != null ? $".{ns}" : string.Empty)}.cshtml"); + + string Target(string ns = null) => GeneratorLocations.HighLevel($"OpenSearchClient{(ns != null ? $".{ns}" : string.Empty)}.cs"); + } +} diff --git a/src/ApiGenerator/Generator/Razor/HighLevelClientInterfaceGenerator.cs b/src/ApiGenerator/Generator/Razor/HighLevelClientInterfaceGenerator.cs new file mode 100644 index 0000000000..1c6aafb7ac --- /dev/null +++ b/src/ApiGenerator/Generator/Razor/HighLevelClientInterfaceGenerator.cs @@ -0,0 +1,49 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System.Threading; +using System.Threading.Tasks; +using ApiGenerator.Configuration; +using ApiGenerator.Domain; +using ShellProgressBar; + +namespace ApiGenerator.Generator.Razor +{ + public class HighLevelClientInterfaceGenerator : RazorGeneratorBase + { + public override string Title => "OpenSearch.Client client interface"; + + public override async Task Generate(RestApiSpec spec, ProgressBar progressBar, CancellationToken token) + { + var view = ViewLocations.HighLevel("Client", "Interface", "IOpenSearchClient.cshtml"); + var target = GeneratorLocations.HighLevel("IOpenSearchClient.cs"); + + await DoRazor(spec, view, target, token); + } + } +} diff --git a/src/ApiGenerator/Generator/Razor/LowLevelClientImplementationGenerator.cs b/src/ApiGenerator/Generator/Razor/LowLevelClientImplementationGenerator.cs new file mode 100644 index 0000000000..c5d6328c41 --- /dev/null +++ b/src/ApiGenerator/Generator/Razor/LowLevelClientImplementationGenerator.cs @@ -0,0 +1,65 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using ApiGenerator.Configuration; +using ApiGenerator.Domain; +using ApiGenerator.Domain.Code; +using ShellProgressBar; + +namespace ApiGenerator.Generator.Razor; + +public class LowLevelClientImplementationGenerator : RazorGeneratorBase +{ + public override string Title => "OpenSearch.Net client implementation"; + + public override async Task Generate(RestApiSpec spec, ProgressBar progressBar, CancellationToken token) + { + await DoRazor(spec, View(), Target(), token); + + await DoRazor(HttpMethod.All, View("Http"), Target("Http"), token); + + await DoRazorDependantFiles( + progressBar, + spec.EndpointsPerNamespaceLowLevel.Where(kv => kv.Key != CsharpNames.RootNamespace).ToList(), + View("Namespace"), + kv => kv.Key, + Target, + token + ); + + return; + + string View(string id = null) => + ViewLocations.LowLevel("Client", "Implementation", $"OpenSearchLowLevelClient{(id != null ? $".{id}" : string.Empty)}.cshtml"); + + string Target(string id = null) => GeneratorLocations.LowLevel($"OpenSearchLowLevelClient{(id != null ? $".{id}" : string.Empty)}.cs"); + } +} diff --git a/src/ApiGenerator/Generator/Razor/LowLevelClientInterfaceGenerator.cs b/src/ApiGenerator/Generator/Razor/LowLevelClientInterfaceGenerator.cs new file mode 100644 index 0000000000..1d18a5204a --- /dev/null +++ b/src/ApiGenerator/Generator/Razor/LowLevelClientInterfaceGenerator.cs @@ -0,0 +1,49 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System.Threading; +using System.Threading.Tasks; +using ApiGenerator.Configuration; +using ApiGenerator.Domain; +using ShellProgressBar; + +namespace ApiGenerator.Generator.Razor +{ + public class LowLevelClientInterfaceGenerator : RazorGeneratorBase + { + public override string Title { get; } = "OpenSearch.Net client interface"; + + public override async Task Generate(RestApiSpec spec, ProgressBar progressBar, CancellationToken token) + { + var view = ViewLocations.LowLevel("Client", "Interface", "IOpenSearchLowLevelClient.cshtml"); + var target = GeneratorLocations.LowLevel("IOpenSearchLowLevelClient.cs"); + + await DoRazor(spec, view, target, token); + } + } +} diff --git a/src/ApiGenerator/Generator/Razor/RazorGeneratorBase.cs b/src/ApiGenerator/Generator/Razor/RazorGeneratorBase.cs new file mode 100644 index 0000000000..4d40ca84e4 --- /dev/null +++ b/src/ApiGenerator/Generator/Razor/RazorGeneratorBase.cs @@ -0,0 +1,99 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System; +using System.Collections.Generic; +using System.IO; +using System.Threading; +using System.Threading.Tasks; +using ApiGenerator.Domain; +using CSharpier; +using RazorLight; +using RazorLight.Generation; +using RazorLight.Razor; +using ShellProgressBar; + +namespace ApiGenerator.Generator.Razor +{ + public abstract class RazorGeneratorBase + { + private static readonly RazorLightEngine Engine = new RazorLightEngineBuilder() + .UseProject(new EmbeddedRazorProject(typeof(CodeTemplatePage<>).Assembly, "ApiGenerator.Views")) + .SetOperatingAssembly(typeof(CodeTemplatePage<>).Assembly) + .UseMemoryCachingProvider() + .EnableDebugMode() + .Build(); + + protected static async Task DoRazor(TModel model, string viewLocation, string targetLocation, CancellationToken token) + { + try + { + token.ThrowIfCancellationRequested(); + var generated = await Engine.CompileRenderAsync(viewLocation, model); + await WriteFormattedCsharpFile(targetLocation, generated); + } + catch (TemplateGenerationException e) + { + foreach (var d in e.Diagnostics) Console.WriteLine(d.GetMessage()); + throw; + } + } + + protected async Task DoRazorDependantFiles( + ProgressBar pbar, IReadOnlyCollection items, string viewLocation, + Func identifier, Func target, + CancellationToken token + ) + { + using var c = pbar.Spawn(items.Count, "Generating namespaces", new ProgressBarOptions + { + ProgressCharacter = '─', + ForegroundColor = ConsoleColor.Yellow + }); + foreach (var item in items) + { + var id = identifier(item); + var targetLocation = target(id); + await DoRazor(item, viewLocation, targetLocation, token); + c.Tick($"{Title}: {id}"); + } + } + + private static async Task WriteFormattedCsharpFile(string path, string contents) + { + contents = (await CodeFormatter.FormatAsync(contents)).Code; + + if (Directory.GetParent(path) is { Exists: false } dir) dir.Create(); + + await File.WriteAllTextAsync(path, contents); + } + + public abstract string Title { get; } + public abstract Task Generate(RestApiSpec spec, ProgressBar progressBar, CancellationToken token); + } +} diff --git a/src/ApiGenerator/Generator/Razor/RequestParametersGenerator.cs b/src/ApiGenerator/Generator/Razor/RequestParametersGenerator.cs new file mode 100644 index 0000000000..9187f22739 --- /dev/null +++ b/src/ApiGenerator/Generator/Razor/RequestParametersGenerator.cs @@ -0,0 +1,62 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using ApiGenerator.Configuration; +using ApiGenerator.Domain; +using ApiGenerator.Domain.Code; +using ShellProgressBar; + +namespace ApiGenerator.Generator.Razor; + +public class RequestParametersGenerator : RazorGeneratorBase +{ + public override string Title => "OpenSearch.Net request parameters"; + + public override async Task Generate(RestApiSpec spec, ProgressBar progressBar, CancellationToken token) + { + await DoRazor(HttpMethod.All, View("Http"), Target("Http"), token); + + await DoRazorDependantFiles( + progressBar, + spec.EndpointsPerNamespaceLowLevel.ToList(), + View(), + kv => kv.Key, + Target, + token + ); + + return; + + string View(string id = null) => ViewLocations.LowLevel("RequestParameters", $"RequestParameters{(id != null ? $".{id}" : string.Empty)}.cshtml"); + + string Target(string id) => GeneratorLocations.LowLevel("Api", "RequestParameters", $"RequestParameters.{id}.cs"); + } +} diff --git a/src/ApiGenerator/Generator/Razor/RequestsGenerator.cs b/src/ApiGenerator/Generator/Razor/RequestsGenerator.cs new file mode 100644 index 0000000000..0e4d0c45fe --- /dev/null +++ b/src/ApiGenerator/Generator/Razor/RequestsGenerator.cs @@ -0,0 +1,68 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.IO; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using ApiGenerator.Configuration; +using ApiGenerator.Domain; +using ApiGenerator.Domain.Code; +using ApiGenerator.Domain.Specification; +using ShellProgressBar; + +namespace ApiGenerator.Generator.Razor +{ + public class RequestsGenerator : RazorGeneratorBase + { + public override string Title => "OpenSearch.Client requests"; + + public override async Task Generate(RestApiSpec spec, ProgressBar progressBar, CancellationToken token) + { + await DoRazor(spec, View("PlainRequestBase"), Target(), token); + + await DoRazor(HttpMethod.All, View("Requests.Http"), Target("Http"), token); + + await DoRazorDependantFiles( + progressBar, + spec.EndpointsPerNamespaceHighLevel.ToList(), + View("Requests"), + kv => kv.Key, + Target, + token); + + return; + + string View(string name) => ViewLocations.HighLevel("Requests", $"{name}.cshtml"); + + string Target(string id = null) => GeneratorLocations.HighLevel($"Requests{(id != null ? $".{id}" : string.Empty)}.cs"); + } + } +} diff --git a/src/ApiGenerator/OpenSearch.openapi.json b/src/ApiGenerator/OpenSearch.openapi.json new file mode 100644 index 0000000000..fe1126c5e3 --- /dev/null +++ b/src/ApiGenerator/OpenSearch.openapi.json @@ -0,0 +1,32606 @@ +{ + "openapi": "3.0.2", + "info": { + "title": "OpenSearch", + "version": "2021-11-23" + }, + "paths": { + "/": { + "get": { + "description": "Returns basic information about the cluster.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest" + }, + "operationId": "Info", + "responses": { + "200": { + "description": "Info 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InfoResponseContent" + } + } + } + } + }, + "x-operation-group": "info", + "x-version-added": "1.0" + }, + "head": { + "description": "Returns whether the cluster is running.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest" + }, + "operationId": "Ping", + "responses": { + "200": { + "description": "Ping 200 response" + } + }, + "x-operation-group": "ping", + "x-version-added": "1.0" + } + }, + "/_alias": { + "get": { + "description": "Returns an alias.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/im-plugin/index-alias/" + }, + "operationId": "IndicesGetAlias", + "parameters": [ + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + } + ], + "responses": { + "200": { + "description": "IndicesGetAlias 200 response" + } + }, + "x-operation-group": "indices.get_alias", + "x-version-added": "1.0" + } + }, + "/_alias/{name}": { + "get": { + "description": "Returns an alias.", + "operationId": "IndicesGetAlias_WithName", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Comma-separated list of alias names.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of alias names.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + } + ], + "responses": { + "200": { + "description": "IndicesGetAlias_WithName 200 response" + } + }, + "x-operation-group": "indices.get_alias", + "x-version-added": "1.0" + }, + "head": { + "description": "Returns information about whether a particular alias exists.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest" + }, + "operationId": "IndicesExistsAlias", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Comma-separated list of alias names.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of alias names.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + } + ], + "responses": { + "200": { + "description": "IndicesExistsAlias 200 response" + } + }, + "x-operation-group": "indices.exists_alias", + "x-version-added": "1.0" + } + }, + "/_aliases": { + "post": { + "description": "Updates index aliases.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/alias/" + }, + "operationId": "IndicesUpdateAliases", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndicesUpdateAliases_BodyParams" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "IndicesUpdateAliases 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndicesUpdateAliasesResponseContent" + } + } + } + } + }, + "x-operation-group": "indices.update_aliases", + "x-version-added": "1.0" + } + }, + "/_analyze": { + "get": { + "description": "Performs the analysis process on a text and return the tokens breakdown of the text.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/analyze-apis/perform-text-analysis/" + }, + "operationId": "IndicesAnalyze_Get", + "parameters": [ + { + "name": "index", + "in": "query", + "description": "The name of the index to scope the operation.", + "schema": { + "type": "string", + "description": "The name of the index to scope the operation." + } + } + ], + "responses": { + "200": { + "description": "IndicesAnalyze_Get 200 response" + } + }, + "x-operation-group": "indices.analyze", + "x-version-added": "1.0" + }, + "post": { + "description": "Performs the analysis process on a text and return the tokens breakdown of the text.", + "operationId": "IndicesAnalyze_Post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndicesAnalyze_BodyParams" + } + } + } + }, + "parameters": [ + { + "name": "index", + "in": "query", + "description": "The name of the index to scope the operation.", + "schema": { + "type": "string", + "description": "The name of the index to scope the operation." + } + } + ], + "responses": { + "200": { + "description": "IndicesAnalyze_Post 200 response" + } + }, + "x-operation-group": "indices.analyze", + "x-version-added": "1.0" + } + }, + "/_bulk": { + "post": { + "description": "Allows to perform multiple index/update/delete operations in a single request.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/document-apis/bulk/" + }, + "operationId": "Bulk_Post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Bulk_BodyParams" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "wait_for_active_shards", + "in": "query", + "description": "Sets the number of shard copies that must be active before proceeding with the 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).", + "schema": { + "type": "string", + "default": "1", + "description": "Sets the number of shard copies that must be active before proceeding with the 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)." + } + }, + { + "name": "refresh", + "in": "query", + "description": "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.", + "schema": { + "$ref": "#/components/schemas/RefreshEnum" + } + }, + { + "name": "routing", + "in": "query", + "description": "Routing value.", + "schema": { + "type": "string", + "description": "Routing value." + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "type", + "in": "query", + "description": "Default document type for items which don't provide one.", + "schema": { + "type": "string", + "description": "Default document type for items which don't provide one." + } + }, + { + "name": "_source", + "in": "query", + "description": "True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-request.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-request." + }, + "explode": true + }, + { + "name": "_source_excludes", + "in": "query", + "description": "Default list of fields to exclude from the returned _source field, can be overridden on each sub-request.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Default list of fields to exclude from the returned _source field, can be overridden on each sub-request." + }, + "explode": true + }, + { + "name": "_source_includes", + "in": "query", + "description": "Default list of fields to extract and return from the _source field, can be overridden on each sub-request.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Default list of fields to extract and return from the _source field, can be overridden on each sub-request." + }, + "explode": true + }, + { + "name": "pipeline", + "in": "query", + "description": "The pipeline id to preprocess incoming documents with.", + "schema": { + "type": "string", + "description": "The pipeline id to preprocess incoming documents with." + } + }, + { + "name": "require_alias", + "in": "query", + "description": "Sets require_alias for all incoming documents.", + "schema": { + "type": "boolean", + "default": false, + "description": "Sets require_alias for all incoming documents." + } + } + ], + "responses": { + "200": { + "description": "Bulk_Post 200 response" + } + }, + "x-operation-group": "bulk", + "x-version-added": "1.0" + }, + "put": { + "description": "Allows to perform multiple index/update/delete operations in a single request.", + "operationId": "Bulk_Put", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Bulk_BodyParams" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "wait_for_active_shards", + "in": "query", + "description": "Sets the number of shard copies that must be active before proceeding with the 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).", + "schema": { + "type": "string", + "default": "1", + "description": "Sets the number of shard copies that must be active before proceeding with the 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)." + } + }, + { + "name": "refresh", + "in": "query", + "description": "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.", + "schema": { + "$ref": "#/components/schemas/RefreshEnum" + } + }, + { + "name": "routing", + "in": "query", + "description": "Routing value.", + "schema": { + "type": "string", + "description": "Routing value." + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "type", + "in": "query", + "description": "Default document type for items which don't provide one.", + "schema": { + "type": "string", + "description": "Default document type for items which don't provide one." + } + }, + { + "name": "_source", + "in": "query", + "description": "True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-request.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-request." + }, + "explode": true + }, + { + "name": "_source_excludes", + "in": "query", + "description": "Default list of fields to exclude from the returned _source field, can be overridden on each sub-request.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Default list of fields to exclude from the returned _source field, can be overridden on each sub-request." + }, + "explode": true + }, + { + "name": "_source_includes", + "in": "query", + "description": "Default list of fields to extract and return from the _source field, can be overridden on each sub-request.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Default list of fields to extract and return from the _source field, can be overridden on each sub-request." + }, + "explode": true + }, + { + "name": "pipeline", + "in": "query", + "description": "The pipeline id to preprocess incoming documents with.", + "schema": { + "type": "string", + "description": "The pipeline id to preprocess incoming documents with." + } + }, + { + "name": "require_alias", + "in": "query", + "description": "Sets require_alias for all incoming documents.", + "schema": { + "type": "boolean", + "default": false, + "description": "Sets require_alias for all incoming documents." + } + } + ], + "responses": { + "200": { + "description": "Bulk_Put 200 response" + } + }, + "x-operation-group": "bulk", + "x-version-added": "1.0" + } + }, + "/_cache/clear": { + "post": { + "description": "Clears all or specific caches for one or more indices.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/index-apis/clear-index-cache/" + }, + "operationId": "IndicesClearCache", + "parameters": [ + { + "name": "fielddata", + "in": "query", + "description": "Clear field data.", + "schema": { + "type": "boolean", + "description": "Clear field data." + } + }, + { + "name": "fields", + "in": "query", + "description": "Comma-separated list of fields to clear when using the `fielddata` parameter (default: all).", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields to clear when using the `fielddata` parameter (default: all)." + }, + "explode": true + }, + { + "name": "query", + "in": "query", + "description": "Clear query caches.", + "schema": { + "type": "boolean", + "description": "Clear query caches." + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "index", + "in": "query", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices." + }, + "explode": true + }, + { + "name": "request", + "in": "query", + "description": "Clear request cache.", + "schema": { + "type": "boolean", + "description": "Clear request cache." + } + } + ], + "responses": { + "200": { + "description": "IndicesClearCache 200 response" + } + }, + "x-operation-group": "indices.clear_cache", + "x-version-added": "1.0" + } + }, + "/_cat": { + "get": { + "description": "Returns help for the Cat APIs.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/cat/index/" + }, + "operationId": "CatHelp", + "parameters": [ + { + "name": "help", + "in": "query", + "description": "Return help information.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return help information." + } + }, + { + "name": "s", + "in": "query", + "description": "Comma-separated list of column names or column aliases to sort by.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names or column aliases to sort by." + }, + "explode": true + } + ], + "responses": { + "200": { + "description": "CatHelp 200 response" + } + }, + "x-operation-group": "cat.help", + "x-version-added": "1.0" + } + }, + "/_cat/aliases": { + "get": { + "description": "Shows information about currently configured aliases to indices including filter and routing infos.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/cat/cat-aliases/" + }, + "operationId": "CatAliases", + "parameters": [ + { + "name": "format", + "in": "query", + "description": "A short version of the Accept header, e.g. json, yaml.", + "schema": { + "type": "string", + "description": "A short version of the Accept header, e.g. json, yaml." + } + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + }, + { + "name": "h", + "in": "query", + "description": "Comma-separated list of column names to display.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names to display." + }, + "explode": true + }, + { + "name": "help", + "in": "query", + "description": "Return help information.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return help information." + } + }, + { + "name": "s", + "in": "query", + "description": "Comma-separated list of column names or column aliases to sort by.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names or column aliases to sort by." + }, + "explode": true + }, + { + "name": "v", + "in": "query", + "description": "Verbose mode. Display column headers.", + "schema": { + "type": "boolean", + "default": false, + "description": "Verbose mode. Display column headers." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + } + ], + "responses": { + "200": { + "description": "CatAliases 200 response" + } + }, + "x-operation-group": "cat.aliases", + "x-version-added": "1.0" + } + }, + "/_cat/aliases/{name}": { + "get": { + "description": "Shows information about currently configured aliases to indices including filter and routing infos.", + "operationId": "CatAliases_WithName", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Comma-separated list of alias names.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of alias names.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "format", + "in": "query", + "description": "A short version of the Accept header, e.g. json, yaml.", + "schema": { + "type": "string", + "description": "A short version of the Accept header, e.g. json, yaml." + } + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + }, + { + "name": "h", + "in": "query", + "description": "Comma-separated list of column names to display.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names to display." + }, + "explode": true + }, + { + "name": "help", + "in": "query", + "description": "Return help information.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return help information." + } + }, + { + "name": "s", + "in": "query", + "description": "Comma-separated list of column names or column aliases to sort by.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names or column aliases to sort by." + }, + "explode": true + }, + { + "name": "v", + "in": "query", + "description": "Verbose mode. Display column headers.", + "schema": { + "type": "boolean", + "default": false, + "description": "Verbose mode. Display column headers." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + } + ], + "responses": { + "200": { + "description": "CatAliases_WithName 200 response" + } + }, + "x-operation-group": "cat.aliases", + "x-version-added": "1.0" + } + }, + "/_cat/allocation": { + "get": { + "description": "Provides a snapshot of how many shards are allocated to each data node and how much disk space they are using.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/cat/cat-allocation/" + }, + "operationId": "CatAllocation", + "parameters": [ + { + "name": "format", + "in": "query", + "description": "A short version of the Accept header, e.g. json, yaml.", + "schema": { + "type": "string", + "description": "A short version of the Accept header, e.g. json, yaml." + } + }, + { + "name": "bytes", + "in": "query", + "description": "The unit in which to display byte values.", + "schema": { + "$ref": "#/components/schemas/Bytes" + } + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "h", + "in": "query", + "description": "Comma-separated list of column names to display.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names to display." + }, + "explode": true + }, + { + "name": "help", + "in": "query", + "description": "Return help information.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return help information." + } + }, + { + "name": "s", + "in": "query", + "description": "Comma-separated list of column names or column aliases to sort by.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names or column aliases to sort by." + }, + "explode": true + }, + { + "name": "v", + "in": "query", + "description": "Verbose mode. Display column headers.", + "schema": { + "type": "boolean", + "default": false, + "description": "Verbose mode. Display column headers." + } + } + ], + "responses": { + "200": { + "description": "CatAllocation 200 response" + } + }, + "x-operation-group": "cat.allocation", + "x-version-added": "1.0" + } + }, + "/_cat/allocation/{node_id}": { + "get": { + "description": "Provides a snapshot of how many shards are allocated to each data node and how much disk space they are using.", + "operationId": "CatAllocation_WithNodeId", + "parameters": [ + { + "name": "node_id", + "in": "path", + "description": "Comma-separated list of node IDs or names to limit the returned information.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of node IDs or names to limit the returned information.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "format", + "in": "query", + "description": "A short version of the Accept header, e.g. json, yaml.", + "schema": { + "type": "string", + "description": "A short version of the Accept header, e.g. json, yaml." + } + }, + { + "name": "bytes", + "in": "query", + "description": "The unit in which to display byte values.", + "schema": { + "$ref": "#/components/schemas/Bytes" + } + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "h", + "in": "query", + "description": "Comma-separated list of column names to display.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names to display." + }, + "explode": true + }, + { + "name": "help", + "in": "query", + "description": "Return help information.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return help information." + } + }, + { + "name": "s", + "in": "query", + "description": "Comma-separated list of column names or column aliases to sort by.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names or column aliases to sort by." + }, + "explode": true + }, + { + "name": "v", + "in": "query", + "description": "Verbose mode. Display column headers.", + "schema": { + "type": "boolean", + "default": false, + "description": "Verbose mode. Display column headers." + } + } + ], + "responses": { + "200": { + "description": "CatAllocation_WithNodeId 200 response" + } + }, + "x-operation-group": "cat.allocation", + "x-version-added": "1.0" + } + }, + "/_cat/cluster_manager": { + "get": { + "description": "Returns information about the cluster-manager node.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/cat/cat-cluster_manager/" + }, + "operationId": "CatClusterManager", + "parameters": [ + { + "name": "format", + "in": "query", + "description": "A short version of the Accept header, e.g. json, yaml.", + "schema": { + "type": "string", + "description": "A short version of the Accept header, e.g. json, yaml." + } + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "h", + "in": "query", + "description": "Comma-separated list of column names to display.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names to display." + }, + "explode": true + }, + { + "name": "help", + "in": "query", + "description": "Return help information.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return help information." + } + }, + { + "name": "s", + "in": "query", + "description": "Comma-separated list of column names or column aliases to sort by.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names or column aliases to sort by." + }, + "explode": true + }, + { + "name": "v", + "in": "query", + "description": "Verbose mode. Display column headers.", + "schema": { + "type": "boolean", + "default": false, + "description": "Verbose mode. Display column headers." + } + } + ], + "responses": { + "200": { + "description": "CatClusterManager 200 response" + } + }, + "x-operation-group": "cat.cluster_manager", + "x-version-added": "1.0" + } + }, + "/_cat/count": { + "get": { + "description": "Provides quick access to the document count of the entire cluster, or individual indices.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/cat/cat-count/" + }, + "operationId": "CatCount", + "parameters": [ + { + "name": "format", + "in": "query", + "description": "A short version of the Accept header, e.g. json, yaml.", + "schema": { + "type": "string", + "description": "A short version of the Accept header, e.g. json, yaml." + } + }, + { + "name": "h", + "in": "query", + "description": "Comma-separated list of column names to display.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names to display." + }, + "explode": true + }, + { + "name": "help", + "in": "query", + "description": "Return help information.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return help information." + } + }, + { + "name": "s", + "in": "query", + "description": "Comma-separated list of column names or column aliases to sort by.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names or column aliases to sort by." + }, + "explode": true + }, + { + "name": "v", + "in": "query", + "description": "Verbose mode. Display column headers.", + "schema": { + "type": "boolean", + "default": false, + "description": "Verbose mode. Display column headers." + } + } + ], + "responses": { + "200": { + "description": "CatCount 200 response" + } + }, + "x-operation-group": "cat.count", + "x-version-added": "1.0" + } + }, + "/_cat/count/{index}": { + "get": { + "description": "Provides quick access to the document count of the entire cluster, or individual indices.", + "operationId": "CatCount_WithIndex", + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices to limit the returned information.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices to limit the returned information.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "format", + "in": "query", + "description": "A short version of the Accept header, e.g. json, yaml.", + "schema": { + "type": "string", + "description": "A short version of the Accept header, e.g. json, yaml." + } + }, + { + "name": "h", + "in": "query", + "description": "Comma-separated list of column names to display.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names to display." + }, + "explode": true + }, + { + "name": "help", + "in": "query", + "description": "Return help information.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return help information." + } + }, + { + "name": "s", + "in": "query", + "description": "Comma-separated list of column names or column aliases to sort by.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names or column aliases to sort by." + }, + "explode": true + }, + { + "name": "v", + "in": "query", + "description": "Verbose mode. Display column headers.", + "schema": { + "type": "boolean", + "default": false, + "description": "Verbose mode. Display column headers." + } + } + ], + "responses": { + "200": { + "description": "CatCount_WithIndex 200 response" + } + }, + "x-operation-group": "cat.count", + "x-version-added": "1.0" + } + }, + "/_cat/fielddata": { + "get": { + "description": "Shows how much heap memory is currently being used by fielddata on every data node in the cluster.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/cat/cat-field-data/" + }, + "operationId": "CatFielddata", + "parameters": [ + { + "name": "format", + "in": "query", + "description": "A short version of the Accept header, e.g. json, yaml.", + "schema": { + "type": "string", + "description": "A short version of the Accept header, e.g. json, yaml." + } + }, + { + "name": "bytes", + "in": "query", + "description": "The unit in which to display byte values.", + "schema": { + "$ref": "#/components/schemas/Bytes" + } + }, + { + "name": "h", + "in": "query", + "description": "Comma-separated list of column names to display.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names to display." + }, + "explode": true + }, + { + "name": "help", + "in": "query", + "description": "Return help information.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return help information." + } + }, + { + "name": "s", + "in": "query", + "description": "Comma-separated list of column names or column aliases to sort by.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names or column aliases to sort by." + }, + "explode": true + }, + { + "name": "v", + "in": "query", + "description": "Verbose mode. Display column headers.", + "schema": { + "type": "boolean", + "default": false, + "description": "Verbose mode. Display column headers." + } + }, + { + "name": "fields", + "in": "query", + "description": "Comma-separated list of fields to return in the output.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields to return in the output." + }, + "explode": true + } + ], + "responses": { + "200": { + "description": "CatFielddata 200 response" + } + }, + "x-operation-group": "cat.fielddata", + "x-version-added": "1.0" + } + }, + "/_cat/fielddata/{fields}": { + "get": { + "description": "Shows how much heap memory is currently being used by fielddata on every data node in the cluster.", + "operationId": "CatFielddata_WithFields", + "parameters": [ + { + "name": "fields", + "in": "path", + "description": "Comma-separated list of fields to return the fielddata size.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of fields to return the fielddata size.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "format", + "in": "query", + "description": "A short version of the Accept header, e.g. json, yaml.", + "schema": { + "type": "string", + "description": "A short version of the Accept header, e.g. json, yaml." + } + }, + { + "name": "bytes", + "in": "query", + "description": "The unit in which to display byte values.", + "schema": { + "$ref": "#/components/schemas/Bytes" + } + }, + { + "name": "h", + "in": "query", + "description": "Comma-separated list of column names to display.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names to display." + }, + "explode": true + }, + { + "name": "help", + "in": "query", + "description": "Return help information.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return help information." + } + }, + { + "name": "s", + "in": "query", + "description": "Comma-separated list of column names or column aliases to sort by.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names or column aliases to sort by." + }, + "explode": true + }, + { + "name": "v", + "in": "query", + "description": "Verbose mode. Display column headers.", + "schema": { + "type": "boolean", + "default": false, + "description": "Verbose mode. Display column headers." + } + }, + { + "name": "fields", + "in": "query", + "description": "Comma-separated list of fields to return in the output.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields to return in the output." + }, + "explode": true + } + ], + "responses": { + "200": { + "description": "CatFielddata_WithFields 200 response" + } + }, + "x-operation-group": "cat.fielddata", + "x-version-added": "1.0" + } + }, + "/_cat/health": { + "get": { + "description": "Returns a concise representation of the cluster health.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/cat/cat-health/" + }, + "operationId": "CatHealth", + "parameters": [ + { + "name": "format", + "in": "query", + "description": "A short version of the Accept header, e.g. json, yaml.", + "schema": { + "type": "string", + "description": "A short version of the Accept header, e.g. json, yaml." + } + }, + { + "name": "h", + "in": "query", + "description": "Comma-separated list of column names to display.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names to display." + }, + "explode": true + }, + { + "name": "help", + "in": "query", + "description": "Return help information.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return help information." + } + }, + { + "name": "s", + "in": "query", + "description": "Comma-separated list of column names or column aliases to sort by.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names or column aliases to sort by." + }, + "explode": true + }, + { + "name": "time", + "in": "query", + "description": "The unit in which to display time values.", + "schema": { + "$ref": "#/components/schemas/Time" + } + }, + { + "name": "ts", + "in": "query", + "description": "Set to false to disable timestamping.", + "schema": { + "type": "boolean", + "default": true, + "description": "Set to false to disable timestamping." + } + }, + { + "name": "v", + "in": "query", + "description": "Verbose mode. Display column headers.", + "schema": { + "type": "boolean", + "default": false, + "description": "Verbose mode. Display column headers." + } + } + ], + "responses": { + "200": { + "description": "CatHealth 200 response" + } + }, + "x-operation-group": "cat.health", + "x-version-added": "1.0" + } + }, + "/_cat/indices": { + "get": { + "description": "Returns information about indices: number of primaries and replicas, document counts, disk size, ...", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/cat/cat-indices/" + }, + "operationId": "CatIndices", + "parameters": [ + { + "name": "format", + "in": "query", + "description": "A short version of the Accept header, e.g. json, yaml.", + "schema": { + "type": "string", + "description": "A short version of the Accept header, e.g. json, yaml." + } + }, + { + "name": "bytes", + "in": "query", + "description": "The unit in which to display byte values.", + "schema": { + "$ref": "#/components/schemas/Bytes" + } + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "h", + "in": "query", + "description": "Comma-separated list of column names to display.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names to display." + }, + "explode": true + }, + { + "name": "health", + "in": "query", + "description": "Health status ('green', 'yellow', or 'red') to filter only indices matching the specified health status.", + "schema": { + "$ref": "#/components/schemas/Health" + } + }, + { + "name": "help", + "in": "query", + "description": "Return help information.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return help information." + } + }, + { + "name": "pri", + "in": "query", + "description": "Set to true to return stats only for primary shards.", + "schema": { + "type": "boolean", + "default": false, + "description": "Set to true to return stats only for primary shards." + } + }, + { + "name": "s", + "in": "query", + "description": "Comma-separated list of column names or column aliases to sort by.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names or column aliases to sort by." + }, + "explode": true + }, + { + "name": "time", + "in": "query", + "description": "The unit in which to display time values.", + "schema": { + "$ref": "#/components/schemas/Time" + } + }, + { + "name": "v", + "in": "query", + "description": "Verbose mode. Display column headers.", + "schema": { + "type": "boolean", + "default": false, + "description": "Verbose mode. Display column headers." + } + }, + { + "name": "include_unloaded_segments", + "in": "query", + "description": "If set to true segment stats will include stats for segments that are not currently loaded into memory.", + "schema": { + "type": "boolean", + "default": false, + "description": "If set to true segment stats will include stats for segments that are not currently loaded into memory." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + } + ], + "responses": { + "200": { + "description": "CatIndices 200 response" + } + }, + "x-operation-group": "cat.indices", + "x-version-added": "1.0" + } + }, + "/_cat/indices/{index}": { + "get": { + "description": "Returns information about indices: number of primaries and replicas, document counts, disk size, ...", + "operationId": "CatIndices_WithIndex", + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices to limit the returned information.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices to limit the returned information.", + "x-data-type": "array" + }, + "required": true, + "examples": { + "CatIndices_WithIndex_example1": { + "summary": "Examples for Cat indices with Index Operation.", + "description": "", + "value": "books" + } + } + }, + { + "name": "format", + "in": "query", + "description": "A short version of the Accept header, e.g. json, yaml.", + "schema": { + "type": "string", + "description": "A short version of the Accept header, e.g. json, yaml." + } + }, + { + "name": "bytes", + "in": "query", + "description": "The unit in which to display byte values.", + "schema": { + "$ref": "#/components/schemas/Bytes" + } + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "h", + "in": "query", + "description": "Comma-separated list of column names to display.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names to display." + }, + "explode": true + }, + { + "name": "health", + "in": "query", + "description": "Health status ('green', 'yellow', or 'red') to filter only indices matching the specified health status.", + "schema": { + "$ref": "#/components/schemas/Health" + } + }, + { + "name": "help", + "in": "query", + "description": "Return help information.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return help information." + } + }, + { + "name": "pri", + "in": "query", + "description": "Set to true to return stats only for primary shards.", + "schema": { + "type": "boolean", + "default": false, + "description": "Set to true to return stats only for primary shards." + } + }, + { + "name": "s", + "in": "query", + "description": "Comma-separated list of column names or column aliases to sort by.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names or column aliases to sort by." + }, + "explode": true + }, + { + "name": "time", + "in": "query", + "description": "The unit in which to display time values.", + "schema": { + "$ref": "#/components/schemas/Time" + } + }, + { + "name": "v", + "in": "query", + "description": "Verbose mode. Display column headers.", + "schema": { + "type": "boolean", + "default": false, + "description": "Verbose mode. Display column headers." + } + }, + { + "name": "include_unloaded_segments", + "in": "query", + "description": "If set to true segment stats will include stats for segments that are not currently loaded into memory.", + "schema": { + "type": "boolean", + "default": false, + "description": "If set to true segment stats will include stats for segments that are not currently loaded into memory." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + } + ], + "responses": { + "200": { + "description": "CatIndices_WithIndex 200 response" + } + }, + "x-operation-group": "cat.indices", + "x-version-added": "1.0" + } + }, + "/_cat/master": { + "get": { + "description": "Returns information about the cluster-manager node.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/cat/cat-cluster_manager/" + }, + "operationId": "CatMaster", + "deprecated": true, + "parameters": [ + { + "name": "format", + "in": "query", + "description": "A short version of the Accept header, e.g. json, yaml.", + "schema": { + "type": "string", + "description": "A short version of the Accept header, e.g. json, yaml." + } + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "h", + "in": "query", + "description": "Comma-separated list of column names to display.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names to display." + }, + "explode": true + }, + { + "name": "help", + "in": "query", + "description": "Return help information.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return help information." + } + }, + { + "name": "s", + "in": "query", + "description": "Comma-separated list of column names or column aliases to sort by.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names or column aliases to sort by." + }, + "explode": true + }, + { + "name": "v", + "in": "query", + "description": "Verbose mode. Display column headers.", + "schema": { + "type": "boolean", + "default": false, + "description": "Verbose mode. Display column headers." + } + } + ], + "responses": { + "200": { + "description": "CatMaster 200 response" + } + }, + "x-deprecation-message": "To promote inclusive language, please use '/_cat/cluster_manager' instead.", + "x-operation-group": "cat.master", + "x-version-added": "1.0", + "x-version-deprecated": "1.0" + } + }, + "/_cat/nodeattrs": { + "get": { + "description": "Returns information about custom node attributes.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/cat/cat-nodeattrs/" + }, + "operationId": "CatNodeattrs", + "parameters": [ + { + "name": "format", + "in": "query", + "description": "A short version of the Accept header, e.g. json, yaml.", + "schema": { + "type": "string", + "description": "A short version of the Accept header, e.g. json, yaml." + } + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "h", + "in": "query", + "description": "Comma-separated list of column names to display.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names to display." + }, + "explode": true + }, + { + "name": "help", + "in": "query", + "description": "Return help information.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return help information." + } + }, + { + "name": "s", + "in": "query", + "description": "Comma-separated list of column names or column aliases to sort by.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names or column aliases to sort by." + }, + "explode": true + }, + { + "name": "v", + "in": "query", + "description": "Verbose mode. Display column headers.", + "schema": { + "type": "boolean", + "default": false, + "description": "Verbose mode. Display column headers." + } + } + ], + "responses": { + "200": { + "description": "CatNodeattrs 200 response" + } + }, + "x-operation-group": "cat.nodeattrs", + "x-version-added": "1.0" + } + }, + "/_cat/nodes": { + "get": { + "description": "Returns basic statistics about performance of cluster nodes.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/cat/cat-nodes/" + }, + "operationId": "CatNodes", + "parameters": [ + { + "name": "bytes", + "in": "query", + "description": "The unit in which to display byte values.", + "schema": { + "$ref": "#/components/schemas/Bytes" + } + }, + { + "name": "format", + "in": "query", + "description": "A short version of the Accept header, e.g. json, yaml.", + "schema": { + "type": "string", + "description": "A short version of the Accept header, e.g. json, yaml." + } + }, + { + "name": "full_id", + "in": "query", + "description": "Return the full node ID instead of the shortened version.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return the full node ID instead of the shortened version." + } + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "x-version-deprecated": "1.0", + "x-deprecation-message": "This parameter does not cause this API to act locally.", + "deprecated": true + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "h", + "in": "query", + "description": "Comma-separated list of column names to display.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names to display." + }, + "explode": true + }, + { + "name": "help", + "in": "query", + "description": "Return help information.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return help information." + } + }, + { + "name": "s", + "in": "query", + "description": "Comma-separated list of column names or column aliases to sort by.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names or column aliases to sort by." + }, + "explode": true + }, + { + "name": "time", + "in": "query", + "description": "The unit in which to display time values.", + "schema": { + "$ref": "#/components/schemas/Time" + } + }, + { + "name": "v", + "in": "query", + "description": "Verbose mode. Display column headers.", + "schema": { + "type": "boolean", + "default": false, + "description": "Verbose mode. Display column headers." + } + } + ], + "responses": { + "200": { + "description": "CatNodes 200 response" + } + }, + "x-operation-group": "cat.nodes", + "x-version-added": "1.0" + } + }, + "/_cat/pending_tasks": { + "get": { + "description": "Returns a concise representation of the cluster pending tasks.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/cat/cat-pending-tasks/" + }, + "operationId": "CatPendingTasks", + "parameters": [ + { + "name": "format", + "in": "query", + "description": "A short version of the Accept header, e.g. json, yaml.", + "schema": { + "type": "string", + "description": "A short version of the Accept header, e.g. json, yaml." + } + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "h", + "in": "query", + "description": "Comma-separated list of column names to display.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names to display." + }, + "explode": true + }, + { + "name": "help", + "in": "query", + "description": "Return help information.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return help information." + } + }, + { + "name": "s", + "in": "query", + "description": "Comma-separated list of column names or column aliases to sort by.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names or column aliases to sort by." + }, + "explode": true + }, + { + "name": "time", + "in": "query", + "description": "The unit in which to display time values.", + "schema": { + "$ref": "#/components/schemas/Time" + } + }, + { + "name": "v", + "in": "query", + "description": "Verbose mode. Display column headers.", + "schema": { + "type": "boolean", + "default": false, + "description": "Verbose mode. Display column headers." + } + } + ], + "responses": { + "200": { + "description": "CatPendingTasks 200 response" + } + }, + "x-operation-group": "cat.pending_tasks", + "x-version-added": "1.0" + } + }, + "/_cat/pit_segments": { + "get": { + "description": "List segments for one or several PITs.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/search-plugins/point-in-time-api/" + }, + "operationId": "CatPitSegments", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CatPitSegments_BodyParams" + } + } + } + }, + "responses": { + "200": { + "description": "CatPitSegments 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CatPitSegmentsResponseContent" + } + } + } + } + }, + "x-operation-group": "cat.pit_segments", + "x-version-added": "2.4" + } + }, + "/_cat/pit_segments/_all": { + "get": { + "description": "Lists all active point-in-time segments.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/search-plugins/point-in-time-api/" + }, + "operationId": "CatAllPitSegments", + "responses": { + "200": { + "description": "CatAllPitSegments 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CatAllPitSegmentsResponseContent" + } + } + } + } + }, + "x-operation-group": "cat.all_pit_segments", + "x-version-added": "2.4" + } + }, + "/_cat/plugins": { + "get": { + "description": "Returns information about installed plugins across nodes node.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/cat/cat-plugins/" + }, + "operationId": "CatPlugins", + "parameters": [ + { + "name": "format", + "in": "query", + "description": "A short version of the Accept header, e.g. json, yaml.", + "schema": { + "type": "string", + "description": "A short version of the Accept header, e.g. json, yaml." + } + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "h", + "in": "query", + "description": "Comma-separated list of column names to display.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names to display." + }, + "explode": true + }, + { + "name": "help", + "in": "query", + "description": "Return help information.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return help information." + } + }, + { + "name": "s", + "in": "query", + "description": "Comma-separated list of column names or column aliases to sort by.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names or column aliases to sort by." + }, + "explode": true + }, + { + "name": "v", + "in": "query", + "description": "Verbose mode. Display column headers.", + "schema": { + "type": "boolean", + "default": false, + "description": "Verbose mode. Display column headers." + } + } + ], + "responses": { + "200": { + "description": "CatPlugins 200 response" + } + }, + "x-operation-group": "cat.plugins", + "x-version-added": "1.0" + } + }, + "/_cat/recovery": { + "get": { + "description": "Returns information about index shard recoveries, both on-going completed.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/cat/cat-plugins/" + }, + "operationId": "CatRecovery", + "parameters": [ + { + "name": "format", + "in": "query", + "description": "A short version of the Accept header, e.g. json, yaml.", + "schema": { + "type": "string", + "description": "A short version of the Accept header, e.g. json, yaml." + } + }, + { + "name": "active_only", + "in": "query", + "description": "If `true`, the response only includes ongoing shard recoveries.", + "schema": { + "type": "boolean", + "default": false, + "description": "If `true`, the response only includes ongoing shard recoveries." + } + }, + { + "name": "bytes", + "in": "query", + "description": "The unit in which to display byte values.", + "schema": { + "$ref": "#/components/schemas/Bytes" + } + }, + { + "name": "detailed", + "in": "query", + "description": "If `true`, the response includes detailed information about shard recoveries.", + "schema": { + "type": "boolean", + "default": false, + "description": "If `true`, the response includes detailed information about shard recoveries." + } + }, + { + "name": "h", + "in": "query", + "description": "Comma-separated list of column names to display.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names to display." + }, + "explode": true + }, + { + "name": "help", + "in": "query", + "description": "Return help information.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return help information." + } + }, + { + "name": "index", + "in": "query", + "description": "Comma-separated list or wildcard expression of index names to limit the returned information.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list or wildcard expression of index names to limit the returned information." + }, + "explode": true + }, + { + "name": "s", + "in": "query", + "description": "Comma-separated list of column names or column aliases to sort by.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names or column aliases to sort by." + }, + "explode": true + }, + { + "name": "time", + "in": "query", + "description": "The unit in which to display time values.", + "schema": { + "$ref": "#/components/schemas/Time" + } + }, + { + "name": "v", + "in": "query", + "description": "Verbose mode. Display column headers.", + "schema": { + "type": "boolean", + "default": false, + "description": "Verbose mode. Display column headers." + } + } + ], + "responses": { + "200": { + "description": "CatRecovery 200 response" + } + }, + "x-operation-group": "cat.recovery", + "x-version-added": "1.0" + } + }, + "/_cat/recovery/{index}": { + "get": { + "description": "Returns information about index shard recoveries, both on-going completed.", + "operationId": "CatRecovery_WithIndex", + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list or wildcard expression of index names to limit the returned information.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list or wildcard expression of index names to limit the returned information.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "format", + "in": "query", + "description": "A short version of the Accept header, e.g. json, yaml.", + "schema": { + "type": "string", + "description": "A short version of the Accept header, e.g. json, yaml." + } + }, + { + "name": "active_only", + "in": "query", + "description": "If `true`, the response only includes ongoing shard recoveries.", + "schema": { + "type": "boolean", + "default": false, + "description": "If `true`, the response only includes ongoing shard recoveries." + } + }, + { + "name": "bytes", + "in": "query", + "description": "The unit in which to display byte values.", + "schema": { + "$ref": "#/components/schemas/Bytes" + } + }, + { + "name": "detailed", + "in": "query", + "description": "If `true`, the response includes detailed information about shard recoveries.", + "schema": { + "type": "boolean", + "default": false, + "description": "If `true`, the response includes detailed information about shard recoveries." + } + }, + { + "name": "h", + "in": "query", + "description": "Comma-separated list of column names to display.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names to display." + }, + "explode": true + }, + { + "name": "help", + "in": "query", + "description": "Return help information.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return help information." + } + }, + { + "name": "index", + "in": "query", + "description": "Comma-separated list or wildcard expression of index names to limit the returned information.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list or wildcard expression of index names to limit the returned information." + }, + "explode": true + }, + { + "name": "s", + "in": "query", + "description": "Comma-separated list of column names or column aliases to sort by.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names or column aliases to sort by." + }, + "explode": true + }, + { + "name": "time", + "in": "query", + "description": "The unit in which to display time values.", + "schema": { + "$ref": "#/components/schemas/Time" + } + }, + { + "name": "v", + "in": "query", + "description": "Verbose mode. Display column headers.", + "schema": { + "type": "boolean", + "default": false, + "description": "Verbose mode. Display column headers." + } + } + ], + "responses": { + "200": { + "description": "CatRecovery_WithIndex 200 response" + } + }, + "x-operation-group": "cat.recovery", + "x-version-added": "1.0" + } + }, + "/_cat/repositories": { + "get": { + "description": "Returns information about snapshot repositories registered in the cluster.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/cat/cat-repositories/" + }, + "operationId": "CatRepositories", + "parameters": [ + { + "name": "format", + "in": "query", + "description": "A short version of the Accept header, e.g. json, yaml.", + "schema": { + "type": "string", + "description": "A short version of the Accept header, e.g. json, yaml." + } + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "h", + "in": "query", + "description": "Comma-separated list of column names to display.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names to display." + }, + "explode": true + }, + { + "name": "help", + "in": "query", + "description": "Return help information.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return help information." + } + }, + { + "name": "s", + "in": "query", + "description": "Comma-separated list of column names or column aliases to sort by.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names or column aliases to sort by." + }, + "explode": true + }, + { + "name": "v", + "in": "query", + "description": "Verbose mode. Display column headers.", + "schema": { + "type": "boolean", + "default": false, + "description": "Verbose mode. Display column headers." + } + } + ], + "responses": { + "200": { + "description": "CatRepositories 200 response" + } + }, + "x-operation-group": "cat.repositories", + "x-version-added": "1.0" + } + }, + "/_cat/segment_replication": { + "get": { + "description": "Returns information about both on-going and latest completed Segment Replication events.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/cat/cat-segment-replication/" + }, + "operationId": "CatSegmentReplication", + "parameters": [ + { + "name": "format", + "in": "query", + "description": "A short version of the Accept header, e.g. json, yaml.", + "schema": { + "type": "string", + "description": "A short version of the Accept header, e.g. json, yaml." + } + }, + { + "name": "active_only", + "in": "query", + "description": "If `true`, the response only includes ongoing segment replication events.", + "schema": { + "type": "boolean", + "default": false, + "description": "If `true`, the response only includes ongoing segment replication events." + } + }, + { + "name": "completed_only", + "in": "query", + "description": "If `true`, the response only includes latest completed segment replication events.", + "schema": { + "type": "boolean", + "default": false, + "description": "If `true`, the response only includes latest completed segment replication events." + } + }, + { + "name": "bytes", + "in": "query", + "description": "The unit in which to display byte values.", + "schema": { + "$ref": "#/components/schemas/Bytes" + } + }, + { + "name": "detailed", + "in": "query", + "description": "If `true`, the response includes detailed information about segment replications.", + "schema": { + "type": "boolean", + "default": false, + "description": "If `true`, the response includes detailed information about segment replications." + } + }, + { + "name": "shards", + "in": "query", + "description": "Comma-separated list of shards to display.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of shards to display." + }, + "explode": true + }, + { + "name": "h", + "in": "query", + "description": "Comma-separated list of column names to display.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names to display." + }, + "explode": true + }, + { + "name": "help", + "in": "query", + "description": "Return help information.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return help information." + } + }, + { + "name": "index", + "in": "query", + "description": "Comma-separated list or wildcard expression of index names to limit the returned information.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list or wildcard expression of index names to limit the returned information." + }, + "explode": true + }, + { + "name": "s", + "in": "query", + "description": "Comma-separated list of column names or column aliases to sort by.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names or column aliases to sort by." + }, + "explode": true + }, + { + "name": "time", + "in": "query", + "description": "The unit in which to display time values.", + "schema": { + "$ref": "#/components/schemas/Time" + } + }, + { + "name": "v", + "in": "query", + "description": "Verbose mode. Display column headers.", + "schema": { + "type": "boolean", + "default": false, + "description": "Verbose mode. Display column headers." + } + } + ], + "responses": { + "200": { + "description": "CatSegmentReplication 200 response" + } + }, + "x-operation-group": "cat.segment_replication", + "x-version-added": "1.0" + } + }, + "/_cat/segment_replication/{index}": { + "get": { + "description": "Returns information about both on-going and latest completed Segment Replication events.", + "operationId": "CatSegmentReplication_WithIndex", + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list or wildcard expression of index names to limit the returned information.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list or wildcard expression of index names to limit the returned information.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "format", + "in": "query", + "description": "A short version of the Accept header, e.g. json, yaml.", + "schema": { + "type": "string", + "description": "A short version of the Accept header, e.g. json, yaml." + } + }, + { + "name": "active_only", + "in": "query", + "description": "If `true`, the response only includes ongoing segment replication events.", + "schema": { + "type": "boolean", + "default": false, + "description": "If `true`, the response only includes ongoing segment replication events." + } + }, + { + "name": "completed_only", + "in": "query", + "description": "If `true`, the response only includes latest completed segment replication events.", + "schema": { + "type": "boolean", + "default": false, + "description": "If `true`, the response only includes latest completed segment replication events." + } + }, + { + "name": "bytes", + "in": "query", + "description": "The unit in which to display byte values.", + "schema": { + "$ref": "#/components/schemas/Bytes" + } + }, + { + "name": "detailed", + "in": "query", + "description": "If `true`, the response includes detailed information about segment replications.", + "schema": { + "type": "boolean", + "default": false, + "description": "If `true`, the response includes detailed information about segment replications." + } + }, + { + "name": "shards", + "in": "query", + "description": "Comma-separated list of shards to display.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of shards to display." + }, + "explode": true + }, + { + "name": "h", + "in": "query", + "description": "Comma-separated list of column names to display.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names to display." + }, + "explode": true + }, + { + "name": "help", + "in": "query", + "description": "Return help information.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return help information." + } + }, + { + "name": "index", + "in": "query", + "description": "Comma-separated list or wildcard expression of index names to limit the returned information.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list or wildcard expression of index names to limit the returned information." + }, + "explode": true + }, + { + "name": "s", + "in": "query", + "description": "Comma-separated list of column names or column aliases to sort by.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names or column aliases to sort by." + }, + "explode": true + }, + { + "name": "time", + "in": "query", + "description": "The unit in which to display time values.", + "schema": { + "$ref": "#/components/schemas/Time" + } + }, + { + "name": "v", + "in": "query", + "description": "Verbose mode. Display column headers.", + "schema": { + "type": "boolean", + "default": false, + "description": "Verbose mode. Display column headers." + } + } + ], + "responses": { + "200": { + "description": "CatSegmentReplication_WithIndex 200 response" + } + }, + "x-operation-group": "cat.segment_replication", + "x-version-added": "1.0" + } + }, + "/_cat/segments": { + "get": { + "description": "Provides low-level information about the segments in the shards of an index.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/cat/cat-segments/" + }, + "operationId": "CatSegments", + "parameters": [ + { + "name": "format", + "in": "query", + "description": "A short version of the Accept header, e.g. json, yaml.", + "schema": { + "type": "string", + "description": "A short version of the Accept header, e.g. json, yaml." + } + }, + { + "name": "bytes", + "in": "query", + "description": "The unit in which to display byte values.", + "schema": { + "$ref": "#/components/schemas/Bytes" + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "h", + "in": "query", + "description": "Comma-separated list of column names to display.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names to display." + }, + "explode": true + }, + { + "name": "help", + "in": "query", + "description": "Return help information.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return help information." + } + }, + { + "name": "s", + "in": "query", + "description": "Comma-separated list of column names or column aliases to sort by.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names or column aliases to sort by." + }, + "explode": true + }, + { + "name": "v", + "in": "query", + "description": "Verbose mode. Display column headers.", + "schema": { + "type": "boolean", + "default": false, + "description": "Verbose mode. Display column headers." + } + } + ], + "responses": { + "200": { + "description": "CatSegments 200 response" + } + }, + "x-operation-group": "cat.segments", + "x-version-added": "1.0" + } + }, + "/_cat/segments/{index}": { + "get": { + "description": "Provides low-level information about the segments in the shards of an index.", + "operationId": "CatSegments_WithIndex", + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices to limit the returned information.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices to limit the returned information.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "format", + "in": "query", + "description": "A short version of the Accept header, e.g. json, yaml.", + "schema": { + "type": "string", + "description": "A short version of the Accept header, e.g. json, yaml." + } + }, + { + "name": "bytes", + "in": "query", + "description": "The unit in which to display byte values.", + "schema": { + "$ref": "#/components/schemas/Bytes" + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "h", + "in": "query", + "description": "Comma-separated list of column names to display.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names to display." + }, + "explode": true + }, + { + "name": "help", + "in": "query", + "description": "Return help information.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return help information." + } + }, + { + "name": "s", + "in": "query", + "description": "Comma-separated list of column names or column aliases to sort by.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names or column aliases to sort by." + }, + "explode": true + }, + { + "name": "v", + "in": "query", + "description": "Verbose mode. Display column headers.", + "schema": { + "type": "boolean", + "default": false, + "description": "Verbose mode. Display column headers." + } + } + ], + "responses": { + "200": { + "description": "CatSegments_WithIndex 200 response" + } + }, + "x-operation-group": "cat.segments", + "x-version-added": "1.0" + } + }, + "/_cat/shards": { + "get": { + "description": "Provides a detailed view of shard allocation on nodes.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/cat/cat-shards/" + }, + "operationId": "CatShards", + "parameters": [ + { + "name": "format", + "in": "query", + "description": "A short version of the Accept header, e.g. json, yaml.", + "schema": { + "type": "string", + "description": "A short version of the Accept header, e.g. json, yaml." + } + }, + { + "name": "bytes", + "in": "query", + "description": "The unit in which to display byte values.", + "schema": { + "$ref": "#/components/schemas/Bytes" + } + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "h", + "in": "query", + "description": "Comma-separated list of column names to display.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names to display." + }, + "explode": true + }, + { + "name": "help", + "in": "query", + "description": "Return help information.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return help information." + } + }, + { + "name": "s", + "in": "query", + "description": "Comma-separated list of column names or column aliases to sort by.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names or column aliases to sort by." + }, + "explode": true + }, + { + "name": "time", + "in": "query", + "description": "The unit in which to display time values.", + "schema": { + "$ref": "#/components/schemas/Time" + } + }, + { + "name": "v", + "in": "query", + "description": "Verbose mode. Display column headers.", + "schema": { + "type": "boolean", + "default": false, + "description": "Verbose mode. Display column headers." + } + } + ], + "responses": { + "200": { + "description": "CatShards 200 response" + } + }, + "x-operation-group": "cat.shards", + "x-version-added": "1.0" + } + }, + "/_cat/shards/{index}": { + "get": { + "description": "Provides a detailed view of shard allocation on nodes.", + "operationId": "CatShards_WithIndex", + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices to limit the returned information.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices to limit the returned information.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "format", + "in": "query", + "description": "A short version of the Accept header, e.g. json, yaml.", + "schema": { + "type": "string", + "description": "A short version of the Accept header, e.g. json, yaml." + } + }, + { + "name": "bytes", + "in": "query", + "description": "The unit in which to display byte values.", + "schema": { + "$ref": "#/components/schemas/Bytes" + } + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "h", + "in": "query", + "description": "Comma-separated list of column names to display.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names to display." + }, + "explode": true + }, + { + "name": "help", + "in": "query", + "description": "Return help information.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return help information." + } + }, + { + "name": "s", + "in": "query", + "description": "Comma-separated list of column names or column aliases to sort by.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names or column aliases to sort by." + }, + "explode": true + }, + { + "name": "time", + "in": "query", + "description": "The unit in which to display time values.", + "schema": { + "$ref": "#/components/schemas/Time" + } + }, + { + "name": "v", + "in": "query", + "description": "Verbose mode. Display column headers.", + "schema": { + "type": "boolean", + "default": false, + "description": "Verbose mode. Display column headers." + } + } + ], + "responses": { + "200": { + "description": "CatShards_WithIndex 200 response" + } + }, + "x-operation-group": "cat.shards", + "x-version-added": "1.0" + } + }, + "/_cat/snapshots": { + "get": { + "description": "Returns all snapshots in a specific repository.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/cat/cat-snapshots/" + }, + "operationId": "CatSnapshots", + "parameters": [ + { + "name": "format", + "in": "query", + "description": "A short version of the Accept header, e.g. json, yaml.", + "schema": { + "type": "string", + "description": "A short version of the Accept header, e.g. json, yaml." + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "default": false, + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "h", + "in": "query", + "description": "Comma-separated list of column names to display.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names to display." + }, + "explode": true + }, + { + "name": "help", + "in": "query", + "description": "Return help information.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return help information." + } + }, + { + "name": "s", + "in": "query", + "description": "Comma-separated list of column names or column aliases to sort by.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names or column aliases to sort by." + }, + "explode": true + }, + { + "name": "time", + "in": "query", + "description": "The unit in which to display time values.", + "schema": { + "$ref": "#/components/schemas/Time" + } + }, + { + "name": "v", + "in": "query", + "description": "Verbose mode. Display column headers.", + "schema": { + "type": "boolean", + "default": false, + "description": "Verbose mode. Display column headers." + } + } + ], + "responses": { + "200": { + "description": "CatSnapshots 200 response" + } + }, + "x-operation-group": "cat.snapshots", + "x-version-added": "1.0" + } + }, + "/_cat/snapshots/{repository}": { + "get": { + "description": "Returns all snapshots in a specific repository.", + "operationId": "CatSnapshots_WithRepository", + "parameters": [ + { + "name": "repository", + "in": "path", + "description": "Comma-separated list of repository names.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of repository names.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "format", + "in": "query", + "description": "A short version of the Accept header, e.g. json, yaml.", + "schema": { + "type": "string", + "description": "A short version of the Accept header, e.g. json, yaml." + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "default": false, + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "h", + "in": "query", + "description": "Comma-separated list of column names to display.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names to display." + }, + "explode": true + }, + { + "name": "help", + "in": "query", + "description": "Return help information.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return help information." + } + }, + { + "name": "s", + "in": "query", + "description": "Comma-separated list of column names or column aliases to sort by.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names or column aliases to sort by." + }, + "explode": true + }, + { + "name": "time", + "in": "query", + "description": "The unit in which to display time values.", + "schema": { + "$ref": "#/components/schemas/Time" + } + }, + { + "name": "v", + "in": "query", + "description": "Verbose mode. Display column headers.", + "schema": { + "type": "boolean", + "default": false, + "description": "Verbose mode. Display column headers." + } + } + ], + "responses": { + "200": { + "description": "CatSnapshots_WithRepository 200 response" + } + }, + "x-operation-group": "cat.snapshots", + "x-version-added": "1.0" + } + }, + "/_cat/tasks": { + "get": { + "description": "Returns information about the tasks currently executing on one or more nodes in the cluster.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/cat/cat-tasks/" + }, + "operationId": "CatTasks", + "parameters": [ + { + "name": "format", + "in": "query", + "description": "A short version of the Accept header, e.g. json, yaml.", + "schema": { + "type": "string", + "description": "A short version of the Accept header, e.g. json, yaml." + } + }, + { + "name": "nodes", + "in": "query", + "description": "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.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "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." + }, + "explode": true + }, + { + "name": "actions", + "in": "query", + "description": "Comma-separated list of actions that should be returned. Leave empty to return all.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of actions that should be returned. Leave empty to return all." + }, + "explode": true + }, + { + "name": "detailed", + "in": "query", + "description": "Return detailed task information.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return detailed task information." + } + }, + { + "name": "parent_task_id", + "in": "query", + "description": "Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all.", + "schema": { + "type": "string", + "description": "Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all." + } + }, + { + "name": "h", + "in": "query", + "description": "Comma-separated list of column names to display.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names to display." + }, + "explode": true + }, + { + "name": "help", + "in": "query", + "description": "Return help information.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return help information." + } + }, + { + "name": "s", + "in": "query", + "description": "Comma-separated list of column names or column aliases to sort by.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names or column aliases to sort by." + }, + "explode": true + }, + { + "name": "time", + "in": "query", + "description": "The unit in which to display time values.", + "schema": { + "$ref": "#/components/schemas/Time" + } + }, + { + "name": "v", + "in": "query", + "description": "Verbose mode. Display column headers.", + "schema": { + "type": "boolean", + "default": false, + "description": "Verbose mode. Display column headers." + } + } + ], + "responses": { + "200": { + "description": "CatTasks 200 response" + } + }, + "x-operation-group": "cat.tasks", + "x-version-added": "1.0" + } + }, + "/_cat/templates": { + "get": { + "description": "Returns information about existing templates.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/cat/cat-templates/" + }, + "operationId": "CatTemplates", + "parameters": [ + { + "name": "format", + "in": "query", + "description": "A short version of the Accept header, e.g. json, yaml.", + "schema": { + "type": "string", + "description": "A short version of the Accept header, e.g. json, yaml." + } + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "h", + "in": "query", + "description": "Comma-separated list of column names to display.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names to display." + }, + "explode": true + }, + { + "name": "help", + "in": "query", + "description": "Return help information.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return help information." + } + }, + { + "name": "s", + "in": "query", + "description": "Comma-separated list of column names or column aliases to sort by.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names or column aliases to sort by." + }, + "explode": true + }, + { + "name": "v", + "in": "query", + "description": "Verbose mode. Display column headers.", + "schema": { + "type": "boolean", + "default": false, + "description": "Verbose mode. Display column headers." + } + } + ], + "responses": { + "200": { + "description": "CatTemplates 200 response" + } + }, + "x-operation-group": "cat.templates", + "x-version-added": "1.0" + } + }, + "/_cat/templates/{name}": { + "get": { + "description": "Returns information about existing templates.", + "operationId": "CatTemplates_WithName", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the template.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the template." + }, + "required": true + }, + { + "name": "format", + "in": "query", + "description": "A short version of the Accept header, e.g. json, yaml.", + "schema": { + "type": "string", + "description": "A short version of the Accept header, e.g. json, yaml." + } + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "h", + "in": "query", + "description": "Comma-separated list of column names to display.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names to display." + }, + "explode": true + }, + { + "name": "help", + "in": "query", + "description": "Return help information.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return help information." + } + }, + { + "name": "s", + "in": "query", + "description": "Comma-separated list of column names or column aliases to sort by.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names or column aliases to sort by." + }, + "explode": true + }, + { + "name": "v", + "in": "query", + "description": "Verbose mode. Display column headers.", + "schema": { + "type": "boolean", + "default": false, + "description": "Verbose mode. Display column headers." + } + } + ], + "responses": { + "200": { + "description": "CatTemplates_WithName 200 response" + } + }, + "x-operation-group": "cat.templates", + "x-version-added": "1.0" + } + }, + "/_cat/thread_pool": { + "get": { + "description": "Returns cluster-wide thread pool statistics per node.\nBy default the active, queue and rejected statistics are returned for all thread pools.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/cat/cat-thread-pool/" + }, + "operationId": "CatThreadPool", + "parameters": [ + { + "name": "format", + "in": "query", + "description": "A short version of the Accept header, e.g. json, yaml.", + "schema": { + "type": "string", + "description": "A short version of the Accept header, e.g. json, yaml." + } + }, + { + "name": "size", + "in": "query", + "description": "The multiplier in which to display values.", + "schema": { + "type": "integer", + "description": "The multiplier in which to display values.", + "format": "int32" + } + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "h", + "in": "query", + "description": "Comma-separated list of column names to display.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names to display." + }, + "explode": true + }, + { + "name": "help", + "in": "query", + "description": "Return help information.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return help information." + } + }, + { + "name": "s", + "in": "query", + "description": "Comma-separated list of column names or column aliases to sort by.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names or column aliases to sort by." + }, + "explode": true + }, + { + "name": "v", + "in": "query", + "description": "Verbose mode. Display column headers.", + "schema": { + "type": "boolean", + "default": false, + "description": "Verbose mode. Display column headers." + } + } + ], + "responses": { + "200": { + "description": "CatThreadPool 200 response" + } + }, + "x-operation-group": "cat.thread_pool", + "x-version-added": "1.0" + } + }, + "/_cat/thread_pool/{thread_pool_patterns}": { + "get": { + "description": "Returns cluster-wide thread pool statistics per node.\nBy default the active, queue and rejected statistics are returned for all thread pools.", + "operationId": "CatThreadPool_WithThreadPoolPatterns", + "parameters": [ + { + "name": "thread_pool_patterns", + "in": "path", + "description": "Comma-separated list of regular-expressions to filter the thread pools in the output.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of regular-expressions to filter the thread pools in the output.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "format", + "in": "query", + "description": "A short version of the Accept header, e.g. json, yaml.", + "schema": { + "type": "string", + "description": "A short version of the Accept header, e.g. json, yaml." + } + }, + { + "name": "size", + "in": "query", + "description": "The multiplier in which to display values.", + "schema": { + "type": "integer", + "description": "The multiplier in which to display values.", + "format": "int32" + } + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "h", + "in": "query", + "description": "Comma-separated list of column names to display.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names to display." + }, + "explode": true + }, + { + "name": "help", + "in": "query", + "description": "Return help information.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return help information." + } + }, + { + "name": "s", + "in": "query", + "description": "Comma-separated list of column names or column aliases to sort by.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of column names or column aliases to sort by." + }, + "explode": true + }, + { + "name": "v", + "in": "query", + "description": "Verbose mode. Display column headers.", + "schema": { + "type": "boolean", + "default": false, + "description": "Verbose mode. Display column headers." + } + } + ], + "responses": { + "200": { + "description": "CatThreadPool_WithThreadPoolPatterns 200 response" + } + }, + "x-operation-group": "cat.thread_pool", + "x-version-added": "1.0" + } + }, + "/_cluster/allocation/explain": { + "get": { + "description": "Provides explanations for shard allocations in the cluster.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-allocation/" + }, + "operationId": "ClusterAllocationExplain_Get", + "parameters": [ + { + "name": "include_yes_decisions", + "in": "query", + "description": "Return 'YES' decisions in explanation.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return 'YES' decisions in explanation." + } + }, + { + "name": "include_disk_info", + "in": "query", + "description": "Return information about disk usage and shard sizes.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return information about disk usage and shard sizes." + } + } + ], + "responses": { + "200": { + "description": "ClusterAllocationExplain_Get 200 response" + } + }, + "x-operation-group": "cluster.allocation_explain", + "x-version-added": "1.0" + }, + "post": { + "description": "Provides explanations for shard allocations in the cluster.", + "operationId": "ClusterAllocationExplain_Post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClusterAllocationExplain_BodyParams" + } + } + } + }, + "parameters": [ + { + "name": "include_yes_decisions", + "in": "query", + "description": "Return 'YES' decisions in explanation.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return 'YES' decisions in explanation." + } + }, + { + "name": "include_disk_info", + "in": "query", + "description": "Return information about disk usage and shard sizes.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return information about disk usage and shard sizes." + } + } + ], + "responses": { + "200": { + "description": "ClusterAllocationExplain_Post 200 response" + } + }, + "x-operation-group": "cluster.allocation_explain", + "x-version-added": "1.0" + } + }, + "/_cluster/decommission/awareness/": { + "delete": { + "description": "Delete any existing decommission.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-decommission/#example-decommissioning-and-recommissioning-a-zone" + }, + "operationId": "ClusterDeleteDecommissionAwareness", + "responses": { + "200": { + "description": "ClusterDeleteDecommissionAwareness 200 response" + } + }, + "x-operation-group": "cluster.delete_decommission_awareness", + "x-version-added": "1.0" + } + }, + "/_cluster/decommission/awareness/{awareness_attribute_name}/_status": { + "get": { + "description": "Get details and status of decommissioned attribute.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-decommission/#example-getting-zone-decommission-status" + }, + "operationId": "ClusterGetDecommissionAwareness", + "parameters": [ + { + "name": "awareness_attribute_name", + "in": "path", + "description": "Awareness attribute name.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Awareness attribute name." + }, + "required": true + } + ], + "responses": { + "200": { + "description": "ClusterGetDecommissionAwareness 200 response" + } + }, + "x-operation-group": "cluster.get_decommission_awareness", + "x-version-added": "1.0" + } + }, + "/_cluster/decommission/awareness/{awareness_attribute_name}/{awareness_attribute_value}": { + "put": { + "description": "Decommissions an awareness attribute.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-decommission/#example-decommissioning-and-recommissioning-a-zone" + }, + "operationId": "ClusterPutDecommissionAwareness", + "parameters": [ + { + "name": "awareness_attribute_name", + "in": "path", + "description": "Awareness attribute name.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Awareness attribute name." + }, + "required": true + }, + { + "name": "awareness_attribute_value", + "in": "path", + "description": "Awareness attribute value.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Awareness attribute value." + }, + "required": true + } + ], + "responses": { + "200": { + "description": "ClusterPutDecommissionAwareness 200 response" + } + }, + "x-operation-group": "cluster.put_decommission_awareness", + "x-version-added": "1.0" + } + }, + "/_cluster/health": { + "get": { + "description": "Returns basic information about the health of the cluster.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-health/" + }, + "operationId": "ClusterHealth", + "parameters": [ + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "level", + "in": "query", + "description": "Specify the level of detail for returned information.", + "schema": { + "$ref": "#/components/schemas/ClusterHealthLevel" + } + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "wait_for_active_shards", + "in": "query", + "description": "Wait until the specified number of shards is active.", + "schema": { + "type": "string", + "description": "Wait until the specified number of shards is active." + } + }, + { + "name": "wait_for_nodes", + "in": "query", + "description": "Wait until the specified number of nodes is available.", + "schema": { + "type": "string", + "description": "Wait until the specified number of nodes is available." + } + }, + { + "name": "wait_for_events", + "in": "query", + "description": "Wait until all currently queued events with the given priority are processed.", + "schema": { + "$ref": "#/components/schemas/WaitForEvents" + } + }, + { + "name": "wait_for_no_relocating_shards", + "in": "query", + "description": "Whether to wait until there are no relocating shards in the cluster.", + "schema": { + "type": "boolean", + "description": "Whether to wait until there are no relocating shards in the cluster." + } + }, + { + "name": "wait_for_no_initializing_shards", + "in": "query", + "description": "Whether to wait until there are no initializing shards in the cluster.", + "schema": { + "type": "boolean", + "description": "Whether to wait until there are no initializing shards in the cluster." + } + }, + { + "name": "wait_for_status", + "in": "query", + "description": "Wait until cluster is in a specific state.", + "schema": { + "$ref": "#/components/schemas/WaitForStatus" + } + }, + { + "name": "awareness_attribute", + "in": "query", + "description": "The awareness attribute for which the health is required.", + "schema": { + "type": "string", + "description": "The awareness attribute for which the health is required." + } + } + ], + "responses": { + "200": { + "description": "ClusterHealth 200 response" + } + }, + "x-operation-group": "cluster.health", + "x-version-added": "1.0" + } + }, + "/_cluster/health/{index}": { + "get": { + "description": "Returns basic information about the health of the cluster.", + "operationId": "ClusterHealth_WithIndex", + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Limit the information returned to specific indicies.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Limit the information returned to specific indicies.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "level", + "in": "query", + "description": "Specify the level of detail for returned information.", + "schema": { + "$ref": "#/components/schemas/ClusterHealthLevel" + } + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "wait_for_active_shards", + "in": "query", + "description": "Wait until the specified number of shards is active.", + "schema": { + "type": "string", + "description": "Wait until the specified number of shards is active." + } + }, + { + "name": "wait_for_nodes", + "in": "query", + "description": "Wait until the specified number of nodes is available.", + "schema": { + "type": "string", + "description": "Wait until the specified number of nodes is available." + } + }, + { + "name": "wait_for_events", + "in": "query", + "description": "Wait until all currently queued events with the given priority are processed.", + "schema": { + "$ref": "#/components/schemas/WaitForEvents" + } + }, + { + "name": "wait_for_no_relocating_shards", + "in": "query", + "description": "Whether to wait until there are no relocating shards in the cluster.", + "schema": { + "type": "boolean", + "description": "Whether to wait until there are no relocating shards in the cluster." + } + }, + { + "name": "wait_for_no_initializing_shards", + "in": "query", + "description": "Whether to wait until there are no initializing shards in the cluster.", + "schema": { + "type": "boolean", + "description": "Whether to wait until there are no initializing shards in the cluster." + } + }, + { + "name": "wait_for_status", + "in": "query", + "description": "Wait until cluster is in a specific state.", + "schema": { + "$ref": "#/components/schemas/WaitForStatus" + } + }, + { + "name": "awareness_attribute", + "in": "query", + "description": "The awareness attribute for which the health is required.", + "schema": { + "type": "string", + "description": "The awareness attribute for which the health is required." + } + } + ], + "responses": { + "200": { + "description": "ClusterHealth_WithIndex 200 response" + } + }, + "x-operation-group": "cluster.health", + "x-version-added": "1.0" + } + }, + "/_cluster/nodes/hot_threads": { + "get": { + "description": "Returns information about hot threads on each node in the cluster.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/nodes-apis/nodes-hot-threads/" + }, + "operationId": "NodesHotThreads_DeprecatedDash", + "deprecated": true, + "parameters": [ + { + "name": "interval", + "in": "query", + "description": "The interval for the second sampling of threads.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "The interval for the second sampling of threads.", + "x-data-type": "time" + } + }, + { + "name": "snapshots", + "in": "query", + "description": "Number of samples of thread stacktrace.", + "schema": { + "type": "integer", + "default": 10, + "description": "Number of samples of thread stacktrace.", + "format": "int32" + } + }, + { + "name": "threads", + "in": "query", + "description": "Specify the number of threads to provide information for.", + "schema": { + "type": "integer", + "default": 3, + "description": "Specify the number of threads to provide information for.", + "format": "int32" + } + }, + { + "name": "ignore_idle_threads", + "in": "query", + "description": "Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue.", + "schema": { + "type": "boolean", + "default": true, + "description": "Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue." + } + }, + { + "name": "type", + "in": "query", + "description": "The type to sample.", + "schema": { + "$ref": "#/components/schemas/SampleType" + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "NodesHotThreads_DeprecatedDash 200 response" + } + }, + "x-deprecation-message": "The hot accepts /_cluster/nodes as prefix for backwards compatibility reasons", + "x-ignorable": true, + "x-operation-group": "nodes.hot_threads", + "x-version-added": "1.0", + "x-version-deprecated": "1.0" + } + }, + "/_cluster/nodes/hotthreads": { + "get": { + "description": "Returns information about hot threads on each node in the cluster.", + "operationId": "NodesHotThreads_DeprecatedCluster", + "deprecated": true, + "parameters": [ + { + "name": "interval", + "in": "query", + "description": "The interval for the second sampling of threads.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "The interval for the second sampling of threads.", + "x-data-type": "time" + } + }, + { + "name": "snapshots", + "in": "query", + "description": "Number of samples of thread stacktrace.", + "schema": { + "type": "integer", + "default": 10, + "description": "Number of samples of thread stacktrace.", + "format": "int32" + } + }, + { + "name": "threads", + "in": "query", + "description": "Specify the number of threads to provide information for.", + "schema": { + "type": "integer", + "default": 3, + "description": "Specify the number of threads to provide information for.", + "format": "int32" + } + }, + { + "name": "ignore_idle_threads", + "in": "query", + "description": "Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue.", + "schema": { + "type": "boolean", + "default": true, + "description": "Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue." + } + }, + { + "name": "type", + "in": "query", + "description": "The type to sample.", + "schema": { + "$ref": "#/components/schemas/SampleType" + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "NodesHotThreads_DeprecatedCluster 200 response" + } + }, + "x-deprecation-message": "The hot threads API accepts `hotthreads` but only `hot_threads` is documented", + "x-ignorable": true, + "x-operation-group": "nodes.hot_threads", + "x-version-added": "1.0", + "x-version-deprecated": "1.0" + } + }, + "/_cluster/nodes/{node_id}/hot_threads": { + "get": { + "description": "Returns information about hot threads on each node in the cluster.", + "operationId": "NodesHotThreads_WithNodeId_DeprecatedDash", + "deprecated": true, + "parameters": [ + { + "name": "node_id", + "in": "path", + "description": "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.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "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.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "interval", + "in": "query", + "description": "The interval for the second sampling of threads.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "The interval for the second sampling of threads.", + "x-data-type": "time" + } + }, + { + "name": "snapshots", + "in": "query", + "description": "Number of samples of thread stacktrace.", + "schema": { + "type": "integer", + "default": 10, + "description": "Number of samples of thread stacktrace.", + "format": "int32" + } + }, + { + "name": "threads", + "in": "query", + "description": "Specify the number of threads to provide information for.", + "schema": { + "type": "integer", + "default": 3, + "description": "Specify the number of threads to provide information for.", + "format": "int32" + } + }, + { + "name": "ignore_idle_threads", + "in": "query", + "description": "Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue.", + "schema": { + "type": "boolean", + "default": true, + "description": "Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue." + } + }, + { + "name": "type", + "in": "query", + "description": "The type to sample.", + "schema": { + "$ref": "#/components/schemas/SampleType" + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "NodesHotThreads_WithNodeId_DeprecatedDash 200 response" + } + }, + "x-deprecation-message": "The hot accepts /_cluster/nodes as prefix for backwards compatibility reasons", + "x-ignorable": true, + "x-operation-group": "nodes.hot_threads", + "x-version-added": "1.0", + "x-version-deprecated": "1.0" + } + }, + "/_cluster/nodes/{node_id}/hotthreads": { + "get": { + "description": "Returns information about hot threads on each node in the cluster.", + "operationId": "NodesHotThreads_WithNodeId_DeprecatedCluster", + "deprecated": true, + "parameters": [ + { + "name": "node_id", + "in": "path", + "description": "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.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "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.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "interval", + "in": "query", + "description": "The interval for the second sampling of threads.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "The interval for the second sampling of threads.", + "x-data-type": "time" + } + }, + { + "name": "snapshots", + "in": "query", + "description": "Number of samples of thread stacktrace.", + "schema": { + "type": "integer", + "default": 10, + "description": "Number of samples of thread stacktrace.", + "format": "int32" + } + }, + { + "name": "threads", + "in": "query", + "description": "Specify the number of threads to provide information for.", + "schema": { + "type": "integer", + "default": 3, + "description": "Specify the number of threads to provide information for.", + "format": "int32" + } + }, + { + "name": "ignore_idle_threads", + "in": "query", + "description": "Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue.", + "schema": { + "type": "boolean", + "default": true, + "description": "Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue." + } + }, + { + "name": "type", + "in": "query", + "description": "The type to sample.", + "schema": { + "$ref": "#/components/schemas/SampleType" + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "NodesHotThreads_WithNodeId_DeprecatedCluster 200 response" + } + }, + "x-deprecation-message": "The hot threads API accepts `hotthreads` but only `hot_threads` is documented", + "x-ignorable": true, + "x-operation-group": "nodes.hot_threads", + "x-version-added": "1.0", + "x-version-deprecated": "1.0" + } + }, + "/_cluster/pending_tasks": { + "get": { + "description": "Returns a list of any cluster-level changes (e.g. create index, update mapping,\nallocate or fail shard) which have not yet been executed.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest" + }, + "operationId": "ClusterPendingTasks", + "parameters": [ + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "ClusterPendingTasks 200 response" + } + }, + "x-operation-group": "cluster.pending_tasks", + "x-version-added": "1.0" + } + }, + "/_cluster/reroute": { + "post": { + "description": "Allows to manually change the allocation of individual shards in the cluster.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest" + }, + "operationId": "ClusterReroute", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClusterReroute_BodyParams" + } + } + } + }, + "parameters": [ + { + "name": "dry_run", + "in": "query", + "description": "Simulate the operation only and return the resulting state.", + "schema": { + "type": "boolean", + "description": "Simulate the operation only and return the resulting state." + } + }, + { + "name": "explain", + "in": "query", + "description": "Return an explanation of why the commands can or cannot be executed.", + "schema": { + "type": "boolean", + "description": "Return an explanation of why the commands can or cannot be executed." + } + }, + { + "name": "retry_failed", + "in": "query", + "description": "Retries allocation of shards that are blocked due to too many subsequent allocation failures.", + "schema": { + "type": "boolean", + "description": "Retries allocation of shards that are blocked due to too many subsequent allocation failures." + } + }, + { + "name": "metric", + "in": "query", + "description": "Limit the information returned to the specified metrics. Defaults to all but metadata.", + "style": "form", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ClusterRerouteMetric_Member" + }, + "description": "Limit the information returned to the specified metrics. Defaults to all but metadata." + }, + "explode": true + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "ClusterReroute 200 response" + } + }, + "x-operation-group": "cluster.reroute", + "x-version-added": "1.0" + } + }, + "/_cluster/routing/awareness/weights": { + "delete": { + "description": "Delete weighted shard routing weights.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-awareness/#example-deleting-weights" + }, + "operationId": "ClusterDeleteWeightedRouting", + "responses": { + "200": { + "description": "ClusterDeleteWeightedRouting 200 response" + } + }, + "x-operation-group": "cluster.delete_weighted_routing", + "x-version-added": "1.0" + } + }, + "/_cluster/routing/awareness/{attribute}/weights": { + "get": { + "description": "Fetches weighted shard routing weights.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-awareness/#example-getting-weights-for-all-zones" + }, + "operationId": "ClusterGetWeightedRouting", + "parameters": [ + { + "name": "attribute", + "in": "path", + "description": "Awareness attribute name.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Awareness attribute name." + }, + "required": true + } + ], + "responses": { + "200": { + "description": "ClusterGetWeightedRouting 200 response" + } + }, + "x-operation-group": "cluster.get_weighted_routing", + "x-version-added": "1.0" + }, + "put": { + "description": "Updates weighted shard routing weights.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-awareness/#example-weighted-round-robin-search" + }, + "operationId": "ClusterPutWeightedRouting", + "parameters": [ + { + "name": "attribute", + "in": "path", + "description": "Awareness attribute name.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Awareness attribute name." + }, + "required": true + } + ], + "responses": { + "200": { + "description": "ClusterPutWeightedRouting 200 response" + } + }, + "x-operation-group": "cluster.put_weighted_routing", + "x-version-added": "1.0" + } + }, + "/_cluster/settings": { + "get": { + "description": "Returns cluster settings.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-settings/" + }, + "operationId": "ClusterGetSettings", + "parameters": [ + { + "name": "flat_settings", + "in": "query", + "description": "Return settings in flat format.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return settings in flat format." + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "include_defaults", + "in": "query", + "description": "Whether to return all default clusters setting.", + "schema": { + "type": "boolean", + "default": false, + "description": "Whether to return all default clusters setting." + }, + "examples": { + "ClusterGetSettings_example1": { + "summary": "Examples for Get cluster settings Operation.", + "description": "", + "value": true + } + } + } + ], + "responses": { + "200": { + "description": "ClusterGetSettings 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClusterGetSettingsResponseContent" + }, + "examples": { + "ClusterGetSettings_example1": { + "summary": "Examples for Get cluster settings Operation.", + "description": "", + "value": {} + } + } + } + } + } + }, + "x-operation-group": "cluster.get_settings", + "x-version-added": "1.0" + }, + "put": { + "description": "Updates the cluster settings.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/cluster-settings/" + }, + "operationId": "ClusterPutSettings", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClusterPutSettings_BodyParams" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "flat_settings", + "in": "query", + "description": "Return settings in flat format.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return settings in flat format." + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "ClusterPutSettings 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClusterPutSettingsResponseContent" + } + } + } + } + }, + "x-operation-group": "cluster.put_settings", + "x-version-added": "1.0" + } + }, + "/_cluster/state": { + "get": { + "description": "Returns a comprehensive information about the state of the cluster.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest" + }, + "operationId": "ClusterState", + "parameters": [ + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "flat_settings", + "in": "query", + "description": "Return settings in flat format.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return settings in flat format." + } + }, + { + "name": "wait_for_metadata_version", + "in": "query", + "description": "Wait for the metadata version to be equal or greater than the specified metadata version.", + "schema": { + "type": "integer", + "description": "Wait for the metadata version to be equal or greater than the specified metadata version.", + "format": "int32" + } + }, + { + "name": "wait_for_timeout", + "in": "query", + "description": "The maximum time to wait for wait_for_metadata_version before timing out.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "The maximum time to wait for wait_for_metadata_version before timing out.", + "x-data-type": "time" + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + } + ], + "responses": { + "200": { + "description": "ClusterState 200 response" + } + }, + "x-operation-group": "cluster.state", + "x-version-added": "1.0" + } + }, + "/_cluster/state/{metric}": { + "get": { + "description": "Returns a comprehensive information about the state of the cluster.", + "operationId": "ClusterState_WithMetric", + "parameters": [ + { + "name": "metric", + "in": "path", + "description": "Limit the information returned to the specified metrics.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Limit the information returned to the specified metrics.", + "x-enum-options": [ + "_all", + "blocks", + "metadata", + "nodes", + "routing_table", + "routing_nodes", + "master_node", + "cluster_manager_node", + "version" + ], + "x-data-type": "array" + }, + "required": true + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "flat_settings", + "in": "query", + "description": "Return settings in flat format.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return settings in flat format." + } + }, + { + "name": "wait_for_metadata_version", + "in": "query", + "description": "Wait for the metadata version to be equal or greater than the specified metadata version.", + "schema": { + "type": "integer", + "description": "Wait for the metadata version to be equal or greater than the specified metadata version.", + "format": "int32" + } + }, + { + "name": "wait_for_timeout", + "in": "query", + "description": "The maximum time to wait for wait_for_metadata_version before timing out.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "The maximum time to wait for wait_for_metadata_version before timing out.", + "x-data-type": "time" + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + } + ], + "responses": { + "200": { + "description": "ClusterState_WithMetric 200 response" + } + }, + "x-operation-group": "cluster.state", + "x-version-added": "1.0" + } + }, + "/_cluster/state/{metric}/{index}": { + "get": { + "description": "Returns a comprehensive information about the state of the cluster.", + "operationId": "ClusterState_WithIndexMetric", + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "metric", + "in": "path", + "description": "Limit the information returned to the specified metrics.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Limit the information returned to the specified metrics.", + "x-enum-options": [ + "_all", + "blocks", + "metadata", + "nodes", + "routing_table", + "routing_nodes", + "master_node", + "cluster_manager_node", + "version" + ], + "x-data-type": "array" + }, + "required": true + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "flat_settings", + "in": "query", + "description": "Return settings in flat format.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return settings in flat format." + } + }, + { + "name": "wait_for_metadata_version", + "in": "query", + "description": "Wait for the metadata version to be equal or greater than the specified metadata version.", + "schema": { + "type": "integer", + "description": "Wait for the metadata version to be equal or greater than the specified metadata version.", + "format": "int32" + } + }, + { + "name": "wait_for_timeout", + "in": "query", + "description": "The maximum time to wait for wait_for_metadata_version before timing out.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "The maximum time to wait for wait_for_metadata_version before timing out.", + "x-data-type": "time" + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + } + ], + "responses": { + "200": { + "description": "ClusterState_WithIndexMetric 200 response" + } + }, + "x-operation-group": "cluster.state", + "x-version-added": "1.0" + } + }, + "/_cluster/stats": { + "get": { + "description": "Returns high-level overview of cluster statistics.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-stats/" + }, + "operationId": "ClusterStats", + "parameters": [ + { + "name": "flat_settings", + "in": "query", + "description": "Return settings in flat format.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return settings in flat format." + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "ClusterStats 200 response" + } + }, + "x-operation-group": "cluster.stats", + "x-version-added": "1.0" + } + }, + "/_cluster/stats/nodes/{node_id}": { + "get": { + "description": "Returns high-level overview of cluster statistics.", + "operationId": "ClusterStats_WithNodeId", + "parameters": [ + { + "name": "node_id", + "in": "path", + "description": "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.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "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.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "flat_settings", + "in": "query", + "description": "Return settings in flat format.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return settings in flat format." + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "ClusterStats_WithNodeId 200 response" + } + }, + "x-operation-group": "cluster.stats", + "x-version-added": "1.0" + } + }, + "/_cluster/voting_config_exclusions": { + "delete": { + "description": "Clears cluster voting config exclusions.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest" + }, + "operationId": "ClusterDeleteVotingConfigExclusions", + "parameters": [ + { + "name": "wait_for_removal", + "in": "query", + "description": "Specifies whether to wait for all excluded nodes to be removed from the cluster before clearing the voting configuration exclusions list.", + "schema": { + "type": "boolean", + "default": true, + "description": "Specifies whether to wait for all excluded nodes to be removed from the cluster before clearing the voting configuration exclusions list." + } + } + ], + "responses": { + "200": { + "description": "ClusterDeleteVotingConfigExclusions 200 response" + } + }, + "x-operation-group": "cluster.delete_voting_config_exclusions", + "x-version-added": "1.0" + }, + "post": { + "description": "Updates the cluster voting config exclusions by node ids or node names.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest" + }, + "operationId": "ClusterPostVotingConfigExclusions", + "parameters": [ + { + "name": "node_ids", + "in": "query", + "description": "Comma-separated list of the persistent ids of the nodes to exclude from the voting configuration. If specified, you may not also specify ?node_names.", + "schema": { + "type": "string", + "description": "Comma-separated list of the persistent ids of the nodes to exclude from the voting configuration. If specified, you may not also specify ?node_names." + } + }, + { + "name": "node_names", + "in": "query", + "description": "Comma-separated list of the names of the nodes to exclude from the voting configuration. If specified, you may not also specify ?node_ids.", + "schema": { + "type": "string", + "description": "Comma-separated list of the names of the nodes to exclude from the voting configuration. If specified, you may not also specify ?node_ids." + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "ClusterPostVotingConfigExclusions 200 response" + } + }, + "x-operation-group": "cluster.post_voting_config_exclusions", + "x-version-added": "1.0" + } + }, + "/_component_template": { + "get": { + "description": "Returns one or more component templates.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest" + }, + "operationId": "ClusterGetComponentTemplate", + "parameters": [ + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + } + ], + "responses": { + "200": { + "description": "ClusterGetComponentTemplate 200 response" + } + }, + "x-operation-group": "cluster.get_component_template", + "x-version-added": "1.0" + } + }, + "/_component_template/{name}": { + "delete": { + "description": "Deletes a component template.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest" + }, + "operationId": "ClusterDeleteComponentTemplate", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the template.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the template." + }, + "required": true + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "ClusterDeleteComponentTemplate 200 response" + } + }, + "x-operation-group": "cluster.delete_component_template", + "x-version-added": "1.0" + }, + "get": { + "description": "Returns one or more component templates.", + "operationId": "ClusterGetComponentTemplate_WithName", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The Comma-separated names of the component templates.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The Comma-separated names of the component templates.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + } + ], + "responses": { + "200": { + "description": "ClusterGetComponentTemplate_WithName 200 response" + } + }, + "x-operation-group": "cluster.get_component_template", + "x-version-added": "1.0" + }, + "head": { + "description": "Returns information about whether a particular component template exist.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest" + }, + "operationId": "ClusterExistsComponentTemplate", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the template.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the template." + }, + "required": true + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + } + ], + "responses": { + "200": { + "description": "ClusterExistsComponentTemplate 200 response" + } + }, + "x-operation-group": "cluster.exists_component_template", + "x-version-added": "1.0" + }, + "post": { + "description": "Creates or updates a component template.", + "operationId": "ClusterPutComponentTemplate_Post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClusterPutComponentTemplate_BodyParams" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the template.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the template." + }, + "required": true + }, + { + "name": "create", + "in": "query", + "description": "Whether the index template should only be added if new or can also replace an existing one.", + "schema": { + "type": "boolean", + "default": false, + "description": "Whether the index template should only be added if new or can also replace an existing one." + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "ClusterPutComponentTemplate_Post 200 response" + } + }, + "x-operation-group": "cluster.put_component_template", + "x-version-added": "1.0" + }, + "put": { + "description": "Creates or updates a component template.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/im-plugin/index-templates/#use-component-templates-to-create-an-index-template" + }, + "operationId": "ClusterPutComponentTemplate_Put", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClusterPutComponentTemplate_BodyParams" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the template.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the template." + }, + "required": true + }, + { + "name": "create", + "in": "query", + "description": "Whether the index template should only be added if new or can also replace an existing one.", + "schema": { + "type": "boolean", + "default": false, + "description": "Whether the index template should only be added if new or can also replace an existing one." + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "ClusterPutComponentTemplate_Put 200 response" + } + }, + "x-operation-group": "cluster.put_component_template", + "x-version-added": "1.0" + } + }, + "/_count": { + "get": { + "description": "Returns number of documents matching a query.", + "operationId": "Count_Get", + "parameters": [ + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "ignore_throttled", + "in": "query", + "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled.", + "schema": { + "type": "boolean", + "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "min_score", + "in": "query", + "description": "Include only documents with a specific `_score` value in the result.", + "schema": { + "type": "integer", + "description": "Include only documents with a specific `_score` value in the result.", + "format": "int32" + } + }, + { + "name": "preference", + "in": "query", + "description": "Specify the node or shard the operation should be performed on.", + "schema": { + "type": "string", + "default": "random", + "description": "Specify the node or shard the operation should be performed on." + } + }, + { + "name": "routing", + "in": "query", + "description": "Comma-separated list of specific routing values.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of specific routing values." + }, + "explode": true + }, + { + "name": "q", + "in": "query", + "description": "Query in the Lucene query string syntax.", + "schema": { + "type": "string", + "description": "Query in the Lucene query string syntax." + } + }, + { + "name": "analyzer", + "in": "query", + "description": "The analyzer to use for the query string.", + "schema": { + "type": "string", + "description": "The analyzer to use for the query string." + } + }, + { + "name": "analyze_wildcard", + "in": "query", + "description": "Specify whether wildcard and prefix queries should be analyzed.", + "schema": { + "type": "boolean", + "default": false, + "description": "Specify whether wildcard and prefix queries should be analyzed." + } + }, + { + "name": "default_operator", + "in": "query", + "description": "The default operator for query string query (AND or OR).", + "schema": { + "$ref": "#/components/schemas/DefaultOperator" + } + }, + { + "name": "df", + "in": "query", + "description": "The field to use as default where no field prefix is given in the query string.", + "schema": { + "type": "string", + "description": "The field to use as default where no field prefix is given in the query string." + } + }, + { + "name": "lenient", + "in": "query", + "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored.", + "schema": { + "type": "boolean", + "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored." + } + }, + { + "name": "terminate_after", + "in": "query", + "description": "The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.", + "schema": { + "type": "integer", + "description": "The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Count_Get 200 response" + } + }, + "x-operation-group": "count", + "x-version-added": "1.0" + }, + "post": { + "description": "Returns number of documents matching a query.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/count/" + }, + "operationId": "Count_Post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Count_BodyParams" + } + } + } + }, + "parameters": [ + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "ignore_throttled", + "in": "query", + "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled.", + "schema": { + "type": "boolean", + "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "min_score", + "in": "query", + "description": "Include only documents with a specific `_score` value in the result.", + "schema": { + "type": "integer", + "description": "Include only documents with a specific `_score` value in the result.", + "format": "int32" + } + }, + { + "name": "preference", + "in": "query", + "description": "Specify the node or shard the operation should be performed on.", + "schema": { + "type": "string", + "default": "random", + "description": "Specify the node or shard the operation should be performed on." + } + }, + { + "name": "routing", + "in": "query", + "description": "Comma-separated list of specific routing values.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of specific routing values." + }, + "explode": true + }, + { + "name": "q", + "in": "query", + "description": "Query in the Lucene query string syntax.", + "schema": { + "type": "string", + "description": "Query in the Lucene query string syntax." + } + }, + { + "name": "analyzer", + "in": "query", + "description": "The analyzer to use for the query string.", + "schema": { + "type": "string", + "description": "The analyzer to use for the query string." + } + }, + { + "name": "analyze_wildcard", + "in": "query", + "description": "Specify whether wildcard and prefix queries should be analyzed.", + "schema": { + "type": "boolean", + "default": false, + "description": "Specify whether wildcard and prefix queries should be analyzed." + } + }, + { + "name": "default_operator", + "in": "query", + "description": "The default operator for query string query (AND or OR).", + "schema": { + "$ref": "#/components/schemas/DefaultOperator" + } + }, + { + "name": "df", + "in": "query", + "description": "The field to use as default where no field prefix is given in the query string.", + "schema": { + "type": "string", + "description": "The field to use as default where no field prefix is given in the query string." + } + }, + { + "name": "lenient", + "in": "query", + "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored.", + "schema": { + "type": "boolean", + "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored." + } + }, + { + "name": "terminate_after", + "in": "query", + "description": "The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.", + "schema": { + "type": "integer", + "description": "The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Count_Post 200 response" + } + }, + "x-operation-group": "count", + "x-version-added": "1.0" + } + }, + "/_dangling": { + "get": { + "description": "Returns all dangling indices.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/index-apis/dangling-index/" + }, + "operationId": "DanglingIndicesListDanglingIndices", + "responses": { + "200": { + "description": "DanglingIndicesListDanglingIndices 200 response" + } + }, + "x-operation-group": "dangling_indices.list_dangling_indices", + "x-version-added": "1.0" + } + }, + "/_dangling/{index_uuid}": { + "delete": { + "description": "Deletes the specified dangling index.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/index-apis/dangling-index/" + }, + "operationId": "DanglingIndicesDeleteDanglingIndex", + "parameters": [ + { + "name": "index_uuid", + "in": "path", + "description": "The UUID of the dangling index.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The UUID of the dangling index." + }, + "required": true + }, + { + "name": "accept_data_loss", + "in": "query", + "description": "Must be set to true in order to delete the dangling index.", + "schema": { + "type": "boolean", + "description": "Must be set to true in order to delete the dangling index." + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "DanglingIndicesDeleteDanglingIndex 200 response" + } + }, + "x-operation-group": "dangling_indices.delete_dangling_index", + "x-version-added": "1.0" + }, + "post": { + "description": "Imports the specified dangling index.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/index-apis/dangling-index/" + }, + "operationId": "DanglingIndicesImportDanglingIndex", + "parameters": [ + { + "name": "index_uuid", + "in": "path", + "description": "The UUID of the dangling index.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The UUID of the dangling index." + }, + "required": true + }, + { + "name": "accept_data_loss", + "in": "query", + "description": "Must be set to true in order to import the dangling index.", + "schema": { + "type": "boolean", + "description": "Must be set to true in order to import the dangling index." + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "DanglingIndicesImportDanglingIndex 200 response" + } + }, + "x-operation-group": "dangling_indices.import_dangling_index", + "x-version-added": "1.0" + } + }, + "/_data_stream": { + "get": { + "description": "Returns data streams.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/im-plugin/data-streams/" + }, + "operationId": "IndicesGetDataStream", + "responses": { + "200": { + "description": "IndicesGetDataStream 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndicesGetDataStreamResponseContent" + } + } + } + } + }, + "x-operation-group": "indices.get_data_stream", + "x-version-added": "1.0" + } + }, + "/_data_stream/_stats": { + "get": { + "description": "Provides statistics on operations happening in a data stream.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/im-plugin/data-streams/" + }, + "operationId": "IndicesDataStreamsStats", + "responses": { + "200": { + "description": "IndicesDataStreamsStats 200 response" + } + }, + "x-operation-group": "indices.data_streams_stats", + "x-version-added": "1.0" + } + }, + "/_data_stream/{name}": { + "delete": { + "description": "Deletes a data stream.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/im-plugin/data-streams/" + }, + "operationId": "IndicesDeleteDataStream", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Comma-separated list of data streams; use `_all` or empty string to perform the operation on all data streams.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of data streams; use `_all` or empty string to perform the operation on all data streams.", + "x-data-type": "array" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "IndicesDeleteDataStream 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndicesDeleteDataStreamResponseContent" + } + } + } + } + }, + "x-operation-group": "indices.delete_data_stream", + "x-version-added": "1.0" + }, + "get": { + "description": "Returns data streams.", + "operationId": "IndicesGetDataStream_WithName", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Comma-separated list of data streams; use `_all` or empty string to perform the operation on all data streams.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of data streams; use `_all` or empty string to perform the operation on all data streams.", + "x-data-type": "array" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "IndicesGetDataStream_WithName 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndicesGetDataStream_WithNameResponseContent" + } + } + } + } + }, + "x-operation-group": "indices.get_data_stream", + "x-version-added": "1.0" + }, + "put": { + "description": "Creates or updates a data stream.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/im-plugin/data-streams/" + }, + "operationId": "IndicesCreateDataStream", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndicesCreateDataStream_BodyParams" + } + } + } + }, + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the data stream.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the data stream." + }, + "required": true + } + ], + "responses": { + "200": { + "description": "IndicesCreateDataStream 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndicesCreateDataStreamResponseContent" + } + } + } + } + }, + "x-operation-group": "indices.create_data_stream", + "x-version-added": "1.0" + } + }, + "/_data_stream/{name}/_stats": { + "get": { + "description": "Provides statistics on operations happening in a data stream.", + "operationId": "IndicesDataStreamsStats_WithName", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Comma-separated list of data streams; use `_all` or empty string to perform the operation on all data streams.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of data streams; use `_all` or empty string to perform the operation on all data streams.", + "x-data-type": "array" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "IndicesDataStreamsStats_WithName 200 response" + } + }, + "x-operation-group": "indices.data_streams_stats", + "x-version-added": "1.0" + } + }, + "/_delete_by_query/{task_id}/_rethrottle": { + "post": { + "description": "Changes the number of requests per second for a particular Delete By Query operation.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest" + }, + "operationId": "DeleteByQueryRethrottle", + "parameters": [ + { + "name": "task_id", + "in": "path", + "description": "The task id to rethrottle.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The task id to rethrottle." + }, + "required": true + }, + { + "name": "requests_per_second", + "in": "query", + "description": "The throttle for this request in sub-requests per second. -1 means no throttle.", + "schema": { + "type": "integer", + "description": "The throttle for this request in sub-requests per second. -1 means no throttle.", + "format": "int32" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "DeleteByQueryRethrottle 200 response" + } + }, + "x-operation-group": "delete_by_query_rethrottle", + "x-version-added": "1.0" + } + }, + "/_field_caps": { + "get": { + "description": "Returns the information about the capabilities of fields among multiple indices.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/field-types/supported-field-types/alias/#using-aliases-in-field-capabilities-api-operations" + }, + "operationId": "FieldCaps_Get", + "parameters": [ + { + "name": "fields", + "in": "query", + "description": "Comma-separated list of field names.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of field names." + }, + "explode": true + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "include_unmapped", + "in": "query", + "description": "Indicates whether unmapped fields should be included in the response.", + "schema": { + "type": "boolean", + "default": false, + "description": "Indicates whether unmapped fields should be included in the response." + } + } + ], + "responses": { + "200": { + "description": "FieldCaps_Get 200 response" + } + }, + "x-operation-group": "field_caps", + "x-version-added": "1.0" + }, + "post": { + "description": "Returns the information about the capabilities of fields among multiple indices.", + "operationId": "FieldCaps_Post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FieldCaps_BodyParams" + } + } + } + }, + "parameters": [ + { + "name": "fields", + "in": "query", + "description": "Comma-separated list of field names.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of field names." + }, + "explode": true + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "include_unmapped", + "in": "query", + "description": "Indicates whether unmapped fields should be included in the response.", + "schema": { + "type": "boolean", + "default": false, + "description": "Indicates whether unmapped fields should be included in the response." + } + } + ], + "responses": { + "200": { + "description": "FieldCaps_Post 200 response" + } + }, + "x-operation-group": "field_caps", + "x-version-added": "1.0" + } + }, + "/_flush": { + "get": { + "description": "Performs the flush operation on one or more indices.", + "operationId": "IndicesFlush_Get", + "parameters": [ + { + "name": "force", + "in": "query", + "description": "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).", + "schema": { + "type": "boolean", + "description": "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)." + } + }, + { + "name": "wait_if_ongoing", + "in": "query", + "description": "If set to true the flush operation will block until the flush can be executed if another flush operation is already executing. If set to false the flush will be skipped iff if another flush operation is already running.", + "schema": { + "type": "boolean", + "default": true, + "description": "If set to true the flush operation will block until the flush can be executed if another flush operation is already executing. If set to false the flush will be skipped iff if another flush operation is already running." + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + } + ], + "responses": { + "200": { + "description": "IndicesFlush_Get 200 response" + } + }, + "x-operation-group": "indices.flush", + "x-version-added": "1.0" + }, + "post": { + "description": "Performs the flush operation on one or more indices.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest" + }, + "operationId": "IndicesFlush_Post", + "parameters": [ + { + "name": "force", + "in": "query", + "description": "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).", + "schema": { + "type": "boolean", + "description": "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)." + } + }, + { + "name": "wait_if_ongoing", + "in": "query", + "description": "If set to true the flush operation will block until the flush can be executed if another flush operation is already executing. If set to false the flush will be skipped iff if another flush operation is already running.", + "schema": { + "type": "boolean", + "default": true, + "description": "If set to true the flush operation will block until the flush can be executed if another flush operation is already executing. If set to false the flush will be skipped iff if another flush operation is already running." + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + } + ], + "responses": { + "200": { + "description": "IndicesFlush_Post 200 response" + } + }, + "x-operation-group": "indices.flush", + "x-version-added": "1.0" + } + }, + "/_forcemerge": { + "post": { + "description": "Performs the force merge operation on one or more indices.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest" + }, + "operationId": "IndicesForcemerge", + "parameters": [ + { + "name": "flush", + "in": "query", + "description": "Specify whether the index should be flushed after performing the operation.", + "schema": { + "type": "boolean", + "default": true, + "description": "Specify whether the index should be flushed after performing the operation." + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "max_num_segments", + "in": "query", + "description": "The number of segments the index should be merged into (default: dynamic).", + "schema": { + "type": "integer", + "description": "The number of segments the index should be merged into (default: dynamic).", + "format": "int32" + } + }, + { + "name": "only_expunge_deletes", + "in": "query", + "description": "Specify whether the operation should only expunge deleted documents.", + "schema": { + "type": "boolean", + "description": "Specify whether the operation should only expunge deleted documents." + } + } + ], + "responses": { + "200": { + "description": "IndicesForcemerge 200 response" + } + }, + "x-operation-group": "indices.forcemerge", + "x-version-added": "1.0" + } + }, + "/_index_template": { + "get": { + "description": "Returns an index template.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/im-plugin/index-templates/" + }, + "operationId": "IndicesGetIndexTemplate", + "parameters": [ + { + "name": "flat_settings", + "in": "query", + "description": "Return settings in flat format.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return settings in flat format." + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + } + ], + "responses": { + "200": { + "description": "IndicesGetIndexTemplate 200 response" + } + }, + "x-operation-group": "indices.get_index_template", + "x-version-added": "1.0" + } + }, + "/_index_template/_simulate": { + "post": { + "description": "Simulate resolving the given template name or body.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest" + }, + "operationId": "IndicesSimulateTemplate", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndicesSimulateTemplate_BodyParams" + } + } + } + }, + "parameters": [ + { + "name": "create", + "in": "query", + "description": "Whether the index template we optionally defined in the body should only be dry-run added if new or can also replace an existing one.", + "schema": { + "type": "boolean", + "default": false, + "description": "Whether the index template we optionally defined in the body should only be dry-run added if new or can also replace an existing one." + } + }, + { + "name": "cause", + "in": "query", + "description": "User defined reason for dry-run creating the new template for simulation purposes.", + "schema": { + "type": "string", + "default": "false", + "description": "User defined reason for dry-run creating the new template for simulation purposes." + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "IndicesSimulateTemplate 200 response" + } + }, + "x-operation-group": "indices.simulate_template", + "x-version-added": "1.0" + } + }, + "/_index_template/_simulate/{name}": { + "post": { + "description": "Simulate resolving the given template name or body.", + "operationId": "IndicesSimulateTemplate_WithName", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndicesSimulateTemplate_BodyParams" + } + } + } + }, + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the template.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the template." + }, + "required": true + }, + { + "name": "create", + "in": "query", + "description": "Whether the index template we optionally defined in the body should only be dry-run added if new or can also replace an existing one.", + "schema": { + "type": "boolean", + "default": false, + "description": "Whether the index template we optionally defined in the body should only be dry-run added if new or can also replace an existing one." + } + }, + { + "name": "cause", + "in": "query", + "description": "User defined reason for dry-run creating the new template for simulation purposes.", + "schema": { + "type": "string", + "default": "false", + "description": "User defined reason for dry-run creating the new template for simulation purposes." + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "IndicesSimulateTemplate_WithName 200 response" + } + }, + "x-operation-group": "indices.simulate_template", + "x-version-added": "1.0" + } + }, + "/_index_template/_simulate_index/{name}": { + "post": { + "description": "Simulate matching the given index name against the index templates in the system.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest" + }, + "operationId": "IndicesSimulateIndexTemplate", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndicesSimulateIndexTemplate_BodyParams" + } + } + } + }, + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the index (it must be a concrete index name).", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the index (it must be a concrete index name)." + }, + "required": true + }, + { + "name": "create", + "in": "query", + "description": "Whether the index template we optionally defined in the body should only be dry-run added if new or can also replace an existing one.", + "schema": { + "type": "boolean", + "default": false, + "description": "Whether the index template we optionally defined in the body should only be dry-run added if new or can also replace an existing one." + } + }, + { + "name": "cause", + "in": "query", + "description": "User defined reason for dry-run creating the new template for simulation purposes.", + "schema": { + "type": "string", + "default": "false", + "description": "User defined reason for dry-run creating the new template for simulation purposes." + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "IndicesSimulateIndexTemplate 200 response" + } + }, + "x-operation-group": "indices.simulate_index_template", + "x-version-added": "1.0" + } + }, + "/_index_template/{name}": { + "delete": { + "description": "Deletes an index template.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/im-plugin/index-templates/#delete-a-template" + }, + "operationId": "IndicesDeleteIndexTemplate", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the template.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the template." + }, + "required": true + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "IndicesDeleteIndexTemplate 200 response" + } + }, + "x-operation-group": "indices.delete_index_template", + "x-version-added": "1.0" + }, + "get": { + "description": "Returns an index template.", + "operationId": "IndicesGetIndexTemplate_WithName", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Comma-separated names of the index templates.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated names of the index templates.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "flat_settings", + "in": "query", + "description": "Return settings in flat format.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return settings in flat format." + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + } + ], + "responses": { + "200": { + "description": "IndicesGetIndexTemplate_WithName 200 response" + } + }, + "x-operation-group": "indices.get_index_template", + "x-version-added": "1.0" + }, + "head": { + "description": "Returns information about whether a particular index template exists.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/im-plugin/index-templates/" + }, + "operationId": "IndicesExistsIndexTemplate", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the template.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the template." + }, + "required": true + }, + { + "name": "flat_settings", + "in": "query", + "description": "Return settings in flat format.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return settings in flat format." + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + } + ], + "responses": { + "200": { + "description": "IndicesExistsIndexTemplate 200 response" + } + }, + "x-operation-group": "indices.exists_index_template", + "x-version-added": "1.0" + }, + "post": { + "description": "Creates or updates an index template.", + "operationId": "IndicesPutIndexTemplate_Post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndicesPutIndexTemplate_BodyParams" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the template.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the template." + }, + "required": true + }, + { + "name": "create", + "in": "query", + "description": "Whether the index template should only be added if new or can also replace an existing one.", + "schema": { + "type": "boolean", + "default": false, + "description": "Whether the index template should only be added if new or can also replace an existing one." + } + }, + { + "name": "cause", + "in": "query", + "description": "User defined reason for creating/updating the index template.", + "schema": { + "type": "string", + "default": "false", + "description": "User defined reason for creating/updating the index template." + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "IndicesPutIndexTemplate_Post 200 response" + } + }, + "x-operation-group": "indices.put_index_template", + "x-version-added": "1.0" + }, + "put": { + "description": "Creates or updates an index template.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/im-plugin/index-templates/" + }, + "operationId": "IndicesPutIndexTemplate_Put", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndicesPutIndexTemplate_BodyParams" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the template.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the template." + }, + "required": true + }, + { + "name": "create", + "in": "query", + "description": "Whether the index template should only be added if new or can also replace an existing one.", + "schema": { + "type": "boolean", + "default": false, + "description": "Whether the index template should only be added if new or can also replace an existing one." + } + }, + { + "name": "cause", + "in": "query", + "description": "User defined reason for creating/updating the index template.", + "schema": { + "type": "string", + "default": "false", + "description": "User defined reason for creating/updating the index template." + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "IndicesPutIndexTemplate_Put 200 response" + } + }, + "x-operation-group": "indices.put_index_template", + "x-version-added": "1.0" + } + }, + "/_ingest/pipeline": { + "get": { + "description": "Returns a pipeline.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/ingest-apis/get-ingest/" + }, + "operationId": "IngestGetPipeline", + "parameters": [ + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "IngestGetPipeline 200 response" + } + }, + "x-operation-group": "ingest.get_pipeline", + "x-version-added": "1.0" + } + }, + "/_ingest/pipeline/_simulate": { + "get": { + "description": "Allows to simulate a pipeline with example documents.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/ingest-apis/simulate-ingest/" + }, + "operationId": "IngestSimulate_Get", + "parameters": [ + { + "name": "verbose", + "in": "query", + "description": "Verbose mode. Display data output for each processor in executed pipeline.", + "schema": { + "type": "boolean", + "default": false, + "description": "Verbose mode. Display data output for each processor in executed pipeline." + } + } + ], + "responses": { + "200": { + "description": "IngestSimulate_Get 200 response" + } + }, + "x-operation-group": "ingest.simulate", + "x-version-added": "1.0" + }, + "post": { + "description": "Allows to simulate a pipeline with example documents.", + "operationId": "IngestSimulate_Post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IngestSimulate_BodyParams" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "verbose", + "in": "query", + "description": "Verbose mode. Display data output for each processor in executed pipeline.", + "schema": { + "type": "boolean", + "default": false, + "description": "Verbose mode. Display data output for each processor in executed pipeline." + } + } + ], + "responses": { + "200": { + "description": "IngestSimulate_Post 200 response" + } + }, + "x-operation-group": "ingest.simulate", + "x-version-added": "1.0" + } + }, + "/_ingest/pipeline/{id}": { + "delete": { + "description": "Deletes a pipeline.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/ingest-apis/delete-ingest/" + }, + "operationId": "IngestDeletePipeline", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Pipeline ID.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Pipeline ID." + }, + "required": true + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "IngestDeletePipeline 200 response" + } + }, + "x-operation-group": "ingest.delete_pipeline", + "x-version-added": "1.0" + }, + "get": { + "description": "Returns a pipeline.", + "operationId": "IngestGetPipeline_WithId", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Comma-separated list of pipeline ids. Wildcards supported.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of pipeline ids. Wildcards supported.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "IngestGetPipeline_WithId 200 response" + } + }, + "x-operation-group": "ingest.get_pipeline", + "x-version-added": "1.0" + }, + "put": { + "description": "Creates or updates a pipeline.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/ingest-apis/create-update-ingest/" + }, + "operationId": "IngestPutPipeline", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IngestPutPipeline_BodyParams" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Pipeline ID.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Pipeline ID." + }, + "required": true + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "IngestPutPipeline 200 response" + } + }, + "x-operation-group": "ingest.put_pipeline", + "x-version-added": "1.0" + } + }, + "/_ingest/pipeline/{id}/_simulate": { + "get": { + "description": "Allows to simulate a pipeline with example documents.", + "operationId": "IngestSimulate_Get_WithId", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Pipeline ID.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Pipeline ID." + }, + "required": true + }, + { + "name": "verbose", + "in": "query", + "description": "Verbose mode. Display data output for each processor in executed pipeline.", + "schema": { + "type": "boolean", + "default": false, + "description": "Verbose mode. Display data output for each processor in executed pipeline." + } + } + ], + "responses": { + "200": { + "description": "IngestSimulate_Get_WithId 200 response" + } + }, + "x-operation-group": "ingest.simulate", + "x-version-added": "1.0" + }, + "post": { + "description": "Allows to simulate a pipeline with example documents.", + "operationId": "IngestSimulate_Post_WithId", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IngestSimulate_BodyParams" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Pipeline ID.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Pipeline ID." + }, + "required": true + }, + { + "name": "verbose", + "in": "query", + "description": "Verbose mode. Display data output for each processor in executed pipeline.", + "schema": { + "type": "boolean", + "default": false, + "description": "Verbose mode. Display data output for each processor in executed pipeline." + } + } + ], + "responses": { + "200": { + "description": "IngestSimulate_Post_WithId 200 response" + } + }, + "x-operation-group": "ingest.simulate", + "x-version-added": "1.0" + } + }, + "/_ingest/processor/grok": { + "get": { + "description": "Returns a list of the built-in patterns.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest" + }, + "operationId": "IngestProcessorGrok", + "responses": { + "200": { + "description": "IngestProcessorGrok 200 response" + } + }, + "x-operation-group": "ingest.processor_grok", + "x-version-added": "1.0" + } + }, + "/_mapping": { + "get": { + "description": "Returns mappings for one or more indices.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/field-types/index/#get-a-mapping" + }, + "operationId": "IndicesGetMapping", + "parameters": [ + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "x-version-deprecated": "1.0", + "x-deprecation-message": "This parameter is a no-op and field mappings are always retrieved locally.", + "deprecated": true + } + } + ], + "responses": { + "200": { + "description": "IndicesGetMapping 200 response" + } + }, + "x-operation-group": "indices.get_mapping", + "x-version-added": "1.0" + } + }, + "/_mapping/field/{fields}": { + "get": { + "description": "Returns mapping for one or more fields.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/field-types/index/" + }, + "operationId": "IndicesGetFieldMapping", + "parameters": [ + { + "name": "fields", + "in": "path", + "description": "Comma-separated list of fields.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of fields.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "include_defaults", + "in": "query", + "description": "Whether the default mapping values should be returned as well.", + "schema": { + "type": "boolean", + "description": "Whether the default mapping values should be returned as well." + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + } + ], + "responses": { + "200": { + "description": "IndicesGetFieldMapping 200 response" + } + }, + "x-operation-group": "indices.get_field_mapping", + "x-version-added": "1.0" + } + }, + "/_mget": { + "get": { + "description": "Allows to get multiple documents in one request.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/document-apis/multi-get/" + }, + "operationId": "Mget_Get", + "parameters": [ + { + "name": "stored_fields", + "in": "query", + "description": "Comma-separated list of stored fields to return.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of stored fields to return." + }, + "explode": true + }, + { + "name": "preference", + "in": "query", + "description": "Specify the node or shard the operation should be performed on.", + "schema": { + "type": "string", + "default": "random", + "description": "Specify the node or shard the operation should be performed on." + } + }, + { + "name": "realtime", + "in": "query", + "description": "Specify whether to perform the operation in realtime or search mode.", + "schema": { + "type": "boolean", + "description": "Specify whether to perform the operation in realtime or search mode." + } + }, + { + "name": "refresh", + "in": "query", + "description": "Refresh the shard containing the document before performing the operation.", + "schema": { + "type": "boolean", + "description": "Refresh the shard containing the document before performing the operation." + } + }, + { + "name": "routing", + "in": "query", + "description": "Routing value.", + "schema": { + "type": "string", + "description": "Routing value." + } + }, + { + "name": "_source", + "in": "query", + "description": "True or false to return the _source field or not, or a list of fields to return.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "True or false to return the _source field or not, or a list of fields to return." + }, + "explode": true + }, + { + "name": "_source_excludes", + "in": "query", + "description": "List of fields to exclude from the returned _source field.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of fields to exclude from the returned _source field." + }, + "explode": true + }, + { + "name": "_source_includes", + "in": "query", + "description": "List of fields to extract and return from the _source field.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of fields to extract and return from the _source field." + }, + "explode": true + } + ], + "responses": { + "200": { + "description": "Mget_Get 200 response" + } + }, + "x-operation-group": "mget", + "x-version-added": "1.0" + }, + "post": { + "description": "Allows to get multiple documents in one request.", + "operationId": "Mget_Post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Mget_BodyParams" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "stored_fields", + "in": "query", + "description": "Comma-separated list of stored fields to return.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of stored fields to return." + }, + "explode": true + }, + { + "name": "preference", + "in": "query", + "description": "Specify the node or shard the operation should be performed on.", + "schema": { + "type": "string", + "default": "random", + "description": "Specify the node or shard the operation should be performed on." + } + }, + { + "name": "realtime", + "in": "query", + "description": "Specify whether to perform the operation in realtime or search mode.", + "schema": { + "type": "boolean", + "description": "Specify whether to perform the operation in realtime or search mode." + } + }, + { + "name": "refresh", + "in": "query", + "description": "Refresh the shard containing the document before performing the operation.", + "schema": { + "type": "boolean", + "description": "Refresh the shard containing the document before performing the operation." + } + }, + { + "name": "routing", + "in": "query", + "description": "Routing value.", + "schema": { + "type": "string", + "description": "Routing value." + } + }, + { + "name": "_source", + "in": "query", + "description": "True or false to return the _source field or not, or a list of fields to return.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "True or false to return the _source field or not, or a list of fields to return." + }, + "explode": true + }, + { + "name": "_source_excludes", + "in": "query", + "description": "List of fields to exclude from the returned _source field.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of fields to exclude from the returned _source field." + }, + "explode": true + }, + { + "name": "_source_includes", + "in": "query", + "description": "List of fields to extract and return from the _source field.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of fields to extract and return from the _source field." + }, + "explode": true + } + ], + "responses": { + "200": { + "description": "Mget_Post 200 response" + } + }, + "x-operation-group": "mget", + "x-version-added": "1.0" + } + }, + "/_msearch": { + "get": { + "description": "Allows to execute several search operations in one request.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/multi-search/" + }, + "operationId": "Msearch_Get", + "parameters": [ + { + "name": "search_type", + "in": "query", + "description": "Search operation type.", + "schema": { + "$ref": "#/components/schemas/SearchTypeMulti" + } + }, + { + "name": "max_concurrent_searches", + "in": "query", + "description": "Controls the maximum number of concurrent searches the multi search api will execute.", + "schema": { + "type": "integer", + "description": "Controls the maximum number of concurrent searches the multi search api will execute.", + "format": "int32" + } + }, + { + "name": "typed_keys", + "in": "query", + "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response.", + "schema": { + "type": "boolean", + "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response." + } + }, + { + "name": "pre_filter_shard_size", + "in": "query", + "description": "Threshold that enforces a pre-filter round-trip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter round-trip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint.", + "schema": { + "type": "integer", + "description": "Threshold that enforces a pre-filter round-trip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter round-trip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint.", + "format": "int32" + } + }, + { + "name": "max_concurrent_shard_requests", + "in": "query", + "description": "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.", + "schema": { + "type": "integer", + "default": 5, + "description": "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.", + "format": "int32" + } + }, + { + "name": "rest_total_hits_as_int", + "in": "query", + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response.", + "schema": { + "type": "boolean", + "default": false, + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response." + } + }, + { + "name": "ccs_minimize_roundtrips", + "in": "query", + "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution.", + "schema": { + "type": "boolean", + "default": true, + "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution." + } + } + ], + "responses": { + "200": { + "description": "Msearch_Get 200 response" + } + }, + "x-operation-group": "msearch", + "x-version-added": "1.0" + }, + "post": { + "description": "Allows to execute several search operations in one request.", + "operationId": "Msearch_Post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Msearch_BodyParams" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "search_type", + "in": "query", + "description": "Search operation type.", + "schema": { + "$ref": "#/components/schemas/SearchTypeMulti" + } + }, + { + "name": "max_concurrent_searches", + "in": "query", + "description": "Controls the maximum number of concurrent searches the multi search api will execute.", + "schema": { + "type": "integer", + "description": "Controls the maximum number of concurrent searches the multi search api will execute.", + "format": "int32" + } + }, + { + "name": "typed_keys", + "in": "query", + "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response.", + "schema": { + "type": "boolean", + "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response." + } + }, + { + "name": "pre_filter_shard_size", + "in": "query", + "description": "Threshold that enforces a pre-filter round-trip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter round-trip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint.", + "schema": { + "type": "integer", + "description": "Threshold that enforces a pre-filter round-trip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter round-trip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint.", + "format": "int32" + } + }, + { + "name": "max_concurrent_shard_requests", + "in": "query", + "description": "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.", + "schema": { + "type": "integer", + "default": 5, + "description": "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.", + "format": "int32" + } + }, + { + "name": "rest_total_hits_as_int", + "in": "query", + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response.", + "schema": { + "type": "boolean", + "default": false, + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response." + } + }, + { + "name": "ccs_minimize_roundtrips", + "in": "query", + "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution.", + "schema": { + "type": "boolean", + "default": true, + "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution." + } + } + ], + "responses": { + "200": { + "description": "Msearch_Post 200 response" + } + }, + "x-operation-group": "msearch", + "x-version-added": "1.0" + } + }, + "/_msearch/template": { + "get": { + "description": "Allows to execute several search template operations in one request.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/search-plugins/search-template/" + }, + "operationId": "MsearchTemplate_Get", + "parameters": [ + { + "name": "search_type", + "in": "query", + "description": "Search operation type.", + "schema": { + "$ref": "#/components/schemas/SearchTypeMulti" + } + }, + { + "name": "typed_keys", + "in": "query", + "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response.", + "schema": { + "type": "boolean", + "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response." + } + }, + { + "name": "max_concurrent_searches", + "in": "query", + "description": "Controls the maximum number of concurrent searches the multi search api will execute.", + "schema": { + "type": "integer", + "description": "Controls the maximum number of concurrent searches the multi search api will execute.", + "format": "int32" + } + }, + { + "name": "rest_total_hits_as_int", + "in": "query", + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response.", + "schema": { + "type": "boolean", + "default": false, + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response." + } + }, + { + "name": "ccs_minimize_roundtrips", + "in": "query", + "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution.", + "schema": { + "type": "boolean", + "default": true, + "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution." + } + } + ], + "responses": { + "200": { + "description": "MsearchTemplate_Get 200 response" + } + }, + "x-operation-group": "msearch_template", + "x-version-added": "1.0" + }, + "post": { + "description": "Allows to execute several search template operations in one request.", + "operationId": "MsearchTemplate_Post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MsearchTemplate_BodyParams" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "search_type", + "in": "query", + "description": "Search operation type.", + "schema": { + "$ref": "#/components/schemas/SearchTypeMulti" + } + }, + { + "name": "typed_keys", + "in": "query", + "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response.", + "schema": { + "type": "boolean", + "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response." + } + }, + { + "name": "max_concurrent_searches", + "in": "query", + "description": "Controls the maximum number of concurrent searches the multi search api will execute.", + "schema": { + "type": "integer", + "description": "Controls the maximum number of concurrent searches the multi search api will execute.", + "format": "int32" + } + }, + { + "name": "rest_total_hits_as_int", + "in": "query", + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response.", + "schema": { + "type": "boolean", + "default": false, + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response." + } + }, + { + "name": "ccs_minimize_roundtrips", + "in": "query", + "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution.", + "schema": { + "type": "boolean", + "default": true, + "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution." + } + } + ], + "responses": { + "200": { + "description": "MsearchTemplate_Post 200 response" + } + }, + "x-operation-group": "msearch_template", + "x-version-added": "1.0" + } + }, + "/_mtermvectors": { + "get": { + "description": "Returns multiple termvectors in one request.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest" + }, + "operationId": "Mtermvectors_Get", + "parameters": [ + { + "name": "ids", + "in": "query", + "description": "Comma-separated list of documents ids. You must define ids as parameter or set 'ids' or 'docs' in the request body.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of documents ids. You must define ids as parameter or set 'ids' or 'docs' in the request body." + }, + "explode": true + }, + { + "name": "term_statistics", + "in": "query", + "description": "Specifies if total term frequency and document frequency should be returned. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'.", + "schema": { + "type": "boolean", + "default": false, + "description": "Specifies if total term frequency and document frequency should be returned. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'." + } + }, + { + "name": "field_statistics", + "in": "query", + "description": "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'.", + "schema": { + "type": "boolean", + "default": true, + "description": "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'." + } + }, + { + "name": "fields", + "in": "query", + "description": "Comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'." + }, + "explode": true + }, + { + "name": "offsets", + "in": "query", + "description": "Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'.", + "schema": { + "type": "boolean", + "default": true, + "description": "Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'." + } + }, + { + "name": "positions", + "in": "query", + "description": "Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'.", + "schema": { + "type": "boolean", + "default": true, + "description": "Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'." + } + }, + { + "name": "payloads", + "in": "query", + "description": "Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'.", + "schema": { + "type": "boolean", + "default": true, + "description": "Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'." + } + }, + { + "name": "preference", + "in": "query", + "description": "Specify the node or shard the operation should be performed on. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'.", + "schema": { + "type": "string", + "default": "random", + "description": "Specify the node or shard the operation should be performed on. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'." + } + }, + { + "name": "routing", + "in": "query", + "description": "Routing value. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'.", + "schema": { + "type": "string", + "description": "Routing value. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'." + } + }, + { + "name": "realtime", + "in": "query", + "description": "Specifies if requests are real-time as opposed to near-real-time.", + "schema": { + "type": "boolean", + "default": true, + "description": "Specifies if requests are real-time as opposed to near-real-time." + } + }, + { + "name": "version", + "in": "query", + "description": "Explicit version number for concurrency control.", + "schema": { + "type": "integer", + "description": "Explicit version number for concurrency control.", + "format": "int32" + } + }, + { + "name": "version_type", + "in": "query", + "description": "Specific version type.", + "schema": { + "$ref": "#/components/schemas/VersionType" + } + } + ], + "responses": { + "200": { + "description": "Mtermvectors_Get 200 response" + } + }, + "x-operation-group": "mtermvectors", + "x-version-added": "1.0" + }, + "post": { + "description": "Returns multiple termvectors in one request.", + "operationId": "Mtermvectors_Post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Mtermvectors_BodyParams" + } + } + } + }, + "parameters": [ + { + "name": "ids", + "in": "query", + "description": "Comma-separated list of documents ids. You must define ids as parameter or set 'ids' or 'docs' in the request body.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of documents ids. You must define ids as parameter or set 'ids' or 'docs' in the request body." + }, + "explode": true + }, + { + "name": "term_statistics", + "in": "query", + "description": "Specifies if total term frequency and document frequency should be returned. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'.", + "schema": { + "type": "boolean", + "default": false, + "description": "Specifies if total term frequency and document frequency should be returned. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'." + } + }, + { + "name": "field_statistics", + "in": "query", + "description": "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'.", + "schema": { + "type": "boolean", + "default": true, + "description": "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'." + } + }, + { + "name": "fields", + "in": "query", + "description": "Comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'." + }, + "explode": true + }, + { + "name": "offsets", + "in": "query", + "description": "Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'.", + "schema": { + "type": "boolean", + "default": true, + "description": "Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'." + } + }, + { + "name": "positions", + "in": "query", + "description": "Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'.", + "schema": { + "type": "boolean", + "default": true, + "description": "Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'." + } + }, + { + "name": "payloads", + "in": "query", + "description": "Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'.", + "schema": { + "type": "boolean", + "default": true, + "description": "Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'." + } + }, + { + "name": "preference", + "in": "query", + "description": "Specify the node or shard the operation should be performed on. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'.", + "schema": { + "type": "string", + "default": "random", + "description": "Specify the node or shard the operation should be performed on. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'." + } + }, + { + "name": "routing", + "in": "query", + "description": "Routing value. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'.", + "schema": { + "type": "string", + "description": "Routing value. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'." + } + }, + { + "name": "realtime", + "in": "query", + "description": "Specifies if requests are real-time as opposed to near-real-time.", + "schema": { + "type": "boolean", + "default": true, + "description": "Specifies if requests are real-time as opposed to near-real-time." + } + }, + { + "name": "version", + "in": "query", + "description": "Explicit version number for concurrency control.", + "schema": { + "type": "integer", + "description": "Explicit version number for concurrency control.", + "format": "int32" + } + }, + { + "name": "version_type", + "in": "query", + "description": "Specific version type.", + "schema": { + "$ref": "#/components/schemas/VersionType" + } + } + ], + "responses": { + "200": { + "description": "Mtermvectors_Post 200 response" + } + }, + "x-operation-group": "mtermvectors", + "x-version-added": "1.0" + } + }, + "/_nodes": { + "get": { + "description": "Returns information about nodes in the cluster.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/nodes-apis/nodes-info/" + }, + "operationId": "NodesInfo", + "parameters": [ + { + "name": "flat_settings", + "in": "query", + "description": "Return settings in flat format.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return settings in flat format." + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "NodesInfo 200 response" + } + }, + "x-operation-group": "nodes.info", + "x-version-added": "1.0" + } + }, + "/_nodes/hot_threads": { + "get": { + "description": "Returns information about hot threads on each node in the cluster.", + "operationId": "NodesHotThreads", + "parameters": [ + { + "name": "interval", + "in": "query", + "description": "The interval for the second sampling of threads.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "The interval for the second sampling of threads.", + "x-data-type": "time" + } + }, + { + "name": "snapshots", + "in": "query", + "description": "Number of samples of thread stacktrace.", + "schema": { + "type": "integer", + "default": 10, + "description": "Number of samples of thread stacktrace.", + "format": "int32" + } + }, + { + "name": "threads", + "in": "query", + "description": "Specify the number of threads to provide information for.", + "schema": { + "type": "integer", + "default": 3, + "description": "Specify the number of threads to provide information for.", + "format": "int32" + } + }, + { + "name": "ignore_idle_threads", + "in": "query", + "description": "Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue.", + "schema": { + "type": "boolean", + "default": true, + "description": "Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue." + } + }, + { + "name": "type", + "in": "query", + "description": "The type to sample.", + "schema": { + "$ref": "#/components/schemas/SampleType" + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "NodesHotThreads 200 response" + } + }, + "x-operation-group": "nodes.hot_threads", + "x-version-added": "1.0" + } + }, + "/_nodes/hotthreads": { + "get": { + "description": "Returns information about hot threads on each node in the cluster.", + "operationId": "NodesHotThreads_Deprecated", + "deprecated": true, + "parameters": [ + { + "name": "interval", + "in": "query", + "description": "The interval for the second sampling of threads.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "The interval for the second sampling of threads.", + "x-data-type": "time" + } + }, + { + "name": "snapshots", + "in": "query", + "description": "Number of samples of thread stacktrace.", + "schema": { + "type": "integer", + "default": 10, + "description": "Number of samples of thread stacktrace.", + "format": "int32" + } + }, + { + "name": "threads", + "in": "query", + "description": "Specify the number of threads to provide information for.", + "schema": { + "type": "integer", + "default": 3, + "description": "Specify the number of threads to provide information for.", + "format": "int32" + } + }, + { + "name": "ignore_idle_threads", + "in": "query", + "description": "Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue.", + "schema": { + "type": "boolean", + "default": true, + "description": "Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue." + } + }, + { + "name": "type", + "in": "query", + "description": "The type to sample.", + "schema": { + "$ref": "#/components/schemas/SampleType" + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "NodesHotThreads_Deprecated 200 response" + } + }, + "x-deprecation-message": "The hot threads API accepts `hotthreads` but only `hot_threads` is documented", + "x-ignorable": true, + "x-operation-group": "nodes.hot_threads", + "x-version-added": "1.0", + "x-version-deprecated": "1.0" + } + }, + "/_nodes/reload_secure_settings": { + "post": { + "description": "Reloads secure settings.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/nodes-apis/nodes-reload-secure/" + }, + "operationId": "NodesReloadSecureSettings", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NodesReloadSecureSettings_BodyParams" + } + } + } + }, + "parameters": [ + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "NodesReloadSecureSettings 200 response" + } + }, + "x-operation-group": "nodes.reload_secure_settings", + "x-version-added": "1.0" + } + }, + "/_nodes/stats": { + "get": { + "description": "Returns statistical information about nodes in the cluster.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/nodes-apis/nodes-usage/" + }, + "operationId": "NodesStats", + "parameters": [ + { + "name": "completion_fields", + "in": "query", + "description": "Comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards).", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards)." + }, + "explode": true + }, + { + "name": "fielddata_fields", + "in": "query", + "description": "Comma-separated list of fields for `fielddata` index metric (supports wildcards).", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields for `fielddata` index metric (supports wildcards)." + }, + "explode": true + }, + { + "name": "fields", + "in": "query", + "description": "Comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards).", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards)." + }, + "explode": true + }, + { + "name": "groups", + "in": "query", + "description": "Comma-separated list of search groups for `search` index metric.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of search groups for `search` index metric." + }, + "explode": true + }, + { + "name": "level", + "in": "query", + "description": "Return indices stats aggregated at index, node or shard level.", + "schema": { + "$ref": "#/components/schemas/NodesStatLevel" + } + }, + { + "name": "types", + "in": "query", + "description": "Comma-separated list of document types for the `indexing` index metric.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of document types for the `indexing` index metric." + }, + "explode": true + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "include_segment_file_sizes", + "in": "query", + "description": "Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested).", + "schema": { + "type": "boolean", + "default": false, + "description": "Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested)." + } + } + ], + "responses": { + "200": { + "description": "NodesStats 200 response" + } + }, + "x-operation-group": "nodes.stats", + "x-version-added": "1.0" + } + }, + "/_nodes/stats/{metric}": { + "get": { + "description": "Returns statistical information about nodes in the cluster.", + "operationId": "NodesStats_WithMetric", + "parameters": [ + { + "name": "metric", + "in": "path", + "description": "Limit the information returned to the specified metrics.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Limit the information returned to the specified metrics.", + "x-enum-options": [ + "_all", + "breaker", + "fs", + "http", + "indices", + "jvm", + "os", + "process", + "thread_pool", + "transport", + "discovery", + "indexing_pressure" + ], + "x-data-type": "array" + }, + "required": true + }, + { + "name": "completion_fields", + "in": "query", + "description": "Comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards).", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards)." + }, + "explode": true + }, + { + "name": "fielddata_fields", + "in": "query", + "description": "Comma-separated list of fields for `fielddata` index metric (supports wildcards).", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields for `fielddata` index metric (supports wildcards)." + }, + "explode": true + }, + { + "name": "fields", + "in": "query", + "description": "Comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards).", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards)." + }, + "explode": true + }, + { + "name": "groups", + "in": "query", + "description": "Comma-separated list of search groups for `search` index metric.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of search groups for `search` index metric." + }, + "explode": true + }, + { + "name": "level", + "in": "query", + "description": "Return indices stats aggregated at index, node or shard level.", + "schema": { + "$ref": "#/components/schemas/NodesStatLevel" + } + }, + { + "name": "types", + "in": "query", + "description": "Comma-separated list of document types for the `indexing` index metric.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of document types for the `indexing` index metric." + }, + "explode": true + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "include_segment_file_sizes", + "in": "query", + "description": "Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested).", + "schema": { + "type": "boolean", + "default": false, + "description": "Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested)." + } + } + ], + "responses": { + "200": { + "description": "NodesStats_WithMetric 200 response" + } + }, + "x-operation-group": "nodes.stats", + "x-version-added": "1.0" + } + }, + "/_nodes/stats/{metric}/{index_metric}": { + "get": { + "description": "Returns statistical information about nodes in the cluster.", + "operationId": "NodesStats_WithIndexMetricMetric", + "parameters": [ + { + "name": "metric", + "in": "path", + "description": "Limit the information returned to the specified metrics.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Limit the information returned to the specified metrics.", + "x-enum-options": [ + "_all", + "breaker", + "fs", + "http", + "indices", + "jvm", + "os", + "process", + "thread_pool", + "transport", + "discovery", + "indexing_pressure" + ], + "x-data-type": "array" + }, + "required": true + }, + { + "name": "index_metric", + "in": "path", + "description": "Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified.", + "x-enum-options": [ + "_all", + "store", + "indexing", + "get", + "search", + "merge", + "flush", + "refresh", + "query_cache", + "fielddata", + "docs", + "warmer", + "completion", + "segments", + "translog", + "suggest", + "request_cache", + "recovery" + ], + "x-data-type": "array" + }, + "required": true + }, + { + "name": "completion_fields", + "in": "query", + "description": "Comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards).", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards)." + }, + "explode": true + }, + { + "name": "fielddata_fields", + "in": "query", + "description": "Comma-separated list of fields for `fielddata` index metric (supports wildcards).", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields for `fielddata` index metric (supports wildcards)." + }, + "explode": true + }, + { + "name": "fields", + "in": "query", + "description": "Comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards).", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards)." + }, + "explode": true + }, + { + "name": "groups", + "in": "query", + "description": "Comma-separated list of search groups for `search` index metric.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of search groups for `search` index metric." + }, + "explode": true + }, + { + "name": "level", + "in": "query", + "description": "Return indices stats aggregated at index, node or shard level.", + "schema": { + "$ref": "#/components/schemas/NodesStatLevel" + } + }, + { + "name": "types", + "in": "query", + "description": "Comma-separated list of document types for the `indexing` index metric.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of document types for the `indexing` index metric." + }, + "explode": true + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "include_segment_file_sizes", + "in": "query", + "description": "Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested).", + "schema": { + "type": "boolean", + "default": false, + "description": "Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested)." + } + } + ], + "responses": { + "200": { + "description": "NodesStats_WithIndexMetricMetric 200 response" + } + }, + "x-operation-group": "nodes.stats", + "x-version-added": "1.0" + } + }, + "/_nodes/usage": { + "get": { + "description": "Returns low-level information about REST actions usage on nodes.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest" + }, + "operationId": "NodesUsage", + "parameters": [ + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "NodesUsage 200 response" + } + }, + "x-operation-group": "nodes.usage", + "x-version-added": "1.0" + } + }, + "/_nodes/usage/{metric}": { + "get": { + "description": "Returns low-level information about REST actions usage on nodes.", + "operationId": "NodesUsage_WithMetric", + "parameters": [ + { + "name": "metric", + "in": "path", + "description": "Limit the information returned to the specified metrics.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Limit the information returned to the specified metrics.", + "x-enum-options": [ + "_all", + "rest_actions" + ], + "x-data-type": "array" + }, + "required": true + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "NodesUsage_WithMetric 200 response" + } + }, + "x-operation-group": "nodes.usage", + "x-version-added": "1.0" + } + }, + "/_nodes/{node_id}": { + "get": { + "description": "Returns information about nodes in the cluster.", + "operationId": "NodesInfo_WithNodeId", + "parameters": [ + { + "name": "node_id", + "in": "path", + "description": "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.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "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.", + "x-overloaded-param": "metric", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "flat_settings", + "in": "query", + "description": "Return settings in flat format.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return settings in flat format." + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "NodesInfo_WithNodeId 200 response" + } + }, + "x-operation-group": "nodes.info", + "x-version-added": "1.0" + } + }, + "/_nodes/{node_id}/hot_threads": { + "get": { + "description": "Returns information about hot threads on each node in the cluster.", + "operationId": "NodesHotThreads_WithNodeId", + "parameters": [ + { + "name": "node_id", + "in": "path", + "description": "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.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "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.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "interval", + "in": "query", + "description": "The interval for the second sampling of threads.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "The interval for the second sampling of threads.", + "x-data-type": "time" + } + }, + { + "name": "snapshots", + "in": "query", + "description": "Number of samples of thread stacktrace.", + "schema": { + "type": "integer", + "default": 10, + "description": "Number of samples of thread stacktrace.", + "format": "int32" + } + }, + { + "name": "threads", + "in": "query", + "description": "Specify the number of threads to provide information for.", + "schema": { + "type": "integer", + "default": 3, + "description": "Specify the number of threads to provide information for.", + "format": "int32" + } + }, + { + "name": "ignore_idle_threads", + "in": "query", + "description": "Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue.", + "schema": { + "type": "boolean", + "default": true, + "description": "Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue." + } + }, + { + "name": "type", + "in": "query", + "description": "The type to sample.", + "schema": { + "$ref": "#/components/schemas/SampleType" + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "NodesHotThreads_WithNodeId 200 response" + } + }, + "x-operation-group": "nodes.hot_threads", + "x-version-added": "1.0" + } + }, + "/_nodes/{node_id}/hotthreads": { + "get": { + "description": "Returns information about hot threads on each node in the cluster.", + "operationId": "NodesHotThreads_WithNodeId_Deprecated", + "deprecated": true, + "parameters": [ + { + "name": "node_id", + "in": "path", + "description": "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.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "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.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "interval", + "in": "query", + "description": "The interval for the second sampling of threads.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "The interval for the second sampling of threads.", + "x-data-type": "time" + } + }, + { + "name": "snapshots", + "in": "query", + "description": "Number of samples of thread stacktrace.", + "schema": { + "type": "integer", + "default": 10, + "description": "Number of samples of thread stacktrace.", + "format": "int32" + } + }, + { + "name": "threads", + "in": "query", + "description": "Specify the number of threads to provide information for.", + "schema": { + "type": "integer", + "default": 3, + "description": "Specify the number of threads to provide information for.", + "format": "int32" + } + }, + { + "name": "ignore_idle_threads", + "in": "query", + "description": "Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue.", + "schema": { + "type": "boolean", + "default": true, + "description": "Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue." + } + }, + { + "name": "type", + "in": "query", + "description": "The type to sample.", + "schema": { + "$ref": "#/components/schemas/SampleType" + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "NodesHotThreads_WithNodeId_Deprecated 200 response" + } + }, + "x-deprecation-message": "The hot threads API accepts `hotthreads` but only `hot_threads` is documented", + "x-ignorable": true, + "x-operation-group": "nodes.hot_threads", + "x-version-added": "1.0", + "x-version-deprecated": "1.0" + } + }, + "/_nodes/{node_id}/reload_secure_settings": { + "post": { + "description": "Reloads secure settings.", + "operationId": "NodesReloadSecureSettings_WithNodeId", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NodesReloadSecureSettings_BodyParams" + } + } + } + }, + "parameters": [ + { + "name": "node_id", + "in": "path", + "description": "Comma-separated list of node IDs to span the reload/reinit call. Should stay empty because reloading usually involves all cluster nodes.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of node IDs to span the reload/reinit call. Should stay empty because reloading usually involves all cluster nodes.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "NodesReloadSecureSettings_WithNodeId 200 response" + } + }, + "x-operation-group": "nodes.reload_secure_settings", + "x-version-added": "1.0" + } + }, + "/_nodes/{node_id}/stats": { + "get": { + "description": "Returns statistical information about nodes in the cluster.", + "operationId": "NodesStats_WithNodeId", + "parameters": [ + { + "name": "node_id", + "in": "path", + "description": "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.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "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.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "completion_fields", + "in": "query", + "description": "Comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards).", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards)." + }, + "explode": true + }, + { + "name": "fielddata_fields", + "in": "query", + "description": "Comma-separated list of fields for `fielddata` index metric (supports wildcards).", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields for `fielddata` index metric (supports wildcards)." + }, + "explode": true + }, + { + "name": "fields", + "in": "query", + "description": "Comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards).", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards)." + }, + "explode": true + }, + { + "name": "groups", + "in": "query", + "description": "Comma-separated list of search groups for `search` index metric.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of search groups for `search` index metric." + }, + "explode": true + }, + { + "name": "level", + "in": "query", + "description": "Return indices stats aggregated at index, node or shard level.", + "schema": { + "$ref": "#/components/schemas/NodesStatLevel" + } + }, + { + "name": "types", + "in": "query", + "description": "Comma-separated list of document types for the `indexing` index metric.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of document types for the `indexing` index metric." + }, + "explode": true + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "include_segment_file_sizes", + "in": "query", + "description": "Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested).", + "schema": { + "type": "boolean", + "default": false, + "description": "Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested)." + } + } + ], + "responses": { + "200": { + "description": "NodesStats_WithNodeId 200 response" + } + }, + "x-operation-group": "nodes.stats", + "x-version-added": "1.0" + } + }, + "/_nodes/{node_id}/stats/{metric}": { + "get": { + "description": "Returns statistical information about nodes in the cluster.", + "operationId": "NodesStats_WithMetricNodeId", + "parameters": [ + { + "name": "metric", + "in": "path", + "description": "Limit the information returned to the specified metrics.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Limit the information returned to the specified metrics.", + "x-enum-options": [ + "_all", + "breaker", + "fs", + "http", + "indices", + "jvm", + "os", + "process", + "thread_pool", + "transport", + "discovery", + "indexing_pressure" + ], + "x-data-type": "array" + }, + "required": true + }, + { + "name": "node_id", + "in": "path", + "description": "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.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "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.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "completion_fields", + "in": "query", + "description": "Comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards).", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards)." + }, + "explode": true + }, + { + "name": "fielddata_fields", + "in": "query", + "description": "Comma-separated list of fields for `fielddata` index metric (supports wildcards).", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields for `fielddata` index metric (supports wildcards)." + }, + "explode": true + }, + { + "name": "fields", + "in": "query", + "description": "Comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards).", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards)." + }, + "explode": true + }, + { + "name": "groups", + "in": "query", + "description": "Comma-separated list of search groups for `search` index metric.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of search groups for `search` index metric." + }, + "explode": true + }, + { + "name": "level", + "in": "query", + "description": "Return indices stats aggregated at index, node or shard level.", + "schema": { + "$ref": "#/components/schemas/NodesStatLevel" + } + }, + { + "name": "types", + "in": "query", + "description": "Comma-separated list of document types for the `indexing` index metric.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of document types for the `indexing` index metric." + }, + "explode": true + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "include_segment_file_sizes", + "in": "query", + "description": "Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested).", + "schema": { + "type": "boolean", + "default": false, + "description": "Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested)." + } + } + ], + "responses": { + "200": { + "description": "NodesStats_WithMetricNodeId 200 response" + } + }, + "x-operation-group": "nodes.stats", + "x-version-added": "1.0" + } + }, + "/_nodes/{node_id}/stats/{metric}/{index_metric}": { + "get": { + "description": "Returns statistical information about nodes in the cluster.", + "operationId": "NodesStats_WithIndexMetricMetricNodeId", + "parameters": [ + { + "name": "metric", + "in": "path", + "description": "Limit the information returned to the specified metrics.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Limit the information returned to the specified metrics.", + "x-enum-options": [ + "_all", + "breaker", + "fs", + "http", + "indices", + "jvm", + "os", + "process", + "thread_pool", + "transport", + "discovery", + "indexing_pressure" + ], + "x-data-type": "array" + }, + "required": true + }, + { + "name": "index_metric", + "in": "path", + "description": "Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified.", + "x-enum-options": [ + "_all", + "store", + "indexing", + "get", + "search", + "merge", + "flush", + "refresh", + "query_cache", + "fielddata", + "docs", + "warmer", + "completion", + "segments", + "translog", + "suggest", + "request_cache", + "recovery" + ], + "x-data-type": "array" + }, + "required": true + }, + { + "name": "node_id", + "in": "path", + "description": "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.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "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.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "completion_fields", + "in": "query", + "description": "Comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards).", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards)." + }, + "explode": true + }, + { + "name": "fielddata_fields", + "in": "query", + "description": "Comma-separated list of fields for `fielddata` index metric (supports wildcards).", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields for `fielddata` index metric (supports wildcards)." + }, + "explode": true + }, + { + "name": "fields", + "in": "query", + "description": "Comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards).", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards)." + }, + "explode": true + }, + { + "name": "groups", + "in": "query", + "description": "Comma-separated list of search groups for `search` index metric.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of search groups for `search` index metric." + }, + "explode": true + }, + { + "name": "level", + "in": "query", + "description": "Return indices stats aggregated at index, node or shard level.", + "schema": { + "$ref": "#/components/schemas/NodesStatLevel" + } + }, + { + "name": "types", + "in": "query", + "description": "Comma-separated list of document types for the `indexing` index metric.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of document types for the `indexing` index metric." + }, + "explode": true + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "include_segment_file_sizes", + "in": "query", + "description": "Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested).", + "schema": { + "type": "boolean", + "default": false, + "description": "Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested)." + } + } + ], + "responses": { + "200": { + "description": "NodesStats_WithIndexMetricMetricNodeId 200 response" + } + }, + "x-operation-group": "nodes.stats", + "x-version-added": "1.0" + } + }, + "/_nodes/{node_id}/usage": { + "get": { + "description": "Returns low-level information about REST actions usage on nodes.", + "operationId": "NodesUsage_WithNodeId", + "parameters": [ + { + "name": "node_id", + "in": "path", + "description": "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.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "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.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "NodesUsage_WithNodeId 200 response" + } + }, + "x-operation-group": "nodes.usage", + "x-version-added": "1.0" + } + }, + "/_nodes/{node_id}/usage/{metric}": { + "get": { + "description": "Returns low-level information about REST actions usage on nodes.", + "operationId": "NodesUsage_WithMetricNodeId", + "parameters": [ + { + "name": "metric", + "in": "path", + "description": "Limit the information returned to the specified metrics.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Limit the information returned to the specified metrics.", + "x-enum-options": [ + "_all", + "rest_actions" + ], + "x-data-type": "array" + }, + "required": true + }, + { + "name": "node_id", + "in": "path", + "description": "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.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "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.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "NodesUsage_WithMetricNodeId 200 response" + } + }, + "x-operation-group": "nodes.usage", + "x-version-added": "1.0" + } + }, + "/_nodes/{node_id}/{metric}": { + "get": { + "description": "Returns information about nodes in the cluster.", + "operationId": "NodesInfo_WithMetricNodeId", + "parameters": [ + { + "name": "node_id", + "in": "path", + "description": "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.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "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.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "metric", + "in": "path", + "description": "Comma-separated list of metrics you wish returned. Leave empty to return all.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of metrics you wish returned. Leave empty to return all.", + "x-enum-options": [ + "settings", + "os", + "process", + "jvm", + "thread_pool", + "transport", + "http", + "plugins", + "ingest" + ], + "x-data-type": "array" + }, + "required": true + }, + { + "name": "flat_settings", + "in": "query", + "description": "Return settings in flat format.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return settings in flat format." + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "NodesInfo_WithMetricNodeId 200 response" + } + }, + "x-operation-group": "nodes.info", + "x-version-added": "1.0" + } + }, + "/_plugins/_security/api/account": { + "get": { + "description": "Returns account details for the current user.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/security/access-control/api/#get-account-details" + }, + "operationId": "GetAccountDetails", + "responses": { + "200": { + "description": "GetAccountDetails 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AccountDetails" + } + } + } + } + }, + "x-operation-group": "security.get_account_details", + "x-version-added": "1.0" + }, + "put": { + "description": "Changes the password for the current user.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/security/access-control/api/#change-password" + }, + "operationId": "ChangePassword", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ChangePasswordRequestContent" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "ChangePassword 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ChangePasswordResponseContent" + } + } + } + } + }, + "x-operation-group": "security.change_password", + "x-version-added": "1.0" + } + }, + "/_plugins/_security/api/actiongroups": { + "patch": { + "description": "Creates, updates, or deletes multiple action groups in a single call.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/security/access-control/api/#patch-action-groups" + }, + "operationId": "PatchActionGroups", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PatchActionGroupsInputPayload" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "PatchActionGroups 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PatchActionGroupsResponseContent" + } + } + } + } + }, + "x-operation-group": "security.patch_action_groups", + "x-version-added": "1.0" + } + }, + "/_plugins/_security/api/actiongroups/": { + "get": { + "description": "Retrieves all action groups.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/security/access-control/api/#get-action-groups" + }, + "operationId": "GetActionGroups", + "responses": { + "200": { + "description": "GetActionGroups 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ActionGroupsMap" + } + } + } + } + }, + "x-operation-group": "security.get_action_groups", + "x-version-added": "1.0" + } + }, + "/_plugins/_security/api/actiongroups/{action_group}": { + "delete": { + "description": "Delete a specified action group.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/security/access-control/api/#delete-action-group" + }, + "operationId": "DeleteActionGroup", + "parameters": [ + { + "name": "action_group", + "in": "path", + "description": "Action group to delete.", + "schema": { + "type": "string", + "description": "Action group to delete." + }, + "required": true + } + ], + "responses": { + "200": { + "description": "DeleteActionGroup 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteActionGroupResponseContent" + } + } + } + } + }, + "x-operation-group": "security.delete_action_group", + "x-version-added": "1.0" + }, + "get": { + "description": "Retrieves one action group.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/security/access-control/api/#get-action-group" + }, + "operationId": "GetActionGroup", + "parameters": [ + { + "name": "action_group", + "in": "path", + "description": "Action group to retrieve.", + "schema": { + "type": "string", + "description": "Action group to retrieve." + }, + "required": true + } + ], + "responses": { + "200": { + "description": "GetActionGroup 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ActionGroupsMap" + } + } + } + } + }, + "x-operation-group": "security.get_action_group", + "x-version-added": "1.0" + }, + "patch": { + "description": "Updates individual attributes of an action group.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/security/access-control/api/#patch-action-group" + }, + "operationId": "PatchActionGroup", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PatchActionGroupInputPayload" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "action_group", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "PatchActionGroup 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PatchActionGroupResponseContent" + } + } + } + } + }, + "x-operation-group": "security.patch_action_group", + "x-version-added": "1.0" + }, + "put": { + "description": "Creates or replaces the specified action group.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/security/access-control/api/#create-action-group" + }, + "operationId": "CreateActionGroup", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Action_Group" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "action_group", + "in": "path", + "description": "The name of the action group to create or replace", + "schema": { + "type": "string", + "description": "The name of the action group to create or replace" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "CreateActionGroup 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateActionGroupResponseContent" + } + } + } + } + }, + "x-operation-group": "security.create_action_group", + "x-version-added": "1.0" + } + }, + "/_plugins/_security/api/audit": { + "get": { + "description": "Retrieves the audit configuration.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/security/access-control/api/#audit-logs" + }, + "operationId": "GetAuditConfiguration", + "responses": { + "200": { + "description": "GetAuditConfiguration 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuditConfigWithReadOnly" + } + } + } + } + }, + "x-operation-group": "security.get_audit_configuration", + "x-version-added": "1.0" + }, + "patch": { + "description": "A PATCH call is used to update specified fields in the audit configuration.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/security/access-control/api/#audit-logs" + }, + "operationId": "PatchAuditConfiguration", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PatchAuditConfigurationInputPayload" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "PatchAuditConfiguration 200 response" + } + }, + "x-operation-group": "security.patch_audit_configuration", + "x-version-added": "1.0" + } + }, + "/_plugins/_security/api/audit/config": { + "put": { + "description": "Updates the audit configuration.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/security/access-control/api/#audit-logs" + }, + "operationId": "UpdateAuditConfiguration", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuditConfig" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "UpdateAuditConfiguration 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateAuditConfigurationResponseContent" + } + } + } + } + }, + "x-operation-group": "security.update_audit_configuration", + "x-version-added": "1.0" + } + }, + "/_plugins/_security/api/cache": { + "delete": { + "description": "Flushes the Security plugin user, authentication, and authorization cache.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/2.7/security/access-control/api/#flush-cache" + }, + "operationId": "FlushCache", + "responses": { + "200": { + "description": "FlushCache 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FlushCacheResponseContent" + } + } + } + } + }, + "x-operation-group": "security.flush_cache", + "x-version-added": "1.0" + } + }, + "/_plugins/_security/api/internalusers": { + "get": { + "description": "Retrieve all internal users.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/security/access-control/api/#get-users" + }, + "operationId": "GetUsers", + "responses": { + "200": { + "description": "GetUsers 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UsersMap" + } + } + } + } + }, + "x-operation-group": "security.get_users", + "x-version-added": "1.0" + }, + "patch": { + "description": "Creates, updates, or deletes multiple internal users in a single call.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/security/access-control/api/#patch-users" + }, + "operationId": "PatchUsers", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PatchUsersInputPayload" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "PatchUsers 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PatchUsersResponseContent" + } + } + } + } + }, + "x-operation-group": "security.patch_users", + "x-version-added": "1.0" + } + }, + "/_plugins/_security/api/internalusers/{username}": { + "delete": { + "description": "Delete the specified user.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/security/access-control/api/#delete-user" + }, + "operationId": "DeleteUser", + "parameters": [ + { + "name": "username", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "DeleteUser 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteUserResponseContent" + } + } + } + } + }, + "x-operation-group": "security.delete_user", + "x-version-added": "1.0" + }, + "get": { + "description": "Retrieve one internal user.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/security/access-control/api/#get-user" + }, + "operationId": "GetUser", + "parameters": [ + { + "name": "username", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "GetUser 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UsersMap" + } + } + } + } + }, + "x-operation-group": "security.get_user", + "x-version-added": "1.0" + }, + "patch": { + "description": "Updates individual attributes of an internal user.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/security/access-control/api/#patch-user" + }, + "operationId": "PatchUser", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PatchUserInputPayload" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "username", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "PatchUser 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PatchUserResponseContent" + } + } + } + } + }, + "x-operation-group": "security.patch_user", + "x-version-added": "1.0" + }, + "put": { + "description": "Creates or replaces the specified user.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/security/access-control/api/#create-user" + }, + "operationId": "CreateUser", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "username", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "CreateUser 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateUserResponseContent" + } + } + } + } + }, + "x-operation-group": "security.create_user", + "x-version-added": "1.0" + } + }, + "/_plugins/_security/api/nodesdn": { + "get": { + "description": "Retrieves all distinguished names in the allow list.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/security/access-control/api/#get-distinguished-names" + }, + "operationId": "GetDistinguishedNames", + "responses": { + "200": { + "description": "GetDistinguishedNames 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DistinguishedNamesMap" + } + } + } + } + }, + "x-operation-group": "security.get_distinguished_names", + "x-version-added": "1.0" + }, + "patch": { + "description": "Bulk update of distinguished names.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/security/access-control/api/#update-all-distinguished-names" + }, + "operationId": "PatchDistinguishedNames", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PatchDistinguishedNamesInputPayload" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "PatchDistinguishedNames 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PatchDistinguishedNamesResponseContent" + } + } + } + } + }, + "x-operation-group": "security.patch_distinguished_names", + "x-version-added": "1.0" + } + }, + "/_plugins/_security/api/nodesdn/{cluster_name}": { + "delete": { + "description": "Deletes all distinguished names in the specified cluster’s or node’s allow list.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/security/access-control/api/#delete-distinguished-names" + }, + "operationId": "DeleteDistinguishedNames", + "parameters": [ + { + "name": "cluster_name", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "DeleteDistinguishedNames 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteDistinguishedNamesResponseContent" + } + } + } + } + }, + "x-operation-group": "security.delete_distinguished_names", + "x-version-added": "1.0" + }, + "get": { + "description": "Retrieve distinguished names of a specified cluster.", + "operationId": "GetDistinguishedNamesWithClusterName", + "parameters": [ + { + "name": "cluster_name", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "GetDistinguishedNamesWithClusterName 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DistinguishedNamesMap" + } + } + } + } + }, + "x-operation-group": "security.get_distinguished_names", + "x-version-added": "1.0" + }, + "put": { + "description": "Adds or updates the specified distinguished names in the cluster’s or node’s allow list.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/security/access-control/api/#update-distinguished-names" + }, + "operationId": "UpdateDistinguishedNames", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DistinguishedNames" + } + } + } + }, + "parameters": [ + { + "name": "cluster_name", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "UpdateDistinguishedNames 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateDistinguishedNamesResponseContent" + } + } + } + } + }, + "x-operation-group": "security.update_distinguished_names", + "x-version-added": "1.0" + } + }, + "/_plugins/_security/api/roles": { + "patch": { + "description": "Creates, updates, or deletes multiple roles in a single call.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/security/access-control/api/#patch-roles" + }, + "operationId": "PatchRoles", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PatchRolesInputPayload" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "PatchRoles 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PatchRolesResponseContent" + } + } + } + } + }, + "x-operation-group": "security.patch_roles", + "x-version-added": "1.0" + } + }, + "/_plugins/_security/api/roles/": { + "get": { + "description": "Retrieves all roles.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/security/access-control/api/#get-roles" + }, + "operationId": "GetRoles", + "responses": { + "200": { + "description": "GetRoles 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RolesMap" + } + } + } + } + }, + "x-operation-group": "security.get_roles", + "x-version-added": "1.0" + } + }, + "/_plugins/_security/api/roles/{role}": { + "delete": { + "description": "Delete the specified role.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/security/access-control/api/#delete-role" + }, + "operationId": "DeleteRole", + "parameters": [ + { + "name": "role", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "DeleteRole 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteRoleResponseContent" + } + } + } + } + }, + "x-operation-group": "security.delete_role", + "x-version-added": "1.0" + }, + "get": { + "description": "Retrieves one role.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/security/access-control/api/#get-role" + }, + "operationId": "GetRole", + "parameters": [ + { + "name": "role", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "GetRole 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RolesMap" + } + } + } + } + }, + "x-operation-group": "security.get_role", + "x-version-added": "1.0" + }, + "patch": { + "description": "Updates individual attributes of a role.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/security/access-control/api/#patch-role" + }, + "operationId": "PatchRole", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PatchRoleInputPayload" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "role", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "PatchRole 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PatchRoleResponseContent" + } + } + } + } + }, + "x-operation-group": "security.patch_role", + "x-version-added": "1.0" + }, + "put": { + "description": "Creates or replaces the specified role.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/security/access-control/api/#create-role" + }, + "operationId": "CreateRole", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Role" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "role", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "CreateRole 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateRoleResponseContent" + } + } + } + } + }, + "x-operation-group": "security.create_role", + "x-version-added": "1.0" + } + }, + "/_plugins/_security/api/rolesmapping": { + "get": { + "description": "Retrieves all role mappings.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/security/access-control/api/#get-role-mappings" + }, + "operationId": "GetRoleMappings", + "responses": { + "200": { + "description": "GetRoleMappings 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RoleMappings" + } + } + } + } + }, + "x-operation-group": "security.get_role_mappings", + "x-version-added": "1.0" + }, + "patch": { + "description": "Creates or updates multiple role mappings in a single call.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/security/access-control/api/#patch-role-mappings" + }, + "operationId": "PatchRoleMappings", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PatchRoleMappingsInputPayload" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "PatchRoleMappings 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PatchRoleMappingsResponseContent" + } + } + } + } + }, + "x-operation-group": "security.patch_role_mappings", + "x-version-added": "1.0" + } + }, + "/_plugins/_security/api/rolesmapping/{role}": { + "delete": { + "description": "Deletes the specified role mapping.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/security/access-control/api/#delete-role-mapping" + }, + "operationId": "DeleteRoleMapping", + "parameters": [ + { + "name": "role", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "DeleteRoleMapping 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteRoleMappingResponseContent" + } + } + } + } + }, + "x-operation-group": "security.delete_role_mapping", + "x-version-added": "1.0" + }, + "get": { + "description": "Retrieves one role mapping.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/security/access-control/api/#get-role-mapping" + }, + "operationId": "GetRoleMapping", + "parameters": [ + { + "name": "role", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "GetRoleMapping 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RoleMappings" + } + } + } + } + }, + "x-operation-group": "security.get_role_mapping", + "x-version-added": "1.0" + }, + "patch": { + "description": "Updates individual attributes of a role mapping.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/security/access-control/api/#patch-role-mapping" + }, + "operationId": "PatchRoleMapping", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PatchRoleMappingInputPayload" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "role", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "PatchRoleMapping 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PatchRoleMappingResponseContent" + } + } + } + } + }, + "x-operation-group": "security.patch_role_mapping", + "x-version-added": "1.0" + }, + "put": { + "description": "Creates or replaces the specified role mapping.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/security/access-control/api/#create-role-mapping" + }, + "operationId": "CreateRoleMapping", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RoleMapping" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "role", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "CreateRoleMapping 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateRoleMappingResponseContent" + } + } + } + } + }, + "x-operation-group": "security.create_role_mapping", + "x-version-added": "1.0" + } + }, + "/_plugins/_security/api/securityconfig": { + "get": { + "description": "Returns the current Security plugin configuration in JSON format.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/2.7/security/access-control/api/#get-configuration" + }, + "operationId": "GetConfiguration", + "responses": { + "200": { + "description": "GetConfiguration 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DynamicConfig" + } + } + } + } + }, + "x-operation-group": "security.get_configuration", + "x-version-added": "1.0" + }, + "patch": { + "description": "A PATCH call is used to update the existing configuration using the REST API.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/2.7/security/access-control/api/#patch-configuration" + }, + "operationId": "PatchConfiguration", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PatchConfigurationInputPayload" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "PatchConfiguration 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PatchConfigurationResponseContent" + } + } + } + } + }, + "x-operation-group": "security.patch_configuration", + "x-version-added": "1.0" + } + }, + "/_plugins/_security/api/securityconfig/config": { + "put": { + "description": "Adds or updates the existing configuration using the REST API.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/2.7/security/access-control/api/#update-configuration" + }, + "operationId": "UpdateConfiguration", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DynamicConfig" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "UpdateConfiguration 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateConfigurationResponseContent" + } + } + } + } + }, + "x-operation-group": "security.update_configuration", + "x-version-added": "1.0" + } + }, + "/_plugins/_security/api/ssl/certs": { + "get": { + "description": "Retrieves the cluster’s security certificates.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/security/access-control/api/#get-certificates" + }, + "operationId": "GetCertificates", + "responses": { + "200": { + "description": "GetCertificates 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetCertificatesResponseContent" + } + } + } + } + }, + "x-operation-group": "security.get_certificates", + "x-version-added": "1.0" + } + }, + "/_plugins/_security/api/ssl/http/reloadcerts": { + "put": { + "description": "Reload HTTP layer communication certificates.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/security/access-control/api/#reload-http-certificates" + }, + "operationId": "ReloadHttpCertificates", + "responses": { + "200": { + "description": "ReloadHttpCertificates 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReloadHttpCertificatesResponseContent" + } + } + } + } + }, + "x-operation-group": "security.reload_http_certificates", + "x-version-added": "1.0" + } + }, + "/_plugins/_security/api/ssl/transport/reloadcerts": { + "put": { + "description": "Reload transport layer communication certificates.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/security/access-control/api/#reload-transport-certificates" + }, + "operationId": "ReloadTransportCertificates", + "responses": { + "200": { + "description": "ReloadTransportCertificates 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReloadTransportCertificatesResponseContent" + } + } + } + } + }, + "x-operation-group": "security.reload_transport_certificates", + "x-version-added": "1.0" + } + }, + "/_plugins/_security/api/tenants/": { + "get": { + "description": "Retrieves all tenants.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/2.7/security/access-control/api/#get-tenants" + }, + "operationId": "GetTenants", + "responses": { + "200": { + "description": "GetTenants 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TenantsMap" + } + } + } + } + }, + "x-operation-group": "security.get_tenants", + "x-version-added": "1.0" + }, + "patch": { + "description": "Add, delete, or modify multiple tenants in a single call.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/2.7/security/access-control/api/#patch-tenants" + }, + "operationId": "PatchTenants", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PatchTenantsInputPayload" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "PatchTenants 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PatchTenantsResponseContent" + } + } + } + } + }, + "x-operation-group": "security.patch_tenants", + "x-version-added": "1.0" + } + }, + "/_plugins/_security/api/tenants/{tenant}": { + "delete": { + "description": "Delete the specified tenant.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/security/access-control/api/#delete-action-group" + }, + "operationId": "DeleteTenant", + "parameters": [ + { + "name": "tenant", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "DeleteTenant 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteTenantResponseContent" + } + } + } + } + }, + "x-operation-group": "security.delete_tenant", + "x-version-added": "1.0" + }, + "get": { + "description": "Retrieves one tenant.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/2.7/security/access-control/api/#get-tenant" + }, + "operationId": "GetTenant", + "parameters": [ + { + "name": "tenant", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "GetTenant 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TenantsMap" + } + } + } + } + }, + "x-operation-group": "security.get_tenant", + "x-version-added": "1.0" + }, + "patch": { + "description": "Add, delete, or modify a single tenant.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/2.7/security/access-control/api/#patch-tenant" + }, + "operationId": "PatchTenant", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PatchTenantInputPayload" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "tenant", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "PatchTenant 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PatchTenantResponseContent" + } + } + } + } + }, + "x-operation-group": "security.patch_tenant", + "x-version-added": "1.0" + }, + "put": { + "description": "Creates or replaces the specified tenant.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/2.7/security/access-control/api/#create-tenant" + }, + "operationId": "CreateTenant", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateTenantParams" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "tenant", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "CreateTenant 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateTenantResponseContent" + } + } + } + } + }, + "x-operation-group": "security.create_tenant", + "x-version-added": "1.0" + } + }, + "/_plugins/_security/health": { + "get": { + "description": "Checks to see if the Security plugin is up and running.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/security/access-control/api/#health-check" + }, + "operationId": "SecurityHealth", + "responses": { + "200": { + "description": "SecurityHealth 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SecurityHealthResponseContent" + } + } + } + } + }, + "x-operation-group": "security.health", + "x-version-added": "1.0" + } + }, + "/_rank_eval": { + "get": { + "description": "Allows to evaluate the quality of ranked search results over a set of typical search queries.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/rank-eval/" + }, + "operationId": "RankEval_Get", + "parameters": [ + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "search_type", + "in": "query", + "description": "Search operation type.", + "schema": { + "$ref": "#/components/schemas/SearchType" + } + } + ], + "responses": { + "200": { + "description": "RankEval_Get 200 response" + } + }, + "x-operation-group": "rank_eval", + "x-version-added": "1.0" + }, + "post": { + "description": "Allows to evaluate the quality of ranked search results over a set of typical search queries.", + "operationId": "RankEval_Post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RankEval_BodyParams" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "search_type", + "in": "query", + "description": "Search operation type.", + "schema": { + "$ref": "#/components/schemas/SearchType" + } + } + ], + "responses": { + "200": { + "description": "RankEval_Post 200 response" + } + }, + "x-operation-group": "rank_eval", + "x-version-added": "1.0" + } + }, + "/_recovery": { + "get": { + "description": "Returns information about ongoing index shard recoveries.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest" + }, + "operationId": "IndicesRecovery", + "parameters": [ + { + "name": "detailed", + "in": "query", + "description": "Whether to display detailed information about shard recovery.", + "schema": { + "type": "boolean", + "default": false, + "description": "Whether to display detailed information about shard recovery." + } + }, + { + "name": "active_only", + "in": "query", + "description": "Display only those recoveries that are currently on-going.", + "schema": { + "type": "boolean", + "default": false, + "description": "Display only those recoveries that are currently on-going." + } + } + ], + "responses": { + "200": { + "description": "IndicesRecovery 200 response" + } + }, + "x-operation-group": "indices.recovery", + "x-version-added": "1.0" + } + }, + "/_refresh": { + "get": { + "description": "Performs the refresh operation in one or more indices.", + "operationId": "IndicesRefresh_Get", + "parameters": [ + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + } + ], + "responses": { + "200": { + "description": "IndicesRefresh_Get 200 response" + } + }, + "x-operation-group": "indices.refresh", + "x-version-added": "1.0" + }, + "post": { + "description": "Performs the refresh operation in one or more indices.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/tuning-your-cluster/availability-and-recovery/remote-store/index/#refresh-level-and-request-level-durability" + }, + "operationId": "IndicesRefresh_Post", + "parameters": [ + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + } + ], + "responses": { + "200": { + "description": "IndicesRefresh_Post 200 response" + } + }, + "x-operation-group": "indices.refresh", + "x-version-added": "1.0" + } + }, + "/_reindex": { + "post": { + "description": "Allows to copy documents from one index to another, optionally filtering the source\ndocuments by a query, changing the destination index settings, or fetching the\ndocuments from a remote cluster.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/im-plugin/reindex-data/" + }, + "operationId": "Reindex", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Reindex_BodyParams" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "refresh", + "in": "query", + "description": "Should the affected indexes be refreshed?.", + "schema": { + "type": "boolean", + "description": "Should the affected indexes be refreshed?." + } + }, + { + "name": "timeout", + "in": "query", + "description": "Time each individual bulk request should wait for shards that are unavailable.", + "schema": { + "type": "string", + "default": "1m", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Time each individual bulk request should wait for shards that are unavailable.", + "x-data-type": "time" + } + }, + { + "name": "wait_for_active_shards", + "in": "query", + "description": "Sets the number of shard copies that must be active before proceeding with the 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).", + "schema": { + "type": "string", + "default": "1", + "description": "Sets the number of shard copies that must be active before proceeding with the 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)." + } + }, + { + "name": "wait_for_completion", + "in": "query", + "description": "Should this request wait until the operation has completed before returning.", + "schema": { + "type": "boolean", + "default": true, + "description": "Should this request wait until the operation has completed before returning." + } + }, + { + "name": "requests_per_second", + "in": "query", + "description": "The throttle for this request in sub-requests per second. -1 means no throttle.", + "schema": { + "type": "integer", + "default": 0, + "description": "The throttle for this request in sub-requests per second. -1 means no throttle.", + "format": "int32" + } + }, + { + "name": "scroll", + "in": "query", + "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", + "x-data-type": "time" + } + }, + { + "name": "slices", + "in": "query", + "description": "The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be set to `auto`.", + "schema": { + "type": "string", + "default": "1", + "description": "The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be set to `auto`." + } + }, + { + "name": "max_docs", + "in": "query", + "description": "Maximum number of documents to process (default: all documents).", + "schema": { + "type": "integer", + "description": "Maximum number of documents to process (default: all documents).", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Reindex 200 response" + } + }, + "x-operation-group": "reindex", + "x-version-added": "1.0" + } + }, + "/_reindex/{task_id}/_rethrottle": { + "post": { + "description": "Changes the number of requests per second for a particular Reindex operation.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest" + }, + "operationId": "ReindexRethrottle", + "parameters": [ + { + "name": "task_id", + "in": "path", + "description": "The task id to rethrottle.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The task id to rethrottle." + }, + "required": true + }, + { + "name": "requests_per_second", + "in": "query", + "description": "The throttle for this request in sub-requests per second. -1 means no throttle.", + "schema": { + "type": "integer", + "description": "The throttle for this request in sub-requests per second. -1 means no throttle.", + "format": "int32" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "ReindexRethrottle 200 response" + } + }, + "x-operation-group": "reindex_rethrottle", + "x-version-added": "1.0" + } + }, + "/_remote/info": { + "get": { + "description": "Returns the information about configured remote clusters.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/remote-info/" + }, + "operationId": "ClusterRemoteInfo", + "responses": { + "200": { + "description": "ClusterRemoteInfo 200 response" + } + }, + "x-operation-group": "cluster.remote_info", + "x-version-added": "1.0" + } + }, + "/_remotestore/_restore": { + "post": { + "description": "Restores from remote store.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/opensearch/remote/#restoring-from-a-backup" + }, + "operationId": "RemoteStoreRestore", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RemoteStoreRestore_BodyParams" + }, + "examples": { + "RemoteStoreRestore_example1": { + "summary": "Examples for Post Remote Storage Restore Operation.", + "description": "", + "value": { + "indices": [ + "books" + ] + } + } + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "wait_for_completion", + "in": "query", + "description": "Should this request wait until the operation has completed before returning.", + "schema": { + "type": "boolean", + "default": false, + "description": "Should this request wait until the operation has completed before returning." + } + } + ], + "responses": { + "200": { + "description": "RemoteStoreRestore 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RemoteStoreRestoreResponseContent" + }, + "examples": { + "RemoteStoreRestore_example1": { + "summary": "Examples for Post Remote Storage Restore Operation.", + "description": "", + "value": { + "remote_store": { + "indices": [ + "books" + ], + "shards": { + "total": 1, + "failed": 0, + "successful": 1 + } + } + } + } + } + } + } + } + }, + "x-operation-group": "remote_store.restore", + "x-version-added": "1.0" + } + }, + "/_render/template": { + "get": { + "description": "Allows to use the Mustache language to pre-render a search definition.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/search-plugins/search-template/" + }, + "operationId": "RenderSearchTemplate_Get", + "responses": { + "200": { + "description": "RenderSearchTemplate_Get 200 response" + } + }, + "x-operation-group": "render_search_template", + "x-version-added": "1.0" + }, + "post": { + "description": "Allows to use the Mustache language to pre-render a search definition.", + "operationId": "RenderSearchTemplate_Post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RenderSearchTemplate_BodyParams" + } + } + } + }, + "responses": { + "200": { + "description": "RenderSearchTemplate_Post 200 response" + } + }, + "x-operation-group": "render_search_template", + "x-version-added": "1.0" + } + }, + "/_render/template/{id}": { + "get": { + "description": "Allows to use the Mustache language to pre-render a search definition.", + "operationId": "RenderSearchTemplate_Get_WithId", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The id of the stored search template.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The id of the stored search template." + }, + "required": true + } + ], + "responses": { + "200": { + "description": "RenderSearchTemplate_Get_WithId 200 response" + } + }, + "x-operation-group": "render_search_template", + "x-version-added": "1.0" + }, + "post": { + "description": "Allows to use the Mustache language to pre-render a search definition.", + "operationId": "RenderSearchTemplate_Post_WithId", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RenderSearchTemplate_BodyParams" + } + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The id of the stored search template.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The id of the stored search template." + }, + "required": true + } + ], + "responses": { + "200": { + "description": "RenderSearchTemplate_Post_WithId 200 response" + } + }, + "x-operation-group": "render_search_template", + "x-version-added": "1.0" + } + }, + "/_resolve/index/{name}": { + "get": { + "description": "Returns information about any matching indices, aliases, and data streams.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest" + }, + "operationId": "IndicesResolveIndex", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Comma-separated list of names or wildcard expressions.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of names or wildcard expressions.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + } + ], + "responses": { + "200": { + "description": "IndicesResolveIndex 200 response" + } + }, + "x-operation-group": "indices.resolve_index", + "x-version-added": "1.0" + } + }, + "/_script_context": { + "get": { + "description": "Returns all script contexts.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/script-apis/get-script-contexts/" + }, + "operationId": "GetScriptContext", + "responses": { + "200": { + "description": "GetScriptContext 200 response" + } + }, + "x-operation-group": "get_script_context", + "x-version-added": "1.0" + } + }, + "/_script_language": { + "get": { + "description": "Returns available script types, languages and contexts.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/script-apis/get-script-language/" + }, + "operationId": "GetScriptLanguages", + "responses": { + "200": { + "description": "GetScriptLanguages 200 response" + } + }, + "x-operation-group": "get_script_languages", + "x-version-added": "1.0" + } + }, + "/_scripts/painless/_execute": { + "get": { + "description": "Allows an arbitrary script to be executed and a result to be returned.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/script-apis/exec-script/" + }, + "operationId": "ScriptsPainlessExecute_Get", + "responses": { + "200": { + "description": "ScriptsPainlessExecute_Get 200 response" + } + }, + "x-operation-group": "scripts_painless_execute", + "x-version-added": "1.0" + }, + "post": { + "description": "Allows an arbitrary script to be executed and a result to be returned.", + "operationId": "ScriptsPainlessExecute_Post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScriptsPainlessExecute_BodyParams" + } + } + } + }, + "responses": { + "200": { + "description": "ScriptsPainlessExecute_Post 200 response" + } + }, + "x-operation-group": "scripts_painless_execute", + "x-version-added": "1.0" + } + }, + "/_scripts/{id}": { + "delete": { + "description": "Deletes a script.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/script-apis/delete-script/" + }, + "operationId": "DeleteScript", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Script ID.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Script ID." + }, + "required": true + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "DeleteScript 200 response" + } + }, + "x-operation-group": "delete_script", + "x-version-added": "1.0" + }, + "get": { + "description": "Returns a script.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/script-apis/get-stored-script/" + }, + "operationId": "GetScript", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Script ID.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Script ID." + }, + "required": true + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "GetScript 200 response" + } + }, + "x-operation-group": "get_script", + "x-version-added": "1.0" + }, + "post": { + "description": "Creates or updates a script.", + "operationId": "PutScript_Post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PutScript_BodyParams" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Script ID.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Script ID." + }, + "required": true + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "PutScript_Post 200 response" + } + }, + "x-operation-group": "put_script", + "x-version-added": "1.0" + }, + "put": { + "description": "Creates or updates a script.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/script-apis/create-stored-script/" + }, + "operationId": "PutScript_Put", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PutScript_BodyParams" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Script ID.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Script ID." + }, + "required": true + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "PutScript_Put 200 response" + } + }, + "x-operation-group": "put_script", + "x-version-added": "1.0" + } + }, + "/_scripts/{id}/{context}": { + "post": { + "description": "Creates or updates a script.", + "operationId": "PutScript_Post_WithContext", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PutScript_BodyParams" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Script ID.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Script ID." + }, + "required": true + }, + { + "name": "context", + "in": "path", + "description": "Script context.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Script context." + }, + "required": true + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "PutScript_Post_WithContext 200 response" + } + }, + "x-operation-group": "put_script", + "x-version-added": "1.0" + }, + "put": { + "description": "Creates or updates a script.", + "operationId": "PutScript_Put_WithContext", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PutScript_BodyParams" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Script ID.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Script ID." + }, + "required": true + }, + { + "name": "context", + "in": "path", + "description": "Script context.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Script context." + }, + "required": true + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "PutScript_Put_WithContext 200 response" + } + }, + "x-operation-group": "put_script", + "x-version-added": "1.0" + } + }, + "/_search": { + "get": { + "description": "Returns results matching a query.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/search/" + }, + "operationId": "Search_Get", + "parameters": [ + { + "name": "analyzer", + "in": "query", + "description": "The analyzer to use for the query string.", + "schema": { + "type": "string", + "description": "The analyzer to use for the query string." + } + }, + { + "name": "analyze_wildcard", + "in": "query", + "description": "Specify whether wildcard and prefix queries should be analyzed.", + "schema": { + "type": "boolean", + "default": false, + "description": "Specify whether wildcard and prefix queries should be analyzed." + } + }, + { + "name": "ccs_minimize_roundtrips", + "in": "query", + "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution.", + "schema": { + "type": "boolean", + "default": true, + "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution." + } + }, + { + "name": "default_operator", + "in": "query", + "description": "The default operator for query string query (AND or OR).", + "schema": { + "$ref": "#/components/schemas/DefaultOperator" + } + }, + { + "name": "df", + "in": "query", + "description": "The field to use as default where no field prefix is given in the query string.", + "schema": { + "type": "string", + "description": "The field to use as default where no field prefix is given in the query string." + } + }, + { + "name": "explain", + "in": "query", + "description": "Specify whether to return detailed information about score computation as part of a hit.", + "schema": { + "type": "boolean", + "description": "Specify whether to return detailed information about score computation as part of a hit." + } + }, + { + "name": "stored_fields", + "in": "query", + "description": "Comma-separated list of stored fields to return.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of stored fields to return." + }, + "explode": true + }, + { + "name": "docvalue_fields", + "in": "query", + "description": "Comma-separated list of fields to return as the docvalue representation of a field for each hit.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields to return as the docvalue representation of a field for each hit." + }, + "explode": true + }, + { + "name": "from", + "in": "query", + "description": "Starting offset.", + "schema": { + "type": "integer", + "default": 0, + "description": "Starting offset.", + "format": "int32" + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "ignore_throttled", + "in": "query", + "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled.", + "schema": { + "type": "boolean", + "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "lenient", + "in": "query", + "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored.", + "schema": { + "type": "boolean", + "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored." + } + }, + { + "name": "preference", + "in": "query", + "description": "Specify the node or shard the operation should be performed on.", + "schema": { + "type": "string", + "default": "random", + "description": "Specify the node or shard the operation should be performed on." + } + }, + { + "name": "q", + "in": "query", + "description": "Query in the Lucene query string syntax.", + "schema": { + "type": "string", + "description": "Query in the Lucene query string syntax." + } + }, + { + "name": "routing", + "in": "query", + "description": "Comma-separated list of specific routing values.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of specific routing values." + }, + "explode": true + }, + { + "name": "scroll", + "in": "query", + "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", + "x-data-type": "time" + } + }, + { + "name": "search_type", + "in": "query", + "description": "Search operation type.", + "schema": { + "$ref": "#/components/schemas/SearchType" + } + }, + { + "name": "size", + "in": "query", + "description": "Number of hits to return.", + "schema": { + "type": "integer", + "default": 10, + "description": "Number of hits to return.", + "format": "int32" + } + }, + { + "name": "sort", + "in": "query", + "description": "Comma-separated list of : pairs.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of : pairs." + }, + "explode": true + }, + { + "name": "_source", + "in": "query", + "description": "True or false to return the _source field or not, or a list of fields to return.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "True or false to return the _source field or not, or a list of fields to return." + }, + "explode": true + }, + { + "name": "_source_excludes", + "in": "query", + "description": "List of fields to exclude from the returned _source field.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of fields to exclude from the returned _source field." + }, + "explode": true + }, + { + "name": "_source_includes", + "in": "query", + "description": "List of fields to extract and return from the _source field.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of fields to extract and return from the _source field." + }, + "explode": true + }, + { + "name": "terminate_after", + "in": "query", + "description": "The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.", + "schema": { + "type": "integer", + "description": "The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.", + "format": "int32" + } + }, + { + "name": "stats", + "in": "query", + "description": "Specific 'tag' of the request for logging and statistical purposes.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Specific 'tag' of the request for logging and statistical purposes." + }, + "explode": true + }, + { + "name": "suggest_field", + "in": "query", + "description": "Specify which field to use for suggestions.", + "schema": { + "type": "string", + "description": "Specify which field to use for suggestions." + } + }, + { + "name": "suggest_mode", + "in": "query", + "description": "Specify suggest mode.", + "schema": { + "$ref": "#/components/schemas/SuggestMode" + } + }, + { + "name": "suggest_size", + "in": "query", + "description": "How many suggestions to return in response.", + "schema": { + "type": "integer", + "description": "How many suggestions to return in response.", + "format": "int32" + } + }, + { + "name": "suggest_text", + "in": "query", + "description": "The source text for which the suggestions should be returned.", + "schema": { + "type": "string", + "description": "The source text for which the suggestions should be returned." + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "track_scores", + "in": "query", + "description": "Whether to calculate and return scores even if they are not used for sorting.", + "schema": { + "type": "boolean", + "description": "Whether to calculate and return scores even if they are not used for sorting." + } + }, + { + "name": "track_total_hits", + "in": "query", + "description": "Indicate if the number of documents that match the query should be tracked.", + "schema": { + "type": "boolean", + "description": "Indicate if the number of documents that match the query should be tracked." + } + }, + { + "name": "allow_partial_search_results", + "in": "query", + "description": "Indicate if an error should be returned if there is a partial search failure or timeout.", + "schema": { + "type": "boolean", + "default": true, + "description": "Indicate if an error should be returned if there is a partial search failure or timeout." + } + }, + { + "name": "typed_keys", + "in": "query", + "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response.", + "schema": { + "type": "boolean", + "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response." + } + }, + { + "name": "version", + "in": "query", + "description": "Whether to return document version as part of a hit.", + "schema": { + "type": "boolean", + "description": "Whether to return document version as part of a hit." + } + }, + { + "name": "seq_no_primary_term", + "in": "query", + "description": "Specify whether to return sequence number and primary term of the last modification of each hit.", + "schema": { + "type": "boolean", + "description": "Specify whether to return sequence number and primary term of the last modification of each hit." + } + }, + { + "name": "request_cache", + "in": "query", + "description": "Specify if request cache should be used for this request or not, defaults to index level setting.", + "schema": { + "type": "boolean", + "description": "Specify if request cache should be used for this request or not, defaults to index level setting." + } + }, + { + "name": "batched_reduce_size", + "in": "query", + "description": "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.", + "schema": { + "type": "integer", + "default": 512, + "description": "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.", + "format": "int32" + } + }, + { + "name": "max_concurrent_shard_requests", + "in": "query", + "description": "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.", + "schema": { + "type": "integer", + "default": 5, + "description": "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.", + "format": "int32" + } + }, + { + "name": "pre_filter_shard_size", + "in": "query", + "description": "Threshold that enforces a pre-filter round-trip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter round-trip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint.", + "schema": { + "type": "integer", + "description": "Threshold that enforces a pre-filter round-trip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter round-trip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint.", + "format": "int32" + } + }, + { + "name": "rest_total_hits_as_int", + "in": "query", + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response.", + "schema": { + "type": "boolean", + "default": false, + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response." + } + } + ], + "responses": { + "200": { + "description": "Search_Get 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Search_GetResponseContent" + } + } + } + } + }, + "x-operation-group": "search", + "x-version-added": "1.0" + }, + "post": { + "description": "Returns results matching a query.", + "operationId": "Search_Post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Search_BodyParams" + }, + "examples": { + "Search_Post_example1": { + "summary": "Examples for Post Search Operation.", + "description": "", + "value": { + "query": { + "match_all": {} + }, + "fields": [ + "*" + ] + } + } + } + } + } + }, + "parameters": [ + { + "name": "analyzer", + "in": "query", + "description": "The analyzer to use for the query string.", + "schema": { + "type": "string", + "description": "The analyzer to use for the query string." + } + }, + { + "name": "analyze_wildcard", + "in": "query", + "description": "Specify whether wildcard and prefix queries should be analyzed.", + "schema": { + "type": "boolean", + "default": false, + "description": "Specify whether wildcard and prefix queries should be analyzed." + } + }, + { + "name": "ccs_minimize_roundtrips", + "in": "query", + "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution.", + "schema": { + "type": "boolean", + "default": true, + "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution." + } + }, + { + "name": "default_operator", + "in": "query", + "description": "The default operator for query string query (AND or OR).", + "schema": { + "$ref": "#/components/schemas/DefaultOperator" + } + }, + { + "name": "df", + "in": "query", + "description": "The field to use as default where no field prefix is given in the query string.", + "schema": { + "type": "string", + "description": "The field to use as default where no field prefix is given in the query string." + } + }, + { + "name": "explain", + "in": "query", + "description": "Specify whether to return detailed information about score computation as part of a hit.", + "schema": { + "type": "boolean", + "description": "Specify whether to return detailed information about score computation as part of a hit." + } + }, + { + "name": "stored_fields", + "in": "query", + "description": "Comma-separated list of stored fields to return.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of stored fields to return." + }, + "explode": true + }, + { + "name": "docvalue_fields", + "in": "query", + "description": "Comma-separated list of fields to return as the docvalue representation of a field for each hit.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields to return as the docvalue representation of a field for each hit." + }, + "explode": true + }, + { + "name": "from", + "in": "query", + "description": "Starting offset.", + "schema": { + "type": "integer", + "default": 0, + "description": "Starting offset.", + "format": "int32" + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "ignore_throttled", + "in": "query", + "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled.", + "schema": { + "type": "boolean", + "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "lenient", + "in": "query", + "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored.", + "schema": { + "type": "boolean", + "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored." + } + }, + { + "name": "preference", + "in": "query", + "description": "Specify the node or shard the operation should be performed on.", + "schema": { + "type": "string", + "default": "random", + "description": "Specify the node or shard the operation should be performed on." + } + }, + { + "name": "q", + "in": "query", + "description": "Query in the Lucene query string syntax.", + "schema": { + "type": "string", + "description": "Query in the Lucene query string syntax." + } + }, + { + "name": "routing", + "in": "query", + "description": "Comma-separated list of specific routing values.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of specific routing values." + }, + "explode": true + }, + { + "name": "scroll", + "in": "query", + "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", + "x-data-type": "time" + }, + "examples": { + "Search_Post_example1": { + "summary": "Examples for Post Search Operation.", + "description": "", + "value": "1d" + } + } + }, + { + "name": "search_type", + "in": "query", + "description": "Search operation type.", + "schema": { + "$ref": "#/components/schemas/SearchType" + } + }, + { + "name": "size", + "in": "query", + "description": "Number of hits to return.", + "schema": { + "type": "integer", + "default": 10, + "description": "Number of hits to return.", + "format": "int32" + } + }, + { + "name": "sort", + "in": "query", + "description": "Comma-separated list of : pairs.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of : pairs." + }, + "explode": true + }, + { + "name": "_source", + "in": "query", + "description": "True or false to return the _source field or not, or a list of fields to return.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "True or false to return the _source field or not, or a list of fields to return." + }, + "explode": true + }, + { + "name": "_source_excludes", + "in": "query", + "description": "List of fields to exclude from the returned _source field.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of fields to exclude from the returned _source field." + }, + "explode": true + }, + { + "name": "_source_includes", + "in": "query", + "description": "List of fields to extract and return from the _source field.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of fields to extract and return from the _source field." + }, + "explode": true + }, + { + "name": "terminate_after", + "in": "query", + "description": "The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.", + "schema": { + "type": "integer", + "description": "The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.", + "format": "int32" + } + }, + { + "name": "stats", + "in": "query", + "description": "Specific 'tag' of the request for logging and statistical purposes.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Specific 'tag' of the request for logging and statistical purposes." + }, + "explode": true + }, + { + "name": "suggest_field", + "in": "query", + "description": "Specify which field to use for suggestions.", + "schema": { + "type": "string", + "description": "Specify which field to use for suggestions." + } + }, + { + "name": "suggest_mode", + "in": "query", + "description": "Specify suggest mode.", + "schema": { + "$ref": "#/components/schemas/SuggestMode" + } + }, + { + "name": "suggest_size", + "in": "query", + "description": "How many suggestions to return in response.", + "schema": { + "type": "integer", + "description": "How many suggestions to return in response.", + "format": "int32" + } + }, + { + "name": "suggest_text", + "in": "query", + "description": "The source text for which the suggestions should be returned.", + "schema": { + "type": "string", + "description": "The source text for which the suggestions should be returned." + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "track_scores", + "in": "query", + "description": "Whether to calculate and return scores even if they are not used for sorting.", + "schema": { + "type": "boolean", + "description": "Whether to calculate and return scores even if they are not used for sorting." + } + }, + { + "name": "track_total_hits", + "in": "query", + "description": "Indicate if the number of documents that match the query should be tracked.", + "schema": { + "type": "boolean", + "description": "Indicate if the number of documents that match the query should be tracked." + } + }, + { + "name": "allow_partial_search_results", + "in": "query", + "description": "Indicate if an error should be returned if there is a partial search failure or timeout.", + "schema": { + "type": "boolean", + "default": true, + "description": "Indicate if an error should be returned if there is a partial search failure or timeout." + } + }, + { + "name": "typed_keys", + "in": "query", + "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response.", + "schema": { + "type": "boolean", + "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response." + } + }, + { + "name": "version", + "in": "query", + "description": "Whether to return document version as part of a hit.", + "schema": { + "type": "boolean", + "description": "Whether to return document version as part of a hit." + } + }, + { + "name": "seq_no_primary_term", + "in": "query", + "description": "Specify whether to return sequence number and primary term of the last modification of each hit.", + "schema": { + "type": "boolean", + "description": "Specify whether to return sequence number and primary term of the last modification of each hit." + } + }, + { + "name": "request_cache", + "in": "query", + "description": "Specify if request cache should be used for this request or not, defaults to index level setting.", + "schema": { + "type": "boolean", + "description": "Specify if request cache should be used for this request or not, defaults to index level setting." + } + }, + { + "name": "batched_reduce_size", + "in": "query", + "description": "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.", + "schema": { + "type": "integer", + "default": 512, + "description": "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.", + "format": "int32" + } + }, + { + "name": "max_concurrent_shard_requests", + "in": "query", + "description": "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.", + "schema": { + "type": "integer", + "default": 5, + "description": "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.", + "format": "int32" + } + }, + { + "name": "pre_filter_shard_size", + "in": "query", + "description": "Threshold that enforces a pre-filter round-trip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter round-trip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint.", + "schema": { + "type": "integer", + "description": "Threshold that enforces a pre-filter round-trip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter round-trip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint.", + "format": "int32" + } + }, + { + "name": "rest_total_hits_as_int", + "in": "query", + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response.", + "schema": { + "type": "boolean", + "default": false, + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response." + } + } + ], + "responses": { + "200": { + "description": "Search_Post 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Search_PostResponseContent" + }, + "examples": { + "Search_Post_example1": { + "summary": "Examples for Post Search Operation.", + "description": "", + "value": { + "timed_out": false, + "_shards": { + "total": 1, + "successful": 1, + "skipped": 0, + "failed": 0 + }, + "hits": { + "total": { + "value": 0, + "relation": "eq" + }, + "hits": [] + } + } + } + } + } + } + } + }, + "x-operation-group": "search", + "x-version-added": "1.0" + } + }, + "/_search/point_in_time": { + "delete": { + "description": "Deletes one or more point in time searches based on the IDs passed.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/search-plugins/point-in-time-api/#delete-pits" + }, + "operationId": "DeletePit", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeletePit_BodyParams" + } + } + } + }, + "responses": { + "200": { + "description": "DeletePit 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeletePitResponseContent" + } + } + } + } + }, + "x-operation-group": "delete_pit", + "x-version-added": "2.4" + } + }, + "/_search/point_in_time/_all": { + "delete": { + "description": "Deletes all active point in time searches.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/search-plugins/point-in-time-api/#delete-pits" + }, + "operationId": "DeleteAllPits", + "responses": { + "200": { + "description": "DeleteAllPits 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteAllPitsResponseContent" + } + } + } + } + }, + "x-operation-group": "delete_all_pits", + "x-version-added": "2.4" + }, + "get": { + "description": "Lists all active point in time searches.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/search-plugins/point-in-time-api/#list-all-pits" + }, + "operationId": "GetAllPits", + "responses": { + "200": { + "description": "GetAllPits 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetAllPitsResponseContent" + } + } + } + } + }, + "x-operation-group": "get_all_pits", + "x-version-added": "2.4" + } + }, + "/_search/scroll": { + "delete": { + "description": "Explicitly clears the search context for a scroll.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/scroll/" + }, + "operationId": "ClearScroll", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClearScroll_BodyParams" + } + } + } + }, + "responses": { + "200": { + "description": "ClearScroll 200 response" + } + }, + "x-operation-group": "clear_scroll", + "x-version-added": "1.0" + }, + "get": { + "description": "Allows to retrieve a large numbers of results from a single search request.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/scroll/#path-and-http-methods" + }, + "operationId": "Scroll_Get", + "parameters": [ + { + "name": "scroll", + "in": "query", + "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", + "x-data-type": "time" + } + }, + { + "name": "scroll_id", + "in": "query", + "description": "Scroll ID.", + "schema": { + "type": "string", + "description": "Scroll ID." + } + }, + { + "name": "rest_total_hits_as_int", + "in": "query", + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response.", + "schema": { + "type": "boolean", + "default": false, + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response." + } + } + ], + "responses": { + "200": { + "description": "Scroll_Get 200 response" + } + }, + "x-operation-group": "scroll", + "x-version-added": "1.0" + }, + "post": { + "description": "Allows to retrieve a large numbers of results from a single search request.", + "operationId": "Scroll_Post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Scroll_BodyParams" + } + } + } + }, + "parameters": [ + { + "name": "scroll", + "in": "query", + "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", + "x-data-type": "time" + } + }, + { + "name": "scroll_id", + "in": "query", + "description": "Scroll ID.", + "schema": { + "type": "string", + "description": "Scroll ID." + } + }, + { + "name": "rest_total_hits_as_int", + "in": "query", + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response.", + "schema": { + "type": "boolean", + "default": false, + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response." + } + } + ], + "responses": { + "200": { + "description": "Scroll_Post 200 response" + } + }, + "x-operation-group": "scroll", + "x-version-added": "1.0" + } + }, + "/_search/scroll/{scroll_id}": { + "delete": { + "description": "Explicitly clears the search context for a scroll.", + "operationId": "ClearScroll_WithScrollId", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClearScroll_BodyParams" + } + } + } + }, + "deprecated": true, + "parameters": [ + { + "name": "scroll_id", + "in": "path", + "description": "Comma-separated list of scroll IDs to clear.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of scroll IDs to clear.", + "deprecated": true, + "x-data-type": "array" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "ClearScroll_WithScrollId 200 response" + } + }, + "x-deprecation-message": "A scroll id can be quite large and should be specified as part of the body", + "x-operation-group": "clear_scroll", + "x-version-added": "1.0", + "x-version-deprecated": "1.0" + }, + "get": { + "description": "Allows to retrieve a large numbers of results from a single search request.", + "operationId": "Scroll_Get_WithScrollId", + "deprecated": true, + "parameters": [ + { + "name": "scroll_id", + "in": "path", + "description": "Scroll ID.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Scroll ID." + }, + "required": true + }, + { + "name": "scroll", + "in": "query", + "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", + "x-data-type": "time" + } + }, + { + "name": "scroll_id", + "in": "query", + "description": "Scroll ID.", + "schema": { + "type": "string", + "description": "Scroll ID." + } + }, + { + "name": "rest_total_hits_as_int", + "in": "query", + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response.", + "schema": { + "type": "boolean", + "default": false, + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response." + } + } + ], + "responses": { + "200": { + "description": "Scroll_Get_WithScrollId 200 response" + } + }, + "x-deprecation-message": "A scroll id can be quite large and should be specified as part of the body", + "x-operation-group": "scroll", + "x-version-added": "1.0", + "x-version-deprecated": "1.0" + }, + "post": { + "description": "Allows to retrieve a large numbers of results from a single search request.", + "operationId": "Scroll_Post_WithScrollId", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Scroll_BodyParams" + } + } + } + }, + "deprecated": true, + "parameters": [ + { + "name": "scroll_id", + "in": "path", + "description": "Scroll ID.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Scroll ID." + }, + "required": true + }, + { + "name": "scroll", + "in": "query", + "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", + "x-data-type": "time" + } + }, + { + "name": "scroll_id", + "in": "query", + "description": "Scroll ID.", + "schema": { + "type": "string", + "description": "Scroll ID." + } + }, + { + "name": "rest_total_hits_as_int", + "in": "query", + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response.", + "schema": { + "type": "boolean", + "default": false, + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response." + } + } + ], + "responses": { + "200": { + "description": "Scroll_Post_WithScrollId 200 response" + } + }, + "x-deprecation-message": "A scroll id can be quite large and should be specified as part of the body", + "x-operation-group": "scroll", + "x-version-added": "1.0", + "x-version-deprecated": "1.0" + } + }, + "/_search/template": { + "get": { + "description": "Allows to use the Mustache language to pre-render a search definition.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/search-plugins/search-template/" + }, + "operationId": "SearchTemplate_Get", + "parameters": [ + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "ignore_throttled", + "in": "query", + "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled.", + "schema": { + "type": "boolean", + "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "preference", + "in": "query", + "description": "Specify the node or shard the operation should be performed on.", + "schema": { + "type": "string", + "default": "random", + "description": "Specify the node or shard the operation should be performed on." + } + }, + { + "name": "routing", + "in": "query", + "description": "Comma-separated list of specific routing values.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of specific routing values." + }, + "explode": true + }, + { + "name": "scroll", + "in": "query", + "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", + "x-data-type": "time" + } + }, + { + "name": "search_type", + "in": "query", + "description": "Search operation type.", + "schema": { + "$ref": "#/components/schemas/SearchTypeMulti" + } + }, + { + "name": "explain", + "in": "query", + "description": "Specify whether to return detailed information about score computation as part of a hit.", + "schema": { + "type": "boolean", + "description": "Specify whether to return detailed information about score computation as part of a hit." + } + }, + { + "name": "profile", + "in": "query", + "description": "Specify whether to profile the query execution.", + "schema": { + "type": "boolean", + "description": "Specify whether to profile the query execution." + } + }, + { + "name": "typed_keys", + "in": "query", + "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response.", + "schema": { + "type": "boolean", + "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response." + } + }, + { + "name": "rest_total_hits_as_int", + "in": "query", + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response.", + "schema": { + "type": "boolean", + "default": false, + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response." + } + }, + { + "name": "ccs_minimize_roundtrips", + "in": "query", + "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution.", + "schema": { + "type": "boolean", + "default": true, + "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution." + } + } + ], + "responses": { + "200": { + "description": "SearchTemplate_Get 200 response" + } + }, + "x-operation-group": "search_template", + "x-version-added": "1.0" + }, + "post": { + "description": "Allows to use the Mustache language to pre-render a search definition.", + "operationId": "SearchTemplate_Post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchTemplate_BodyParams" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "ignore_throttled", + "in": "query", + "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled.", + "schema": { + "type": "boolean", + "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "preference", + "in": "query", + "description": "Specify the node or shard the operation should be performed on.", + "schema": { + "type": "string", + "default": "random", + "description": "Specify the node or shard the operation should be performed on." + } + }, + { + "name": "routing", + "in": "query", + "description": "Comma-separated list of specific routing values.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of specific routing values." + }, + "explode": true + }, + { + "name": "scroll", + "in": "query", + "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", + "x-data-type": "time" + } + }, + { + "name": "search_type", + "in": "query", + "description": "Search operation type.", + "schema": { + "$ref": "#/components/schemas/SearchTypeMulti" + } + }, + { + "name": "explain", + "in": "query", + "description": "Specify whether to return detailed information about score computation as part of a hit.", + "schema": { + "type": "boolean", + "description": "Specify whether to return detailed information about score computation as part of a hit." + } + }, + { + "name": "profile", + "in": "query", + "description": "Specify whether to profile the query execution.", + "schema": { + "type": "boolean", + "description": "Specify whether to profile the query execution." + } + }, + { + "name": "typed_keys", + "in": "query", + "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response.", + "schema": { + "type": "boolean", + "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response." + } + }, + { + "name": "rest_total_hits_as_int", + "in": "query", + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response.", + "schema": { + "type": "boolean", + "default": false, + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response." + } + }, + { + "name": "ccs_minimize_roundtrips", + "in": "query", + "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution.", + "schema": { + "type": "boolean", + "default": true, + "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution." + } + } + ], + "responses": { + "200": { + "description": "SearchTemplate_Post 200 response" + } + }, + "x-operation-group": "search_template", + "x-version-added": "1.0" + } + }, + "/_search_shards": { + "get": { + "description": "Returns information about the indices and shards that a search request would be executed against.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest" + }, + "operationId": "SearchShards_Get", + "parameters": [ + { + "name": "preference", + "in": "query", + "description": "Specify the node or shard the operation should be performed on.", + "schema": { + "type": "string", + "default": "random", + "description": "Specify the node or shard the operation should be performed on." + } + }, + { + "name": "routing", + "in": "query", + "description": "Routing value.", + "schema": { + "type": "string", + "description": "Routing value." + } + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + } + ], + "responses": { + "200": { + "description": "SearchShards_Get 200 response" + } + }, + "x-operation-group": "search_shards", + "x-version-added": "1.0" + }, + "post": { + "description": "Returns information about the indices and shards that a search request would be executed against.", + "operationId": "SearchShards_Post", + "parameters": [ + { + "name": "preference", + "in": "query", + "description": "Specify the node or shard the operation should be performed on.", + "schema": { + "type": "string", + "default": "random", + "description": "Specify the node or shard the operation should be performed on." + } + }, + { + "name": "routing", + "in": "query", + "description": "Routing value.", + "schema": { + "type": "string", + "description": "Routing value." + } + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + } + ], + "responses": { + "200": { + "description": "SearchShards_Post 200 response" + } + }, + "x-operation-group": "search_shards", + "x-version-added": "1.0" + } + }, + "/_segments": { + "get": { + "description": "Provides low-level information about segments in a Lucene index.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest" + }, + "operationId": "IndicesSegments", + "parameters": [ + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "verbose", + "in": "query", + "description": "Includes detailed memory usage by Lucene.", + "schema": { + "type": "boolean", + "default": false, + "description": "Includes detailed memory usage by Lucene." + } + } + ], + "responses": { + "200": { + "description": "IndicesSegments 200 response" + } + }, + "x-operation-group": "indices.segments", + "x-version-added": "1.0" + } + }, + "/_settings": { + "get": { + "description": "Returns settings for one or more indices.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/index-apis/get-settings/" + }, + "operationId": "IndicesGetSettings", + "parameters": [ + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "flat_settings", + "in": "query", + "description": "Return settings in flat format.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return settings in flat format." + } + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + }, + { + "name": "include_defaults", + "in": "query", + "description": "Whether to return all default setting for each of the indices.", + "schema": { + "type": "boolean", + "default": false, + "description": "Whether to return all default setting for each of the indices." + } + } + ], + "responses": { + "200": { + "description": "IndicesGetSettings 200 response" + } + }, + "x-operation-group": "indices.get_settings", + "x-version-added": "1.0" + }, + "put": { + "description": "Updates the index settings.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/index-apis/update-settings/" + }, + "operationId": "IndicesPutSettings", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndicesPutSettings_BodyParams" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "preserve_existing", + "in": "query", + "description": "Whether to update existing settings. If set to `true` existing settings on an index remain unchanged.", + "schema": { + "type": "boolean", + "default": false, + "description": "Whether to update existing settings. If set to `true` existing settings on an index remain unchanged." + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "flat_settings", + "in": "query", + "description": "Return settings in flat format.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return settings in flat format." + } + } + ], + "responses": { + "200": { + "description": "IndicesPutSettings 200 response" + } + }, + "x-operation-group": "indices.put_settings", + "x-version-added": "1.0" + } + }, + "/_settings/{name}": { + "get": { + "description": "Returns settings for one or more indices.", + "operationId": "IndicesGetSettings_WithName", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Comma-separated list of settings.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of settings.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "flat_settings", + "in": "query", + "description": "Return settings in flat format.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return settings in flat format." + } + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + }, + { + "name": "include_defaults", + "in": "query", + "description": "Whether to return all default setting for each of the indices.", + "schema": { + "type": "boolean", + "default": false, + "description": "Whether to return all default setting for each of the indices." + } + } + ], + "responses": { + "200": { + "description": "IndicesGetSettings_WithName 200 response" + } + }, + "x-operation-group": "indices.get_settings", + "x-version-added": "1.0" + } + }, + "/_shard_stores": { + "get": { + "description": "Provides store information for shard copies of indices.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest" + }, + "operationId": "IndicesShardStores", + "parameters": [ + { + "name": "status", + "in": "query", + "description": "Comma-separated list of statuses used to filter on shards to get store information for.", + "style": "form", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Status_Member" + }, + "description": "Comma-separated list of statuses used to filter on shards to get store information for." + }, + "explode": true + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + } + ], + "responses": { + "200": { + "description": "IndicesShardStores 200 response" + } + }, + "x-operation-group": "indices.shard_stores", + "x-version-added": "1.0" + } + }, + "/_snapshot": { + "get": { + "description": "Returns information about a repository.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/snapshots/get-snapshot-repository/" + }, + "operationId": "SnapshotGetRepository", + "parameters": [ + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + } + ], + "responses": { + "200": { + "description": "SnapshotGetRepository 200 response" + } + }, + "x-operation-group": "snapshot.get_repository", + "x-version-added": "1.0" + } + }, + "/_snapshot/_status": { + "get": { + "description": "Returns information about the status of a snapshot.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/snapshots/get-snapshot-status/" + }, + "operationId": "SnapshotStatus", + "parameters": [ + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown.", + "schema": { + "type": "boolean", + "default": false, + "description": "Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown." + } + } + ], + "responses": { + "200": { + "description": "SnapshotStatus 200 response" + } + }, + "x-operation-group": "snapshot.status", + "x-version-added": "1.0" + } + }, + "/_snapshot/{repository}": { + "delete": { + "description": "Deletes a repository.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/snapshots/delete-snapshot-repository/" + }, + "operationId": "SnapshotDeleteRepository", + "parameters": [ + { + "name": "repository", + "in": "path", + "description": "Name of the snapshot repository to unregister. Wildcard (`*`) patterns are supported.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Name of the snapshot repository to unregister. Wildcard (`*`) patterns are supported.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "SnapshotDeleteRepository 200 response" + } + }, + "x-operation-group": "snapshot.delete_repository", + "x-version-added": "1.0" + }, + "get": { + "description": "Returns information about a repository.", + "operationId": "SnapshotGetRepository_WithRepository", + "parameters": [ + { + "name": "repository", + "in": "path", + "description": "Comma-separated list of repository names.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of repository names.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + } + ], + "responses": { + "200": { + "description": "SnapshotGetRepository_WithRepository 200 response" + } + }, + "x-operation-group": "snapshot.get_repository", + "x-version-added": "1.0" + }, + "post": { + "description": "Creates a repository.", + "operationId": "SnapshotCreateRepository_Post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SnapshotCreateRepository_BodyParams" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "repository", + "in": "path", + "description": "Repository name.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Repository name." + }, + "required": true + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "verify", + "in": "query", + "description": "Whether to verify the repository after creation.", + "schema": { + "type": "boolean", + "description": "Whether to verify the repository after creation." + } + } + ], + "responses": { + "200": { + "description": "SnapshotCreateRepository_Post 200 response" + } + }, + "x-operation-group": "snapshot.create_repository", + "x-version-added": "1.0" + }, + "put": { + "description": "Creates a repository.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/snapshots/create-repository/" + }, + "operationId": "SnapshotCreateRepository_Put", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SnapshotCreateRepository_BodyParams" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "repository", + "in": "path", + "description": "Repository name.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Repository name." + }, + "required": true + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "verify", + "in": "query", + "description": "Whether to verify the repository after creation.", + "schema": { + "type": "boolean", + "description": "Whether to verify the repository after creation." + } + } + ], + "responses": { + "200": { + "description": "SnapshotCreateRepository_Put 200 response" + } + }, + "x-operation-group": "snapshot.create_repository", + "x-version-added": "1.0" + } + }, + "/_snapshot/{repository}/_cleanup": { + "post": { + "description": "Removes stale data from repository.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest" + }, + "operationId": "SnapshotCleanupRepository", + "parameters": [ + { + "name": "repository", + "in": "path", + "description": "Repository name.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Repository name." + }, + "required": true + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "SnapshotCleanupRepository 200 response" + } + }, + "x-operation-group": "snapshot.cleanup_repository", + "x-version-added": "1.0" + } + }, + "/_snapshot/{repository}/_status": { + "get": { + "description": "Returns information about the status of a snapshot.", + "operationId": "SnapshotStatus_WithRepository", + "parameters": [ + { + "name": "repository", + "in": "path", + "description": "Repository name.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Repository name." + }, + "required": true + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown.", + "schema": { + "type": "boolean", + "default": false, + "description": "Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown." + } + } + ], + "responses": { + "200": { + "description": "SnapshotStatus_WithRepository 200 response" + } + }, + "x-operation-group": "snapshot.status", + "x-version-added": "1.0" + } + }, + "/_snapshot/{repository}/_verify": { + "post": { + "description": "Verifies a repository.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/snapshots/verify-snapshot-repository/" + }, + "operationId": "SnapshotVerifyRepository", + "parameters": [ + { + "name": "repository", + "in": "path", + "description": "Repository name.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Repository name." + }, + "required": true + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "SnapshotVerifyRepository 200 response" + } + }, + "x-operation-group": "snapshot.verify_repository", + "x-version-added": "1.0" + } + }, + "/_snapshot/{repository}/{snapshot}": { + "delete": { + "description": "Deletes a snapshot.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/snapshots/delete-snapshot/" + }, + "operationId": "SnapshotDelete", + "parameters": [ + { + "name": "repository", + "in": "path", + "description": "Repository name.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Repository name." + }, + "required": true + }, + { + "name": "snapshot", + "in": "path", + "description": "Snapshot name.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Snapshot name." + }, + "required": true + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "SnapshotDelete 200 response" + } + }, + "x-operation-group": "snapshot.delete", + "x-version-added": "1.0" + }, + "get": { + "description": "Returns information about a snapshot.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest" + }, + "operationId": "SnapshotGet", + "parameters": [ + { + "name": "repository", + "in": "path", + "description": "Repository name.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Repository name." + }, + "required": true + }, + { + "name": "snapshot", + "in": "path", + "description": "Comma-separated list of snapshot names.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of snapshot names.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown.", + "schema": { + "type": "boolean", + "default": false, + "description": "Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown." + } + }, + { + "name": "verbose", + "in": "query", + "description": "Whether to show verbose snapshot info or only show the basic info found in the repository index blob.", + "schema": { + "type": "boolean", + "description": "Whether to show verbose snapshot info or only show the basic info found in the repository index blob." + } + } + ], + "responses": { + "200": { + "description": "SnapshotGet 200 response" + } + }, + "x-operation-group": "snapshot.get", + "x-version-added": "1.0" + }, + "post": { + "description": "Creates a snapshot in a repository.", + "operationId": "SnapshotCreate_Post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SnapshotCreate_BodyParams" + } + } + } + }, + "parameters": [ + { + "name": "repository", + "in": "path", + "description": "Repository name.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Repository name." + }, + "required": true + }, + { + "name": "snapshot", + "in": "path", + "description": "Snapshot name.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Snapshot name." + }, + "required": true + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "wait_for_completion", + "in": "query", + "description": "Should this request wait until the operation has completed before returning.", + "schema": { + "type": "boolean", + "default": false, + "description": "Should this request wait until the operation has completed before returning." + } + } + ], + "responses": { + "200": { + "description": "SnapshotCreate_Post 200 response" + } + }, + "x-operation-group": "snapshot.create", + "x-version-added": "1.0" + }, + "put": { + "description": "Creates a snapshot in a repository.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/snapshots/create-snapshot/" + }, + "operationId": "SnapshotCreate_Put", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SnapshotCreate_BodyParams" + } + } + } + }, + "parameters": [ + { + "name": "repository", + "in": "path", + "description": "Repository name.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Repository name." + }, + "required": true + }, + { + "name": "snapshot", + "in": "path", + "description": "Snapshot name.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Snapshot name." + }, + "required": true + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "wait_for_completion", + "in": "query", + "description": "Should this request wait until the operation has completed before returning.", + "schema": { + "type": "boolean", + "default": false, + "description": "Should this request wait until the operation has completed before returning." + } + } + ], + "responses": { + "200": { + "description": "SnapshotCreate_Put 200 response" + } + }, + "x-operation-group": "snapshot.create", + "x-version-added": "1.0" + } + }, + "/_snapshot/{repository}/{snapshot}/_clone/{target_snapshot}": { + "put": { + "description": "Clones indices from one snapshot into another snapshot in the same repository.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest" + }, + "operationId": "SnapshotClone", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SnapshotClone_BodyParams" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "repository", + "in": "path", + "description": "Repository name.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Repository name." + }, + "required": true + }, + { + "name": "snapshot", + "in": "path", + "description": "Snapshot name.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Snapshot name." + }, + "required": true + }, + { + "name": "target_snapshot", + "in": "path", + "description": "The name of the cloned snapshot to create.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the cloned snapshot to create." + }, + "required": true + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "SnapshotClone 200 response" + } + }, + "x-operation-group": "snapshot.clone", + "x-version-added": "1.0" + } + }, + "/_snapshot/{repository}/{snapshot}/_restore": { + "post": { + "description": "Restores a snapshot.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/snapshots/restore-snapshot/" + }, + "operationId": "SnapshotRestore", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SnapshotRestore_BodyParams" + } + } + } + }, + "parameters": [ + { + "name": "repository", + "in": "path", + "description": "Repository name.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Repository name." + }, + "required": true + }, + { + "name": "snapshot", + "in": "path", + "description": "Snapshot name.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Snapshot name." + }, + "required": true + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "wait_for_completion", + "in": "query", + "description": "Should this request wait until the operation has completed before returning.", + "schema": { + "type": "boolean", + "default": false, + "description": "Should this request wait until the operation has completed before returning." + } + } + ], + "responses": { + "200": { + "description": "SnapshotRestore 200 response" + } + }, + "x-operation-group": "snapshot.restore", + "x-version-added": "1.0" + } + }, + "/_snapshot/{repository}/{snapshot}/_status": { + "get": { + "description": "Returns information about the status of a snapshot.", + "operationId": "SnapshotStatus_WithRepositorySnapshot", + "parameters": [ + { + "name": "repository", + "in": "path", + "description": "Repository name.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Repository name." + }, + "required": true + }, + { + "name": "snapshot", + "in": "path", + "description": "Comma-separated list of snapshot names.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of snapshot names.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown.", + "schema": { + "type": "boolean", + "default": false, + "description": "Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown." + } + } + ], + "responses": { + "200": { + "description": "SnapshotStatus_WithRepositorySnapshot 200 response" + } + }, + "x-operation-group": "snapshot.status", + "x-version-added": "1.0" + } + }, + "/_stats": { + "get": { + "description": "Provides statistics on operations happening in an index.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest" + }, + "operationId": "IndicesStats", + "parameters": [ + { + "name": "completion_fields", + "in": "query", + "description": "Comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards).", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards)." + }, + "explode": true + }, + { + "name": "fielddata_fields", + "in": "query", + "description": "Comma-separated list of fields for `fielddata` index metric (supports wildcards).", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields for `fielddata` index metric (supports wildcards)." + }, + "explode": true + }, + { + "name": "fields", + "in": "query", + "description": "Comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards).", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards)." + }, + "explode": true + }, + { + "name": "groups", + "in": "query", + "description": "Comma-separated list of search groups for `search` index metric.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of search groups for `search` index metric." + }, + "explode": true + }, + { + "name": "level", + "in": "query", + "description": "Return stats aggregated at cluster, index or shard level.", + "schema": { + "$ref": "#/components/schemas/IndiciesStatLevel" + } + }, + { + "name": "include_segment_file_sizes", + "in": "query", + "description": "Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested).", + "schema": { + "type": "boolean", + "default": false, + "description": "Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested)." + } + }, + { + "name": "include_unloaded_segments", + "in": "query", + "description": "If set to true segment stats will include stats for segments that are not currently loaded into memory.", + "schema": { + "type": "boolean", + "default": false, + "description": "If set to true segment stats will include stats for segments that are not currently loaded into memory." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "forbid_closed_indices", + "in": "query", + "description": "If set to false stats will also collected from closed indices if explicitly specified or if expand_wildcards expands to closed indices.", + "schema": { + "type": "boolean", + "default": true, + "description": "If set to false stats will also collected from closed indices if explicitly specified or if expand_wildcards expands to closed indices." + } + } + ], + "responses": { + "200": { + "description": "IndicesStats 200 response" + } + }, + "x-operation-group": "indices.stats", + "x-version-added": "1.0" + } + }, + "/_stats/{metric}": { + "get": { + "description": "Provides statistics on operations happening in an index.", + "operationId": "IndicesStats_WithMetric", + "parameters": [ + { + "name": "metric", + "in": "path", + "description": "Limit the information returned the specific metrics.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Limit the information returned the specific metrics.", + "x-enum-options": [ + "_all", + "store", + "indexing", + "get", + "search", + "merge", + "flush", + "refresh", + "query_cache", + "fielddata", + "docs", + "warmer", + "completion", + "segments", + "translog", + "suggest", + "request_cache", + "recovery" + ], + "x-data-type": "array" + }, + "required": true + }, + { + "name": "completion_fields", + "in": "query", + "description": "Comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards).", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards)." + }, + "explode": true + }, + { + "name": "fielddata_fields", + "in": "query", + "description": "Comma-separated list of fields for `fielddata` index metric (supports wildcards).", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields for `fielddata` index metric (supports wildcards)." + }, + "explode": true + }, + { + "name": "fields", + "in": "query", + "description": "Comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards).", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards)." + }, + "explode": true + }, + { + "name": "groups", + "in": "query", + "description": "Comma-separated list of search groups for `search` index metric.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of search groups for `search` index metric." + }, + "explode": true + }, + { + "name": "level", + "in": "query", + "description": "Return stats aggregated at cluster, index or shard level.", + "schema": { + "$ref": "#/components/schemas/IndiciesStatLevel" + } + }, + { + "name": "include_segment_file_sizes", + "in": "query", + "description": "Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested).", + "schema": { + "type": "boolean", + "default": false, + "description": "Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested)." + } + }, + { + "name": "include_unloaded_segments", + "in": "query", + "description": "If set to true segment stats will include stats for segments that are not currently loaded into memory.", + "schema": { + "type": "boolean", + "default": false, + "description": "If set to true segment stats will include stats for segments that are not currently loaded into memory." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "forbid_closed_indices", + "in": "query", + "description": "If set to false stats will also collected from closed indices if explicitly specified or if expand_wildcards expands to closed indices.", + "schema": { + "type": "boolean", + "default": true, + "description": "If set to false stats will also collected from closed indices if explicitly specified or if expand_wildcards expands to closed indices." + } + } + ], + "responses": { + "200": { + "description": "IndicesStats_WithMetric 200 response" + } + }, + "x-operation-group": "indices.stats", + "x-version-added": "1.0" + } + }, + "/_tasks": { + "get": { + "description": "Returns a list of tasks.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/tasks/" + }, + "operationId": "TasksList", + "parameters": [ + { + "name": "nodes", + "in": "query", + "description": "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.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "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." + }, + "explode": true + }, + { + "name": "actions", + "in": "query", + "description": "Comma-separated list of actions that should be returned. Leave empty to return all.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of actions that should be returned. Leave empty to return all." + }, + "explode": true + }, + { + "name": "detailed", + "in": "query", + "description": "Return detailed task information.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return detailed task information." + } + }, + { + "name": "parent_task_id", + "in": "query", + "description": "Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all.", + "schema": { + "type": "string", + "description": "Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all." + } + }, + { + "name": "wait_for_completion", + "in": "query", + "description": "Should this request wait until the operation has completed before returning.", + "schema": { + "type": "boolean", + "default": false, + "description": "Should this request wait until the operation has completed before returning." + } + }, + { + "name": "group_by", + "in": "query", + "description": "Group tasks by nodes or parent/child relationships.", + "schema": { + "$ref": "#/components/schemas/GroupBy" + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "TasksList 200 response" + } + }, + "x-operation-group": "tasks.list", + "x-version-added": "1.0" + } + }, + "/_tasks/_cancel": { + "post": { + "description": "Cancels a task, if it can be cancelled through an API.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/tasks/#task-canceling" + }, + "operationId": "TasksCancel", + "parameters": [ + { + "name": "nodes", + "in": "query", + "description": "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.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "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." + }, + "explode": true + }, + { + "name": "actions", + "in": "query", + "description": "Comma-separated list of actions that should be cancelled. Leave empty to cancel all.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of actions that should be cancelled. Leave empty to cancel all." + }, + "explode": true + }, + { + "name": "parent_task_id", + "in": "query", + "description": "Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all.", + "schema": { + "type": "string", + "description": "Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all." + } + }, + { + "name": "wait_for_completion", + "in": "query", + "description": "Should this request wait until the operation has completed before returning.", + "schema": { + "type": "boolean", + "default": false, + "description": "Should this request wait until the operation has completed before returning." + } + } + ], + "responses": { + "200": { + "description": "TasksCancel 200 response" + } + }, + "x-operation-group": "tasks.cancel", + "x-version-added": "1.0" + } + }, + "/_tasks/{task_id}": { + "get": { + "description": "Returns information about a task.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/tasks/" + }, + "operationId": "TasksGet", + "parameters": [ + { + "name": "task_id", + "in": "path", + "description": "Return the task with specified id (node_id:task_number).", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Return the task with specified id (node_id:task_number)." + }, + "required": true + }, + { + "name": "wait_for_completion", + "in": "query", + "description": "Should this request wait until the operation has completed before returning.", + "schema": { + "type": "boolean", + "default": false, + "description": "Should this request wait until the operation has completed before returning." + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "TasksGet 200 response" + } + }, + "x-operation-group": "tasks.get", + "x-version-added": "1.0" + } + }, + "/_tasks/{task_id}/_cancel": { + "post": { + "description": "Cancels a task, if it can be cancelled through an API.", + "operationId": "TasksCancel_WithTaskId", + "parameters": [ + { + "name": "task_id", + "in": "path", + "description": "Cancel the task with specified task id (node_id:task_number).", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Cancel the task with specified task id (node_id:task_number)." + }, + "required": true + }, + { + "name": "nodes", + "in": "query", + "description": "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.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "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." + }, + "explode": true + }, + { + "name": "actions", + "in": "query", + "description": "Comma-separated list of actions that should be cancelled. Leave empty to cancel all.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of actions that should be cancelled. Leave empty to cancel all." + }, + "explode": true + }, + { + "name": "parent_task_id", + "in": "query", + "description": "Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all.", + "schema": { + "type": "string", + "description": "Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all." + } + }, + { + "name": "wait_for_completion", + "in": "query", + "description": "Should this request wait until the operation has completed before returning.", + "schema": { + "type": "boolean", + "default": false, + "description": "Should this request wait until the operation has completed before returning." + } + } + ], + "responses": { + "200": { + "description": "TasksCancel_WithTaskId 200 response" + } + }, + "x-operation-group": "tasks.cancel", + "x-version-added": "1.0" + } + }, + "/_template": { + "get": { + "description": "Returns an index template.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest" + }, + "operationId": "IndicesGetTemplate", + "parameters": [ + { + "name": "flat_settings", + "in": "query", + "description": "Return settings in flat format.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return settings in flat format." + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + } + ], + "responses": { + "200": { + "description": "IndicesGetTemplate 200 response" + } + }, + "x-operation-group": "indices.get_template", + "x-version-added": "1.0" + } + }, + "/_template/{name}": { + "delete": { + "description": "Deletes an index template.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest" + }, + "operationId": "IndicesDeleteTemplate", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the template.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the template." + }, + "required": true + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "IndicesDeleteTemplate 200 response" + } + }, + "x-operation-group": "indices.delete_template", + "x-version-added": "1.0" + }, + "get": { + "description": "Returns an index template.", + "operationId": "IndicesGetTemplate_WithName", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Comma-separated names of the index templates.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated names of the index templates.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "flat_settings", + "in": "query", + "description": "Return settings in flat format.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return settings in flat format." + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + } + ], + "responses": { + "200": { + "description": "IndicesGetTemplate_WithName 200 response" + } + }, + "x-operation-group": "indices.get_template", + "x-version-added": "1.0" + }, + "head": { + "description": "Returns information about whether a particular index template exists.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest" + }, + "operationId": "IndicesExistsTemplate", + "parameters": [ + { + "name": "name", + "in": "path", + "description": "Comma-separated names of the index templates.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated names of the index templates.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "flat_settings", + "in": "query", + "description": "Return settings in flat format.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return settings in flat format." + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + } + ], + "responses": { + "200": { + "description": "IndicesExistsTemplate 200 response" + } + }, + "x-operation-group": "indices.exists_template", + "x-version-added": "1.0" + }, + "post": { + "description": "Creates or updates an index template.", + "operationId": "IndicesPutTemplate_Post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndicesPutTemplate_BodyParams" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the template.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the template." + }, + "required": true + }, + { + "name": "order", + "in": "query", + "description": "The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers).", + "schema": { + "type": "integer", + "description": "The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers).", + "format": "int32" + } + }, + { + "name": "create", + "in": "query", + "description": "Whether the index template should only be added if new or can also replace an existing one.", + "schema": { + "type": "boolean", + "default": false, + "description": "Whether the index template should only be added if new or can also replace an existing one." + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "IndicesPutTemplate_Post 200 response" + } + }, + "x-operation-group": "indices.put_template", + "x-version-added": "1.0" + }, + "put": { + "description": "Creates or updates an index template.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/im-plugin/index-templates/" + }, + "operationId": "IndicesPutTemplate_Put", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndicesPutTemplate_BodyParams" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "name", + "in": "path", + "description": "The name of the template.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the template." + }, + "required": true + }, + { + "name": "order", + "in": "query", + "description": "The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers).", + "schema": { + "type": "integer", + "description": "The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers).", + "format": "int32" + } + }, + { + "name": "create", + "in": "query", + "description": "Whether the index template should only be added if new or can also replace an existing one.", + "schema": { + "type": "boolean", + "default": false, + "description": "Whether the index template should only be added if new or can also replace an existing one." + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "IndicesPutTemplate_Put 200 response" + } + }, + "x-operation-group": "indices.put_template", + "x-version-added": "1.0" + } + }, + "/_update_by_query/{task_id}/_rethrottle": { + "post": { + "description": "Changes the number of requests per second for a particular Update By Query operation.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest" + }, + "operationId": "UpdateByQueryRethrottle", + "parameters": [ + { + "name": "task_id", + "in": "path", + "description": "The task id to rethrottle.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The task id to rethrottle." + }, + "required": true + }, + { + "name": "requests_per_second", + "in": "query", + "description": "The throttle for this request in sub-requests per second. -1 means no throttle.", + "schema": { + "type": "integer", + "description": "The throttle for this request in sub-requests per second. -1 means no throttle.", + "format": "int32" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "UpdateByQueryRethrottle 200 response" + } + }, + "x-operation-group": "update_by_query_rethrottle", + "x-version-added": "1.0" + } + }, + "/_upgrade": { + "get": { + "description": "The _upgrade API is no longer useful and will be removed.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest" + }, + "operationId": "IndicesGetUpgrade", + "parameters": [ + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + } + ], + "responses": { + "200": { + "description": "IndicesGetUpgrade 200 response" + } + }, + "x-operation-group": "indices.get_upgrade", + "x-version-added": "1.0" + }, + "post": { + "description": "The _upgrade API is no longer useful and will be removed.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest" + }, + "operationId": "IndicesUpgrade", + "parameters": [ + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "wait_for_completion", + "in": "query", + "description": "Should this request wait until the operation has completed before returning.", + "schema": { + "type": "boolean", + "default": false, + "description": "Should this request wait until the operation has completed before returning." + } + }, + { + "name": "only_ancient_segments", + "in": "query", + "description": "If true, only ancient (an older Lucene major release) segments will be upgraded.", + "schema": { + "type": "boolean", + "description": "If true, only ancient (an older Lucene major release) segments will be upgraded." + } + } + ], + "responses": { + "200": { + "description": "IndicesUpgrade 200 response" + } + }, + "x-operation-group": "indices.upgrade", + "x-version-added": "1.0" + } + }, + "/_validate/query": { + "get": { + "description": "Allows a user to validate a potentially expensive query without executing it.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest" + }, + "operationId": "IndicesValidateQuery_Get", + "parameters": [ + { + "name": "explain", + "in": "query", + "description": "Return detailed information about the error.", + "schema": { + "type": "boolean", + "description": "Return detailed information about the error." + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "q", + "in": "query", + "description": "Query in the Lucene query string syntax.", + "schema": { + "type": "string", + "description": "Query in the Lucene query string syntax." + } + }, + { + "name": "analyzer", + "in": "query", + "description": "The analyzer to use for the query string.", + "schema": { + "type": "string", + "description": "The analyzer to use for the query string." + } + }, + { + "name": "analyze_wildcard", + "in": "query", + "description": "Specify whether wildcard and prefix queries should be analyzed.", + "schema": { + "type": "boolean", + "default": false, + "description": "Specify whether wildcard and prefix queries should be analyzed." + } + }, + { + "name": "default_operator", + "in": "query", + "description": "The default operator for query string query (AND or OR).", + "schema": { + "$ref": "#/components/schemas/DefaultOperator" + } + }, + { + "name": "df", + "in": "query", + "description": "The field to use as default where no field prefix is given in the query string.", + "schema": { + "type": "string", + "description": "The field to use as default where no field prefix is given in the query string." + } + }, + { + "name": "lenient", + "in": "query", + "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored.", + "schema": { + "type": "boolean", + "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored." + } + }, + { + "name": "rewrite", + "in": "query", + "description": "Provide a more detailed explanation showing the actual Lucene query that will be executed.", + "schema": { + "type": "boolean", + "description": "Provide a more detailed explanation showing the actual Lucene query that will be executed." + } + }, + { + "name": "all_shards", + "in": "query", + "description": "Execute validation on all shards instead of one random shard per index.", + "schema": { + "type": "boolean", + "description": "Execute validation on all shards instead of one random shard per index." + } + } + ], + "responses": { + "200": { + "description": "IndicesValidateQuery_Get 200 response" + } + }, + "x-operation-group": "indices.validate_query", + "x-version-added": "1.0" + }, + "post": { + "description": "Allows a user to validate a potentially expensive query without executing it.", + "operationId": "IndicesValidateQuery_Post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndicesValidateQuery_BodyParams" + } + } + } + }, + "parameters": [ + { + "name": "explain", + "in": "query", + "description": "Return detailed information about the error.", + "schema": { + "type": "boolean", + "description": "Return detailed information about the error." + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "q", + "in": "query", + "description": "Query in the Lucene query string syntax.", + "schema": { + "type": "string", + "description": "Query in the Lucene query string syntax." + } + }, + { + "name": "analyzer", + "in": "query", + "description": "The analyzer to use for the query string.", + "schema": { + "type": "string", + "description": "The analyzer to use for the query string." + } + }, + { + "name": "analyze_wildcard", + "in": "query", + "description": "Specify whether wildcard and prefix queries should be analyzed.", + "schema": { + "type": "boolean", + "default": false, + "description": "Specify whether wildcard and prefix queries should be analyzed." + } + }, + { + "name": "default_operator", + "in": "query", + "description": "The default operator for query string query (AND or OR).", + "schema": { + "$ref": "#/components/schemas/DefaultOperator" + } + }, + { + "name": "df", + "in": "query", + "description": "The field to use as default where no field prefix is given in the query string.", + "schema": { + "type": "string", + "description": "The field to use as default where no field prefix is given in the query string." + } + }, + { + "name": "lenient", + "in": "query", + "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored.", + "schema": { + "type": "boolean", + "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored." + } + }, + { + "name": "rewrite", + "in": "query", + "description": "Provide a more detailed explanation showing the actual Lucene query that will be executed.", + "schema": { + "type": "boolean", + "description": "Provide a more detailed explanation showing the actual Lucene query that will be executed." + } + }, + { + "name": "all_shards", + "in": "query", + "description": "Execute validation on all shards instead of one random shard per index.", + "schema": { + "type": "boolean", + "description": "Execute validation on all shards instead of one random shard per index." + } + } + ], + "responses": { + "200": { + "description": "IndicesValidateQuery_Post 200 response" + } + }, + "x-operation-group": "indices.validate_query", + "x-version-added": "1.0" + } + }, + "/{alias}/_rollover": { + "post": { + "description": "Updates an alias to point to a new index when the existing index\nis considered to be too large or too old.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/dashboards/im-dashboards/rollover/" + }, + "operationId": "IndicesRollover", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndicesRollover_BodyParams" + } + } + } + }, + "parameters": [ + { + "name": "alias", + "in": "path", + "description": "The name of the alias to rollover.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the alias to rollover." + }, + "required": true + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "dry_run", + "in": "query", + "description": "If set to true the rollover action will only be validated but not actually performed even if a condition matches.", + "schema": { + "type": "boolean", + "default": false, + "description": "If set to true the rollover action will only be validated but not actually performed even if a condition matches." + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "wait_for_active_shards", + "in": "query", + "description": "Set the number of active shards to wait for on the newly created rollover index before the operation returns.", + "schema": { + "type": "string", + "description": "Set the number of active shards to wait for on the newly created rollover index before the operation returns." + } + } + ], + "responses": { + "200": { + "description": "IndicesRollover 200 response" + } + }, + "x-operation-group": "indices.rollover", + "x-version-added": "1.0" + } + }, + "/{alias}/_rollover/{new_index}": { + "post": { + "description": "Updates an alias to point to a new index when the existing index\nis considered to be too large or too old.", + "operationId": "IndicesRollover_WithNewIndex", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndicesRollover_BodyParams" + } + } + } + }, + "parameters": [ + { + "name": "alias", + "in": "path", + "description": "The name of the alias to rollover.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the alias to rollover." + }, + "required": true + }, + { + "name": "new_index", + "in": "path", + "description": "The name of the rollover index.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the rollover index." + }, + "required": true + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "dry_run", + "in": "query", + "description": "If set to true the rollover action will only be validated but not actually performed even if a condition matches.", + "schema": { + "type": "boolean", + "default": false, + "description": "If set to true the rollover action will only be validated but not actually performed even if a condition matches." + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "wait_for_active_shards", + "in": "query", + "description": "Set the number of active shards to wait for on the newly created rollover index before the operation returns.", + "schema": { + "type": "string", + "description": "Set the number of active shards to wait for on the newly created rollover index before the operation returns." + } + } + ], + "responses": { + "200": { + "description": "IndicesRollover_WithNewIndex 200 response" + } + }, + "x-operation-group": "indices.rollover", + "x-version-added": "1.0" + } + }, + "/{index}": { + "delete": { + "description": "Deletes an index.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/index-apis/delete-index/" + }, + "operationId": "IndicesDelete", + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices to delete; use `_all` or `*` string to delete all indices.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices to delete; use `_all` or `*` string to delete all indices.", + "x-data-type": "array" + }, + "required": true, + "examples": { + "IndicesDelete_example1": { + "summary": "Examples for Delete Index Operation.", + "description": "", + "value": "books" + } + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "default": false, + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "default": false, + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + } + ], + "responses": { + "200": { + "description": "IndicesDelete 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndicesDeleteResponseContent" + }, + "examples": { + "IndicesDelete_example1": { + "summary": "Examples for Delete Index Operation.", + "description": "", + "value": { + "acknowledged": true + } + } + } + } + } + } + }, + "x-operation-group": "indices.delete", + "x-version-added": "1.0" + }, + "get": { + "description": "Returns information about one or more indices.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/index-apis/get-index/" + }, + "operationId": "IndicesGet", + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "default": false, + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "default": false, + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "flat_settings", + "in": "query", + "description": "Return settings in flat format.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return settings in flat format." + } + }, + { + "name": "include_defaults", + "in": "query", + "description": "Whether to return all default setting for each of the indices.", + "schema": { + "type": "boolean", + "default": false, + "description": "Whether to return all default setting for each of the indices." + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "IndicesGet 200 response" + } + }, + "x-operation-group": "indices.get", + "x-version-added": "1.0" + }, + "head": { + "description": "Returns information about whether a particular index exists.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/index-apis/exists/" + }, + "operationId": "IndicesExists", + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "default": false, + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "default": false, + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "flat_settings", + "in": "query", + "description": "Return settings in flat format.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return settings in flat format." + } + }, + { + "name": "include_defaults", + "in": "query", + "description": "Whether to return all default setting for each of the indices.", + "schema": { + "type": "boolean", + "default": false, + "description": "Whether to return all default setting for each of the indices." + } + } + ], + "responses": { + "200": { + "description": "IndicesExists 200 response" + } + }, + "x-operation-group": "indices.exists", + "x-version-added": "1.0" + }, + "put": { + "description": "Creates an index with optional settings and mappings.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/index-apis/create-index/" + }, + "operationId": "IndicesCreate", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndicesCreate_BodyParams" + } + } + } + }, + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Index name.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Index name." + }, + "required": true, + "examples": { + "IndicesCreate_example1": { + "summary": "Examples for Create Index Operation.", + "description": "", + "value": "books" + } + } + }, + { + "name": "wait_for_active_shards", + "in": "query", + "description": "Set the number of active shards to wait for before the operation returns.", + "schema": { + "type": "string", + "description": "Set the number of active shards to wait for before the operation returns." + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "IndicesCreate 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndicesCreateResponseContent" + }, + "examples": { + "IndicesCreate_example1": { + "summary": "Examples for Create Index Operation.", + "description": "", + "value": { + "index": "books", + "shards_acknowledged": true, + "acknowledged": true + } + } + } + } + } + } + }, + "x-operation-group": "indices.create", + "x-version-added": "1.0" + } + }, + "/{index}/_alias": { + "get": { + "description": "Returns an alias.", + "operationId": "IndicesGetAlias_WithIndex", + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices to filter aliases.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices to filter aliases.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + } + ], + "responses": { + "200": { + "description": "IndicesGetAlias_WithIndex 200 response" + } + }, + "x-operation-group": "indices.get_alias", + "x-version-added": "1.0" + } + }, + "/{index}/_alias/{name}": { + "delete": { + "description": "Deletes an alias.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/im-plugin/index-alias/#delete-aliases" + }, + "operationId": "IndicesDeleteAlias", + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "name", + "in": "path", + "description": "Comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "IndicesDeleteAlias 200 response" + } + }, + "x-operation-group": "indices.delete_alias", + "x-version-added": "1.0" + }, + "get": { + "description": "Returns an alias.", + "operationId": "IndicesGetAlias_WithIndexName", + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices to filter aliases.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices to filter aliases.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "name", + "in": "path", + "description": "Comma-separated list of alias names.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of alias names.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + } + ], + "responses": { + "200": { + "description": "IndicesGetAlias_WithIndexName 200 response" + } + }, + "x-operation-group": "indices.get_alias", + "x-version-added": "1.0" + }, + "head": { + "description": "Returns information about whether a particular alias exists.", + "operationId": "IndicesExistsAlias_WithIndex", + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices to filter aliases.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices to filter aliases.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "name", + "in": "path", + "description": "Comma-separated list of alias names.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of alias names.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + } + ], + "responses": { + "200": { + "description": "IndicesExistsAlias_WithIndex 200 response" + } + }, + "x-operation-group": "indices.exists_alias", + "x-version-added": "1.0" + }, + "post": { + "description": "Creates or updates an alias.", + "operationId": "IndicesPutAlias_Post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndicesPutAlias_BodyParams" + } + } + } + }, + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "name", + "in": "path", + "description": "The name of the alias to be created or updated.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the alias to be created or updated." + }, + "required": true + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "IndicesPutAlias_Post 200 response" + } + }, + "x-operation-group": "indices.put_alias", + "x-version-added": "1.0" + }, + "put": { + "description": "Creates or updates an alias.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/im-plugin/index-alias/#create-aliases" + }, + "operationId": "IndicesPutAlias_Put", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndicesPutAlias_BodyParams" + } + } + } + }, + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "name", + "in": "path", + "description": "The name of the alias to be created or updated.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the alias to be created or updated." + }, + "required": true + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "IndicesPutAlias_Put 200 response" + } + }, + "x-operation-group": "indices.put_alias", + "x-version-added": "1.0" + } + }, + "/{index}/_aliases/{name}": { + "delete": { + "description": "Deletes an alias.", + "operationId": "IndicesDeleteAlias_Plural", + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "name", + "in": "path", + "description": "Comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "IndicesDeleteAlias_Plural 200 response" + } + }, + "x-operation-group": "indices.delete_alias", + "x-version-added": "1.0" + }, + "post": { + "description": "Creates or updates an alias.", + "operationId": "IndicesPutAlias_Post_Plural", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndicesPutAlias_BodyParams" + } + } + } + }, + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "name", + "in": "path", + "description": "The name of the alias to be created or updated.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the alias to be created or updated." + }, + "required": true + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "IndicesPutAlias_Post_Plural 200 response" + } + }, + "x-operation-group": "indices.put_alias", + "x-version-added": "1.0" + }, + "put": { + "description": "Creates or updates an alias.", + "operationId": "IndicesPutAlias_Put_Plural", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndicesPutAlias_BodyParams" + } + } + } + }, + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "name", + "in": "path", + "description": "The name of the alias to be created or updated.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the alias to be created or updated." + }, + "required": true + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "IndicesPutAlias_Put_Plural 200 response" + } + }, + "x-operation-group": "indices.put_alias", + "x-version-added": "1.0" + } + }, + "/{index}/_analyze": { + "get": { + "description": "Performs the analysis process on a text and return the tokens breakdown of the text.", + "operationId": "IndicesAnalyze_Get_WithIndex", + "parameters": [ + { + "name": "index", + "in": "path", + "description": "The name of the index to scope the operation.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the index to scope the operation." + }, + "required": true + }, + { + "name": "index", + "in": "query", + "description": "The name of the index to scope the operation.", + "schema": { + "type": "string", + "description": "The name of the index to scope the operation." + } + } + ], + "responses": { + "200": { + "description": "IndicesAnalyze_Get_WithIndex 200 response" + } + }, + "x-operation-group": "indices.analyze", + "x-version-added": "1.0" + }, + "post": { + "description": "Performs the analysis process on a text and return the tokens breakdown of the text.", + "operationId": "IndicesAnalyze_Post_WithIndex", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndicesAnalyze_BodyParams" + } + } + } + }, + "parameters": [ + { + "name": "index", + "in": "path", + "description": "The name of the index to scope the operation.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the index to scope the operation." + }, + "required": true + }, + { + "name": "index", + "in": "query", + "description": "The name of the index to scope the operation.", + "schema": { + "type": "string", + "description": "The name of the index to scope the operation." + } + } + ], + "responses": { + "200": { + "description": "IndicesAnalyze_Post_WithIndex 200 response" + } + }, + "x-operation-group": "indices.analyze", + "x-version-added": "1.0" + } + }, + "/{index}/_block/{block}": { + "put": { + "description": "Adds a block to an index.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest" + }, + "operationId": "IndicesAddBlock", + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices to add a block to.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices to add a block to.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "block", + "in": "path", + "description": "The block to add (one of read, write, read_only or metadata).", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The block to add (one of read, write, read_only or metadata)." + }, + "required": true + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + } + ], + "responses": { + "200": { + "description": "IndicesAddBlock 200 response" + } + }, + "x-operation-group": "indices.add_block", + "x-version-added": "1.0" + } + }, + "/{index}/_bulk": { + "post": { + "description": "Allows to perform multiple index/update/delete operations in a single request.", + "operationId": "Bulk_Post_WithIndex", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Bulk_BodyParams" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Default index for items which don't provide one.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Default index for items which don't provide one." + }, + "required": true + }, + { + "name": "wait_for_active_shards", + "in": "query", + "description": "Sets the number of shard copies that must be active before proceeding with the 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).", + "schema": { + "type": "string", + "default": "1", + "description": "Sets the number of shard copies that must be active before proceeding with the 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)." + } + }, + { + "name": "refresh", + "in": "query", + "description": "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.", + "schema": { + "$ref": "#/components/schemas/RefreshEnum" + } + }, + { + "name": "routing", + "in": "query", + "description": "Routing value.", + "schema": { + "type": "string", + "description": "Routing value." + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "type", + "in": "query", + "description": "Default document type for items which don't provide one.", + "schema": { + "type": "string", + "description": "Default document type for items which don't provide one." + } + }, + { + "name": "_source", + "in": "query", + "description": "True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-request.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-request." + }, + "explode": true + }, + { + "name": "_source_excludes", + "in": "query", + "description": "Default list of fields to exclude from the returned _source field, can be overridden on each sub-request.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Default list of fields to exclude from the returned _source field, can be overridden on each sub-request." + }, + "explode": true + }, + { + "name": "_source_includes", + "in": "query", + "description": "Default list of fields to extract and return from the _source field, can be overridden on each sub-request.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Default list of fields to extract and return from the _source field, can be overridden on each sub-request." + }, + "explode": true + }, + { + "name": "pipeline", + "in": "query", + "description": "The pipeline id to preprocess incoming documents with.", + "schema": { + "type": "string", + "description": "The pipeline id to preprocess incoming documents with." + } + }, + { + "name": "require_alias", + "in": "query", + "description": "Sets require_alias for all incoming documents.", + "schema": { + "type": "boolean", + "default": false, + "description": "Sets require_alias for all incoming documents." + } + } + ], + "responses": { + "200": { + "description": "Bulk_Post_WithIndex 200 response" + } + }, + "x-operation-group": "bulk", + "x-version-added": "1.0" + }, + "put": { + "description": "Allows to perform multiple index/update/delete operations in a single request.", + "operationId": "Bulk_Put_WithIndex", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Bulk_BodyParams" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Default index for items which don't provide one.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Default index for items which don't provide one." + }, + "required": true + }, + { + "name": "wait_for_active_shards", + "in": "query", + "description": "Sets the number of shard copies that must be active before proceeding with the 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).", + "schema": { + "type": "string", + "default": "1", + "description": "Sets the number of shard copies that must be active before proceeding with the 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)." + } + }, + { + "name": "refresh", + "in": "query", + "description": "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.", + "schema": { + "$ref": "#/components/schemas/RefreshEnum" + } + }, + { + "name": "routing", + "in": "query", + "description": "Routing value.", + "schema": { + "type": "string", + "description": "Routing value." + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "type", + "in": "query", + "description": "Default document type for items which don't provide one.", + "schema": { + "type": "string", + "description": "Default document type for items which don't provide one." + } + }, + { + "name": "_source", + "in": "query", + "description": "True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-request.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-request." + }, + "explode": true + }, + { + "name": "_source_excludes", + "in": "query", + "description": "Default list of fields to exclude from the returned _source field, can be overridden on each sub-request.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Default list of fields to exclude from the returned _source field, can be overridden on each sub-request." + }, + "explode": true + }, + { + "name": "_source_includes", + "in": "query", + "description": "Default list of fields to extract and return from the _source field, can be overridden on each sub-request.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Default list of fields to extract and return from the _source field, can be overridden on each sub-request." + }, + "explode": true + }, + { + "name": "pipeline", + "in": "query", + "description": "The pipeline id to preprocess incoming documents with.", + "schema": { + "type": "string", + "description": "The pipeline id to preprocess incoming documents with." + } + }, + { + "name": "require_alias", + "in": "query", + "description": "Sets require_alias for all incoming documents.", + "schema": { + "type": "boolean", + "default": false, + "description": "Sets require_alias for all incoming documents." + } + } + ], + "responses": { + "200": { + "description": "Bulk_Put_WithIndex 200 response" + } + }, + "x-operation-group": "bulk", + "x-version-added": "1.0" + } + }, + "/{index}/_cache/clear": { + "post": { + "description": "Clears all or specific caches for one or more indices.", + "operationId": "IndicesClearCache_WithIndex", + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "fielddata", + "in": "query", + "description": "Clear field data.", + "schema": { + "type": "boolean", + "description": "Clear field data." + } + }, + { + "name": "fields", + "in": "query", + "description": "Comma-separated list of fields to clear when using the `fielddata` parameter (default: all).", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields to clear when using the `fielddata` parameter (default: all)." + }, + "explode": true + }, + { + "name": "query", + "in": "query", + "description": "Clear query caches.", + "schema": { + "type": "boolean", + "description": "Clear query caches." + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "index", + "in": "query", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices." + }, + "explode": true + }, + { + "name": "request", + "in": "query", + "description": "Clear request cache.", + "schema": { + "type": "boolean", + "description": "Clear request cache." + } + } + ], + "responses": { + "200": { + "description": "IndicesClearCache_WithIndex 200 response" + } + }, + "x-operation-group": "indices.clear_cache", + "x-version-added": "1.0" + } + }, + "/{index}/_clone/{target}": { + "post": { + "description": "Clones an index.", + "operationId": "IndicesClone_Post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndicesClone_BodyParams" + } + } + } + }, + "parameters": [ + { + "name": "index", + "in": "path", + "description": "The name of the source index to clone.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the source index to clone." + }, + "required": true + }, + { + "name": "target", + "in": "path", + "description": "The name of the target index.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the target index." + }, + "required": true + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "wait_for_active_shards", + "in": "query", + "description": "Set the number of active shards to wait for on the cloned index before the operation returns.", + "schema": { + "type": "string", + "description": "Set the number of active shards to wait for on the cloned index before the operation returns." + } + } + ], + "responses": { + "200": { + "description": "IndicesClone_Post 200 response" + } + }, + "x-operation-group": "indices.clone", + "x-version-added": "1.0" + }, + "put": { + "description": "Clones an index.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/index-apis/clone/" + }, + "operationId": "IndicesClone_Put", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndicesClone_BodyParams" + } + } + } + }, + "parameters": [ + { + "name": "index", + "in": "path", + "description": "The name of the source index to clone.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the source index to clone." + }, + "required": true + }, + { + "name": "target", + "in": "path", + "description": "The name of the target index.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the target index." + }, + "required": true + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "wait_for_active_shards", + "in": "query", + "description": "Set the number of active shards to wait for on the cloned index before the operation returns.", + "schema": { + "type": "string", + "description": "Set the number of active shards to wait for on the cloned index before the operation returns." + } + } + ], + "responses": { + "200": { + "description": "IndicesClone_Put 200 response" + } + }, + "x-operation-group": "indices.clone", + "x-version-added": "1.0" + } + }, + "/{index}/_close": { + "post": { + "description": "Closes an index.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/index-apis/close-index/" + }, + "operationId": "IndicesClose", + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices to close.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices to close.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "wait_for_active_shards", + "in": "query", + "description": "Sets the number of active shards to wait for before the operation returns.", + "schema": { + "type": "string", + "description": "Sets the number of active shards to wait for before the operation returns." + } + } + ], + "responses": { + "200": { + "description": "IndicesClose 200 response" + } + }, + "x-operation-group": "indices.close", + "x-version-added": "1.0" + } + }, + "/{index}/_count": { + "get": { + "description": "Returns number of documents matching a query.", + "operationId": "Count_Get_WithIndex", + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices to restrict the results.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices to restrict the results.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "ignore_throttled", + "in": "query", + "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled.", + "schema": { + "type": "boolean", + "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "min_score", + "in": "query", + "description": "Include only documents with a specific `_score` value in the result.", + "schema": { + "type": "integer", + "description": "Include only documents with a specific `_score` value in the result.", + "format": "int32" + } + }, + { + "name": "preference", + "in": "query", + "description": "Specify the node or shard the operation should be performed on.", + "schema": { + "type": "string", + "default": "random", + "description": "Specify the node or shard the operation should be performed on." + } + }, + { + "name": "routing", + "in": "query", + "description": "Comma-separated list of specific routing values.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of specific routing values." + }, + "explode": true + }, + { + "name": "q", + "in": "query", + "description": "Query in the Lucene query string syntax.", + "schema": { + "type": "string", + "description": "Query in the Lucene query string syntax." + } + }, + { + "name": "analyzer", + "in": "query", + "description": "The analyzer to use for the query string.", + "schema": { + "type": "string", + "description": "The analyzer to use for the query string." + } + }, + { + "name": "analyze_wildcard", + "in": "query", + "description": "Specify whether wildcard and prefix queries should be analyzed.", + "schema": { + "type": "boolean", + "default": false, + "description": "Specify whether wildcard and prefix queries should be analyzed." + } + }, + { + "name": "default_operator", + "in": "query", + "description": "The default operator for query string query (AND or OR).", + "schema": { + "$ref": "#/components/schemas/DefaultOperator" + } + }, + { + "name": "df", + "in": "query", + "description": "The field to use as default where no field prefix is given in the query string.", + "schema": { + "type": "string", + "description": "The field to use as default where no field prefix is given in the query string." + } + }, + { + "name": "lenient", + "in": "query", + "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored.", + "schema": { + "type": "boolean", + "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored." + } + }, + { + "name": "terminate_after", + "in": "query", + "description": "The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.", + "schema": { + "type": "integer", + "description": "The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Count_Get_WithIndex 200 response" + } + }, + "x-operation-group": "count", + "x-version-added": "1.0" + }, + "post": { + "description": "Returns number of documents matching a query.", + "operationId": "Count_Post_WithIndex", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Count_BodyParams" + } + } + } + }, + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices to restrict the results.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices to restrict the results.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "ignore_throttled", + "in": "query", + "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled.", + "schema": { + "type": "boolean", + "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "min_score", + "in": "query", + "description": "Include only documents with a specific `_score` value in the result.", + "schema": { + "type": "integer", + "description": "Include only documents with a specific `_score` value in the result.", + "format": "int32" + } + }, + { + "name": "preference", + "in": "query", + "description": "Specify the node or shard the operation should be performed on.", + "schema": { + "type": "string", + "default": "random", + "description": "Specify the node or shard the operation should be performed on." + } + }, + { + "name": "routing", + "in": "query", + "description": "Comma-separated list of specific routing values.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of specific routing values." + }, + "explode": true + }, + { + "name": "q", + "in": "query", + "description": "Query in the Lucene query string syntax.", + "schema": { + "type": "string", + "description": "Query in the Lucene query string syntax." + } + }, + { + "name": "analyzer", + "in": "query", + "description": "The analyzer to use for the query string.", + "schema": { + "type": "string", + "description": "The analyzer to use for the query string." + } + }, + { + "name": "analyze_wildcard", + "in": "query", + "description": "Specify whether wildcard and prefix queries should be analyzed.", + "schema": { + "type": "boolean", + "default": false, + "description": "Specify whether wildcard and prefix queries should be analyzed." + } + }, + { + "name": "default_operator", + "in": "query", + "description": "The default operator for query string query (AND or OR).", + "schema": { + "$ref": "#/components/schemas/DefaultOperator" + } + }, + { + "name": "df", + "in": "query", + "description": "The field to use as default where no field prefix is given in the query string.", + "schema": { + "type": "string", + "description": "The field to use as default where no field prefix is given in the query string." + } + }, + { + "name": "lenient", + "in": "query", + "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored.", + "schema": { + "type": "boolean", + "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored." + } + }, + { + "name": "terminate_after", + "in": "query", + "description": "The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.", + "schema": { + "type": "integer", + "description": "The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Count_Post_WithIndex 200 response" + } + }, + "x-operation-group": "count", + "x-version-added": "1.0" + } + }, + "/{index}/_create/{id}": { + "post": { + "description": "Creates a new document in the index.\n\nReturns a 409 response when a document with a same ID already exists in the index.", + "operationId": "Create_Post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Create_BodyParams" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Document ID.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Document ID." + }, + "required": true + }, + { + "name": "index", + "in": "path", + "description": "Index name.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Index name." + }, + "required": true + }, + { + "name": "wait_for_active_shards", + "in": "query", + "description": "Sets the number of shard copies that must be active before proceeding with the 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).", + "schema": { + "type": "string", + "default": "1", + "description": "Sets the number of shard copies that must be active before proceeding with the 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)." + } + }, + { + "name": "refresh", + "in": "query", + "description": "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.", + "schema": { + "$ref": "#/components/schemas/RefreshEnum" + } + }, + { + "name": "routing", + "in": "query", + "description": "Routing value.", + "schema": { + "type": "string", + "description": "Routing value." + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "version", + "in": "query", + "description": "Explicit version number for concurrency control.", + "schema": { + "type": "integer", + "description": "Explicit version number for concurrency control.", + "format": "int32" + } + }, + { + "name": "version_type", + "in": "query", + "description": "Specific version type.", + "schema": { + "$ref": "#/components/schemas/VersionType" + } + }, + { + "name": "pipeline", + "in": "query", + "description": "The pipeline id to preprocess incoming documents with.", + "schema": { + "type": "string", + "description": "The pipeline id to preprocess incoming documents with." + } + } + ], + "responses": { + "200": { + "description": "Create_Post 200 response" + } + }, + "x-operation-group": "create", + "x-version-added": "1.0" + }, + "put": { + "description": "Creates a new document in the index.\n\nReturns a 409 response when a document with a same ID already exists in the index.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/document-apis/index-document/" + }, + "operationId": "Create_Put", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Create_BodyParams" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Document ID.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Document ID." + }, + "required": true + }, + { + "name": "index", + "in": "path", + "description": "Index name.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Index name." + }, + "required": true + }, + { + "name": "wait_for_active_shards", + "in": "query", + "description": "Sets the number of shard copies that must be active before proceeding with the 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).", + "schema": { + "type": "string", + "default": "1", + "description": "Sets the number of shard copies that must be active before proceeding with the 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)." + } + }, + { + "name": "refresh", + "in": "query", + "description": "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.", + "schema": { + "$ref": "#/components/schemas/RefreshEnum" + } + }, + { + "name": "routing", + "in": "query", + "description": "Routing value.", + "schema": { + "type": "string", + "description": "Routing value." + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "version", + "in": "query", + "description": "Explicit version number for concurrency control.", + "schema": { + "type": "integer", + "description": "Explicit version number for concurrency control.", + "format": "int32" + } + }, + { + "name": "version_type", + "in": "query", + "description": "Specific version type.", + "schema": { + "$ref": "#/components/schemas/VersionType" + } + }, + { + "name": "pipeline", + "in": "query", + "description": "The pipeline id to preprocess incoming documents with.", + "schema": { + "type": "string", + "description": "The pipeline id to preprocess incoming documents with." + } + } + ], + "responses": { + "200": { + "description": "Create_Put 200 response" + } + }, + "x-operation-group": "create", + "x-version-added": "1.0" + } + }, + "/{index}/_delete_by_query": { + "post": { + "description": "Deletes documents matching the provided query.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/document-apis/delete-by-query/" + }, + "operationId": "DeleteByQuery", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteByQuery_BodyParams" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "analyzer", + "in": "query", + "description": "The analyzer to use for the query string.", + "schema": { + "type": "string", + "description": "The analyzer to use for the query string." + } + }, + { + "name": "analyze_wildcard", + "in": "query", + "description": "Specify whether wildcard and prefix queries should be analyzed.", + "schema": { + "type": "boolean", + "default": false, + "description": "Specify whether wildcard and prefix queries should be analyzed." + } + }, + { + "name": "default_operator", + "in": "query", + "description": "The default operator for query string query (AND or OR).", + "schema": { + "$ref": "#/components/schemas/DefaultOperator" + } + }, + { + "name": "df", + "in": "query", + "description": "The field to use as default where no field prefix is given in the query string.", + "schema": { + "type": "string", + "description": "The field to use as default where no field prefix is given in the query string." + } + }, + { + "name": "from", + "in": "query", + "description": "Starting offset.", + "schema": { + "type": "integer", + "default": 0, + "description": "Starting offset.", + "format": "int32" + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "conflicts", + "in": "query", + "description": "What to do when the operation encounters version conflicts?.", + "schema": { + "$ref": "#/components/schemas/Conflicts" + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "lenient", + "in": "query", + "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored.", + "schema": { + "type": "boolean", + "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored." + } + }, + { + "name": "preference", + "in": "query", + "description": "Specify the node or shard the operation should be performed on.", + "schema": { + "type": "string", + "default": "random", + "description": "Specify the node or shard the operation should be performed on." + } + }, + { + "name": "q", + "in": "query", + "description": "Query in the Lucene query string syntax.", + "schema": { + "type": "string", + "description": "Query in the Lucene query string syntax." + } + }, + { + "name": "routing", + "in": "query", + "description": "Comma-separated list of specific routing values.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of specific routing values." + }, + "explode": true + }, + { + "name": "scroll", + "in": "query", + "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", + "x-data-type": "time" + } + }, + { + "name": "search_type", + "in": "query", + "description": "Search operation type.", + "schema": { + "$ref": "#/components/schemas/SearchType" + } + }, + { + "name": "search_timeout", + "in": "query", + "description": "Explicit timeout for each search request. Defaults to no timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Explicit timeout for each search request. Defaults to no timeout.", + "x-data-type": "time" + } + }, + { + "name": "size", + "in": "query", + "description": "Deprecated, please use `max_docs` instead.", + "schema": { + "type": "integer", + "description": "Deprecated, please use `max_docs` instead.", + "format": "int32" + } + }, + { + "name": "max_docs", + "in": "query", + "description": "Maximum number of documents to process (default: all documents).", + "schema": { + "type": "integer", + "description": "Maximum number of documents to process (default: all documents).", + "format": "int32" + } + }, + { + "name": "sort", + "in": "query", + "description": "Comma-separated list of : pairs.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of : pairs." + }, + "explode": true + }, + { + "name": "_source", + "in": "query", + "description": "True or false to return the _source field or not, or a list of fields to return.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "True or false to return the _source field or not, or a list of fields to return." + }, + "explode": true + }, + { + "name": "_source_excludes", + "in": "query", + "description": "List of fields to exclude from the returned _source field.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of fields to exclude from the returned _source field." + }, + "explode": true + }, + { + "name": "_source_includes", + "in": "query", + "description": "List of fields to extract and return from the _source field.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of fields to extract and return from the _source field." + }, + "explode": true + }, + { + "name": "terminate_after", + "in": "query", + "description": "The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.", + "schema": { + "type": "integer", + "description": "The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.", + "format": "int32" + } + }, + { + "name": "stats", + "in": "query", + "description": "Specific 'tag' of the request for logging and statistical purposes.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Specific 'tag' of the request for logging and statistical purposes." + }, + "explode": true + }, + { + "name": "version", + "in": "query", + "description": "Whether to return document version as part of a hit.", + "schema": { + "type": "boolean", + "description": "Whether to return document version as part of a hit." + } + }, + { + "name": "request_cache", + "in": "query", + "description": "Specify if request cache should be used for this request or not, defaults to index level setting.", + "schema": { + "type": "boolean", + "description": "Specify if request cache should be used for this request or not, defaults to index level setting." + } + }, + { + "name": "refresh", + "in": "query", + "description": "Refresh the shard containing the document before performing the operation.", + "schema": { + "type": "boolean", + "description": "Refresh the shard containing the document before performing the operation." + } + }, + { + "name": "timeout", + "in": "query", + "description": "Time each individual bulk request should wait for shards that are unavailable.", + "schema": { + "type": "string", + "default": "1m", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Time each individual bulk request should wait for shards that are unavailable.", + "x-data-type": "time" + } + }, + { + "name": "wait_for_active_shards", + "in": "query", + "description": "Sets the number of shard copies that must be active before proceeding with the 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).", + "schema": { + "type": "string", + "default": "1", + "description": "Sets the number of shard copies that must be active before proceeding with the 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)." + } + }, + { + "name": "scroll_size", + "in": "query", + "description": "Size on the scroll request powering the operation.", + "schema": { + "type": "integer", + "default": 100, + "description": "Size on the scroll request powering the operation.", + "format": "int32" + } + }, + { + "name": "wait_for_completion", + "in": "query", + "description": "Should this request wait until the operation has completed before returning.", + "schema": { + "type": "boolean", + "default": true, + "description": "Should this request wait until the operation has completed before returning." + } + }, + { + "name": "requests_per_second", + "in": "query", + "description": "The throttle for this request in sub-requests per second. -1 means no throttle.", + "schema": { + "type": "integer", + "default": 0, + "description": "The throttle for this request in sub-requests per second. -1 means no throttle.", + "format": "int32" + } + }, + { + "name": "slices", + "in": "query", + "description": "The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be set to `auto`.", + "schema": { + "type": "string", + "default": "1", + "description": "The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be set to `auto`." + } + } + ], + "responses": { + "200": { + "description": "DeleteByQuery 200 response" + } + }, + "x-operation-group": "delete_by_query", + "x-version-added": "1.0" + } + }, + "/{index}/_doc": { + "post": { + "description": "Creates or updates a document in an index.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/document-apis/index-document/" + }, + "operationId": "Index_Post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Index_BodyParams" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Index name.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Index name." + }, + "required": true + }, + { + "name": "wait_for_active_shards", + "in": "query", + "description": "Sets the number of shard copies that must be active before proceeding with the 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).", + "schema": { + "type": "string", + "default": "1", + "description": "Sets the number of shard copies that must be active before proceeding with the 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)." + } + }, + { + "name": "op_type", + "in": "query", + "description": "Explicit operation type. Defaults to `index` for requests with an explicit document ID, and to `create`for requests without an explicit document ID.", + "schema": { + "$ref": "#/components/schemas/OpType" + } + }, + { + "name": "refresh", + "in": "query", + "description": "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.", + "schema": { + "$ref": "#/components/schemas/RefreshEnum" + } + }, + { + "name": "routing", + "in": "query", + "description": "Routing value.", + "schema": { + "type": "string", + "description": "Routing value." + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "version", + "in": "query", + "description": "Explicit version number for concurrency control.", + "schema": { + "type": "integer", + "description": "Explicit version number for concurrency control.", + "format": "int32" + } + }, + { + "name": "version_type", + "in": "query", + "description": "Specific version type.", + "schema": { + "$ref": "#/components/schemas/VersionType" + } + }, + { + "name": "if_seq_no", + "in": "query", + "description": "only perform the operation if the last operation that has changed the document has the specified sequence number.", + "schema": { + "type": "integer", + "description": "only perform the operation if the last operation that has changed the document has the specified sequence number.", + "format": "int32" + } + }, + { + "name": "if_primary_term", + "in": "query", + "description": "only perform the operation if the last operation that has changed the document has the specified primary term.", + "schema": { + "type": "integer", + "description": "only perform the operation if the last operation that has changed the document has the specified primary term.", + "format": "int32" + } + }, + { + "name": "pipeline", + "in": "query", + "description": "The pipeline id to preprocess incoming documents with.", + "schema": { + "type": "string", + "description": "The pipeline id to preprocess incoming documents with." + } + }, + { + "name": "require_alias", + "in": "query", + "description": "When true, requires destination to be an alias.", + "schema": { + "type": "boolean", + "default": false, + "description": "When true, requires destination to be an alias." + } + } + ], + "responses": { + "200": { + "description": "Index_Post 200 response" + } + }, + "x-operation-group": "index", + "x-version-added": "1.0" + } + }, + "/{index}/_doc/{id}": { + "delete": { + "description": "Removes a document from the index.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/document-apis/delete-document/" + }, + "operationId": "Delete", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Document ID.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Document ID." + }, + "required": true + }, + { + "name": "index", + "in": "path", + "description": "Index name.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Index name." + }, + "required": true + }, + { + "name": "wait_for_active_shards", + "in": "query", + "description": "Sets the number of shard copies that must be active before proceeding with the 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).", + "schema": { + "type": "string", + "default": "1", + "description": "Sets the number of shard copies that must be active before proceeding with the 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)." + } + }, + { + "name": "refresh", + "in": "query", + "description": "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.", + "schema": { + "$ref": "#/components/schemas/RefreshEnum" + } + }, + { + "name": "routing", + "in": "query", + "description": "Routing value.", + "schema": { + "type": "string", + "description": "Routing value." + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "if_seq_no", + "in": "query", + "description": "only perform the operation if the last operation that has changed the document has the specified sequence number.", + "schema": { + "type": "integer", + "description": "only perform the operation if the last operation that has changed the document has the specified sequence number.", + "format": "int32" + } + }, + { + "name": "if_primary_term", + "in": "query", + "description": "only perform the operation if the last operation that has changed the document has the specified primary term.", + "schema": { + "type": "integer", + "description": "only perform the operation if the last operation that has changed the document has the specified primary term.", + "format": "int32" + } + }, + { + "name": "version", + "in": "query", + "description": "Explicit version number for concurrency control.", + "schema": { + "type": "integer", + "description": "Explicit version number for concurrency control.", + "format": "int32" + } + }, + { + "name": "version_type", + "in": "query", + "description": "Specific version type.", + "schema": { + "$ref": "#/components/schemas/VersionType" + } + } + ], + "responses": { + "200": { + "description": "Delete 200 response" + } + }, + "x-operation-group": "delete", + "x-version-added": "1.0" + }, + "get": { + "description": "Returns a document.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/document-apis/get-documents/" + }, + "operationId": "Get", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Document ID.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Document ID." + }, + "required": true, + "examples": { + "Get_example1": { + "summary": "Examples for Get document doc Operation.", + "description": "", + "value": "1" + } + } + }, + { + "name": "index", + "in": "path", + "description": "Index name.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Index name." + }, + "required": true, + "examples": { + "Get_example1": { + "summary": "Examples for Get document doc Operation.", + "description": "", + "value": "books" + } + } + }, + { + "name": "stored_fields", + "in": "query", + "description": "Comma-separated list of stored fields to return.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of stored fields to return." + }, + "explode": true + }, + { + "name": "preference", + "in": "query", + "description": "Specify the node or shard the operation should be performed on.", + "schema": { + "type": "string", + "default": "random", + "description": "Specify the node or shard the operation should be performed on." + } + }, + { + "name": "realtime", + "in": "query", + "description": "Specify whether to perform the operation in realtime or search mode.", + "schema": { + "type": "boolean", + "description": "Specify whether to perform the operation in realtime or search mode." + } + }, + { + "name": "refresh", + "in": "query", + "description": "Refresh the shard containing the document before performing the operation.", + "schema": { + "type": "boolean", + "description": "Refresh the shard containing the document before performing the operation." + } + }, + { + "name": "routing", + "in": "query", + "description": "Routing value.", + "schema": { + "type": "string", + "description": "Routing value." + } + }, + { + "name": "_source", + "in": "query", + "description": "True or false to return the _source field or not, or a list of fields to return.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "True or false to return the _source field or not, or a list of fields to return." + }, + "explode": true + }, + { + "name": "_source_excludes", + "in": "query", + "description": "List of fields to exclude from the returned _source field.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of fields to exclude from the returned _source field." + }, + "explode": true + }, + { + "name": "_source_includes", + "in": "query", + "description": "List of fields to extract and return from the _source field.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of fields to extract and return from the _source field." + }, + "explode": true + }, + { + "name": "version", + "in": "query", + "description": "Explicit version number for concurrency control.", + "schema": { + "type": "integer", + "description": "Explicit version number for concurrency control.", + "format": "int32" + } + }, + { + "name": "version_type", + "in": "query", + "description": "Specific version type.", + "schema": { + "$ref": "#/components/schemas/VersionType" + } + } + ], + "responses": { + "200": { + "description": "Get 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetResponseContent" + }, + "examples": { + "Get_example1": { + "summary": "Examples for Get document doc Operation.", + "description": "", + "value": { + "_index": "books", + "_id": "1", + "found": true + } + } + } + } + } + } + }, + "x-operation-group": "get", + "x-version-added": "1.0" + }, + "head": { + "description": "Returns information about whether a document exists in an index.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/document-apis/get-documents/" + }, + "operationId": "Exists", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Document ID.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Document ID." + }, + "required": true + }, + { + "name": "index", + "in": "path", + "description": "Index name.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Index name." + }, + "required": true + }, + { + "name": "stored_fields", + "in": "query", + "description": "Comma-separated list of stored fields to return.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of stored fields to return." + }, + "explode": true + }, + { + "name": "preference", + "in": "query", + "description": "Specify the node or shard the operation should be performed on.", + "schema": { + "type": "string", + "default": "random", + "description": "Specify the node or shard the operation should be performed on." + } + }, + { + "name": "realtime", + "in": "query", + "description": "Specify whether to perform the operation in realtime or search mode.", + "schema": { + "type": "boolean", + "description": "Specify whether to perform the operation in realtime or search mode." + } + }, + { + "name": "refresh", + "in": "query", + "description": "Refresh the shard containing the document before performing the operation.", + "schema": { + "type": "boolean", + "description": "Refresh the shard containing the document before performing the operation." + } + }, + { + "name": "routing", + "in": "query", + "description": "Routing value.", + "schema": { + "type": "string", + "description": "Routing value." + } + }, + { + "name": "_source", + "in": "query", + "description": "True or false to return the _source field or not, or a list of fields to return.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "True or false to return the _source field or not, or a list of fields to return." + }, + "explode": true + }, + { + "name": "_source_excludes", + "in": "query", + "description": "List of fields to exclude from the returned _source field.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of fields to exclude from the returned _source field." + }, + "explode": true + }, + { + "name": "_source_includes", + "in": "query", + "description": "List of fields to extract and return from the _source field.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of fields to extract and return from the _source field." + }, + "explode": true + }, + { + "name": "version", + "in": "query", + "description": "Explicit version number for concurrency control.", + "schema": { + "type": "integer", + "description": "Explicit version number for concurrency control.", + "format": "int32" + } + }, + { + "name": "version_type", + "in": "query", + "description": "Specific version type.", + "schema": { + "$ref": "#/components/schemas/VersionType" + } + } + ], + "responses": { + "200": { + "description": "Exists 200 response" + } + }, + "x-operation-group": "exists", + "x-version-added": "1.0" + }, + "post": { + "description": "Creates or updates a document in an index.", + "operationId": "Index_Post_WithId", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Index_BodyParams" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Document ID.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Document ID." + }, + "required": true + }, + { + "name": "index", + "in": "path", + "description": "Index name.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Index name." + }, + "required": true + }, + { + "name": "wait_for_active_shards", + "in": "query", + "description": "Sets the number of shard copies that must be active before proceeding with the 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).", + "schema": { + "type": "string", + "default": "1", + "description": "Sets the number of shard copies that must be active before proceeding with the 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)." + } + }, + { + "name": "op_type", + "in": "query", + "description": "Explicit operation type. Defaults to `index` for requests with an explicit document ID, and to `create`for requests without an explicit document ID.", + "schema": { + "$ref": "#/components/schemas/OpType" + } + }, + { + "name": "refresh", + "in": "query", + "description": "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.", + "schema": { + "$ref": "#/components/schemas/RefreshEnum" + } + }, + { + "name": "routing", + "in": "query", + "description": "Routing value.", + "schema": { + "type": "string", + "description": "Routing value." + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "version", + "in": "query", + "description": "Explicit version number for concurrency control.", + "schema": { + "type": "integer", + "description": "Explicit version number for concurrency control.", + "format": "int32" + } + }, + { + "name": "version_type", + "in": "query", + "description": "Specific version type.", + "schema": { + "$ref": "#/components/schemas/VersionType" + } + }, + { + "name": "if_seq_no", + "in": "query", + "description": "only perform the operation if the last operation that has changed the document has the specified sequence number.", + "schema": { + "type": "integer", + "description": "only perform the operation if the last operation that has changed the document has the specified sequence number.", + "format": "int32" + } + }, + { + "name": "if_primary_term", + "in": "query", + "description": "only perform the operation if the last operation that has changed the document has the specified primary term.", + "schema": { + "type": "integer", + "description": "only perform the operation if the last operation that has changed the document has the specified primary term.", + "format": "int32" + } + }, + { + "name": "pipeline", + "in": "query", + "description": "The pipeline id to preprocess incoming documents with.", + "schema": { + "type": "string", + "description": "The pipeline id to preprocess incoming documents with." + } + }, + { + "name": "require_alias", + "in": "query", + "description": "When true, requires destination to be an alias.", + "schema": { + "type": "boolean", + "default": false, + "description": "When true, requires destination to be an alias." + } + } + ], + "responses": { + "200": { + "description": "Index_Post_WithId 200 response" + } + }, + "x-operation-group": "index", + "x-version-added": "1.0" + }, + "put": { + "description": "Creates or updates a document in an index.", + "operationId": "Index_Put_WithId", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Index_BodyParams" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Document ID.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Document ID." + }, + "required": true + }, + { + "name": "index", + "in": "path", + "description": "Index name.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Index name." + }, + "required": true + }, + { + "name": "wait_for_active_shards", + "in": "query", + "description": "Sets the number of shard copies that must be active before proceeding with the 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).", + "schema": { + "type": "string", + "default": "1", + "description": "Sets the number of shard copies that must be active before proceeding with the 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)." + } + }, + { + "name": "op_type", + "in": "query", + "description": "Explicit operation type. Defaults to `index` for requests with an explicit document ID, and to `create`for requests without an explicit document ID.", + "schema": { + "$ref": "#/components/schemas/OpType" + } + }, + { + "name": "refresh", + "in": "query", + "description": "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.", + "schema": { + "$ref": "#/components/schemas/RefreshEnum" + } + }, + { + "name": "routing", + "in": "query", + "description": "Routing value.", + "schema": { + "type": "string", + "description": "Routing value." + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "version", + "in": "query", + "description": "Explicit version number for concurrency control.", + "schema": { + "type": "integer", + "description": "Explicit version number for concurrency control.", + "format": "int32" + } + }, + { + "name": "version_type", + "in": "query", + "description": "Specific version type.", + "schema": { + "$ref": "#/components/schemas/VersionType" + } + }, + { + "name": "if_seq_no", + "in": "query", + "description": "only perform the operation if the last operation that has changed the document has the specified sequence number.", + "schema": { + "type": "integer", + "description": "only perform the operation if the last operation that has changed the document has the specified sequence number.", + "format": "int32" + } + }, + { + "name": "if_primary_term", + "in": "query", + "description": "only perform the operation if the last operation that has changed the document has the specified primary term.", + "schema": { + "type": "integer", + "description": "only perform the operation if the last operation that has changed the document has the specified primary term.", + "format": "int32" + } + }, + { + "name": "pipeline", + "in": "query", + "description": "The pipeline id to preprocess incoming documents with.", + "schema": { + "type": "string", + "description": "The pipeline id to preprocess incoming documents with." + } + }, + { + "name": "require_alias", + "in": "query", + "description": "When true, requires destination to be an alias.", + "schema": { + "type": "boolean", + "default": false, + "description": "When true, requires destination to be an alias." + } + } + ], + "responses": { + "200": { + "description": "Index_Put_WithId 200 response" + } + }, + "x-operation-group": "index", + "x-version-added": "1.0" + } + }, + "/{index}/_explain/{id}": { + "get": { + "description": "Returns information about why a specific matches (or doesn't match) a query.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/explain/" + }, + "operationId": "Explain_Get", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Document ID.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Document ID." + }, + "required": true + }, + { + "name": "index", + "in": "path", + "description": "Index name.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Index name." + }, + "required": true + }, + { + "name": "analyze_wildcard", + "in": "query", + "description": "Specify whether wildcards and prefix queries in the query string query should be analyzed.", + "schema": { + "type": "boolean", + "default": false, + "description": "Specify whether wildcards and prefix queries in the query string query should be analyzed." + } + }, + { + "name": "analyzer", + "in": "query", + "description": "The analyzer to use for the query string.", + "schema": { + "type": "string", + "description": "The analyzer to use for the query string." + } + }, + { + "name": "default_operator", + "in": "query", + "description": "The default operator for query string query (AND or OR).", + "schema": { + "$ref": "#/components/schemas/DefaultOperator" + } + }, + { + "name": "df", + "in": "query", + "description": "The default field for query string query.", + "schema": { + "type": "string", + "default": "_all", + "description": "The default field for query string query." + } + }, + { + "name": "stored_fields", + "in": "query", + "description": "Comma-separated list of stored fields to return.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of stored fields to return." + }, + "explode": true + }, + { + "name": "lenient", + "in": "query", + "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored.", + "schema": { + "type": "boolean", + "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored." + } + }, + { + "name": "preference", + "in": "query", + "description": "Specify the node or shard the operation should be performed on.", + "schema": { + "type": "string", + "default": "random", + "description": "Specify the node or shard the operation should be performed on." + } + }, + { + "name": "q", + "in": "query", + "description": "Query in the Lucene query string syntax.", + "schema": { + "type": "string", + "description": "Query in the Lucene query string syntax." + } + }, + { + "name": "routing", + "in": "query", + "description": "Routing value.", + "schema": { + "type": "string", + "description": "Routing value." + } + }, + { + "name": "_source", + "in": "query", + "description": "True or false to return the _source field or not, or a list of fields to return.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "True or false to return the _source field or not, or a list of fields to return." + }, + "explode": true + }, + { + "name": "_source_excludes", + "in": "query", + "description": "List of fields to exclude from the returned _source field.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of fields to exclude from the returned _source field." + }, + "explode": true + }, + { + "name": "_source_includes", + "in": "query", + "description": "List of fields to extract and return from the _source field.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of fields to extract and return from the _source field." + }, + "explode": true + } + ], + "responses": { + "200": { + "description": "Explain_Get 200 response" + } + }, + "x-operation-group": "explain", + "x-version-added": "1.0" + }, + "post": { + "description": "Returns information about why a specific matches (or doesn't match) a query.", + "operationId": "Explain_Post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Explain_BodyParams" + } + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Document ID.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Document ID." + }, + "required": true + }, + { + "name": "index", + "in": "path", + "description": "Index name.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Index name." + }, + "required": true + }, + { + "name": "analyze_wildcard", + "in": "query", + "description": "Specify whether wildcards and prefix queries in the query string query should be analyzed.", + "schema": { + "type": "boolean", + "default": false, + "description": "Specify whether wildcards and prefix queries in the query string query should be analyzed." + } + }, + { + "name": "analyzer", + "in": "query", + "description": "The analyzer to use for the query string.", + "schema": { + "type": "string", + "description": "The analyzer to use for the query string." + } + }, + { + "name": "default_operator", + "in": "query", + "description": "The default operator for query string query (AND or OR).", + "schema": { + "$ref": "#/components/schemas/DefaultOperator" + } + }, + { + "name": "df", + "in": "query", + "description": "The default field for query string query.", + "schema": { + "type": "string", + "default": "_all", + "description": "The default field for query string query." + } + }, + { + "name": "stored_fields", + "in": "query", + "description": "Comma-separated list of stored fields to return.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of stored fields to return." + }, + "explode": true + }, + { + "name": "lenient", + "in": "query", + "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored.", + "schema": { + "type": "boolean", + "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored." + } + }, + { + "name": "preference", + "in": "query", + "description": "Specify the node or shard the operation should be performed on.", + "schema": { + "type": "string", + "default": "random", + "description": "Specify the node or shard the operation should be performed on." + } + }, + { + "name": "q", + "in": "query", + "description": "Query in the Lucene query string syntax.", + "schema": { + "type": "string", + "description": "Query in the Lucene query string syntax." + } + }, + { + "name": "routing", + "in": "query", + "description": "Routing value.", + "schema": { + "type": "string", + "description": "Routing value." + } + }, + { + "name": "_source", + "in": "query", + "description": "True or false to return the _source field or not, or a list of fields to return.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "True or false to return the _source field or not, or a list of fields to return." + }, + "explode": true + }, + { + "name": "_source_excludes", + "in": "query", + "description": "List of fields to exclude from the returned _source field.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of fields to exclude from the returned _source field." + }, + "explode": true + }, + { + "name": "_source_includes", + "in": "query", + "description": "List of fields to extract and return from the _source field.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of fields to extract and return from the _source field." + }, + "explode": true + } + ], + "responses": { + "200": { + "description": "Explain_Post 200 response" + } + }, + "x-operation-group": "explain", + "x-version-added": "1.0" + } + }, + "/{index}/_field_caps": { + "get": { + "description": "Returns the information about the capabilities of fields among multiple indices.", + "operationId": "FieldCaps_Get_WithIndex", + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "fields", + "in": "query", + "description": "Comma-separated list of field names.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of field names." + }, + "explode": true + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "include_unmapped", + "in": "query", + "description": "Indicates whether unmapped fields should be included in the response.", + "schema": { + "type": "boolean", + "default": false, + "description": "Indicates whether unmapped fields should be included in the response." + } + } + ], + "responses": { + "200": { + "description": "FieldCaps_Get_WithIndex 200 response" + } + }, + "x-operation-group": "field_caps", + "x-version-added": "1.0" + }, + "post": { + "description": "Returns the information about the capabilities of fields among multiple indices.", + "operationId": "FieldCaps_Post_WithIndex", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FieldCaps_BodyParams" + } + } + } + }, + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "fields", + "in": "query", + "description": "Comma-separated list of field names.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of field names." + }, + "explode": true + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "include_unmapped", + "in": "query", + "description": "Indicates whether unmapped fields should be included in the response.", + "schema": { + "type": "boolean", + "default": false, + "description": "Indicates whether unmapped fields should be included in the response." + } + } + ], + "responses": { + "200": { + "description": "FieldCaps_Post_WithIndex 200 response" + } + }, + "x-operation-group": "field_caps", + "x-version-added": "1.0" + } + }, + "/{index}/_flush": { + "get": { + "description": "Performs the flush operation on one or more indices.", + "operationId": "IndicesFlush_Get_WithIndex", + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "force", + "in": "query", + "description": "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).", + "schema": { + "type": "boolean", + "description": "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)." + } + }, + { + "name": "wait_if_ongoing", + "in": "query", + "description": "If set to true the flush operation will block until the flush can be executed if another flush operation is already executing. If set to false the flush will be skipped iff if another flush operation is already running.", + "schema": { + "type": "boolean", + "default": true, + "description": "If set to true the flush operation will block until the flush can be executed if another flush operation is already executing. If set to false the flush will be skipped iff if another flush operation is already running." + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + } + ], + "responses": { + "200": { + "description": "IndicesFlush_Get_WithIndex 200 response" + } + }, + "x-operation-group": "indices.flush", + "x-version-added": "1.0" + }, + "post": { + "description": "Performs the flush operation on one or more indices.", + "operationId": "IndicesFlush_Post_WithIndex", + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "force", + "in": "query", + "description": "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).", + "schema": { + "type": "boolean", + "description": "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)." + } + }, + { + "name": "wait_if_ongoing", + "in": "query", + "description": "If set to true the flush operation will block until the flush can be executed if another flush operation is already executing. If set to false the flush will be skipped iff if another flush operation is already running.", + "schema": { + "type": "boolean", + "default": true, + "description": "If set to true the flush operation will block until the flush can be executed if another flush operation is already executing. If set to false the flush will be skipped iff if another flush operation is already running." + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + } + ], + "responses": { + "200": { + "description": "IndicesFlush_Post_WithIndex 200 response" + } + }, + "x-operation-group": "indices.flush", + "x-version-added": "1.0" + } + }, + "/{index}/_forcemerge": { + "post": { + "description": "Performs the force merge operation on one or more indices.", + "operationId": "IndicesForcemerge_WithIndex", + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "flush", + "in": "query", + "description": "Specify whether the index should be flushed after performing the operation.", + "schema": { + "type": "boolean", + "default": true, + "description": "Specify whether the index should be flushed after performing the operation." + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "max_num_segments", + "in": "query", + "description": "The number of segments the index should be merged into (default: dynamic).", + "schema": { + "type": "integer", + "description": "The number of segments the index should be merged into (default: dynamic).", + "format": "int32" + } + }, + { + "name": "only_expunge_deletes", + "in": "query", + "description": "Specify whether the operation should only expunge deleted documents.", + "schema": { + "type": "boolean", + "description": "Specify whether the operation should only expunge deleted documents." + } + } + ], + "responses": { + "200": { + "description": "IndicesForcemerge_WithIndex 200 response" + } + }, + "x-operation-group": "indices.forcemerge", + "x-version-added": "1.0" + } + }, + "/{index}/_mapping": { + "get": { + "description": "Returns mappings for one or more indices.", + "operationId": "IndicesGetMapping_WithIndex", + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "x-version-deprecated": "1.0", + "x-deprecation-message": "This parameter is a no-op and field mappings are always retrieved locally.", + "deprecated": true + } + } + ], + "responses": { + "200": { + "description": "IndicesGetMapping_WithIndex 200 response" + } + }, + "x-operation-group": "indices.get_mapping", + "x-version-added": "1.0" + }, + "post": { + "description": "Updates the index mappings.", + "operationId": "IndicesPutMapping_Post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndicesPutMapping_BodyParams" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "write_index_only", + "in": "query", + "description": "When true, applies mappings only to the write index of an alias or data stream.", + "schema": { + "type": "boolean", + "default": false, + "description": "When true, applies mappings only to the write index of an alias or data stream." + } + } + ], + "responses": { + "200": { + "description": "IndicesPutMapping_Post 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndicesPutMapping_PostResponseContent" + } + } + } + } + }, + "x-operation-group": "indices.put_mapping", + "x-version-added": "1.0" + }, + "put": { + "description": "Updates the index mappings.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/index-apis/put-mapping/" + }, + "operationId": "IndicesPutMapping_Put", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndicesPutMapping_BodyParams" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "write_index_only", + "in": "query", + "description": "When true, applies mappings only to the write index of an alias or data stream.", + "schema": { + "type": "boolean", + "default": false, + "description": "When true, applies mappings only to the write index of an alias or data stream." + } + } + ], + "responses": { + "200": { + "description": "IndicesPutMapping_Put 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndicesPutMapping_PutResponseContent" + } + } + } + } + }, + "x-operation-group": "indices.put_mapping", + "x-version-added": "1.0" + } + }, + "/{index}/_mapping/field/{fields}": { + "get": { + "description": "Returns mapping for one or more fields.", + "operationId": "IndicesGetFieldMapping_WithIndex", + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "fields", + "in": "path", + "description": "Comma-separated list of fields.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of fields.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "include_defaults", + "in": "query", + "description": "Whether the default mapping values should be returned as well.", + "schema": { + "type": "boolean", + "description": "Whether the default mapping values should be returned as well." + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + } + ], + "responses": { + "200": { + "description": "IndicesGetFieldMapping_WithIndex 200 response" + } + }, + "x-operation-group": "indices.get_field_mapping", + "x-version-added": "1.0" + } + }, + "/{index}/_mget": { + "get": { + "description": "Allows to get multiple documents in one request.", + "operationId": "Mget_Get_WithIndex", + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Index name.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Index name." + }, + "required": true + }, + { + "name": "stored_fields", + "in": "query", + "description": "Comma-separated list of stored fields to return.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of stored fields to return." + }, + "explode": true + }, + { + "name": "preference", + "in": "query", + "description": "Specify the node or shard the operation should be performed on.", + "schema": { + "type": "string", + "default": "random", + "description": "Specify the node or shard the operation should be performed on." + } + }, + { + "name": "realtime", + "in": "query", + "description": "Specify whether to perform the operation in realtime or search mode.", + "schema": { + "type": "boolean", + "description": "Specify whether to perform the operation in realtime or search mode." + } + }, + { + "name": "refresh", + "in": "query", + "description": "Refresh the shard containing the document before performing the operation.", + "schema": { + "type": "boolean", + "description": "Refresh the shard containing the document before performing the operation." + } + }, + { + "name": "routing", + "in": "query", + "description": "Routing value.", + "schema": { + "type": "string", + "description": "Routing value." + } + }, + { + "name": "_source", + "in": "query", + "description": "True or false to return the _source field or not, or a list of fields to return.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "True or false to return the _source field or not, or a list of fields to return." + }, + "explode": true + }, + { + "name": "_source_excludes", + "in": "query", + "description": "List of fields to exclude from the returned _source field.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of fields to exclude from the returned _source field." + }, + "explode": true + }, + { + "name": "_source_includes", + "in": "query", + "description": "List of fields to extract and return from the _source field.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of fields to extract and return from the _source field." + }, + "explode": true + } + ], + "responses": { + "200": { + "description": "Mget_Get_WithIndex 200 response" + } + }, + "x-operation-group": "mget", + "x-version-added": "1.0" + }, + "post": { + "description": "Allows to get multiple documents in one request.", + "operationId": "Mget_Post_WithIndex", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Mget_BodyParams" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Index name.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Index name." + }, + "required": true + }, + { + "name": "stored_fields", + "in": "query", + "description": "Comma-separated list of stored fields to return.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of stored fields to return." + }, + "explode": true + }, + { + "name": "preference", + "in": "query", + "description": "Specify the node or shard the operation should be performed on.", + "schema": { + "type": "string", + "default": "random", + "description": "Specify the node or shard the operation should be performed on." + } + }, + { + "name": "realtime", + "in": "query", + "description": "Specify whether to perform the operation in realtime or search mode.", + "schema": { + "type": "boolean", + "description": "Specify whether to perform the operation in realtime or search mode." + } + }, + { + "name": "refresh", + "in": "query", + "description": "Refresh the shard containing the document before performing the operation.", + "schema": { + "type": "boolean", + "description": "Refresh the shard containing the document before performing the operation." + } + }, + { + "name": "routing", + "in": "query", + "description": "Routing value.", + "schema": { + "type": "string", + "description": "Routing value." + } + }, + { + "name": "_source", + "in": "query", + "description": "True or false to return the _source field or not, or a list of fields to return.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "True or false to return the _source field or not, or a list of fields to return." + }, + "explode": true + }, + { + "name": "_source_excludes", + "in": "query", + "description": "List of fields to exclude from the returned _source field.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of fields to exclude from the returned _source field." + }, + "explode": true + }, + { + "name": "_source_includes", + "in": "query", + "description": "List of fields to extract and return from the _source field.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of fields to extract and return from the _source field." + }, + "explode": true + } + ], + "responses": { + "200": { + "description": "Mget_Post_WithIndex 200 response" + } + }, + "x-operation-group": "mget", + "x-version-added": "1.0" + } + }, + "/{index}/_msearch": { + "get": { + "description": "Allows to execute several search operations in one request.", + "operationId": "Msearch_Get_WithIndex", + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices to use as default.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices to use as default.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "search_type", + "in": "query", + "description": "Search operation type.", + "schema": { + "$ref": "#/components/schemas/SearchTypeMulti" + } + }, + { + "name": "max_concurrent_searches", + "in": "query", + "description": "Controls the maximum number of concurrent searches the multi search api will execute.", + "schema": { + "type": "integer", + "description": "Controls the maximum number of concurrent searches the multi search api will execute.", + "format": "int32" + } + }, + { + "name": "typed_keys", + "in": "query", + "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response.", + "schema": { + "type": "boolean", + "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response." + } + }, + { + "name": "pre_filter_shard_size", + "in": "query", + "description": "Threshold that enforces a pre-filter round-trip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter round-trip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint.", + "schema": { + "type": "integer", + "description": "Threshold that enforces a pre-filter round-trip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter round-trip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint.", + "format": "int32" + } + }, + { + "name": "max_concurrent_shard_requests", + "in": "query", + "description": "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.", + "schema": { + "type": "integer", + "default": 5, + "description": "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.", + "format": "int32" + } + }, + { + "name": "rest_total_hits_as_int", + "in": "query", + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response.", + "schema": { + "type": "boolean", + "default": false, + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response." + } + }, + { + "name": "ccs_minimize_roundtrips", + "in": "query", + "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution.", + "schema": { + "type": "boolean", + "default": true, + "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution." + } + } + ], + "responses": { + "200": { + "description": "Msearch_Get_WithIndex 200 response" + } + }, + "x-operation-group": "msearch", + "x-version-added": "1.0" + }, + "post": { + "description": "Allows to execute several search operations in one request.", + "operationId": "Msearch_Post_WithIndex", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Msearch_BodyParams" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices to use as default.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices to use as default.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "search_type", + "in": "query", + "description": "Search operation type.", + "schema": { + "$ref": "#/components/schemas/SearchTypeMulti" + } + }, + { + "name": "max_concurrent_searches", + "in": "query", + "description": "Controls the maximum number of concurrent searches the multi search api will execute.", + "schema": { + "type": "integer", + "description": "Controls the maximum number of concurrent searches the multi search api will execute.", + "format": "int32" + } + }, + { + "name": "typed_keys", + "in": "query", + "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response.", + "schema": { + "type": "boolean", + "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response." + } + }, + { + "name": "pre_filter_shard_size", + "in": "query", + "description": "Threshold that enforces a pre-filter round-trip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter round-trip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint.", + "schema": { + "type": "integer", + "description": "Threshold that enforces a pre-filter round-trip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter round-trip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint.", + "format": "int32" + } + }, + { + "name": "max_concurrent_shard_requests", + "in": "query", + "description": "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.", + "schema": { + "type": "integer", + "default": 5, + "description": "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.", + "format": "int32" + } + }, + { + "name": "rest_total_hits_as_int", + "in": "query", + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response.", + "schema": { + "type": "boolean", + "default": false, + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response." + } + }, + { + "name": "ccs_minimize_roundtrips", + "in": "query", + "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution.", + "schema": { + "type": "boolean", + "default": true, + "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution." + } + } + ], + "responses": { + "200": { + "description": "Msearch_Post_WithIndex 200 response" + } + }, + "x-operation-group": "msearch", + "x-version-added": "1.0" + } + }, + "/{index}/_msearch/template": { + "get": { + "description": "Allows to execute several search template operations in one request.", + "operationId": "MsearchTemplate_Get_WithIndex", + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices to use as default.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices to use as default.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "search_type", + "in": "query", + "description": "Search operation type.", + "schema": { + "$ref": "#/components/schemas/SearchTypeMulti" + } + }, + { + "name": "typed_keys", + "in": "query", + "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response.", + "schema": { + "type": "boolean", + "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response." + } + }, + { + "name": "max_concurrent_searches", + "in": "query", + "description": "Controls the maximum number of concurrent searches the multi search api will execute.", + "schema": { + "type": "integer", + "description": "Controls the maximum number of concurrent searches the multi search api will execute.", + "format": "int32" + } + }, + { + "name": "rest_total_hits_as_int", + "in": "query", + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response.", + "schema": { + "type": "boolean", + "default": false, + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response." + } + }, + { + "name": "ccs_minimize_roundtrips", + "in": "query", + "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution.", + "schema": { + "type": "boolean", + "default": true, + "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution." + } + } + ], + "responses": { + "200": { + "description": "MsearchTemplate_Get_WithIndex 200 response" + } + }, + "x-operation-group": "msearch_template", + "x-version-added": "1.0" + }, + "post": { + "description": "Allows to execute several search template operations in one request.", + "operationId": "MsearchTemplate_Post_WithIndex", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MsearchTemplate_BodyParams" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices to use as default.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices to use as default.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "search_type", + "in": "query", + "description": "Search operation type.", + "schema": { + "$ref": "#/components/schemas/SearchTypeMulti" + } + }, + { + "name": "typed_keys", + "in": "query", + "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response.", + "schema": { + "type": "boolean", + "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response." + } + }, + { + "name": "max_concurrent_searches", + "in": "query", + "description": "Controls the maximum number of concurrent searches the multi search api will execute.", + "schema": { + "type": "integer", + "description": "Controls the maximum number of concurrent searches the multi search api will execute.", + "format": "int32" + } + }, + { + "name": "rest_total_hits_as_int", + "in": "query", + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response.", + "schema": { + "type": "boolean", + "default": false, + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response." + } + }, + { + "name": "ccs_minimize_roundtrips", + "in": "query", + "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution.", + "schema": { + "type": "boolean", + "default": true, + "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution." + } + } + ], + "responses": { + "200": { + "description": "MsearchTemplate_Post_WithIndex 200 response" + } + }, + "x-operation-group": "msearch_template", + "x-version-added": "1.0" + } + }, + "/{index}/_mtermvectors": { + "get": { + "description": "Returns multiple termvectors in one request.", + "operationId": "Mtermvectors_Get_WithIndex", + "parameters": [ + { + "name": "index", + "in": "path", + "description": "The index in which the document resides.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The index in which the document resides." + }, + "required": true + }, + { + "name": "ids", + "in": "query", + "description": "Comma-separated list of documents ids. You must define ids as parameter or set 'ids' or 'docs' in the request body.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of documents ids. You must define ids as parameter or set 'ids' or 'docs' in the request body." + }, + "explode": true + }, + { + "name": "term_statistics", + "in": "query", + "description": "Specifies if total term frequency and document frequency should be returned. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'.", + "schema": { + "type": "boolean", + "default": false, + "description": "Specifies if total term frequency and document frequency should be returned. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'." + } + }, + { + "name": "field_statistics", + "in": "query", + "description": "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'.", + "schema": { + "type": "boolean", + "default": true, + "description": "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'." + } + }, + { + "name": "fields", + "in": "query", + "description": "Comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'." + }, + "explode": true + }, + { + "name": "offsets", + "in": "query", + "description": "Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'.", + "schema": { + "type": "boolean", + "default": true, + "description": "Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'." + } + }, + { + "name": "positions", + "in": "query", + "description": "Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'.", + "schema": { + "type": "boolean", + "default": true, + "description": "Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'." + } + }, + { + "name": "payloads", + "in": "query", + "description": "Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'.", + "schema": { + "type": "boolean", + "default": true, + "description": "Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'." + } + }, + { + "name": "preference", + "in": "query", + "description": "Specify the node or shard the operation should be performed on. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'.", + "schema": { + "type": "string", + "default": "random", + "description": "Specify the node or shard the operation should be performed on. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'." + } + }, + { + "name": "routing", + "in": "query", + "description": "Routing value. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'.", + "schema": { + "type": "string", + "description": "Routing value. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'." + } + }, + { + "name": "realtime", + "in": "query", + "description": "Specifies if requests are real-time as opposed to near-real-time.", + "schema": { + "type": "boolean", + "default": true, + "description": "Specifies if requests are real-time as opposed to near-real-time." + } + }, + { + "name": "version", + "in": "query", + "description": "Explicit version number for concurrency control.", + "schema": { + "type": "integer", + "description": "Explicit version number for concurrency control.", + "format": "int32" + } + }, + { + "name": "version_type", + "in": "query", + "description": "Specific version type.", + "schema": { + "$ref": "#/components/schemas/VersionType" + } + } + ], + "responses": { + "200": { + "description": "Mtermvectors_Get_WithIndex 200 response" + } + }, + "x-operation-group": "mtermvectors", + "x-version-added": "1.0" + }, + "post": { + "description": "Returns multiple termvectors in one request.", + "operationId": "Mtermvectors_Post_WithIndex", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Mtermvectors_BodyParams" + } + } + } + }, + "parameters": [ + { + "name": "index", + "in": "path", + "description": "The index in which the document resides.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The index in which the document resides." + }, + "required": true + }, + { + "name": "ids", + "in": "query", + "description": "Comma-separated list of documents ids. You must define ids as parameter or set 'ids' or 'docs' in the request body.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of documents ids. You must define ids as parameter or set 'ids' or 'docs' in the request body." + }, + "explode": true + }, + { + "name": "term_statistics", + "in": "query", + "description": "Specifies if total term frequency and document frequency should be returned. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'.", + "schema": { + "type": "boolean", + "default": false, + "description": "Specifies if total term frequency and document frequency should be returned. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'." + } + }, + { + "name": "field_statistics", + "in": "query", + "description": "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'.", + "schema": { + "type": "boolean", + "default": true, + "description": "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'." + } + }, + { + "name": "fields", + "in": "query", + "description": "Comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'." + }, + "explode": true + }, + { + "name": "offsets", + "in": "query", + "description": "Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'.", + "schema": { + "type": "boolean", + "default": true, + "description": "Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'." + } + }, + { + "name": "positions", + "in": "query", + "description": "Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'.", + "schema": { + "type": "boolean", + "default": true, + "description": "Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'." + } + }, + { + "name": "payloads", + "in": "query", + "description": "Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'.", + "schema": { + "type": "boolean", + "default": true, + "description": "Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'." + } + }, + { + "name": "preference", + "in": "query", + "description": "Specify the node or shard the operation should be performed on. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'.", + "schema": { + "type": "string", + "default": "random", + "description": "Specify the node or shard the operation should be performed on. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'." + } + }, + { + "name": "routing", + "in": "query", + "description": "Routing value. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'.", + "schema": { + "type": "string", + "description": "Routing value. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'." + } + }, + { + "name": "realtime", + "in": "query", + "description": "Specifies if requests are real-time as opposed to near-real-time.", + "schema": { + "type": "boolean", + "default": true, + "description": "Specifies if requests are real-time as opposed to near-real-time." + } + }, + { + "name": "version", + "in": "query", + "description": "Explicit version number for concurrency control.", + "schema": { + "type": "integer", + "description": "Explicit version number for concurrency control.", + "format": "int32" + } + }, + { + "name": "version_type", + "in": "query", + "description": "Specific version type.", + "schema": { + "$ref": "#/components/schemas/VersionType" + } + } + ], + "responses": { + "200": { + "description": "Mtermvectors_Post_WithIndex 200 response" + } + }, + "x-operation-group": "mtermvectors", + "x-version-added": "1.0" + } + }, + "/{index}/_open": { + "post": { + "description": "Opens an index.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/index-apis/open-index/" + }, + "operationId": "IndicesOpen", + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices to open.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices to open.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "wait_for_active_shards", + "in": "query", + "description": "Sets the number of active shards to wait for before the operation returns.", + "schema": { + "type": "string", + "description": "Sets the number of active shards to wait for before the operation returns." + } + } + ], + "responses": { + "200": { + "description": "IndicesOpen 200 response" + } + }, + "x-operation-group": "indices.open", + "x-version-added": "1.0" + } + }, + "/{index}/_rank_eval": { + "get": { + "description": "Allows to evaluate the quality of ranked search results over a set of typical search queries.", + "operationId": "RankEval_Get_WithIndex", + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "search_type", + "in": "query", + "description": "Search operation type.", + "schema": { + "$ref": "#/components/schemas/SearchType" + } + } + ], + "responses": { + "200": { + "description": "RankEval_Get_WithIndex 200 response" + } + }, + "x-operation-group": "rank_eval", + "x-version-added": "1.0" + }, + "post": { + "description": "Allows to evaluate the quality of ranked search results over a set of typical search queries.", + "operationId": "RankEval_Post_WithIndex", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RankEval_BodyParams" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "search_type", + "in": "query", + "description": "Search operation type.", + "schema": { + "$ref": "#/components/schemas/SearchType" + } + } + ], + "responses": { + "200": { + "description": "RankEval_Post_WithIndex 200 response" + } + }, + "x-operation-group": "rank_eval", + "x-version-added": "1.0" + } + }, + "/{index}/_recovery": { + "get": { + "description": "Returns information about ongoing index shard recoveries.", + "operationId": "IndicesRecovery_WithIndex", + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "detailed", + "in": "query", + "description": "Whether to display detailed information about shard recovery.", + "schema": { + "type": "boolean", + "default": false, + "description": "Whether to display detailed information about shard recovery." + } + }, + { + "name": "active_only", + "in": "query", + "description": "Display only those recoveries that are currently on-going.", + "schema": { + "type": "boolean", + "default": false, + "description": "Display only those recoveries that are currently on-going." + } + } + ], + "responses": { + "200": { + "description": "IndicesRecovery_WithIndex 200 response" + } + }, + "x-operation-group": "indices.recovery", + "x-version-added": "1.0" + } + }, + "/{index}/_refresh": { + "get": { + "description": "Performs the refresh operation in one or more indices.", + "operationId": "IndicesRefresh_Get_WithIndex", + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + } + ], + "responses": { + "200": { + "description": "IndicesRefresh_Get_WithIndex 200 response" + } + }, + "x-operation-group": "indices.refresh", + "x-version-added": "1.0" + }, + "post": { + "description": "Performs the refresh operation in one or more indices.", + "operationId": "IndicesRefresh_Post_WithIndex", + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + } + ], + "responses": { + "200": { + "description": "IndicesRefresh_Post_WithIndex 200 response" + } + }, + "x-operation-group": "indices.refresh", + "x-version-added": "1.0" + } + }, + "/{index}/_search": { + "get": { + "description": "Returns results matching a query.", + "operationId": "Search_Get_WithIndex", + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "analyzer", + "in": "query", + "description": "The analyzer to use for the query string.", + "schema": { + "type": "string", + "description": "The analyzer to use for the query string." + } + }, + { + "name": "analyze_wildcard", + "in": "query", + "description": "Specify whether wildcard and prefix queries should be analyzed.", + "schema": { + "type": "boolean", + "default": false, + "description": "Specify whether wildcard and prefix queries should be analyzed." + } + }, + { + "name": "ccs_minimize_roundtrips", + "in": "query", + "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution.", + "schema": { + "type": "boolean", + "default": true, + "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution." + } + }, + { + "name": "default_operator", + "in": "query", + "description": "The default operator for query string query (AND or OR).", + "schema": { + "$ref": "#/components/schemas/DefaultOperator" + } + }, + { + "name": "df", + "in": "query", + "description": "The field to use as default where no field prefix is given in the query string.", + "schema": { + "type": "string", + "description": "The field to use as default where no field prefix is given in the query string." + } + }, + { + "name": "explain", + "in": "query", + "description": "Specify whether to return detailed information about score computation as part of a hit.", + "schema": { + "type": "boolean", + "description": "Specify whether to return detailed information about score computation as part of a hit." + } + }, + { + "name": "stored_fields", + "in": "query", + "description": "Comma-separated list of stored fields to return.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of stored fields to return." + }, + "explode": true + }, + { + "name": "docvalue_fields", + "in": "query", + "description": "Comma-separated list of fields to return as the docvalue representation of a field for each hit.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields to return as the docvalue representation of a field for each hit." + }, + "explode": true + }, + { + "name": "from", + "in": "query", + "description": "Starting offset.", + "schema": { + "type": "integer", + "default": 0, + "description": "Starting offset.", + "format": "int32" + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "ignore_throttled", + "in": "query", + "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled.", + "schema": { + "type": "boolean", + "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "lenient", + "in": "query", + "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored.", + "schema": { + "type": "boolean", + "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored." + } + }, + { + "name": "preference", + "in": "query", + "description": "Specify the node or shard the operation should be performed on.", + "schema": { + "type": "string", + "default": "random", + "description": "Specify the node or shard the operation should be performed on." + } + }, + { + "name": "q", + "in": "query", + "description": "Query in the Lucene query string syntax.", + "schema": { + "type": "string", + "description": "Query in the Lucene query string syntax." + } + }, + { + "name": "routing", + "in": "query", + "description": "Comma-separated list of specific routing values.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of specific routing values." + }, + "explode": true + }, + { + "name": "scroll", + "in": "query", + "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", + "x-data-type": "time" + } + }, + { + "name": "search_type", + "in": "query", + "description": "Search operation type.", + "schema": { + "$ref": "#/components/schemas/SearchType" + } + }, + { + "name": "size", + "in": "query", + "description": "Number of hits to return.", + "schema": { + "type": "integer", + "default": 10, + "description": "Number of hits to return.", + "format": "int32" + } + }, + { + "name": "sort", + "in": "query", + "description": "Comma-separated list of : pairs.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of : pairs." + }, + "explode": true + }, + { + "name": "_source", + "in": "query", + "description": "True or false to return the _source field or not, or a list of fields to return.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "True or false to return the _source field or not, or a list of fields to return." + }, + "explode": true + }, + { + "name": "_source_excludes", + "in": "query", + "description": "List of fields to exclude from the returned _source field.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of fields to exclude from the returned _source field." + }, + "explode": true + }, + { + "name": "_source_includes", + "in": "query", + "description": "List of fields to extract and return from the _source field.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of fields to extract and return from the _source field." + }, + "explode": true + }, + { + "name": "terminate_after", + "in": "query", + "description": "The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.", + "schema": { + "type": "integer", + "description": "The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.", + "format": "int32" + } + }, + { + "name": "stats", + "in": "query", + "description": "Specific 'tag' of the request for logging and statistical purposes.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Specific 'tag' of the request for logging and statistical purposes." + }, + "explode": true + }, + { + "name": "suggest_field", + "in": "query", + "description": "Specify which field to use for suggestions.", + "schema": { + "type": "string", + "description": "Specify which field to use for suggestions." + } + }, + { + "name": "suggest_mode", + "in": "query", + "description": "Specify suggest mode.", + "schema": { + "$ref": "#/components/schemas/SuggestMode" + } + }, + { + "name": "suggest_size", + "in": "query", + "description": "How many suggestions to return in response.", + "schema": { + "type": "integer", + "description": "How many suggestions to return in response.", + "format": "int32" + } + }, + { + "name": "suggest_text", + "in": "query", + "description": "The source text for which the suggestions should be returned.", + "schema": { + "type": "string", + "description": "The source text for which the suggestions should be returned." + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "track_scores", + "in": "query", + "description": "Whether to calculate and return scores even if they are not used for sorting.", + "schema": { + "type": "boolean", + "description": "Whether to calculate and return scores even if they are not used for sorting." + } + }, + { + "name": "track_total_hits", + "in": "query", + "description": "Indicate if the number of documents that match the query should be tracked.", + "schema": { + "type": "boolean", + "description": "Indicate if the number of documents that match the query should be tracked." + } + }, + { + "name": "allow_partial_search_results", + "in": "query", + "description": "Indicate if an error should be returned if there is a partial search failure or timeout.", + "schema": { + "type": "boolean", + "default": true, + "description": "Indicate if an error should be returned if there is a partial search failure or timeout." + } + }, + { + "name": "typed_keys", + "in": "query", + "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response.", + "schema": { + "type": "boolean", + "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response." + } + }, + { + "name": "version", + "in": "query", + "description": "Whether to return document version as part of a hit.", + "schema": { + "type": "boolean", + "description": "Whether to return document version as part of a hit." + } + }, + { + "name": "seq_no_primary_term", + "in": "query", + "description": "Specify whether to return sequence number and primary term of the last modification of each hit.", + "schema": { + "type": "boolean", + "description": "Specify whether to return sequence number and primary term of the last modification of each hit." + } + }, + { + "name": "request_cache", + "in": "query", + "description": "Specify if request cache should be used for this request or not, defaults to index level setting.", + "schema": { + "type": "boolean", + "description": "Specify if request cache should be used for this request or not, defaults to index level setting." + } + }, + { + "name": "batched_reduce_size", + "in": "query", + "description": "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.", + "schema": { + "type": "integer", + "default": 512, + "description": "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.", + "format": "int32" + } + }, + { + "name": "max_concurrent_shard_requests", + "in": "query", + "description": "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.", + "schema": { + "type": "integer", + "default": 5, + "description": "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.", + "format": "int32" + } + }, + { + "name": "pre_filter_shard_size", + "in": "query", + "description": "Threshold that enforces a pre-filter round-trip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter round-trip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint.", + "schema": { + "type": "integer", + "description": "Threshold that enforces a pre-filter round-trip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter round-trip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint.", + "format": "int32" + } + }, + { + "name": "rest_total_hits_as_int", + "in": "query", + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response.", + "schema": { + "type": "boolean", + "default": false, + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response." + } + } + ], + "responses": { + "200": { + "description": "Search_Get_WithIndex 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Search_Get_WithIndexResponseContent" + } + } + } + } + }, + "x-operation-group": "search", + "x-version-added": "1.0" + }, + "post": { + "description": "Returns results matching a query.", + "operationId": "Search_Post_WithIndex", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Search_BodyParams" + }, + "examples": { + "Search_Post_WithIndex_example1": { + "summary": "Examples for Post Search With Index Operation.", + "description": "", + "value": { + "query": { + "match_all": {} + }, + "fields": [ + "*" + ] + } + } + } + } + } + }, + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "x-data-type": "array" + }, + "required": true, + "examples": { + "Search_Post_WithIndex_example1": { + "summary": "Examples for Post Search With Index Operation.", + "description": "", + "value": "books" + } + } + }, + { + "name": "analyzer", + "in": "query", + "description": "The analyzer to use for the query string.", + "schema": { + "type": "string", + "description": "The analyzer to use for the query string." + } + }, + { + "name": "analyze_wildcard", + "in": "query", + "description": "Specify whether wildcard and prefix queries should be analyzed.", + "schema": { + "type": "boolean", + "default": false, + "description": "Specify whether wildcard and prefix queries should be analyzed." + } + }, + { + "name": "ccs_minimize_roundtrips", + "in": "query", + "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution.", + "schema": { + "type": "boolean", + "default": true, + "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution." + } + }, + { + "name": "default_operator", + "in": "query", + "description": "The default operator for query string query (AND or OR).", + "schema": { + "$ref": "#/components/schemas/DefaultOperator" + } + }, + { + "name": "df", + "in": "query", + "description": "The field to use as default where no field prefix is given in the query string.", + "schema": { + "type": "string", + "description": "The field to use as default where no field prefix is given in the query string." + } + }, + { + "name": "explain", + "in": "query", + "description": "Specify whether to return detailed information about score computation as part of a hit.", + "schema": { + "type": "boolean", + "description": "Specify whether to return detailed information about score computation as part of a hit." + } + }, + { + "name": "stored_fields", + "in": "query", + "description": "Comma-separated list of stored fields to return.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of stored fields to return." + }, + "explode": true + }, + { + "name": "docvalue_fields", + "in": "query", + "description": "Comma-separated list of fields to return as the docvalue representation of a field for each hit.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields to return as the docvalue representation of a field for each hit." + }, + "explode": true + }, + { + "name": "from", + "in": "query", + "description": "Starting offset.", + "schema": { + "type": "integer", + "default": 0, + "description": "Starting offset.", + "format": "int32" + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "ignore_throttled", + "in": "query", + "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled.", + "schema": { + "type": "boolean", + "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "lenient", + "in": "query", + "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored.", + "schema": { + "type": "boolean", + "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored." + } + }, + { + "name": "preference", + "in": "query", + "description": "Specify the node or shard the operation should be performed on.", + "schema": { + "type": "string", + "default": "random", + "description": "Specify the node or shard the operation should be performed on." + } + }, + { + "name": "q", + "in": "query", + "description": "Query in the Lucene query string syntax.", + "schema": { + "type": "string", + "description": "Query in the Lucene query string syntax." + } + }, + { + "name": "routing", + "in": "query", + "description": "Comma-separated list of specific routing values.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of specific routing values." + }, + "explode": true + }, + { + "name": "scroll", + "in": "query", + "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", + "x-data-type": "time" + }, + "examples": { + "Search_Post_WithIndex_example1": { + "summary": "Examples for Post Search With Index Operation.", + "description": "", + "value": "1d" + } + } + }, + { + "name": "search_type", + "in": "query", + "description": "Search operation type.", + "schema": { + "$ref": "#/components/schemas/SearchType" + } + }, + { + "name": "size", + "in": "query", + "description": "Number of hits to return.", + "schema": { + "type": "integer", + "default": 10, + "description": "Number of hits to return.", + "format": "int32" + } + }, + { + "name": "sort", + "in": "query", + "description": "Comma-separated list of : pairs.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of : pairs." + }, + "explode": true + }, + { + "name": "_source", + "in": "query", + "description": "True or false to return the _source field or not, or a list of fields to return.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "True or false to return the _source field or not, or a list of fields to return." + }, + "explode": true + }, + { + "name": "_source_excludes", + "in": "query", + "description": "List of fields to exclude from the returned _source field.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of fields to exclude from the returned _source field." + }, + "explode": true + }, + { + "name": "_source_includes", + "in": "query", + "description": "List of fields to extract and return from the _source field.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of fields to extract and return from the _source field." + }, + "explode": true + }, + { + "name": "terminate_after", + "in": "query", + "description": "The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.", + "schema": { + "type": "integer", + "description": "The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.", + "format": "int32" + } + }, + { + "name": "stats", + "in": "query", + "description": "Specific 'tag' of the request for logging and statistical purposes.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Specific 'tag' of the request for logging and statistical purposes." + }, + "explode": true + }, + { + "name": "suggest_field", + "in": "query", + "description": "Specify which field to use for suggestions.", + "schema": { + "type": "string", + "description": "Specify which field to use for suggestions." + } + }, + { + "name": "suggest_mode", + "in": "query", + "description": "Specify suggest mode.", + "schema": { + "$ref": "#/components/schemas/SuggestMode" + } + }, + { + "name": "suggest_size", + "in": "query", + "description": "How many suggestions to return in response.", + "schema": { + "type": "integer", + "description": "How many suggestions to return in response.", + "format": "int32" + } + }, + { + "name": "suggest_text", + "in": "query", + "description": "The source text for which the suggestions should be returned.", + "schema": { + "type": "string", + "description": "The source text for which the suggestions should be returned." + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "track_scores", + "in": "query", + "description": "Whether to calculate and return scores even if they are not used for sorting.", + "schema": { + "type": "boolean", + "description": "Whether to calculate and return scores even if they are not used for sorting." + } + }, + { + "name": "track_total_hits", + "in": "query", + "description": "Indicate if the number of documents that match the query should be tracked.", + "schema": { + "type": "boolean", + "description": "Indicate if the number of documents that match the query should be tracked." + } + }, + { + "name": "allow_partial_search_results", + "in": "query", + "description": "Indicate if an error should be returned if there is a partial search failure or timeout.", + "schema": { + "type": "boolean", + "default": true, + "description": "Indicate if an error should be returned if there is a partial search failure or timeout." + } + }, + { + "name": "typed_keys", + "in": "query", + "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response.", + "schema": { + "type": "boolean", + "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response." + } + }, + { + "name": "version", + "in": "query", + "description": "Whether to return document version as part of a hit.", + "schema": { + "type": "boolean", + "description": "Whether to return document version as part of a hit." + } + }, + { + "name": "seq_no_primary_term", + "in": "query", + "description": "Specify whether to return sequence number and primary term of the last modification of each hit.", + "schema": { + "type": "boolean", + "description": "Specify whether to return sequence number and primary term of the last modification of each hit." + } + }, + { + "name": "request_cache", + "in": "query", + "description": "Specify if request cache should be used for this request or not, defaults to index level setting.", + "schema": { + "type": "boolean", + "description": "Specify if request cache should be used for this request or not, defaults to index level setting." + } + }, + { + "name": "batched_reduce_size", + "in": "query", + "description": "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.", + "schema": { + "type": "integer", + "default": 512, + "description": "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.", + "format": "int32" + } + }, + { + "name": "max_concurrent_shard_requests", + "in": "query", + "description": "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.", + "schema": { + "type": "integer", + "default": 5, + "description": "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.", + "format": "int32" + } + }, + { + "name": "pre_filter_shard_size", + "in": "query", + "description": "Threshold that enforces a pre-filter round-trip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter round-trip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint.", + "schema": { + "type": "integer", + "description": "Threshold that enforces a pre-filter round-trip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter round-trip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint.", + "format": "int32" + } + }, + { + "name": "rest_total_hits_as_int", + "in": "query", + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response.", + "schema": { + "type": "boolean", + "default": false, + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response." + } + } + ], + "responses": { + "200": { + "description": "Search_Post_WithIndex 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Search_Post_WithIndexResponseContent" + }, + "examples": { + "Search_Post_WithIndex_example1": { + "summary": "Examples for Post Search With Index Operation.", + "description": "", + "value": { + "timed_out": false, + "_shards": { + "total": 1, + "successful": 1, + "skipped": 0, + "failed": 0 + }, + "hits": { + "total": { + "value": 0, + "relation": "eq" + }, + "hits": [] + } + } + } + } + } + } + } + }, + "x-operation-group": "search", + "x-version-added": "1.0" + } + }, + "/{index}/_search/point_in_time": { + "post": { + "description": "Creates point in time context.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/search-plugins/point-in-time-api/#create-a-pit" + }, + "operationId": "CreatePit", + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "allow_partial_pit_creation", + "in": "query", + "description": "Allow if point in time can be created with partial failures.", + "schema": { + "type": "boolean", + "description": "Allow if point in time can be created with partial failures." + } + }, + { + "name": "keep_alive", + "in": "query", + "description": "Specify the keep alive for point in time.", + "schema": { + "type": "string", + "description": "Specify the keep alive for point in time.", + "x-data-type": "time" + } + }, + { + "name": "preference", + "in": "query", + "description": "Specify the node or shard the operation should be performed on.", + "schema": { + "type": "string", + "default": "random", + "description": "Specify the node or shard the operation should be performed on." + } + }, + { + "name": "routing", + "in": "query", + "description": "Comma-separated list of specific routing values.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of specific routing values." + }, + "explode": true + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + } + ], + "responses": { + "200": { + "description": "CreatePit 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreatePitResponseContent" + } + } + } + } + }, + "x-operation-group": "create_pit", + "x-version-added": "2.4" + } + }, + "/{index}/_search/template": { + "get": { + "description": "Allows to use the Mustache language to pre-render a search definition.", + "operationId": "SearchTemplate_Get_WithIndex", + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "ignore_throttled", + "in": "query", + "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled.", + "schema": { + "type": "boolean", + "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "preference", + "in": "query", + "description": "Specify the node or shard the operation should be performed on.", + "schema": { + "type": "string", + "default": "random", + "description": "Specify the node or shard the operation should be performed on." + } + }, + { + "name": "routing", + "in": "query", + "description": "Comma-separated list of specific routing values.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of specific routing values." + }, + "explode": true + }, + { + "name": "scroll", + "in": "query", + "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", + "x-data-type": "time" + } + }, + { + "name": "search_type", + "in": "query", + "description": "Search operation type.", + "schema": { + "$ref": "#/components/schemas/SearchTypeMulti" + } + }, + { + "name": "explain", + "in": "query", + "description": "Specify whether to return detailed information about score computation as part of a hit.", + "schema": { + "type": "boolean", + "description": "Specify whether to return detailed information about score computation as part of a hit." + } + }, + { + "name": "profile", + "in": "query", + "description": "Specify whether to profile the query execution.", + "schema": { + "type": "boolean", + "description": "Specify whether to profile the query execution." + } + }, + { + "name": "typed_keys", + "in": "query", + "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response.", + "schema": { + "type": "boolean", + "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response." + } + }, + { + "name": "rest_total_hits_as_int", + "in": "query", + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response.", + "schema": { + "type": "boolean", + "default": false, + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response." + } + }, + { + "name": "ccs_minimize_roundtrips", + "in": "query", + "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution.", + "schema": { + "type": "boolean", + "default": true, + "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution." + } + } + ], + "responses": { + "200": { + "description": "SearchTemplate_Get_WithIndex 200 response" + } + }, + "x-operation-group": "search_template", + "x-version-added": "1.0" + }, + "post": { + "description": "Allows to use the Mustache language to pre-render a search definition.", + "operationId": "SearchTemplate_Post_WithIndex", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchTemplate_BodyParams" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "ignore_throttled", + "in": "query", + "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled.", + "schema": { + "type": "boolean", + "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "preference", + "in": "query", + "description": "Specify the node or shard the operation should be performed on.", + "schema": { + "type": "string", + "default": "random", + "description": "Specify the node or shard the operation should be performed on." + } + }, + { + "name": "routing", + "in": "query", + "description": "Comma-separated list of specific routing values.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of specific routing values." + }, + "explode": true + }, + { + "name": "scroll", + "in": "query", + "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", + "x-data-type": "time" + } + }, + { + "name": "search_type", + "in": "query", + "description": "Search operation type.", + "schema": { + "$ref": "#/components/schemas/SearchTypeMulti" + } + }, + { + "name": "explain", + "in": "query", + "description": "Specify whether to return detailed information about score computation as part of a hit.", + "schema": { + "type": "boolean", + "description": "Specify whether to return detailed information about score computation as part of a hit." + } + }, + { + "name": "profile", + "in": "query", + "description": "Specify whether to profile the query execution.", + "schema": { + "type": "boolean", + "description": "Specify whether to profile the query execution." + } + }, + { + "name": "typed_keys", + "in": "query", + "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response.", + "schema": { + "type": "boolean", + "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response." + } + }, + { + "name": "rest_total_hits_as_int", + "in": "query", + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response.", + "schema": { + "type": "boolean", + "default": false, + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response." + } + }, + { + "name": "ccs_minimize_roundtrips", + "in": "query", + "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution.", + "schema": { + "type": "boolean", + "default": true, + "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution." + } + } + ], + "responses": { + "200": { + "description": "SearchTemplate_Post_WithIndex 200 response" + } + }, + "x-operation-group": "search_template", + "x-version-added": "1.0" + } + }, + "/{index}/_search_shards": { + "get": { + "description": "Returns information about the indices and shards that a search request would be executed against.", + "operationId": "SearchShards_Get_WithIndex", + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "preference", + "in": "query", + "description": "Specify the node or shard the operation should be performed on.", + "schema": { + "type": "string", + "default": "random", + "description": "Specify the node or shard the operation should be performed on." + } + }, + { + "name": "routing", + "in": "query", + "description": "Routing value.", + "schema": { + "type": "string", + "description": "Routing value." + } + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + } + ], + "responses": { + "200": { + "description": "SearchShards_Get_WithIndex 200 response" + } + }, + "x-operation-group": "search_shards", + "x-version-added": "1.0" + }, + "post": { + "description": "Returns information about the indices and shards that a search request would be executed against.", + "operationId": "SearchShards_Post_WithIndex", + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "preference", + "in": "query", + "description": "Specify the node or shard the operation should be performed on.", + "schema": { + "type": "string", + "default": "random", + "description": "Specify the node or shard the operation should be performed on." + } + }, + { + "name": "routing", + "in": "query", + "description": "Routing value.", + "schema": { + "type": "string", + "description": "Routing value." + } + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + } + ], + "responses": { + "200": { + "description": "SearchShards_Post_WithIndex 200 response" + } + }, + "x-operation-group": "search_shards", + "x-version-added": "1.0" + } + }, + "/{index}/_segments": { + "get": { + "description": "Provides low-level information about segments in a Lucene index.", + "operationId": "IndicesSegments_WithIndex", + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "verbose", + "in": "query", + "description": "Includes detailed memory usage by Lucene.", + "schema": { + "type": "boolean", + "default": false, + "description": "Includes detailed memory usage by Lucene." + } + } + ], + "responses": { + "200": { + "description": "IndicesSegments_WithIndex 200 response" + } + }, + "x-operation-group": "indices.segments", + "x-version-added": "1.0" + } + }, + "/{index}/_settings": { + "get": { + "description": "Returns settings for one or more indices.", + "operationId": "IndicesGetSettings_WithIndex", + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "x-data-type": "array" + }, + "required": true, + "examples": { + "IndicesGetSettings_WithIndex_example1": { + "summary": "Examples for Get settings Index Operation.", + "description": "", + "value": "books" + } + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "flat_settings", + "in": "query", + "description": "Return settings in flat format.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return settings in flat format." + } + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + }, + { + "name": "include_defaults", + "in": "query", + "description": "Whether to return all default setting for each of the indices.", + "schema": { + "type": "boolean", + "default": false, + "description": "Whether to return all default setting for each of the indices." + } + } + ], + "responses": { + "200": { + "description": "IndicesGetSettings_WithIndex 200 response" + } + }, + "x-operation-group": "indices.get_settings", + "x-version-added": "1.0" + }, + "put": { + "description": "Updates the index settings.", + "operationId": "IndicesPutSettings_WithIndex", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndicesPutSettings_BodyParams" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "preserve_existing", + "in": "query", + "description": "Whether to update existing settings. If set to `true` existing settings on an index remain unchanged.", + "schema": { + "type": "boolean", + "default": false, + "description": "Whether to update existing settings. If set to `true` existing settings on an index remain unchanged." + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "flat_settings", + "in": "query", + "description": "Return settings in flat format.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return settings in flat format." + } + } + ], + "responses": { + "200": { + "description": "IndicesPutSettings_WithIndex 200 response" + } + }, + "x-operation-group": "indices.put_settings", + "x-version-added": "1.0" + } + }, + "/{index}/_settings/{name}": { + "get": { + "description": "Returns settings for one or more indices.", + "operationId": "IndicesGetSettings_WithIndexName", + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "x-data-type": "array" + }, + "required": true, + "examples": { + "IndicesGetSettings_WithIndexName_example1": { + "summary": "Examples for Get settings Index-setting Operation.", + "description": "", + "value": "books" + } + } + }, + { + "name": "name", + "in": "path", + "description": "Comma-separated list of settings.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of settings.", + "x-data-type": "array" + }, + "required": true, + "examples": { + "IndicesGetSettings_WithIndexName_example1": { + "summary": "Examples for Get settings Index-setting Operation.", + "description": "", + "value": "index" + } + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "flat_settings", + "in": "query", + "description": "Return settings in flat format.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return settings in flat format." + } + }, + { + "name": "local", + "in": "query", + "description": "Return local information, do not retrieve the state from cluster-manager node.", + "schema": { + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } + }, + { + "name": "include_defaults", + "in": "query", + "description": "Whether to return all default setting for each of the indices.", + "schema": { + "type": "boolean", + "default": false, + "description": "Whether to return all default setting for each of the indices." + } + } + ], + "responses": { + "200": { + "description": "IndicesGetSettings_WithIndexName 200 response" + } + }, + "x-operation-group": "indices.get_settings", + "x-version-added": "1.0" + } + }, + "/{index}/_shard_stores": { + "get": { + "description": "Provides store information for shard copies of indices.", + "operationId": "IndicesShardStores_WithIndex", + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "status", + "in": "query", + "description": "Comma-separated list of statuses used to filter on shards to get store information for.", + "style": "form", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Status_Member" + }, + "description": "Comma-separated list of statuses used to filter on shards to get store information for." + }, + "explode": true + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + } + ], + "responses": { + "200": { + "description": "IndicesShardStores_WithIndex 200 response" + } + }, + "x-operation-group": "indices.shard_stores", + "x-version-added": "1.0" + } + }, + "/{index}/_shrink/{target}": { + "post": { + "description": "Allow to shrink an existing index into a new index with fewer primary shards.", + "operationId": "IndicesShrink_Post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndicesShrink_BodyParams" + } + } + } + }, + "parameters": [ + { + "name": "index", + "in": "path", + "description": "The name of the source index to shrink.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the source index to shrink." + }, + "required": true + }, + { + "name": "target", + "in": "path", + "description": "The name of the target index.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the target index." + }, + "required": true + }, + { + "name": "copy_settings", + "in": "query", + "description": "whether or not to copy settings from the source index.", + "schema": { + "type": "boolean", + "default": false, + "description": "whether or not to copy settings from the source index." + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "wait_for_active_shards", + "in": "query", + "description": "Set the number of active shards to wait for on the shrunken index before the operation returns.", + "schema": { + "type": "string", + "description": "Set the number of active shards to wait for on the shrunken index before the operation returns." + } + } + ], + "responses": { + "200": { + "description": "IndicesShrink_Post 200 response" + } + }, + "x-operation-group": "indices.shrink", + "x-version-added": "1.0" + }, + "put": { + "description": "Allow to shrink an existing index into a new index with fewer primary shards.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/index-apis/shrink-index/" + }, + "operationId": "IndicesShrink_Put", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndicesShrink_BodyParams" + } + } + } + }, + "parameters": [ + { + "name": "index", + "in": "path", + "description": "The name of the source index to shrink.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the source index to shrink." + }, + "required": true + }, + { + "name": "target", + "in": "path", + "description": "The name of the target index.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the target index." + }, + "required": true + }, + { + "name": "copy_settings", + "in": "query", + "description": "whether or not to copy settings from the source index.", + "schema": { + "type": "boolean", + "default": false, + "description": "whether or not to copy settings from the source index." + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "wait_for_active_shards", + "in": "query", + "description": "Set the number of active shards to wait for on the shrunken index before the operation returns.", + "schema": { + "type": "string", + "description": "Set the number of active shards to wait for on the shrunken index before the operation returns." + } + } + ], + "responses": { + "200": { + "description": "IndicesShrink_Put 200 response" + } + }, + "x-operation-group": "indices.shrink", + "x-version-added": "1.0" + } + }, + "/{index}/_source/{id}": { + "get": { + "description": "Returns the source of a document.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/document-apis/get-documents/" + }, + "operationId": "GetSource", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Document ID.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Document ID." + }, + "required": true, + "examples": { + "GetSource_example1": { + "summary": "Examples for Get document source Operation.", + "description": "", + "value": "1" + } + } + }, + { + "name": "index", + "in": "path", + "description": "Index name.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Index name." + }, + "required": true, + "examples": { + "GetSource_example1": { + "summary": "Examples for Get document source Operation.", + "description": "", + "value": "books" + } + } + }, + { + "name": "preference", + "in": "query", + "description": "Specify the node or shard the operation should be performed on.", + "schema": { + "type": "string", + "default": "random", + "description": "Specify the node or shard the operation should be performed on." + } + }, + { + "name": "realtime", + "in": "query", + "description": "Specify whether to perform the operation in realtime or search mode.", + "schema": { + "type": "boolean", + "description": "Specify whether to perform the operation in realtime or search mode." + } + }, + { + "name": "refresh", + "in": "query", + "description": "Refresh the shard containing the document before performing the operation.", + "schema": { + "type": "boolean", + "description": "Refresh the shard containing the document before performing the operation." + } + }, + { + "name": "routing", + "in": "query", + "description": "Routing value.", + "schema": { + "type": "string", + "description": "Routing value." + } + }, + { + "name": "_source", + "in": "query", + "description": "True or false to return the _source field or not, or a list of fields to return.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "True or false to return the _source field or not, or a list of fields to return." + }, + "explode": true + }, + { + "name": "_source_excludes", + "in": "query", + "description": "List of fields to exclude from the returned _source field.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of fields to exclude from the returned _source field." + }, + "explode": true + }, + { + "name": "_source_includes", + "in": "query", + "description": "List of fields to extract and return from the _source field.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of fields to extract and return from the _source field." + }, + "explode": true + }, + { + "name": "version", + "in": "query", + "description": "Explicit version number for concurrency control.", + "schema": { + "type": "integer", + "description": "Explicit version number for concurrency control.", + "format": "int32" + } + }, + { + "name": "version_type", + "in": "query", + "description": "Specific version type.", + "schema": { + "$ref": "#/components/schemas/VersionType" + } + } + ], + "responses": { + "200": { + "description": "GetSource 200 response" + } + }, + "x-operation-group": "get_source", + "x-version-added": "1.0" + }, + "head": { + "description": "Returns information about whether a document source exists in an index.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/document-apis/get-documents/" + }, + "operationId": "ExistsSource", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Document ID.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Document ID." + }, + "required": true + }, + { + "name": "index", + "in": "path", + "description": "Index name.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Index name." + }, + "required": true + }, + { + "name": "preference", + "in": "query", + "description": "Specify the node or shard the operation should be performed on.", + "schema": { + "type": "string", + "default": "random", + "description": "Specify the node or shard the operation should be performed on." + } + }, + { + "name": "realtime", + "in": "query", + "description": "Specify whether to perform the operation in realtime or search mode.", + "schema": { + "type": "boolean", + "description": "Specify whether to perform the operation in realtime or search mode." + } + }, + { + "name": "refresh", + "in": "query", + "description": "Refresh the shard containing the document before performing the operation.", + "schema": { + "type": "boolean", + "description": "Refresh the shard containing the document before performing the operation." + } + }, + { + "name": "routing", + "in": "query", + "description": "Routing value.", + "schema": { + "type": "string", + "description": "Routing value." + } + }, + { + "name": "_source", + "in": "query", + "description": "True or false to return the _source field or not, or a list of fields to return.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "True or false to return the _source field or not, or a list of fields to return." + }, + "explode": true + }, + { + "name": "_source_excludes", + "in": "query", + "description": "List of fields to exclude from the returned _source field.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of fields to exclude from the returned _source field." + }, + "explode": true + }, + { + "name": "_source_includes", + "in": "query", + "description": "List of fields to extract and return from the _source field.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of fields to extract and return from the _source field." + }, + "explode": true + }, + { + "name": "version", + "in": "query", + "description": "Explicit version number for concurrency control.", + "schema": { + "type": "integer", + "description": "Explicit version number for concurrency control.", + "format": "int32" + } + }, + { + "name": "version_type", + "in": "query", + "description": "Specific version type.", + "schema": { + "$ref": "#/components/schemas/VersionType" + } + } + ], + "responses": { + "200": { + "description": "ExistsSource 200 response" + } + }, + "x-operation-group": "exists_source", + "x-version-added": "1.0" + } + }, + "/{index}/_split/{target}": { + "post": { + "description": "Allows you to split an existing index into a new index with more primary shards.", + "operationId": "IndicesSplit_Post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndicesSplit_BodyParams" + } + } + } + }, + "parameters": [ + { + "name": "index", + "in": "path", + "description": "The name of the source index to split.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the source index to split." + }, + "required": true + }, + { + "name": "target", + "in": "path", + "description": "The name of the target index.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the target index." + }, + "required": true + }, + { + "name": "copy_settings", + "in": "query", + "description": "whether or not to copy settings from the source index.", + "schema": { + "type": "boolean", + "default": false, + "description": "whether or not to copy settings from the source index." + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "wait_for_active_shards", + "in": "query", + "description": "Set the number of active shards to wait for on the shrunken index before the operation returns.", + "schema": { + "type": "string", + "description": "Set the number of active shards to wait for on the shrunken index before the operation returns." + } + } + ], + "responses": { + "200": { + "description": "IndicesSplit_Post 200 response" + } + }, + "x-operation-group": "indices.split", + "x-version-added": "1.0" + }, + "put": { + "description": "Allows you to split an existing index into a new index with more primary shards.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/index-apis/split/" + }, + "operationId": "IndicesSplit_Put", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndicesSplit_BodyParams" + } + } + } + }, + "parameters": [ + { + "name": "index", + "in": "path", + "description": "The name of the source index to split.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the source index to split." + }, + "required": true + }, + { + "name": "target", + "in": "path", + "description": "The name of the target index.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the target index." + }, + "required": true + }, + { + "name": "copy_settings", + "in": "query", + "description": "whether or not to copy settings from the source index.", + "schema": { + "type": "boolean", + "default": false, + "description": "whether or not to copy settings from the source index." + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to master node.", + "x-version-deprecated": "2.0.0", + "x-data-type": "time", + "x-deprecation-message": "To promote inclusive language, use 'cluster_manager_timeout' instead.", + "deprecated": true + } + }, + { + "name": "cluster_manager_timeout", + "in": "query", + "description": "Operation timeout for connection to cluster-manager node.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-version-added": "2.0.0", + "x-data-type": "time" + } + }, + { + "name": "wait_for_active_shards", + "in": "query", + "description": "Set the number of active shards to wait for on the shrunken index before the operation returns.", + "schema": { + "type": "string", + "description": "Set the number of active shards to wait for on the shrunken index before the operation returns." + } + } + ], + "responses": { + "200": { + "description": "IndicesSplit_Put 200 response" + } + }, + "x-operation-group": "indices.split", + "x-version-added": "1.0" + } + }, + "/{index}/_stats": { + "get": { + "description": "Provides statistics on operations happening in an index.", + "operationId": "IndicesStats_WithIndex", + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "completion_fields", + "in": "query", + "description": "Comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards).", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards)." + }, + "explode": true + }, + { + "name": "fielddata_fields", + "in": "query", + "description": "Comma-separated list of fields for `fielddata` index metric (supports wildcards).", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields for `fielddata` index metric (supports wildcards)." + }, + "explode": true + }, + { + "name": "fields", + "in": "query", + "description": "Comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards).", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards)." + }, + "explode": true + }, + { + "name": "groups", + "in": "query", + "description": "Comma-separated list of search groups for `search` index metric.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of search groups for `search` index metric." + }, + "explode": true + }, + { + "name": "level", + "in": "query", + "description": "Return stats aggregated at cluster, index or shard level.", + "schema": { + "$ref": "#/components/schemas/IndiciesStatLevel" + } + }, + { + "name": "include_segment_file_sizes", + "in": "query", + "description": "Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested).", + "schema": { + "type": "boolean", + "default": false, + "description": "Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested)." + } + }, + { + "name": "include_unloaded_segments", + "in": "query", + "description": "If set to true segment stats will include stats for segments that are not currently loaded into memory.", + "schema": { + "type": "boolean", + "default": false, + "description": "If set to true segment stats will include stats for segments that are not currently loaded into memory." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "forbid_closed_indices", + "in": "query", + "description": "If set to false stats will also collected from closed indices if explicitly specified or if expand_wildcards expands to closed indices.", + "schema": { + "type": "boolean", + "default": true, + "description": "If set to false stats will also collected from closed indices if explicitly specified or if expand_wildcards expands to closed indices." + } + } + ], + "responses": { + "200": { + "description": "IndicesStats_WithIndex 200 response" + } + }, + "x-operation-group": "indices.stats", + "x-version-added": "1.0" + } + }, + "/{index}/_stats/{metric}": { + "get": { + "description": "Provides statistics on operations happening in an index.", + "operationId": "IndicesStats_WithIndexMetric", + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "metric", + "in": "path", + "description": "Limit the information returned the specific metrics.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Limit the information returned the specific metrics.", + "x-enum-options": [ + "_all", + "store", + "indexing", + "get", + "search", + "merge", + "flush", + "refresh", + "query_cache", + "fielddata", + "docs", + "warmer", + "completion", + "segments", + "translog", + "suggest", + "request_cache", + "recovery" + ], + "x-data-type": "array" + }, + "required": true + }, + { + "name": "completion_fields", + "in": "query", + "description": "Comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards).", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards)." + }, + "explode": true + }, + { + "name": "fielddata_fields", + "in": "query", + "description": "Comma-separated list of fields for `fielddata` index metric (supports wildcards).", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields for `fielddata` index metric (supports wildcards)." + }, + "explode": true + }, + { + "name": "fields", + "in": "query", + "description": "Comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards).", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards)." + }, + "explode": true + }, + { + "name": "groups", + "in": "query", + "description": "Comma-separated list of search groups for `search` index metric.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of search groups for `search` index metric." + }, + "explode": true + }, + { + "name": "level", + "in": "query", + "description": "Return stats aggregated at cluster, index or shard level.", + "schema": { + "$ref": "#/components/schemas/IndiciesStatLevel" + } + }, + { + "name": "include_segment_file_sizes", + "in": "query", + "description": "Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested).", + "schema": { + "type": "boolean", + "default": false, + "description": "Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested)." + } + }, + { + "name": "include_unloaded_segments", + "in": "query", + "description": "If set to true segment stats will include stats for segments that are not currently loaded into memory.", + "schema": { + "type": "boolean", + "default": false, + "description": "If set to true segment stats will include stats for segments that are not currently loaded into memory." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "forbid_closed_indices", + "in": "query", + "description": "If set to false stats will also collected from closed indices if explicitly specified or if expand_wildcards expands to closed indices.", + "schema": { + "type": "boolean", + "default": true, + "description": "If set to false stats will also collected from closed indices if explicitly specified or if expand_wildcards expands to closed indices." + } + } + ], + "responses": { + "200": { + "description": "IndicesStats_WithIndexMetric 200 response" + } + }, + "x-operation-group": "indices.stats", + "x-version-added": "1.0" + } + }, + "/{index}/_termvectors": { + "get": { + "description": "Returns information and statistics about terms in the fields of a particular document.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest" + }, + "operationId": "Termvectors_Get", + "parameters": [ + { + "name": "index", + "in": "path", + "description": "The index in which the document resides.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The index in which the document resides." + }, + "required": true + }, + { + "name": "term_statistics", + "in": "query", + "description": "Specifies if total term frequency and document frequency should be returned.", + "schema": { + "type": "boolean", + "default": false, + "description": "Specifies if total term frequency and document frequency should be returned." + } + }, + { + "name": "field_statistics", + "in": "query", + "description": "Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned.", + "schema": { + "type": "boolean", + "default": true, + "description": "Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned." + } + }, + { + "name": "fields", + "in": "query", + "description": "Comma-separated list of fields to return.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields to return." + }, + "explode": true + }, + { + "name": "offsets", + "in": "query", + "description": "Specifies if term offsets should be returned.", + "schema": { + "type": "boolean", + "default": true, + "description": "Specifies if term offsets should be returned." + } + }, + { + "name": "positions", + "in": "query", + "description": "Specifies if term positions should be returned.", + "schema": { + "type": "boolean", + "default": true, + "description": "Specifies if term positions should be returned." + } + }, + { + "name": "payloads", + "in": "query", + "description": "Specifies if term payloads should be returned.", + "schema": { + "type": "boolean", + "default": true, + "description": "Specifies if term payloads should be returned." + } + }, + { + "name": "preference", + "in": "query", + "description": "Specify the node or shard the operation should be performed on.", + "schema": { + "type": "string", + "default": "random", + "description": "Specify the node or shard the operation should be performed on." + } + }, + { + "name": "routing", + "in": "query", + "description": "Routing value.", + "schema": { + "type": "string", + "description": "Routing value." + } + }, + { + "name": "realtime", + "in": "query", + "description": "Specifies if request is real-time as opposed to near-real-time.", + "schema": { + "type": "boolean", + "default": true, + "description": "Specifies if request is real-time as opposed to near-real-time." + } + }, + { + "name": "version", + "in": "query", + "description": "Explicit version number for concurrency control.", + "schema": { + "type": "integer", + "description": "Explicit version number for concurrency control.", + "format": "int32" + } + }, + { + "name": "version_type", + "in": "query", + "description": "Specific version type.", + "schema": { + "$ref": "#/components/schemas/VersionType" + } + } + ], + "responses": { + "200": { + "description": "Termvectors_Get 200 response" + } + }, + "x-operation-group": "termvectors", + "x-version-added": "1.0" + }, + "post": { + "description": "Returns information and statistics about terms in the fields of a particular document.", + "operationId": "Termvectors_Post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Termvectors_BodyParams" + } + } + } + }, + "parameters": [ + { + "name": "index", + "in": "path", + "description": "The index in which the document resides.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The index in which the document resides." + }, + "required": true + }, + { + "name": "term_statistics", + "in": "query", + "description": "Specifies if total term frequency and document frequency should be returned.", + "schema": { + "type": "boolean", + "default": false, + "description": "Specifies if total term frequency and document frequency should be returned." + } + }, + { + "name": "field_statistics", + "in": "query", + "description": "Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned.", + "schema": { + "type": "boolean", + "default": true, + "description": "Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned." + } + }, + { + "name": "fields", + "in": "query", + "description": "Comma-separated list of fields to return.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields to return." + }, + "explode": true + }, + { + "name": "offsets", + "in": "query", + "description": "Specifies if term offsets should be returned.", + "schema": { + "type": "boolean", + "default": true, + "description": "Specifies if term offsets should be returned." + } + }, + { + "name": "positions", + "in": "query", + "description": "Specifies if term positions should be returned.", + "schema": { + "type": "boolean", + "default": true, + "description": "Specifies if term positions should be returned." + } + }, + { + "name": "payloads", + "in": "query", + "description": "Specifies if term payloads should be returned.", + "schema": { + "type": "boolean", + "default": true, + "description": "Specifies if term payloads should be returned." + } + }, + { + "name": "preference", + "in": "query", + "description": "Specify the node or shard the operation should be performed on.", + "schema": { + "type": "string", + "default": "random", + "description": "Specify the node or shard the operation should be performed on." + } + }, + { + "name": "routing", + "in": "query", + "description": "Routing value.", + "schema": { + "type": "string", + "description": "Routing value." + } + }, + { + "name": "realtime", + "in": "query", + "description": "Specifies if request is real-time as opposed to near-real-time.", + "schema": { + "type": "boolean", + "default": true, + "description": "Specifies if request is real-time as opposed to near-real-time." + } + }, + { + "name": "version", + "in": "query", + "description": "Explicit version number for concurrency control.", + "schema": { + "type": "integer", + "description": "Explicit version number for concurrency control.", + "format": "int32" + } + }, + { + "name": "version_type", + "in": "query", + "description": "Specific version type.", + "schema": { + "$ref": "#/components/schemas/VersionType" + } + } + ], + "responses": { + "200": { + "description": "Termvectors_Post 200 response" + } + }, + "x-operation-group": "termvectors", + "x-version-added": "1.0" + } + }, + "/{index}/_termvectors/{id}": { + "get": { + "description": "Returns information and statistics about terms in the fields of a particular document.", + "operationId": "Termvectors_Get_WithId", + "parameters": [ + { + "name": "index", + "in": "path", + "description": "The index in which the document resides.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The index in which the document resides." + }, + "required": true + }, + { + "name": "id", + "in": "path", + "description": "Document ID. When not specified a doc param should be supplied.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Document ID. When not specified a doc param should be supplied." + }, + "required": true + }, + { + "name": "term_statistics", + "in": "query", + "description": "Specifies if total term frequency and document frequency should be returned.", + "schema": { + "type": "boolean", + "default": false, + "description": "Specifies if total term frequency and document frequency should be returned." + } + }, + { + "name": "field_statistics", + "in": "query", + "description": "Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned.", + "schema": { + "type": "boolean", + "default": true, + "description": "Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned." + } + }, + { + "name": "fields", + "in": "query", + "description": "Comma-separated list of fields to return.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields to return." + }, + "explode": true + }, + { + "name": "offsets", + "in": "query", + "description": "Specifies if term offsets should be returned.", + "schema": { + "type": "boolean", + "default": true, + "description": "Specifies if term offsets should be returned." + } + }, + { + "name": "positions", + "in": "query", + "description": "Specifies if term positions should be returned.", + "schema": { + "type": "boolean", + "default": true, + "description": "Specifies if term positions should be returned." + } + }, + { + "name": "payloads", + "in": "query", + "description": "Specifies if term payloads should be returned.", + "schema": { + "type": "boolean", + "default": true, + "description": "Specifies if term payloads should be returned." + } + }, + { + "name": "preference", + "in": "query", + "description": "Specify the node or shard the operation should be performed on.", + "schema": { + "type": "string", + "default": "random", + "description": "Specify the node or shard the operation should be performed on." + } + }, + { + "name": "routing", + "in": "query", + "description": "Routing value.", + "schema": { + "type": "string", + "description": "Routing value." + } + }, + { + "name": "realtime", + "in": "query", + "description": "Specifies if request is real-time as opposed to near-real-time.", + "schema": { + "type": "boolean", + "default": true, + "description": "Specifies if request is real-time as opposed to near-real-time." + } + }, + { + "name": "version", + "in": "query", + "description": "Explicit version number for concurrency control.", + "schema": { + "type": "integer", + "description": "Explicit version number for concurrency control.", + "format": "int32" + } + }, + { + "name": "version_type", + "in": "query", + "description": "Specific version type.", + "schema": { + "$ref": "#/components/schemas/VersionType" + } + } + ], + "responses": { + "200": { + "description": "Termvectors_Get_WithId 200 response" + } + }, + "x-operation-group": "termvectors", + "x-version-added": "1.0" + }, + "post": { + "description": "Returns information and statistics about terms in the fields of a particular document.", + "operationId": "Termvectors_Post_WithId", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Termvectors_BodyParams" + } + } + } + }, + "parameters": [ + { + "name": "index", + "in": "path", + "description": "The index in which the document resides.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The index in which the document resides." + }, + "required": true + }, + { + "name": "id", + "in": "path", + "description": "Document ID. When not specified a doc param should be supplied.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Document ID. When not specified a doc param should be supplied." + }, + "required": true + }, + { + "name": "term_statistics", + "in": "query", + "description": "Specifies if total term frequency and document frequency should be returned.", + "schema": { + "type": "boolean", + "default": false, + "description": "Specifies if total term frequency and document frequency should be returned." + } + }, + { + "name": "field_statistics", + "in": "query", + "description": "Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned.", + "schema": { + "type": "boolean", + "default": true, + "description": "Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned." + } + }, + { + "name": "fields", + "in": "query", + "description": "Comma-separated list of fields to return.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields to return." + }, + "explode": true + }, + { + "name": "offsets", + "in": "query", + "description": "Specifies if term offsets should be returned.", + "schema": { + "type": "boolean", + "default": true, + "description": "Specifies if term offsets should be returned." + } + }, + { + "name": "positions", + "in": "query", + "description": "Specifies if term positions should be returned.", + "schema": { + "type": "boolean", + "default": true, + "description": "Specifies if term positions should be returned." + } + }, + { + "name": "payloads", + "in": "query", + "description": "Specifies if term payloads should be returned.", + "schema": { + "type": "boolean", + "default": true, + "description": "Specifies if term payloads should be returned." + } + }, + { + "name": "preference", + "in": "query", + "description": "Specify the node or shard the operation should be performed on.", + "schema": { + "type": "string", + "default": "random", + "description": "Specify the node or shard the operation should be performed on." + } + }, + { + "name": "routing", + "in": "query", + "description": "Routing value.", + "schema": { + "type": "string", + "description": "Routing value." + } + }, + { + "name": "realtime", + "in": "query", + "description": "Specifies if request is real-time as opposed to near-real-time.", + "schema": { + "type": "boolean", + "default": true, + "description": "Specifies if request is real-time as opposed to near-real-time." + } + }, + { + "name": "version", + "in": "query", + "description": "Explicit version number for concurrency control.", + "schema": { + "type": "integer", + "description": "Explicit version number for concurrency control.", + "format": "int32" + } + }, + { + "name": "version_type", + "in": "query", + "description": "Specific version type.", + "schema": { + "$ref": "#/components/schemas/VersionType" + } + } + ], + "responses": { + "200": { + "description": "Termvectors_Post_WithId 200 response" + } + }, + "x-operation-group": "termvectors", + "x-version-added": "1.0" + } + }, + "/{index}/_update/{id}": { + "post": { + "description": "Updates a document with a script or partial document.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/document-apis/update-document/" + }, + "operationId": "Update", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Update_BodyParams" + } + } + }, + "required": true + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Document ID.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Document ID." + }, + "required": true + }, + { + "name": "index", + "in": "path", + "description": "Index name.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Index name." + }, + "required": true + }, + { + "name": "wait_for_active_shards", + "in": "query", + "description": "Sets the number of shard copies that must be active before proceeding with the 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).", + "schema": { + "type": "string", + "default": "1", + "description": "Sets the number of shard copies that must be active before proceeding with the 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)." + } + }, + { + "name": "_source", + "in": "query", + "description": "True or false to return the _source field or not, or a list of fields to return.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "True or false to return the _source field or not, or a list of fields to return." + }, + "explode": true + }, + { + "name": "_source_excludes", + "in": "query", + "description": "List of fields to exclude from the returned _source field.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of fields to exclude from the returned _source field." + }, + "explode": true + }, + { + "name": "_source_includes", + "in": "query", + "description": "List of fields to extract and return from the _source field.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of fields to extract and return from the _source field." + }, + "explode": true + }, + { + "name": "lang", + "in": "query", + "description": "The script language.", + "schema": { + "type": "string", + "default": "painless", + "description": "The script language." + } + }, + { + "name": "refresh", + "in": "query", + "description": "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.", + "schema": { + "$ref": "#/components/schemas/RefreshEnum" + } + }, + { + "name": "retry_on_conflict", + "in": "query", + "description": "Specify how many times should the operation be retried when a conflict occurs.", + "schema": { + "type": "integer", + "default": 0, + "description": "Specify how many times should the operation be retried when a conflict occurs.", + "format": "int32" + } + }, + { + "name": "routing", + "in": "query", + "description": "Routing value.", + "schema": { + "type": "string", + "description": "Routing value." + } + }, + { + "name": "timeout", + "in": "query", + "description": "Operation timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } + }, + { + "name": "if_seq_no", + "in": "query", + "description": "only perform the operation if the last operation that has changed the document has the specified sequence number.", + "schema": { + "type": "integer", + "description": "only perform the operation if the last operation that has changed the document has the specified sequence number.", + "format": "int32" + } + }, + { + "name": "if_primary_term", + "in": "query", + "description": "only perform the operation if the last operation that has changed the document has the specified primary term.", + "schema": { + "type": "integer", + "description": "only perform the operation if the last operation that has changed the document has the specified primary term.", + "format": "int32" + } + }, + { + "name": "require_alias", + "in": "query", + "description": "When true, requires destination to be an alias.", + "schema": { + "type": "boolean", + "default": false, + "description": "When true, requires destination to be an alias." + } + } + ], + "responses": { + "200": { + "description": "Update 200 response" + } + }, + "x-operation-group": "update", + "x-version-added": "1.0" + } + }, + "/{index}/_update_by_query": { + "post": { + "description": "Performs an update on every document in the index without changing the source,\nfor example to pick up a mapping change.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/document-apis/update-by-query/" + }, + "operationId": "UpdateByQuery", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateByQuery_BodyParams" + } + } + } + }, + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "analyzer", + "in": "query", + "description": "The analyzer to use for the query string.", + "schema": { + "type": "string", + "description": "The analyzer to use for the query string." + } + }, + { + "name": "analyze_wildcard", + "in": "query", + "description": "Specify whether wildcard and prefix queries should be analyzed.", + "schema": { + "type": "boolean", + "default": false, + "description": "Specify whether wildcard and prefix queries should be analyzed." + } + }, + { + "name": "default_operator", + "in": "query", + "description": "The default operator for query string query (AND or OR).", + "schema": { + "$ref": "#/components/schemas/DefaultOperator" + } + }, + { + "name": "df", + "in": "query", + "description": "The field to use as default where no field prefix is given in the query string.", + "schema": { + "type": "string", + "description": "The field to use as default where no field prefix is given in the query string." + } + }, + { + "name": "from", + "in": "query", + "description": "Starting offset.", + "schema": { + "type": "integer", + "default": 0, + "description": "Starting offset.", + "format": "int32" + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "conflicts", + "in": "query", + "description": "What to do when the operation encounters version conflicts?.", + "schema": { + "$ref": "#/components/schemas/Conflicts" + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "lenient", + "in": "query", + "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored.", + "schema": { + "type": "boolean", + "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored." + } + }, + { + "name": "pipeline", + "in": "query", + "description": "The pipeline id to preprocess incoming documents with.", + "schema": { + "type": "string", + "description": "The pipeline id to preprocess incoming documents with." + } + }, + { + "name": "preference", + "in": "query", + "description": "Specify the node or shard the operation should be performed on.", + "schema": { + "type": "string", + "default": "random", + "description": "Specify the node or shard the operation should be performed on." + } + }, + { + "name": "q", + "in": "query", + "description": "Query in the Lucene query string syntax.", + "schema": { + "type": "string", + "description": "Query in the Lucene query string syntax." + } + }, + { + "name": "routing", + "in": "query", + "description": "Comma-separated list of specific routing values.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of specific routing values." + }, + "explode": true + }, + { + "name": "scroll", + "in": "query", + "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", + "x-data-type": "time" + } + }, + { + "name": "search_type", + "in": "query", + "description": "Search operation type.", + "schema": { + "$ref": "#/components/schemas/SearchType" + } + }, + { + "name": "search_timeout", + "in": "query", + "description": "Explicit timeout for each search request. Defaults to no timeout.", + "schema": { + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Explicit timeout for each search request. Defaults to no timeout.", + "x-data-type": "time" + } + }, + { + "name": "size", + "in": "query", + "description": "Deprecated, please use `max_docs` instead.", + "schema": { + "type": "integer", + "description": "Deprecated, please use `max_docs` instead.", + "format": "int32" + } + }, + { + "name": "max_docs", + "in": "query", + "description": "Maximum number of documents to process (default: all documents).", + "schema": { + "type": "integer", + "description": "Maximum number of documents to process (default: all documents).", + "format": "int32" + } + }, + { + "name": "sort", + "in": "query", + "description": "Comma-separated list of : pairs.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of : pairs." + }, + "explode": true + }, + { + "name": "_source", + "in": "query", + "description": "True or false to return the _source field or not, or a list of fields to return.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "True or false to return the _source field or not, or a list of fields to return." + }, + "explode": true + }, + { + "name": "_source_excludes", + "in": "query", + "description": "List of fields to exclude from the returned _source field.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of fields to exclude from the returned _source field." + }, + "explode": true + }, + { + "name": "_source_includes", + "in": "query", + "description": "List of fields to extract and return from the _source field.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of fields to extract and return from the _source field." + }, + "explode": true + }, + { + "name": "terminate_after", + "in": "query", + "description": "The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.", + "schema": { + "type": "integer", + "description": "The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.", + "format": "int32" + } + }, + { + "name": "stats", + "in": "query", + "description": "Specific 'tag' of the request for logging and statistical purposes.", + "style": "form", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Specific 'tag' of the request for logging and statistical purposes." + }, + "explode": true + }, + { + "name": "version", + "in": "query", + "description": "Whether to return document version as part of a hit.", + "schema": { + "type": "boolean", + "description": "Whether to return document version as part of a hit." + } + }, + { + "name": "request_cache", + "in": "query", + "description": "Specify if request cache should be used for this request or not, defaults to index level setting.", + "schema": { + "type": "boolean", + "description": "Specify if request cache should be used for this request or not, defaults to index level setting." + } + }, + { + "name": "refresh", + "in": "query", + "description": "Should the affected indexes be refreshed?.", + "schema": { + "type": "boolean", + "description": "Should the affected indexes be refreshed?." + } + }, + { + "name": "timeout", + "in": "query", + "description": "Time each individual bulk request should wait for shards that are unavailable.", + "schema": { + "type": "string", + "default": "1m", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Time each individual bulk request should wait for shards that are unavailable.", + "x-data-type": "time" + } + }, + { + "name": "wait_for_active_shards", + "in": "query", + "description": "Sets the number of shard copies that must be active before proceeding with the 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).", + "schema": { + "type": "string", + "default": "1", + "description": "Sets the number of shard copies that must be active before proceeding with the 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)." + } + }, + { + "name": "scroll_size", + "in": "query", + "description": "Size on the scroll request powering the operation.", + "schema": { + "type": "integer", + "default": 100, + "description": "Size on the scroll request powering the operation.", + "format": "int32" + } + }, + { + "name": "wait_for_completion", + "in": "query", + "description": "Should this request wait until the operation has completed before returning.", + "schema": { + "type": "boolean", + "default": true, + "description": "Should this request wait until the operation has completed before returning." + } + }, + { + "name": "requests_per_second", + "in": "query", + "description": "The throttle for this request in sub-requests per second. -1 means no throttle.", + "schema": { + "type": "integer", + "default": 0, + "description": "The throttle for this request in sub-requests per second. -1 means no throttle.", + "format": "int32" + } + }, + { + "name": "slices", + "in": "query", + "description": "The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be set to `auto`.", + "schema": { + "type": "string", + "default": "1", + "description": "The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be set to `auto`." + } + } + ], + "responses": { + "200": { + "description": "UpdateByQuery 200 response" + } + }, + "x-operation-group": "update_by_query", + "x-version-added": "1.0" + } + }, + "/{index}/_upgrade": { + "get": { + "description": "The _upgrade API is no longer useful and will be removed.", + "operationId": "IndicesGetUpgrade_WithIndex", + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + } + ], + "responses": { + "200": { + "description": "IndicesGetUpgrade_WithIndex 200 response" + } + }, + "x-operation-group": "indices.get_upgrade", + "x-version-added": "1.0" + }, + "post": { + "description": "The _upgrade API is no longer useful and will be removed.", + "operationId": "IndicesUpgrade_WithIndex", + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "wait_for_completion", + "in": "query", + "description": "Should this request wait until the operation has completed before returning.", + "schema": { + "type": "boolean", + "default": false, + "description": "Should this request wait until the operation has completed before returning." + } + }, + { + "name": "only_ancient_segments", + "in": "query", + "description": "If true, only ancient (an older Lucene major release) segments will be upgraded.", + "schema": { + "type": "boolean", + "description": "If true, only ancient (an older Lucene major release) segments will be upgraded." + } + } + ], + "responses": { + "200": { + "description": "IndicesUpgrade_WithIndex 200 response" + } + }, + "x-operation-group": "indices.upgrade", + "x-version-added": "1.0" + } + }, + "/{index}/_validate/query": { + "get": { + "description": "Allows a user to validate a potentially expensive query without executing it.", + "operationId": "IndicesValidateQuery_Get_WithIndex", + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "explain", + "in": "query", + "description": "Return detailed information about the error.", + "schema": { + "type": "boolean", + "description": "Return detailed information about the error." + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "q", + "in": "query", + "description": "Query in the Lucene query string syntax.", + "schema": { + "type": "string", + "description": "Query in the Lucene query string syntax." + } + }, + { + "name": "analyzer", + "in": "query", + "description": "The analyzer to use for the query string.", + "schema": { + "type": "string", + "description": "The analyzer to use for the query string." + } + }, + { + "name": "analyze_wildcard", + "in": "query", + "description": "Specify whether wildcard and prefix queries should be analyzed.", + "schema": { + "type": "boolean", + "default": false, + "description": "Specify whether wildcard and prefix queries should be analyzed." + } + }, + { + "name": "default_operator", + "in": "query", + "description": "The default operator for query string query (AND or OR).", + "schema": { + "$ref": "#/components/schemas/DefaultOperator" + } + }, + { + "name": "df", + "in": "query", + "description": "The field to use as default where no field prefix is given in the query string.", + "schema": { + "type": "string", + "description": "The field to use as default where no field prefix is given in the query string." + } + }, + { + "name": "lenient", + "in": "query", + "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored.", + "schema": { + "type": "boolean", + "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored." + } + }, + { + "name": "rewrite", + "in": "query", + "description": "Provide a more detailed explanation showing the actual Lucene query that will be executed.", + "schema": { + "type": "boolean", + "description": "Provide a more detailed explanation showing the actual Lucene query that will be executed." + } + }, + { + "name": "all_shards", + "in": "query", + "description": "Execute validation on all shards instead of one random shard per index.", + "schema": { + "type": "boolean", + "description": "Execute validation on all shards instead of one random shard per index." + } + } + ], + "responses": { + "200": { + "description": "IndicesValidateQuery_Get_WithIndex 200 response" + } + }, + "x-operation-group": "indices.validate_query", + "x-version-added": "1.0" + }, + "post": { + "description": "Allows a user to validate a potentially expensive query without executing it.", + "operationId": "IndicesValidateQuery_Post_WithIndex", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndicesValidateQuery_BodyParams" + } + } + } + }, + "parameters": [ + { + "name": "index", + "in": "path", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "schema": { + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "x-data-type": "array" + }, + "required": true + }, + { + "name": "explain", + "in": "query", + "description": "Return detailed information about the error.", + "schema": { + "type": "boolean", + "description": "Return detailed information about the error." + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "schema": { + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } + }, + { + "name": "allow_no_indices", + "in": "query", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified).", + "schema": { + "type": "boolean", + "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + } + }, + { + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "schema": { + "$ref": "#/components/schemas/ExpandWildcards" + } + }, + { + "name": "q", + "in": "query", + "description": "Query in the Lucene query string syntax.", + "schema": { + "type": "string", + "description": "Query in the Lucene query string syntax." + } + }, + { + "name": "analyzer", + "in": "query", + "description": "The analyzer to use for the query string.", + "schema": { + "type": "string", + "description": "The analyzer to use for the query string." + } + }, + { + "name": "analyze_wildcard", + "in": "query", + "description": "Specify whether wildcard and prefix queries should be analyzed.", + "schema": { + "type": "boolean", + "default": false, + "description": "Specify whether wildcard and prefix queries should be analyzed." + } + }, + { + "name": "default_operator", + "in": "query", + "description": "The default operator for query string query (AND or OR).", + "schema": { + "$ref": "#/components/schemas/DefaultOperator" + } + }, + { + "name": "df", + "in": "query", + "description": "The field to use as default where no field prefix is given in the query string.", + "schema": { + "type": "string", + "description": "The field to use as default where no field prefix is given in the query string." + } + }, + { + "name": "lenient", + "in": "query", + "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored.", + "schema": { + "type": "boolean", + "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored." + } + }, + { + "name": "rewrite", + "in": "query", + "description": "Provide a more detailed explanation showing the actual Lucene query that will be executed.", + "schema": { + "type": "boolean", + "description": "Provide a more detailed explanation showing the actual Lucene query that will be executed." + } + }, + { + "name": "all_shards", + "in": "query", + "description": "Execute validation on all shards instead of one random shard per index.", + "schema": { + "type": "boolean", + "description": "Execute validation on all shards instead of one random shard per index." + } + } + ], + "responses": { + "200": { + "description": "IndicesValidateQuery_Post_WithIndex 200 response" + } + }, + "x-operation-group": "indices.validate_query", + "x-version-added": "1.0" + } + } + }, + "components": { + "schemas": { + "AccountDetails": { + "type": "object", + "properties": { + "user_name": { + "type": "string" + }, + "is_reserved": { + "type": "boolean" + }, + "is_hidden": { + "type": "boolean" + }, + "is_internal_user": { + "type": "boolean" + }, + "user_requested_tenant": { + "type": "string" + }, + "backend_roles": { + "type": "array", + "items": { + "type": "string" + } + }, + "custom_attribute_names": { + "type": "array", + "items": { + "type": "string" + } + }, + "tenants": { + "$ref": "#/components/schemas/UserTenants" + }, + "roles": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "ActionGroupsMap": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Action_Group" + } + }, + "ActionObjectStructure": { + "type": "object", + "properties": { + "add": { + "$ref": "#/components/schemas/UserDefinedStructure" + }, + "remove": { + "$ref": "#/components/schemas/UserDefinedStructure" + }, + "remove_index": { + "$ref": "#/components/schemas/UserDefinedStructure" + } + } + }, + "Action_Group": { + "type": "object", + "properties": { + "reserved": { + "type": "boolean" + }, + "hidden": { + "type": "boolean" + }, + "allowed_actions": { + "type": "array", + "items": { + "type": "string" + } + }, + "type": { + "type": "string" + }, + "description": { + "type": "string" + }, + "static": { + "type": "boolean" + } + } + }, + "AuditConfig": { + "type": "object", + "properties": { + "compliance": { + "$ref": "#/components/schemas/ComplianceConfig" + }, + "enabled": { + "type": "boolean" + }, + "audit": { + "$ref": "#/components/schemas/AuditLogsConfig" + } + } + }, + "AuditConfigWithReadOnly": { + "type": "object", + "properties": { + "_readonly": { + "type": "array", + "items": { + "type": "string" + } + }, + "config": { + "$ref": "#/components/schemas/AuditConfig" + } + } + }, + "AuditLogsConfig": { + "type": "object", + "properties": { + "ignore_users": { + "type": "array", + "items": { + "type": "string" + } + }, + "ignore_requests": { + "type": "array", + "items": { + "type": "string" + } + }, + "disabled_rest_categories": { + "type": "array", + "items": { + "type": "string" + } + }, + "disabled_transport_categories": { + "type": "array", + "items": { + "type": "string" + } + }, + "log_request_body": { + "type": "boolean" + }, + "resolve_indices": { + "type": "boolean" + }, + "resolve_bulk_requests": { + "type": "boolean" + }, + "exclude_sensitive_headers": { + "type": "boolean" + }, + "enable_transport": { + "type": "boolean" + }, + "enable_rest": { + "type": "boolean" + } + } + }, + "Bulk_BodyParams": { + "type": "object", + "description": "The operation definition and data (action-data pairs), separated by newlines", + "x-serialize": "bulk" + }, + "Bytes": { + "type": "string", + "description": "The unit in which to display byte values.", + "enum": [ + "b", + "k", + "kb", + "m", + "mb", + "g", + "gb", + "t", + "tb", + "p", + "pb" + ] + }, + "CatAllPitSegmentsResponseContent": { + "type": "object", + "properties": { + "content": { + "$ref": "#/components/schemas/CatPitSegment" + } + } + }, + "CatPitSegment": { + "type": "object", + "properties": { + "index": { + "type": "string" + }, + "shard": { + "type": "integer", + "format": "int32" + }, + "prirep": { + "type": "boolean", + "description": "Set to true to return stats only for primary shards." + }, + "ip": { + "type": "string" + }, + "segment": { + "type": "string" + }, + "generation": { + "type": "integer", + "format": "int32" + }, + "docs_count": { + "type": "integer", + "format": "int32" + }, + "docs_deleted": { + "type": "integer", + "format": "int32" + }, + "size": { + "type": "string" + }, + "size_memory": { + "type": "integer", + "format": "int32" + }, + "committed": { + "type": "boolean" + }, + "searchable": { + "type": "boolean" + }, + "version": { + "type": "string" + }, + "compound": { + "type": "boolean" + } + } + }, + "CatPitSegmentsResponseContent": { + "type": "object", + "properties": { + "content": { + "$ref": "#/components/schemas/CatPitSegment" + } + } + }, + "CatPitSegments_BodyParams": { + "type": "object", + "properties": { + "pit_id": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "pit_id" + ] + }, + "CertificatesDetail": { + "type": "object", + "properties": { + "issuer_dn": { + "type": "string" + }, + "subject_dn": { + "type": "string" + }, + "san": { + "type": "string" + }, + "not_before": { + "type": "string" + }, + "not_after": { + "type": "string" + } + } + }, + "ChangePasswordRequestContent": { + "type": "object", + "properties": { + "current_password": { + "type": "string", + "description": "The current password" + }, + "password": { + "type": "string", + "description": "The new password to set" + } + }, + "required": [ + "current_password", + "password" + ] + }, + "ChangePasswordResponseContent": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Security Operation Status" + }, + "message": { + "type": "string", + "description": "Security Operation Message" + } + } + }, + "ClearScroll_BodyParams": { + "type": "object", + "description": "Comma-separated list of scroll IDs to clear if none was specified via the scroll_id parameter" + }, + "ClusterAllocationExplain_BodyParams": { + "type": "object", + "description": "The index, shard, and primary flag to explain. Empty means 'explain the first unassigned shard'" + }, + "ClusterGetSettingsResponseContent": { + "type": "object", + "properties": { + "persistent": { + "$ref": "#/components/schemas/UserDefinedValueMap" + }, + "transient": { + "$ref": "#/components/schemas/UserDefinedValueMap" + }, + "defaults": { + "$ref": "#/components/schemas/UserDefinedValueMap" + } + } + }, + "ClusterHealthLevel": { + "type": "string", + "description": "Specify the level of detail for returned information.", + "enum": [ + "cluster", + "indices", + "shards", + "awareness_attributes" + ] + }, + "ClusterPutComponentTemplate_BodyParams": { + "type": "object", + "description": "The template definition" + }, + "ClusterPutSettingsResponseContent": { + "type": "object", + "properties": { + "acknowledged": { + "type": "boolean" + }, + "persistent": { + "$ref": "#/components/schemas/UserDefinedValueMap" + }, + "transient": { + "$ref": "#/components/schemas/UserDefinedValueMap" + } + } + }, + "ClusterPutSettings_BodyParams": { + "type": "object", + "description": "The settings to be updated. Can be either `transient` or `persistent` (survives cluster restart).", + "properties": { + "persistent": { + "$ref": "#/components/schemas/UserDefinedValueMap" + }, + "transient": { + "$ref": "#/components/schemas/UserDefinedValueMap" + } + } + }, + "ClusterRerouteMetric_Member": { + "type": "string", + "enum": [ + "_all", + "blocks", + "metadata", + "nodes", + "routing_table", + "master_node", + "cluster_manager_node", + "version" + ] + }, + "ClusterReroute_BodyParams": { + "type": "object", + "description": "The definition of `commands` to perform (`move`, `cancel`, `allocate`)" + }, + "ComplianceConfig": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "write_log_diffs": { + "type": "boolean" + }, + "read_watched_fields": {}, + "read_ignore_users": { + "type": "array", + "items": { + "type": "string" + } + }, + "write_watched_indices": { + "type": "array", + "items": { + "type": "string" + } + }, + "write_ignore_users": { + "type": "array", + "items": { + "type": "string" + } + }, + "read_metadata_only": { + "type": "boolean" + }, + "write_metadata_only": { + "type": "boolean" + }, + "external_config": { + "type": "boolean" + }, + "internal_config": { + "type": "boolean" + } + } + }, + "Conflicts": { + "type": "string", + "description": "What to do when the operation encounters version conflicts?.", + "enum": [ + "abort", + "proceed" + ] + }, + "Count_BodyParams": { + "type": "object", + "description": "Query to restrict the results specified with the Query DSL (optional)" + }, + "CreateActionGroupResponseContent": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Security Operation Status" + }, + "message": { + "type": "string", + "description": "Security Operation Message" + } + } + }, + "CreatePitResponseContent": { + "type": "object", + "properties": { + "pit_id": { + "type": "string" + }, + "_shard": { + "$ref": "#/components/schemas/ShardStatistics" + }, + "creation_time": { + "type": "integer", + "format": "int64" + } + } + }, + "CreateRoleMappingResponseContent": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Security Operation Status" + }, + "message": { + "type": "string", + "description": "Security Operation Message" + } + } + }, + "CreateRoleResponseContent": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Security Operation Status" + }, + "message": { + "type": "string", + "description": "Security Operation Message" + } + } + }, + "CreateTenantParams": { + "type": "object", + "properties": { + "description": { + "type": "string" + } + } + }, + "CreateTenantResponseContent": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Security Operation Status" + }, + "message": { + "type": "string", + "description": "Security Operation Message" + } + } + }, + "CreateUserResponseContent": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Security Operation Status" + }, + "message": { + "type": "string", + "description": "Security Operation Message" + } + } + }, + "Create_BodyParams": { + "type": "object", + "description": "The document" + }, + "DataStream": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "timestamp_field": { + "$ref": "#/components/schemas/DataStreamTimestampField" + }, + "indices": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DataStreamIndex" + } + }, + "generation": { + "type": "integer", + "format": "int64" + }, + "status": { + "$ref": "#/components/schemas/DataStreamStatus" + }, + "template": { + "type": "string" + } + } + }, + "DataStreamIndex": { + "type": "object", + "properties": { + "index_name": { + "type": "string" + }, + "index_uuid": { + "type": "string" + } + } + }, + "DataStreamStatus": { + "type": "string", + "enum": [ + "green", + "yellow", + "red" + ] + }, + "DataStreamTimestampField": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + } + }, + "DefaultOperator": { + "type": "string", + "description": "The default operator for query string query (AND or OR).", + "enum": [ + "AND", + "OR" + ] + }, + "DeleteActionGroupResponseContent": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Security Operation Status" + }, + "message": { + "type": "string", + "description": "Security Operation Message" + } + } + }, + "DeleteAllPitsResponseContent": { + "type": "object", + "properties": { + "pits": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PitsDetailsDeleteAll" + } + } + } + }, + "DeleteByQuery_BodyParams": { + "type": "object", + "description": "The search definition using the Query DSL" + }, + "DeleteDistinguishedNamesResponseContent": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Security Operation Status" + }, + "message": { + "type": "string", + "description": "Security Operation Message" + } + } + }, + "DeletePitResponseContent": { + "type": "object", + "properties": { + "pits": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DeletedPit" + } + } + } + }, + "DeletePit_BodyParams": { + "type": "object", + "description": "The point-in-time ids to be deleted", + "properties": { + "pit_id": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "pit_id" + ] + }, + "DeleteRoleMappingResponseContent": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Security Operation Status" + }, + "message": { + "type": "string", + "description": "Security Operation Message" + } + } + }, + "DeleteRoleResponseContent": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Security Operation Status" + }, + "message": { + "type": "string", + "description": "Security Operation Message" + } + } + }, + "DeleteTenantResponseContent": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Security Operation Status" + }, + "message": { + "type": "string", + "description": "Security Operation Message" + } + } + }, + "DeleteUserResponseContent": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Security Operation Status" + }, + "message": { + "type": "string", + "description": "Security Operation Message" + } + } + }, + "DeletedPit": { + "type": "object", + "properties": { + "successful": { + "type": "boolean" + }, + "pit_id": { + "type": "string" + } + } + }, + "DistinguishedNames": { + "type": "object", + "properties": { + "nodes_dn": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "DistinguishedNamesMap": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/DistinguishedNames" + } + }, + "DynamicConfig": { + "type": "object", + "properties": { + "dynamic": { + "$ref": "#/components/schemas/DynamicOptions" + } + } + }, + "DynamicOptions": { + "type": "object", + "properties": { + "filteredAliasMode": { + "type": "string" + }, + "disableRestAuth": { + "type": "boolean" + }, + "disableIntertransportAuth": { + "type": "boolean" + }, + "respectRequestIndicesOptions": { + "type": "boolean" + }, + "kibana": {}, + "http": {}, + "authc": {}, + "authz": {}, + "authFailureListeners": {}, + "doNotFailOnForbidden": { + "type": "boolean" + }, + "multiRolespanEnabled": { + "type": "boolean" + }, + "hostsResolverMode": { + "type": "string" + }, + "doNotFailOnForbiddenEmpty": { + "type": "boolean" + } + } + }, + "ExpandWildcards": { + "type": "string", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "enum": [ + "all", + "open", + "closed", + "hidden", + "none" + ] + }, + "Explain_BodyParams": { + "type": "object", + "description": "The query definition using the Query DSL" + }, + "FieldCaps_BodyParams": { + "type": "object", + "description": "An index filter specified with the Query DSL" + }, + "FlushCacheResponseContent": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Security Operation Status" + }, + "message": { + "type": "string", + "description": "Security Operation Message" + } + } + }, + "GetAllPitsResponseContent": { + "type": "object", + "properties": { + "pits": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PitDetail" + } + } + } + }, + "GetCertificatesResponseContent": { + "type": "object", + "properties": { + "http_certificates_list": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CertificatesDetail" + } + }, + "transport_certificates_list": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CertificatesDetail" + } + } + } + }, + "GetResponseContent": { + "type": "object", + "properties": { + "_index": { + "type": "string" + }, + "_type": { + "type": "string" + }, + "_id": { + "type": "string" + }, + "version": { + "type": "integer", + "format": "int32" + }, + "seq_no": { + "type": "integer", + "format": "int64" + }, + "primary_term": { + "type": "integer", + "format": "int64" + }, + "found": { + "type": "boolean" + }, + "_routing": { + "type": "string" + }, + "_source": { + "$ref": "#/components/schemas/UserDefinedValueMap" + }, + "_fields": { + "$ref": "#/components/schemas/UserDefinedValueMap" + } + }, + "required": [ + "_id", + "_index", + "found" + ] + }, + "GroupBy": { + "type": "string", + "description": "Group tasks by nodes or parent/child relationships.", + "enum": [ + "nodes", + "parents", + "none" + ] + }, + "Health": { + "type": "string", + "description": "Health status ('green', 'yellow', or 'red') to filter only indices matching the specified health status.", + "enum": [ + "green", + "yellow", + "red" + ] + }, + "Hits": { + "type": "object", + "properties": { + "_index": { + "type": "string" + }, + "_type": { + "type": "string" + }, + "_id": { + "type": "string" + }, + "_score": { + "type": "number", + "format": "float" + }, + "_source": {}, + "fields": {} + } + }, + "HitsMetadata": { + "type": "object", + "properties": { + "total": { + "$ref": "#/components/schemas/Total" + }, + "max_score": { + "type": "number", + "format": "double" + }, + "hits": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Hits" + } + } + } + }, + "IndexPermission": { + "type": "object", + "properties": { + "index_patterns": { + "type": "array", + "items": { + "type": "string" + } + }, + "dls": { + "type": "string" + }, + "fls": { + "type": "array", + "items": { + "type": "string" + } + }, + "masked_fields": { + "type": "array", + "items": { + "type": "string" + } + }, + "allowed_actions": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "Index_BodyParams": { + "type": "object", + "description": "The document" + }, + "IndicesAnalyze_BodyParams": { + "type": "object", + "description": "Define analyzer/tokenizer parameters and the text on which the analysis should be performed" + }, + "IndicesClone_BodyParams": { + "type": "object", + "description": "The configuration for the target index (`settings` and `aliases`)" + }, + "IndicesCreateDataStreamResponseContent": { + "type": "object", + "properties": { + "acknowledged": { + "type": "boolean" + } + } + }, + "IndicesCreateDataStream_BodyParams": { + "type": "object", + "description": "The data stream definition" + }, + "IndicesCreateResponseContent": { + "type": "object", + "properties": { + "index": { + "type": "string" + }, + "shards_acknowledged": { + "type": "boolean" + }, + "acknowledged": { + "type": "boolean" + } + }, + "required": [ + "acknowledged", + "index", + "shards_acknowledged" + ] + }, + "IndicesCreate_BodyParams": { + "type": "object", + "description": "The configuration for the index (`settings` and `mappings`)", + "properties": { + "aliases": { + "$ref": "#/components/schemas/UserDefinedValueMap" + }, + "mapping": { + "$ref": "#/components/schemas/UserDefinedValueMap" + }, + "settings": { + "$ref": "#/components/schemas/UserDefinedValueMap" + } + } + }, + "IndicesDeleteDataStreamResponseContent": { + "type": "object", + "properties": { + "acknowledged": { + "type": "boolean" + } + } + }, + "IndicesDeleteResponseContent": { + "type": "object", + "properties": { + "acknowledged": { + "type": "boolean" + } + } + }, + "IndicesGetDataStreamResponseContent": { + "type": "object", + "properties": { + "data_streams": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DataStream" + } + } + } + }, + "IndicesGetDataStream_WithNameResponseContent": { + "type": "object", + "properties": { + "data_streams": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DataStream" + } + } + } + }, + "IndicesPutAlias_BodyParams": { + "type": "object", + "description": "The settings for the alias, such as `routing` or `filter`" + }, + "IndicesPutIndexTemplate_BodyParams": { + "type": "object", + "description": "The template definition" + }, + "IndicesPutMapping_BodyParams": { + "type": "object", + "description": "The mapping definition" + }, + "IndicesPutMapping_PostResponseContent": { + "type": "object", + "properties": { + "acknowledged": { + "type": "boolean" + } + } + }, + "IndicesPutMapping_PutResponseContent": { + "type": "object", + "properties": { + "acknowledged": { + "type": "boolean" + } + } + }, + "IndicesPutSettings_BodyParams": { + "type": "object", + "description": "The index settings to be updated" + }, + "IndicesPutTemplate_BodyParams": { + "type": "object", + "description": "The template definition" + }, + "IndicesRollover_BodyParams": { + "type": "object", + "description": "The conditions that needs to be met for executing rollover" + }, + "IndicesShrink_BodyParams": { + "type": "object", + "description": "The configuration for the target index (`settings` and `aliases`)" + }, + "IndicesSimulateIndexTemplate_BodyParams": { + "type": "object", + "description": "New index template definition, which will be included in the simulation, as if it already exists in the system" + }, + "IndicesSimulateTemplate_BodyParams": { + "type": "object", + "description": "New index template definition to be simulated, if no index template name is specified" + }, + "IndicesSplit_BodyParams": { + "type": "object", + "description": "The configuration for the target index (`settings` and `aliases`)" + }, + "IndicesUpdateAliasesResponseContent": { + "type": "object", + "properties": { + "acknowledged": { + "type": "boolean" + } + }, + "required": [ + "acknowledged" + ] + }, + "IndicesUpdateAliases_BodyParams": { + "type": "object", + "description": "The definition of `actions` to perform", + "properties": { + "actions": { + "$ref": "#/components/schemas/ActionObjectStructure" + } + } + }, + "IndicesValidateQuery_BodyParams": { + "type": "object", + "description": "The query definition specified with the Query DSL" + }, + "IndiciesStatLevel": { + "type": "string", + "description": "Return stats aggregated at cluster, index or shard level.", + "enum": [ + "cluster", + "indices", + "shards" + ] + }, + "InfoResponseContent": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "cluster_name": { + "type": "string" + }, + "cluster_uuid": { + "type": "string" + }, + "version": { + "$ref": "#/components/schemas/InfoVersion" + }, + "tagline": { + "type": "string" + } + } + }, + "InfoVersion": { + "type": "object", + "properties": { + "distribution": { + "type": "string" + }, + "number": { + "type": "string" + }, + "build_type": { + "type": "string" + }, + "build_hash": { + "type": "string" + }, + "build_date": { + "type": "string" + }, + "build_snapshot": { + "type": "boolean" + }, + "lucene_version": { + "type": "string" + }, + "minimum_wire_compatibility_version": { + "type": "string" + }, + "minimum_index_compatibility_version": { + "type": "string" + } + } + }, + "IngestPutPipeline_BodyParams": { + "type": "object", + "description": "The ingest definition" + }, + "IngestSimulate_BodyParams": { + "type": "object", + "description": "The simulate definition" + }, + "Mget_BodyParams": { + "type": "object", + "description": "Document identifiers; can be either `docs` (containing full document information) or `ids` (when index is provided in the URL." + }, + "MsearchTemplate_BodyParams": { + "type": "object", + "description": "The request definitions (metadata-search request definition pairs), separated by newlines", + "x-serialize": "bulk" + }, + "Msearch_BodyParams": { + "type": "object", + "description": "The request definitions (metadata-search request definition pairs), separated by newlines", + "x-serialize": "bulk" + }, + "Mtermvectors_BodyParams": { + "type": "object", + "description": "Define ids, documents, parameters or a list of parameters per document here. You must at least provide a list of document ids. See documentation." + }, + "NodesReloadSecureSettings_BodyParams": { + "type": "object", + "description": "An object containing the password for the opensearch keystore" + }, + "NodesStatLevel": { + "type": "string", + "description": "Return indices stats aggregated at index, node or shard level.", + "enum": [ + "indices", + "node", + "shards" + ] + }, + "OpType": { + "type": "string", + "description": "Explicit operation type. Defaults to `index` for requests with an explicit document ID, and to `create`for requests without an explicit document ID.", + "enum": [ + "index", + "create" + ] + }, + "PatchActionGroupInputPayload": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PatchOperation" + } + }, + "PatchActionGroupResponseContent": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Security Operation Status" + }, + "message": { + "type": "string", + "description": "Security Operation Message" + } + } + }, + "PatchActionGroupsInputPayload": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PatchOperation" + } + }, + "PatchActionGroupsResponseContent": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Security Operation Status" + }, + "message": { + "type": "string", + "description": "Security Operation Message" + } + } + }, + "PatchAuditConfigurationInputPayload": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PatchOperation" + } + }, + "PatchConfigurationInputPayload": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PatchOperation" + } + }, + "PatchConfigurationResponseContent": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Security Operation Status" + }, + "message": { + "type": "string", + "description": "Security Operation Message" + } + } + }, + "PatchDistinguishedNamesInputPayload": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PatchOperation" + } + }, + "PatchDistinguishedNamesResponseContent": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Security Operation Status" + }, + "message": { + "type": "string", + "description": "Security Operation Message" + } + } + }, + "PatchOperation": { + "type": "object", + "properties": { + "op": { + "type": "string", + "description": "The operation to perform. Possible values: remove,add, replace, move, copy, test." + }, + "path": { + "type": "string", + "description": "The path to the resource." + }, + "value": { + "description": "The new values used for the update." + } + }, + "required": [ + "op", + "path" + ] + }, + "PatchRoleInputPayload": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PatchOperation" + } + }, + "PatchRoleMappingInputPayload": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PatchOperation" + } + }, + "PatchRoleMappingResponseContent": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Security Operation Status" + }, + "message": { + "type": "string", + "description": "Security Operation Message" + } + } + }, + "PatchRoleMappingsInputPayload": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PatchOperation" + } + }, + "PatchRoleMappingsResponseContent": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Security Operation Status" + }, + "message": { + "type": "string", + "description": "Security Operation Message" + } + } + }, + "PatchRoleResponseContent": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Security Operation Status" + }, + "message": { + "type": "string", + "description": "Security Operation Message" + } + } + }, + "PatchRolesInputPayload": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PatchOperation" + } + }, + "PatchRolesResponseContent": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Security Operation Status" + }, + "message": { + "type": "string", + "description": "Security Operation Message" + } + } + }, + "PatchTenantInputPayload": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PatchOperation" + } + }, + "PatchTenantResponseContent": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Security Operation Status" + }, + "message": { + "type": "string", + "description": "Security Operation Message" + } + } + }, + "PatchTenantsInputPayload": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PatchOperation" + } + }, + "PatchTenantsResponseContent": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Security Operation Status" + }, + "message": { + "type": "string", + "description": "Security Operation Message" + } + } + }, + "PatchUserInputPayload": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PatchOperation" + } + }, + "PatchUserResponseContent": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Security Operation Status" + }, + "message": { + "type": "string", + "description": "Security Operation Message" + } + } + }, + "PatchUsersInputPayload": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PatchOperation" + } + }, + "PatchUsersResponseContent": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Security Operation Status" + }, + "message": { + "type": "string", + "description": "Security Operation Message" + } + } + }, + "PitDetail": { + "type": "object", + "properties": { + "pit_id": { + "type": "string" + }, + "creation_time": { + "type": "integer", + "format": "int64" + }, + "keep_alive": { + "type": "integer", + "format": "int64" + } + } + }, + "PitsDetailsDeleteAll": { + "type": "object", + "properties": { + "successful": { + "type": "boolean" + }, + "pit_id": { + "type": "string" + } + } + }, + "PutScript_BodyParams": { + "type": "object", + "description": "The document" + }, + "RankEval_BodyParams": { + "type": "object", + "description": "The ranking evaluation search definition, including search requests, document ratings and ranking metric definition." + }, + "RefreshEnum": { + "type": "string", + "description": "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.", + "enum": [ + "true", + "false", + "wait_for" + ] + }, + "Reindex_BodyParams": { + "type": "object", + "description": "The search definition using the Query DSL and the prototype for the index request." + }, + "Relation": { + "type": "string", + "enum": [ + "eq", + "gte" + ] + }, + "ReloadHttpCertificatesResponseContent": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Security Operation Status" + }, + "message": { + "type": "string", + "description": "Security Operation Message" + } + } + }, + "ReloadTransportCertificatesResponseContent": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Security Operation Status" + }, + "message": { + "type": "string", + "description": "Security Operation Message" + } + } + }, + "RemoteStoreRestoreInfo": { + "type": "object", + "properties": { + "snapshot": { + "type": "string" + }, + "indices": { + "type": "array", + "items": { + "type": "string" + } + }, + "shards": { + "$ref": "#/components/schemas/RemoteStoreRestoreShardsInfo" + } + } + }, + "RemoteStoreRestoreResponseContent": { + "type": "object", + "properties": { + "accepted": { + "type": "boolean" + }, + "remote_store": { + "$ref": "#/components/schemas/RemoteStoreRestoreInfo" + } + } + }, + "RemoteStoreRestoreShardsInfo": { + "type": "object", + "properties": { + "total": { + "type": "integer", + "format": "int32" + }, + "failed": { + "type": "integer", + "format": "int32" + }, + "successful": { + "type": "integer", + "format": "int32" + } + } + }, + "RemoteStoreRestore_BodyParams": { + "type": "object", + "description": "Comma-separated list of index IDs", + "properties": { + "indices": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "indices" + ] + }, + "RenderSearchTemplate_BodyParams": { + "type": "object", + "description": "The search definition template and its params" + }, + "Role": { + "type": "object", + "properties": { + "reserved": { + "type": "boolean" + }, + "hidden": { + "type": "boolean" + }, + "description": { + "type": "string" + }, + "cluster_permissions": { + "type": "array", + "items": { + "type": "string" + } + }, + "index_permissions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/IndexPermission" + } + }, + "tenant_permissions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TenantPermission" + } + }, + "static": { + "type": "boolean" + } + } + }, + "RoleMapping": { + "type": "object", + "properties": { + "hosts": { + "type": "array", + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "items": { + "type": "string" + } + }, + "reserved": { + "type": "boolean" + }, + "hidden": { + "type": "boolean" + }, + "backend_roles": { + "type": "array", + "items": { + "type": "string" + } + }, + "and_backend_roles": { + "type": "array", + "items": { + "type": "string" + } + }, + "description": { + "type": "string" + } + } + }, + "RoleMappings": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/RoleMapping" + } + }, + "RolesMap": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Role" + } + }, + "SampleType": { + "type": "string", + "description": "The type to sample.", + "enum": [ + "cpu", + "wait", + "block" + ] + }, + "ScriptsPainlessExecute_BodyParams": { + "type": "object", + "description": "The script to execute" + }, + "Scroll_BodyParams": { + "type": "object", + "description": "The scroll ID if not passed by URL or query parameter." + }, + "SearchTemplate_BodyParams": { + "type": "object", + "description": "The search definition template and its params" + }, + "SearchType": { + "type": "string", + "description": "Search operation type.", + "enum": [ + "query_then_fetch", + "dfs_query_then_fetch" + ] + }, + "SearchTypeMulti": { + "type": "string", + "description": "Search operation type.", + "enum": [ + "query_then_fetch", + "query_and_fetch", + "dfs_query_then_fetch", + "dfs_query_and_fetch" + ] + }, + "Search_BodyParams": { + "type": "object", + "description": "The search definition using the Query DSL", + "properties": { + "docvalue_fields": { + "type": "string" + }, + "explain": { + "type": "boolean" + }, + "from": { + "type": "integer", + "format": "int32" + }, + "seq_no_primary_term": { + "type": "boolean" + }, + "size": { + "type": "integer", + "format": "int32" + }, + "source": { + "type": "string" + }, + "stats": { + "type": "string" + }, + "terminate_after": { + "type": "integer", + "format": "int32" + }, + "timeout": { + "$ref": "#/components/schemas/Time" + }, + "version": { + "type": "boolean" + }, + "fields": { + "type": "array", + "items": { + "type": "string" + } + }, + "min_score": { + "type": "integer", + "format": "int32" + }, + "indices_boost": { + "type": "array", + "items": {} + }, + "query": { + "$ref": "#/components/schemas/UserDefinedObjectStructure" + } + } + }, + "Search_GetResponseContent": { + "type": "object", + "properties": { + "_scroll_id": { + "type": "string" + }, + "took": { + "type": "integer", + "format": "int64" + }, + "timed_out": { + "type": "boolean" + }, + "_shards": { + "$ref": "#/components/schemas/ShardStatistics" + }, + "hits": { + "$ref": "#/components/schemas/HitsMetadata" + } + } + }, + "Search_Get_WithIndexResponseContent": { + "type": "object", + "properties": { + "_scroll_id": { + "type": "string" + }, + "took": { + "type": "integer", + "format": "int64" + }, + "timed_out": { + "type": "boolean" + }, + "_shards": { + "$ref": "#/components/schemas/ShardStatistics" + }, + "hits": { + "$ref": "#/components/schemas/HitsMetadata" + } + } + }, + "Search_PostResponseContent": { + "type": "object", + "properties": { + "_scroll_id": { + "type": "string" + }, + "took": { + "type": "integer", + "format": "int64" + }, + "timed_out": { + "type": "boolean" + }, + "_shards": { + "$ref": "#/components/schemas/ShardStatistics" + }, + "hits": { + "$ref": "#/components/schemas/HitsMetadata" + } + } + }, + "Search_Post_WithIndexResponseContent": { + "type": "object", + "properties": { + "_scroll_id": { + "type": "string" + }, + "took": { + "type": "integer", + "format": "int64" + }, + "timed_out": { + "type": "boolean" + }, + "_shards": { + "$ref": "#/components/schemas/ShardStatistics" + }, + "hits": { + "$ref": "#/components/schemas/HitsMetadata" + } + } + }, + "SecurityHealthResponseContent": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "mode": { + "type": "string" + }, + "status": { + "type": "string" + } + } + }, + "ShardStatistics": { + "type": "object", + "properties": { + "total": { + "type": "integer", + "format": "int32" + }, + "successful": { + "type": "integer", + "format": "int32" + }, + "skipped": { + "type": "integer", + "format": "int32" + }, + "failed": { + "type": "integer", + "format": "int32" + } + } + }, + "SnapshotClone_BodyParams": { + "type": "object", + "description": "The snapshot clone definition" + }, + "SnapshotCreateRepository_BodyParams": { + "type": "object", + "description": "The repository definition" + }, + "SnapshotCreate_BodyParams": { + "type": "object", + "description": "The snapshot definition" + }, + "SnapshotRestore_BodyParams": { + "type": "object", + "description": "Details of what to restore" + }, + "Status_Member": { + "type": "string", + "enum": [ + "green", + "yellow", + "red", + "all" + ] + }, + "SuggestMode": { + "type": "string", + "description": "Specify suggest mode.", + "enum": [ + "missing", + "popular", + "always" + ] + }, + "Tenant": { + "type": "object", + "properties": { + "reserved": { + "type": "boolean" + }, + "hidden": { + "type": "boolean" + }, + "description": { + "type": "string" + }, + "static": { + "type": "boolean" + } + } + }, + "TenantPermission": { + "type": "object", + "properties": { + "tenant_patterns": { + "type": "array", + "items": { + "type": "string" + } + }, + "allowed_actions": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "TenantsMap": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Tenant" + } + }, + "Termvectors_BodyParams": { + "type": "object", + "description": "Define parameters and or supply a document to get termvectors for. See documentation." + }, + "Time": { + "type": "string", + "description": "The unit in which to display time values.", + "enum": [ + "d", + "h", + "m", + "s", + "ms", + "micros", + "nanos" + ] + }, + "Total": { + "type": "object", + "properties": { + "value": { + "type": "integer", + "format": "int32" + }, + "relation": { + "$ref": "#/components/schemas/Relation" + } + } + }, + "UpdateAuditConfigurationResponseContent": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Security Operation Status" + }, + "message": { + "type": "string", + "description": "Security Operation Message" + } + } + }, + "UpdateByQuery_BodyParams": { + "type": "object", + "description": "The search definition using the Query DSL" + }, + "UpdateConfigurationResponseContent": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Security Operation Status" + }, + "message": { + "type": "string", + "description": "Security Operation Message" + } + } + }, + "UpdateDistinguishedNamesResponseContent": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Security Operation Status" + }, + "message": { + "type": "string", + "description": "Security Operation Message" + } + } + }, + "Update_BodyParams": { + "type": "object", + "description": "The request definition requires either `script` or partial `doc`" + }, + "User": { + "type": "object", + "properties": { + "hash": { + "type": "string" + }, + "reserved": { + "type": "boolean" + }, + "hidden": { + "type": "boolean" + }, + "backend_roles": { + "type": "array", + "items": { + "type": "string" + } + }, + "attributes": { + "$ref": "#/components/schemas/UserAttributes" + }, + "description": { + "type": "string" + }, + "opendistro_security_roles": { + "type": "array", + "items": { + "type": "string" + } + }, + "static": { + "type": "boolean" + } + } + }, + "UserAttributes": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "UserDefinedObjectStructure": { + "type": "object", + "properties": { + "bool": {}, + "boosting": {}, + "combined_fields": {}, + "constant_score": {}, + "dis_max": {}, + "distance_feature": {}, + "exists": {}, + "function_score": {}, + "fuzzy": { + "$ref": "#/components/schemas/UserDefinedValueMap" + }, + "geo_bounding_box": {}, + "geo_distance": {}, + "geo_polygon": {}, + "geo_shape": {}, + "has_child": {}, + "has_parent": {}, + "ids": {}, + "intervals": { + "$ref": "#/components/schemas/UserDefinedValueMap" + }, + "knn": {}, + "match": { + "$ref": "#/components/schemas/UserDefinedValueMap" + }, + "match_all": {}, + "match_bool_prefix": { + "$ref": "#/components/schemas/UserDefinedValueMap" + }, + "match_none": {}, + "match_phrase": { + "$ref": "#/components/schemas/UserDefinedValueMap" + }, + "match_phrase_prefix": { + "$ref": "#/components/schemas/UserDefinedValueMap" + }, + "more_like_this": {}, + "multi_match": {}, + "nested": {}, + "parent_id": {}, + "percolate": {}, + "pinned": {}, + "prefix": { + "$ref": "#/components/schemas/UserDefinedValueMap" + }, + "query_string": {}, + "range": { + "$ref": "#/components/schemas/UserDefinedValueMap" + }, + "rank_feature": {}, + "regexp": { + "$ref": "#/components/schemas/UserDefinedValueMap" + }, + "script": {}, + "script_score": {}, + "shape": {}, + "simple_query_string": {}, + "span_containing": {}, + "field_masking_span": {}, + "span_first": {}, + "span_multi": {}, + "span_near": {}, + "span_not": {}, + "span_or": {}, + "span_term": { + "$ref": "#/components/schemas/UserDefinedValueMap" + }, + "span_within": {}, + "term": { + "$ref": "#/components/schemas/UserDefinedValueMap" + }, + "terms": {}, + "terms_set": { + "$ref": "#/components/schemas/UserDefinedValueMap" + }, + "wildcard": { + "$ref": "#/components/schemas/UserDefinedValueMap" + }, + "wrapper": {} + } + }, + "UserDefinedStructure": { + "type": "object", + "properties": { + "alias": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "type": "string" + } + }, + "filter": {}, + "index": { + "type": "string" + }, + "indices": { + "type": "array", + "items": { + "type": "string" + } + }, + "index_routing": { + "type": "string" + }, + "is_hidden": { + "type": "boolean" + }, + "is_write_index": { + "type": "boolean" + }, + "must_exist": { + "type": "string" + }, + "routing": { + "type": "string" + }, + "search_routing": { + "type": "string" + } + } + }, + "UserDefinedValueMap": { + "type": "object", + "additionalProperties": {} + }, + "UserTenants": { + "type": "object", + "properties": { + "global_tenant": { + "type": "boolean" + }, + "admin_tenant": { + "type": "boolean" + }, + "admin": { + "type": "boolean" + } + } + }, + "UsersMap": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/User" + } + }, + "VersionType": { + "type": "string", + "description": "Specific version type.", + "enum": [ + "internal", + "external", + "external_gte", + "force" + ] + }, + "WaitForEvents": { + "type": "string", + "description": "Wait until all currently queued events with the given priority are processed.", + "enum": [ + "immediate", + "urgent", + "high", + "normal", + "low", + "languid" + ] + }, + "WaitForStatus": { + "type": "string", + "description": "Wait until cluster is in a specific state.", + "enum": [ + "green", + "yellow", + "red" + ] + } + }, + "securitySchemes": { + "smithy.api.httpBasicAuth": { + "type": "http", + "description": "HTTP Basic authentication", + "scheme": "Basic" + } + } + }, + "security": [ + { + "smithy.api.httpBasicAuth": [] + } + ] +} diff --git a/src/ApiGenerator/Program.cs b/src/ApiGenerator/Program.cs new file mode 100644 index 0000000000..4a219ddf11 --- /dev/null +++ b/src/ApiGenerator/Program.cs @@ -0,0 +1,184 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using ApiGenerator.Configuration; +using Spectre.Console; + +#pragma warning disable 162 + +namespace ApiGenerator +{ + public static class Program + { + private static bool Interactive { get; set; } = false; + + /// + /// A main function can also take which is hooked up to support termination (e.g CTRL+C) + /// + /// The stack's branch we are targeting the generation for + /// Run the generation interactively, this will ignore all flags + /// Whether to download the specs or use an already downloaded copy + /// Also generate the high level client (OpenSearch.Client) + /// Only download the specs, skip all code generation + /// + /// + private static async Task Main( + string branch, bool interactive = false, bool download = false, bool includeHighLevel = false, bool skipGenerate = false + , CancellationToken token = default) + { + Interactive = interactive; + try + { + if (string.IsNullOrEmpty(branch)) + { + + throw new ArgumentException("--branch can not be null"); + } + await Generate(download, branch, includeHighLevel, skipGenerate, token); + } + catch (OperationCanceledException) + { + AnsiConsole.WriteLine(); + AnsiConsole.Write(new Rule("[b white on orange4_1] Cancelled [/]").LeftJustified()); + AnsiConsole.WriteLine(); + return 1; + } + catch (Exception ex) + { + AnsiConsole.WriteLine(); + AnsiConsole.Write(new Rule("[b white on darkred] Exception [/]").LeftJustified()); + AnsiConsole.WriteLine(); + AnsiConsole.WriteException(ex, ExceptionFormats.ShowLinks); + return 1; + } + return 0; + } + + private static async Task Generate(bool download, string branch, bool includeHighLevel, bool skipGenerate, CancellationToken token = default) + { + var redownloadCoreSpecification = Ask("Download online rest specifications?", download); + + var downloadBranch = branch; + if (Interactive && redownloadCoreSpecification) + { + Console.Write($"Branch to download specification from (default {downloadBranch}): "); + var readBranch = Console.ReadLine()?.Trim(); + if (!string.IsNullOrEmpty(readBranch)) + downloadBranch = readBranch; + } + + if (string.IsNullOrEmpty(downloadBranch)) + throw new Exception($"Branch to download from is null or empty"); + + var generateCode = Ask("Generate code from the specification files on disk?", !skipGenerate); + var lowLevelOnly = generateCode && Ask("Generate low level client only?", !includeHighLevel); + + static string YesNo(bool value) => value ? "[bold green]Yes[/]" : "[grey]No[/]"; + var grid = new Grid() + .AddColumn(new GridColumn().PadRight(4)) + .AddColumn() + .AddRow("[b]Download specification[/]", $"{YesNo(download)}") + .AddRow("[b]Download branch[/]", $"{downloadBranch}") + .AddRow("[b]Generate code from specification[/]", $"{YesNo(generateCode)}") + .AddRow("[b]Include high level client[/]", $"{YesNo(!lowLevelOnly)}"); + + Console.WriteLine(); + AnsiConsole.Write( + new Panel(grid) + .Header(new PanelHeader("[b white on chartreuse4] OpenSearch .NET client API generator [/]", Justify.Left)) + ); + Console.WriteLine(); + + if (redownloadCoreSpecification) + { + Console.WriteLine(); + AnsiConsole.Write(new Rule("[b white on chartreuse4] Downloading specification [/]").LeftJustified()); + Console.WriteLine(); + await RestSpecDownloader.DownloadAsync(downloadBranch, token); + } + + if (!generateCode) return 0; + + Console.WriteLine(); + AnsiConsole.Write(new Rule("[b white on chartreuse4] Loading specification [/]").LeftJustified()); + Console.WriteLine(); + + var spec = await Generator.ApiGenerator.CreateRestApiSpecModel(token); + if (!lowLevelOnly) + { + foreach (var endpoint in spec.Endpoints.Select(e => e.Value.Name)) + { + if (CodeConfiguration.IsNewHighLevelApi(endpoint) + && Ask($"Generate highlevel code for new api {endpoint}", false)) + CodeConfiguration.EnableHighLevelCodeGen.Add(endpoint); + + } + } + + Console.WriteLine(); + AnsiConsole.Write(new Rule("[b white on chartreuse4] Generating code [/]").LeftJustified()); + Console.WriteLine(); + + await Generator.ApiGenerator.Generate(lowLevelOnly, spec, token); + + var warnings = Generator.ApiGenerator.Warnings; + if (warnings.Count > 0) + { + Console.WriteLine(); + AnsiConsole.Write(new Rule("[b black on yellow] Specification warnings [/]").LeftJustified()); + Console.WriteLine(); + + foreach (var warning in warnings.Distinct().OrderBy(w => w)) + AnsiConsole.MarkupLine(" {0} [yellow] {1} [/] ", Emoji.Known.Warning, warning); + } + + return 0; + } + + private static bool Ask(string question, bool defaultAnswer = true) + { + if (!Interactive) return defaultAnswer; + + var answer = "invalid"; + var defaultResponse = defaultAnswer ? "y" : "n"; + + while (answer != "y" && answer != "n" && answer != "") + { + Console.Write($"{question}[y/N] (default {defaultResponse}): "); + answer = Console.ReadLine()?.Trim().ToLowerInvariant(); + if (string.IsNullOrWhiteSpace(answer)) answer = defaultResponse; + defaultAnswer = answer == "y"; + } + return defaultAnswer; + } + } +} diff --git a/src/ApiGenerator/RestSpecDownloader.cs b/src/ApiGenerator/RestSpecDownloader.cs new file mode 100644 index 0000000000..5eb276ef7a --- /dev/null +++ b/src/ApiGenerator/RestSpecDownloader.cs @@ -0,0 +1,51 @@ +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +using System; +using System.IO; +using System.Net.Http; +using System.Threading; +using System.Threading.Tasks; +using ApiGenerator.Configuration; + +namespace ApiGenerator +{ + public static class RestSpecDownloader + { + private static readonly HttpClient Http = new(); + + public static async Task DownloadAsync(string branch, CancellationToken token) + { + var githubUrl = $"https://raw.githubusercontent.com/opensearch-project/opensearch-api-specification/{branch}/OpenSearch.openapi.json"; + Console.WriteLine($"Downloading OpenAPI spec for branch {branch}"); + var spec = await Http.GetStringAsync(githubUrl, token); + await File.WriteAllTextAsync(GeneratorLocations.OpenApiSpecFile, spec, token); + Console.WriteLine($"Downloaded OpenAPI spec for branch {branch}"); + } + } +} diff --git a/src/ApiGenerator/Views/GeneratorNotice.cshtml b/src/ApiGenerator/Views/GeneratorNotice.cshtml new file mode 100644 index 0000000000..039524ceae --- /dev/null +++ b/src/ApiGenerator/Views/GeneratorNotice.cshtml @@ -0,0 +1,47 @@ +@using ApiGenerator +@inherits CodeTemplatePage +/* SPDX-License-Identifier: Apache-2.0 +* +* The OpenSearch Contributors require contributions made to +* this file be licensed under the Apache-2.0 license or a +* compatible open source license. +*/@if (Model) +{ +/* +* Modifications Copyright OpenSearch Contributors. See +* GitHub history for details. +* +* Licensed to Elasticsearch B.V. under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch B.V. licenses this file to you under +* the Apache License, Version 2.0 (the "License"); you may +* not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ +} +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ----------------------------------------------- +// +// This file is automatically generated +// Please do not edit these files manually +// Run the following in the root of the repos: +// +// *NIX : ./build.sh codegen +// Windows : build.bat codegen +// +// ----------------------------------------------- diff --git a/src/ApiGenerator/Views/HighLevel/Client/FluentSyntax/FluentMethod.cshtml b/src/ApiGenerator/Views/HighLevel/Client/FluentSyntax/FluentMethod.cshtml new file mode 100644 index 0000000000..e748bf9fff --- /dev/null +++ b/src/ApiGenerator/Views/HighLevel/Client/FluentSyntax/FluentMethod.cshtml @@ -0,0 +1,18 @@ +@using System +@using ApiGenerator.Domain.Code.HighLevel.Methods +@inherits ApiGenerator.CodeTemplatePage +@{ + var method = !Model.Async ? Model.Syntax.MethodName : string.Format("{0}Async", Model.Syntax.MethodName); + var asyncKeyword = Model.Syntax.InterfaceResponse && Model.Async ? "async " : string.Empty; + var awaitKeyWord = Model.Syntax.InterfaceResponse && Model.Async ? "await ": string.Empty; + var configureAwait = Model.Syntax.InterfaceResponse && Model.Async ? ".ConfigureAwait(false)" : string.Empty; + + var requestMethodGenerics = Model.Syntax.RequestMethodGenerics; + var descriptor = Model.Syntax.DescriptorName; + var selectorArgs = Model.Syntax.SelectorArguments(); + var selectorChained = Model.Syntax.SelectorChainedDefaults(); + var cancellationToken = !Model.Async ? string.Empty : ", ct"; +} +@{ await IncludeAsync("HighLevel/Client/MethodXmlDocs.cshtml", Model.Syntax); } +public @(asyncKeyword)@{ await IncludeAsync("HighLevel/Client/FluentSyntax/FluentMethodHeader.cshtml", Model);} @Raw("=>") + @(awaitKeyWord)@(method)@(Raw(requestMethodGenerics))(selector.InvokeOrDefault(new @(Raw(descriptor))(@Raw(selectorArgs))@(@selectorChained))@cancellationToken)@Raw(configureAwait); diff --git a/src/ApiGenerator/Views/HighLevel/Client/FluentSyntax/FluentMethodHeader.cshtml b/src/ApiGenerator/Views/HighLevel/Client/FluentSyntax/FluentMethodHeader.cshtml new file mode 100644 index 0000000000..fa7873f2d9 --- /dev/null +++ b/src/ApiGenerator/Views/HighLevel/Client/FluentSyntax/FluentMethodHeader.cshtml @@ -0,0 +1,14 @@ +@using ApiGenerator.Domain.Code.HighLevel.Methods +@inherits ApiGenerator.CodeTemplatePage +@{ + var response = !Model.Async ? Model.Syntax.ResponseName : string.Format("Task<{0}>", Model.Syntax.ResponseName); + var method = !Model.Async ? Model.Syntax.MethodName : string.Format("{0}Async", Model.Syntax.MethodName); + + var methodGenerics = Model.Syntax.MethodGenerics; + var descriptorArgs = Model.Syntax.DescriptorArguments(); + var selector = Model.Syntax.Selector; + var optionalSelector = Model.Syntax.OptionalSelectorSuffix; + var whereClause = Model.Syntax.GenericWhereClause; + var cancellationToken = !Model.Async ? string.Empty : ", CancellationToken ct = default"; +} +@Raw(response) @(method)@(Raw(methodGenerics))(@(Raw(descriptorArgs))@(Raw(selector)) selector@(optionalSelector)@(cancellationToken))@whereClause diff --git a/src/ApiGenerator/Views/HighLevel/Client/Implementation/MethodImplementation.cshtml b/src/ApiGenerator/Views/HighLevel/Client/Implementation/MethodImplementation.cshtml new file mode 100644 index 0000000000..6469fa22f1 --- /dev/null +++ b/src/ApiGenerator/Views/HighLevel/Client/Implementation/MethodImplementation.cshtml @@ -0,0 +1,19 @@ +@using ApiGenerator +@using ApiGenerator.Domain.Code.HighLevel.Methods +@using HighLevelModel = ApiGenerator.Domain.Code.HighLevel.Methods.HighLevelModel +@inherits CodeTemplatePage +@{ + const string fluentPath = "HighLevel/Client/FluentSyntax/FluentMethod.cshtml"; + const string initializerPath = "HighLevel/Client/InitializerSyntax/InitializerMethod.cshtml"; +} +@{ await IncludeAsync(fluentPath, new FluentSyntaxView(Model.Fluent, async: false)); } +@{ await IncludeAsync(fluentPath, new FluentSyntaxView(Model.Fluent, async: true)); } +@if (Model.FluentBound != null) +{ + + @{ await IncludeAsync(fluentPath, new FluentSyntaxView(Model.FluentBound, async: false)); } + @{ await IncludeAsync(fluentPath, new FluentSyntaxView(Model.FluentBound, async: true)); } + +} +@{ await IncludeAsync(initializerPath, new InitializerSyntaxView(Model.Initializer, async: false)); } +@{ await IncludeAsync(initializerPath, new InitializerSyntaxView(Model.Initializer, async: true)); } diff --git a/src/ApiGenerator/Views/HighLevel/Client/Implementation/OpenSearchClient.Namespace.cshtml b/src/ApiGenerator/Views/HighLevel/Client/Implementation/OpenSearchClient.Namespace.cshtml new file mode 100644 index 0000000000..ebbbf3bc60 --- /dev/null +++ b/src/ApiGenerator/Views/HighLevel/Client/Implementation/OpenSearchClient.Namespace.cshtml @@ -0,0 +1,35 @@ +@using ApiGenerator +@using System.Collections.Generic +@using System.Collections.ObjectModel +@using ApiGenerator.Domain.Code +@using ApiGenerator.Domain.Specification +@inherits ApiGenerator.CodeTemplatePage>> +@{ + var (ns, endpoints) = Model; +} +@{ await IncludeLegacyGeneratorNotice(); } +// ReSharper disable RedundantUsingDirective +using System; +using System.Threading; +using System.Threading.Tasks; +using OpenSearch.Net.@(CsharpNames.ApiNamespace).@ns@(CsharpNames.ApiNamespaceSuffix); + +// ReSharper disable once CheckNamespace +// ReSharper disable RedundantTypeArgumentsOfMethod +namespace OpenSearch.Client.@(CsharpNames.ApiNamespace).@ns@(CsharpNames.ApiNamespaceSuffix) +{ + /// + /// @ns.SplitPascalCase() APIs. + /// Not intended to be instantiated directly. Use the property + /// on . + /// + /// + public partial class @(CsharpNames.HighLevelClientNamespacePrefix)@ns@(CsharpNames.ClientNamespaceSuffix) : NamespacedClientProxy + { + internal @(CsharpNames.HighLevelClientNamespacePrefix)@ns@(CsharpNames.ClientNamespaceSuffix)(OpenSearchClient client) : base(client) {} + @foreach(var e in endpoints) + { + await IncludeAsync("HighLevel/Client/Implementation/MethodImplementation.cshtml", e.HighLevelModel); + } + } +} diff --git a/src/ApiGenerator/Views/HighLevel/Client/Implementation/OpenSearchClient.cshtml b/src/ApiGenerator/Views/HighLevel/Client/Implementation/OpenSearchClient.cshtml new file mode 100644 index 0000000000..d4c6cd28e3 --- /dev/null +++ b/src/ApiGenerator/Views/HighLevel/Client/Implementation/OpenSearchClient.cshtml @@ -0,0 +1,59 @@ +@using System.Linq +@using ApiGenerator.Domain +@using ApiGenerator +@using ApiGenerator.Domain.Code +@inherits CodeTemplatePage +@{ await IncludeLegacyGeneratorNotice(); } +// ReSharper disable RedundantUsingDirective +using System; +using System.Threading; +using System.Threading.Tasks; +using OpenSearch.Client; +@{ await IncludeAsync("HighLevel/Client/Usings.cshtml", Model);} + +@{ + var namespaces = Model.EndpointsPerNamespaceHighLevel.Keys.ToHashSet(); + namespaces.Remove(CsharpNames.RootNamespace); + namespaces.Add("Http"); + + +// ReSharper disable RedundantTypeArgumentsOfMethod +namespace OpenSearch.Client +{ + /// + /// OpenSearch high level client + /// + public partial class OpenSearchClient : IOpenSearchClient + { + + foreach (var ns in namespaces) + { + /// @(ns.SplitPascalCase()) APIs + public @CsharpNames.HighLevelClientNamespacePrefix@(ns)@CsharpNames.ClientNamespaceSuffix @ns { get; private set; } + + } + + partial void SetupGeneratedNamespaces() + { + + foreach (var ns in namespaces) + { + @(ns) = new @(CsharpNames.HighLevelClientNamespacePrefix)@(ns)@(CsharpNames.ClientNamespaceSuffix)(this); + + } + + } + + + if(Model.EndpointsPerNamespaceHighLevel.TryGetValue(CsharpNames.RootNamespace, out var endpoints)) + { + foreach(var m in endpoints.Select(e => e.HighLevelModel)) + { + await IncludeAsync("HighLevel/Client/Implementation/MethodImplementation.cshtml", m); + } + } + + } + } + +} diff --git a/src/ApiGenerator/Views/HighLevel/Client/InitializerSyntax/InitializerMethod.cshtml b/src/ApiGenerator/Views/HighLevel/Client/InitializerSyntax/InitializerMethod.cshtml new file mode 100644 index 0000000000..0526bad6b1 --- /dev/null +++ b/src/ApiGenerator/Views/HighLevel/Client/InitializerSyntax/InitializerMethod.cshtml @@ -0,0 +1,20 @@ +@using System +@using ApiGenerator.Domain.Code.HighLevel.Methods +@inherits ApiGenerator.CodeTemplatePage +@{ + var dispatchMethod = !Model.Async ? Model.Syntax.DispatchMethod : string.Format("{0}Async", Model.Syntax.DispatchMethod); + var dispatchGenerics = Model.Syntax.DispatchGenerics; + var dispatchParameters = Model.Syntax.DispatchParameters; + var asyncKeyword = Model.Syntax.InterfaceResponse && Model.Async ? "async " : String.Empty; + var awaitKeyWord = Model.Syntax.InterfaceResponse && Model.Async ? "await ": string.Empty; + var configureAwait = Model.Syntax.InterfaceResponse && Model.Async ? ".ConfigureAwait(false)" : String.Empty; + if (Model.Async) + { + dispatchParameters += ", ct"; + } +} +@{ await IncludeAsync("HighLevel/Client/MethodXmlDocs.cshtml", Model.Syntax); } +public @Raw(asyncKeyword)@{ await IncludeAsync("HighLevel/Client/InitializerSyntax/InitializerMethodHeader.cshtml", Model); } @Raw("=>") + @(awaitKeyWord)@(dispatchMethod)@(Raw(dispatchGenerics))(@Raw(dispatchParameters))@Raw(configureAwait); + + diff --git a/src/ApiGenerator/Views/HighLevel/Client/InitializerSyntax/InitializerMethodHeader.cshtml b/src/ApiGenerator/Views/HighLevel/Client/InitializerSyntax/InitializerMethodHeader.cshtml new file mode 100644 index 0000000000..f93edc5877 --- /dev/null +++ b/src/ApiGenerator/Views/HighLevel/Client/InitializerSyntax/InitializerMethodHeader.cshtml @@ -0,0 +1,15 @@ +@using ApiGenerator.Domain.Code.HighLevel.Methods +@inherits ApiGenerator.CodeTemplatePage +@{ + var response = !Model.Async ? Model.Syntax.ResponseName : string.Format("Task<{0}>", Model.Syntax.ResponseName); + var method = !Model.Async ? Model.Syntax.MethodName : string.Format("{0}Async", Model.Syntax.MethodName); + var requestMethodGenerics = Model.Syntax.MethodGenerics; + + var methodsArgs = string.Format("{0} request", Model.Syntax.ArgumentType); + if (Model.Async) + { + methodsArgs += ", CancellationToken ct = default"; + } + var whereClause = Model.Syntax.GenericWhereClause; +} +@Raw(response) @(method)@(Raw(requestMethodGenerics))(@Raw(methodsArgs))@whereClause diff --git a/src/ApiGenerator/Views/HighLevel/Client/Interface/IOpenSearchClient.cshtml b/src/ApiGenerator/Views/HighLevel/Client/Interface/IOpenSearchClient.cshtml new file mode 100644 index 0000000000..fc35066b57 --- /dev/null +++ b/src/ApiGenerator/Views/HighLevel/Client/Interface/IOpenSearchClient.cshtml @@ -0,0 +1,44 @@ +@using System.Linq +@using ApiGenerator +@using ApiGenerator.Domain +@using ApiGenerator.Domain.Code +@inherits ApiGenerator.CodeTemplatePage +@{ await IncludeLegacyGeneratorNotice(); } +// ReSharper disable RedundantUsingDirective +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using System.Linq; +using OpenSearch.Client; +@{ await IncludeAsync("HighLevel/Client/Usings.cshtml", Model);} + +namespace OpenSearch.Client +{ + /// + /// OpenSearch high level client + /// + public partial interface IOpenSearchClient + { + @{ + var namespaces = Model.EndpointsPerNamespaceHighLevel.Keys.ToHashSet(); + namespaces.Remove(CsharpNames.RootNamespace); + namespaces.Add("Http"); + + foreach (var ns in namespaces) + { + /// @ns.SplitPascalCase() APIs + @CsharpNames.HighLevelClientNamespacePrefix@(ns)@CsharpNames.ClientNamespaceSuffix @ns { get; } + + } + + if(Model.EndpointsPerNamespaceHighLevel.TryGetValue(CsharpNames.RootNamespace, out var endpoints)) + { + foreach(var m in endpoints.Select(e => e.HighLevelModel)) + { + await IncludeAsync("HighLevel/Client/Interface/MethodInterface.cshtml", m); + } + } + } + } +} diff --git a/src/ApiGenerator/Views/HighLevel/Client/Interface/MethodInterface.cshtml b/src/ApiGenerator/Views/HighLevel/Client/Interface/MethodInterface.cshtml new file mode 100644 index 0000000000..e9e336e5af --- /dev/null +++ b/src/ApiGenerator/Views/HighLevel/Client/Interface/MethodInterface.cshtml @@ -0,0 +1,29 @@ +@using ApiGenerator +@using ApiGenerator.Domain.Code.HighLevel.Methods +@using HighLevelModel = ApiGenerator.Domain.Code.HighLevel.Methods.HighLevelModel +@inherits CodeTemplatePage +@{ + const string fluentPath = "HighLevel/Client/FluentSyntax/FluentMethodHeader.cshtml"; + const string initializerPath = "HighLevel/Client/InitializerSyntax/InitializerMethodHeader.cshtml"; + const string xmlDocsPath = "HighLevel/Client/MethodXmlDocs.cshtml"; +} + +@{ await IncludeAsync(xmlDocsPath, Model.Fluent); } +@{ await IncludeAsync(fluentPath, new FluentSyntaxView(Model.Fluent, async: false)); }; +@{ await IncludeAsync(xmlDocsPath, Model.Fluent); } +@{ await IncludeAsync(fluentPath, new FluentSyntaxView(Model.Fluent, async: true)); }; + +@if (Model.FluentBound != null) +{ + + @{ await IncludeAsync(xmlDocsPath, Model.FluentBound); } + @{ await IncludeAsync(fluentPath, new FluentSyntaxView(Model.FluentBound, async: false)); }; + @{ await IncludeAsync(xmlDocsPath, Model.FluentBound); } + @{ await IncludeAsync(fluentPath, new FluentSyntaxView(Model.FluentBound, async: true)); }; + +} +@{ await IncludeAsync(xmlDocsPath, Model.Initializer); } +@{ await IncludeAsync(initializerPath, new InitializerSyntaxView(Model.Initializer, async: false)); }; +@{ await IncludeAsync(xmlDocsPath, Model.Initializer); } +@{ await IncludeAsync(initializerPath, new InitializerSyntaxView(Model.Initializer, async: true)); }; + diff --git a/src/ApiGenerator/Views/HighLevel/Client/MethodXmlDocs.cshtml b/src/ApiGenerator/Views/HighLevel/Client/MethodXmlDocs.cshtml new file mode 100644 index 0000000000..0a4ec9a61b --- /dev/null +++ b/src/ApiGenerator/Views/HighLevel/Client/MethodXmlDocs.cshtml @@ -0,0 +1,18 @@ +@using ApiGenerator +@using ApiGenerator.Domain.Code.HighLevel.Methods; +@using Version = SemanticVersioning.Version; +@inherits CodeTemplatePage +/// +/// @Raw(Model.XmlDocSummary) +/// @Raw("") +/// @Model.DocumentationLink +/// +@if (Model.VersionAdded is {} versionAdded && versionAdded > new Version("1.0.0")) +{ +/// Supported by OpenSearch servers of version @(versionAdded) or greater. + +} +@if (Model.Deprecated is {} deprecation) +{ +@Raw($"[Obsolete(\"{deprecation}\")]") +} diff --git a/src/ApiGenerator/Views/HighLevel/Client/Usings.cshtml b/src/ApiGenerator/Views/HighLevel/Client/Usings.cshtml new file mode 100644 index 0000000000..65b76adb6e --- /dev/null +++ b/src/ApiGenerator/Views/HighLevel/Client/Usings.cshtml @@ -0,0 +1,14 @@ +@using ApiGenerator.Domain +@using ApiGenerator.Domain.Code +@inherits ApiGenerator.CodeTemplatePage +@{ + var namespaces = Model.EndpointsPerNamespaceHighLevel.Keys.ToHashSet(); + namespaces.Remove(CsharpNames.RootNamespace); + namespaces.Add("Http"); + + foreach (var ns in namespaces) + { +using OpenSearch.Client.@(CsharpNames.ApiNamespace).@(ns)@(CsharpNames.ApiNamespaceSuffix); + + } +} diff --git a/src/ApiGenerator/Views/HighLevel/Descriptors/Descriptor.cshtml b/src/ApiGenerator/Views/HighLevel/Descriptors/Descriptor.cshtml new file mode 100644 index 0000000000..2e0626c3c1 --- /dev/null +++ b/src/ApiGenerator/Views/HighLevel/Descriptors/Descriptor.cshtml @@ -0,0 +1,86 @@ +@using System.Linq +@using ApiGenerator +@using ApiGenerator.Domain.Code.HighLevel.Requests +@using ApiGenerator.Generator +@inherits global::ApiGenerator.CodeTemplatePage +@{ + var names = Model.CsharpNames; + var type = names.GenericOrNonGenericDescriptorName; + var concreteInterface = names.GenericOrNonGenericInterfaceName; + var baseInterface = names.GenericOrNonGenericInterfacePreference; + var apiLookup = $"ApiUrlsLookups.{Model.CsharpNames.Namespace}{Model.CsharpNames.MethodName}"; +} + /// Descriptor for @names.MethodName@(Raw(Model.OfficialDocumentationLink.IsNullOrEmpty() ? "" : " " + Model.OfficialDocumentationLink + "")) + public partial class @Raw(type) @(Raw(string.Format(" : RequestDescriptorBase<{0},{1}, {2}>, {2}", type,names.ParametersName, concreteInterface))) + { + internal override ApiUrls ApiUrls => @apiLookup; +@foreach (var c in Model.Constructors) +{ + @(Raw(CodeGenerator.Constructor(c))) + +} + // values part of the url path +@foreach (var part in Model.Parts) +{ + @(Raw(part.HighLevelTypeName)) @(Raw(baseInterface)).@(part.InterfaceName) => Self.RouteValues.Get@(Raw(string.Format("<{0}>",part.HighLevelTypeName)))("@(part.Name)"); + +} +@foreach (var c in Model.GetFluentRouteSetters()) +{ + + @(Raw(c.XmlDoc)) + @(Raw(c.Code)) + +} + // Request parameters +@foreach (var param in Model.Params) +{ + var original = param.QueryStringKey; + //skip parameters already part of the path portion of the url + if (Model.Parts.Any(p=>p.Name == original)) + { + continue; + } + //we prefer this parameter to be explictly implemented on the request body + if (param.RenderPartial && (Model.HasBody)) + { + continue; + } + var t = @param.TypeHighLevel; + var tSuffix = (t == "bool" || t == "bool?") ? " = true" : ""; + var typed = !string.IsNullOrEmpty(names.GenericsDeclaredOnDescriptor); + var g = typed ? names.GenericsDeclaredOnDescriptor.Replace("<", "").Replace(">", "") : "T"; + + await IncludeAsync("HighLevel/Descriptors/XmlDocs.cshtml", param); + + if(!string.IsNullOrWhiteSpace(param.Obsolete)) + { + [Obsolete("@Raw(param.Obsolete)")] + + } + public @Raw(type) @(param.ClsName)(@param.DescriptorArgumentType @param.ClsArgumentName@tSuffix) => Qs("@original", @(param.ClsArgumentName)); + + if (param.IsFieldsParam) + { + + /// @param.Description + public @Raw(type) @param.ClsName@(Raw(typed ? "" : ""))(params @Raw("Expression>[]") fields) @Raw(typed ? "" : "where " + g + " : class") => Qs("@original", fields?@Raw(".Select(e=>(Field)e)")); + + } + else if (param.IsFieldParam) + { + + /// @param.Description + public @Raw(type) @param.ClsName@(Raw(typed ? "" : ""))(@Raw("Expression>") field) @Raw(typed ? "" : "where " + g + " : class") => Qs("@original", (Field)field); + + } +} + @if (names.DescriptorNotFoundInCodebase) + { + [Obsolete("Unmapped, blacklist this API in CodeConfiguration.cs or implement @names.DescriptorName and @names.RequestName in a file called @(names.RequestName).cs in OSC's codebase", true)] + public bool IsUnmapped => true; + public bool UseIsUnmapped => IsUnmapped; + + } + } + diff --git a/src/ApiGenerator/Views/HighLevel/Descriptors/Descriptors.cshtml b/src/ApiGenerator/Views/HighLevel/Descriptors/Descriptors.cshtml new file mode 100644 index 0000000000..46c8bcba21 --- /dev/null +++ b/src/ApiGenerator/Views/HighLevel/Descriptors/Descriptors.cshtml @@ -0,0 +1,36 @@ +@using System.Collections.ObjectModel +@using ApiGenerator +@using ApiGenerator.Domain.Specification +@using ApiGenerator.Domain.Code +@inherits CodeTemplatePage>> +@{ + var (ns, endpoints) = Model; + ns = ns != CsharpNames.RootNamespace ? $".{CsharpNames.ApiNamespace}.{ns}{CsharpNames.ApiNamespaceSuffix}" : null; +} +@{ await IncludeLegacyGeneratorNotice(); } +// ReSharper disable RedundantUsingDirective +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Linq.Expressions; + +using OpenSearch.Net; +using OpenSearch.Net.Utf8Json; +@if (ns != null) +{ + using OpenSearch.Net@(ns); + +} + +// ReSharper disable RedundantBaseConstructorCall +// ReSharper disable UnusedTypeParameter +// ReSharper disable PartialMethodWithSinglePart +// ReSharper disable RedundantNameQualifier +namespace OpenSearch.Client +{ +@foreach (var endpoint in endpoints) +{ + await IncludeAsync("HighLevel/Descriptors/Descriptor.cshtml", endpoint.DescriptorPartialImplementation); +} +} diff --git a/src/ApiGenerator/Views/HighLevel/Descriptors/RequestDescriptorBase.cshtml b/src/ApiGenerator/Views/HighLevel/Descriptors/RequestDescriptorBase.cshtml new file mode 100644 index 0000000000..43d6ed6d08 --- /dev/null +++ b/src/ApiGenerator/Views/HighLevel/Descriptors/RequestDescriptorBase.cshtml @@ -0,0 +1,12 @@ +@using ApiGenerator.Domain +@inherits ApiGenerator.CodeTemplatePage +@{ await IncludeLegacyGeneratorNotice(); } +using System.Collections.Generic; + +namespace OpenSearch.Client +{ + // ReSharper disable UnusedTypeParameter + public abstract partial class @Raw("RequestDescriptorBase") + { + } +} diff --git a/src/ApiGenerator/Views/HighLevel/Descriptors/XmlDocs.cshtml b/src/ApiGenerator/Views/HighLevel/Descriptors/XmlDocs.cshtml new file mode 100644 index 0000000000..5435af2bf5 --- /dev/null +++ b/src/ApiGenerator/Views/HighLevel/Descriptors/XmlDocs.cshtml @@ -0,0 +1,24 @@ +@using System.Linq +@using Version = SemanticVersioning.Version +@inherits ApiGenerator.CodeTemplatePage +@{ + var docs = Model.DescriptionHighLevel.ToList(); + var description = docs.Count == 1 ? docs.First() : string.Join($"{Environment.NewLine}\t\t", docs.Select(d => "/// " + d)); + if (docs.Count == 1) + { + /// @Raw(description) + + } + else + { + /// + @Raw(description) + /// + + } + if (Model.VersionAdded is {} versionAdded && versionAdded > new Version("1.0.0")) + { + /// Supported by OpenSearch servers of version @(versionAdded) or greater. + + } +} diff --git a/src/ApiGenerator/Views/HighLevel/Requests/ApiUrlsLookup.cshtml b/src/ApiGenerator/Views/HighLevel/Requests/ApiUrlsLookup.cshtml new file mode 100644 index 0000000000..eaca2173f2 --- /dev/null +++ b/src/ApiGenerator/Views/HighLevel/Requests/ApiUrlsLookup.cshtml @@ -0,0 +1,24 @@ +@using System.Linq +@using ApiGenerator.Domain +@using ApiGenerator +@using ApiGenerator.Configuration +@inherits CodeTemplatePage +@{ await IncludeLegacyGeneratorNotice(); } +namespace OpenSearch.Client +{ + internal static partial class ApiUrlsLookups + { +@foreach (var endpoint in Model.Endpoints.Values) +{ + if (CodeConfiguration.IgnoreHighLevelApi(endpoint.Name)) + { + continue; + } + var propertyName = $"{endpoint.CsharpNames.Namespace}{endpoint.CsharpNames.MethodName}"; + var paths = !endpoint.Url.Paths.Any() ? endpoint.Url.AllPaths : endpoint.Url.Paths; + + internal static readonly ApiUrls @(Raw(propertyName)) = new(new [] {@Raw(string.Join(", ", paths.Select(p=>$"\"{p.Path.TrimStart('/')}\"")))}); + +} + } +} diff --git a/src/ApiGenerator/Views/HighLevel/Requests/PlainRequestBase.cshtml b/src/ApiGenerator/Views/HighLevel/Requests/PlainRequestBase.cshtml new file mode 100644 index 0000000000..8a0fbafbc6 --- /dev/null +++ b/src/ApiGenerator/Views/HighLevel/Requests/PlainRequestBase.cshtml @@ -0,0 +1,21 @@ +@using ApiGenerator.Domain +@inherits ApiGenerator.CodeTemplatePage +@{ await IncludeLegacyGeneratorNotice(); } +// ReSharper disable RedundantUsingDirective +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Linq.Expressions; +using System.Runtime.Serialization; +using OpenSearch.Net; +using OpenSearch.Net.Utf8Json; +@{ await IncludeAsync("LowLevel/Client/Usings.cshtml", Model);} + +// ReSharper disable UnusedTypeParameter +namespace OpenSearch.Client +{ + public abstract partial class @Raw("PlainRequestBase") + { + } +} diff --git a/src/ApiGenerator/Views/HighLevel/Requests/RequestImplementations.cshtml b/src/ApiGenerator/Views/HighLevel/Requests/RequestImplementations.cshtml new file mode 100644 index 0000000000..0be9404b61 --- /dev/null +++ b/src/ApiGenerator/Views/HighLevel/Requests/RequestImplementations.cshtml @@ -0,0 +1,82 @@ +@using System.Linq +@using ApiGenerator +@using ApiGenerator.Domain.Code.HighLevel.Requests +@using ApiGenerator.Domain.Specification +@using ApiGenerator.Generator +@inherits global::ApiGenerator.CodeTemplatePage +@{ + var apiLookup = $"ApiUrlsLookups.{Model.CsharpNames.Namespace}{Model.CsharpNames.MethodName}"; +} +/// Request for @Model.CsharpNames.MethodName@(Raw(Model.OfficialDocumentationLink.IsNullOrEmpty() ? "" : " " + Model.OfficialDocumentationLink + "")) +@if (Model.Stability != Stability.Stable) +{ + string warningMessage = ""; + switch (Model.Stability) + { + case Stability.Experimental: + warningMessage = "this functionality is experimental and may be changed or removed completely in a future release. OpenSearch will take a best effort approach to fix any issues, but experimental features are not subject to the support SLA of official GA features."; + break; + case Stability.Beta: + warningMessage = "this functionality is in beta and is subject to change. The design and code is less mature than official GA features and is being provided as-is with no warranties. Beta features are not subject to the support SLA of official GA features."; + break; + } + +/// @Raw("Note: " + Model.Stability + " within the OpenSearch server, " + warningMessage + "") + +} + public partial class @Raw(Model.Name) @Raw(string.Format(": PlainRequestBase<{0}>, {1}", Model.CsharpNames.ParametersName, Model.InterfaceName)) +{ + protected @Raw(Model.InterfaceName) Self => this; + internal override ApiUrls ApiUrls => @apiLookup; +@foreach (var c in Model.Constructors) +{ + @(Raw(CodeGenerator.Constructor(c))) + +} + // values part of the url path +@foreach (var part in Model.Parts) +{ + [IgnoreDataMember] + @(Raw(part.HighLevelTypeName)) @(Raw(Model.InterfaceName)).@(part.InterfaceName) => Self.RouteValues.Get@(Raw(string.Format("<{0}>", part.HighLevelTypeName)))("@(part.Name)"); + +} + + // Request parameters +@foreach (var param in Model.Params) +{ + var original = param.QueryStringKey; + //skip parameters already part of the path portion of the url + if (Model.Parts.Any(p=>p.Name == original)) + { + continue; + } + // We prefer to map these explicitly in our own hand written classes. + // The interface generation will generate properties for these so code won't compile until we do + if (param.RenderPartial && (Model.HasBody)) + { + continue; + } + var doc = param.DescriptionHighLevel.ToArray(); + @Raw(param.InitializerGenerator(Model.CsharpNames.Namespace, param.TypeHighLevel, param.ClsName, original, param.SetterHighLevel, param.VersionAdded, doc)) +} +@if (Model.CsharpNames.DescriptorNotFoundInCodebase) +{ + [Obsolete("Unmapped, blacklist this API in CodeConfiguration.cs or implement @Model.CsharpNames.DescriptorName and @Model.CsharpNames.RequestName in a file called @(Model.CsharpNames.RequestName).cs in OSC's codebase", true)] + public bool IsUnmapped => true; + public bool UseIsUnmapped => IsUnmapped; + +} + } +@if (Model.NeedsGenericImplementation) + { + public partial class @Raw(Model.CsharpNames.GenericRequestName) @Raw(string.Format(": {0}, {1}", Model.CsharpNames.RequestName, Model.CsharpNames.GenericInterfaceName)) + { + protected @Raw(Model.CsharpNames.GenericInterfaceName) TypedSelf => this; +@foreach (Constructor c in Model.GenericConstructors) +{ + @(Raw(CodeGenerator.Constructor(c))) + +} + } + +} diff --git a/src/ApiGenerator/Views/HighLevel/Requests/RequestInterface.cshtml b/src/ApiGenerator/Views/HighLevel/Requests/RequestInterface.cshtml new file mode 100644 index 0000000000..efe0da4f29 --- /dev/null +++ b/src/ApiGenerator/Views/HighLevel/Requests/RequestInterface.cshtml @@ -0,0 +1,25 @@ +@using ApiGenerator.Domain.Code.HighLevel.Requests +@inherits ApiGenerator.CodeTemplatePage +@{ + var name = Model.CsharpNames.RequestInterfaceName; +} + [InterfaceDataContract] + public partial interface @Raw(Model.Name) : IRequest@(Raw(string.Format("<{0}>", Model.CsharpNames.ParametersName))) +{ +@foreach (var part in Model.UrlParts) +{ + [IgnoreDataMember] + @(Raw(part.HighLevelTypeName)) @(part.InterfaceName) { get; } + +} +@foreach (var partialParam in Model.PartialParameters) +{ + [DataMember(Name = "@(partialParam.QueryStringKey)")] @(Raw(partialParam.TypeHighLevel)) @(partialParam.ClsName) { get; set; } +} + } +@if (Model.NeedsGenericInterface) +{ + + public partial interface @(name)@Raw(Model.CsharpNames.GenericsDeclaredOnRequest) : @(Raw(name)) { } + +} diff --git a/src/ApiGenerator/Views/HighLevel/Requests/Requests.cshtml b/src/ApiGenerator/Views/HighLevel/Requests/Requests.cshtml new file mode 100644 index 0000000000..ceb8018eca --- /dev/null +++ b/src/ApiGenerator/Views/HighLevel/Requests/Requests.cshtml @@ -0,0 +1,37 @@ +@using System.Collections.ObjectModel +@using ApiGenerator +@using ApiGenerator.Domain.Specification +@using ApiGenerator.Domain.Code +@inherits CodeTemplatePage>> +@{ + var (ns, endpoints) = Model; + ns = ns != CsharpNames.RootNamespace ? $".{CsharpNames.ApiNamespace}.{ns}{CsharpNames.ApiNamespaceSuffix}" : null; +} +@{ await IncludeLegacyGeneratorNotice(); } +// ReSharper disable RedundantUsingDirective +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Linq.Expressions; +using System.Runtime.Serialization; +using OpenSearch.Net; +using OpenSearch.Net.Utf8Json; +@if (ns != null) +{ + using OpenSearch.Net@(ns); + +} + +// ReSharper disable RedundantBaseConstructorCall +// ReSharper disable UnusedTypeParameter +// ReSharper disable PartialMethodWithSinglePart +// ReSharper disable RedundantNameQualifier +namespace OpenSearch.Client +{ +@foreach (var endpoint in endpoints) +{ + await IncludeAsync("HighLevel/Requests/RequestInterface.cshtml", endpoint.RequestInterface); + await IncludeAsync("HighLevel/Requests/RequestImplementations.cshtml", endpoint.RequestPartialImplementation); +} +} diff --git a/src/ApiGenerator/Views/LowLevel/Client/Implementation/OpenSearchLowLevelClient.Namespace.cshtml b/src/ApiGenerator/Views/LowLevel/Client/Implementation/OpenSearchLowLevelClient.Namespace.cshtml new file mode 100644 index 0000000000..ebfd4cb1a8 --- /dev/null +++ b/src/ApiGenerator/Views/LowLevel/Client/Implementation/OpenSearchLowLevelClient.Namespace.cshtml @@ -0,0 +1,49 @@ +@using System.Collections.ObjectModel +@using System.Linq +@using ApiGenerator +@using ApiGenerator.Domain.Code +@using ApiGenerator.Domain.Specification +@inherits CodeTemplatePage>> +@{ await IncludeLegacyGeneratorNotice(); } +@{ + var (ns, endpoints) = Model; +} +// ReSharper disable RedundantUsingDirective +using System; +using System.Collections.Generic; +using System.Collections.Specialized; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using OpenSearch.Net; +using static OpenSearch.Net.HttpMethod; + +// ReSharper disable InterpolatedStringExpressionIsNotIFormattable +// ReSharper disable once CheckNamespace +// ReSharper disable InterpolatedStringExpressionIsNotIFormattable +// ReSharper disable RedundantExtendsListEntry +namespace OpenSearch.Net.@(CsharpNames.ApiNamespace).@ns@(CsharpNames.ApiNamespaceSuffix) +{ + /// + /// @ns.SplitPascalCase() APIs. + /// Not intended to be instantiated directly. Use the property + /// on . + /// + /// + public partial class @(CsharpNames.LowLevelClientNamespacePrefix)@ns@(CsharpNames.ClientNamespaceSuffix) : NamespacedClientProxy + { + internal @(CsharpNames.LowLevelClientNamespacePrefix)@ns@(CsharpNames.ClientNamespaceSuffix)(OpenSearchLowLevelClient client) : base(client) {} +@if (ns == "Cat") +{ + protected override string ContentType => "text/plain"; +} + @{ + var methods = endpoints.SelectMany(e=>e.LowLevelClientMethods).ToList(); + foreach (var method in methods) + { + await IncludeAsync("LowLevel/Client/Methods/MethodImplementation.cshtml", method); + } + } + } +} diff --git a/src/ApiGenerator/Views/LowLevel/Client/Implementation/OpenSearchLowLevelClient.cshtml b/src/ApiGenerator/Views/LowLevel/Client/Implementation/OpenSearchLowLevelClient.cshtml new file mode 100644 index 0000000000..655d586510 --- /dev/null +++ b/src/ApiGenerator/Views/LowLevel/Client/Implementation/OpenSearchLowLevelClient.cshtml @@ -0,0 +1,63 @@ +@using System.Linq +@using ApiGenerator.Domain +@using ApiGenerator +@using ApiGenerator.Domain.Code +@inherits CodeTemplatePage +@{ await IncludeLegacyGeneratorNotice(); } +// ReSharper disable RedundantUsingDirective +using System; +using System.Collections.Generic; +using System.Collections.Specialized; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using OpenSearch.Net; +@{ await IncludeAsync("LowLevel/Client/Usings.cshtml", Model);} +using static OpenSearch.Net.HttpMethod; + +@{ + var namespaces = Model.EndpointsPerNamespaceLowLevel.Keys.ToHashSet(); + namespaces.Remove(CsharpNames.RootNamespace); + namespaces.Add("Http"); + +// ReSharper disable InterpolatedStringExpressionIsNotIFormattable +// ReSharper disable RedundantExtendsListEntry +namespace OpenSearch.Net +{ + /// + /// OpenSearch low level client + /// + public partial class OpenSearchLowLevelClient : IOpenSearchLowLevelClient + { + + foreach (var ns in namespaces) + { + public @(CsharpNames.LowLevelClientNamespacePrefix)@(ns)@(CsharpNames.ClientNamespaceSuffix) @ns { get; private set; } + + } + + partial void SetupGeneratedNamespaces() + { + + foreach (var ns in namespaces) + { + @ns = new @(CsharpNames.LowLevelClientNamespacePrefix)@(ns)@(CsharpNames.ClientNamespaceSuffix)(this); + + } + + } + + + if(Model.EndpointsPerNamespaceLowLevel.TryGetValue(CsharpNames.RootNamespace, out var endpoints)) + { + foreach(var m in endpoints.SelectMany(e => e.LowLevelClientMethods)) + { + await IncludeAsync("LowLevel/Client/Methods/MethodImplementation.cshtml", m); + } + } + + } + } + +} diff --git a/src/ApiGenerator/Views/LowLevel/Client/Interface/IOpenSearchLowLevelClient.cshtml b/src/ApiGenerator/Views/LowLevel/Client/Interface/IOpenSearchLowLevelClient.cshtml new file mode 100644 index 0000000000..399f4984f7 --- /dev/null +++ b/src/ApiGenerator/Views/LowLevel/Client/Interface/IOpenSearchLowLevelClient.cshtml @@ -0,0 +1,47 @@ +@using System.Linq +@using ApiGenerator +@using ApiGenerator.Domain +@using ApiGenerator.Domain.Code +@inherits ApiGenerator.CodeTemplatePage +@{ await IncludeLegacyGeneratorNotice(); } +// ReSharper disable RedundantUsingDirective +using System; +using System.Collections.Generic; +using System.Collections.Specialized; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using OpenSearch.Net; +@{ await IncludeAsync("LowLevel/Client/Usings.cshtml", Model);} + +namespace OpenSearch.Net +{ + /// + /// OpenSearch low level client + /// + public partial interface IOpenSearchLowLevelClient + { + @{ + var namespaces = Model.EndpointsPerNamespaceLowLevel.Keys.ToHashSet(); + namespaces.Remove(CsharpNames.RootNamespace); + namespaces.Add("Http"); + + foreach (var ns in namespaces) + { + + /// @ns.SplitPascalCase() APIs + @CsharpNames.LowLevelClientNamespacePrefix@(ns)@CsharpNames.ClientNamespaceSuffix @ns { get; } + + } + + if(Model.EndpointsPerNamespaceHighLevel.TryGetValue(CsharpNames.RootNamespace, out var endpoints)) + { + foreach(var m in endpoints.SelectMany(e => e.LowLevelClientMethods)) + { + await IncludeAsync("LowLevel/Client/Methods/MethodInterface.cshtml", m); + } + } + } + } +} diff --git a/src/ApiGenerator/Views/LowLevel/Client/Methods/MethodDocs.cshtml b/src/ApiGenerator/Views/LowLevel/Client/Methods/MethodDocs.cshtml new file mode 100644 index 0000000000..2801001566 --- /dev/null +++ b/src/ApiGenerator/Views/LowLevel/Client/Methods/MethodDocs.cshtml @@ -0,0 +1,39 @@ +@using ApiGenerator +@using ApiGenerator.Domain.Code.LowLevel +@using ApiGenerator.Domain.Specification +@using SemanticVersioning +@using Version = SemanticVersioning.Version +@inherits ApiGenerator.CodeTemplatePage +/// @Model.HttpMethod on @Model.Path@(Raw(Model.OfficialDocumentationLink.IsNullOrEmpty() ? "" : " " + Model.OfficialDocumentationLink + "")) +@foreach (var part in Model.Parts) +{ + /// @Raw("")@part.Description@Raw("") + +} + /// @Raw(@"Request specific configuration such as querystring parameters & request specific connection settings.") + @if (Model.Stability != Stability.Stable) + { + string warningMessage = ""; + switch (Model.Stability) + { + case Stability.Experimental: + warningMessage = "this functionality is Experimental and may be changed or removed completely in a future release. OpenSearch will take a best effort approach to fix any issues, but experimental features are not subject to the support SLA of official GA features."; + break; + case Stability.Beta: + warningMessage = "this functionality is in Beta and is subject to change. The design and code is less mature than official GA features and is being provided as-is with no warranties. Beta features are not subject to the support SLA of official GA features."; + break; + } + + warningMessage += " This functionality is subject to potential breaking changes within a minor version, meaning that your referencing code may break when this library is upgraded."; + + /// @Raw("Note: " + Model.Stability + " within the OpenSearch server, " + warningMessage + "") + +} + @if (Model.VersionAdded is {} versionAdded && versionAdded > new Version("1.0.0")) + { + /// @Raw("Supported by OpenSearch servers of version " + versionAdded + " or greater.") +} + @if (Model.Deprecation is {} deprecation) + { + [Obsolete("Deprecated in version @deprecation.Version: @Raw(deprecation.Description)")] +} diff --git a/src/ApiGenerator/Views/LowLevel/Client/Methods/MethodImplementation.cshtml b/src/ApiGenerator/Views/LowLevel/Client/Methods/MethodImplementation.cshtml new file mode 100644 index 0000000000..d0ececa4ef --- /dev/null +++ b/src/ApiGenerator/Views/LowLevel/Client/Methods/MethodImplementation.cshtml @@ -0,0 +1,13 @@ +@using ApiGenerator.Domain.Code.LowLevel +@inherits ApiGenerator.CodeTemplatePage +@{ + var contentType = Model.CsharpNames.RestSpecName.Contains(".cat_") ? ", contentType: \"text/plain\"" : string.Empty; +} +@{await IncludeAsync("LowLevel/Client/Methods/MethodDocs.cshtml", Model); } + public TResponse @Model.PerPathMethodName@(Raw(""))(@Raw(Model.Arguments)) + where TResponse : class, IOpenSearchResponse, new() => DoRequest@(Raw(""))(@Model.HttpMethod, @Raw(Model.UrlInCode), @(Model.HasBody ? "body" : "null"), RequestParams(requestParameters@(Raw(contentType)))); + +@{await IncludeAsync("LowLevel/Client/Methods/MethodDocs.cshtml", Model); } + [MapsApi("@Model.CsharpNames.RestSpecName", "@Model.MapsApiArguments")] + public Task@(Raw("")) @(Model.PerPathMethodName)Async@(Raw(""))(@Raw(Model.Arguments), CancellationToken ctx = default) + where TResponse : class, IOpenSearchResponse, new() => DoRequestAsync@(Raw(""))(@Model.HttpMethod, @Raw(Model.UrlInCode), ctx, @(Model.HasBody ? "body" : "null"), RequestParams(requestParameters@(Raw(contentType)))); diff --git a/src/ApiGenerator/Views/LowLevel/Client/Methods/MethodInterface.cshtml b/src/ApiGenerator/Views/LowLevel/Client/Methods/MethodInterface.cshtml new file mode 100644 index 0000000000..26af0feff8 --- /dev/null +++ b/src/ApiGenerator/Views/LowLevel/Client/Methods/MethodInterface.cshtml @@ -0,0 +1,7 @@ +@using ApiGenerator.Domain.Code.LowLevel +@inherits ApiGenerator.CodeTemplatePage +@{await IncludeAsync("LowLevel/Client/Methods/MethodDocs.cshtml", Model); } + TResponse @Model.PerPathMethodName@(Raw(""))(@Raw(Model.Arguments)) where TResponse : class, IOpenSearchResponse, new(); + +@{await IncludeAsync("LowLevel/Client/Methods/MethodDocs.cshtml", Model); } + Task@(Raw("")) @(Model.PerPathMethodName)Async@(Raw(""))(@Raw(Model.Arguments), CancellationToken ctx = default) where TResponse : class, IOpenSearchResponse, new(); diff --git a/src/ApiGenerator/Views/LowLevel/Client/Usings.cshtml b/src/ApiGenerator/Views/LowLevel/Client/Usings.cshtml new file mode 100644 index 0000000000..5abe91e7ab --- /dev/null +++ b/src/ApiGenerator/Views/LowLevel/Client/Usings.cshtml @@ -0,0 +1,14 @@ +@using ApiGenerator.Domain +@using ApiGenerator.Domain.Code +@inherits ApiGenerator.CodeTemplatePage +@{ + var namespaces = Model.EndpointsPerNamespaceLowLevel.Keys.ToHashSet(); + namespaces.Remove(CsharpNames.RootNamespace); + namespaces.Add("Http"); + + foreach (var ns in namespaces) + { +using OpenSearch.Net.@(CsharpNames.ApiNamespace).@(ns)@(CsharpNames.ApiNamespaceSuffix); + + } +} diff --git a/src/ApiGenerator/Views/LowLevel/Enums.cshtml b/src/ApiGenerator/Views/LowLevel/Enums.cshtml new file mode 100644 index 0000000000..65bc11fe9f --- /dev/null +++ b/src/ApiGenerator/Views/LowLevel/Enums.cshtml @@ -0,0 +1,122 @@ +@using System.Linq +@using System.Text +@using ApiGenerator.Domain +@using ApiGenerator +@using ApiGenerator.Configuration.Overrides +@inherits CodeTemplatePage +@{ await IncludeLegacyGeneratorNotice(); } +@functions { + private const string RawSize = "Raw"; + private const string SizeEnum = "Size"; + + private string CreateEnum(string enumName, string value, int? i) + { + var enumValue = (enumName == SizeEnum && value == string.Empty) ? RawSize : value.ToPascalCase(true); + var enumCsharp = string.Format("[EnumMember(Value = \"{0}\")] {1}{2}", value, enumValue, i.HasValue ? " = 1 << " + i.Value : null); + if (GlobalOverrides.Instance.ObsoleteEnumMembers.TryGetValue(enumName, out var d) && d.TryGetValue(value, out var obsolete)) + { + return string.Format("[Obsolete(\"{0}\")]{2}\t\t{1}", obsolete, enumCsharp, Environment.NewLine); + } + return enumCsharp; + } + private string CreateCase(string e, string o) + { + var enumValue = GetEnumValue(e, o); + var isObsolete = GlobalOverrides.Instance.ObsoleteEnumMembers.TryGetValue(e, out var d) && d.TryGetValue(o, out _); + var sb = new StringBuilder(); + if (isObsolete) sb.AppendLine("#pragma warning disable 618"); + sb.Append(string.Format("case {0}.{1}: return \"{2}\";", e, enumValue, o)); + if (isObsolete) sb.AppendLine(Environment.NewLine + "#pragma warning disable 618"); + return sb.ToString(); + } + private bool IsFlag(string name) + { + return name.EndsWith("Metric") || name.EndsWith("Feature"); + } + + private string GetEnumValue(string enumName, string value) + { + return enumName == SizeEnum && value == string.Empty + ? RawSize + : value.ToPascalCase(true); + } +} +// ReSharper disable RedundantUsingDirective +using System; +using System.Collections.Generic; +using System.Collections.Concurrent; +using System.Linq; +using System.Text; +using System.Reflection; +using System.Runtime.Serialization; + +namespace OpenSearch.Net +{ +@foreach (var e in Model.EnumsInTheSpec) +{ + var isFlag = IsFlag(e.Name); + + @(isFlag ? "[Flags, StringEnum]" : "[StringEnum]")public enum @e.Name + { + @Raw(string.Join(","+ Environment.NewLine + "\t\t", e.Options.OrderBy(s => s == "_all" ? 1 : 0).Select((s, i) => CreateEnum(e.Name, s, isFlag ? (int?)i : null)))) + } +} + + public static partial class KnownEnums + { + static partial void RegisterEnumStringResolvers() + { + @foreach (var e in Model.EnumsInTheSpec) + { + EnumStringResolvers.TryAdd(typeof(@(e.Name)), e => GetStringValue((@(e.Name))e)); + + } + } + + @foreach (var e in Model.EnumsInTheSpec) + { + var isFlag = IsFlag(e.Name); + + public static string GetStringValue(this @(e.Name) enumValue) + { + + if (isFlag) + { + var allOption = e.Options.FirstOrDefault(o => o == "_all"); + if (allOption != null) + { + if ((enumValue & @(e.Name).All) != 0) return "_all"; + + } + var list = new @(Raw("List()")); + + var g = GlobalOverrides.Instance.ObsoleteEnumMembers.TryGetValue(e.Name, out var d); + foreach (var option in e.Options.Where(o => o != "_all")) + { + var value = GetEnumValue(e.Name, option); + if (g && d.TryGetValue(option, out var _)) { +#pragma warning disable 618 + if ((enumValue & @(e.Name).@(value)) != 0) list.Add("@(option)"); +#pragma warning restore 618 + + } + else { + if ((enumValue & @(e.Name).@(value)) != 0) list.Add("@(option)"); + + } + } + return string.Join(",", list); + } + } + else + { + switch (enumValue) + { + @Raw(string.Join(Environment.NewLine + "\t\t\t\t", e.Options.Select(o => CreateCase(e.Name, o)))) + } + throw new ArgumentException($"'{enumValue.ToString()}' is not a valid value for enum '@(e.Name)'"); + } + } + } + } +} diff --git a/src/ApiGenerator/Views/LowLevel/RequestParameters/RequestParameters.cshtml b/src/ApiGenerator/Views/LowLevel/RequestParameters/RequestParameters.cshtml new file mode 100644 index 0000000000..110f7f51bc --- /dev/null +++ b/src/ApiGenerator/Views/LowLevel/RequestParameters/RequestParameters.cshtml @@ -0,0 +1,40 @@ +@using System.Collections.ObjectModel +@using ApiGenerator +@using ApiGenerator.Domain.Code +@using ApiGenerator.Domain.Specification +@inherits CodeTemplatePage>> +@{ await IncludeLegacyGeneratorNotice(); } +@{ + var (ns, endpoints) = Model; + ns = ns != CsharpNames.RootNamespace ? $".{CsharpNames.ApiNamespace}.{ns}{CsharpNames.ApiNamespaceSuffix}" : null; +} + +// ReSharper disable RedundantUsingDirective +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Linq.Expressions; + +// ReSharper disable once CheckNamespace +namespace OpenSearch.Net@(ns) +{ + @foreach (var endpoint in endpoints) + { + var r = endpoint.RequestParameterImplementation; + var supportsBody = endpoint.Body != null; + var names = r.CsharpNames; + + /// Request options for @names.MethodName@Raw(r.OfficialDocumentationLink.IsNullOrEmpty() ? "" : " " + r.OfficialDocumentationLink + "") + public partial class @names.ParametersName : RequestParameters<@names.ParametersName> + { + public override HttpMethod DefaultHttpMethod => HttpMethod.@r.HttpMethod; + public override bool SupportsBody => @(supportsBody ? "true" : "false"); + @foreach (var param in r.Params) + { + @Raw(param.InitializerGenerator(r.CsharpNames.Namespace, param.TypeLowLevel, param.ClsName, param.QueryStringKey, param.SetterLowLevel, param.VersionAdded, param.Description)) + + } + } + } +}