From 9a4499cd66c2f7769b17592972d4415a1d3e151e Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Mon, 4 Dec 2023 11:53:14 +1300 Subject: [PATCH 01/27] 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 --- OpenSearch.sln | 7 + build/scripts/Commandline.fs | 3 + build/scripts/ReposTooling.fs | 8 + build/scripts/Targets.fs | 3 + src/ApiGenerator/ApiGenerator.csproj | 24 + src/ApiGenerator/App.config | 6 + src/ApiGenerator/CodeTemplatePage.cs | 42 ++ .../Configuration/CodeConfiguration.cs | 248 +++++++++ .../Configuration/GeneratorLocations.cs | 69 +++ .../Overrides/EndpointOverridesBase.cs | 44 ++ .../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/NodesHotThreadsOverrides.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 | 76 +++ .../Overrides/IEndpointOverrides.cs | 60 +++ .../Configuration/ViewLocations.cs | 40 ++ .../Domain/ApiQueryParametersPatcher.cs | 160 ++++++ src/ApiGenerator/Domain/Code/CsharpNames.cs | 208 ++++++++ .../HighLevel/Methods/BoundFluentMethod.cs | 64 +++ .../Code/HighLevel/Methods/FluentMethod.cs | 46 ++ .../HighLevel/Methods/FluentSyntaxBase.cs | 165 ++++++ .../HighLevel/Methods/FluentSyntaxView.cs | 39 ++ .../Code/HighLevel/Methods/HighLevelModel.cs | 39 ++ .../HighLevel/Methods/InitializerMethod.cs | 73 +++ .../Methods/InitializerSyntaxView.cs | 40 ++ .../HighLevel/Methods/MethodSyntaxBase.cs | 52 ++ .../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 | 81 +++ src/ApiGenerator/Domain/RestApiSpec.cs | 127 +++++ .../Domain/Specification/ApiEndpoint.cs | 208 ++++++++ src/ApiGenerator/Domain/Specification/Body.cs | 36 ++ .../Domain/Specification/Documentation.cs | 87 ++++ .../Domain/Specification/QueryParameters.cs | 222 +++++++++ .../Domain/Specification/Stability.cs | 53 ++ .../Domain/Specification/UrlInformation.cs | 144 ++++++ .../Domain/Specification/UrlPart.cs | 175 +++++++ .../Domain/Specification/UrlPath.cs | 119 +++++ src/ApiGenerator/Extensions.cs | 73 +++ .../Generator/ApiEndpointFactory.cs | 229 +++++++++ src/ApiGenerator/Generator/ApiGenerator.cs | 153 ++++++ src/ApiGenerator/Generator/CodeGenerator.cs | 121 +++++ .../Razor/ApiUrlsLookupsGenerator.cs | 49 ++ .../Generator/Razor/DescriptorsGenerator.cs | 59 +++ .../Generator/Razor/EnumsGenerator.cs | 49 ++ .../HighLevelClientImplementationGenerator.cs | 62 +++ .../HighLevelClientInterfaceGenerator.cs | 49 ++ .../LowLevelClientImplementationGenerator.cs | 60 +++ .../Razor/LowLevelClientInterfaceGenerator.cs | 49 ++ .../Generator/Razor/RazorGeneratorBase.cs | 102 ++++ .../Razor/RequestParametersGenerator.cs | 56 +++ .../Generator/Razor/RequestsGenerator.cs | 59 +++ src/ApiGenerator/Program.cs | 187 +++++++ src/ApiGenerator/RestSpecDownloader.cs | 172 +++++++ .../RestSpecification/Core/_common.json | 31 ++ .../RestSpecification/Core/bulk.json | 107 ++++ .../RestSpecification/Core/cat.aliases.json | 75 +++ .../Core/cat.allocation.json | 88 ++++ .../Core/cat.cluster_manager.json | 73 +++ .../RestSpecification/Core/cat.count.json | 59 +++ .../RestSpecification/Core/cat.fielddata.json | 80 +++ .../RestSpecification/Core/cat.health.json | 65 +++ .../RestSpecification/Core/cat.help.json | 34 ++ .../RestSpecification/Core/cat.indices.json | 132 +++++ .../RestSpecification/Core/cat.master.json | 55 ++ .../RestSpecification/Core/cat.nodeattrs.json | 59 +++ .../RestSpecification/Core/cat.nodes.json | 89 ++++ .../Core/cat.pending_tasks.json | 72 +++ .../RestSpecification/Core/cat.plugins.json | 64 +++ .../RestSpecification/Core/cat.recovery.json | 103 ++++ .../Core/cat.repositories.json | 60 +++ .../RestSpecification/Core/cat.segments.json | 76 +++ .../RestSpecification/Core/cat.shards.json | 101 ++++ .../RestSpecification/Core/cat.snapshots.json | 85 ++++ .../RestSpecification/Core/cat.tasks.json | 76 +++ .../RestSpecification/Core/cat.templates.json | 71 +++ .../Core/cat.thread_pool.json | 71 +++ .../RestSpecification/Core/clear_scroll.json | 28 ++ .../Core/cluster.allocation_explain.json | 38 ++ .../cluster.delete_component_template.json | 43 ++ ...uster.delete_voting_config_exclusions.json | 30 ++ .../cluster.exists_component_template.json | 43 ++ .../Core/cluster.get_component_template.json | 49 ++ .../Core/cluster.get_settings.json | 46 ++ .../Core/cluster.health.json | 112 +++++ .../Core/cluster.pending_tasks.json | 37 ++ ...cluster.post_voting_config_exclusions.json | 38 ++ .../Core/cluster.put_component_template.json | 54 ++ .../Core/cluster.put_settings.json | 46 ++ .../Core/cluster.remote_info.json | 24 + .../Core/cluster.reroute.json | 66 +++ .../RestSpecification/Core/cluster.state.json | 117 +++++ .../RestSpecification/Core/cluster.stats.json | 45 ++ .../RestSpecification/Core/count.json | 113 +++++ .../RestSpecification/Core/create.json | 79 +++ ...angling_indices.delete_dangling_index.json | 47 ++ ...angling_indices.import_dangling_index.json | 47 ++ ...angling_indices.list_dangling_indices.json | 24 + .../RestSpecification/Core/delete.json | 78 +++ .../Core/delete_by_query.json | 185 +++++++ .../Core/delete_by_query_rethrottle.json | 36 ++ .../RestSpecification/Core/delete_script.json | 43 ++ .../RestSpecification/Core/exists.json | 81 +++ .../RestSpecification/Core/exists_source.json | 77 +++ .../RestSpecification/Core/explain.json | 93 ++++ .../Core/features.get_features.json | 33 ++ .../RestSpecification/Core/field_caps.json | 71 +++ .../RestSpecification/Core/get.json | 81 +++ .../RestSpecification/Core/get_script.json | 39 ++ .../Core/get_script_context.json | 24 + .../Core/get_script_languages.json | 24 + .../RestSpecification/Core/get_source.json | 77 +++ .../RestSpecification/Core/index.json | 111 +++++ .../Core/indices.add_block.json | 67 +++ .../Core/indices.analyze.json | 47 ++ .../Core/indices.clear_cache.json | 77 +++ .../RestSpecification/Core/indices.clone.json | 56 +++ .../RestSpecification/Core/indices.close.json | 67 +++ .../Core/indices.create.json | 55 ++ .../Core/indices.delete.json | 63 +++ .../Core/indices.delete_alias.json | 63 +++ .../Core/indices.delete_index_template.json | 43 ++ .../Core/indices.delete_template.json | 43 ++ .../Core/indices.exists.json | 64 +++ .../Core/indices.exists_alias.json | 71 +++ .../Core/indices.exists_index_template.json | 47 ++ .../Core/indices.exists_template.json | 47 ++ .../Core/indices.exists_type.json | 59 +++ .../RestSpecification/Core/indices.flush.json | 67 +++ .../Core/indices.forcemerge.json | 69 +++ .../RestSpecification/Core/indices.get.json | 76 +++ .../Core/indices.get_alias.json | 89 ++++ .../Core/indices.get_field_mapping.json | 79 +++ .../Core/indices.get_index_template.json | 53 ++ .../Core/indices.get_mapping.json | 69 +++ .../Core/indices.get_settings.json | 106 ++++ .../Core/indices.get_template.json | 57 +++ .../RestSpecification/Core/indices.open.json | 67 +++ .../Core/indices.put_alias.json | 70 +++ .../Core/indices.put_index_template.json | 55 ++ .../Core/indices.put_mapping.json | 95 ++++ .../Core/indices.put_settings.json | 82 +++ .../Core/indices.put_template.json | 58 +++ .../Core/indices.recovery.json | 47 ++ .../Core/indices.refresh.json | 59 +++ .../Core/indices.resolve_index.json | 43 ++ .../Core/indices.rollover.json | 75 +++ .../Core/indices.segments.json | 62 +++ .../Core/indices.shard_stores.json | 67 +++ .../Core/indices.shrink.json | 60 +++ .../Core/indices.simulate_index_template.json | 54 ++ .../Core/indices.simulate_template.json | 60 +++ .../RestSpecification/Core/indices.split.json | 60 +++ .../RestSpecification/Core/indices.stats.json | 158 ++++++ .../Core/indices.update_aliases.json | 42 ++ .../Core/indices.validate_query.json | 104 ++++ .../RestSpecification/Core/info.json | 24 + .../Core/ingest.delete_pipeline.json | 43 ++ .../Core/ingest.get_pipeline.json | 45 ++ .../Core/ingest.processor_grok.json | 24 + .../Core/ingest.put_pipeline.json | 48 ++ .../Core/ingest.simulate.json | 49 ++ .../RestSpecification/Core/mget.json | 76 +++ .../RestSpecification/Core/msearch.json | 82 +++ .../Core/msearch_template.json | 73 +++ .../RestSpecification/Core/mtermvectors.json | 103 ++++ .../Core/nodes.hot_threads.json | 147 ++++++ .../RestSpecification/Core/nodes.info.json | 95 ++++ .../Core/nodes.reload_secure_settings.json | 46 ++ .../RestSpecification/Core/nodes.stats.json | 232 +++++++++ .../RestSpecification/Core/nodes.usage.json | 77 +++ .../RestSpecification/Core/ping.json | 24 + .../RestSpecification/Core/put_script.json | 70 +++ .../RestSpecification/Core/rank_eval.json | 72 +++ .../RestSpecification/Core/reindex.json | 67 +++ .../Core/reindex_rethrottle.json | 36 ++ .../Core/render_search_template.json | 41 ++ .../Core/scripts_painless_execute.json | 29 ++ .../RestSpecification/Core/scroll.json | 43 ++ .../RestSpecification/Core/search.json | 243 +++++++++ .../RestSpecification/Core/search_shards.json | 71 +++ .../Core/search_template.json | 112 +++++ .../Core/snapshot.cleanup_repository.json | 43 ++ .../Core/snapshot.clone.json | 52 ++ .../Core/snapshot.create.json | 54 ++ .../Core/snapshot.create_repository.json | 53 ++ .../Core/snapshot.delete.json | 43 ++ .../Core/snapshot.delete_repository.json | 43 ++ .../RestSpecification/Core/snapshot.get.json | 51 ++ .../Core/snapshot.get_repository.json | 49 ++ .../Core/snapshot.restore.json | 53 ++ .../Core/snapshot.status.json | 65 +++ .../Core/snapshot.verify_repository.json | 43 ++ .../RestSpecification/Core/tasks.cancel.json | 53 ++ .../RestSpecification/Core/tasks.get.json | 39 ++ .../RestSpecification/Core/tasks.list.json | 59 +++ .../RestSpecification/Core/termvectors.json | 109 ++++ .../RestSpecification/Core/update.json | 93 ++++ .../Core/update_by_query.json | 198 ++++++++ .../Core/update_by_query_rethrottle.json | 36 ++ .../_Patches/cat.tasks.patch.json | 8 + .../_Patches/indices.put_mapping.patch.json | 15 + .../_Patches/indices.stats.patch.json | 11 + .../_Patches/nodes.hot_threads.patch.json | 40 ++ .../_Patches/nodes.stats.patch.json | 11 + .../_Patches/reindex.patch.patch.json | 12 + .../snapshot.cleanup_repository.patch.json | 5 + src/ApiGenerator/Views/GeneratorNotice.cshtml | 45 ++ .../Client/FluentSyntax/FluentMethod.cshtml | 20 + .../FluentSyntax/FluentMethodHeader.cshtml | 16 + .../MethodImplementation.cshtml | 20 + .../OpenSearchClient.Namespace.cshtml | 37 ++ .../Implementation/OpenSearchClient.cshtml | 64 +++ .../InitializerMethod.cshtml | 22 + .../InitializerMethodHeader.cshtml | 17 + .../Client/Interface/IOpenSearchClient.cshtml | 40 ++ .../Client/Interface/MethodInterface.cshtml | 29 ++ .../HighLevel/Client/MethodXmlDocs.cshtml | 11 + .../Views/HighLevel/Client/Usings.cshtml | 11 + .../HighLevel/Descriptors/Descriptor.cshtml | 90 ++++ .../HighLevel/Descriptors/Descriptors.cshtml | 38 ++ .../Descriptors/RequestDescriptorBase.cshtml | 26 + .../HighLevel/Descriptors/XmlDocs.cshtml | 19 + .../HighLevel/Requests/ApiUrlsLookup.cshtml | 27 + .../Requests/PlainRequestBase.cshtml | 27 + .../Requests/RequestImplementations.cshtml | 86 ++++ .../Requests/RequestInterface.cshtml | 27 + .../Views/HighLevel/Requests/Requests.cshtml | 39 ++ .../OpenSearchLowLevelClient.Namespace.cshtml | 52 ++ .../OpenSearchLowLevelClient.cshtml | 69 +++ .../IOpenSearchLowLevelClient.cshtml | 43 ++ .../LowLevel/Client/Methods/MethodDocs.cshtml | 36 ++ .../Methods/MethodImplementation.cshtml | 14 + .../Client/Methods/MethodInterface.cshtml | 10 + .../Views/LowLevel/Client/Usings.cshtml | 11 + .../Views/LowLevel/Enums.Generated.cshtml | 173 +++++++ .../RequestParameters.cshtml | 43 ++ src/ApiGenerator/packages.lock.json | 470 ++++++++++++++++++ src/ApiGenerator/razormachine.readme.txt | 20 + 261 files changed, 17230 insertions(+) create mode 100644 src/ApiGenerator/ApiGenerator.csproj create mode 100644 src/ApiGenerator/App.config 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/NodesHotThreadsOverrides.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/ApiQueryParametersPatcher.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/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/Program.cs create mode 100644 src/ApiGenerator/RestSpecDownloader.cs create mode 100644 src/ApiGenerator/RestSpecification/Core/_common.json create mode 100644 src/ApiGenerator/RestSpecification/Core/bulk.json create mode 100644 src/ApiGenerator/RestSpecification/Core/cat.aliases.json create mode 100644 src/ApiGenerator/RestSpecification/Core/cat.allocation.json create mode 100644 src/ApiGenerator/RestSpecification/Core/cat.cluster_manager.json create mode 100644 src/ApiGenerator/RestSpecification/Core/cat.count.json create mode 100644 src/ApiGenerator/RestSpecification/Core/cat.fielddata.json create mode 100644 src/ApiGenerator/RestSpecification/Core/cat.health.json create mode 100644 src/ApiGenerator/RestSpecification/Core/cat.help.json create mode 100644 src/ApiGenerator/RestSpecification/Core/cat.indices.json create mode 100644 src/ApiGenerator/RestSpecification/Core/cat.master.json create mode 100644 src/ApiGenerator/RestSpecification/Core/cat.nodeattrs.json create mode 100644 src/ApiGenerator/RestSpecification/Core/cat.nodes.json create mode 100644 src/ApiGenerator/RestSpecification/Core/cat.pending_tasks.json create mode 100644 src/ApiGenerator/RestSpecification/Core/cat.plugins.json create mode 100644 src/ApiGenerator/RestSpecification/Core/cat.recovery.json create mode 100644 src/ApiGenerator/RestSpecification/Core/cat.repositories.json create mode 100644 src/ApiGenerator/RestSpecification/Core/cat.segments.json create mode 100644 src/ApiGenerator/RestSpecification/Core/cat.shards.json create mode 100644 src/ApiGenerator/RestSpecification/Core/cat.snapshots.json create mode 100644 src/ApiGenerator/RestSpecification/Core/cat.tasks.json create mode 100644 src/ApiGenerator/RestSpecification/Core/cat.templates.json create mode 100644 src/ApiGenerator/RestSpecification/Core/cat.thread_pool.json create mode 100644 src/ApiGenerator/RestSpecification/Core/clear_scroll.json create mode 100644 src/ApiGenerator/RestSpecification/Core/cluster.allocation_explain.json create mode 100644 src/ApiGenerator/RestSpecification/Core/cluster.delete_component_template.json create mode 100644 src/ApiGenerator/RestSpecification/Core/cluster.delete_voting_config_exclusions.json create mode 100644 src/ApiGenerator/RestSpecification/Core/cluster.exists_component_template.json create mode 100644 src/ApiGenerator/RestSpecification/Core/cluster.get_component_template.json create mode 100644 src/ApiGenerator/RestSpecification/Core/cluster.get_settings.json create mode 100644 src/ApiGenerator/RestSpecification/Core/cluster.health.json create mode 100644 src/ApiGenerator/RestSpecification/Core/cluster.pending_tasks.json create mode 100644 src/ApiGenerator/RestSpecification/Core/cluster.post_voting_config_exclusions.json create mode 100644 src/ApiGenerator/RestSpecification/Core/cluster.put_component_template.json create mode 100644 src/ApiGenerator/RestSpecification/Core/cluster.put_settings.json create mode 100644 src/ApiGenerator/RestSpecification/Core/cluster.remote_info.json create mode 100644 src/ApiGenerator/RestSpecification/Core/cluster.reroute.json create mode 100644 src/ApiGenerator/RestSpecification/Core/cluster.state.json create mode 100644 src/ApiGenerator/RestSpecification/Core/cluster.stats.json create mode 100644 src/ApiGenerator/RestSpecification/Core/count.json create mode 100644 src/ApiGenerator/RestSpecification/Core/create.json create mode 100644 src/ApiGenerator/RestSpecification/Core/dangling_indices.delete_dangling_index.json create mode 100644 src/ApiGenerator/RestSpecification/Core/dangling_indices.import_dangling_index.json create mode 100644 src/ApiGenerator/RestSpecification/Core/dangling_indices.list_dangling_indices.json create mode 100644 src/ApiGenerator/RestSpecification/Core/delete.json create mode 100644 src/ApiGenerator/RestSpecification/Core/delete_by_query.json create mode 100644 src/ApiGenerator/RestSpecification/Core/delete_by_query_rethrottle.json create mode 100644 src/ApiGenerator/RestSpecification/Core/delete_script.json create mode 100644 src/ApiGenerator/RestSpecification/Core/exists.json create mode 100644 src/ApiGenerator/RestSpecification/Core/exists_source.json create mode 100644 src/ApiGenerator/RestSpecification/Core/explain.json create mode 100644 src/ApiGenerator/RestSpecification/Core/features.get_features.json create mode 100644 src/ApiGenerator/RestSpecification/Core/field_caps.json create mode 100644 src/ApiGenerator/RestSpecification/Core/get.json create mode 100644 src/ApiGenerator/RestSpecification/Core/get_script.json create mode 100644 src/ApiGenerator/RestSpecification/Core/get_script_context.json create mode 100644 src/ApiGenerator/RestSpecification/Core/get_script_languages.json create mode 100644 src/ApiGenerator/RestSpecification/Core/get_source.json create mode 100644 src/ApiGenerator/RestSpecification/Core/index.json create mode 100644 src/ApiGenerator/RestSpecification/Core/indices.add_block.json create mode 100644 src/ApiGenerator/RestSpecification/Core/indices.analyze.json create mode 100644 src/ApiGenerator/RestSpecification/Core/indices.clear_cache.json create mode 100644 src/ApiGenerator/RestSpecification/Core/indices.clone.json create mode 100644 src/ApiGenerator/RestSpecification/Core/indices.close.json create mode 100644 src/ApiGenerator/RestSpecification/Core/indices.create.json create mode 100644 src/ApiGenerator/RestSpecification/Core/indices.delete.json create mode 100644 src/ApiGenerator/RestSpecification/Core/indices.delete_alias.json create mode 100644 src/ApiGenerator/RestSpecification/Core/indices.delete_index_template.json create mode 100644 src/ApiGenerator/RestSpecification/Core/indices.delete_template.json create mode 100644 src/ApiGenerator/RestSpecification/Core/indices.exists.json create mode 100644 src/ApiGenerator/RestSpecification/Core/indices.exists_alias.json create mode 100644 src/ApiGenerator/RestSpecification/Core/indices.exists_index_template.json create mode 100644 src/ApiGenerator/RestSpecification/Core/indices.exists_template.json create mode 100644 src/ApiGenerator/RestSpecification/Core/indices.exists_type.json create mode 100644 src/ApiGenerator/RestSpecification/Core/indices.flush.json create mode 100644 src/ApiGenerator/RestSpecification/Core/indices.forcemerge.json create mode 100644 src/ApiGenerator/RestSpecification/Core/indices.get.json create mode 100644 src/ApiGenerator/RestSpecification/Core/indices.get_alias.json create mode 100644 src/ApiGenerator/RestSpecification/Core/indices.get_field_mapping.json create mode 100644 src/ApiGenerator/RestSpecification/Core/indices.get_index_template.json create mode 100644 src/ApiGenerator/RestSpecification/Core/indices.get_mapping.json create mode 100644 src/ApiGenerator/RestSpecification/Core/indices.get_settings.json create mode 100644 src/ApiGenerator/RestSpecification/Core/indices.get_template.json create mode 100644 src/ApiGenerator/RestSpecification/Core/indices.open.json create mode 100644 src/ApiGenerator/RestSpecification/Core/indices.put_alias.json create mode 100644 src/ApiGenerator/RestSpecification/Core/indices.put_index_template.json create mode 100644 src/ApiGenerator/RestSpecification/Core/indices.put_mapping.json create mode 100644 src/ApiGenerator/RestSpecification/Core/indices.put_settings.json create mode 100644 src/ApiGenerator/RestSpecification/Core/indices.put_template.json create mode 100644 src/ApiGenerator/RestSpecification/Core/indices.recovery.json create mode 100644 src/ApiGenerator/RestSpecification/Core/indices.refresh.json create mode 100644 src/ApiGenerator/RestSpecification/Core/indices.resolve_index.json create mode 100644 src/ApiGenerator/RestSpecification/Core/indices.rollover.json create mode 100644 src/ApiGenerator/RestSpecification/Core/indices.segments.json create mode 100644 src/ApiGenerator/RestSpecification/Core/indices.shard_stores.json create mode 100644 src/ApiGenerator/RestSpecification/Core/indices.shrink.json create mode 100644 src/ApiGenerator/RestSpecification/Core/indices.simulate_index_template.json create mode 100644 src/ApiGenerator/RestSpecification/Core/indices.simulate_template.json create mode 100644 src/ApiGenerator/RestSpecification/Core/indices.split.json create mode 100644 src/ApiGenerator/RestSpecification/Core/indices.stats.json create mode 100644 src/ApiGenerator/RestSpecification/Core/indices.update_aliases.json create mode 100644 src/ApiGenerator/RestSpecification/Core/indices.validate_query.json create mode 100644 src/ApiGenerator/RestSpecification/Core/info.json create mode 100644 src/ApiGenerator/RestSpecification/Core/ingest.delete_pipeline.json create mode 100644 src/ApiGenerator/RestSpecification/Core/ingest.get_pipeline.json create mode 100644 src/ApiGenerator/RestSpecification/Core/ingest.processor_grok.json create mode 100644 src/ApiGenerator/RestSpecification/Core/ingest.put_pipeline.json create mode 100644 src/ApiGenerator/RestSpecification/Core/ingest.simulate.json create mode 100644 src/ApiGenerator/RestSpecification/Core/mget.json create mode 100644 src/ApiGenerator/RestSpecification/Core/msearch.json create mode 100644 src/ApiGenerator/RestSpecification/Core/msearch_template.json create mode 100644 src/ApiGenerator/RestSpecification/Core/mtermvectors.json create mode 100644 src/ApiGenerator/RestSpecification/Core/nodes.hot_threads.json create mode 100644 src/ApiGenerator/RestSpecification/Core/nodes.info.json create mode 100644 src/ApiGenerator/RestSpecification/Core/nodes.reload_secure_settings.json create mode 100644 src/ApiGenerator/RestSpecification/Core/nodes.stats.json create mode 100644 src/ApiGenerator/RestSpecification/Core/nodes.usage.json create mode 100644 src/ApiGenerator/RestSpecification/Core/ping.json create mode 100644 src/ApiGenerator/RestSpecification/Core/put_script.json create mode 100644 src/ApiGenerator/RestSpecification/Core/rank_eval.json create mode 100644 src/ApiGenerator/RestSpecification/Core/reindex.json create mode 100644 src/ApiGenerator/RestSpecification/Core/reindex_rethrottle.json create mode 100644 src/ApiGenerator/RestSpecification/Core/render_search_template.json create mode 100644 src/ApiGenerator/RestSpecification/Core/scripts_painless_execute.json create mode 100644 src/ApiGenerator/RestSpecification/Core/scroll.json create mode 100644 src/ApiGenerator/RestSpecification/Core/search.json create mode 100644 src/ApiGenerator/RestSpecification/Core/search_shards.json create mode 100644 src/ApiGenerator/RestSpecification/Core/search_template.json create mode 100644 src/ApiGenerator/RestSpecification/Core/snapshot.cleanup_repository.json create mode 100644 src/ApiGenerator/RestSpecification/Core/snapshot.clone.json create mode 100644 src/ApiGenerator/RestSpecification/Core/snapshot.create.json create mode 100644 src/ApiGenerator/RestSpecification/Core/snapshot.create_repository.json create mode 100644 src/ApiGenerator/RestSpecification/Core/snapshot.delete.json create mode 100644 src/ApiGenerator/RestSpecification/Core/snapshot.delete_repository.json create mode 100644 src/ApiGenerator/RestSpecification/Core/snapshot.get.json create mode 100644 src/ApiGenerator/RestSpecification/Core/snapshot.get_repository.json create mode 100644 src/ApiGenerator/RestSpecification/Core/snapshot.restore.json create mode 100644 src/ApiGenerator/RestSpecification/Core/snapshot.status.json create mode 100644 src/ApiGenerator/RestSpecification/Core/snapshot.verify_repository.json create mode 100644 src/ApiGenerator/RestSpecification/Core/tasks.cancel.json create mode 100644 src/ApiGenerator/RestSpecification/Core/tasks.get.json create mode 100644 src/ApiGenerator/RestSpecification/Core/tasks.list.json create mode 100644 src/ApiGenerator/RestSpecification/Core/termvectors.json create mode 100644 src/ApiGenerator/RestSpecification/Core/update.json create mode 100644 src/ApiGenerator/RestSpecification/Core/update_by_query.json create mode 100644 src/ApiGenerator/RestSpecification/Core/update_by_query_rethrottle.json create mode 100644 src/ApiGenerator/RestSpecification/_Patches/cat.tasks.patch.json create mode 100644 src/ApiGenerator/RestSpecification/_Patches/indices.put_mapping.patch.json create mode 100644 src/ApiGenerator/RestSpecification/_Patches/indices.stats.patch.json create mode 100644 src/ApiGenerator/RestSpecification/_Patches/nodes.hot_threads.patch.json create mode 100644 src/ApiGenerator/RestSpecification/_Patches/nodes.stats.patch.json create mode 100644 src/ApiGenerator/RestSpecification/_Patches/reindex.patch.patch.json create mode 100644 src/ApiGenerator/RestSpecification/_Patches/snapshot.cleanup_repository.patch.json 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.Generated.cshtml create mode 100644 src/ApiGenerator/Views/LowLevel/RequestParameters/RequestParameters.cshtml create mode 100644 src/ApiGenerator/packages.lock.json create mode 100644 src/ApiGenerator/razormachine.readme.txt 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..0c9d11077f --- /dev/null +++ b/src/ApiGenerator/ApiGenerator.csproj @@ -0,0 +1,24 @@ + + + + Exe + net6.0 + false + + CS1591;NU1701 + true + + + + + + + + + + + + + + + diff --git a/src/ApiGenerator/App.config b/src/ApiGenerator/App.config new file mode 100644 index 0000000000..434e45fb3e --- /dev/null +++ b/src/ApiGenerator/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/ApiGenerator/CodeTemplatePage.cs b/src/ApiGenerator/CodeTemplatePage.cs new file mode 100644 index 0000000000..7b59c684af --- /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; +using System.Threading.Tasks; +using RazorLight; + +namespace ApiGenerator +{ + /// This only exists to make the IDE tooling happy, not actually used to render the templates + public class CodeTemplatePage : TemplatePage + { + public override Task ExecuteAsync() => throw new NotImplementedException(); + + public Task Execute() => Task.CompletedTask; + } +} diff --git a/src/ApiGenerator/Configuration/CodeConfiguration.cs b/src/ApiGenerator/Configuration/CodeConfiguration.cs new file mode 100644 index 0000000000..b0053fef26 --- /dev/null +++ b/src/ApiGenerator/Configuration/CodeConfiguration.cs @@ -0,0 +1,248 @@ +/* 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; + +namespace ApiGenerator.Configuration +{ + public static class CodeConfiguration + { + /// These APIs are not implemented yet in the low and high level client + public static string[] IgnoredApis { get; } = + { + // To be removed + "indices.upgrade.json", + "indices.get_upgrade.json", + }; + + private static string[] IgnoredApisHighLevel { get; } = + { + "indices.delete_index_template.json", + "indices.exists_index_template.json", + "indices.get_index_template.json", + "indices.put_index_template.json", + "indices.simulate_index_template.json", + "indices.simulate_template.json", + + "get_script_context.json", // 7.7 experimental + "get_script_languages.json", // 7.7 experimental + + "indices.exist_type.json", // already removed on client + + "rank_eval.json", // 7.7 experimental + "scripts_painless_context.json", // 7.7 experimental + "cluster.delete_component_template.json", // 7.8 experimental + "cluster.get_component_template.json", // 7.8 experimental + "cluster.put_component_template.json", // 7.8 experimental + "cluster.exists_component_template.json", // 7.8 experimental + }; + + /// + /// Map API default names for API's we are only supporting on the low level client first + /// + private static readonly Dictionary LowLevelApiNameMapping = new Dictionary + { + { "indices.delete_index_template", "DeleteIndexTemplateV2" }, + { "indices.get_index_template", "GetIndexTemplateV2" }, + { "indices.put_index_template", "PutIndexTemplateV2" } + }; + + /// + /// 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) => + // if its explicitly ignored we know about it. + !IgnoredApis.Contains(apiFileName) + && !IgnoredApisHighLevel.Contains(apiFileName) + // no requests with [MapsApi("filename.json")] found + && !HighLevelApiNameMapping.ContainsKey(apiFileName.Replace(".json", "")); + + public static bool IgnoreHighLevelApi(string apiFileName) + { + //explicitly ignored + if (IgnoredApis.Contains(apiFileName) || IgnoredApisHighLevel.Contains(apiFileName)) return true; + + //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..08467cb003 --- /dev/null +++ b/src/ApiGenerator/Configuration/GeneratorLocations.cs @@ -0,0 +1,69 @@ +/* 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 OpenSearchNetFolder { get; } = $@"{Root}../../src/OpenSearch.Net/"; + public static string LastDownloadedRef { get; } = Path.Combine(Root, "last_downloaded_version.txt"); + + public static string OpenSearchClientFolder { get; } = $@"{Root}../../src/OpenSearch.Client/"; + public static string RestSpecificationFolder { get; } = $@"{Root}RestSpecification/"; + // @formatter:on — enable formatter after this line + + public static string HighLevel(params string[] paths) => OpenSearchClientFolder + string.Join("/", paths); + public static string LowLevel(params string[] paths) => OpenSearchNetFolder + 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..d7066a7dc1 --- /dev/null +++ b/src/ApiGenerator/Configuration/Overrides/EndpointOverridesBase.cs @@ -0,0 +1,44 @@ +/* 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 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/NodesHotThreadsOverrides.cs b/src/ApiGenerator/Configuration/Overrides/Endpoints/NodesHotThreadsOverrides.cs new file mode 100644 index 0000000000..409876cf2d --- /dev/null +++ b/src/ApiGenerator/Configuration/Overrides/Endpoints/NodesHotThreadsOverrides.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 NodesHotThreadsOverrides : EndpointOverridesBase + { + public override IDictionary RenameQueryStringParams => new Dictionary + { + { "type", "thread_type" } + }; + } +} 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..9cda96e15d --- /dev/null +++ b/src/ApiGenerator/Configuration/Overrides/GlobalOverrides.cs @@ -0,0 +1,76 @@ +/* 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 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..5c5838638a --- /dev/null +++ b/src/ApiGenerator/Configuration/Overrides/IEndpointOverrides.cs @@ -0,0 +1,60 @@ +/* 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 + { + /// + /// A map of key -> obsolete message for properties in the spec that should not be used any longer + /// + IDictionary ObsoleteQueryStringParams { get; set; } + + /// + /// 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..5adfd3c46d --- /dev/null +++ b/src/ApiGenerator/Configuration/ViewLocations.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.Configuration +{ + public static class ViewLocations + { + public static string Root { get; } = $@"{GeneratorLocations.Root}Views/"; + private static string HighLevelRoot { get; } = $@"{Root}/HighLevel/"; + public static string HighLevel(params string[] paths) => HighLevelRoot + string.Join("/", paths); + + private static string LowLevelRoot { get; } = $@"{Root}/LowLevel/"; + public static string LowLevel(params string[] paths) => LowLevelRoot + string.Join("/", paths); + } +} diff --git a/src/ApiGenerator/Domain/ApiQueryParametersPatcher.cs b/src/ApiGenerator/Domain/ApiQueryParametersPatcher.cs new file mode 100644 index 0000000000..6bb6663e8c --- /dev/null +++ b/src/ApiGenerator/Domain/ApiQueryParametersPatcher.cs @@ -0,0 +1,160 @@ +/* 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 ApiQueryParametersPatcher + { + public static SortedDictionary Patch( + string endpointName, + IDictionary source, + IEndpointOverrides overrides, + bool checkCommon = true + ) + { + if (source == null) return null; + + var globalOverrides = new GlobalOverrides(); + var declaredKeys = source.Keys; + var skipList = CreateSkipList(globalOverrides, overrides, declaredKeys); + var partialList = CreatePartialList(globalOverrides, overrides, declaredKeys); + + var renameLookup = CreateRenameLookup(globalOverrides, overrides, declaredKeys); + var obsoleteLookup = CreateObsoleteLookup(globalOverrides, overrides, declaredKeys); + + var patchedParams = new SortedDictionary(); + var name = overrides?.GetType().Name ?? endpointName ?? "unknown"; + foreach (var kv in source) + { + var queryStringKey = kv.Key; + kv.Value.QueryStringKey = queryStringKey; + + if (checkCommon && RestApiSpec.CommonApiQueryParameters.Keys.Contains(queryStringKey)) + { + Generator.ApiGenerator.Warnings.Add($"key '{queryStringKey}' in {name} is already declared in _common.json"); + continue; + } + + if (!renameLookup.TryGetValue(queryStringKey, out var preferredName)) preferredName = kv.Key; + kv.Value.ClsName = CreateCSharpName(preferredName, endpointName); + + if (skipList.Contains(queryStringKey)) kv.Value.Skip = true; + + if (partialList.Contains(queryStringKey)) kv.Value.RenderPartial = true; + + if (obsoleteLookup.TryGetValue(queryStringKey, out var obsolete)) kv.Value.Obsolete = obsolete; + + //make sure source_enabled takes a boolean only + if (preferredName == "source_enabled") kv.Value.Type = "boolean"; + + + patchedParams[preferredName] = kv.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 global, IEndpointOverrides local, ICollection declaredKeys) => + CreateList(global, local, "skip", e => e.SkipQueryStringParams, declaredKeys); + + private static IList CreatePartialList(IEndpointOverrides global, IEndpointOverrides local, ICollection declaredKeys) => + CreateList(global, local, "partial", e => e.RenderPartial, declaredKeys); + + private static IDictionary CreateLookup(IEndpointOverrides global, IEndpointOverrides local, string type, + Func> @from, ICollection declaredKeys + ) + { + var d = new SortedDictionary(); + foreach (var kv in from(global)) 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 global, IEndpointOverrides local, string type, + Func> @from, ICollection declaredKeys + ) + { + var list = new List(); + if (global != null) list.AddRange(from(global)); + 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 CreateRenameLookup(IEndpointOverrides global, IEndpointOverrides local, + ICollection declaredKeys + ) => + CreateLookup(global, local, "rename", e => e.RenameQueryStringParams, declaredKeys); + + private static IDictionary CreateObsoleteLookup(IEndpointOverrides global, IEndpointOverrides local, + ICollection declaredKeys + ) => + CreateLookup(global, 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..c762abe066 --- /dev/null +++ b/src/ApiGenerator/Domain/Code/CsharpNames.cs @@ -0,0 +1,208 @@ +/* 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; +using CsQuery.ExtensionMethods.Internal; + +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..7e005f027f --- /dev/null +++ b/src/ApiGenerator/Domain/Code/HighLevel/Methods/BoundFluentMethod.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.Collections.Generic; +using System.Linq; +using ApiGenerator.Configuration; +using ApiGenerator.Domain.Specification; + +namespace ApiGenerator.Domain.Code.HighLevel.Methods +{ + public class BoundFluentMethod : FluentSyntaxBase + { + public BoundFluentMethod(CsharpNames names, IReadOnlyCollection parts, bool selectorIsOptional, string link, string summary) + : base(names, parts, selectorIsOptional, link, summary) { } + + 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..07c5ccd5a9 --- /dev/null +++ b/src/ApiGenerator/Domain/Code/HighLevel/Methods/FluentMethod.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; +using ApiGenerator.Domain.Specification; + +namespace ApiGenerator.Domain.Code.HighLevel.Methods +{ + public class FluentMethod : FluentSyntaxBase + { + public FluentMethod(CsharpNames names, IReadOnlyCollection parts, bool selectorIsOptional, string link, string summary) + : base(names, parts, selectorIsOptional, link, summary) { } + + 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..abff18c282 --- /dev/null +++ b/src/ApiGenerator/Domain/Code/HighLevel/Methods/FluentSyntaxBase.cs @@ -0,0 +1,165 @@ +/* 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; + +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) + : base(names, link, summary) => + (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..d47228b3ce --- /dev/null +++ b/src/ApiGenerator/Domain/Code/HighLevel/Methods/InitializerMethod.cs @@ -0,0 +1,73 @@ +/* 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; + +namespace ApiGenerator.Domain.Code.HighLevel.Methods +{ + public class InitializerMethod : MethodSyntaxBase + { + public InitializerMethod(CsharpNames names, string link, string summary) : base(names, link, summary) { } + + 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..5e27c6d8e2 --- /dev/null +++ b/src/ApiGenerator/Domain/Code/HighLevel/Methods/MethodSyntaxBase.cs @@ -0,0 +1,52 @@ +/* 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 abstract class MethodSyntaxBase + { + protected MethodSyntaxBase(CsharpNames names, string link, string summary) => + (CsharpNames, DocumentationLink, XmlDocSummary) = (names, link, summary); + + public string DocumentationLink { get; } + + public string XmlDocSummary { get; } + + 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..a46a85660e --- /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..3039482559 --- /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..f00f74f9e5 --- /dev/null +++ b/src/ApiGenerator/Domain/Code/LowLevel/LowLevelClientMethod.cs @@ -0,0 +1,81 @@ +/* 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; + +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 DeprecatedPath DeprecatedPath { get; set; } + public UrlInformation Url { get; set; } + public bool HasBody { get; set; } + public IEnumerable Parts { get; set; } + public string Path { get; set; } + + + public string UrlInCode + { + get + { + string Evaluator(Match m) + { + + var arg = m.Groups[^1].Value.ToCamelCase(); + return $"{{{arg}:{arg}}}"; + } + + var url = Path.TrimStart('/'); + var options = Url.OriginalParts?.Select(p => p.Key) ?? Enumerable.Empty(); + + var pattern = string.Join("|", options); + var urlCode = $"\"{url}\""; + if (Path.Contains("{")) + { + var patchedUrl = Regex.Replace(url, "{(" + pattern + ")}", Evaluator); + urlCode = $"Url($\"{patchedUrl}\")"; + } + return urlCode; + } + } + + 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..b9b70fb0d7 --- /dev/null +++ b/src/ApiGenerator/Domain/RestApiSpec.cs @@ -0,0 +1,127 @@ +/* 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 string Commit { get; set; } + + public static SortedDictionary CommonApiQueryParameters { get; set; } + + public IDictionary 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.FileName)) + .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; + + string CreateName(string name, string methodName, string @namespace) + { + if ( + name.ToLowerInvariant().Contains("metric") + ||(name.ToLowerInvariant() == "status") + ||(name.ToLowerInvariant() == "format") + ) + { + if (methodName.StartsWith(@namespace)) + return methodName + name; + else + return @namespace + methodName + name; + } + + return name; + } + + var urlParameterEnums = ( + from e in Endpoints.Values + from para in e.Url.Params.Values + where para.Options != null && para.Options.Any() + let name = CreateName(para.ClsName, e.CsharpNames.MethodName, e.CsharpNames.Namespace) + where name != "Time" + select new EnumDescription + { + Name = name, + Options = para.Options + }).ToList(); + + var urlPartEnums = ( + from e in Endpoints.Values + from part in e.Url.Parts + where part.Options != null && part.Options.Any() + select new EnumDescription + { + Name = CreateName(part.Name.ToPascalCase(), e.CsharpNames.MethodName, e.CsharpNames.Namespace), + Options = part.Options + }).ToList(); + + _enumDescriptions = urlPartEnums + .Concat(urlParameterEnums) + .DistinctBy(e => e.Name) + .ToList(); + + //TODO can be removed in 8.x + var versionType = _enumDescriptions.FirstOrDefault(f => f.Name == "VersionType"); + if (versionType != null) + { + var options = new List(versionType.Options); + options.Add("force"); + versionType.Options = options; + } + + return _enumDescriptions; + } + } + } +} diff --git a/src/ApiGenerator/Domain/Specification/ApiEndpoint.cs b/src/ApiGenerator/Domain/Specification/ApiEndpoint.cs new file mode 100644 index 0000000000..159b02fdf0 --- /dev/null +++ b/src/ApiGenerator/Domain/Specification/ApiEndpoint.cs @@ -0,0 +1,208 @@ +/* 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 Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace ApiGenerator.Domain.Specification +{ + public class ApiEndpoint + { + /// The filename of the spec describing the api endpoint + public string FileName { get; set; } + + /// 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; } + + [JsonConverter(typeof(StringEnumConverter))] + [JsonProperty("stability")] + public Stability Stability { get; set; } + + [JsonProperty("documentation")] + public Documentation OfficialDocumentationLink { get; set; } + + public UrlInformation Url { get; set; } + + public Body Body { get; set; } + + [JsonProperty("methods")] + public IReadOnlyCollection HttpMethods { get; set; } + + public IEndpointOverrides Overrides { get; internal set; } + + public RequestInterface RequestInterface => new RequestInterface + { + CsharpNames = CsharpNames, + UrlParts = Url.Parts, + PartialParameters = + Body == null ? Enumerable.Empty().ToList() : Url.Params.Values.Where(p => p.RenderPartial && !p.Skip).ToList(), + OfficialDocumentationLink = OfficialDocumentationLink?.Url + }; + + public RequestPartialImplementation RequestPartialImplementation => new RequestPartialImplementation + { + CsharpNames = CsharpNames, + OfficialDocumentationLink = OfficialDocumentationLink?.Url, + Stability = Stability, + Paths = Url.Paths, + Parts = Url.Parts, + Params = Url.Params.Values.Where(p => !p.Skip).ToList(), + Constructors = Constructor.RequestConstructors(CsharpNames, Url, inheritsFromPlainRequestBase: true).ToList(), + GenericConstructors = Constructor.RequestConstructors(CsharpNames, Url, inheritsFromPlainRequestBase: false).ToList(), + HasBody = Body != null, + }; + + public DescriptorPartialImplementation DescriptorPartialImplementation => new DescriptorPartialImplementation + { + CsharpNames = CsharpNames, + OfficialDocumentationLink = OfficialDocumentationLink?.Url, + Constructors = Constructor.DescriptorConstructors(CsharpNames, Url).ToList(), + Paths = Url.Paths, + Parts = Url.Parts, + Params = Url.Params.Values.Where(p => !p.Skip).ToList(), + HasBody = Body != null, + }; + + public RequestParameterImplementation RequestParameterImplementation => new RequestParameterImplementation + { + CsharpNames = CsharpNames, + OfficialDocumentationLink = OfficialDocumentationLink?.Url, + Params = Url.Params.Values.Where(p => !p.Skip).ToList(), + HttpMethod = PreferredHttpMethod + }; + + public string PreferredHttpMethod + { + get + { + var first = HttpMethods.First(); + if (HttpMethods.Count > 1 && first.ToUpperInvariant() == "GET") + return HttpMethods.Last(); + + return first; + } + } + + public string HighLevelMethodXmlDocDescription => + $"{PreferredHttpMethod} request to the {Name} API, read more about this API online:"; + + public HighLevelModel HighLevelModel => new HighLevelModel + { + CsharpNames = CsharpNames, + Fluent = new FluentMethod(CsharpNames, Url.Parts, + selectorIsOptional: Body == null || !Body.Required || HttpMethods.Contains("GET"), + link: OfficialDocumentationLink?.Url, + summary: HighLevelMethodXmlDocDescription + ), + FluentBound = !CsharpNames.DescriptorBindsOverMultipleDocuments + ? null + : new BoundFluentMethod(CsharpNames, Url.Parts, + selectorIsOptional: Body == null || !Body.Required || HttpMethods.Contains("GET"), + link: OfficialDocumentationLink?.Url, + summary: HighLevelMethodXmlDocDescription + ), + Initializer = new InitializerMethod(CsharpNames, + link: OfficialDocumentationLink?.Url, + summary: HighLevelMethodXmlDocDescription + ) + }; + + 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.PathsWithDeprecations) + { + 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, + DeprecatedPath = path.Deprecation, + Path = path.Path, + Parts = parts, + Url = Url, + HasBody = Body != null + }; + _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/Documentation.cs b/src/ApiGenerator/Domain/Specification/Documentation.cs new file mode 100644 index 0000000000..7f0cad59f5 --- /dev/null +++ b/src/ApiGenerator/Domain/Specification/Documentation.cs @@ -0,0 +1,87 @@ +/* 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 Newtonsoft.Json; + +namespace ApiGenerator.Domain.Specification +{ + [JsonConverter(typeof(DocumentationConverter))] + public class Documentation + { + public string Description { get; set; } + + private string _url; + public string Url + { + get => _url; + set => _url = value?.Replace("http://", "https://"); + } + } + + public class DocumentationConverter : JsonConverter + { + public override bool CanWrite { get; } = false; + + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) => throw new NotSupportedException(); + + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + + var documentation = new Documentation(); + + if (reader.TokenType == JsonToken.String) + { + documentation.Url = (string)reader.Value; + return documentation; + } + + while (reader.Read()) + { + if (reader.TokenType == JsonToken.EndObject) + break; + + var prop = (string)reader.Value; + switch (prop) + { + case "url": + documentation.Url = reader.ReadAsString(); + break; + case "description": + documentation.Description = reader.ReadAsString(); + break; + default: + throw new Exception($"Property '{prop}' unexpected in documentation object"); + } + } + return documentation; + } + + public override bool CanConvert(Type objectType) => true; + } +} diff --git a/src/ApiGenerator/Domain/Specification/QueryParameters.cs b/src/ApiGenerator/Domain/Specification/QueryParameters.cs new file mode 100644 index 0000000000..cd8de8801d --- /dev/null +++ b/src/ApiGenerator/Domain/Specification/QueryParameters.cs @@ -0,0 +1,222 @@ +/* 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 Newtonsoft.Json; +using Newtonsoft.Json.Linq; + +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 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 + { + if (!string.IsNullOrEmpty(_obsolete)) return _obsolete; + if (Deprecated != null) + { + if (!string.IsNullOrEmpty(Deprecated.Version) && !string.IsNullOrEmpty(Deprecated.Description)) + return $"Deprecated as of: {Deprecated.Version}, reason: {Deprecated.Description}"; + if (!string.IsNullOrEmpty(Deprecated.Version)) + return $"Deprecated as of: {Deprecated.Version}"; + if (!string.IsNullOrEmpty(Deprecated.Description)) + return $"reason: {Deprecated.Description}"; + + return "deprecated"; + } + + return null; + } + set => _obsolete = value; + } + + public QueryParameterDeprecation 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, params string[] doc) => + CodeGenerator.Property(@namespace, type, name, key, setter, Obsolete, doc); + } + + public class QueryParameterDeprecation + { + public string Version { get; set; } + + public string Description { get; set; } + } + + internal class QueryParameterDeprecationConverter : JsonConverter + { + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) => throw new NotImplementedException(); + + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + if (reader.TokenType == JsonToken.Boolean) + return new QueryParameterDeprecation(); + + var jObject = JObject.Load(reader); + return jObject.ToObject(JsonSerializer.CreateDefault()); + } + + public override bool CanConvert(Type objectType) => typeof(QueryParameterDeprecation).IsAssignableFrom(objectType); + } +} 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..1c58c9e92e --- /dev/null +++ b/src/ApiGenerator/Domain/Specification/UrlInformation.cs @@ -0,0 +1,144 @@ +/* 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 Newtonsoft.Json; + +namespace ApiGenerator.Domain.Specification +{ + + // ReSharper disable once ClassNeverInstantiated.Global + public class UrlInformation + { + public IDictionary Params { get; set; } = new SortedDictionary(); + + [JsonProperty("paths")] + private IReadOnlyCollection OriginalPaths { get; set; } + + [JsonProperty("parts")] + public IDictionary OriginalParts { get; set; } + + [JsonProperty("deprecated_paths")] + private IReadOnlyCollection DeprecatedPaths { get; set; } + + private List _paths; + public IReadOnlyCollection Paths + { + get + { + if (_paths != null && _paths.Count > 0) return _paths; + + _paths = OriginalPaths.Select(p => new UrlPath(p, OriginalParts)).ToList(); + return _paths; + } + } + + private List _pathsWithDeprecation; + public IReadOnlyCollection PathsWithDeprecations + { + get + { + if (_pathsWithDeprecation != null && _pathsWithDeprecation.Count > 0) return _pathsWithDeprecation; + + var paths = Paths ?? new UrlPath[] {}; + if (DeprecatedPaths == null || DeprecatedPaths.Count == 0) return Paths; + if (OriginalParts == null) return Paths; + + //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 canonicalPartNameLookup = paths.Select(path => new HashSet(path.Parts.Select(p => p.Name))).ToList(); + var withoutDeprecatedAliases = DeprecatedPaths + .Select(deprecatedPath => new + { + deprecatedPath, + parts = new HashSet(OriginalParts.Keys.Where(k => deprecatedPath.Path.Contains($"{{{k}}}"))) + }) + .GroupBy(t => t.parts, HashSet.CreateSetComparer()) + .Where(grouped => !canonicalPartNameLookup.Any(set => set.SetEquals(grouped.Key))) + .Select(grouped => grouped.First().deprecatedPath); + + _pathsWithDeprecation = paths + .Concat(withoutDeprecatedAliases.Select(p => new UrlPath(p, OriginalParts, Paths))) + .ToList(); + + // 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); + } + } + + _pathsWithDeprecation = finalPathsWithDeprecations; + + return _pathsWithDeprecation; + } + } + + + public IReadOnlyCollection Parts => Paths.SelectMany(p => p.Parts).DistinctBy(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, OriginalParts, 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..f0f0c27bbb --- /dev/null +++ b/src/ApiGenerator/Domain/Specification/UrlPart.cs @@ -0,0 +1,175 @@ +/* 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 +{ + + // Rename this type to Deprecation and remove Path duplication + public class DeprecatedPath + { + public string Version { get; set; } + public string Path { get; set; } + public string Description { get; set; } + } + + + 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 + { + get + { + switch (Name) + { + case "repository": return "RepositoryName"; + default: return 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 string CleanUpDescription(string value) + { + if (string.IsNullOrWhiteSpace(value)) return value; + + return 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..b1546f4f6e --- /dev/null +++ b/src/ApiGenerator/Domain/Specification/UrlPath.cs @@ -0,0 +1,119 @@ +/* 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; + +namespace ApiGenerator.Domain.Specification +{ + public class UrlPath + { + private readonly List _additionalPartsForConstructor; + public string Path { get; } + public DeprecatedPath Deprecation { get; } + + + public List Parts { get; } + + //TODO mark the parts that are deprecated + public UrlPath(DeprecatedPath path, IDictionary originalParts, IReadOnlyCollection allNonDeprecatedPaths) + : this(path.Path, originalParts) + { + Deprecation = path; + foreach (var part in Parts) + { + if (!part.Deprecated && !allNonDeprecatedPaths.Any(p => p.Path.Contains($"{{{part.Name}}}"))) + part.Deprecated = true; + } + } + public UrlPath(string path, IDictionary allParts, List additionalPartsForConstructor = null) + { + _additionalPartsForConstructor = additionalPartsForConstructor ?? new List(); + Path = LeadingBackslash(path); + if (allParts == null) + { + Parts = new List(); + return; + } + var parts = + from p in allParts + //so deliciously side effect-y but at least its more isolated then in ApiEndpoint.CsharpMethods + let name = p.Value.Name = p.Key + where path.Contains($"{{{name}}}") + orderby path.IndexOf($"{{{name}}}", StringComparison.Ordinal) + select p.Value; + Parts = parts.ToList(); + } + + 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..dd4251bd3b --- /dev/null +++ b/src/ApiGenerator/Extensions.cs @@ -0,0 +1,73 @@ +/* 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; +using CsQuery.ExtensionMethods.Internal; + +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 pascal[0].ToLower() + pascal.Substring(1); + } + + public static string SplitPascalCase(this string s) => + Regex.Replace(s, "([A-Z]+[a-z]*)", " $1").Trim(); + } +} diff --git a/src/ApiGenerator/Generator/ApiEndpointFactory.cs b/src/ApiGenerator/Generator/ApiEndpointFactory.cs new file mode 100644 index 0000000000..8669d731db --- /dev/null +++ b/src/ApiGenerator/Generator/ApiEndpointFactory.cs @@ -0,0 +1,229 @@ +/* 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 ApiGenerator.Configuration; +using ApiGenerator.Configuration.Overrides; +using ApiGenerator.Domain; +using ApiGenerator.Domain.Code; +using ApiGenerator.Domain.Specification; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; + +namespace ApiGenerator.Generator +{ + public static class ApiEndpointFactory + { + private static readonly JsonSerializer Serializer = JsonSerializer.Create( + new JsonSerializerSettings { Converters = new List { new QueryParameterDeprecationConverter() } }); + + public static ApiEndpoint FromFile(string jsonFile) + { + var officialJsonSpec = JObject.Parse(File.ReadAllText(jsonFile)); + TransformNewSpecStructureToOld(officialJsonSpec); + PatchOfficialSpec(officialJsonSpec, jsonFile); + var (name, endpoint) = officialJsonSpec.ToObject>(Serializer).First(); + + endpoint.FileName = Path.GetFileName(jsonFile); + endpoint.Name = name; + var tokens = name.Split("."); + + endpoint.MethodName = tokens.Last(); + if (tokens.Length > 1) + endpoint.Namespace = tokens[0]; + //todo side effect + endpoint.CsharpNames = new CsharpNames(name, endpoint.MethodName, endpoint.Namespace); + + LoadOverridesOnEndpoint(endpoint); + PatchRequestParameters(endpoint); + + EnforceRequiredOnParts(jsonFile, endpoint.Url); + return endpoint; + } + + /// + /// This makes sure required is configured correctly by inspecting the paths. + /// Will emit a warning if the spec file got this wrong + /// + private static void EnforceRequiredOnParts(string jsonFile, UrlInformation url) + { + if (url.IsPartless) return; + foreach (var part in url.Parts) + { + var required = url.Paths.All(p => p.Path.Contains($"{{{part.Name}}}")); + if (part.Required != required) + { + var message = required + ? "is [b green] required [/] but appears in spec as [b red] optional [/]" + : "is [b green] optional [/] but marked as [b red] required [/] "; + // TODO submit PR to fix these, too noisy for now + //ApiGenerator.Warnings.Add($"[grey]{jsonFile}[/] part [b white] {part.Name} [/] {message}"); + } + part.Required = required; + } + } + + private static void LoadOverridesOnEndpoint(ApiEndpoint endpoint) + { + var method = endpoint.CsharpNames.MethodName; + if (CodeConfiguration.ApiNameMapping.TryGetValue(endpoint.Name, out var mapsApiMethodName)) + method = mapsApiMethodName; + + var namespacePrefix = typeof(GlobalOverrides).Namespace + ".Endpoints."; + var typeName = namespacePrefix + method + "Overrides"; + var type = GeneratorLocations.Assembly.GetType(typeName); + if (type != null && Activator.CreateInstance(type) is IEndpointOverrides overrides) + endpoint.Overrides = overrides; + } + + private static void PatchRequestParameters(ApiEndpoint endpoint) + { + var newParams = ApiQueryParametersPatcher.Patch(endpoint.Name, endpoint.Url.Params, endpoint.Overrides); + endpoint.Url.Params = newParams; + } + + /// + /// Finds a patch file in patches and union merges this with the official spec. + /// This allows us to check in tweaks should breaking changes occur in the spec before we catch them + /// + private static void PatchOfficialSpec(JObject original, string jsonFile) + { + var directory = Path.GetDirectoryName(jsonFile); + var patchFile = Path.Combine(directory!,"..", "_Patches", Path.GetFileNameWithoutExtension(jsonFile)) + ".patch.json"; + if (!File.Exists(patchFile)) return; + + var patchedJson = JObject.Parse(File.ReadAllText(patchFile)); + + var pathsOverride = patchedJson.SelectToken("*.url.paths"); + + original.Merge(patchedJson, new JsonMergeSettings + { + MergeArrayHandling = MergeArrayHandling.Union + }); + + if (pathsOverride != null) original.SelectToken("*.url.paths").Replace(pathsOverride); + + var methodsOverride = patchedJson.SelectToken("*.methods"); + if (methodsOverride != null) + original.SelectToken("*.methods").Replace(methodsOverride); + + var paramsOverride = patchedJson.SelectToken("*.params"); + var originalParams = original.SelectToken("*.url.params") as JObject; + originalParams?.Merge(paramsOverride, new JsonMergeSettings + { + MergeArrayHandling = MergeArrayHandling.Union + }); + + if (paramsOverride != null) originalParams?.Replace(originalParams); + + void ReplaceOptions(string path) + { + var optionsOverrides = patchedJson.SelectToken(path); + if (optionsOverrides != null) + original.SelectToken(path).Replace(optionsOverrides); + } + + ReplaceOptions("*.url.parts.metric.options"); + ReplaceOptions("*.url.parts.index_metric.options"); + } + + /// + /// Changes the structure of new REST API spec in 7.4.0 to one that matches prior spec structure. + /// + private static void TransformNewSpecStructureToOld(JObject original) + { + var name = (JProperty)original.First; + var spec = (JObject)name.Value; + + // old spec structure, nothing to change + if (spec.ContainsKey("methods")) + return; + + var methods = new HashSet(StringComparer.InvariantCultureIgnoreCase); + JObject parts = null; + var paths = new List(); + var deprecatedPaths = new List(); + + foreach (var path in spec["url"]["paths"].Cast()) + { + if (path.ContainsKey("deprecated")) + { + var deprecated = new JObject + { + ["version"] = path["deprecated"]["version"].Value(), + ["path"] = path["path"].Value(), + ["description"] = path["deprecated"]["description"].Value() + }; + + deprecatedPaths.Add(deprecated); + } + else + paths.Add(path["path"].Value()); + + if (path.ContainsKey("parts")) + { + if (parts == null) + parts = path["parts"].Value(); + else + parts.Merge(path["parts"].Value(), new JsonMergeSettings + { + MergeArrayHandling = MergeArrayHandling.Union + }); + } + + foreach (var method in path["methods"].Cast()) + methods.Add(method.Value()); + } + + + + var newUrl = new JObject + { + ["paths"] = new JArray(paths.Cast().ToArray()), + }; + + if (spec.ContainsKey("params")) + { + newUrl["params"] = spec["params"]; + spec.Remove("params"); + } + + if (parts != null) + newUrl["parts"] = parts; + + if (deprecatedPaths.Any()) + newUrl["deprecated_paths"] = new JArray(deprecatedPaths.Cast().ToArray()); + + spec["url"] = newUrl; + spec["methods"] = new JArray(methods.Cast().ToArray()); + } + } +} diff --git a/src/ApiGenerator/Generator/ApiGenerator.cs b/src/ApiGenerator/Generator/ApiGenerator.cs new file mode 100644 index 0000000000..f4c522ec00 --- /dev/null +++ b/src/ApiGenerator/Generator/ApiGenerator.cs @@ -0,0 +1,153 @@ +/* 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.Threading; + using System.Threading.Tasks; +using ApiGenerator.Configuration; +using ApiGenerator.Domain; +using ApiGenerator.Domain.Specification; +using ApiGenerator.Generator.Razor; +using Newtonsoft.Json.Linq; +using ShellProgressBar; + +namespace ApiGenerator.Generator +{ + public class ApiGenerator + { + public static List Warnings { get; private set; } = new List(); + + public static async Task Generate(string downloadBranch, bool lowLevelOnly, RestApiSpec spec, CancellationToken token) + { + static async Task DoGenerate(ICollection generators, RestApiSpec restApiSpec, bool highLevel, CancellationToken token) + { + 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(restApiSpec, pbar, token); + pbar.Tick("Generated " + generator.Title); + } + } + + + var lowLevelGenerators = new List + { + //low level client + new LowLevelClientInterfaceGenerator(), + new LowLevelClientImplementationGenerator(), + new RequestParametersGenerator(), + new EnumsGenerator(), + new ApiUrlsLookupsGenerator(), + }; + + var highLevelGenerators = new List + { + //high level client + new HighLevelClientInterfaceGenerator(), + new HighLevelClientImplementationGenerator(), + new DescriptorsGenerator(), + new RequestsGenerator(), + }; + + await DoGenerate(lowLevelGenerators, spec, highLevel: false, token); + if (!lowLevelOnly) + await DoGenerate(highLevelGenerators, spec, highLevel: true, token); + + } + + public static RestApiSpec CreateRestApiSpecModel(string downloadBranch, params string[] folders) + { + var directories = Directory.GetDirectories(GeneratorLocations.RestSpecificationFolder, "*", SearchOption.AllDirectories) + .Where(f => folders == null || folders.Length == 0 || folders.Contains(new DirectoryInfo(f).Name)) + .OrderBy(f => new FileInfo(f).Name) + .ToList(); + + var endpoints = new SortedDictionary(); + var seenFiles = new HashSet(); + using (var pbar = new ProgressBar(directories.Count, $"Listing {directories.Count} directories", + new ProgressBarOptions { ProgressCharacter = '─', BackgroundColor = ConsoleColor.DarkGray, CollapseWhenFinished = false })) + { + var folderFiles = directories.Select(dir => + Directory.GetFiles(dir) + .Where(f => f.EndsWith(".json") && !CodeConfiguration.IgnoredApis.Contains(new FileInfo(f).Name)) + .ToList() + ); + var commonFile = Path.Combine(GeneratorLocations.RestSpecificationFolder, "Core", "_common.json"); + if (!File.Exists(commonFile)) throw new Exception($"Expected to find {commonFile}"); + + RestApiSpec.CommonApiQueryParameters = CreateCommonApiQueryParameters(commonFile); + + foreach (var jsonFiles in folderFiles) + { + using (var fileProgress = pbar.Spawn(jsonFiles.Count, $"Listing {jsonFiles.Count} files", + new ProgressBarOptions { ProgressCharacter = '─', BackgroundColor = ConsoleColor.DarkGray })) + { + foreach (var file in jsonFiles) + { + if (file.EndsWith("_common.json")) continue; + else if (file.EndsWith(".patch.json")) continue; + else + { + var endpoint = ApiEndpointFactory.FromFile(file); + seenFiles.Add(Path.GetFileNameWithoutExtension(file)); + endpoints.Add(endpoint.Name, endpoint); + } + + fileProgress.Tick(); + } + } + pbar.Tick(); + } + } + var wrongMapsApi = CodeConfiguration.ApiNameMapping.Where(k => !string.IsNullOrWhiteSpace(k.Key) && !seenFiles.Contains(k.Key)); + foreach (var (key, value) in wrongMapsApi) + { + var isIgnored = CodeConfiguration.IgnoredApis.Contains($"{value}.json"); + if (isIgnored) + Warnings.Add($"{value} uses MapsApi: {key} ignored in ${nameof(CodeConfiguration)}.{nameof(CodeConfiguration.IgnoredApis)}"); + else Warnings.Add($"{value} uses MapsApi: {key} which does not exist"); + } + + return new RestApiSpec { Endpoints = endpoints, Commit = downloadBranch }; + } + + private static SortedDictionary CreateCommonApiQueryParameters(string jsonFile) + { + var json = File.ReadAllText(jsonFile); + var jobject = JObject.Parse(json); + var commonParameters = jobject.Property("params").Value.ToObject>(); + return ApiQueryParametersPatcher.Patch(null, commonParameters, null, false); + } + } +} diff --git a/src/ApiGenerator/Generator/CodeGenerator.cs b/src/ApiGenerator/Generator/CodeGenerator.cs new file mode 100644 index 0000000000..b7e201e64a --- /dev/null +++ b/src/ApiGenerator/Generator/CodeGenerator.cs @@ -0,0 +1,121 @@ +/* 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 CsQuery.ExtensionMethods.Internal; + +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, params string[] doc) + { + var components = new List(); + foreach (var d in RenderDocumentation(doc)) A(d); + if (!string.IsNullOrWhiteSpace(obsolete)) A($"[Obsolete(\"Scheduled to be removed in 8.0, {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..35189de048 --- /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("_Generated", "ApiUrlsLookup.generated.cs"); + + await DoRazor(spec, view, target, null, token); + } + } +} diff --git a/src/ApiGenerator/Generator/Razor/DescriptorsGenerator.cs b/src/ApiGenerator/Generator/Razor/DescriptorsGenerator.cs new file mode 100644 index 0000000000..fa9e3f7ff8 --- /dev/null +++ b/src/ApiGenerator/Generator/Razor/DescriptorsGenerator.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 System.IO; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using ApiGenerator.Configuration; +using ApiGenerator.Domain; +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) + { + // Delete existing files + foreach (var file in Directory.GetFiles(GeneratorLocations.OpenSearchClientFolder, "Descriptors.*.cs")) + File.Delete(file); + + var view = ViewLocations.HighLevel("Descriptors", "RequestDescriptorBase.cshtml"); + var target = GeneratorLocations.HighLevel("Descriptors.cs"); + await DoRazor(spec, view, target, null, token); + + var dependantView = ViewLocations.HighLevel("Descriptors", "Descriptors.cshtml"); + string Target(string id) => GeneratorLocations.HighLevel($"Descriptors.{id}.cs"); + var namespaced = spec.EndpointsPerNamespaceHighLevel.ToList(); + await DoRazorDependantFiles(progressBar, namespaced, dependantView, kv => kv.Key, id => Target(id), token); + } + } +} diff --git a/src/ApiGenerator/Generator/Razor/EnumsGenerator.cs b/src/ApiGenerator/Generator/Razor/EnumsGenerator.cs new file mode 100644 index 0000000000..3708c5051a --- /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.Generated.cshtml"); + var target = GeneratorLocations.LowLevel("Api", "Enums.Generated.cs"); + + await DoRazor(spec, view, target, null, token); + } + } +} diff --git a/src/ApiGenerator/Generator/Razor/HighLevelClientImplementationGenerator.cs b/src/ApiGenerator/Generator/Razor/HighLevelClientImplementationGenerator.cs new file mode 100644 index 0000000000..a37dc00761 --- /dev/null +++ b/src/ApiGenerator/Generator/Razor/HighLevelClientImplementationGenerator.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.IO; +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 HighLevelClientImplementationGenerator : RazorGeneratorBase + { + public override string Title => "OpenSearch.Client client implementation"; + + public override async Task Generate(RestApiSpec spec, ProgressBar progressBar, CancellationToken token) + { + // Delete existing files + foreach (var file in Directory.GetFiles(GeneratorLocations.OpenSearchClientFolder, "OpenSearchClient.*.cs")) + File.Delete(file); + + var view = ViewLocations.HighLevel("Client", "Implementation", "OpenSearchClient.cshtml"); + var target = GeneratorLocations.HighLevel($"OpenSearchClient.{CsharpNames.RootNamespace}.cs"); + await DoRazor(spec, view, target, null, token); + + string Target(string id) => GeneratorLocations.HighLevel($"OpenSearchClient.{id}.cs"); + + var namespaced = spec.EndpointsPerNamespaceHighLevel.Where(kv => kv.Key != CsharpNames.RootNamespace).ToList(); + var dependantView = ViewLocations.HighLevel("Client", "Implementation", "OpenSearchClient.Namespace.cshtml"); + await DoRazorDependantFiles(progressBar, namespaced, dependantView, kv => kv.Key, id => Target(id), token); + + } + } +} diff --git a/src/ApiGenerator/Generator/Razor/HighLevelClientInterfaceGenerator.cs b/src/ApiGenerator/Generator/Razor/HighLevelClientInterfaceGenerator.cs new file mode 100644 index 0000000000..9b35b9a919 --- /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.Generated.cs"); + + await DoRazor(spec, view, target, null, token); + } + } +} diff --git a/src/ApiGenerator/Generator/Razor/LowLevelClientImplementationGenerator.cs b/src/ApiGenerator/Generator/Razor/LowLevelClientImplementationGenerator.cs new file mode 100644 index 0000000000..bd41fac4b8 --- /dev/null +++ b/src/ApiGenerator/Generator/Razor/LowLevelClientImplementationGenerator.cs @@ -0,0 +1,60 @@ +/* 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.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 { get; } = "OpenSearch.Net client implementation"; + + public override async Task Generate(RestApiSpec spec, ProgressBar progressBar, CancellationToken token) + { + // Delete existing files + foreach (var file in Directory.GetFiles(GeneratorLocations.OpenSearchNetFolder, "OpenSearchLowLevelClient.*.cs")) + File.Delete(file); + + var view = ViewLocations.LowLevel("Client", "Implementation", "OpenSearchLowLevelClient.cshtml"); + var target = GeneratorLocations.LowLevel($"OpenSearchLowLevelClient.{CsharpNames.RootNamespace}.cs"); + await DoRazor(spec, view, target, null, token); + + var namespaced = spec.EndpointsPerNamespaceLowLevel.Where(kv => kv.Key != CsharpNames.RootNamespace).ToList(); + var namespacedView = ViewLocations.LowLevel("Client", "Implementation", "OpenSearchLowLevelClient.Namespace.cshtml"); + await DoRazorDependantFiles(progressBar, namespaced, namespacedView, kv => kv.Key, + id => GeneratorLocations.LowLevel($"OpenSearchLowLevelClient.{id}.cs"), token); + } + } +} diff --git a/src/ApiGenerator/Generator/Razor/LowLevelClientInterfaceGenerator.cs b/src/ApiGenerator/Generator/Razor/LowLevelClientInterfaceGenerator.cs new file mode 100644 index 0000000000..f1d31074ce --- /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.Generated.cs"); + + await DoRazor(spec, view, target, null, token); + } + } +} diff --git a/src/ApiGenerator/Generator/Razor/RazorGeneratorBase.cs b/src/ApiGenerator/Generator/Razor/RazorGeneratorBase.cs new file mode 100644 index 0000000000..e24e7803ad --- /dev/null +++ b/src/ApiGenerator/Generator/Razor/RazorGeneratorBase.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; +using System.Collections.Generic; +using System.IO; +using System.Threading; +using System.Threading.Tasks; +using ApiGenerator.Configuration; +using ApiGenerator.Domain; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp; +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 FileSystemRazorProject(Path.GetFullPath(ViewLocations.Root))) + .UseMemoryCachingProvider() + .Build(); + + protected async Task DoRazor(TModel model, string viewLocation, string targetLocation, string cacheNameSuffix, CancellationToken token) + { + try + { + var name = GetType().Name + cacheNameSuffix; + var sourceFileContents = await File.ReadAllTextAsync(viewLocation, token); + token.ThrowIfCancellationRequested(); + var generated = await Engine.CompileRenderStringAsync(name, sourceFileContents, model); + 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, id, token); + c.Tick($"{Title}: {id}"); + } + } + } + + protected static void WriteFormattedCsharpFile(string path, string contents) + { + var tree = CSharpSyntaxTree.ParseText(contents); + var root = tree.GetRoot().NormalizeWhitespace(indentation:"\t", "\n"); + contents = root.ToFullString(); + File.WriteAllText(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..05d3609acc --- /dev/null +++ b/src/ApiGenerator/Generator/Razor/RequestParametersGenerator.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.IO; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using ApiGenerator.Configuration; +using ApiGenerator.Domain; +using ShellProgressBar; + +namespace ApiGenerator.Generator.Razor +{ + public class RequestParametersGenerator : RazorGeneratorBase + { + public override string Title { get; } = "OpenSearch.Net request parameters"; + + public override async Task Generate(RestApiSpec spec, ProgressBar progressBar, CancellationToken token) + { + // Delete existing files + foreach (var file in Directory.GetFiles(GeneratorLocations.OpenSearchNetFolder, "RequestParameters.*.cs")) + File.Delete(file); + + var view = ViewLocations.LowLevel("RequestParameters", "RequestParameters.cshtml"); + string Target(string id) => GeneratorLocations.LowLevel("Api", "RequestParameters", $"RequestParameters.{id}.cs"); + + var namespaced = spec.EndpointsPerNamespaceLowLevel.ToList(); + await DoRazorDependantFiles(progressBar, namespaced, view, kv => kv.Key, id => Target(id), token); + } + } +} diff --git a/src/ApiGenerator/Generator/Razor/RequestsGenerator.cs b/src/ApiGenerator/Generator/Razor/RequestsGenerator.cs new file mode 100644 index 0000000000..c7aa78b624 --- /dev/null +++ b/src/ApiGenerator/Generator/Razor/RequestsGenerator.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 System.IO; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using ApiGenerator.Configuration; +using ApiGenerator.Domain; +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) + { + // Delete existing files + foreach (var file in Directory.GetFiles(GeneratorLocations.OpenSearchClientFolder, "Requests.*.cs")) + File.Delete(file); + + var view = ViewLocations.HighLevel("Requests", "PlainRequestBase.cshtml"); + var target = GeneratorLocations.HighLevel("Requests.cs"); + await DoRazor(spec, view, target, null, token); + + var dependantView = ViewLocations.HighLevel("Requests", "Requests.cshtml"); + string Target(string id) => GeneratorLocations.HighLevel($"Requests.{id}.cs"); + var namespaced = spec.EndpointsPerNamespaceHighLevel.ToList(); + await DoRazorDependantFiles(progressBar, namespaced, dependantView, kv => kv.Key, id => Target(id), token); + } + } +} diff --git a/src/ApiGenerator/Program.cs b/src/ApiGenerator/Program.cs new file mode 100644 index 0000000000..2adb8d357b --- /dev/null +++ b/src/ApiGenerator/Program.cs @@ -0,0 +1,187 @@ +/* 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.Render(new Rule("[b white on orange4_1] Cancelled [/]").LeftAligned()); + AnsiConsole.WriteLine(); + return 1; + } + catch (Exception ex) + { + AnsiConsole.WriteLine(); + AnsiConsole.Render(new Rule("[b white on darkred] Exception [/]") + { + Alignment = Justify.Left, + }); + AnsiConsole.WriteLine(); + AnsiConsole.WriteException(ex); + 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.Render( + new Panel(grid) + .Header(new PanelHeader("[b white on chartreuse4] OpenSearch .NET client API generator [/]", Justify.Left)) + ); + Console.WriteLine(); + + if (redownloadCoreSpecification) + { + Console.WriteLine(); + AnsiConsole.Render(new Rule("[b white on chartreuse4] Downloading specification [/]").LeftAligned()); + Console.WriteLine(); + await RestSpecDownloader.DownloadAsync(downloadBranch, token); + } + + if (!generateCode) return 0; + + Console.WriteLine(); + AnsiConsole.Render(new Rule("[b white on chartreuse4] Loading specification [/]").LeftAligned()); + Console.WriteLine(); + + var spec = Generator.ApiGenerator.CreateRestApiSpecModel(downloadBranch, "Core"); + if (!lowLevelOnly) + { + foreach (var endpoint in spec.Endpoints.Select(e => e.Value.FileName)) + { + if (CodeConfiguration.IsNewHighLevelApi(endpoint) + && Ask($"Generate highlevel code for new api {endpoint}", false)) + CodeConfiguration.EnableHighLevelCodeGen.Add(endpoint); + + } + } + + Console.WriteLine(); + AnsiConsole.Render(new Rule("[b white on chartreuse4] Generating code [/]").LeftAligned()); + Console.WriteLine(); + + await Generator.ApiGenerator.Generate(downloadBranch, lowLevelOnly, spec, token); + + var warnings = Generator.ApiGenerator.Warnings; + if (warnings.Count > 0) + { + Console.WriteLine(); + AnsiConsole.Render(new Rule("[b black on yellow] Specification warnings [/]").LeftAligned()); + 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..86ef8e2dc5 --- /dev/null +++ b/src/ApiGenerator/RestSpecDownloader.cs @@ -0,0 +1,172 @@ +/* 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.Net; +using System.Net.Http; +using System.Threading; +using System.Threading.Tasks; +using ApiGenerator.Configuration; +using CsQuery; +using ShellProgressBar; + +namespace ApiGenerator +{ + public class RestSpecDownloader + { + private readonly string _branch; + private static readonly ProgressBarOptions MainProgressBarOptions = new ProgressBarOptions + { + BackgroundColor = ConsoleColor.DarkGray, + ProgressCharacter = '─', + }; + + private static string CommitsUrl = "https://github.com/opensearch-project/opensearch-net/commits/{branch}"; + private static readonly Dictionary OnlineSpecifications = new Dictionary + { + { "Core", "https://github.com/opensearch-project/opensearch-net/tree/{ref}/rest-api-spec/src/main/resources/rest-api-spec/api" }, + }; + + private static readonly ProgressBarOptions SubProgressBarOptions = new ProgressBarOptions + { + ForegroundColor = ConsoleColor.Cyan, + ForegroundColorDone = ConsoleColor.DarkGreen, + ProgressCharacter = '─', + BackgroundColor = ConsoleColor.DarkGray, + }; + + private RestSpecDownloader(string branch) => _branch = branch; + + private async Task DownloadAsync(CancellationToken token) + { + var @ref = await ResolveLastRef(_branch, token); + + var specifications = + (from kv in OnlineSpecifications + let url = kv.Value.Replace("{ref}", @ref) + select new Specification { FolderOnDisk = kv.Key, Branch = _branch, Ref = @ref, GithubListingUrl = url }).ToList(); + + using (var pbar = new ProgressBar(specifications.Count, "Downloading specifications", MainProgressBarOptions)) + { + foreach (var spec in specifications) + { + var specFolderOnDisk = Path.Combine(GeneratorLocations.RestSpecificationFolder, spec.FolderOnDisk); + if (Directory.Exists(specFolderOnDisk)) + { + Directory.Delete(specFolderOnDisk, true); + pbar.WriteLine($"Deleted target spec folder, before downloading new copy: {specFolderOnDisk}"); + } + pbar.Message = $"Downloading rest-api-spec to {spec.FolderOnDisk} for branch {_branch}"; + await DownloadJsonDefinitions(spec, pbar, token); + pbar.Tick($"Downloaded rest-api-spec to {spec.FolderOnDisk} for branch {_branch}"); + } + } + + await File.WriteAllTextAsync(GeneratorLocations.LastDownloadedRef, @ref, token); + + } + + public static Task DownloadAsync(string branch, CancellationToken token = default) => new RestSpecDownloader(branch).DownloadAsync(token); + + private static async Task ResolveLastRef(string branch, CancellationToken token) + { + var response = await Http.GetAsync(CommitsUrl.Replace("{branch}", branch), token); + var html = await response.Content.ReadAsStringAsync(); + var dom = CQ.Create(html); + + var prefix = "/opensearch-project/opensearch-net/commit/"; + var commit = dom["a.text-mono"] + .Select(s => s.GetAttribute("href")) + .Where(a => a.StartsWith(prefix)) + .Select(a => a.Replace(prefix, "")) + .FirstOrDefault() + ?? throw new Exception($"Can not locate the latest commit on branch: {branch}"); + return commit; + } + + private static readonly HttpClient Http = new HttpClient(); + private static async Task DownloadJsonDefinitions(Specification spec, IProgressBar pbar, CancellationToken token) + { + var response = await Http.GetAsync(spec.GithubListingUrl, token); + var html = await response.Content.ReadAsStringAsync(); + + await FindJsonFilesOnListing(spec, html, pbar, token); + } + + private static async Task FindJsonFilesOnListing(Specification spec, string html, IProgressBar pbar, CancellationToken token) + { + if (!Directory.Exists(GeneratorLocations.RestSpecificationFolder)) + Directory.CreateDirectory(GeneratorLocations.RestSpecificationFolder); + + var dom = CQ.Create(html); + + var endpoints = dom[".js-navigation-open"] + .Select(s => s.InnerText) + .Where(s => !string.IsNullOrEmpty(s) && s.EndsWith(".json")) + .ToList(); + + using var subBar = pbar.Spawn(endpoints.Count, "fetching individual json files", SubProgressBarOptions); + foreach (var e in endpoints) + await WriteEndpointFile(spec, e, subBar, token); + } + + private static async Task WriteEndpointFile(Specification spec, string s, IProgressBar pbar, CancellationToken token) + { + var rawFile = spec.GithubDownloadUrl(s); + var fileName = rawFile.Split('/').Last(); + + var response = await Http.GetAsync(rawFile, token); + var json = await response.Content.ReadAsStringAsync(); + await WriteToEndpointsFolder(spec.FolderOnDisk, fileName, json, token); + pbar.Tick($"Downloading {fileName}"); + } + + private static async Task WriteToEndpointsFolder(string folder, string filename, string contents, CancellationToken token) + { + var f = Path.Combine(GeneratorLocations.RestSpecificationFolder, folder); + if (!Directory.Exists(f)) Directory.CreateDirectory(f); + var target = Path.Combine(f, filename); + await File.WriteAllTextAsync(target, contents, token); + } + + private class Specification + { + // ReSharper disable once UnusedAutoPropertyAccessor.Local + public string Branch { get; set; } + public string Ref { get; set; } + public string FolderOnDisk { get; set; } + public string GithubListingUrl { get; set; } + + public string GithubDownloadUrl(string file) => + GithubListingUrl.Replace("github.com", "raw.githubusercontent.com").Replace("tree/", "") + "/" + file; + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/_common.json b/src/ApiGenerator/RestSpecification/Core/_common.json new file mode 100644 index 0000000000..afb0f75de6 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/_common.json @@ -0,0 +1,31 @@ +{ + "documentation" : { + "description": "Parameters that are accepted by all API endpoints.", + "url": "https://opensearch.org/docs/latest/opensearch/common-parameters/" + }, + "params": { + "pretty": { + "type": "boolean", + "description": "Pretty format the returned JSON response.", + "default": false + }, + "human": { + "type": "boolean", + "description": "Return human readable values for statistics.", + "default": true + }, + "error_trace": { + "type": "boolean", + "description": "Include the stack trace of returned errors.", + "default": false + }, + "source": { + "type": "string", + "description": "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests." + }, + "filter_path": { + "type": "list", + "description": "A comma-separated list of filters used to reduce the response." + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/bulk.json b/src/ApiGenerator/RestSpecification/Core/bulk.json new file mode 100644 index 0000000000..c4b2f102a9 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/bulk.json @@ -0,0 +1,107 @@ +{ + "bulk":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/bulk/", + "description":"Allows to perform multiple index/update/delete operations in a single request." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"], + "content_type": ["application/x-ndjson"] + }, + "url":{ + "paths":[ + { + "path":"/_bulk", + "methods":[ + "POST", + "PUT" + ] + }, + { + "path":"/{index}/_bulk", + "methods":[ + "POST", + "PUT" + ], + "parts":{ + "index":{ + "type":"string", + "description":"Default index for items which don't provide one" + } + } + }, + { + "path":"/{index}/{type}/_bulk", + "methods":[ + "POST", + "PUT" + ], + "parts":{ + "index":{ + "type":"string", + "description":"Default index for items which don't provide one" + }, + "type":{ + "type":"string", + "description":"Default document type for items which don't provide one" + } + } + } + ] + }, + "params":{ + "wait_for_active_shards":{ + "type":"string", + "description":"Sets the number of shard copies that must be active before proceeding with the bulk operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)" + }, + "refresh":{ + "type":"enum", + "options":[ + "true", + "false", + "wait_for" + ], + "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." + }, + "routing":{ + "type":"string", + "description":"Specific routing value" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "type":{ + "type":"string", + "description":"Default document type for items which don't provide one" + }, + "_source":{ + "type":"list", + "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" + }, + "_source_excludes":{ + "type":"list", + "description":"Default list of fields to exclude from the returned _source field, can be overridden on each sub-request" + }, + "_source_includes":{ + "type":"list", + "description":"Default list of fields to extract and return from the _source field, can be overridden on each sub-request" + }, + "pipeline":{ + "type":"string", + "description":"The pipeline id to preprocess incoming documents with" + }, + "require_alias": { + "type": "boolean", + "description": "Sets require_alias for all incoming documents. Defaults to unset (false)" + } + }, + "body":{ + "description":"The operation definition and data (action-data pairs), separated by newlines", + "required":true, + "serialize":"bulk" + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/cat.aliases.json b/src/ApiGenerator/RestSpecification/Core/cat.aliases.json new file mode 100644 index 0000000000..5790819539 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/cat.aliases.json @@ -0,0 +1,75 @@ +{ + "cat.aliases":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-aliases/", + "description":"Shows information about currently configured aliases to indices including filter and routing infos." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "text/plain", "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_cat/aliases", + "methods":[ + "GET" + ] + }, + { + "path":"/_cat/aliases/{name}", + "methods":[ + "GET" + ], + "parts":{ + "name":{ + "type":"list", + "description":"A comma-separated list of alias names to return" + } + } + } + ] + }, + "params":{ + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + }, + "h":{ + "type":"list", + "description":"Comma-separated list of column names to display" + }, + "help":{ + "type":"boolean", + "description":"Return help information", + "default":false + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default": "all", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/cat.allocation.json b/src/ApiGenerator/RestSpecification/Core/cat.allocation.json new file mode 100644 index 0000000000..6616747970 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/cat.allocation.json @@ -0,0 +1,88 @@ +{ + "cat.allocation":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-allocation/", + "description":"Provides a snapshot of how many shards are allocated to each data node and how much disk space they are using." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "text/plain", "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_cat/allocation", + "methods":[ + "GET" + ] + }, + { + "path":"/_cat/allocation/{node_id}", + "methods":[ + "GET" + ], + "parts":{ + "node_id":{ + "type":"list", + "description":"A comma-separated list of node IDs or names to limit the returned information" + } + } + } + ] + }, + "params":{ + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" + }, + "bytes":{ + "type":"enum", + "description":"The unit in which to display byte values", + "options":[ + "b", + "k", + "kb", + "m", + "mb", + "g", + "gb", + "t", + "tb", + "p", + "pb" + ] + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + }, + "h":{ + "type":"list", + "description":"Comma-separated list of column names to display" + }, + "help":{ + "type":"boolean", + "description":"Return help information", + "default":false + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/cat.cluster_manager.json b/src/ApiGenerator/RestSpecification/Core/cat.cluster_manager.json new file mode 100644 index 0000000000..5056437c26 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/cat.cluster_manager.json @@ -0,0 +1,73 @@ +{ + "cat.cluster_manager":{ + "documentation":{ + "url":"https://opensearch.org/docs/2.0/opensearch/rest-api/cat/cat-cluster_manager/", + "description":"Returns information about the cluster_manager node. Introduced in OpenSearch 2.0 instead of cat-master." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "text/plain", "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_cat/cluster_manager", + "methods":[ + "GET" + ] + }, + { + "path":"/_cat/master", + "methods":[ + "GET" + ], + "deprecated":{ + "version":"2.0.0", + "description":"To promote inclusive language, please use '/_cat/cluster_manager' instead." + } + } + ] + }, + "params":{ + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from cluster-manager node (default: false)" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node", + "deprecated":{ + "version":"2.0.0", + "description":"To promote inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager node" + }, + "h":{ + "type":"list", + "description":"Comma-separated list of column names to display" + }, + "help":{ + "type":"boolean", + "description":"Return help information", + "default":false + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/cat.count.json b/src/ApiGenerator/RestSpecification/Core/cat.count.json new file mode 100644 index 0000000000..3b1213eecc --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/cat.count.json @@ -0,0 +1,59 @@ +{ + "cat.count":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-count/", + "description":"Provides quick access to the document count of the entire cluster, or individual indices." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "text/plain", "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_cat/count", + "methods":[ + "GET" + ] + }, + { + "path":"/_cat/count/{index}", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to limit the returned information" + } + } + } + ] + }, + "params":{ + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" + }, + "h":{ + "type":"list", + "description":"Comma-separated list of column names to display" + }, + "help":{ + "type":"boolean", + "description":"Return help information", + "default":false + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/cat.fielddata.json b/src/ApiGenerator/RestSpecification/Core/cat.fielddata.json new file mode 100644 index 0000000000..6d418a9547 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/cat.fielddata.json @@ -0,0 +1,80 @@ +{ + "cat.fielddata":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-field-data/", + "description":"Shows how much heap memory is currently being used by fielddata on every data node in the cluster." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "text/plain", "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_cat/fielddata", + "methods":[ + "GET" + ] + }, + { + "path":"/_cat/fielddata/{fields}", + "methods":[ + "GET" + ], + "parts":{ + "fields":{ + "type":"list", + "description":"A comma-separated list of fields to return the fielddata size" + } + } + } + ] + }, + "params":{ + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" + }, + "bytes":{ + "type":"enum", + "description":"The unit in which to display byte values", + "options":[ + "b", + "k", + "kb", + "m", + "mb", + "g", + "gb", + "t", + "tb", + "p", + "pb" + ] + }, + "h":{ + "type":"list", + "description":"Comma-separated list of column names to display" + }, + "help":{ + "type":"boolean", + "description":"Return help information", + "default":false + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + }, + "fields":{ + "type":"list", + "description":"A comma-separated list of fields to return in the output" + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/cat.health.json b/src/ApiGenerator/RestSpecification/Core/cat.health.json new file mode 100644 index 0000000000..0a3cc9be1f --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/cat.health.json @@ -0,0 +1,65 @@ +{ + "cat.health":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-health/", + "description":"Returns a concise representation of the cluster health." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "text/plain", "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_cat/health", + "methods":[ + "GET" + ] + } + ] + }, + "params":{ + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" + }, + "h":{ + "type":"list", + "description":"Comma-separated list of column names to display" + }, + "help":{ + "type":"boolean", + "description":"Return help information", + "default":false + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "time":{ + "type":"enum", + "description":"The unit in which to display time values", + "options":[ + "d", + "h", + "m", + "s", + "ms", + "micros", + "nanos" + ] + }, + "ts":{ + "type":"boolean", + "description":"Set to false to disable timestamping", + "default":true + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/cat.help.json b/src/ApiGenerator/RestSpecification/Core/cat.help.json new file mode 100644 index 0000000000..21c9e63b79 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/cat.help.json @@ -0,0 +1,34 @@ +{ + "cat.help":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-health/", + "description":"Returns help for the Cat APIs." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "text/plain" ] + }, + "url":{ + "paths":[ + { + "path":"/_cat", + "methods":[ + "GET" + ] + } + ] + }, + "params":{ + "help":{ + "type":"boolean", + "description":"Return help information", + "default":false + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/cat.indices.json b/src/ApiGenerator/RestSpecification/Core/cat.indices.json new file mode 100644 index 0000000000..1f6ad64e01 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/cat.indices.json @@ -0,0 +1,132 @@ +{ + "cat.indices":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-indices/", + "description":"Returns information about indices: number of primaries and replicas, document counts, disk size, ..." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "text/plain", "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_cat/indices", + "methods":[ + "GET" + ] + }, + { + "path":"/_cat/indices/{index}", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to limit the returned information" + } + } + } + ] + }, + "params":{ + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" + }, + "bytes":{ + "type":"enum", + "description":"The unit in which to display byte values", + "options":[ + "b", + "k", + "kb", + "m", + "mb", + "g", + "gb", + "t", + "tb", + "p", + "pb" + ] + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)", + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + }, + "h":{ + "type":"list", + "description":"Comma-separated list of column names to display" + }, + "health":{ + "type":"enum", + "options":[ + "green", + "yellow", + "red" + ], + "description":"A health status (\"green\", \"yellow\", or \"red\" to filter only indices matching the specified health status" + }, + "help":{ + "type":"boolean", + "description":"Return help information", + "default":false + }, + "pri":{ + "type":"boolean", + "description":"Set to true to return stats only for primary shards", + "default":false + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "time":{ + "type":"enum", + "description":"The unit in which to display time values", + "options":[ + "d", + "h", + "m", + "s", + "ms", + "micros", + "nanos" + ] + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + }, + "include_unloaded_segments":{ + "type":"boolean", + "description":"If set to true segment stats will include stats for segments that are not currently loaded into memory", + "default":false + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default": "all", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/cat.master.json b/src/ApiGenerator/RestSpecification/Core/cat.master.json new file mode 100644 index 0000000000..26e0d29110 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/cat.master.json @@ -0,0 +1,55 @@ +{ + "cat.master":{ + "documentation":{ + "url":"https://opensearch.org/docs/1.2/opensearch/rest-api/cat/cat-master/", + "description":"Returns information about the master node. Deprecated as of OpenSearch 2.0, use cat-cluster_manager instead." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "text/plain", "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_cat/master", + "methods":[ + "GET" + ] + } + ] + }, + "params":{ + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "h":{ + "type":"list", + "description":"Comma-separated list of column names to display" + }, + "help":{ + "type":"boolean", + "description":"Return help information", + "default":false + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/cat.nodeattrs.json b/src/ApiGenerator/RestSpecification/Core/cat.nodeattrs.json new file mode 100644 index 0000000000..61aa48cd6e --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/cat.nodeattrs.json @@ -0,0 +1,59 @@ +{ + "cat.nodeattrs":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-nodeattrs/", + "description":"Returns information about custom node attributes." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "text/plain", "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_cat/nodeattrs", + "methods":[ + "GET" + ] + } + ] + }, + "params":{ + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + }, + "h":{ + "type":"list", + "description":"Comma-separated list of column names to display" + }, + "help":{ + "type":"boolean", + "description":"Return help information", + "default":false + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/cat.nodes.json b/src/ApiGenerator/RestSpecification/Core/cat.nodes.json new file mode 100644 index 0000000000..3e6d9e1f2e --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/cat.nodes.json @@ -0,0 +1,89 @@ +{ + "cat.nodes":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-nodes/", + "description":"Returns basic statistics about performance of cluster nodes." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "text/plain", "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_cat/nodes", + "methods":[ + "GET" + ] + } + ] + }, + "params":{ + "bytes":{ + "type":"enum", + "description":"The unit in which to display byte values", + "options":[ + "b", + "k", + "kb", + "m", + "mb", + "g", + "gb", + "t", + "tb", + "p", + "pb" + ] + }, + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" + }, + "full_id":{ + "type":"boolean", + "description":"Return the full node ID instead of the shortened version (default: false)" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + }, + "h":{ + "type":"list", + "description":"Comma-separated list of column names to display" + }, + "help":{ + "type":"boolean", + "description":"Return help information", + "default":false + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "time":{ + "type":"enum", + "description":"The unit in which to display time values", + "options":[ + "d", + "h", + "m", + "s", + "ms", + "micros", + "nanos" + ] + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/cat.pending_tasks.json b/src/ApiGenerator/RestSpecification/Core/cat.pending_tasks.json new file mode 100644 index 0000000000..8164f6c004 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/cat.pending_tasks.json @@ -0,0 +1,72 @@ +{ + "cat.pending_tasks":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-pending-tasks/", + "description":"Returns a concise representation of the cluster pending tasks." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "text/plain", "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_cat/pending_tasks", + "methods":[ + "GET" + ] + } + ] + }, + "params":{ + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + }, + "h":{ + "type":"list", + "description":"Comma-separated list of column names to display" + }, + "help":{ + "type":"boolean", + "description":"Return help information", + "default":false + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "time":{ + "type":"enum", + "description":"The unit in which to display time values", + "options":[ + "d", + "h", + "m", + "s", + "ms", + "micros", + "nanos" + ] + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/cat.plugins.json b/src/ApiGenerator/RestSpecification/Core/cat.plugins.json new file mode 100644 index 0000000000..fd25b004c8 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/cat.plugins.json @@ -0,0 +1,64 @@ +{ + "cat.plugins":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-plugins/", + "description":"Returns information about installed plugins across nodes node." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "text/plain", "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_cat/plugins", + "methods":[ + "GET" + ] + } + ] + }, + "params":{ + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + }, + "h":{ + "type":"list", + "description":"Comma-separated list of column names to display" + }, + "help":{ + "type":"boolean", + "description":"Return help information", + "default":false + }, + "include_bootstrap":{ + "type":"boolean", + "description":"Include bootstrap plugins in the response", + "default":false + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/cat.recovery.json b/src/ApiGenerator/RestSpecification/Core/cat.recovery.json new file mode 100644 index 0000000000..c1e9d1c844 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/cat.recovery.json @@ -0,0 +1,103 @@ +{ + "cat.recovery":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-recovery/", + "description":"Returns information about index shard recoveries, both on-going completed." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "text/plain", "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_cat/recovery", + "methods":[ + "GET" + ] + }, + { + "path":"/_cat/recovery/{index}", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"Comma-separated list or wildcard expression of index names to limit the returned information" + } + } + } + ] + }, + "params":{ + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" + }, + "active_only":{ + "type":"boolean", + "description":"If `true`, the response only includes ongoing shard recoveries", + "default":false + }, + "bytes":{ + "type":"enum", + "description":"The unit in which to display byte values", + "options":[ + "b", + "k", + "kb", + "m", + "mb", + "g", + "gb", + "t", + "tb", + "p", + "pb" + ] + }, + "detailed":{ + "type":"boolean", + "description":"If `true`, the response includes detailed information about shard recoveries", + "default":false + }, + "h":{ + "type":"list", + "description":"Comma-separated list of column names to display" + }, + "help":{ + "type":"boolean", + "description":"Return help information", + "default":false + }, + "index":{ + "type":"list", + "description":"Comma-separated list or wildcard expression of index names to limit the returned information" + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "time":{ + "type":"enum", + "description":"The unit in which to display time values", + "options":[ + "d", + "h", + "m", + "s", + "ms", + "micros", + "nanos" + ] + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/cat.repositories.json b/src/ApiGenerator/RestSpecification/Core/cat.repositories.json new file mode 100644 index 0000000000..294bedc001 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/cat.repositories.json @@ -0,0 +1,60 @@ +{ + "cat.repositories":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-repositories/", + "description":"Returns information about snapshot repositories registered in the cluster." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "text/plain", "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_cat/repositories", + "methods":[ + "GET" + ] + } + ] + }, + "params":{ + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node", + "default":false + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + }, + "h":{ + "type":"list", + "description":"Comma-separated list of column names to display" + }, + "help":{ + "type":"boolean", + "description":"Return help information", + "default":false + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/cat.segments.json b/src/ApiGenerator/RestSpecification/Core/cat.segments.json new file mode 100644 index 0000000000..24a28410e5 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/cat.segments.json @@ -0,0 +1,76 @@ +{ + "cat.segments":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-segments/", + "description":"Provides low-level information about the segments in the shards of an index." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "text/plain", "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_cat/segments", + "methods":[ + "GET" + ] + }, + { + "path":"/_cat/segments/{index}", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to limit the returned information" + } + } + } + ] + }, + "params":{ + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" + }, + "bytes":{ + "type":"enum", + "description":"The unit in which to display byte values", + "options":[ + "b", + "k", + "kb", + "m", + "mb", + "g", + "gb", + "t", + "tb", + "p", + "pb" + ] + }, + "h":{ + "type":"list", + "description":"Comma-separated list of column names to display" + }, + "help":{ + "type":"boolean", + "description":"Return help information", + "default":false + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/cat.shards.json b/src/ApiGenerator/RestSpecification/Core/cat.shards.json new file mode 100644 index 0000000000..7241591b38 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/cat.shards.json @@ -0,0 +1,101 @@ +{ + "cat.shards":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-shards/", + "description":"Provides a detailed view of shard allocation on nodes." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "text/plain", "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_cat/shards", + "methods":[ + "GET" + ] + }, + { + "path":"/_cat/shards/{index}", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to limit the returned information" + } + } + } + ] + }, + "params":{ + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" + }, + "bytes":{ + "type":"enum", + "description":"The unit in which to display byte values", + "options":[ + "b", + "k", + "kb", + "m", + "mb", + "g", + "gb", + "t", + "tb", + "p", + "pb" + ] + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)", + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + }, + "h":{ + "type":"list", + "description":"Comma-separated list of column names to display" + }, + "help":{ + "type":"boolean", + "description":"Return help information", + "default":false + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "time":{ + "type":"enum", + "description":"The unit in which to display time values", + "options":[ + "d", + "h", + "m", + "s", + "ms", + "micros", + "nanos" + ] + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/cat.snapshots.json b/src/ApiGenerator/RestSpecification/Core/cat.snapshots.json new file mode 100644 index 0000000000..ce8e73d29e --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/cat.snapshots.json @@ -0,0 +1,85 @@ +{ + "cat.snapshots":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/", + "description":"Returns all snapshots in a specific repository." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "text/plain", "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_cat/snapshots", + "methods":[ + "GET" + ] + }, + { + "path":"/_cat/snapshots/{repository}", + "methods":[ + "GET" + ], + "parts":{ + "repository":{ + "type":"list", + "description":"Name of repository from which to fetch the snapshot information" + } + } + } + ] + }, + "params":{ + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Set to true to ignore unavailable snapshots", + "default":false + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + }, + "h":{ + "type":"list", + "description":"Comma-separated list of column names to display" + }, + "help":{ + "type":"boolean", + "description":"Return help information", + "default":false + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "time":{ + "type":"enum", + "description":"The unit in which to display time values", + "options":[ + "d", + "h", + "m", + "s", + "ms", + "micros", + "nanos" + ] + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/cat.tasks.json b/src/ApiGenerator/RestSpecification/Core/cat.tasks.json new file mode 100644 index 0000000000..0a2bad4bbe --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/cat.tasks.json @@ -0,0 +1,76 @@ +{ + "cat.tasks":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-tasks/", + "description":"Returns information about the tasks currently executing on one or more nodes in the cluster." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "text/plain", "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_cat/tasks", + "methods":[ + "GET" + ] + } + ] + }, + "params":{ + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" + }, + "nodes":{ + "type":"list", + "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" + }, + "actions":{ + "type":"list", + "description":"A comma-separated list of actions that should be returned. Leave empty to return all." + }, + "detailed":{ + "type":"boolean", + "description":"Return detailed task information (default: false)" + }, + "parent_task_id":{ + "type":"string", + "description":"Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all." + }, + "h":{ + "type":"list", + "description":"Comma-separated list of column names to display" + }, + "help":{ + "type":"boolean", + "description":"Return help information", + "default":false + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "time":{ + "type":"enum", + "description":"The unit in which to display time values", + "options":[ + "d", + "h", + "m", + "s", + "ms", + "micros", + "nanos" + ] + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/cat.templates.json b/src/ApiGenerator/RestSpecification/Core/cat.templates.json new file mode 100644 index 0000000000..d1dfdb95df --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/cat.templates.json @@ -0,0 +1,71 @@ +{ + "cat.templates":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/", + "description":"Returns information about existing templates." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "text/plain", "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_cat/templates", + "methods":[ + "GET" + ] + }, + { + "path":"/_cat/templates/{name}", + "methods":[ + "GET" + ], + "parts":{ + "name":{ + "type":"string", + "description":"A pattern that returned template names must match" + } + } + } + ] + }, + "params":{ + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + }, + "h":{ + "type":"list", + "description":"Comma-separated list of column names to display" + }, + "help":{ + "type":"boolean", + "description":"Return help information", + "default":false + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/cat.thread_pool.json b/src/ApiGenerator/RestSpecification/Core/cat.thread_pool.json new file mode 100644 index 0000000000..8279f0b7bc --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/cat.thread_pool.json @@ -0,0 +1,71 @@ +{ + "cat.thread_pool":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-thread-pool/", + "description":"Returns cluster-wide thread pool statistics per node.\nBy default the active, queue and rejected statistics are returned for all thread pools." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "text/plain", "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_cat/thread_pool", + "methods":[ + "GET" + ] + }, + { + "path":"/_cat/thread_pool/{thread_pool_patterns}", + "methods":[ + "GET" + ], + "parts":{ + "thread_pool_patterns":{ + "type":"list", + "description":"A comma-separated list of regular-expressions to filter the thread pools in the output" + } + } + } + ] + }, + "params":{ + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + }, + "h":{ + "type":"list", + "description":"Comma-separated list of column names to display" + }, + "help":{ + "type":"boolean", + "description":"Return help information", + "default":false + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/clear_scroll.json b/src/ApiGenerator/RestSpecification/Core/clear_scroll.json new file mode 100644 index 0000000000..f352a421a2 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/clear_scroll.json @@ -0,0 +1,28 @@ +{ + "clear_scroll":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/scroll/", + "description":"Explicitly clears the search context for a scroll." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"], + "content_type": ["application/json","text/plain"] + }, + "url":{ + "paths":[ + { + "path":"/_search/scroll", + "methods":[ + "DELETE" + ] + } + ] + }, + "params":{}, + "body":{ + "description":"A comma-separated list of scroll IDs to clear if none was specified via the scroll_id parameter" + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/cluster.allocation_explain.json b/src/ApiGenerator/RestSpecification/Core/cluster.allocation_explain.json new file mode 100644 index 0000000000..b14bd18a45 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/cluster.allocation_explain.json @@ -0,0 +1,38 @@ +{ + "cluster.allocation_explain":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cluster-allocation/", + "description":"Provides explanations for shard allocations in the cluster." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"], + "content_type": ["application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_cluster/allocation/explain", + "methods":[ + "GET", + "POST" + ] + } + ] + }, + "params":{ + "include_yes_decisions":{ + "type":"boolean", + "description":"Return 'YES' decisions in explanation (default: false)" + }, + "include_disk_info":{ + "type":"boolean", + "description":"Return information about disk usage and shard sizes (default: false)" + } + }, + "body":{ + "description":"The index, shard, and primary flag to explain. Empty means 'explain the first unassigned shard'" + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/cluster.delete_component_template.json b/src/ApiGenerator/RestSpecification/Core/cluster.delete_component_template.json new file mode 100644 index 0000000000..b4ee56dab7 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/cluster.delete_component_template.json @@ -0,0 +1,43 @@ +{ + "cluster.delete_component_template":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/index-templates/", + "description":"Deletes a component template" + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_component_template/{name}", + "methods":[ + "DELETE" + ], + "parts":{ + "name":{ + "type":"string", + "description":"The name of the template" + } + } + } + ] + }, + "params":{ + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/cluster.delete_voting_config_exclusions.json b/src/ApiGenerator/RestSpecification/Core/cluster.delete_voting_config_exclusions.json new file mode 100644 index 0000000000..d32583908f --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/cluster.delete_voting_config_exclusions.json @@ -0,0 +1,30 @@ +{ + "cluster.delete_voting_config_exclusions":{ + "documentation":{ + "url":"", + "description":"Clears cluster voting config exclusions." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_cluster/voting_config_exclusions", + "methods":[ + "DELETE" + ] + } + ] + }, + "params":{ + "wait_for_removal": { + "type":"boolean", + "description":"Specifies whether to wait for all excluded nodes to be removed from the cluster before clearing the voting configuration exclusions list.", + "default":true + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/cluster.exists_component_template.json b/src/ApiGenerator/RestSpecification/Core/cluster.exists_component_template.json new file mode 100644 index 0000000000..64679d2e6b --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/cluster.exists_component_template.json @@ -0,0 +1,43 @@ +{ + "cluster.exists_component_template":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/index-templates/", + "description":"Returns information about whether a particular component template exist" + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_component_template/{name}", + "methods":[ + "HEAD" + ], + "parts":{ + "name":{ + "type":"string", + "description":"The name of the template" + } + } + } + ] + }, + "params":{ + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/cluster.get_component_template.json b/src/ApiGenerator/RestSpecification/Core/cluster.get_component_template.json new file mode 100644 index 0000000000..6e3329031a --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/cluster.get_component_template.json @@ -0,0 +1,49 @@ +{ + "cluster.get_component_template":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/index-templates/", + "description":"Returns one or more component templates" + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_component_template", + "methods":[ + "GET" + ] + }, + { + "path":"/_component_template/{name}", + "methods":[ + "GET" + ], + "parts":{ + "name":{ + "type":"list", + "description":"The comma separated names of the component templates" + } + } + } + ] + }, + "params":{ + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/cluster.get_settings.json b/src/ApiGenerator/RestSpecification/Core/cluster.get_settings.json new file mode 100644 index 0000000000..d329a8df2b --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/cluster.get_settings.json @@ -0,0 +1,46 @@ +{ + "cluster.get_settings":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cluster-settings/", + "description":"Returns cluster settings." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_cluster/settings", + "methods":[ + "GET" + ] + } + ] + }, + "params":{ + "flat_settings":{ + "type":"boolean", + "description":"Return settings in flat format (default: false)" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "include_defaults":{ + "type":"boolean", + "description":"Whether to return all default clusters setting.", + "default":false + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/cluster.health.json b/src/ApiGenerator/RestSpecification/Core/cluster.health.json new file mode 100644 index 0000000000..4aefa8d302 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/cluster.health.json @@ -0,0 +1,112 @@ +{ + "cluster.health":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cluster-health/", + "description":"Returns basic information about the health of the cluster." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_cluster/health", + "methods":[ + "GET" + ] + }, + { + "path":"/_cluster/health/{index}", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"Limit the information returned to a specific index" + } + } + } + ] + }, + "params":{ + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"all", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "level":{ + "type":"enum", + "options":[ + "cluster", + "indices", + "shards" + ], + "default":"cluster", + "description":"Specify the level of detail for returned information" + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "wait_for_active_shards":{ + "type":"string", + "description":"Wait until the specified number of shards is active" + }, + "wait_for_nodes":{ + "type":"string", + "description":"Wait until the specified number of nodes is available" + }, + "wait_for_events":{ + "type":"enum", + "options":[ + "immediate", + "urgent", + "high", + "normal", + "low", + "languid" + ], + "description":"Wait until all currently queued events with the given priority are processed" + }, + "wait_for_no_relocating_shards":{ + "type":"boolean", + "description":"Whether to wait until there are no relocating shards in the cluster" + }, + "wait_for_no_initializing_shards":{ + "type":"boolean", + "description":"Whether to wait until there are no initializing shards in the cluster" + }, + "wait_for_status":{ + "type":"enum", + "options":[ + "green", + "yellow", + "red" + ], + "description":"Wait until cluster is in a specific state" + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/cluster.pending_tasks.json b/src/ApiGenerator/RestSpecification/Core/cluster.pending_tasks.json new file mode 100644 index 0000000000..176385d912 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/cluster.pending_tasks.json @@ -0,0 +1,37 @@ +{ + "cluster.pending_tasks":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-pending-tasks/", + "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." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_cluster/pending_tasks", + "methods":[ + "GET" + ] + } + ] + }, + "params":{ + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/cluster.post_voting_config_exclusions.json b/src/ApiGenerator/RestSpecification/Core/cluster.post_voting_config_exclusions.json new file mode 100644 index 0000000000..d15970dbfb --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/cluster.post_voting_config_exclusions.json @@ -0,0 +1,38 @@ +{ + "cluster.post_voting_config_exclusions":{ + "documentation":{ + "url":"", + "description":"Updates the cluster voting config exclusions by node ids or node names." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_cluster/voting_config_exclusions", + "methods":[ + "POST" + ] + } + ] + }, + "params":{ + "node_ids":{ + "type":"string", + "description":"A comma-separated list of the persistent ids of the nodes to exclude from the voting configuration. If specified, you may not also specify ?node_names." + }, + "node_names":{ + "type":"string", + "description":"A comma-separated list of the names of the nodes to exclude from the voting configuration. If specified, you may not also specify ?node_ids." + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout", + "default":"30s" + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/cluster.put_component_template.json b/src/ApiGenerator/RestSpecification/Core/cluster.put_component_template.json new file mode 100644 index 0000000000..50eed63d39 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/cluster.put_component_template.json @@ -0,0 +1,54 @@ +{ + "cluster.put_component_template":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/index-templates/", + "description":"Creates or updates a component template" + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"], + "content_type": ["application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_component_template/{name}", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "name":{ + "type":"string", + "description":"The name of the template" + } + } + } + ] + }, + "params":{ + "create":{ + "type":"boolean", + "description":"Whether the index template should only be added if new or can also replace an existing one", + "default":false + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + } + }, + "body":{ + "description":"The template definition", + "required":true + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/cluster.put_settings.json b/src/ApiGenerator/RestSpecification/Core/cluster.put_settings.json new file mode 100644 index 0000000000..32ae4c3ac2 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/cluster.put_settings.json @@ -0,0 +1,46 @@ +{ + "cluster.put_settings":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cluster-settings/", + "description":"Updates the cluster settings." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"], + "content_type": ["application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_cluster/settings", + "methods":[ + "PUT" + ] + } + ] + }, + "params":{ + "flat_settings":{ + "type":"boolean", + "description":"Return settings in flat format (default: false)" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + } + }, + "body":{ + "description":"The settings to be updated. Can be either `transient` or `persistent` (survives cluster restart).", + "required":true + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/cluster.remote_info.json b/src/ApiGenerator/RestSpecification/Core/cluster.remote_info.json new file mode 100644 index 0000000000..d0ba3c375a --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/cluster.remote_info.json @@ -0,0 +1,24 @@ +{ + "cluster.remote_info":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/remote-info/", + "description":"Returns the information about configured remote clusters." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_remote/info", + "methods":[ + "GET" + ] + } + ] + }, + "params":{} + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/cluster.reroute.json b/src/ApiGenerator/RestSpecification/Core/cluster.reroute.json new file mode 100644 index 0000000000..14b75a551a --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/cluster.reroute.json @@ -0,0 +1,66 @@ +{ + "cluster.reroute":{ + "documentation":{ + "url":"", + "description":"Allows to manually change the allocation of individual shards in the cluster." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"], + "content_type": ["application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_cluster/reroute", + "methods":[ + "POST" + ] + } + ] + }, + "params":{ + "dry_run":{ + "type":"boolean", + "description":"Simulate the operation only and return the resulting state" + }, + "explain":{ + "type":"boolean", + "description":"Return an explanation of why the commands can or cannot be executed" + }, + "retry_failed":{ + "type":"boolean", + "description":"Retries allocation of shards that are blocked due to too many subsequent allocation failures" + }, + "metric":{ + "type":"list", + "options":[ + "_all", + "blocks", + "metadata", + "nodes", + "routing_table", + "master_node", + "version" + ], + "description":"Limit the information returned to the specified metrics. Defaults to all but metadata" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + } + }, + "body":{ + "description":"The definition of `commands` to perform (`move`, `cancel`, `allocate`)" + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/cluster.state.json b/src/ApiGenerator/RestSpecification/Core/cluster.state.json new file mode 100644 index 0000000000..89767d4dc8 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/cluster.state.json @@ -0,0 +1,117 @@ +{ + "cluster.state":{ + "documentation":{ + "url":"", + "description":"Returns a comprehensive information about the state of the cluster." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_cluster/state", + "methods":[ + "GET" + ] + }, + { + "path":"/_cluster/state/{metric}", + "methods":[ + "GET" + ], + "parts":{ + "metric":{ + "type":"list", + "options":[ + "_all", + "blocks", + "metadata", + "nodes", + "routing_table", + "routing_nodes", + "master_node", + "version" + ], + "description":"Limit the information returned to the specified metrics" + } + } + }, + { + "path":"/_cluster/state/{metric}/{index}", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" + }, + "metric":{ + "type":"list", + "options":[ + "_all", + "blocks", + "metadata", + "nodes", + "routing_table", + "routing_nodes", + "master_node", + "version" + ], + "description":"Limit the information returned to the specified metrics" + } + } + } + ] + }, + "params":{ + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + }, + "flat_settings":{ + "type":"boolean", + "description":"Return settings in flat format (default: false)" + }, + "wait_for_metadata_version":{ + "type":"number", + "description":"Wait for the metadata version to be equal or greater than the specified metadata version" + }, + "wait_for_timeout":{ + "type":"time", + "description":"The maximum time to wait for wait_for_metadata_version before timing out" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "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)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/cluster.stats.json b/src/ApiGenerator/RestSpecification/Core/cluster.stats.json new file mode 100644 index 0000000000..7545f6ba99 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/cluster.stats.json @@ -0,0 +1,45 @@ +{ + "cluster.stats":{ + "documentation":{ + "url":"", + "description":"Returns high-level overview of cluster statistics." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_cluster/stats", + "methods":[ + "GET" + ] + }, + { + "path":"/_cluster/stats/nodes/{node_id}", + "methods":[ + "GET" + ], + "parts":{ + "node_id":{ + "type":"list", + "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" + } + } + } + ] + }, + "params":{ + "flat_settings":{ + "type":"boolean", + "description":"Return settings in flat format (default: false)" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/count.json b/src/ApiGenerator/RestSpecification/Core/count.json new file mode 100644 index 0000000000..53aad4dde3 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/count.json @@ -0,0 +1,113 @@ +{ + "count":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/count/", + "description":"Returns number of documents matching a query." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"], + "content_type": ["application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_count", + "methods":[ + "POST", + "GET" + ] + + }, + { + "path":"/{index}/_count", + "methods":[ + "POST", + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of indices to restrict the results" + } + } + } + ] + }, + "params":{ + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "ignore_throttled":{ + "type":"boolean", + "description":"Whether specified concrete, expanded or aliased indices should be ignored when throttled" + }, + "allow_no_indices":{ + "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)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "min_score":{ + "type":"number", + "description":"Include only documents with a specific `_score` value in the result" + }, + "preference":{ + "type":"string", + "description":"Specify the node or shard the operation should be performed on (default: random)" + }, + "routing":{ + "type":"list", + "description":"A comma-separated list of specific routing values" + }, + "q":{ + "type":"string", + "description":"Query in the Lucene query string syntax" + }, + "analyzer":{ + "type":"string", + "description":"The analyzer to use for the query string" + }, + "analyze_wildcard":{ + "type":"boolean", + "description":"Specify whether wildcard and prefix queries should be analyzed (default: false)" + }, + "default_operator":{ + "type":"enum", + "options":[ + "AND", + "OR" + ], + "default":"OR", + "description":"The default operator for query string query (AND or OR)" + }, + "df":{ + "type":"string", + "description":"The field to use as default where no field prefix is given in the query string" + }, + "lenient":{ + "type":"boolean", + "description":"Specify whether format-based query failures (such as providing text to a numeric field) should be ignored" + }, + "terminate_after":{ + "type":"number", + "description":"The maximum count for each shard, upon reaching which the query execution will terminate early" + } + }, + "body":{ + "description":"A query to restrict the results specified with the Query DSL (optional)" + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/create.json b/src/ApiGenerator/RestSpecification/Core/create.json new file mode 100644 index 0000000000..a0932b971a --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/create.json @@ -0,0 +1,79 @@ +{ + "create":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/index-document/", + "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." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"], + "content_type": ["application/json"] + }, + "url":{ + "paths":[ + { + "path":"/{index}/_create/{id}", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "id":{ + "type":"string", + "description":"Document ID" + }, + "index":{ + "type":"string", + "description":"The name of the index" + } + } + } + ] + }, + "params":{ + "wait_for_active_shards":{ + "type":"string", + "description":"Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)" + }, + "refresh":{ + "type":"enum", + "options":[ + "true", + "false", + "wait_for" + ], + "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." + }, + "routing":{ + "type":"string", + "description":"Specific routing value" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "version":{ + "type":"number", + "description":"Explicit version number for concurrency control" + }, + "version_type":{ + "type":"enum", + "options":[ + "internal", + "external", + "external_gte" + ], + "description":"Specific version type" + }, + "pipeline":{ + "type":"string", + "description":"The pipeline id to preprocess incoming documents with" + } + }, + "body":{ + "description":"The document", + "required":true + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/dangling_indices.delete_dangling_index.json b/src/ApiGenerator/RestSpecification/Core/dangling_indices.delete_dangling_index.json new file mode 100644 index 0000000000..13670576c3 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/dangling_indices.delete_dangling_index.json @@ -0,0 +1,47 @@ +{ + "dangling_indices.delete_dangling_index": { + "documentation": { + "url": "", + "description": "Deletes the specified dangling index" + }, + "stability": "stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url": { + "paths": [ + { + "path": "/_dangling/{index_uuid}", + "methods": [ + "DELETE" + ], + "parts": { + "index_uuid": { + "type": "string", + "description": "The UUID of the dangling index" + } + } + } + ] + }, + "params": { + "accept_data_loss": { + "type": "boolean", + "description": "Must be set to true in order to delete the dangling index" + }, + "timeout": { + "type": "time", + "description": "Explicit operation timeout" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/dangling_indices.import_dangling_index.json b/src/ApiGenerator/RestSpecification/Core/dangling_indices.import_dangling_index.json new file mode 100644 index 0000000000..64c0568eb7 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/dangling_indices.import_dangling_index.json @@ -0,0 +1,47 @@ +{ + "dangling_indices.import_dangling_index": { + "documentation": { + "url": "", + "description": "Imports the specified dangling index" + }, + "stability": "stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url": { + "paths": [ + { + "path": "/_dangling/{index_uuid}", + "methods": [ + "POST" + ], + "parts": { + "index_uuid": { + "type": "string", + "description": "The UUID of the dangling index" + } + } + } + ] + }, + "params": { + "accept_data_loss": { + "type": "boolean", + "description": "Must be set to true in order to import the dangling index" + }, + "timeout": { + "type": "time", + "description": "Explicit operation timeout" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/dangling_indices.list_dangling_indices.json b/src/ApiGenerator/RestSpecification/Core/dangling_indices.list_dangling_indices.json new file mode 100644 index 0000000000..0cab5e272d --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/dangling_indices.list_dangling_indices.json @@ -0,0 +1,24 @@ +{ + "dangling_indices.list_dangling_indices": { + "documentation": { + "url": "", + "description": "Returns all dangling indices." + }, + "stability": "stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url": { + "paths": [ + { + "path": "/_dangling", + "methods": [ + "GET" + ] + } + ] + }, + "params": {} + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/delete.json b/src/ApiGenerator/RestSpecification/Core/delete.json new file mode 100644 index 0000000000..2bbbe5114f --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/delete.json @@ -0,0 +1,78 @@ +{ + "delete":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/delete-document/", + "description":"Removes a document from the index." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/{index}/_doc/{id}", + "methods":[ + "DELETE" + ], + "parts":{ + "id":{ + "type":"string", + "description":"The document ID" + }, + "index":{ + "type":"string", + "description":"The name of the index" + } + } + } + ] + }, + "params":{ + "wait_for_active_shards":{ + "type":"string", + "description":"Sets the number of shard copies that must be active before proceeding with the delete operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)" + }, + "refresh":{ + "type":"enum", + "options":[ + "true", + "false", + "wait_for" + ], + "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." + }, + "routing":{ + "type":"string", + "description":"Specific routing value" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "if_seq_no":{ + "type":"number", + "description":"only perform the delete operation if the last operation that has changed the document has the specified sequence number" + }, + "if_primary_term":{ + "type":"number", + "description":"only perform the delete operation if the last operation that has changed the document has the specified primary term" + }, + "version":{ + "type":"number", + "description":"Explicit version number for concurrency control" + }, + "version_type":{ + "type":"enum", + "options":[ + "internal", + "external", + "external_gte", + "force" + ], + "description":"Specific version type" + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/delete_by_query.json b/src/ApiGenerator/RestSpecification/Core/delete_by_query.json new file mode 100644 index 0000000000..c9a8e45fba --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/delete_by_query.json @@ -0,0 +1,185 @@ +{ + "delete_by_query":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/delete-by-query/", + "description":"Deletes documents matching the provided query." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"], + "content_type": ["application/json"] + }, + "url":{ + "paths":[ + { + "path":"/{index}/_delete_by_query", + "methods":[ + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices" + } + } + } + ] + }, + "params":{ + "analyzer": { + "type" : "string", + "description" : "The analyzer to use for the query string" + }, + "analyze_wildcard": { + "type" : "boolean", + "description" : "Specify whether wildcard and prefix queries should be analyzed (default: false)" + }, + "default_operator": { + "type" : "enum", + "options" : ["AND","OR"], + "default" : "OR", + "description" : "The default operator for query string query (AND or OR)" + }, + "df": { + "type" : "string", + "description" : "The field to use as default where no field prefix is given in the query string" + }, + "from": { + "type" : "number", + "description" : "Starting offset (default: 0)" + }, + "ignore_unavailable": { + "type" : "boolean", + "description" : "Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices": { + "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)" + }, + "conflicts":{ + "type":"enum", + "options":[ + "abort", + "proceed" + ], + "default":"abort", + "description":"What to do when the delete by query hits version conflicts?" + }, + "expand_wildcards": { + "type" : "enum", + "options" : [ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default" : "open", + "description" :"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "lenient": { + "type" : "boolean", + "description" : "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored" + }, + "preference": { + "type" : "string", + "description" : "Specify the node or shard the operation should be performed on (default: random)" + }, + "q": { + "type" : "string", + "description" : "Query in the Lucene query string syntax" + }, + "routing": { + "type" : "list", + "description" : "A comma-separated list of specific routing values" + }, + "scroll": { + "type" : "time", + "description" : "Specify how long a consistent view of the index should be maintained for scrolled search" + }, + "search_type": { + "type" : "enum", + "options" : ["query_then_fetch", "dfs_query_then_fetch"], + "description" : "Search operation type" + }, + "search_timeout": { + "type" : "time", + "description" : "Explicit timeout for each search request. Defaults to no timeout." + }, + "max_docs": { + "type" : "number", + "description" : "Maximum number of documents to process (default: all documents)" + }, + "sort": { + "type" : "list", + "description" : "A comma-separated list of : pairs" + }, + "_source": { + "type" : "list", + "description" : "True or false to return the _source field or not, or a list of fields to return" + }, + "_source_excludes": { + "type" : "list", + "description" : "A list of fields to exclude from the returned _source field" + }, + "_source_includes": { + "type" : "list", + "description" : "A list of fields to extract and return from the _source field" + }, + "terminate_after": { + "type" : "number", + "description" : "The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early." + }, + "stats": { + "type" : "list", + "description" : "Specific 'tag' of the request for logging and statistical purposes" + }, + "version": { + "type" : "boolean", + "description" : "Specify whether to return document version as part of a hit" + }, + "request_cache": { + "type" : "boolean", + "description" : "Specify if request cache should be used for this request or not, defaults to index level setting" + }, + "refresh": { + "type" : "boolean", + "description" : "Should the effected indexes be refreshed?" + }, + "timeout": { + "type" : "time", + "default": "1m", + "description" : "Time each individual bulk request should wait for shards that are unavailable." + }, + "wait_for_active_shards": { + "type" : "string", + "description" : "Sets the number of shard copies that must be active before proceeding with the delete by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)" + }, + "scroll_size":{ + "type":"number", + "default":100, + "description":"Size on the scroll request powering the delete by query" + }, + "wait_for_completion": { + "type" : "boolean", + "default": true, + "description" : "Should the request should block until the delete by query is complete." + }, + "requests_per_second": { + "type": "number", + "default": 0, + "description": "The throttle for this request in sub-requests per second. -1 means no throttle." + }, + "slices": { + "type": "number|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`." + } + }, + "body":{ + "description":"The search definition using the Query DSL", + "required":true + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/delete_by_query_rethrottle.json b/src/ApiGenerator/RestSpecification/Core/delete_by_query_rethrottle.json new file mode 100644 index 0000000000..39ff524319 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/delete_by_query_rethrottle.json @@ -0,0 +1,36 @@ +{ + "delete_by_query_rethrottle":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/delete-by-query/", + "description":"Changes the number of requests per second for a particular Delete By Query operation." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_delete_by_query/{task_id}/_rethrottle", + "methods":[ + "POST" + ], + "parts":{ + "task_id":{ + "type":"string", + "description":"The task id to rethrottle" + } + } + } + ] + }, + "params":{ + "requests_per_second":{ + "type":"number", + "required":true, + "description":"The throttle to set on this request in floating sub-requests per second. -1 means set no throttle." + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/delete_script.json b/src/ApiGenerator/RestSpecification/Core/delete_script.json new file mode 100644 index 0000000000..36b76fb222 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/delete_script.json @@ -0,0 +1,43 @@ +{ + "delete_script":{ + "documentation":{ + "url":"", + "description":"Deletes a script." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_scripts/{id}", + "methods":[ + "DELETE" + ], + "parts":{ + "id":{ + "type":"string", + "description":"Script ID" + } + } + } + ] + }, + "params":{ + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/exists.json b/src/ApiGenerator/RestSpecification/Core/exists.json new file mode 100644 index 0000000000..c0f131064d --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/exists.json @@ -0,0 +1,81 @@ +{ + "exists":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/", + "description":"Returns information about whether a document exists in an index." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/{index}/_doc/{id}", + "methods":[ + "HEAD" + ], + "parts":{ + "id":{ + "type":"string", + "description":"The document ID" + }, + "index":{ + "type":"string", + "description":"The name of the index" + } + } + } + ] + }, + "params":{ + "stored_fields":{ + "type":"list", + "description":"A comma-separated list of stored fields to return in the response" + }, + "preference":{ + "type":"string", + "description":"Specify the node or shard the operation should be performed on (default: random)" + }, + "realtime":{ + "type":"boolean", + "description":"Specify whether to perform the operation in realtime or search mode" + }, + "refresh":{ + "type":"boolean", + "description":"Refresh the shard containing the document before performing the operation" + }, + "routing":{ + "type":"string", + "description":"Specific routing value" + }, + "_source":{ + "type":"list", + "description":"True or false to return the _source field or not, or a list of fields to return" + }, + "_source_excludes":{ + "type":"list", + "description":"A list of fields to exclude from the returned _source field" + }, + "_source_includes":{ + "type":"list", + "description":"A list of fields to extract and return from the _source field" + }, + "version":{ + "type":"number", + "description":"Explicit version number for concurrency control" + }, + "version_type":{ + "type":"enum", + "options":[ + "internal", + "external", + "external_gte", + "force" + ], + "description":"Specific version type" + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/exists_source.json b/src/ApiGenerator/RestSpecification/Core/exists_source.json new file mode 100644 index 0000000000..0f498b7c04 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/exists_source.json @@ -0,0 +1,77 @@ +{ + "exists_source":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/", + "description":"Returns information about whether a document source exists in an index." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/{index}/_source/{id}", + "methods":[ + "HEAD" + ], + "parts":{ + "id":{ + "type":"string", + "description":"The document ID" + }, + "index":{ + "type":"string", + "description":"The name of the index" + } + } + } + ] + }, + "params":{ + "preference":{ + "type":"string", + "description":"Specify the node or shard the operation should be performed on (default: random)" + }, + "realtime":{ + "type":"boolean", + "description":"Specify whether to perform the operation in realtime or search mode" + }, + "refresh":{ + "type":"boolean", + "description":"Refresh the shard containing the document before performing the operation" + }, + "routing":{ + "type":"string", + "description":"Specific routing value" + }, + "_source":{ + "type":"list", + "description":"True or false to return the _source field or not, or a list of fields to return" + }, + "_source_excludes":{ + "type":"list", + "description":"A list of fields to exclude from the returned _source field" + }, + "_source_includes":{ + "type":"list", + "description":"A list of fields to extract and return from the _source field" + }, + "version":{ + "type":"number", + "description":"Explicit version number for concurrency control" + }, + "version_type":{ + "type":"enum", + "options":[ + "internal", + "external", + "external_gte", + "force" + ], + "description":"Specific version type" + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/explain.json b/src/ApiGenerator/RestSpecification/Core/explain.json new file mode 100644 index 0000000000..6ae2f8a08a --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/explain.json @@ -0,0 +1,93 @@ +{ + "explain":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/explain/", + "description":"Returns information about why a specific matches (or doesn't match) a query." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"], + "content_type": ["application/json"] + }, + "url":{ + "paths":[ + { + "path":"/{index}/_explain/{id}", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "id":{ + "type":"string", + "description":"The document ID" + }, + "index":{ + "type":"string", + "description":"The name of the index" + } + } + } + ] + }, + "params":{ + "analyze_wildcard":{ + "type":"boolean", + "description":"Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false)" + }, + "analyzer":{ + "type":"string", + "description":"The analyzer for the query string query" + }, + "default_operator":{ + "type":"enum", + "options":[ + "AND", + "OR" + ], + "default":"OR", + "description":"The default operator for query string query (AND or OR)" + }, + "df":{ + "type":"string", + "description":"The default field for query string query (default: _all)" + }, + "stored_fields":{ + "type":"list", + "description":"A comma-separated list of stored fields to return in the response" + }, + "lenient":{ + "type":"boolean", + "description":"Specify whether format-based query failures (such as providing text to a numeric field) should be ignored" + }, + "preference":{ + "type":"string", + "description":"Specify the node or shard the operation should be performed on (default: random)" + }, + "q":{ + "type":"string", + "description":"Query in the Lucene query string syntax" + }, + "routing":{ + "type":"string", + "description":"Specific routing value" + }, + "_source":{ + "type":"list", + "description":"True or false to return the _source field or not, or a list of fields to return" + }, + "_source_excludes":{ + "type":"list", + "description":"A list of fields to exclude from the returned _source field" + }, + "_source_includes":{ + "type":"list", + "description":"A list of fields to extract and return from the _source field" + } + }, + "body":{ + "description":"The query definition using the Query DSL" + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/features.get_features.json b/src/ApiGenerator/RestSpecification/Core/features.get_features.json new file mode 100644 index 0000000000..3ad4adc3a9 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/features.get_features.json @@ -0,0 +1,33 @@ +{ + "features.get_features":{ + "documentation":{ + "url":"h", + "description":"Gets a list of features which can be included in snapshots using the feature_states field when creating a snapshot" + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_features", + "methods":[ + "GET" + ] + } + ] + }, + "params":{ + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/field_caps.json b/src/ApiGenerator/RestSpecification/Core/field_caps.json new file mode 100644 index 0000000000..63382c4c22 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/field_caps.json @@ -0,0 +1,71 @@ +{ + "field_caps":{ + "documentation":{ + "url":"", + "description":"Returns the information about the capabilities of fields among multiple indices." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_field_caps", + "methods":[ + "GET", + "POST" + ] + }, + { + "path":"/{index}/_field_caps", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" + } + } + } + ] + }, + "params":{ + "fields":{ + "type":"list", + "description":"A comma-separated list of field names" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "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)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "include_unmapped":{ + "type":"boolean", + "default":false, + "description":"Indicates whether unmapped fields should be included in the response." + } + }, + "body":{ + "description":"An index filter specified with the Query DSL" + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/get.json b/src/ApiGenerator/RestSpecification/Core/get.json new file mode 100644 index 0000000000..cc07436a83 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/get.json @@ -0,0 +1,81 @@ +{ + "get":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/", + "description":"Returns a document." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/{index}/_doc/{id}", + "methods":[ + "GET" + ], + "parts":{ + "id":{ + "type":"string", + "description":"The document ID" + }, + "index":{ + "type":"string", + "description":"The name of the index" + } + } + } + ] + }, + "params":{ + "stored_fields":{ + "type":"list", + "description":"A comma-separated list of stored fields to return in the response" + }, + "preference":{ + "type":"string", + "description":"Specify the node or shard the operation should be performed on (default: random)" + }, + "realtime":{ + "type":"boolean", + "description":"Specify whether to perform the operation in realtime or search mode" + }, + "refresh":{ + "type":"boolean", + "description":"Refresh the shard containing the document before performing the operation" + }, + "routing":{ + "type":"string", + "description":"Specific routing value" + }, + "_source":{ + "type":"list", + "description":"True or false to return the _source field or not, or a list of fields to return" + }, + "_source_excludes":{ + "type":"list", + "description":"A list of fields to exclude from the returned _source field" + }, + "_source_includes":{ + "type":"list", + "description":"A list of fields to extract and return from the _source field" + }, + "version":{ + "type":"number", + "description":"Explicit version number for concurrency control" + }, + "version_type":{ + "type":"enum", + "options":[ + "internal", + "external", + "external_gte", + "force" + ], + "description":"Specific version type" + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/get_script.json b/src/ApiGenerator/RestSpecification/Core/get_script.json new file mode 100644 index 0000000000..b99b5d3cf1 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/get_script.json @@ -0,0 +1,39 @@ +{ + "get_script":{ + "documentation":{ + "url":"", + "description":"Returns a script." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_scripts/{id}", + "methods":[ + "GET" + ], + "parts":{ + "id":{ + "type":"string", + "description":"Script ID" + } + } + } + ] + }, + "params":{ + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager node" + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/get_script_context.json b/src/ApiGenerator/RestSpecification/Core/get_script_context.json new file mode 100644 index 0000000000..a8150af421 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/get_script_context.json @@ -0,0 +1,24 @@ +{ + "get_script_context":{ + "documentation":{ + "url": "", + "description":"Returns all script contexts." + }, + "stability":"experimental", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_script_context", + "methods":[ + "GET" + ] + } + ] + }, + "params":{} + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/get_script_languages.json b/src/ApiGenerator/RestSpecification/Core/get_script_languages.json new file mode 100644 index 0000000000..2bf532fa14 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/get_script_languages.json @@ -0,0 +1,24 @@ +{ + "get_script_languages":{ + "documentation":{ + "url": "", + "description":"Returns available script types, languages and contexts" + }, + "stability":"experimental", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_script_language", + "methods":[ + "GET" + ] + } + ] + }, + "params":{} + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/get_source.json b/src/ApiGenerator/RestSpecification/Core/get_source.json new file mode 100644 index 0000000000..02db4c2902 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/get_source.json @@ -0,0 +1,77 @@ +{ + "get_source":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/", + "description":"Returns the source of a document." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/{index}/_source/{id}", + "methods":[ + "GET" + ], + "parts":{ + "id":{ + "type":"string", + "description":"The document ID" + }, + "index":{ + "type":"string", + "description":"The name of the index" + } + } + } + ] + }, + "params":{ + "preference":{ + "type":"string", + "description":"Specify the node or shard the operation should be performed on (default: random)" + }, + "realtime":{ + "type":"boolean", + "description":"Specify whether to perform the operation in realtime or search mode" + }, + "refresh":{ + "type":"boolean", + "description":"Refresh the shard containing the document before performing the operation" + }, + "routing":{ + "type":"string", + "description":"Specific routing value" + }, + "_source":{ + "type":"list", + "description":"True or false to return the _source field or not, or a list of fields to return" + }, + "_source_excludes":{ + "type":"list", + "description":"A list of fields to exclude from the returned _source field" + }, + "_source_includes":{ + "type":"list", + "description":"A list of fields to extract and return from the _source field" + }, + "version":{ + "type":"number", + "description":"Explicit version number for concurrency control" + }, + "version_type":{ + "type":"enum", + "options":[ + "internal", + "external", + "external_gte", + "force" + ], + "description":"Specific version type" + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/index.json b/src/ApiGenerator/RestSpecification/Core/index.json new file mode 100644 index 0000000000..609204b3cb --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/index.json @@ -0,0 +1,111 @@ +{ + "index":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/index-document/", + "description":"Creates or updates a document in an index." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"], + "content_type": ["application/json"] + }, + "url":{ + "paths":[ + { + "path":"/{index}/_doc/{id}", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "id":{ + "type":"string", + "description":"Document ID" + }, + "index":{ + "type":"string", + "description":"The name of the index" + } + } + }, + { + "path":"/{index}/_doc", + "methods":[ + "POST" + ], + "parts":{ + "index":{ + "type":"string", + "description":"The name of the index" + } + } + } + ] + }, + "params":{ + "wait_for_active_shards":{ + "type":"string", + "description":"Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)" + }, + "op_type":{ + "type":"enum", + "options":[ + "index", + "create" + ], + "description":"Explicit operation type. Defaults to `index` for requests with an explicit document ID, and to `create`for requests without an explicit document ID" + }, + "refresh":{ + "type":"enum", + "options":[ + "true", + "false", + "wait_for" + ], + "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." + }, + "routing":{ + "type":"string", + "description":"Specific routing value" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "version":{ + "type":"number", + "description":"Explicit version number for concurrency control" + }, + "version_type":{ + "type":"enum", + "options":[ + "internal", + "external", + "external_gte" + ], + "description":"Specific version type" + }, + "if_seq_no":{ + "type":"number", + "description":"only perform the index operation if the last operation that has changed the document has the specified sequence number" + }, + "if_primary_term":{ + "type":"number", + "description":"only perform the index operation if the last operation that has changed the document has the specified primary term" + }, + "pipeline":{ + "type":"string", + "description":"The pipeline id to preprocess incoming documents with" + }, + "require_alias": { + "type": "boolean", + "description": "When true, requires destination to be an alias. Default is false" + } + }, + "body":{ + "description":"The document", + "required":true + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.add_block.json b/src/ApiGenerator/RestSpecification/Core/indices.add_block.json new file mode 100644 index 0000000000..f63cfab61e --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/indices.add_block.json @@ -0,0 +1,67 @@ +{ + "indices.add_block":{ + "documentation":{ + "url":"", + "description":"Adds a block to an index." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/{index}/_block/{block}", + "methods":[ + "PUT" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma separated list of indices to add a block to" + }, + "block":{ + "type":"string", + "description":"The block to add (one of read, write, read_only or metadata)" + } + } + } + ] + }, + "params":{ + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "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)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.analyze.json b/src/ApiGenerator/RestSpecification/Core/indices.analyze.json new file mode 100644 index 0000000000..2f8cd48257 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/indices.analyze.json @@ -0,0 +1,47 @@ +{ + "indices.analyze":{ + "documentation":{ + "url":"", + "description":"Performs the analysis process on a text and return the tokens breakdown of the text." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"], + "content_type": ["application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_analyze", + "methods":[ + "GET", + "POST" + ] + }, + { + "path":"/{index}/_analyze", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "index":{ + "type":"string", + "description":"The name of the index to scope the operation" + } + } + } + ] + }, + "params":{ + "index":{ + "type":"string", + "description":"The name of the index to scope the operation" + } + }, + "body":{ + "description":"Define analyzer/tokenizer parameters and the text on which the analysis should be performed" + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.clear_cache.json b/src/ApiGenerator/RestSpecification/Core/indices.clear_cache.json new file mode 100644 index 0000000000..7f325513ee --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/indices.clear_cache.json @@ -0,0 +1,77 @@ +{ + "indices.clear_cache":{ + "documentation":{ + "url":"", + "description":"Clears all or specific caches for one or more indices." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_cache/clear", + "methods":[ + "POST" + ] + }, + { + "path":"/{index}/_cache/clear", + "methods":[ + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index name to limit the operation" + } + } + } + ] + }, + "params":{ + "fielddata":{ + "type":"boolean", + "description":"Clear field data" + }, + "fields":{ + "type":"list", + "description":"A comma-separated list of fields to clear when using the `fielddata` parameter (default: all)" + }, + "query":{ + "type":"boolean", + "description":"Clear query caches" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "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)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "index":{ + "type":"list", + "description":"A comma-separated list of index name to limit the operation" + }, + "request":{ + "type":"boolean", + "description":"Clear request cache" + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.clone.json b/src/ApiGenerator/RestSpecification/Core/indices.clone.json new file mode 100644 index 0000000000..d200c10b85 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/indices.clone.json @@ -0,0 +1,56 @@ +{ + "indices.clone": { + "documentation": { + "url": "https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/clone/", + "description": "Clones an index" + }, + "stability": "stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"], + "content_type": ["application/json"] + }, + "url": { + "paths": [ + { + "path": "/{index}/_clone/{target}", + "methods": [ + "PUT", + "POST" + ], + "parts": { + "index": { + "type": "string", + "description": "The name of the source index to clone" + }, + "target": { + "type": "string", + "description": "The name of the target index to clone into" + } + } + } + ] + }, + "params": { + "timeout": { + "type" : "time", + "description" : "Explicit operation timeout" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + }, + "wait_for_active_shards": { + "type" : "string", + "description" : "Set the number of active shards to wait for on the cloned index before the operation returns." + } + }, + "body": { + "description" : "The configuration for the target index (`settings` and `aliases`)" + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.close.json b/src/ApiGenerator/RestSpecification/Core/indices.close.json new file mode 100644 index 0000000000..75ac41325e --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/indices.close.json @@ -0,0 +1,67 @@ +{ + "indices.close":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/close-index/", + "description":"Closes an index." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/{index}/_close", + "methods":[ + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma separated list of indices to close" + } + } + } + ] + }, + "params":{ + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "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)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "wait_for_active_shards":{ + "type":"string", + "description":"Sets the number of active shards to wait for before the operation returns. Set to `index-setting` to wait according to the index setting `index.write.wait_for_active_shards`, or `all` to wait for all shards, or an integer. Defaults to `0`." + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.create.json b/src/ApiGenerator/RestSpecification/Core/indices.create.json new file mode 100644 index 0000000000..02ddc9c760 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/indices.create.json @@ -0,0 +1,55 @@ +{ + "indices.create":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/create-index/", + "description":"Creates an index with optional settings and mappings." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"], + "content_type": ["application/json"] + }, + "url":{ + "paths":[ + { + "path":"/{index}", + "methods":[ + "PUT" + ], + "parts":{ + "index":{ + "type":"string", + "description":"The name of the index" + } + } + } + ] + }, + "params":{ + "include_type_name":{ + "type":"boolean", + "description":"Whether a type should be expected in the body of the mappings." + }, + "wait_for_active_shards":{ + "type":"string", + "description":"Set the number of active shards to wait for before the operation returns." + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + } + }, + "body":{ + "description":"The configuration for the index (`settings` and `mappings`)" + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.delete.json b/src/ApiGenerator/RestSpecification/Core/indices.delete.json new file mode 100644 index 0000000000..2ba5dda8c3 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/indices.delete.json @@ -0,0 +1,63 @@ +{ + "indices.delete":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/delete-index/", + "description":"Deletes an index." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/{index}", + "methods":[ + "DELETE" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices" + } + } + } + ] + }, + "params":{ + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Ignore unavailable indexes (default: false)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Ignore if a wildcard expression resolves to no concrete indices (default: false)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether wildcard expressions should get expanded to open or closed indices (default: open)" + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.delete_alias.json b/src/ApiGenerator/RestSpecification/Core/indices.delete_alias.json new file mode 100644 index 0000000000..6b3a133166 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/indices.delete_alias.json @@ -0,0 +1,63 @@ +{ + "indices.delete_alias":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/alias/", + "description":"Deletes an alias." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/{index}/_alias/{name}", + "methods":[ + "DELETE" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names (supports wildcards); use `_all` for all indices" + }, + "name":{ + "type":"list", + "description":"A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices." + } + } + }, + { + "path":"/{index}/_aliases/{name}", + "methods":[ + "DELETE" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names (supports wildcards); use `_all` for all indices" + }, + "name":{ + "type":"list", + "description":"A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices." + } + } + } + ] + }, + "params":{ + "timeout":{ + "type":"time", + "description":"Explicit timestamp for the document" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.delete_index_template.json b/src/ApiGenerator/RestSpecification/Core/indices.delete_index_template.json new file mode 100644 index 0000000000..3fd849a339 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/indices.delete_index_template.json @@ -0,0 +1,43 @@ +{ + "indices.delete_index_template":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/", + "description":"Deletes an index template." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_index_template/{name}", + "methods":[ + "DELETE" + ], + "parts":{ + "name":{ + "type":"string", + "description":"The name of the template" + } + } + } + ] + }, + "params":{ + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.delete_template.json b/src/ApiGenerator/RestSpecification/Core/indices.delete_template.json new file mode 100644 index 0000000000..f16a62f6cb --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/indices.delete_template.json @@ -0,0 +1,43 @@ +{ + "indices.delete_template":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/", + "description":"Deletes an index template." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_template/{name}", + "methods":[ + "DELETE" + ], + "parts":{ + "name":{ + "type":"string", + "description":"The name of the template" + } + } + } + ] + }, + "params":{ + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.exists.json b/src/ApiGenerator/RestSpecification/Core/indices.exists.json new file mode 100644 index 0000000000..8847793949 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/indices.exists.json @@ -0,0 +1,64 @@ +{ + "indices.exists":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/exists/", + "description":"Returns information about whether a particular index exists." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/{index}", + "methods":[ + "HEAD" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names" + } + } + } + ] + }, + "params":{ + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Ignore unavailable indexes (default: false)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Ignore if a wildcard expression resolves to no concrete indices (default: false)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether wildcard expressions should get expanded to open or closed indices (default: open)" + }, + "flat_settings":{ + "type":"boolean", + "description":"Return settings in flat format (default: false)" + }, + "include_defaults":{ + "type":"boolean", + "description":"Whether to return all default setting for each of the indices.", + "default":false + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.exists_alias.json b/src/ApiGenerator/RestSpecification/Core/indices.exists_alias.json new file mode 100644 index 0000000000..6782ae4422 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/indices.exists_alias.json @@ -0,0 +1,71 @@ +{ + "indices.exists_alias":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/alias/", + "description":"Returns information about whether a particular alias exists." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_alias/{name}", + "methods":[ + "HEAD" + ], + "parts":{ + "name":{ + "type":"list", + "description":"A comma-separated list of alias names to return" + } + } + }, + { + "path":"/{index}/_alias/{name}", + "methods":[ + "HEAD" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to filter aliases" + }, + "name":{ + "type":"list", + "description":"A comma-separated list of alias names to return" + } + } + } + ] + }, + "params":{ + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "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)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"all", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.exists_index_template.json b/src/ApiGenerator/RestSpecification/Core/indices.exists_index_template.json new file mode 100644 index 0000000000..762477a23f --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/indices.exists_index_template.json @@ -0,0 +1,47 @@ +{ + "indices.exists_index_template":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/", + "description":"Returns information about whether a particular index template exists." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_index_template/{name}", + "methods":[ + "HEAD" + ], + "parts":{ + "name":{ + "type":"string", + "description":"The name of the template" + } + } + } + ] + }, + "params":{ + "flat_settings":{ + "type":"boolean", + "description":"Return settings in flat format (default: false)" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.exists_template.json b/src/ApiGenerator/RestSpecification/Core/indices.exists_template.json new file mode 100644 index 0000000000..d04305300c --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/indices.exists_template.json @@ -0,0 +1,47 @@ +{ + "indices.exists_template":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/", + "description":"Returns information about whether a particular index template exists." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_template/{name}", + "methods":[ + "HEAD" + ], + "parts":{ + "name":{ + "type":"list", + "description":"The comma separated names of the index templates" + } + } + } + ] + }, + "params":{ + "flat_settings":{ + "type":"boolean", + "description":"Return settings in flat format (default: false)" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.exists_type.json b/src/ApiGenerator/RestSpecification/Core/indices.exists_type.json new file mode 100644 index 0000000000..c1d763c453 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/indices.exists_type.json @@ -0,0 +1,59 @@ +{ + "indices.exists_type":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/exists/", + "description":"Returns information about whether a particular document type exists." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/{index}/_mapping/{type}", + "methods":[ + "HEAD" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names; use `_all` to check the types across all indices" + }, + "type":{ + "type":"list", + "description":"A comma-separated list of document types to check" + } + } + } + ] + }, + "params":{ + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "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)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.flush.json b/src/ApiGenerator/RestSpecification/Core/indices.flush.json new file mode 100644 index 0000000000..ce8053844c --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/indices.flush.json @@ -0,0 +1,67 @@ +{ + "indices.flush":{ + "documentation":{ + "url":"", + "description":"Performs the flush operation on one or more indices." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_flush", + "methods":[ + "POST", + "GET" + ] + }, + { + "path":"/{index}/_flush", + "methods":[ + "POST", + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names; use `_all` or empty string for all indices" + } + } + } + ] + }, + "params":{ + "force":{ + "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)" + }, + "wait_if_ongoing":{ + "type":"boolean", + "description":"If set to true the flush operation will block until the flush can be executed if another flush operation is already executing. The default is true. If set to false the flush will be skipped iff if another flush operation is already running." + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "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)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.forcemerge.json b/src/ApiGenerator/RestSpecification/Core/indices.forcemerge.json new file mode 100644 index 0000000000..893b0bb2e3 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/indices.forcemerge.json @@ -0,0 +1,69 @@ +{ + "indices.forcemerge":{ + "documentation":{ + "url":"", + "description":"Performs the force merge operation on one or more indices." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_forcemerge", + "methods":[ + "POST" + ] + }, + { + "path":"/{index}/_forcemerge", + "methods":[ + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" + } + } + } + ] + }, + "params":{ + "flush":{ + "type":"boolean", + "description":"Specify whether the index should be flushed after performing the operation (default: true)" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "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)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "max_num_segments":{ + "type":"number", + "description":"The number of segments the index should be merged into (default: dynamic)" + }, + "only_expunge_deletes":{ + "type":"boolean", + "description":"Specify whether the operation should only expunge deleted documents" + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.get.json b/src/ApiGenerator/RestSpecification/Core/indices.get.json new file mode 100644 index 0000000000..ad98d5b660 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/indices.get.json @@ -0,0 +1,76 @@ +{ + "indices.get":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/get-index/", + "description":"Returns information about one or more indices." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/{index}", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names" + } + } + } + ] + }, + "params":{ + "include_type_name":{ + "type":"boolean", + "description":"Whether to add the type name to the response (default: false)" + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Ignore unavailable indexes (default: false)" + }, + "allow_no_indices":{ + "type":"boolean", + "description":"Ignore if a wildcard expression resolves to no concrete indices (default: false)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether wildcard expressions should get expanded to open or closed indices (default: open)" + }, + "flat_settings":{ + "type":"boolean", + "description":"Return settings in flat format (default: false)" + }, + "include_defaults":{ + "type":"boolean", + "description":"Whether to return all default setting for each of the indices.", + "default":false + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.get_alias.json b/src/ApiGenerator/RestSpecification/Core/indices.get_alias.json new file mode 100644 index 0000000000..502e22265f --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/indices.get_alias.json @@ -0,0 +1,89 @@ +{ + "indices.get_alias":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/alias/", + "description":"Returns an alias." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_alias", + "methods":[ + "GET" + ] + }, + { + "path":"/_alias/{name}", + "methods":[ + "GET" + ], + "parts":{ + "name":{ + "type":"list", + "description":"A comma-separated list of alias names to return" + } + } + }, + { + "path":"/{index}/_alias/{name}", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to filter aliases" + }, + "name":{ + "type":"list", + "description":"A comma-separated list of alias names to return" + } + } + }, + { + "path":"/{index}/_alias", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to filter aliases" + } + } + } + ] + }, + "params":{ + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "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)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default": "all", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.get_field_mapping.json b/src/ApiGenerator/RestSpecification/Core/indices.get_field_mapping.json new file mode 100644 index 0000000000..42983da2b8 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/indices.get_field_mapping.json @@ -0,0 +1,79 @@ +{ + "indices.get_field_mapping":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/update-mapping/", + "description":"Returns mapping for one or more fields." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_mapping/field/{fields}", + "methods":[ + "GET" + ], + "parts":{ + "fields":{ + "type":"list", + "description":"A comma-separated list of fields" + } + } + }, + { + "path":"/{index}/_mapping/field/{fields}", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names" + }, + "fields":{ + "type":"list", + "description":"A comma-separated list of fields" + } + } + } + ] + }, + "params":{ + "include_type_name":{ + "type":"boolean", + "description":"Whether a type should be returned in the body of the mappings." + }, + "include_defaults":{ + "type":"boolean", + "description":"Whether the default mapping values should be returned as well" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "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)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.get_index_template.json b/src/ApiGenerator/RestSpecification/Core/indices.get_index_template.json new file mode 100644 index 0000000000..a8392a1d8a --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/indices.get_index_template.json @@ -0,0 +1,53 @@ +{ + "indices.get_index_template":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/", + "description":"Returns an index template." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_index_template", + "methods":[ + "GET" + ] + }, + { + "path":"/_index_template/{name}", + "methods":[ + "GET" + ], + "parts":{ + "name":{ + "type":"list", + "description":"The comma separated names of the index templates" + } + } + } + ] + }, + "params":{ + "flat_settings":{ + "type":"boolean", + "description":"Return settings in flat format (default: false)" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.get_mapping.json b/src/ApiGenerator/RestSpecification/Core/indices.get_mapping.json new file mode 100644 index 0000000000..7e29e1d29d --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/indices.get_mapping.json @@ -0,0 +1,69 @@ +{ + "indices.get_mapping":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/update-mapping/", + "description":"Returns mappings for one or more indices." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_mapping", + "methods":[ + "GET" + ] + }, + { + "path":"/{index}/_mapping", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names" + } + } + } + ] + }, + "params":{ + "include_type_name":{ + "type":"boolean", + "description":"Whether to add the type name to the response (default: false)" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "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)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.get_settings.json b/src/ApiGenerator/RestSpecification/Core/indices.get_settings.json new file mode 100644 index 0000000000..39fb4847f3 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/indices.get_settings.json @@ -0,0 +1,106 @@ +{ + "indices.get_settings":{ + "documentation":{ + "url":"", + "description":"Returns settings for one or more indices." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_settings", + "methods":[ + "GET" + ] + }, + { + "path":"/{index}/_settings", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" + } + } + }, + { + "path":"/{index}/_settings/{name}", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" + }, + "name":{ + "type":"list", + "description":"The name of the settings that should be included" + } + } + }, + { + "path":"/_settings/{name}", + "methods":[ + "GET" + ], + "parts":{ + "name":{ + "type":"list", + "description":"The name of the settings that should be included" + } + } + } + ] + }, + "params":{ + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "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)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default": "all", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "flat_settings":{ + "type":"boolean", + "description":"Return settings in flat format (default: false)" + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + }, + "include_defaults":{ + "type":"boolean", + "description":"Whether to return all default setting for each of the indices.", + "default":false + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.get_template.json b/src/ApiGenerator/RestSpecification/Core/indices.get_template.json new file mode 100644 index 0000000000..66cb7a73ff --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/indices.get_template.json @@ -0,0 +1,57 @@ +{ + "indices.get_template":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/", + "description":"Returns an index template." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_template", + "methods":[ + "GET" + ] + }, + { + "path":"/_template/{name}", + "methods":[ + "GET" + ], + "parts":{ + "name":{ + "type":"list", + "description":"The comma separated names of the index templates" + } + } + } + ] + }, + "params":{ + "include_type_name":{ + "type":"boolean", + "description":"Whether a type should be returned in the body of the mappings." + }, + "flat_settings":{ + "type":"boolean", + "description":"Return settings in flat format (default: false)" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.open.json b/src/ApiGenerator/RestSpecification/Core/indices.open.json new file mode 100644 index 0000000000..3c094844af --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/indices.open.json @@ -0,0 +1,67 @@ +{ + "indices.open":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/close-index/", + "description":"Opens an index." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/{index}/_open", + "methods":[ + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma separated list of indices to open" + } + } + } + ] + }, + "params":{ + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "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)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"closed", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "wait_for_active_shards":{ + "type":"string", + "description":"Sets the number of active shards to wait for before the operation returns." + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.put_alias.json b/src/ApiGenerator/RestSpecification/Core/indices.put_alias.json new file mode 100644 index 0000000000..c45f0aa36f --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/indices.put_alias.json @@ -0,0 +1,70 @@ +{ + "indices.put_alias":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/alias/", + "description":"Creates or updates an alias." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"], + "content_type": ["application/json"] + }, + "url":{ + "paths":[ + { + "path":"/{index}/_alias/{name}", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the operation on all indices." + }, + "name":{ + "type":"string", + "description":"The name of the alias to be created or updated" + } + } + }, + { + "path":"/{index}/_aliases/{name}", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the operation on all indices." + }, + "name":{ + "type":"string", + "description":"The name of the alias to be created or updated" + } + } + } + ] + }, + "params":{ + "timeout":{ + "type":"time", + "description":"Explicit timestamp for the document" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + } + }, + "body":{ + "description":"The settings for the alias, such as `routing` or `filter`", + "required":false + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.put_index_template.json b/src/ApiGenerator/RestSpecification/Core/indices.put_index_template.json new file mode 100644 index 0000000000..4963df1614 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/indices.put_index_template.json @@ -0,0 +1,55 @@ +{ + "indices.put_index_template":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/", + "description":"Creates or updates an index template." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"], + "content_type": ["application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_index_template/{name}", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "name":{ + "type":"string", + "description":"The name of the template" + } + } + } + ] + }, + "params":{ + "create":{ + "type":"boolean", + "description":"Whether the index template should only be added if new or can also replace an existing one", + "default":false + }, + "cause":{ + "type":"string", + "description":"User defined reason for creating/updating the index template", + "default":false + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + } + }, + "body":{ + "description":"The template definition", + "required":true + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.put_mapping.json b/src/ApiGenerator/RestSpecification/Core/indices.put_mapping.json new file mode 100644 index 0000000000..7bc6e47cd4 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/indices.put_mapping.json @@ -0,0 +1,95 @@ +{ + "indices.put_mapping":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/update-mapping/", + "description":"Updates the index mappings." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"], + "content_type": ["application/json"] + }, + "url":{ + "paths":[ + { + "path":"/{index}/_mapping", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices." + } + } + }, + { + "path":"/{index}/_mappings", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices." + } + }, + "deprecated":{ + "version":"1.0.0", + "description":"The plural mappings is accepted but only /_mapping is documented" + } + } + ] + }, + "params":{ + "include_type_name":{ + "type":"boolean", + "description":"Whether a type should be expected in the body of the mappings." + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "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)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "write_index_only":{ + "type":"boolean", + "default":false, + "description":"When true, applies mappings only to the write index of an alias or data stream" + } + }, + "body":{ + "description":"The mapping definition", + "required":true + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.put_settings.json b/src/ApiGenerator/RestSpecification/Core/indices.put_settings.json new file mode 100644 index 0000000000..09be5ce207 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/indices.put_settings.json @@ -0,0 +1,82 @@ +{ + "indices.put_settings":{ + "documentation":{ + "url":"", + "description":"Updates the index settings." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"], + "content_type": ["application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_settings", + "methods":[ + "PUT" + ] + }, + { + "path":"/{index}/_settings", + "methods":[ + "PUT" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" + } + } + } + ] + }, + "params":{ + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "preserve_existing":{ + "type":"boolean", + "description":"Whether to update existing settings. If set to `true` existing settings on an index remain unchanged, the default is `false`" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "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)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "flat_settings":{ + "type":"boolean", + "description":"Return settings in flat format (default: false)" + } + }, + "body":{ + "description":"The index settings to be updated", + "required":true + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.put_template.json b/src/ApiGenerator/RestSpecification/Core/indices.put_template.json new file mode 100644 index 0000000000..50d0034a75 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/indices.put_template.json @@ -0,0 +1,58 @@ +{ + "indices.put_template":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/", + "description":"Creates or updates an index template." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"], + "content_type": ["application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_template/{name}", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "name":{ + "type":"string", + "description":"The name of the template" + } + } + } + ] + }, + "params":{ + "include_type_name":{ + "type":"boolean", + "description":"Whether a type should be returned in the body of the mappings." + }, + "order":{ + "type":"number", + "description":"The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers)" + }, + "create":{ + "type":"boolean", + "description":"Whether the index template should only be added if new or can also replace an existing one", + "default":false + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + } + }, + "body":{ + "description":"The template definition", + "required":true + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.recovery.json b/src/ApiGenerator/RestSpecification/Core/indices.recovery.json new file mode 100644 index 0000000000..24d96f2e1d --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/indices.recovery.json @@ -0,0 +1,47 @@ +{ + "indices.recovery":{ + "documentation":{ + "url":"", + "description":"Returns information about ongoing index shard recoveries." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_recovery", + "methods":[ + "GET" + ] + }, + { + "path":"/{index}/_recovery", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" + } + } + } + ] + }, + "params":{ + "detailed":{ + "type":"boolean", + "description":"Whether to display detailed information about shard recovery", + "default":false + }, + "active_only":{ + "type":"boolean", + "description":"Display only those recoveries that are currently on-going", + "default":false + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.refresh.json b/src/ApiGenerator/RestSpecification/Core/indices.refresh.json new file mode 100644 index 0000000000..10d63e8eaa --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/indices.refresh.json @@ -0,0 +1,59 @@ +{ + "indices.refresh":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/", + "description":"Performs the refresh operation in one or more indices." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_refresh", + "methods":[ + "POST", + "GET" + ] + }, + { + "path":"/{index}/_refresh", + "methods":[ + "POST", + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" + } + } + } + ] + }, + "params":{ + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "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)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.resolve_index.json b/src/ApiGenerator/RestSpecification/Core/indices.resolve_index.json new file mode 100644 index 0000000000..21264ead72 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/indices.resolve_index.json @@ -0,0 +1,43 @@ +{ + "indices.resolve_index":{ + "documentation":{ + "url":"", + "description":"Returns information about any matching indices, aliases, and data streams" + }, + "stability":"experimental", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_resolve/index/{name}", + "methods":[ + "GET" + ], + "parts":{ + "name":{ + "type":"list", + "description":"A comma-separated list of names or wildcard expressions" + } + } + } + ] + }, + "params":{ + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether wildcard expressions should get expanded to open or closed indices (default: open)" + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.rollover.json b/src/ApiGenerator/RestSpecification/Core/indices.rollover.json new file mode 100644 index 0000000000..9d43a18fd6 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/indices.rollover.json @@ -0,0 +1,75 @@ +{ + "indices.rollover":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/data-streams/#step-5-rollover-a-data-stream", + "description":"Updates an alias to point to a new index when the existing index\nis considered to be too large or too old." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"], + "content_type": ["application/json"] + }, + "url":{ + "paths":[ + { + "path":"/{alias}/_rollover", + "methods":[ + "POST" + ], + "parts":{ + "alias":{ + "type":"string", + "description":"The name of the alias to rollover" + } + } + }, + { + "path":"/{alias}/_rollover/{new_index}", + "methods":[ + "POST" + ], + "parts":{ + "alias":{ + "type":"string", + "description":"The name of the alias to rollover" + }, + "new_index":{ + "type":"string", + "description":"The name of the rollover index" + } + } + } + ] + }, + "params":{ + "include_type_name":{ + "type":"boolean", + "description":"Whether a type should be included in the body of the mappings." + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "dry_run":{ + "type":"boolean", + "description":"If set to true the rollover action will only be validated but not actually performed even if a condition matches. The default is false" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + }, + "wait_for_active_shards":{ + "type":"string", + "description":"Set the number of active shards to wait for on the newly created rollover index before the operation returns." + } + }, + "body":{ + "description":"The conditions that needs to be met for executing rollover" + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.segments.json b/src/ApiGenerator/RestSpecification/Core/indices.segments.json new file mode 100644 index 0000000000..fe44a81bfd --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/indices.segments.json @@ -0,0 +1,62 @@ +{ + "indices.segments":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-segments/", + "description":"Provides low-level information about segments in a Lucene index." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_segments", + "methods":[ + "GET" + ] + }, + { + "path":"/{index}/_segments", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" + } + } + } + ] + }, + "params":{ + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "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)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "verbose":{ + "type":"boolean", + "description":"Includes detailed memory usage by Lucene.", + "default":false + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.shard_stores.json b/src/ApiGenerator/RestSpecification/Core/indices.shard_stores.json new file mode 100644 index 0000000000..c241aeab89 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/indices.shard_stores.json @@ -0,0 +1,67 @@ +{ + "indices.shard_stores":{ + "documentation":{ + "url":"", + "description":"Provides store information for shard copies of indices." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_shard_stores", + "methods":[ + "GET" + ] + }, + { + "path":"/{index}/_shard_stores", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" + } + } + } + ] + }, + "params":{ + "status":{ + "type":"list", + "options":[ + "green", + "yellow", + "red", + "all" + ], + "description":"A comma-separated list of statuses used to filter on shards to get store information for" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "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)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.shrink.json b/src/ApiGenerator/RestSpecification/Core/indices.shrink.json new file mode 100644 index 0000000000..16a781df6a --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/indices.shrink.json @@ -0,0 +1,60 @@ +{ + "indices.shrink":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/shrink-index/", + "description":"Allow to shrink an existing index into a new index with fewer primary shards." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"], + "content_type": ["application/json"] + }, + "url":{ + "paths":[ + { + "path":"/{index}/_shrink/{target}", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "index":{ + "type":"string", + "description":"The name of the source index to shrink" + }, + "target":{ + "type":"string", + "description":"The name of the target index to shrink into" + } + } + } + ] + }, + "params":{ + "copy_settings": { + "type" : "boolean", + "description" : "whether or not to copy settings from the source index (defaults to false)" + }, + "timeout": { + "type" : "time", + "description" : "Explicit operation timeout" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + }, + "wait_for_active_shards": { + "type" : "string", + "description" : "Set the number of active shards to wait for on the shrunken index before the operation returns." + } + }, + "body":{ + "description":"The configuration for the target index (`settings` and `aliases`)" + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.simulate_index_template.json b/src/ApiGenerator/RestSpecification/Core/indices.simulate_index_template.json new file mode 100644 index 0000000000..295a457442 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/indices.simulate_index_template.json @@ -0,0 +1,54 @@ +{ + "indices.simulate_index_template":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/", + "description": "Simulate matching the given index name against the index templates in the system" + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"], + "content_type": ["application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_index_template/_simulate_index/{name}", + "methods":[ + "POST" + ], + "parts":{ + "name":{ + "type":"string", + "description":"The name of the index (it must be a concrete index name)" + } + } + } + ] + }, + "params":{ + "create":{ + "type":"boolean", + "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", + "default":false + }, + "cause":{ + "type":"string", + "description":"User defined reason for dry-run creating the new template for simulation purposes", + "default":false + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + } + }, + "body":{ + "description":"New index template definition, which will be included in the simulation, as if it already exists in the system", + "required":false + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.simulate_template.json b/src/ApiGenerator/RestSpecification/Core/indices.simulate_template.json new file mode 100644 index 0000000000..a6a8a23dd7 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/indices.simulate_template.json @@ -0,0 +1,60 @@ +{ + "indices.simulate_template":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/", + "description": "Simulate resolving the given template name or body" + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"], + "content_type": ["application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_index_template/_simulate", + "methods":[ + "POST" + ] + }, + { + "path":"/_index_template/_simulate/{name}", + "methods":[ + "POST" + ], + "parts":{ + "name":{ + "type":"string", + "description":"The name of the index template" + } + } + } + ] + }, + "params":{ + "create":{ + "type":"boolean", + "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", + "default":false + }, + "cause":{ + "type":"string", + "description":"User defined reason for dry-run creating the new template for simulation purposes", + "default":false + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + } + }, + "body":{ + "description":"New index template definition to be simulated, if no index template name is specified", + "required":false + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.split.json b/src/ApiGenerator/RestSpecification/Core/indices.split.json new file mode 100644 index 0000000000..cc56dff46c --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/indices.split.json @@ -0,0 +1,60 @@ +{ + "indices.split":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/split/", + "description":"Allows you to split an existing index into a new index with more primary shards." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"], + "content_type": ["application/json"] + }, + "url":{ + "paths":[ + { + "path":"/{index}/_split/{target}", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "index":{ + "type":"string", + "description":"The name of the source index to split" + }, + "target":{ + "type":"string", + "description":"The name of the target index to split into" + } + } + } + ] + }, + "params": { + "copy_settings": { + "type" : "boolean", + "description" : "whether or not to copy settings from the source index (defaults to false)" + }, + "timeout": { + "type" : "time", + "description" : "Explicit operation timeout" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + }, + "wait_for_active_shards": { + "type" : "string", + "description" : "Set the number of active shards to wait for on the shrunken index before the operation returns." + } + }, + "body":{ + "description":"The configuration for the target index (`settings` and `aliases`)" + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.stats.json b/src/ApiGenerator/RestSpecification/Core/indices.stats.json new file mode 100644 index 0000000000..ac0221cafd --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/indices.stats.json @@ -0,0 +1,158 @@ +{ + "indices.stats":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/stats-api/", + "description":"Provides statistics on operations happening in an index." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_stats", + "methods":[ + "GET" + ] + }, + { + "path":"/_stats/{metric}", + "methods":[ + "GET" + ], + "parts":{ + "metric":{ + "type":"list", + "options":[ + "_all", + "completion", + "docs", + "fielddata", + "query_cache", + "flush", + "get", + "indexing", + "merge", + "request_cache", + "refresh", + "search", + "segments", + "store", + "warmer", + "suggest" + ], + "description":"Limit the information returned the specific metrics." + } + } + }, + { + "path":"/{index}/_stats", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" + } + } + }, + { + "path":"/{index}/_stats/{metric}", + "methods":[ + "GET" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" + }, + "metric":{ + "type":"list", + "options":[ + "_all", + "completion", + "docs", + "fielddata", + "query_cache", + "flush", + "get", + "indexing", + "merge", + "request_cache", + "refresh", + "search", + "segments", + "store", + "warmer", + "suggest" + ], + "description":"Limit the information returned the specific metrics." + } + } + } + ] + }, + "params":{ + "completion_fields":{ + "type":"list", + "description":"A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards)" + }, + "fielddata_fields":{ + "type":"list", + "description":"A comma-separated list of fields for `fielddata` index metric (supports wildcards)" + }, + "fields":{ + "type":"list", + "description":"A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards)" + }, + "groups":{ + "type":"list", + "description":"A comma-separated list of search groups for `search` index metric" + }, + "level":{ + "type":"enum", + "description":"Return stats aggregated at cluster, index or shard level", + "options":[ + "cluster", + "indices", + "shards" + ], + "default":"indices" + }, + "types":{ + "type":"list", + "description":"A comma-separated list of document types for the `indexing` index metric" + }, + "include_segment_file_sizes":{ + "type":"boolean", + "description":"Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested)", + "default":false + }, + "include_unloaded_segments":{ + "type":"boolean", + "description":"If set to true segment stats will include stats for segments that are not currently loaded into memory", + "default":false + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "forbid_closed_indices":{ + "type":"boolean", + "description":"If set to false stats will also collected from closed indices if explicitly specified or if expand_wildcards expands to closed indices", + "default":true + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.update_aliases.json b/src/ApiGenerator/RestSpecification/Core/indices.update_aliases.json new file mode 100644 index 0000000000..7ef9f4a9e3 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/indices.update_aliases.json @@ -0,0 +1,42 @@ +{ + "indices.update_aliases":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/alias/", + "description":"Updates index aliases." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"], + "content_type": ["application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_aliases", + "methods":[ + "POST" + ] + } + ] + }, + "params":{ + "timeout":{ + "type":"time", + "description":"Request timeout" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + } + }, + "body":{ + "description":"The definition of `actions` to perform", + "required":true + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.validate_query.json b/src/ApiGenerator/RestSpecification/Core/indices.validate_query.json new file mode 100644 index 0000000000..4132f1a9eb --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/indices.validate_query.json @@ -0,0 +1,104 @@ +{ + "indices.validate_query":{ + "documentation":{ + "url":"", + "description":"Allows a user to validate a potentially expensive query without executing it." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"], + "content_type": ["application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_validate/query", + "methods":[ + "GET", + "POST" + ] + }, + { + "path":"/{index}/_validate/query", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices" + } + } + } + ] + }, + "params":{ + "explain":{ + "type":"boolean", + "description":"Return detailed information about the error" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "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)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "q":{ + "type":"string", + "description":"Query in the Lucene query string syntax" + }, + "analyzer":{ + "type":"string", + "description":"The analyzer to use for the query string" + }, + "analyze_wildcard":{ + "type":"boolean", + "description":"Specify whether wildcard and prefix queries should be analyzed (default: false)" + }, + "default_operator":{ + "type":"enum", + "options":[ + "AND", + "OR" + ], + "default":"OR", + "description":"The default operator for query string query (AND or OR)" + }, + "df":{ + "type":"string", + "description":"The field to use as default where no field prefix is given in the query string" + }, + "lenient":{ + "type":"boolean", + "description":"Specify whether format-based query failures (such as providing text to a numeric field) should be ignored" + }, + "rewrite":{ + "type":"boolean", + "description":"Provide a more detailed explanation showing the actual Lucene query that will be executed." + }, + "all_shards":{ + "type":"boolean", + "description":"Execute validation on all shards instead of one random shard per index" + } + }, + "body":{ + "description":"The query definition specified with the Query DSL" + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/info.json b/src/ApiGenerator/RestSpecification/Core/info.json new file mode 100644 index 0000000000..c07c5c760c --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/info.json @@ -0,0 +1,24 @@ +{ + "info":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/index/", + "description":"Returns basic information about the cluster." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/", + "methods":[ + "GET" + ] + } + ] + }, + "params":{} + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/ingest.delete_pipeline.json b/src/ApiGenerator/RestSpecification/Core/ingest.delete_pipeline.json new file mode 100644 index 0000000000..b67eb57c3f --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/ingest.delete_pipeline.json @@ -0,0 +1,43 @@ +{ + "ingest.delete_pipeline":{ + "documentation":{ + "url":"", + "description":"Deletes a pipeline." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_ingest/pipeline/{id}", + "methods":[ + "DELETE" + ], + "parts":{ + "id":{ + "type":"string", + "description":"Pipeline ID" + } + } + } + ] + }, + "params":{ + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/ingest.get_pipeline.json b/src/ApiGenerator/RestSpecification/Core/ingest.get_pipeline.json new file mode 100644 index 0000000000..0c1d15854b --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/ingest.get_pipeline.json @@ -0,0 +1,45 @@ +{ + "ingest.get_pipeline":{ + "documentation":{ + "url":"", + "description":"Returns a pipeline." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_ingest/pipeline", + "methods":[ + "GET" + ] + }, + { + "path":"/_ingest/pipeline/{id}", + "methods":[ + "GET" + ], + "parts":{ + "id":{ + "type":"string", + "description":"Comma separated list of pipeline ids. Wildcards supported" + } + } + } + ] + }, + "params":{ + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/ingest.processor_grok.json b/src/ApiGenerator/RestSpecification/Core/ingest.processor_grok.json new file mode 100644 index 0000000000..8449ea41b9 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/ingest.processor_grok.json @@ -0,0 +1,24 @@ +{ + "ingest.processor_grok":{ + "documentation":{ + "url":"", + "description":"Returns a list of the built-in patterns." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_ingest/processor/grok", + "methods":[ + "GET" + ] + } + ] + }, + "params":{} + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/ingest.put_pipeline.json b/src/ApiGenerator/RestSpecification/Core/ingest.put_pipeline.json new file mode 100644 index 0000000000..c01fb37d24 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/ingest.put_pipeline.json @@ -0,0 +1,48 @@ +{ + "ingest.put_pipeline":{ + "documentation":{ + "url":"", + "description":"Creates or updates a pipeline." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"], + "content_type": ["application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_ingest/pipeline/{id}", + "methods":[ + "PUT" + ], + "parts":{ + "id":{ + "type":"string", + "description":"Pipeline ID" + } + } + } + ] + }, + "params":{ + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + } + }, + "body":{ + "description":"The ingest definition", + "required":true + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/ingest.simulate.json b/src/ApiGenerator/RestSpecification/Core/ingest.simulate.json new file mode 100644 index 0000000000..538931232e --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/ingest.simulate.json @@ -0,0 +1,49 @@ +{ + "ingest.simulate":{ + "documentation":{ + "url":"", + "description":"Allows to simulate a pipeline with example documents." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"], + "content_type": ["application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_ingest/pipeline/_simulate", + "methods":[ + "GET", + "POST" + ] + }, + { + "path":"/_ingest/pipeline/{id}/_simulate", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "id":{ + "type":"string", + "description":"Pipeline ID" + } + } + } + ] + }, + "params":{ + "verbose":{ + "type":"boolean", + "description":"Verbose mode. Display data output for each processor in executed pipeline", + "default":false + } + }, + "body":{ + "description":"The simulate definition", + "required":true + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/mget.json b/src/ApiGenerator/RestSpecification/Core/mget.json new file mode 100644 index 0000000000..31261b97ba --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/mget.json @@ -0,0 +1,76 @@ +{ + "mget":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/multi-get/", + "description":"Allows to get multiple documents in one request." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"], + "content_type": ["application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_mget", + "methods":[ + "GET", + "POST" + ] + }, + { + "path":"/{index}/_mget", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "index":{ + "type":"string", + "description":"The name of the index" + } + } + } + ] + }, + "params":{ + "stored_fields":{ + "type":"list", + "description":"A comma-separated list of stored fields to return in the response" + }, + "preference":{ + "type":"string", + "description":"Specify the node or shard the operation should be performed on (default: random)" + }, + "realtime":{ + "type":"boolean", + "description":"Specify whether to perform the operation in realtime or search mode" + }, + "refresh":{ + "type":"boolean", + "description":"Refresh the shard containing the document before performing the operation" + }, + "routing":{ + "type":"string", + "description":"Specific routing value" + }, + "_source":{ + "type":"list", + "description":"True or false to return the _source field or not, or a list of fields to return" + }, + "_source_excludes":{ + "type":"list", + "description":"A list of fields to exclude from the returned _source field" + }, + "_source_includes":{ + "type":"list", + "description":"A list of fields to extract and return from the _source field" + } + }, + "body":{ + "description":"Document identifiers; can be either `docs` (containing full document information) or `ids` (when index and type is provided in the URL.", + "required":true + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/msearch.json b/src/ApiGenerator/RestSpecification/Core/msearch.json new file mode 100644 index 0000000000..706e1ba9a4 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/msearch.json @@ -0,0 +1,82 @@ +{ + "msearch":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/multi-search/", + "description":"Allows to execute several search operations in one request." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"], + "content_type": ["application/x-ndjson"] + }, + "url":{ + "paths":[ + { + "path":"/_msearch", + "methods":[ + "GET", + "POST" + ] + }, + { + "path":"/{index}/_msearch", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to use as default" + } + } + } + ] + }, + "params": { + "search_type":{ + "type":"enum", + "options":[ + "query_then_fetch", + "query_and_fetch", + "dfs_query_then_fetch", + "dfs_query_and_fetch" + ], + "description":"Search operation type" + }, + "max_concurrent_searches" : { + "type" : "number", + "description" : "Controls the maximum number of concurrent searches the multi search api will execute" + }, + "typed_keys": { + "type" : "boolean", + "description" : "Specify whether aggregation and suggester names should be prefixed by their respective types in the response" + }, + "pre_filter_shard_size":{ + "type":"number", + "description" : "A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint." + }, + "max_concurrent_shard_requests" : { + "type" : "number", + "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", + "default" : 5 + }, + "rest_total_hits_as_int" : { + "type": "boolean", + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response", + "default": false + }, + "ccs_minimize_roundtrips":{ + "type":"boolean", + "description":"Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution", + "default":"true" + } + }, + "body":{ + "description":"The request definitions (metadata-search request definition pairs), separated by newlines", + "required":true, + "serialize":"bulk" + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/msearch_template.json b/src/ApiGenerator/RestSpecification/Core/msearch_template.json new file mode 100644 index 0000000000..39a2b2985b --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/msearch_template.json @@ -0,0 +1,73 @@ +{ + "msearch_template":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/multi-search/", + "description":"Allows to execute several search template operations in one request." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"], + "content_type": ["application/x-ndjson"] + }, + "url":{ + "paths":[ + { + "path":"/_msearch/template", + "methods":[ + "GET", + "POST" + ] + }, + { + "path":"/{index}/_msearch/template", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to use as default" + } + } + } + ] + }, + "params": { + "search_type":{ + "type":"enum", + "options":[ + "query_then_fetch", + "query_and_fetch", + "dfs_query_then_fetch", + "dfs_query_and_fetch" + ], + "description":"Search operation type" + }, + "typed_keys": { + "type" : "boolean", + "description" : "Specify whether aggregation and suggester names should be prefixed by their respective types in the response" + }, + "max_concurrent_searches" : { + "type" : "number", + "description" : "Controls the maximum number of concurrent searches the multi search api will execute" + }, + "rest_total_hits_as_int" : { + "type" : "boolean", + "description" : "Indicates whether hits.total should be rendered as an integer or an object in the rest search response", + "default" : false + }, + "ccs_minimize_roundtrips": { + "type" : "boolean", + "description" : "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution", + "default" : "true" + } + }, + "body":{ + "description":"The request definitions (metadata-search request definition pairs), separated by newlines", + "required":true, + "serialize":"bulk" + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/mtermvectors.json b/src/ApiGenerator/RestSpecification/Core/mtermvectors.json new file mode 100644 index 0000000000..156a410e21 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/mtermvectors.json @@ -0,0 +1,103 @@ +{ + "mtermvectors":{ + "documentation":{ + "url":"", + "description":"Returns multiple termvectors in one request." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"], + "content_type": ["application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_mtermvectors", + "methods":[ + "GET", + "POST" + ] + }, + { + "path":"/{index}/_mtermvectors", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "index":{ + "type":"string", + "description":"The index in which the document resides." + } + } + } + ] + }, + "params":{ + "ids":{ + "type":"list", + "description":"A comma-separated list of documents ids. You must define ids as parameter or set \"ids\" or \"docs\" in the request body" + }, + "term_statistics":{ + "type":"boolean", + "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\".", + "default":false + }, + "field_statistics":{ + "type":"boolean", + "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\".", + "default":true + }, + "fields":{ + "type":"list", + "description":"A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\"." + }, + "offsets":{ + "type":"boolean", + "description":"Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\".", + "default":true + }, + "positions":{ + "type":"boolean", + "description":"Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\".", + "default":true + }, + "payloads":{ + "type":"boolean", + "description":"Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\".", + "default":true + }, + "preference":{ + "type":"string", + "description":"Specify the node or shard the operation should be performed on (default: random) .Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\"." + }, + "routing":{ + "type":"string", + "description":"Specific routing value. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\"." + }, + "realtime":{ + "type":"boolean", + "description":"Specifies if requests are real-time as opposed to near-real-time (default: true)." + }, + "version":{ + "type":"number", + "description":"Explicit version number for concurrency control" + }, + "version_type":{ + "type":"enum", + "options":[ + "internal", + "external", + "external_gte", + "force" + ], + "description":"Specific version type" + } + }, + "body":{ + "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.", + "required":false + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/nodes.hot_threads.json b/src/ApiGenerator/RestSpecification/Core/nodes.hot_threads.json new file mode 100644 index 0000000000..c31e997965 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/nodes.hot_threads.json @@ -0,0 +1,147 @@ +{ + "nodes.hot_threads":{ + "documentation":{ + "url":"", + "description":"Returns information about hot threads on each node in the cluster." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "text/plain"] + }, + "url":{ + "paths":[ + { + "path":"/_nodes/hot_threads", + "methods":[ + "GET" + ] + }, + { + "path":"/_nodes/{node_id}/hot_threads", + "methods":[ + "GET" + ], + "parts":{ + "node_id":{ + "type":"list", + "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" + } + } + }, + { + "path":"/_cluster/nodes/hotthreads", + "methods":[ + "GET" + ], + "parts":{}, + "deprecated":{ + "version":"1.0.0", + "description":"The hot threads API accepts `hotthreads` but only `hot_threads` is documented" + } + }, + { + "path":"/_cluster/nodes/{node_id}/hotthreads", + "methods":[ + "GET" + ], + "parts":{ + "node_id":{ + "type":"list", + "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" + } + }, + "deprecated":{ + "version":"1.0.0", + "description":"The hot threads API accepts `hotthreads` but only `hot_threads` is documented" + } + }, + { + "path":"/_nodes/hotthreads", + "methods":[ + "GET" + ], + "parts":{}, + "deprecated":{ + "version":"1.0.0", + "description":"The hot threads API accepts `hotthreads` but only `hot_threads` is documented" + } + }, + { + "path":"/_nodes/{node_id}/hotthreads", + "methods":[ + "GET" + ], + "parts":{ + "node_id":{ + "type":"list", + "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" + } + }, + "deprecated":{ + "version":"1.0.0", + "description":"The hot threads API accepts `hotthreads` but only `hot_threads` is documented" + } + }, + { + "path":"/_cluster/nodes/hot_threads", + "methods":[ + "GET" + ], + "parts":{}, + "deprecated":{ + "version":"1.0.0", + "description":"The hot accepts /_cluster/nodes as prefix for backwards compatibility reasons" + } + }, + { + "path":"/_cluster/nodes/{node_id}/hot_threads", + "methods":[ + "GET" + ], + "parts":{ + "node_id":{ + "type":"list", + "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" + } + }, + "deprecated":{ + "version":"1.0.0", + "description":"The hot accepts /_cluster/nodes as prefix for backwards compatibility reasons" + } + } + ] + }, + "params":{ + "interval":{ + "type":"time", + "description":"The interval for the second sampling of threads" + }, + "snapshots":{ + "type":"number", + "description":"Number of samples of thread stacktrace (default: 10)" + }, + "threads":{ + "type":"number", + "description":"Specify the number of threads to provide information for (default: 3)" + }, + "ignore_idle_threads":{ + "type":"boolean", + "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 (default: true)" + }, + "type":{ + "type":"enum", + "options":[ + "cpu", + "wait", + "block" + ], + "description":"The type to sample (default: cpu)" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/nodes.info.json b/src/ApiGenerator/RestSpecification/Core/nodes.info.json new file mode 100644 index 0000000000..3333df769d --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/nodes.info.json @@ -0,0 +1,95 @@ +{ + "nodes.info":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-nodes/", + "description":"Returns information about nodes in the cluster." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_nodes", + "methods":[ + "GET" + ] + }, + { + "path":"/_nodes/{node_id}", + "methods":[ + "GET" + ], + "parts":{ + "node_id":{ + "type":"list", + "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" + } + } + }, + { + "path":"/_nodes/{metric}", + "methods":[ + "GET" + ], + "parts":{ + "metric":{ + "type":"list", + "options":[ + "settings", + "os", + "process", + "jvm", + "thread_pool", + "transport", + "http", + "plugins", + "ingest" + ], + "description":"A comma-separated list of metrics you wish returned. Leave empty to return all." + } + } + }, + { + "path":"/_nodes/{node_id}/{metric}", + "methods":[ + "GET" + ], + "parts":{ + "node_id":{ + "type":"list", + "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" + }, + "metric":{ + "type":"list", + "options":[ + "settings", + "os", + "process", + "jvm", + "thread_pool", + "transport", + "http", + "plugins", + "ingest" + ], + "description":"A comma-separated list of metrics you wish returned. Leave empty to return all." + } + } + } + ] + }, + "params":{ + "flat_settings":{ + "type":"boolean", + "description":"Return settings in flat format (default: false)" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/nodes.reload_secure_settings.json b/src/ApiGenerator/RestSpecification/Core/nodes.reload_secure_settings.json new file mode 100644 index 0000000000..4ca0f27cd9 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/nodes.reload_secure_settings.json @@ -0,0 +1,46 @@ +{ + "nodes.reload_secure_settings":{ + "documentation":{ + "url":"", + "description":"Reloads secure settings." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"], + "content_type": [ "application/json" ] + }, + "url":{ + "paths":[ + { + "path":"/_nodes/reload_secure_settings", + "methods":[ + "POST" + ] + }, + { + "path":"/_nodes/{node_id}/reload_secure_settings", + "methods":[ + "POST" + ], + "parts":{ + "node_id":{ + "type":"list", + "description":"A comma-separated list of node IDs to span the reload/reinit call. Should stay empty because reloading usually involves all cluster nodes." + } + } + } + ] + }, + "params": { + "timeout": { + "type": "time", + "description": "Explicit operation timeout" + } + }, + "body": { + "description": "An object containing the password for the opensearch keystore", + "required": false + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/nodes.stats.json b/src/ApiGenerator/RestSpecification/Core/nodes.stats.json new file mode 100644 index 0000000000..a6d2ad1442 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/nodes.stats.json @@ -0,0 +1,232 @@ +{ + "nodes.stats":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/stats-api/", + "description":"Returns statistical information about nodes in the cluster." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_nodes/stats", + "methods":[ + "GET" + ] + }, + { + "path":"/_nodes/{node_id}/stats", + "methods":[ + "GET" + ], + "parts":{ + "node_id":{ + "type":"list", + "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" + } + } + }, + { + "path":"/_nodes/stats/{metric}", + "methods":[ + "GET" + ], + "parts":{ + "metric":{ + "type":"list", + "options":[ + "_all", + "breaker", + "fs", + "http", + "indices", + "jvm", + "os", + "process", + "thread_pool", + "transport", + "discovery", + "indexing_pressure" + ], + "description":"Limit the information returned to the specified metrics" + } + } + }, + { + "path":"/_nodes/{node_id}/stats/{metric}", + "methods":[ + "GET" + ], + "parts":{ + "metric":{ + "type":"list", + "options":[ + "_all", + "breaker", + "fs", + "http", + "indices", + "jvm", + "os", + "process", + "thread_pool", + "transport", + "discovery", + "indexing_pressure" + ], + "description":"Limit the information returned to the specified metrics" + }, + "node_id":{ + "type":"list", + "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" + } + } + }, + { + "path":"/_nodes/stats/{metric}/{index_metric}", + "methods":[ + "GET" + ], + "parts":{ + "metric":{ + "type":"list", + "options":[ + "_all", + "breaker", + "fs", + "http", + "indices", + "jvm", + "os", + "process", + "thread_pool", + "transport", + "discovery", + "indexing_pressure" + ], + "description":"Limit the information returned to the specified metrics" + }, + "index_metric":{ + "type":"list", + "options":[ + "_all", + "completion", + "docs", + "fielddata", + "query_cache", + "flush", + "get", + "indexing", + "merge", + "request_cache", + "refresh", + "search", + "segments", + "store", + "warmer", + "suggest" + ], + "description":"Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified." + } + } + }, + { + "path":"/_nodes/{node_id}/stats/{metric}/{index_metric}", + "methods":[ + "GET" + ], + "parts":{ + "metric":{ + "type":"list", + "options":[ + "_all", + "breaker", + "fs", + "http", + "indices", + "jvm", + "os", + "process", + "thread_pool", + "transport", + "discovery", + "indexing_pressure" + ], + "description":"Limit the information returned to the specified metrics" + }, + "index_metric":{ + "type":"list", + "options":[ + "_all", + "completion", + "docs", + "fielddata", + "query_cache", + "flush", + "get", + "indexing", + "merge", + "request_cache", + "refresh", + "search", + "segments", + "store", + "warmer", + "suggest" + ], + "description":"Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified." + }, + "node_id":{ + "type":"list", + "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" + } + } + } + ] + }, + "params":{ + "completion_fields":{ + "type":"list", + "description":"A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards)" + }, + "fielddata_fields":{ + "type":"list", + "description":"A comma-separated list of fields for `fielddata` index metric (supports wildcards)" + }, + "fields":{ + "type":"list", + "description":"A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards)" + }, + "groups":{ + "type":"boolean", + "description":"A comma-separated list of search groups for `search` index metric" + }, + "level":{ + "type":"enum", + "description":"Return indices stats aggregated at index, node or shard level", + "options":[ + "indices", + "node", + "shards" + ], + "default":"node" + }, + "types":{ + "type":"list", + "description":"A comma-separated list of document types for the `indexing` index metric" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "include_segment_file_sizes":{ + "type":"boolean", + "description":"Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested)", + "default":false + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/nodes.usage.json b/src/ApiGenerator/RestSpecification/Core/nodes.usage.json new file mode 100644 index 0000000000..ce7c0d9137 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/nodes.usage.json @@ -0,0 +1,77 @@ +{ + "nodes.usage":{ + "documentation":{ + "url":"", + "description":"Returns low-level information about REST actions usage on nodes." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_nodes/usage", + "methods":[ + "GET" + ] + }, + { + "path":"/_nodes/{node_id}/usage", + "methods":[ + "GET" + ], + "parts":{ + "node_id":{ + "type":"list", + "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" + } + } + }, + { + "path":"/_nodes/usage/{metric}", + "methods":[ + "GET" + ], + "parts":{ + "metric":{ + "type":"list", + "options":[ + "_all", + "rest_actions" + ], + "description":"Limit the information returned to the specified metrics" + } + } + }, + { + "path":"/_nodes/{node_id}/usage/{metric}", + "methods":[ + "GET" + ], + "parts":{ + "metric":{ + "type":"list", + "options":[ + "_all", + "rest_actions" + ], + "description":"Limit the information returned to the specified metrics" + }, + "node_id":{ + "type":"list", + "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" + } + } + } + ] + }, + "params":{ + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/ping.json b/src/ApiGenerator/RestSpecification/Core/ping.json new file mode 100644 index 0000000000..87226096fd --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/ping.json @@ -0,0 +1,24 @@ +{ + "ping":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/index/", + "description":"Returns whether the cluster is running." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/", + "methods":[ + "HEAD" + ] + } + ] + }, + "params":{} + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/put_script.json b/src/ApiGenerator/RestSpecification/Core/put_script.json new file mode 100644 index 0000000000..de125549c8 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/put_script.json @@ -0,0 +1,70 @@ +{ + "put_script":{ + "documentation":{ + "url":"", + "description":"Creates or updates a script." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"], + "content_type": ["application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_scripts/{id}", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "id":{ + "type":"string", + "description":"Script ID" + } + } + }, + { + "path":"/_scripts/{id}/{context}", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "id":{ + "type":"string", + "description":"Script ID" + }, + "context":{ + "type":"string", + "description":"Script context" + } + } + } + ] + }, + "params":{ + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + }, + "context":{ + "type":"string", + "description":"Context name to compile script against" + } + }, + "body":{ + "description":"The document", + "required":true + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/rank_eval.json b/src/ApiGenerator/RestSpecification/Core/rank_eval.json new file mode 100644 index 0000000000..91bd3121aa --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/rank_eval.json @@ -0,0 +1,72 @@ +{ + "rank_eval":{ + "documentation":{ + "url":"", + "description":"Allows to evaluate the quality of ranked search results over a set of typical search queries" + }, + "stability":"experimental", + "visibility":"public", + "headers":{ + "accept": [ "application/json"], + "content_type": ["application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_rank_eval", + "methods":[ + "GET", + "POST" + ] + }, + { + "path":"/{index}/_rank_eval", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices" + } + } + } + ] + }, + "params":{ + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "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)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "search_type":{ + "type":"enum", + "options":[ + "query_then_fetch", + "dfs_query_then_fetch" + ], + "description":"Search operation type" + } + }, + "body":{ + "description":"The ranking evaluation search definition, including search requests, document ratings and ranking metric definition.", + "required":true + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/reindex.json b/src/ApiGenerator/RestSpecification/Core/reindex.json new file mode 100644 index 0000000000..8ed380265f --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/reindex.json @@ -0,0 +1,67 @@ +{ + "reindex":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/reindex/", + "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." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"], + "content_type": ["application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_reindex", + "methods":[ + "POST" + ] + } + ] + }, + "params":{ + "refresh":{ + "type":"boolean", + "description":"Should the affected indexes be refreshed?" + }, + "timeout":{ + "type":"time", + "default":"1m", + "description":"Time each individual bulk request should wait for shards that are unavailable." + }, + "wait_for_active_shards":{ + "type":"string", + "description":"Sets the number of shard copies that must be active before proceeding with the reindex operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)" + }, + "wait_for_completion":{ + "type":"boolean", + "default":true, + "description":"Should the request should block until the reindex is complete." + }, + "requests_per_second":{ + "type":"number", + "default":0, + "description":"The throttle to set on this request in sub-requests per second. -1 means no throttle." + }, + "scroll":{ + "type":"time", + "description":"Control how long to keep the search context alive", + "default":"5m" + }, + "slices":{ + "type":"number|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`." + }, + "max_docs":{ + "type":"number", + "description":"Maximum number of documents to process (default: all documents)" + } + }, + "body":{ + "description":"The search definition using the Query DSL and the prototype for the index request.", + "required":true + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/reindex_rethrottle.json b/src/ApiGenerator/RestSpecification/Core/reindex_rethrottle.json new file mode 100644 index 0000000000..548f02c1f8 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/reindex_rethrottle.json @@ -0,0 +1,36 @@ +{ + "reindex_rethrottle":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/reindex/", + "description":"Changes the number of requests per second for a particular Reindex operation." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_reindex/{task_id}/_rethrottle", + "methods":[ + "POST" + ], + "parts":{ + "task_id":{ + "type":"string", + "description":"The task id to rethrottle" + } + } + } + ] + }, + "params":{ + "requests_per_second":{ + "type":"number", + "required":true, + "description":"The throttle to set on this request in floating sub-requests per second. -1 means set no throttle." + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/render_search_template.json b/src/ApiGenerator/RestSpecification/Core/render_search_template.json new file mode 100644 index 0000000000..de148aec03 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/render_search_template.json @@ -0,0 +1,41 @@ +{ + "render_search_template":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/search-template/", + "description":"Allows to use the Mustache language to pre-render a search definition." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"], + "content_type": ["application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_render/template", + "methods":[ + "GET", + "POST" + ] + }, + { + "path":"/_render/template/{id}", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "id":{ + "type":"string", + "description":"The id of the stored search template" + } + } + } + ] + }, + "body":{ + "description":"The search definition template and its params" + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/scripts_painless_execute.json b/src/ApiGenerator/RestSpecification/Core/scripts_painless_execute.json new file mode 100644 index 0000000000..c27d25bf03 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/scripts_painless_execute.json @@ -0,0 +1,29 @@ +{ + "scripts_painless_execute":{ + "documentation":{ + "url":"", + "description":"Allows an arbitrary script to be executed and a result to be returned" + }, + "stability":"experimental", + "visibility":"public", + "headers":{ + "accept": [ "application/json"], + "content_type": ["application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_scripts/painless/_execute", + "methods":[ + "GET", + "POST" + ] + } + ] + }, + "params":{}, + "body":{ + "description":"The script to execute" + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/scroll.json b/src/ApiGenerator/RestSpecification/Core/scroll.json new file mode 100644 index 0000000000..42dda8508d --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/scroll.json @@ -0,0 +1,43 @@ +{ + "scroll":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/search/#request-body", + "description":"Allows to retrieve a large numbers of results from a single search request." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"], + "content_type": ["application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_search/scroll", + "methods":[ + "GET", + "POST" + ] + } + ] + }, + "params":{ + "scroll":{ + "type":"time", + "description":"Specify how long a consistent view of the index should be maintained for scrolled search" + }, + "scroll_id":{ + "type":"string", + "description":"The scroll ID for scrolled search" + }, + "rest_total_hits_as_int":{ + "type":"boolean", + "description":"Indicates whether hits.total should be rendered as an integer or an object in the rest search response", + "default":false + } + }, + "body":{ + "description":"The scroll ID if not passed by URL or query parameter." + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/search.json b/src/ApiGenerator/RestSpecification/Core/search.json new file mode 100644 index 0000000000..6651077680 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/search.json @@ -0,0 +1,243 @@ +{ + "search":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/search/", + "description":"Returns results matching a query." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"], + "content_type": ["application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_search", + "methods":[ + "GET", + "POST" + ] + }, + { + "path":"/{index}/_search", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices" + } + } + } + ] + }, + "params":{ + "analyzer":{ + "type":"string", + "description":"The analyzer to use for the query string" + }, + "analyze_wildcard":{ + "type":"boolean", + "description":"Specify whether wildcard and prefix queries should be analyzed (default: false)" + }, + "ccs_minimize_roundtrips":{ + "type":"boolean", + "description":"Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution", + "default":"true" + }, + "default_operator":{ + "type":"enum", + "options":[ + "AND", + "OR" + ], + "default":"OR", + "description":"The default operator for query string query (AND or OR)" + }, + "df":{ + "type":"string", + "description":"The field to use as default where no field prefix is given in the query string" + }, + "explain":{ + "type":"boolean", + "description":"Specify whether to return detailed information about score computation as part of a hit" + }, + "stored_fields":{ + "type":"list", + "description":"A comma-separated list of stored fields to return as part of a hit" + }, + "docvalue_fields":{ + "type":"list", + "description":"A comma-separated list of fields to return as the docvalue representation of a field for each hit" + }, + "from":{ + "type":"number", + "description":"Starting offset (default: 0)" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "ignore_throttled":{ + "type":"boolean", + "description":"Whether specified concrete, expanded or aliased indices should be ignored when throttled" + }, + "allow_no_indices":{ + "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)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "lenient":{ + "type":"boolean", + "description":"Specify whether format-based query failures (such as providing text to a numeric field) should be ignored" + }, + "preference":{ + "type":"string", + "description":"Specify the node or shard the operation should be performed on (default: random)" + }, + "q":{ + "type":"string", + "description":"Query in the Lucene query string syntax" + }, + "routing":{ + "type":"list", + "description":"A comma-separated list of specific routing values" + }, + "scroll":{ + "type":"time", + "description":"Specify how long a consistent view of the index should be maintained for scrolled search" + }, + "search_type":{ + "type":"enum", + "options":[ + "query_then_fetch", + "dfs_query_then_fetch" + ], + "description":"Search operation type" + }, + "size":{ + "type":"number", + "description":"Number of hits to return (default: 10)" + }, + "sort":{ + "type":"list", + "description":"A comma-separated list of : pairs" + }, + "_source":{ + "type":"list", + "description":"True or false to return the _source field or not, or a list of fields to return" + }, + "_source_excludes":{ + "type":"list", + "description":"A list of fields to exclude from the returned _source field" + }, + "_source_includes":{ + "type":"list", + "description":"A list of fields to extract and return from the _source field" + }, + "terminate_after":{ + "type":"number", + "description":"The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early." + }, + "stats":{ + "type":"list", + "description":"Specific 'tag' of the request for logging and statistical purposes" + }, + "suggest_field":{ + "type":"string", + "description":"Specify which field to use for suggestions" + }, + "suggest_mode":{ + "type":"enum", + "options":[ + "missing", + "popular", + "always" + ], + "default":"missing", + "description":"Specify suggest mode" + }, + "suggest_size":{ + "type":"number", + "description":"How many suggestions to return in response" + }, + "suggest_text":{ + "type":"string", + "description":"The source text for which the suggestions should be returned" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "track_scores":{ + "type":"boolean", + "description":"Whether to calculate and return scores even if they are not used for sorting" + }, + "track_total_hits":{ + "type":"boolean", + "description":"Indicate if the number of documents that match the query should be tracked" + }, + "allow_partial_search_results":{ + "type":"boolean", + "default":true, + "description":"Indicate if an error should be returned if there is a partial search failure or timeout" + }, + "typed_keys":{ + "type":"boolean", + "description":"Specify whether aggregation and suggester names should be prefixed by their respective types in the response" + }, + "version":{ + "type":"boolean", + "description":"Specify whether to return document version as part of a hit" + }, + "seq_no_primary_term":{ + "type":"boolean", + "description":"Specify whether to return sequence number and primary term of the last modification of each hit" + }, + "request_cache":{ + "type":"boolean", + "description":"Specify if request cache should be used for this request or not, defaults to index level setting" + }, + "batched_reduce_size":{ + "type":"number", + "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.", + "default":512 + }, + "max_concurrent_shard_requests":{ + "type":"number", + "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", + "default":5 + }, + "pre_filter_shard_size":{ + "type":"number", + "description":"A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint." + }, + "rest_total_hits_as_int":{ + "type":"boolean", + "description":"Indicates whether hits.total should be rendered as an integer or an object in the rest search response", + "default":false + }, + "min_compatible_shard_node":{ + "type":"string", + "description":"The minimum compatible version that all shards involved in search should have for this request to be successful" + } + }, + "body":{ + "description":"The search definition using the Query DSL" + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/search_shards.json b/src/ApiGenerator/RestSpecification/Core/search_shards.json new file mode 100644 index 0000000000..c013caeaa3 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/search_shards.json @@ -0,0 +1,71 @@ +{ + "search_shards":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/security-plugin/access-control/cross-cluster-search/", + "description":"Returns information about the indices and shards that a search request would be executed against." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_search_shards", + "methods":[ + "GET", + "POST" + ] + }, + { + "path":"/{index}/_search_shards", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices" + } + } + } + ] + }, + "params":{ + "preference":{ + "type":"string", + "description":"Specify the node or shard the operation should be performed on (default: random)" + }, + "routing":{ + "type":"string", + "description":"Specific routing value" + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "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)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/search_template.json b/src/ApiGenerator/RestSpecification/Core/search_template.json new file mode 100644 index 0000000000..b6a2adbeb9 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/search_template.json @@ -0,0 +1,112 @@ +{ + "search_template":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/search-template/", + "description":"Allows to use the Mustache language to pre-render a search definition." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"], + "content_type": ["application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_search/template", + "methods":[ + "GET", + "POST" + ] + }, + { + "path":"/{index}/_search/template", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices" + } + } + } + ] + }, + "params":{ + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "ignore_throttled":{ + "type":"boolean", + "description":"Whether specified concrete, expanded or aliased indices should be ignored when throttled" + }, + "allow_no_indices":{ + "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)" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "preference":{ + "type":"string", + "description":"Specify the node or shard the operation should be performed on (default: random)" + }, + "routing":{ + "type":"list", + "description":"A comma-separated list of specific routing values" + }, + "scroll":{ + "type":"time", + "description":"Specify how long a consistent view of the index should be maintained for scrolled search" + }, + "search_type":{ + "type":"enum", + "options":[ + "query_then_fetch", + "query_and_fetch", + "dfs_query_then_fetch", + "dfs_query_and_fetch" + ], + "description":"Search operation type" + }, + "explain":{ + "type":"boolean", + "description":"Specify whether to return detailed information about score computation as part of a hit" + }, + "profile":{ + "type":"boolean", + "description":"Specify whether to profile the query execution" + }, + "typed_keys":{ + "type":"boolean", + "description":"Specify whether aggregation and suggester names should be prefixed by their respective types in the response" + }, + "rest_total_hits_as_int":{ + "type":"boolean", + "description":"Indicates whether hits.total should be rendered as an integer or an object in the rest search response", + "default":false + }, + "ccs_minimize_roundtrips": { + "type" : "boolean", + "description" : "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution", + "default" : "true" + } + }, + "body":{ + "description":"The search definition template and its params", + "required":true + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/snapshot.cleanup_repository.json b/src/ApiGenerator/RestSpecification/Core/snapshot.cleanup_repository.json new file mode 100644 index 0000000000..9783af5d07 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/snapshot.cleanup_repository.json @@ -0,0 +1,43 @@ +{ + "snapshot.cleanup_repository": { + "documentation": { + "url": "", + "description": "Removes stale data from repository." + }, + "stability": "stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url": { + "paths": [ + { + "path": "/_snapshot/{repository}/_cleanup", + "methods": [ + "POST" + ], + "parts": { + "repository": { + "type": "string", + "description": "A repository name" + } + } + } + ] + }, + "params": { + "master_timeout": { + "type": "time", + "description": "Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout": { + "type": "time", + "description": "Explicit operation timeout for connection to cluster_manager_timeout node" + }, + "timeout": { + "type": "time", + "description": "Explicit operation timeout" + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/snapshot.clone.json b/src/ApiGenerator/RestSpecification/Core/snapshot.clone.json new file mode 100644 index 0000000000..c069bdcd5a --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/snapshot.clone.json @@ -0,0 +1,52 @@ +{ + "snapshot.clone":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/", + "description":"Clones indices from one snapshot into another snapshot in the same repository." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"], + "content_type": ["application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_snapshot/{repository}/{snapshot}/_clone/{target_snapshot}", + "methods":[ + "PUT" + ], + "parts":{ + "repository":{ + "type":"string", + "description":"A repository name" + }, + "snapshot":{ + "type":"string", + "description":"The name of the snapshot to clone from" + }, + "target_snapshot":{ + "type":"string", + "description":"The name of the cloned snapshot to create" + } + } + } + ] + }, + "params":{ + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + }, + }, + "body":{ + "description":"The snapshot clone definition", + "required":true + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/snapshot.create.json b/src/ApiGenerator/RestSpecification/Core/snapshot.create.json new file mode 100644 index 0000000000..c05e4d650c --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/snapshot.create.json @@ -0,0 +1,54 @@ +{ + "snapshot.create":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/", + "description":"Creates a snapshot in a repository." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"], + "content_type": ["application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_snapshot/{repository}/{snapshot}", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "repository":{ + "type":"string", + "description":"A repository name" + }, + "snapshot":{ + "type":"string", + "description":"A snapshot name" + } + } + } + ] + }, + "params":{ + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + }, + "wait_for_completion":{ + "type":"boolean", + "description":"Should this request wait until the operation has completed before returning", + "default":false + } + }, + "body":{ + "description":"The snapshot definition", + "required":false + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/snapshot.create_repository.json b/src/ApiGenerator/RestSpecification/Core/snapshot.create_repository.json new file mode 100644 index 0000000000..b5d89f5282 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/snapshot.create_repository.json @@ -0,0 +1,53 @@ +{ + "snapshot.create_repository":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/", + "description":"Creates a repository." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"], + "content_type": ["application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_snapshot/{repository}", + "methods":[ + "PUT", + "POST" + ], + "parts":{ + "repository":{ + "type":"string", + "description":"A repository name" + } + } + } + ] + }, + "params":{ + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "verify":{ + "type":"boolean", + "description":"Whether to verify the repository after creation" + } + }, + "body":{ + "description":"The repository definition", + "required":true + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/snapshot.delete.json b/src/ApiGenerator/RestSpecification/Core/snapshot.delete.json new file mode 100644 index 0000000000..227d3aec7c --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/snapshot.delete.json @@ -0,0 +1,43 @@ +{ + "snapshot.delete":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/", + "description":"Deletes a snapshot." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_snapshot/{repository}/{snapshot}", + "methods":[ + "DELETE" + ], + "parts":{ + "repository":{ + "type":"string", + "description":"A repository name" + }, + "snapshot":{ + "type":"string", + "description":"A snapshot name" + } + } + } + ] + }, + "params":{ + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/snapshot.delete_repository.json b/src/ApiGenerator/RestSpecification/Core/snapshot.delete_repository.json new file mode 100644 index 0000000000..4cbf5b31f5 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/snapshot.delete_repository.json @@ -0,0 +1,43 @@ +{ + "snapshot.delete_repository":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/", + "description":"Deletes a repository." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_snapshot/{repository}", + "methods":[ + "DELETE" + ], + "parts":{ + "repository":{ + "type":"list", + "description":"Name of the snapshot repository to unregister. Wildcard (`*`) patterns are supported." + } + } + } + ] + }, + "params":{ + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/snapshot.get.json b/src/ApiGenerator/RestSpecification/Core/snapshot.get.json new file mode 100644 index 0000000000..7d526adcbc --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/snapshot.get.json @@ -0,0 +1,51 @@ +{ + "snapshot.get":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/", + "description":"Returns information about a snapshot." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_snapshot/{repository}/{snapshot}", + "methods":[ + "GET" + ], + "parts":{ + "repository":{ + "type":"string", + "description":"A repository name" + }, + "snapshot":{ + "type":"list", + "description":"A comma-separated list of snapshot names" + } + } + } + ] + }, + "params":{ + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown" + }, + "verbose":{ + "type":"boolean", + "description":"Whether to show verbose snapshot info or only show the basic info found in the repository index blob" + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/snapshot.get_repository.json b/src/ApiGenerator/RestSpecification/Core/snapshot.get_repository.json new file mode 100644 index 0000000000..3a03941ed3 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/snapshot.get_repository.json @@ -0,0 +1,49 @@ +{ + "snapshot.get_repository":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/", + "description":"Returns information about a repository." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_snapshot", + "methods":[ + "GET" + ] + }, + { + "path":"/_snapshot/{repository}", + "methods":[ + "GET" + ], + "parts":{ + "repository":{ + "type":"list", + "description":"A comma-separated list of repository names" + } + } + } + ] + }, + "params":{ + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/snapshot.restore.json b/src/ApiGenerator/RestSpecification/Core/snapshot.restore.json new file mode 100644 index 0000000000..630381ede2 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/snapshot.restore.json @@ -0,0 +1,53 @@ +{ + "snapshot.restore":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/", + "description":"Restores a snapshot." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"], + "content_type": ["application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_snapshot/{repository}/{snapshot}/_restore", + "methods":[ + "POST" + ], + "parts":{ + "repository":{ + "type":"string", + "description":"A repository name" + }, + "snapshot":{ + "type":"string", + "description":"A snapshot name" + } + } + } + ] + }, + "params":{ + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + }, + "wait_for_completion":{ + "type":"boolean", + "description":"Should this request wait until the operation has completed before returning", + "default":false + } + }, + "body":{ + "description":"Details of what to restore", + "required":false + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/snapshot.status.json b/src/ApiGenerator/RestSpecification/Core/snapshot.status.json new file mode 100644 index 0000000000..40acfc5521 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/snapshot.status.json @@ -0,0 +1,65 @@ +{ + "snapshot.status":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/", + "description":"Returns information about the status of a snapshot." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_snapshot/_status", + "methods":[ + "GET" + ] + }, + { + "path":"/_snapshot/{repository}/_status", + "methods":[ + "GET" + ], + "parts":{ + "repository":{ + "type":"string", + "description":"A repository name" + } + } + }, + { + "path":"/_snapshot/{repository}/{snapshot}/_status", + "methods":[ + "GET" + ], + "parts":{ + "repository":{ + "type":"string", + "description":"A repository name" + }, + "snapshot":{ + "type":"list", + "description":"A comma-separated list of snapshot names" + } + } + } + ] + }, + "params":{ + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown" + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/snapshot.verify_repository.json b/src/ApiGenerator/RestSpecification/Core/snapshot.verify_repository.json new file mode 100644 index 0000000000..b0d52a80ca --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/snapshot.verify_repository.json @@ -0,0 +1,43 @@ +{ + "snapshot.verify_repository":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/", + "description":"Verifies a repository." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_snapshot/{repository}/_verify", + "methods":[ + "POST" + ], + "parts":{ + "repository":{ + "type":"string", + "description":"A repository name" + } + } + } + ] + }, + "params":{ + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster_manager_timeout node" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/tasks.cancel.json b/src/ApiGenerator/RestSpecification/Core/tasks.cancel.json new file mode 100644 index 0000000000..8a31e844a4 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/tasks.cancel.json @@ -0,0 +1,53 @@ +{ + "tasks.cancel":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-tasks/", + "description":"Cancels a task, if it can be cancelled through an API." + }, + "stability":"experimental", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_tasks/_cancel", + "methods":[ + "POST" + ] + }, + { + "path":"/_tasks/{task_id}/_cancel", + "methods":[ + "POST" + ], + "parts":{ + "task_id":{ + "type":"string", + "description":"Cancel the task with specified task id (node_id:task_number)" + } + } + } + ] + }, + "params":{ + "nodes":{ + "type":"list", + "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" + }, + "actions":{ + "type":"list", + "description":"A comma-separated list of actions that should be cancelled. Leave empty to cancel all." + }, + "parent_task_id":{ + "type":"string", + "description":"Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all." + }, + "wait_for_completion": { + "type":"boolean", + "description":"Should the request block until the cancellation of the task and its descendant tasks is completed. Defaults to false" + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/tasks.get.json b/src/ApiGenerator/RestSpecification/Core/tasks.get.json new file mode 100644 index 0000000000..1d8d576111 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/tasks.get.json @@ -0,0 +1,39 @@ +{ + "tasks.get":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-tasks/", + "description":"Returns information about a task." + }, + "stability":"experimental", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_tasks/{task_id}", + "methods":[ + "GET" + ], + "parts":{ + "task_id":{ + "type":"string", + "description":"Return the task with specified id (node_id:task_number)" + } + } + } + ] + }, + "params":{ + "wait_for_completion":{ + "type":"boolean", + "description":"Wait for the matching tasks to complete (default: false)" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/tasks.list.json b/src/ApiGenerator/RestSpecification/Core/tasks.list.json new file mode 100644 index 0000000000..e669d8d66c --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/tasks.list.json @@ -0,0 +1,59 @@ +{ + "tasks.list":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-tasks/", + "description":"Returns a list of tasks." + }, + "stability":"experimental", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_tasks", + "methods":[ + "GET" + ] + } + ] + }, + "params":{ + "nodes":{ + "type":"list", + "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" + }, + "actions":{ + "type":"list", + "description":"A comma-separated list of actions that should be returned. Leave empty to return all." + }, + "detailed":{ + "type":"boolean", + "description":"Return detailed task information (default: false)" + }, + "parent_task_id":{ + "type":"string", + "description":"Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all." + }, + "wait_for_completion":{ + "type":"boolean", + "description":"Wait for the matching tasks to complete (default: false)" + }, + "group_by":{ + "type":"enum", + "description":"Group tasks by nodes or parent/child relationships", + "options":[ + "nodes", + "parents", + "none" + ], + "default":"nodes" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/termvectors.json b/src/ApiGenerator/RestSpecification/Core/termvectors.json new file mode 100644 index 0000000000..98fd8216ba --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/termvectors.json @@ -0,0 +1,109 @@ +{ + "termvectors":{ + "documentation":{ + "url":"", + "description":"Returns information and statistics about terms in the fields of a particular document." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"], + "content_type": ["application/json"] + }, + "url":{ + "paths":[ + { + "path":"/{index}/_termvectors/{id}", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "index":{ + "type":"string", + "description":"The index in which the document resides." + }, + "id":{ + "type":"string", + "description":"The id of the document, when not specified a doc param should be supplied." + } + } + }, + { + "path":"/{index}/_termvectors", + "methods":[ + "GET", + "POST" + ], + "parts":{ + "index":{ + "type":"string", + "description":"The index in which the document resides." + } + } + } + ] + }, + "params":{ + "term_statistics":{ + "type":"boolean", + "description":"Specifies if total term frequency and document frequency should be returned.", + "default":false + }, + "field_statistics":{ + "type":"boolean", + "description":"Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned.", + "default":true + }, + "fields":{ + "type":"list", + "description":"A comma-separated list of fields to return." + }, + "offsets":{ + "type":"boolean", + "description":"Specifies if term offsets should be returned.", + "default":true + }, + "positions":{ + "type":"boolean", + "description":"Specifies if term positions should be returned.", + "default":true + }, + "payloads":{ + "type":"boolean", + "description":"Specifies if term payloads should be returned.", + "default":true + }, + "preference":{ + "type":"string", + "description":"Specify the node or shard the operation should be performed on (default: random)." + }, + "routing":{ + "type":"string", + "description":"Specific routing value." + }, + "realtime":{ + "type":"boolean", + "description":"Specifies if request is real-time as opposed to near-real-time (default: true)." + }, + "version":{ + "type":"number", + "description":"Explicit version number for concurrency control" + }, + "version_type":{ + "type":"enum", + "options":[ + "internal", + "external", + "external_gte", + "force" + ], + "description":"Specific version type" + } + }, + "body":{ + "description":"Define parameters and or supply a document to get termvectors for. See documentation.", + "required":false + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/update.json b/src/ApiGenerator/RestSpecification/Core/update.json new file mode 100644 index 0000000000..800b9f1116 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/update.json @@ -0,0 +1,93 @@ +{ + "update":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/update-document/", + "description":"Updates a document with a script or partial document." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"], + "content_type": ["application/json"] + }, + "url":{ + "paths":[ + { + "path":"/{index}/_update/{id}", + "methods":[ + "POST" + ], + "parts":{ + "id":{ + "type":"string", + "description":"Document ID" + }, + "index":{ + "type":"string", + "description":"The name of the index" + } + } + } + ] + }, + "params":{ + "wait_for_active_shards":{ + "type":"string", + "description":"Sets the number of shard copies that must be active before proceeding with the update operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)" + }, + "_source":{ + "type":"list", + "description":"True or false to return the _source field or not, or a list of fields to return" + }, + "_source_excludes":{ + "type":"list", + "description":"A list of fields to exclude from the returned _source field" + }, + "_source_includes":{ + "type":"list", + "description":"A list of fields to extract and return from the _source field" + }, + "lang":{ + "type":"string", + "description":"The script language (default: painless)" + }, + "refresh":{ + "type":"enum", + "options":[ + "true", + "false", + "wait_for" + ], + "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." + }, + "retry_on_conflict":{ + "type":"number", + "description":"Specify how many times should the operation be retried when a conflict occurs (default: 0)" + }, + "routing":{ + "type":"string", + "description":"Specific routing value" + }, + "timeout":{ + "type":"time", + "description":"Explicit operation timeout" + }, + "if_seq_no":{ + "type":"number", + "description":"only perform the update operation if the last operation that has changed the document has the specified sequence number" + }, + "if_primary_term":{ + "type":"number", + "description":"only perform the update operation if the last operation that has changed the document has the specified primary term" + }, + "require_alias": { + "type": "boolean", + "description": "When true, requires destination is an alias. Default is false" + } + }, + "body":{ + "description":"The request definition requires either `script` or partial `doc`", + "required":true + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/update_by_query.json b/src/ApiGenerator/RestSpecification/Core/update_by_query.json new file mode 100644 index 0000000000..0e83281217 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/update_by_query.json @@ -0,0 +1,198 @@ +{ + "update_by_query":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/update-by-query/", + "description":"Performs an update on every document in the index without changing the source,\nfor example to pick up a mapping change." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"], + "content_type": ["application/json"] + }, + "url":{ + "paths":[ + { + "path":"/{index}/_update_by_query", + "methods":[ + "POST" + ], + "parts":{ + "index":{ + "type":"list", + "description":"A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices" + } + } + } + ] + }, + "params":{ + "analyzer":{ + "type":"string", + "description":"The analyzer to use for the query string" + }, + "analyze_wildcard":{ + "type":"boolean", + "description":"Specify whether wildcard and prefix queries should be analyzed (default: false)" + }, + "default_operator":{ + "type":"enum", + "options":[ + "AND", + "OR" + ], + "default":"OR", + "description":"The default operator for query string query (AND or OR)" + }, + "df":{ + "type":"string", + "description":"The field to use as default where no field prefix is given in the query string" + }, + "from":{ + "type":"number", + "description":"Starting offset (default: 0)" + }, + "ignore_unavailable":{ + "type":"boolean", + "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" + }, + "allow_no_indices":{ + "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)" + }, + "conflicts":{ + "type":"enum", + "options":[ + "abort", + "proceed" + ], + "default":"abort", + "description":"What to do when the update by query hits version conflicts?" + }, + "expand_wildcards":{ + "type":"enum", + "options":[ + "open", + "closed", + "hidden", + "none", + "all" + ], + "default":"open", + "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." + }, + "lenient":{ + "type":"boolean", + "description":"Specify whether format-based query failures (such as providing text to a numeric field) should be ignored" + }, + "pipeline":{ + "type":"string", + "description":"Ingest pipeline to set on index requests made by this action. (default: none)" + }, + "preference":{ + "type":"string", + "description":"Specify the node or shard the operation should be performed on (default: random)" + }, + "q":{ + "type":"string", + "description":"Query in the Lucene query string syntax" + }, + "routing":{ + "type":"list", + "description":"A comma-separated list of specific routing values" + }, + "scroll":{ + "type":"time", + "description":"Specify how long a consistent view of the index should be maintained for scrolled search" + }, + "search_type":{ + "type":"enum", + "options":[ + "query_then_fetch", + "dfs_query_then_fetch" + ], + "description":"Search operation type" + }, + "search_timeout":{ + "type":"time", + "description":"Explicit timeout for each search request. Defaults to no timeout." + }, + "max_docs":{ + "type":"number", + "description":"Maximum number of documents to process (default: all documents)" + }, + "sort":{ + "type":"list", + "description":"A comma-separated list of : pairs" + }, + "_source":{ + "type":"list", + "description":"True or false to return the _source field or not, or a list of fields to return" + }, + "_source_excludes":{ + "type":"list", + "description":"A list of fields to exclude from the returned _source field" + }, + "_source_includes":{ + "type":"list", + "description":"A list of fields to extract and return from the _source field" + }, + "terminate_after":{ + "type":"number", + "description":"The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early." + }, + "stats":{ + "type":"list", + "description":"Specific 'tag' of the request for logging and statistical purposes" + }, + "version":{ + "type":"boolean", + "description":"Specify whether to return document version as part of a hit" + }, + "version_type":{ + "type":"boolean", + "description":"Should the document increment the version number (internal) on hit or not (reindex)" + }, + "request_cache":{ + "type":"boolean", + "description":"Specify if request cache should be used for this request or not, defaults to index level setting" + }, + "refresh":{ + "type":"boolean", + "description":"Should the affected indexes be refreshed?" + }, + "timeout":{ + "type":"time", + "default":"1m", + "description":"Time each individual bulk request should wait for shards that are unavailable." + }, + "wait_for_active_shards":{ + "type":"string", + "description":"Sets the number of shard copies that must be active before proceeding with the update by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)" + }, + "scroll_size":{ + "type":"number", + "default":100, + "description":"Size on the scroll request powering the update by query" + }, + "wait_for_completion":{ + "type":"boolean", + "default":true, + "description":"Should the request should block until the update by query operation is complete." + }, + "requests_per_second":{ + "type":"number", + "default":0, + "description":"The throttle to set on this request in sub-requests per second. -1 means no throttle." + }, + "slices":{ + "type":"number|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`." + } + }, + "body":{ + "description":"The search definition using the Query DSL" + } + } +} diff --git a/src/ApiGenerator/RestSpecification/Core/update_by_query_rethrottle.json b/src/ApiGenerator/RestSpecification/Core/update_by_query_rethrottle.json new file mode 100644 index 0000000000..ee11e0e927 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/Core/update_by_query_rethrottle.json @@ -0,0 +1,36 @@ +{ + "update_by_query_rethrottle":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/update-by-query/", + "description":"Changes the number of requests per second for a particular Update By Query operation." + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_update_by_query/{task_id}/_rethrottle", + "methods":[ + "POST" + ], + "parts":{ + "task_id":{ + "type":"string", + "description":"The task id to rethrottle" + } + } + } + ] + }, + "params":{ + "requests_per_second":{ + "type":"number", + "required":true, + "description":"The throttle to set on this request in floating sub-requests per second. -1 means set no throttle." + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/_Patches/cat.tasks.patch.json b/src/ApiGenerator/RestSpecification/_Patches/cat.tasks.patch.json new file mode 100644 index 0000000000..ca5a5100d9 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/_Patches/cat.tasks.patch.json @@ -0,0 +1,8 @@ +{ + "cat.tasks": { + "stability" : "experimental", + "url": { + "path": "/_cat/tasks" + } + } +} \ No newline at end of file diff --git a/src/ApiGenerator/RestSpecification/_Patches/indices.put_mapping.patch.json b/src/ApiGenerator/RestSpecification/_Patches/indices.put_mapping.patch.json new file mode 100644 index 0000000000..87be1e7c1c --- /dev/null +++ b/src/ApiGenerator/RestSpecification/_Patches/indices.put_mapping.patch.json @@ -0,0 +1,15 @@ +{ + "indices.put_mapping": { + "url": { + "path": "{index}/_mapping", + "paths": ["{index}/_mapping"], + "deprecated_paths" : [ + { + "version" : "1.0", + "path" : "{index}/_mappings", + "description" : "The plural mappings is accepted but only /_mapping is documented" + } + ] + } + } +} diff --git a/src/ApiGenerator/RestSpecification/_Patches/indices.stats.patch.json b/src/ApiGenerator/RestSpecification/_Patches/indices.stats.patch.json new file mode 100644 index 0000000000..9a805273b9 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/_Patches/indices.stats.patch.json @@ -0,0 +1,11 @@ +{ + "indices.stats": { + "url": { + "parts": { + "metric" : { + "options": [ "_all", "store", "indexing", "get", "search", "merge", "flush", "refresh", "query_cache", "fielddata", "docs", "warmer", "completion", "segments", "translog", "request_cache", "recovery" ] + } + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/_Patches/nodes.hot_threads.patch.json b/src/ApiGenerator/RestSpecification/_Patches/nodes.hot_threads.patch.json new file mode 100644 index 0000000000..c895018667 --- /dev/null +++ b/src/ApiGenerator/RestSpecification/_Patches/nodes.hot_threads.patch.json @@ -0,0 +1,40 @@ +{ + "nodes.hot_threads": { + "url": { + "path": "/_nodes/hot_threads", + "paths": [ "/_nodes/hot_threads", "/_nodes/{node_id}/hot_threads" ], + "deprecated_paths": [ + { + "version": "1.0", + "path": "/_cluster/nodes/hotthreads", + "description": "The hot threads API accepts `hotthreads` but only `hot_threads` is documented" + }, + { + "version": "1.0", + "path": "/_cluster/nodes/{node_id}/hotthreads", + "description": "The hot threads API accepts `hotthreads` but only `hot_threads` is documented" + }, + { + "version": "1.0", + "path": "/_nodes/hotthreads", + "description": "The hot threads API accepts `hotthreads` but only `hot_threads` is documented" + }, + { + "version": "1.0", + "path": "/_nodes/{node_id}/hotthreads", + "description": "The hot threads API accepts `hotthreads` but only `hot_threads` is documented" + }, + { + "version": "1.0", + "path": "/_cluster/nodes/hot_threads", + "description": "The hot accepts /_cluster/nodes as prefix for backwards compatibility reasons" + }, + { + "version": "1.0", + "path": "/_cluster/nodes/{node_id}/hot_threads", + "description": "The hot accepts /_cluster/nodes as prefix for backwards compatibility reasons" + } + ] + } + } +} diff --git a/src/ApiGenerator/RestSpecification/_Patches/nodes.stats.patch.json b/src/ApiGenerator/RestSpecification/_Patches/nodes.stats.patch.json new file mode 100644 index 0000000000..b43cb36f3c --- /dev/null +++ b/src/ApiGenerator/RestSpecification/_Patches/nodes.stats.patch.json @@ -0,0 +1,11 @@ +{ + "nodes.stats": { + "url": { + "parts": { + "index_metric" : { + "options": [ "_all", "store", "indexing", "get", "search", "merge", "flush", "refresh", "query_cache", "fielddata", "docs", "warmer", "completion", "segments", "translog", "request_cache", "recovery" ] + } + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/_Patches/reindex.patch.patch.json b/src/ApiGenerator/RestSpecification/_Patches/reindex.patch.patch.json new file mode 100644 index 0000000000..1c1240317d --- /dev/null +++ b/src/ApiGenerator/RestSpecification/_Patches/reindex.patch.patch.json @@ -0,0 +1,12 @@ +{ + "reindex": { + "url": { + "params": { + "scroll": { + "type" : "time", + "description" : "Specify how long a consistent view of the index should be maintained for scrolled search" + } + } + } + } +} diff --git a/src/ApiGenerator/RestSpecification/_Patches/snapshot.cleanup_repository.patch.json b/src/ApiGenerator/RestSpecification/_Patches/snapshot.cleanup_repository.patch.json new file mode 100644 index 0000000000..7c4a52b6af --- /dev/null +++ b/src/ApiGenerator/RestSpecification/_Patches/snapshot.cleanup_repository.patch.json @@ -0,0 +1,5 @@ +{ + "snapshot.cleanup_repository": { + "body": { } + } +} diff --git a/src/ApiGenerator/Views/GeneratorNotice.cshtml b/src/ApiGenerator/Views/GeneratorNotice.cshtml new file mode 100644 index 0000000000..fc624a8e9e --- /dev/null +++ b/src/ApiGenerator/Views/GeneratorNotice.cshtml @@ -0,0 +1,45 @@ +@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. +*/ +/* +* 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..5847b6ee46 --- /dev/null +++ b/src/ApiGenerator/Views/HighLevel/Client/FluentSyntax/FluentMethod.cshtml @@ -0,0 +1,20 @@ +@using System +@using ApiGenerator.Domain.Code.HighLevel.Methods +@inherits ApiGenerator.CodeTemplatePage +@{ + FluentSyntaxBase syntax = Model.Syntax; + + var method = !Model.Async ? syntax.MethodName : string.Format("{0}Async", 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 = syntax.RequestMethodGenerics; + var descriptor = syntax.DescriptorName; + var selectorArgs = syntax.SelectorArguments(); + var selectorChained = syntax.SelectorChainedDefaults(); + var cancellationToken = !Model.Async ? string.Empty : ", ct"; +} +@{ await IncludeAsync("HighLevel/Client/MethodXmlDocs.cshtml", 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..547c087257 --- /dev/null +++ b/src/ApiGenerator/Views/HighLevel/Client/FluentSyntax/FluentMethodHeader.cshtml @@ -0,0 +1,16 @@ +@using ApiGenerator.Domain.Code.HighLevel.Methods +@inherits ApiGenerator.CodeTemplatePage +@{ + FluentSyntaxBase syntax = Model.Syntax; + + var response = !Model.Async ? syntax.ResponseName : string.Format("Task<{0}>", syntax.ResponseName); + var method = !Model.Async ? syntax.MethodName : string.Format("{0}Async", syntax.MethodName); + + var methodGenerics = syntax.MethodGenerics; + var descriptorArgs = syntax.DescriptorArguments(); + var selector = syntax.Selector; + var optionalSelector = syntax.OptionalSelectorSuffix; + var whereClause = 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..978a9b2a3e --- /dev/null +++ b/src/ApiGenerator/Views/HighLevel/Client/Implementation/MethodImplementation.cshtml @@ -0,0 +1,20 @@ +@using ApiGenerator +@using ApiGenerator.Domain.Code.HighLevel.Methods +@using HighLevelModel = ApiGenerator.Domain.Code.HighLevel.Methods.HighLevelModel +@inherits CodeTemplatePage +@{ + HighLevelModel model = Model; + var fluentPath = "HighLevel/Client/FluentSyntax/FluentMethod.cshtml"; + var 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..31934d8da9 --- /dev/null +++ b/src/ApiGenerator/Views/HighLevel/Client/Implementation/OpenSearchClient.Namespace.cshtml @@ -0,0 +1,37 @@ +@using ApiGenerator +@using System.Collections.Generic +@using System.Collections.ObjectModel +@using ApiGenerator.Domain.Code +@using ApiGenerator.Domain.Specification +@inherits ApiGenerator.CodeTemplatePage>> +@{ + KeyValuePair> model = Model; + string ns = model.Key; + var endpoints = model.Value; +} +@{ await IncludeAsync("GeneratorNotice.cshtml", model); } +// 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 class @(CsharpNames.HighLevelClientNamespacePrefix)@(model.Key)@(CsharpNames.ClientNamespaceSuffix) : NamespacedClientProxy + { + internal @(CsharpNames.HighLevelClientNamespacePrefix)@(model.Key)@(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..1fa8f03b90 --- /dev/null +++ b/src/ApiGenerator/Views/HighLevel/Client/Implementation/OpenSearchClient.cshtml @@ -0,0 +1,64 @@ +@using System.Linq +@using ApiGenerator.Domain +@using ApiGenerator +@using ApiGenerator.Domain.Code +@inherits CodeTemplatePage +@{ await IncludeAsync("GeneratorNotice.cshtml", Model); } +// ReSharper disable RedundantUsingDirective +using System; +using System.Threading; +using System.Threading.Tasks; +using OpenSearch.Client; +@{ await IncludeAsync("HighLevel/Client/Usings.cshtml", Model);} + +@{ + RestApiSpec model = Model; + var namespaces = model.EndpointsPerNamespaceHighLevel.Keys.Where(k => k != CsharpNames.RootNamespace).ToList(); + +// 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 SetupNamespaces() + { + + foreach (var ns in namespaces) + { + @ns = new @(CsharpNames.HighLevelClientNamespacePrefix)@(ns)@(CsharpNames.ClientNamespaceSuffix)(this); + + } + + } + + + + foreach (var kv in model.EndpointsPerNamespaceHighLevel) + { + if (kv.Key != CsharpNames.RootNamespace) + { + continue; + } + var endpoints = kv.Value; + var models = endpoints.Select(e=>e.HighLevelModel).ToList(); + foreach (var m in models) + { + 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..ea70731bcc --- /dev/null +++ b/src/ApiGenerator/Views/HighLevel/Client/InitializerSyntax/InitializerMethod.cshtml @@ -0,0 +1,22 @@ +@using System +@using ApiGenerator.Domain.Code.HighLevel.Methods +@inherits ApiGenerator.CodeTemplatePage +@{ + InitializerMethod syntax = Model.Syntax; + + var dispatchMethod = !Model.Async ? syntax.DispatchMethod : string.Format("{0}Async", syntax.DispatchMethod); + var dispatchGenerics = syntax.DispatchGenerics; + var dispatchParameters = 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", 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..aaf70f0c83 --- /dev/null +++ b/src/ApiGenerator/Views/HighLevel/Client/InitializerSyntax/InitializerMethodHeader.cshtml @@ -0,0 +1,17 @@ +@using ApiGenerator.Domain.Code.HighLevel.Methods +@inherits ApiGenerator.CodeTemplatePage +@{ + InitializerMethod syntax = Model.Syntax; + + var response = !Model.Async ? syntax.ResponseName : string.Format("Task<{0}>", syntax.ResponseName); + var method = !Model.Async ? syntax.MethodName : string.Format("{0}Async", syntax.MethodName); + var requestMethodGenerics = syntax.MethodGenerics; + + var methodsArgs = string.Format("{0} request", syntax.ArgumentType); + if (Model.Async) + { + methodsArgs += ", CancellationToken ct = default"; + } + var whereClause = 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..6b82e4375a --- /dev/null +++ b/src/ApiGenerator/Views/HighLevel/Client/Interface/IOpenSearchClient.cshtml @@ -0,0 +1,40 @@ +@using System.Linq +@using ApiGenerator +@using ApiGenerator.Domain +@using ApiGenerator.Domain.Code +@inherits ApiGenerator.CodeTemplatePage +@{ await IncludeAsync("GeneratorNotice.cshtml", Model); } +// 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 + { + @foreach(var kv in Model.EndpointsPerNamespaceHighLevel) + { + if (kv.Key != CsharpNames.RootNamespace) + { + ///@(kv.Key.SplitPascalCase()) APIs + @CsharpNames.HighLevelClientNamespacePrefix@(kv.Key)@CsharpNames.ClientNamespaceSuffix @kv.Key { get; } + + continue; + } + var endpoints = kv.Value; + var models = endpoints.Select(e=>e.HighLevelModel).ToList(); + foreach(var m in models) + { + 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..e0db8b1671 --- /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 +@{ + HighLevelModel model = Model; + var fluentPath = "HighLevel/Client/FluentSyntax/FluentMethodHeader.cshtml"; + var initializerPath = "HighLevel/Client/InitializerSyntax/InitializerMethodHeader.cshtml"; +} + +@{ await IncludeAsync("HighLevel/Client/MethodXmlDocs.cshtml", model.Fluent); } +@{ await IncludeAsync(fluentPath, new FluentSyntaxView(model.Fluent, async: false)); }; +@{ await IncludeAsync("HighLevel/Client/MethodXmlDocs.cshtml", model.Fluent); } +@{ await IncludeAsync(fluentPath, new FluentSyntaxView(model.Fluent, async: true)); }; + +@if (model.FluentBound != null) +{ + + @{ await IncludeAsync("HighLevel/Client/MethodXmlDocs.cshtml", model.FluentBound); } + @{ await IncludeAsync(fluentPath, new FluentSyntaxView(model.FluentBound, async: false)); }; + @{ await IncludeAsync("HighLevel/Client/MethodXmlDocs.cshtml", model.FluentBound); } + @{ await IncludeAsync(fluentPath, new FluentSyntaxView(model.FluentBound, async: true)); }; + +} +@{ await IncludeAsync("HighLevel/Client/MethodXmlDocs.cshtml", model.Initializer); } +@{ await IncludeAsync(initializerPath, new InitializerSyntaxView(model.Initializer, async: false)); }; +@{ await IncludeAsync("HighLevel/Client/MethodXmlDocs.cshtml", 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..e93b97856c --- /dev/null +++ b/src/ApiGenerator/Views/HighLevel/Client/MethodXmlDocs.cshtml @@ -0,0 +1,11 @@ +@using ApiGenerator +@using ApiGenerator.Domain.Code.HighLevel.Methods; +@inherits CodeTemplatePage +@{ + var syntax = Model; +} +/// +/// @Raw(syntax.XmlDocSummary) +/// @Raw("") +/// @syntax.DocumentationLink +/// diff --git a/src/ApiGenerator/Views/HighLevel/Client/Usings.cshtml b/src/ApiGenerator/Views/HighLevel/Client/Usings.cshtml new file mode 100644 index 0000000000..53dcab591c --- /dev/null +++ b/src/ApiGenerator/Views/HighLevel/Client/Usings.cshtml @@ -0,0 +1,11 @@ +@using ApiGenerator.Domain +@using ApiGenerator.Domain.Code +@inherits ApiGenerator.CodeTemplatePage +@foreach(var kv in Model.EndpointsPerNamespaceHighLevel) +{ + if (kv.Key != CsharpNames.RootNamespace) + { +using OpenSearch.Client.@(CsharpNames.ApiNamespace).@(kv.Key)@(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..244b56e9e1 --- /dev/null +++ b/src/ApiGenerator/Views/HighLevel/Descriptors/Descriptor.cshtml @@ -0,0 +1,90 @@ +@using System.Linq +@using ApiGenerator.Domain.Code.HighLevel.Requests +@using ApiGenerator.Domain.Specification +@using ApiGenerator.Generator +@using CsQuery.ExtensionMethods.Internal +@inherits global::ApiGenerator.CodeTemplatePage +@{ + DescriptorPartialImplementation d = Model; + var names = d.CsharpNames; + var type = names.GenericOrNonGenericDescriptorName; + var concreteInterface = names.GenericOrNonGenericInterfaceName; + var baseInterface = names.GenericOrNonGenericInterfacePreference; + var apiLookup = $"ApiUrlsLookups.{d.CsharpNames.Namespace}{d.CsharpNames.MethodName}"; +} + ///Descriptor for @names.MethodName@Raw(d.OfficialDocumentationLink.IsNullOrEmpty() ? "" : " " + d.OfficialDocumentationLink + "") + public partial class @Raw(type) @(Raw(string.Format(" : RequestDescriptorBase<{0},{1}, {2}>, {2}", type,names.ParametersName, concreteInterface))) + { + internal override ApiUrls ApiUrls => @apiLookup; +@foreach (Constructor c in d.Constructors) +{ + @(Raw(CodeGenerator.Constructor(c))) + +} + // values part of the url path +@foreach (UrlPart part in d.Parts) +{ + @(Raw(part.HighLevelTypeName)) @(Raw(baseInterface)).@(part.InterfaceName) => Self.RouteValues.Get@(Raw(string.Format("<{0}>",part.HighLevelTypeName)))("@(part.Name)"); + +} +@foreach (FluentRouteSetter c in d.GetFluentRouteSetters()) +{ + + @(Raw(c.XmlDoc)) + @(Raw(c.Code)) + +} + // Request parameters +@foreach (var param in d.Params) +{ + var original = param.QueryStringKey; + //skip parameters already part of the path portion of the url + if (d.Parts.Any(p=>p.Name == original)) + { + continue; + } + //we prefer this parameter to be explictly implemented on the request body + if (param.RenderPartial && (d.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"; + var desc = param.DescriptionHighLevel.ToList(); + + await IncludeAsync("HighLevel/Descriptors/XmlDocs.cshtml", desc); + if(!string.IsNullOrWhiteSpace(param.Obsolete)) + { + + [Obsolete("Scheduled to be removed in 8.0, @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..51ee81f6e7 --- /dev/null +++ b/src/ApiGenerator/Views/HighLevel/Descriptors/Descriptors.cshtml @@ -0,0 +1,38 @@ +@using System.Collections.Generic +@using System.Collections.ObjectModel +@using ApiGenerator +@using ApiGenerator.Domain.Specification +@using ApiGenerator.Domain.Code +@inherits CodeTemplatePage>> +@{ + KeyValuePair> model = Model; + string ns = model.Key != CsharpNames.RootNamespace ? "."+CsharpNames.ApiNamespace+"." + model.Key + CsharpNames.ApiNamespaceSuffix : null; + var endpoints = model.Value; +} +@{ await IncludeAsync("GeneratorNotice.cshtml", Model); } +// 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 (model.Key != CsharpNames.RootNamespace) +{ + 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); +} +} \ No newline at end of file diff --git a/src/ApiGenerator/Views/HighLevel/Descriptors/RequestDescriptorBase.cshtml b/src/ApiGenerator/Views/HighLevel/Descriptors/RequestDescriptorBase.cshtml new file mode 100644 index 0000000000..281bf02f27 --- /dev/null +++ b/src/ApiGenerator/Views/HighLevel/Descriptors/RequestDescriptorBase.cshtml @@ -0,0 +1,26 @@ +@using ApiGenerator.Domain +@inherits ApiGenerator.CodeTemplatePage +using System.Collections.Generic; + +namespace OpenSearch.Client +{ + // ReSharper disable UnusedTypeParameter + public abstract partial class @Raw("RequestDescriptorBase") + { +@foreach (var common in RestApiSpec.CommonApiQueryParameters.Values) +{ + var original = common.QueryStringKey; + var t = @common.TypeHighLevel; + var tSuffix = (t == "bool" || t == "bool?") ? " = true" : ""; + ///@(Raw(string.Join("", common.DescriptionHighLevel))) + public TDescriptor @(common.ClsName)(@common.DescriptorArgumentType @common.ClsArgumentName@tSuffix) => Qs("@original", @(common.ClsArgumentName)); + + if (common.IsArray) + { + ///@(Raw(string.Join("", common.DescriptionHighLevel))) + public TDescriptor @(common.ClsName)(@Raw(common.DescriptorEnumerableArgumentType) @common.ClsArgumentName@tSuffix) => Qs("@original", @(common.ClsArgumentName)); + + } +} + } +} diff --git a/src/ApiGenerator/Views/HighLevel/Descriptors/XmlDocs.cshtml b/src/ApiGenerator/Views/HighLevel/Descriptors/XmlDocs.cshtml new file mode 100644 index 0000000000..ded98d8e91 --- /dev/null +++ b/src/ApiGenerator/Views/HighLevel/Descriptors/XmlDocs.cshtml @@ -0,0 +1,19 @@ +@using System +@using System.Linq +@using System.Collections.Generic +@inherits ApiGenerator.CodeTemplatePage> +@{ + List summary = Model; + var description = summary.Count == 1 ? summary.First() : string.Join($"{Environment.NewLine}\t\t", summary.Select(d => "/// " + d)); + if (summary.Count == 1) + { + ///@Raw(description) + } + else + { + /// + @Raw(description) + /// + + } +} diff --git a/src/ApiGenerator/Views/HighLevel/Requests/ApiUrlsLookup.cshtml b/src/ApiGenerator/Views/HighLevel/Requests/ApiUrlsLookup.cshtml new file mode 100644 index 0000000000..9f2e38ffc7 --- /dev/null +++ b/src/ApiGenerator/Views/HighLevel/Requests/ApiUrlsLookup.cshtml @@ -0,0 +1,27 @@ +@using System.Linq +@using ApiGenerator.Domain +@using ApiGenerator +@using ApiGenerator.Configuration +@inherits CodeTemplatePage +@{ + RestApiSpec m = Model; +} +@{ await IncludeAsync("GeneratorNotice.cshtml", m); } +namespace OpenSearch.Client +{ + internal static class ApiUrlsLookups + { +@foreach (var endpoint in m.Endpoints.Values) +{ + if (CodeConfiguration.IgnoreHighLevelApi(endpoint.Name)) + { + continue; + } + var propertyName = $"{endpoint.CsharpNames.Namespace}{endpoint.CsharpNames.MethodName}"; + var paths = endpoint.Url.Paths.Count == 0 ? endpoint.Url.PathsWithDeprecations : endpoint.Url.Paths; + + internal static ApiUrls @(Raw(propertyName)) = new ApiUrls(new [] {@Raw(string.Join(", ", paths.Select(p=>$"\"{p.Path.TrimStart('/')}\"")))}); + +} + } +} \ No newline at end of file diff --git a/src/ApiGenerator/Views/HighLevel/Requests/PlainRequestBase.cshtml b/src/ApiGenerator/Views/HighLevel/Requests/PlainRequestBase.cshtml new file mode 100644 index 0000000000..f9cadb9648 --- /dev/null +++ b/src/ApiGenerator/Views/HighLevel/Requests/PlainRequestBase.cshtml @@ -0,0 +1,27 @@ +@using System.Linq +@using ApiGenerator.Domain +@inherits ApiGenerator.CodeTemplatePage +@{ await IncludeAsync("GeneratorNotice.cshtml", Model); } +// 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") + { +@foreach (var common in RestApiSpec.CommonApiQueryParameters.Values) +{ + @Raw(common.InitializerGenerator(null, common.TypeHighLevel, common.ClsName, common.QueryStringKey, "value", common.DescriptionHighLevel.ToArray())) + +} + } +} diff --git a/src/ApiGenerator/Views/HighLevel/Requests/RequestImplementations.cshtml b/src/ApiGenerator/Views/HighLevel/Requests/RequestImplementations.cshtml new file mode 100644 index 0000000000..a16e7cf4f1 --- /dev/null +++ b/src/ApiGenerator/Views/HighLevel/Requests/RequestImplementations.cshtml @@ -0,0 +1,86 @@ +@using System.Linq +@using ApiGenerator.Domain.Code +@using ApiGenerator.Domain.Code.HighLevel.Requests +@using ApiGenerator.Domain.Specification +@using ApiGenerator.Generator +@using CsQuery.ExtensionMethods.Internal +@inherits global::ApiGenerator.CodeTemplatePage +@{ + RequestPartialImplementation r = Model; + CsharpNames names = r.CsharpNames; + var apiLookup = $"ApiUrlsLookups.{r.CsharpNames.Namespace}{r.CsharpNames.MethodName}"; +} +///Request for @names.MethodName@Raw(r.OfficialDocumentationLink.IsNullOrEmpty() ? "" : " " + r.OfficialDocumentationLink + "") +@if (r.Stability != Stability.Stable) +{ + string warningMessage = ""; + switch (r.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: " + r.Stability + " within the OpenSearch server, " + warningMessage + "") + +} + public partial class @Raw(r.Name) @Raw(string.Format(": PlainRequestBase<{0}>, {1}", names.ParametersName, r.InterfaceName)) + { + protected @(Raw(r.InterfaceName)) Self => this; + internal override ApiUrls ApiUrls => @apiLookup; +@foreach (Constructor c in r.Constructors) +{ + @(Raw(CodeGenerator.Constructor(c))) + +} + // values part of the url path +@foreach (var part in r.Parts) +{ + [IgnoreDataMember] + @(Raw(part.HighLevelTypeName)) @(Raw(r.InterfaceName)).@(part.InterfaceName) => Self.RouteValues.Get@(Raw(string.Format("<{0}>", part.HighLevelTypeName)))("@(part.Name)"); + +} + + // Request parameters +@foreach (var param in r.Params) +{ + var original = param.QueryStringKey; + //skip parameters already part of the path portion of the url + if (r.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 && (r.HasBody)) + { + continue; + } + var doc = param.DescriptionHighLevel.ToArray(); + @Raw(param.InitializerGenerator(r.CsharpNames.Namespace, param.TypeHighLevel, param.ClsName, original, param.SetterHighLevel, doc)) + +} +@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; + +} + } +@if (r.NeedsGenericImplementation) + { + public partial class @Raw(names.GenericRequestName) @Raw(string.Format(": {0}, {1}", names.RequestName, names.GenericInterfaceName)) + { + protected @(Raw(names.GenericInterfaceName)) TypedSelf => this; +@foreach (Constructor c in r.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..ad5642216b --- /dev/null +++ b/src/ApiGenerator/Views/HighLevel/Requests/RequestInterface.cshtml @@ -0,0 +1,27 @@ +@using ApiGenerator.Domain.Code.HighLevel.Requests +@using ApiGenerator.Domain.Specification +@inherits ApiGenerator.CodeTemplatePage +@{ + RequestInterface i = Model; + string name = i.CsharpNames.RequestInterfaceName; +} + [InterfaceDataContract] + public partial interface @(Raw(i.Name)) : IRequest@(Raw(string.Format("<{0}>", i.CsharpNames.ParametersName))) + { +@foreach (UrlPart part in i.UrlParts) +{ + [IgnoreDataMember] + @(Raw(part.HighLevelTypeName)) @(part.InterfaceName) { get; } + +} +@foreach (var partialParam in i.PartialParameters) +{ + [DataMember(Name = "@(partialParam.QueryStringKey)")] @(Raw(partialParam.TypeHighLevel)) @(partialParam.ClsName) { get; set; } +} + } +@if (i.NeedsGenericInterface) +{ + + public partial interface @(name)@(Raw(i.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..e55ea5a1ee --- /dev/null +++ b/src/ApiGenerator/Views/HighLevel/Requests/Requests.cshtml @@ -0,0 +1,39 @@ +@using System.Collections.Generic +@using System.Collections.ObjectModel +@using ApiGenerator +@using ApiGenerator.Domain.Specification +@using ApiGenerator.Domain.Code +@inherits CodeTemplatePage>> +@{ + KeyValuePair> model = Model; + string ns = model.Key != CsharpNames.RootNamespace ? "."+CsharpNames.ApiNamespace+"." + model.Key + CsharpNames.ApiNamespaceSuffix : null; + var endpoints = model.Value; +} +@{ await IncludeAsync("GeneratorNotice.cshtml", Model); } +// 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 (model.Key != CsharpNames.RootNamespace) +{ + 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); +} +} \ No newline at end of file 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..9ec2f9c3a1 --- /dev/null +++ b/src/ApiGenerator/Views/LowLevel/Client/Implementation/OpenSearchLowLevelClient.Namespace.cshtml @@ -0,0 +1,52 @@ +@using System.Collections.Generic +@using System.Collections.ObjectModel +@using System.Linq +@using ApiGenerator +@using ApiGenerator.Domain.Code +@using ApiGenerator.Domain.Specification +@inherits CodeTemplatePage>> +@{ await IncludeAsync("GeneratorNotice.cshtml", Model); } +@{ + KeyValuePair> model = Model; + string ns = model.Key; + var endpoints = model.Value; +} +// 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)@(model.Key)@(CsharpNames.ClientNamespaceSuffix) : NamespacedClientProxy + { + internal @(CsharpNames.LowLevelClientNamespacePrefix)@(model.Key)@(CsharpNames.ClientNamespaceSuffix)(OpenSearchLowLevelClient client) : base(client) {} +@if (ns == "Cat") +{ + protected override string ContentType { get; } = "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..a4ce6b2159 --- /dev/null +++ b/src/ApiGenerator/Views/LowLevel/Client/Implementation/OpenSearchLowLevelClient.cshtml @@ -0,0 +1,69 @@ +@using System.Linq +@using ApiGenerator.Domain +@using ApiGenerator +@using ApiGenerator.Domain.Code +@inherits CodeTemplatePage +@{ await IncludeAsync("GeneratorNotice.cshtml", 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; +@{ await IncludeAsync("LowLevel/Client/Usings.cshtml", Model);} +using static OpenSearch.Net.HttpMethod; + +@{ + RestApiSpec model = Model; + var namespaces = model.EndpointsPerNamespaceLowLevel.Keys.Where(k => k != CsharpNames.RootNamespace).ToList(); + +// 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 SetupNamespaces() + { + + foreach (var ns in namespaces) + { + @ns = new @(CsharpNames.LowLevelClientNamespacePrefix)@(ns)@(CsharpNames.ClientNamespaceSuffix)(this); + + } + + } + + + + foreach (var kv in model.EndpointsPerNamespaceLowLevel) + { + if (kv.Key != CsharpNames.RootNamespace) + { + continue; + } + var endpoints = kv.Value; + 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/Interface/IOpenSearchLowLevelClient.cshtml b/src/ApiGenerator/Views/LowLevel/Client/Interface/IOpenSearchLowLevelClient.cshtml new file mode 100644 index 0000000000..beadac4ff0 --- /dev/null +++ b/src/ApiGenerator/Views/LowLevel/Client/Interface/IOpenSearchLowLevelClient.cshtml @@ -0,0 +1,43 @@ +@using System.Linq +@using ApiGenerator +@using ApiGenerator.Domain +@using ApiGenerator.Domain.Code +@inherits ApiGenerator.CodeTemplatePage +@{ await IncludeAsync("GeneratorNotice.cshtml", 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; +@{ await IncludeAsync("LowLevel/Client/Usings.cshtml", Model);} + +namespace OpenSearch.Net +{ + /// + ///OpenSearch low level client + /// + public partial interface IOpenSearchLowLevelClient + { + @foreach(var kv in Model.EndpointsPerNamespaceLowLevel) + { + if (kv.Key != CsharpNames.RootNamespace) + { + + ///@(kv.Key.SplitPascalCase()) APIs + @CsharpNames.LowLevelClientNamespacePrefix@(kv.Key)@CsharpNames.ClientNamespaceSuffix @kv.Key { get; } + + continue; + } + var endpoints = kv.Value; + var methods = endpoints.SelectMany(e=>e.LowLevelClientMethods).ToList(); + foreach(var method in methods) + { + await IncludeAsync("LowLevel/Client/Methods/MethodInterface.cshtml", method); + } + } + } +} 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..0ec26f8228 --- /dev/null +++ b/src/ApiGenerator/Views/LowLevel/Client/Methods/MethodDocs.cshtml @@ -0,0 +1,36 @@ +@using ApiGenerator.Domain.Code.LowLevel +@using ApiGenerator.Domain.Specification +@using CsQuery.ExtensionMethods.Internal +@inherits ApiGenerator.CodeTemplatePage +@{ + LowLevelClientMethod method = Model; +} + ///@method.HttpMethod on @method.Path@Raw(method.OfficialDocumentationLink.IsNullOrEmpty() ? "" : " " + method.OfficialDocumentationLink + "") +@foreach (var part in method.Parts) +{ + ///@Raw("")@part.Description@Raw("") + +} + ///@Raw(@"Request specific configuration such as querystring parameters & request specific connection settings.") + @if (method.Stability != Stability.Stable) + { + string warningMessage = ""; + switch (method.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: " + method.Stability + " within the OpenSearch server, " + warningMessage + "") + + } + @if (method.DeprecatedPath != null) + { + [Obsolete("Deprecated in version @(method.DeprecatedPath.Version): @Raw(method.DeprecatedPath.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..211a1f5dc8 --- /dev/null +++ b/src/ApiGenerator/Views/LowLevel/Client/Methods/MethodImplementation.cshtml @@ -0,0 +1,14 @@ +@using ApiGenerator.Domain.Code.LowLevel +@inherits ApiGenerator.CodeTemplatePage +@{ + LowLevelClientMethod method = Model; + var contentType = method.CsharpNames.RestSpecName.Contains(".cat_") ? ", contentType: \"text/plain\"" : string.Empty; +} +@{await IncludeAsync("LowLevel/Client/Methods/MethodDocs.cshtml", method); } + public TResponse @(method.PerPathMethodName)@(Raw(""))(@Raw(method.Arguments)) + where TResponse : class, IOpenSearchResponse, new() => DoRequest@(Raw(""))(@method.HttpMethod, @Raw(method.UrlInCode), @(method.HasBody ? "body" : "null"), RequestParams(requestParameters@(Raw(contentType)))); + +@{await IncludeAsync("LowLevel/Client/Methods/MethodDocs.cshtml", method); } + [MapsApi("@(method.CsharpNames.RestSpecName)", "@(method.MapsApiArguments)")] + public Task@(Raw("")) @(method.PerPathMethodName)Async@(Raw(""))(@Raw(method.Arguments), CancellationToken ctx = default) + where TResponse : class, IOpenSearchResponse, new() => DoRequestAsync@(Raw(""))(@method.HttpMethod, @Raw(method.UrlInCode), ctx, @(method.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..be8bef61ae --- /dev/null +++ b/src/ApiGenerator/Views/LowLevel/Client/Methods/MethodInterface.cshtml @@ -0,0 +1,10 @@ +@using ApiGenerator.Domain.Code.LowLevel +@inherits ApiGenerator.CodeTemplatePage +@{ + LowLevelClientMethod method = Model; +} +@{await IncludeAsync("LowLevel/Client/Methods/MethodDocs.cshtml", method); } + TResponse @(method.PerPathMethodName)@(Raw(""))(@Raw(method.Arguments)) where TResponse : class, IOpenSearchResponse, new(); + +@{await IncludeAsync("LowLevel/Client/Methods/MethodDocs.cshtml", method); } + Task@(Raw("")) @(method.PerPathMethodName)Async@(Raw(""))(@Raw(method.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..3222da33a8 --- /dev/null +++ b/src/ApiGenerator/Views/LowLevel/Client/Usings.cshtml @@ -0,0 +1,11 @@ +@using ApiGenerator.Domain +@using ApiGenerator.Domain.Code +@inherits ApiGenerator.CodeTemplatePage +@foreach(var kv in Model.EndpointsPerNamespaceLowLevel) +{ + if (kv.Key != CsharpNames.RootNamespace) + { +using OpenSearch.Net.@(CsharpNames.ApiNamespace).@(kv.Key)@(CsharpNames.ApiNamespaceSuffix); + + } +} diff --git a/src/ApiGenerator/Views/LowLevel/Enums.Generated.cshtml b/src/ApiGenerator/Views/LowLevel/Enums.Generated.cshtml new file mode 100644 index 0000000000..d669011d30 --- /dev/null +++ b/src/ApiGenerator/Views/LowLevel/Enums.Generated.cshtml @@ -0,0 +1,173 @@ +@using System +@using System.Linq +@using System.Text +@using ApiGenerator.Domain +@using ApiGenerator +@using ApiGenerator.Configuration.Overrides +@inherits CodeTemplatePage +@{ await IncludeAsync("GeneratorNotice.cshtml", Model); } +@functions { + private const string RawSize = "Raw"; + private const string SizeEnum = "Size"; + private static GlobalOverrides GlobalOverrides = new GlobalOverrides(); + + 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.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.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 (EnumDescription 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 class KnownEnums + { + private static readonly @(Raw("ConcurrentDictionary>")) EnumStringResolvers = new @(Raw("ConcurrentDictionary>"))(); + + static KnownEnums() + { + @foreach (EnumDescription e in Model.EnumsInTheSpec) + { + EnumStringResolvers.TryAdd(typeof(@(e.Name)), (e) => GetStringValue((@(e.Name))e)); + + } + } + + private class EnumDictionary : @(Raw("Dictionary")) + { + public EnumDictionary(int capacity) : base(capacity) {} + public @(Raw("Func")) Resolver { get; set; } + } + + @foreach (EnumDescription 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.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)'"); + } + } + } + + public static string GetStringValue(this Enum e) + { + var type = e.GetType(); + var resolver = EnumStringResolvers.GetOrAdd(type, GetEnumStringResolver); + return resolver(e); + } + + private static @Raw("Func") GetEnumStringResolver(Type type) + { + var values = Enum.GetValues(type); + var dictionary = new EnumDictionary(values.Length); + + for (int index = 0; index < values.Length; index++) + { + var value = values.GetValue(index); + var info = type.GetField(value.ToString()); + var da = (EnumMemberAttribute[])info.GetCustomAttributes(typeof(EnumMemberAttribute), false); + var stringValue = da.Length > 0 ? da[0].Value : Enum.GetName(type, value); + dictionary.Add((Enum)value, stringValue); + } + + var isFlag = type.GetCustomAttributes(typeof(FlagsAttribute), false).Length > 0; + + return (e) => + { + if (isFlag) + { + var list = new @(Raw("List()")); + foreach(var kv in dictionary) + { + if (e.HasFlag(kv.Key)) list.Add(kv.Value); + } + return string.Join(",", list); + } + else + { + return dictionary[e]; + } + }; + } + } +} \ No newline at end of file diff --git a/src/ApiGenerator/Views/LowLevel/RequestParameters/RequestParameters.cshtml b/src/ApiGenerator/Views/LowLevel/RequestParameters/RequestParameters.cshtml new file mode 100644 index 0000000000..2e54e83140 --- /dev/null +++ b/src/ApiGenerator/Views/LowLevel/RequestParameters/RequestParameters.cshtml @@ -0,0 +1,43 @@ +@using System.Collections.Generic +@using System.Collections.ObjectModel +@using ApiGenerator +@using ApiGenerator.Domain.Code +@using ApiGenerator.Domain.Specification +@using CsQuery.ExtensionMethods.Internal +@inherits CodeTemplatePage>> +@{ await IncludeAsync("GeneratorNotice.cshtml", Model); } +@{ + KeyValuePair> model = Model; + string ns = model.Key != CsharpNames.RootNamespace ? "."+CsharpNames.ApiNamespace+"." + model.Key + CsharpNames.ApiNamespaceSuffix : null; + var endpoints = model.Value; +} + +// 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 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.Description)) + + } + } + } +} \ No newline at end of file diff --git a/src/ApiGenerator/packages.lock.json b/src/ApiGenerator/packages.lock.json new file mode 100644 index 0000000000..623306d514 --- /dev/null +++ b/src/ApiGenerator/packages.lock.json @@ -0,0 +1,470 @@ +{ + "version": 1, + "dependencies": { + "net6.0": { + "CsQuery.Core": { + "type": "Direct", + "requested": "[2.0.1, )", + "resolved": "2.0.1", + "contentHash": "JQvgD0jBnO6M3r7SGrDfdpCak6E9ZP1hQb3T8iegkXiCs3A1JawE5TWD6q49MPY4arqVegtsB3th6J+lOXZkxA==", + "dependencies": { + "Microsoft.CSharp": "4.4.1", + "Newtonsoft.Json": "11.0.2" + } + }, + "Microsoft.CodeAnalysis.CSharp": { + "type": "Direct", + "requested": "[4.2.0, )", + "resolved": "4.2.0", + "contentHash": "5IDwr8zGNBmDpxtzxxZj9IHwoA6HJ1/WWT/JacqPQJ4Vz/oZXaHNlzcBPVCZRGWUw+QvVdAhCKwEyJyuAuH/wg==", + "dependencies": { + "Microsoft.CodeAnalysis.Common": "[4.2.0]" + } + }, + "Microsoft.NETFramework.ReferenceAssemblies": { + "type": "Direct", + "requested": "[1.0.3, )", + "resolved": "1.0.3", + "contentHash": "vUc9Npcs14QsyOD01tnv/m8sQUnGTGOw1BCmKcv77LBJY7OxhJ+zJF7UD/sCL3lYNFuqmQEVlkfS4Quif6FyYg==", + "dependencies": { + "Microsoft.NETFramework.ReferenceAssemblies.net461": "1.0.3" + } + }, + "Newtonsoft.Json": { + "type": "Direct", + "requested": "[13.0.1, )", + "resolved": "13.0.1", + "contentHash": "ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==" + }, + "RazorLight": { + "type": "Direct", + "requested": "[2.1.0, )", + "resolved": "2.1.0", + "contentHash": "WUJUsOJXUXrRpMrlWunn2QsOigF07S+lP2QxuOEBlfswDtuO4SAGaL97tOn0Hq24lMNqR4SWepOMj4Rlx+OfsQ==", + "dependencies": { + "Microsoft.AspNetCore.Mvc.Razor.Extensions": "6.0.0", + "Microsoft.CodeAnalysis.Razor": "6.0.0", + "Microsoft.Extensions.Caching.Abstractions": "6.0.0", + "Microsoft.Extensions.Caching.Memory": "6.0.0", + "Microsoft.Extensions.DependencyInjection": "6.0.0", + "Microsoft.Extensions.DependencyModel": "6.0.0", + "Microsoft.Extensions.FileProviders.Physical": "6.0.0", + "Microsoft.Extensions.Primitives": "6.0.0", + "System.Buffers": "4.5.1" + } + }, + "ShellProgressBar": { + "type": "Direct", + "requested": "[5.2.0, )", + "resolved": "5.2.0", + "contentHash": "XwR9OG00J837mtAXlHIeaJX93di6ZqPUwQLRXTLxyjDiAsytuZDKWELjeDXpWTQCzKsq+oZVhIeK8SN3ubYTwg==", + "dependencies": { + "System.Runtime.InteropServices.RuntimeInformation": "4.3.0", + "System.Text.Encoding.CodePages": "4.0.1" + } + }, + "Spectre.Console": { + "type": "Direct", + "requested": "[0.30.0, )", + "resolved": "0.30.0", + "contentHash": "7UG9p43sEJ2IjPuzkFNCE8zWmV1OOE0Kwh1jlJXv8/dzEADmWImzt9q868FCQ1ny5mDhNIkrZ3mfy2zxMSDagQ==", + "dependencies": { + "Wcwidth": "0.2.0" + } + }, + "System.CommandLine.DragonFruit": { + "type": "Direct", + "requested": "[0.3.0-alpha.20371.2, )", + "resolved": "0.3.0-alpha.20371.2", + "contentHash": "qLGFosjzbv/jzc3AnN5EgI88ODGGgGzcDQ5H9mt8j+boIVk+Sd9QwkGYw017A0lVT6pEgPXq3j/sLg5HmbtdeA==", + "dependencies": { + "System.CommandLine": "2.0.0-beta1.20371.2", + "System.CommandLine.Rendering": "0.3.0-alpha.20371.2" + } + }, + "System.Text.Encodings.Web": { + "type": "Direct", + "requested": "[7.0.0, )", + "resolved": "7.0.0", + "contentHash": "OP6umVGxc0Z0MvZQBVigj4/U31Pw72ITihDWP9WiWDm+q5aoe0GaJivsfYGq53o6dxH7DcXWiCTl7+0o2CGdmg==", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + } + }, + "Microsoft.AspNetCore.Mvc.Razor.Extensions": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "M0h+ChPgydX2xY17agiphnAVa/Qh05RAP8eeuqGGhQKT10claRBlLNO6d2/oSV8zy0RLHzwLnNZm5xuC/gckGA==", + "dependencies": { + "Microsoft.AspNetCore.Razor.Language": "6.0.0", + "Microsoft.CodeAnalysis.Razor": "6.0.0" + } + }, + "Microsoft.AspNetCore.Razor.Language": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "yCtBr1GSGzJrrp1NJUb4ltwFYMKHw/tJLnIDvg9g/FnkGIEzmE19tbCQqXARIJv5kdtBgsoVIdGLL+zmjxvM/A==" + }, + "Microsoft.CodeAnalysis.Analyzers": { + "type": "Transitive", + "resolved": "3.3.3", + "contentHash": "j/rOZtLMVJjrfLRlAMckJLPW/1rze9MT1yfWqSIbUPGRu1m1P0fuo9PmqapwsmePfGB5PJrudQLvmUOAMF0DqQ==" + }, + "Microsoft.CodeAnalysis.Common": { + "type": "Transitive", + "resolved": "4.2.0", + "contentHash": "lbusGcuE7D8FtZawQ4G++UFsRQArPzZN1GGXjPQwu3gvCbw7FXDcBq1zDZrZN1vRzPTVe1qyZMvfGhVUzs1TDg==", + "dependencies": { + "Microsoft.CodeAnalysis.Analyzers": "3.3.3", + "System.Collections.Immutable": "5.0.0", + "System.Memory": "4.5.4", + "System.Reflection.Metadata": "5.0.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Text.Encoding.CodePages": "6.0.0", + "System.Threading.Tasks.Extensions": "4.5.4" + } + }, + "Microsoft.CodeAnalysis.Razor": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "uqdzuQXxD7XrJCbIbbwpI/LOv0PBJ9VIR0gdvANTHOfK5pjTaCir+XcwvYvBZ5BIzd0KGzyiamzlEWw1cK1q0w==", + "dependencies": { + "Microsoft.AspNetCore.Razor.Language": "6.0.0", + "Microsoft.CodeAnalysis.CSharp": "4.0.0", + "Microsoft.CodeAnalysis.Common": "4.0.0" + } + }, + "Microsoft.CSharp": { + "type": "Transitive", + "resolved": "4.4.1", + "contentHash": "A5hI3gk6WpcBI0QGZY6/d5CCaYUxJgi7iENn1uYEng+Olo8RfI5ReGVkjXjeu3VR3srLvVYREATXa2M0X7FYJA==" + }, + "Microsoft.Extensions.Caching.Abstractions": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "bcz5sSFJbganH0+YrfvIjJDIcKNW7TL07C4d1eTmXy/wOt52iz4LVogJb6pazs7W0+74j0YpXFErvp++Aq5Bsw==", + "dependencies": { + "Microsoft.Extensions.Primitives": "6.0.0" + } + }, + "Microsoft.Extensions.Caching.Memory": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "Ve3BlCzhAlVp5IgO3+8dacAhZk1A0GlIlFNkAcfR2TfAibLKWIt5DhVJZfu4YtW+XZ89OjYf/agMcgjDtPxdGA==", + "dependencies": { + "Microsoft.Extensions.Caching.Abstractions": "6.0.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", + "Microsoft.Extensions.Logging.Abstractions": "6.0.0", + "Microsoft.Extensions.Options": "6.0.0", + "Microsoft.Extensions.Primitives": "6.0.0" + } + }, + "Microsoft.Extensions.DependencyInjection": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "k6PWQMuoBDGGHOQTtyois2u4AwyVcIwL2LaSLlTZQm2CYcJ1pxbt6jfAnpWmzENA/wfrYRI/X9DTLoUkE4AsLw==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + } + }, + "Microsoft.Extensions.DependencyInjection.Abstractions": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "xlzi2IYREJH3/m6+lUrQlujzX8wDitm4QGnUu6kUXTQAWPuZY8i+ticFJbzfqaetLA6KR/rO6Ew/HuYD+bxifg==" + }, + "Microsoft.Extensions.DependencyModel": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "TD5QHg98m3+QhgEV1YVoNMl5KtBw/4rjfxLHO0e/YV9bPUBDKntApP4xdrVtGgCeQZHVfC2EXIGsdpRNrr87Pg==", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.4", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Text.Encodings.Web": "6.0.0", + "System.Text.Json": "6.0.0" + } + }, + "Microsoft.Extensions.FileProviders.Abstractions": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "0pd4/fho0gC12rQswaGQxbU34jOS1TPS8lZPpkFCH68ppQjHNHYle9iRuHeev1LhrJ94YPvzcRd8UmIuFk23Qw==", + "dependencies": { + "Microsoft.Extensions.Primitives": "6.0.0" + } + }, + "Microsoft.Extensions.FileProviders.Physical": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "QvkL7l0nM8udt3gfyu0Vw8bbCXblxaKOl7c2oBfgGy4LCURRaL9XWZX1FWJrQc43oMokVneVxH38iz+bY1sbhg==", + "dependencies": { + "Microsoft.Extensions.FileProviders.Abstractions": "6.0.0", + "Microsoft.Extensions.FileSystemGlobbing": "6.0.0", + "Microsoft.Extensions.Primitives": "6.0.0" + } + }, + "Microsoft.Extensions.FileSystemGlobbing": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "ip8jnL1aPiaPeKINCqaTEbvBFDmVx9dXQEBZ2HOBRXPD1eabGNqP/bKlsIcp7U2lGxiXd5xIhoFcmY8nM4Hdiw==" + }, + "Microsoft.Extensions.Logging.Abstractions": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "/HggWBbTwy8TgebGSX5DBZ24ndhzi93sHUBDvP1IxbZD7FDokYzdAr6+vbWGjw2XAfR2EJ1sfKUotpjHnFWPxA==" + }, + "Microsoft.Extensions.Options": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "dzXN0+V1AyjOe2xcJ86Qbo233KHuLEY0njf/P2Kw8SfJU+d45HNS2ctJdnEnrWbM9Ye2eFgaC5Mj9otRMU6IsQ==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", + "Microsoft.Extensions.Primitives": "6.0.0" + } + }, + "Microsoft.Extensions.Primitives": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "9+PnzmQFfEFNR9J2aDTfJGGupShHjOuGw4VUv+JB044biSHrnmCIMD+mJHmb2H7YryrfBEXDurxQ47gJZdCKNQ==", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + } + }, + "Microsoft.NETCore.Platforms": { + "type": "Transitive", + "resolved": "1.1.0", + "contentHash": "kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==" + }, + "Microsoft.NETCore.Targets": { + "type": "Transitive", + "resolved": "1.1.0", + "contentHash": "aOZA3BWfz9RXjpzt0sRJJMjAscAUm3Hoa4UWAfceV9UTYxgwZ1lZt5nO2myFf+/jetYQo4uTP7zS8sJY67BBxg==" + }, + "Microsoft.NETFramework.ReferenceAssemblies.net461": { + "type": "Transitive", + "resolved": "1.0.3", + "contentHash": "AmOJZwCqnOCNp6PPcf9joyogScWLtwy0M1WkqfEQ0M9nYwyDD7EX9ZjscKS5iYnyvteX7kzSKFCKt9I9dXA6mA==" + }, + "runtime.native.System": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "c/qWt2LieNZIj1jGnVNsE2Kl23Ya2aSTBuXMD6V7k9KWr6l16Tqdwq+hJScEpWER9753NWC8h96PaVNY5Ld7Jw==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0" + } + }, + "System.Buffers": { + "type": "Transitive", + "resolved": "4.5.1", + "contentHash": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==" + }, + "System.Collections.Immutable": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "FXkLXiK0sVVewcso0imKQoOxjoPAj42R8HtjjbSjVPAzwDfzoyoznWxgA3c38LDbN9SJux1xXoXYAhz98j7r2g==" + }, + "System.CommandLine": { + "type": "Transitive", + "resolved": "2.0.0-beta1.20371.2", + "contentHash": "L6cnw4QgaLAOpUPSW1TjYGJGKsUvyDYvdQ/Gqv0/EnOSzByEf+IlAK1sRu+bcAhBrdws+eNPcOarg1Qj33oNDA==", + "dependencies": { + "Microsoft.CSharp": "4.4.1", + "system.memory": "4.5.4" + } + }, + "System.CommandLine.Rendering": { + "type": "Transitive", + "resolved": "0.3.0-alpha.20371.2", + "contentHash": "Giz/HUeNkosCnf1vkqHSTlbKGXIpthihn1ZDh2ZbwM3AOYGwv+ZOrgy/z9y3NNh3TCNyutHRf+c2Awg5TO27pA==", + "dependencies": { + "System.CommandLine": "2.0.0-beta1.20371.2" + } + }, + "System.Globalization": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "kYdVd2f2PAdFGblzFswE4hkNANJBKRmsfa2X5LG2AcWE1c7/4t0pYae1L8vfZ5xvE2nK/R9JprtToA61OSHWIg==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Runtime": "4.3.0" + } + }, + "System.IO": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "3qjaHvxQPDpSOYICjUoTsmoq5u6QJAFRUITgeT/4gqkF1bajbSmb1kwSxEA8AHlofqgcKJcM8udgieRNhaJ5Cg==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Runtime": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.Memory": { + "type": "Transitive", + "resolved": "4.5.4", + "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==" + }, + "System.Reflection": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "KMiAFoW7MfJGa9nDFNcfu+FpEdiHpWgTcS2HdMpDvt9saK3y/G4GwprPyzqjFH9NTaGPQeWNHU+iDlDILj96aQ==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0", + "System.IO": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Extensions": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "rJkrJD3kBI5B712aRu4DpSIiHRtr6QlfZSQsb0hYHrDCZORXCFjQfoipo2LaMUHoT9i1B7j7MnfaEKWDFmFQNQ==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Metadata": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "5NecZgXktdGg34rh1OenY1rFNDCI8xSjFr+Z4OU4cU06AQHUdRnIIEeWENu3Wl4YowbzkymAIMvi3WyK9U53pQ==" + }, + "System.Reflection.Primitives": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "5RXItQz5As4xN2/YUDxdpsEkMhvw3e6aNveFXUn4Hl/udNTCNhnKp8lT9fnc3MhvGKh1baak5CovpuQUXHAlIA==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Runtime": "4.3.0" + } + }, + "System.Resources.ResourceManager": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "/zrcPkkWdZmI4F92gL/TPumP98AVDu/Wxr3CSJGQQ+XN6wbRZcyfSKVoPo17ilb3iOr0cCRqJInGwNMolqhS8A==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Globalization": "4.3.0", + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "JufQi0vPQ0xGnAczR13AUFglDyVYt4Kqnz1AZaiKZ5+GICq0/1MH/mO/eAJHt/mHW1zjKBJd7kV26SrxddAhiw==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0" + } + }, + "System.Runtime.CompilerServices.Unsafe": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg==" + }, + "System.Runtime.Handles": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "OKiSUN7DmTWeYb3l51A7EYaeNMnvxwE249YtZz7yooT4gOZhmTjIn48KgSsw2k2lYdLgTKNJw/ZIfSElwDRVgg==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime.InteropServices": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "uv1ynXqiMK8mp1GM3jDqPCFN66eJ5w5XNomaK2XD+TuCroNTLFGeZ+WCmBMcBDyTFKou3P6cR6J/QsaqDp7fGQ==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Reflection": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0" + } + }, + "System.Runtime.InteropServices.RuntimeInformation": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "cbz4YJMqRDR7oLeMRbdYv7mYzc++17lNhScCX0goO2XpGWdvAt60CGN+FHdePUEHCe/Jy9jUlvNAiNdM+7jsOw==", + "dependencies": { + "System.Reflection": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Threading": "4.3.0", + "runtime.native.System": "4.3.0" + } + }, + "System.Text.Encoding": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "BiIg+KWaSDOITze6jGQynxg64naAPtqGHBwDrLaCtixsa5bKiR8dpPOHA7ge3C0JJQizJE+sfkz1wV+BAKAYZw==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Runtime": "4.3.0" + } + }, + "System.Text.Encoding.CodePages": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "ZFCILZuOvtKPauZ/j/swhvw68ZRi9ATCfvGbk1QfydmcXBkIWecWKn/250UH7rahZ5OoDBaiAudJtPvLwzw85A==", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + } + }, + "System.Text.Json": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "zaJsHfESQvJ11vbXnNlkrR46IaMULk/gHxYsJphzSF+07kTjPHv+Oc14w6QEOfo3Q4hqLJgStUaYB9DBl0TmWg==", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Text.Encodings.Web": "6.0.0" + } + }, + "System.Threading": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "VkUS0kOBcUf3Wwm0TSbrevDDZ6BlM+b/HRiapRFWjM5O0NS0LviG0glKmFK+hhPDd1XFeSdU1GmlLhb2CoVpIw==", + "dependencies": { + "System.Runtime": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.Threading.Tasks": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "LbSxKEdOUhVe8BezB/9uOGGppt+nZf6e1VFyw6v3DN6lqitm0OSn2uXMOdtP0M3W4iMcqcivm2J6UgqiwwnXiA==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Runtime": "4.3.0" + } + }, + "System.Threading.Tasks.Extensions": { + "type": "Transitive", + "resolved": "4.5.4", + "contentHash": "zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==" + }, + "Wcwidth": { + "type": "Transitive", + "resolved": "0.2.0", + "contentHash": "H7no2W0vuLJTvSPanlrijtG3UdJNVoeWBOp2a5dJFVa2tqSQuP5GfbJw1xAtPG9agRW310nFTUUsyPz5tuVIxw==" + } + } + } +} \ No newline at end of file diff --git a/src/ApiGenerator/razormachine.readme.txt b/src/ApiGenerator/razormachine.readme.txt new file mode 100644 index 0000000000..ff71feef32 --- /dev/null +++ b/src/ApiGenerator/razormachine.readme.txt @@ -0,0 +1,20 @@ +Xipton.Razor v2.6.1 + +The web.config configuration file only is for activating Razor intellisense inside Razor templates, within non MVC projects. Note that for being able to use Razor intellisense MVC 3 or MVC 4 need to be installed on your system. MVC is not needed for compiling Xipton.Razor templates. + +You need to the web.config to your non MVC template project besides your default app.config. The configured MVC and Razor assemblies (here MVC version 3) need to be installed at your environment. Xipton.Razor uses Razor 2.0 (part of MVC 4), still you can use this configuration (MVC 3, Razor 1) as long as MVC 3 has been installed at your system as well. If you do not have MVC 3 installed on your system you need to configure the MVC version (and configuration) in accordance to the version that is on your system. + +Important: +If you reference Xipton.Razor as a dll (and not as a project) and you want to use intellisense you must install the signed Xipton.Razor.dll inside the GAC (this is required only for being able to use intellisense, not for deployment).In that case the @model directive does not work together with intellisense (the template will compile though). Therefore if referencing Xipton.Razor as a signed dll (that must have been installed inside the GAC) you need to use the @inherits directive for a working intellisense like "@inherits Xipton.Razor.TemplateBase". + +Within MVC projects: +If you work with Xipton.Razor together with MVC, then you use your MVC project's app.config. In that case you could install the Xipton.Razor.dll in the GAC as well. Inside the MVC app.config you add an assembly reference for the Xipton.Razor.dll like: + + + + + + + +Now inside your Xipton.Razor templates you need to use the directive @inherits, like "@inherits Xipton.Razor.TemplateBase", instead of the @model directive. + From 41575c4a8d242c34cfd96212441e5c562a7beeb8 Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Wed, 14 Jun 2023 15:07:32 +1200 Subject: [PATCH 02/27] Bump Spectre.Console from 0.30.0 to 0.47.0 (#227) Signed-off-by: Thomas Farr --- src/ApiGenerator/ApiGenerator.csproj | 2 +- src/ApiGenerator/Program.cs | 17 +++++++---------- src/ApiGenerator/packages.lock.json | 17 ++++++----------- 3 files changed, 14 insertions(+), 22 deletions(-) diff --git a/src/ApiGenerator/ApiGenerator.csproj b/src/ApiGenerator/ApiGenerator.csproj index 0c9d11077f..330adef566 100644 --- a/src/ApiGenerator/ApiGenerator.csproj +++ b/src/ApiGenerator/ApiGenerator.csproj @@ -13,7 +13,7 @@ - + diff --git a/src/ApiGenerator/Program.cs b/src/ApiGenerator/Program.cs index 2adb8d357b..e64056addd 100644 --- a/src/ApiGenerator/Program.cs +++ b/src/ApiGenerator/Program.cs @@ -68,17 +68,14 @@ private static async Task Main( catch (OperationCanceledException) { AnsiConsole.WriteLine(); - AnsiConsole.Render(new Rule("[b white on orange4_1] Cancelled [/]").LeftAligned()); + AnsiConsole.Write(new Rule("[b white on orange4_1] Cancelled [/]").LeftJustified()); AnsiConsole.WriteLine(); return 1; } catch (Exception ex) { AnsiConsole.WriteLine(); - AnsiConsole.Render(new Rule("[b white on darkred] Exception [/]") - { - Alignment = Justify.Left, - }); + AnsiConsole.Write(new Rule("[b white on darkred] Exception [/]").LeftJustified()); AnsiConsole.WriteLine(); AnsiConsole.WriteException(ex); return 1; @@ -115,7 +112,7 @@ private static async Task Generate(bool download, string branch, bool inclu .AddRow("[b]Include high level client[/]", $"{YesNo(!lowLevelOnly)}"); Console.WriteLine(); - AnsiConsole.Render( + AnsiConsole.Write( new Panel(grid) .Header(new PanelHeader("[b white on chartreuse4] OpenSearch .NET client API generator [/]", Justify.Left)) ); @@ -124,7 +121,7 @@ private static async Task Generate(bool download, string branch, bool inclu if (redownloadCoreSpecification) { Console.WriteLine(); - AnsiConsole.Render(new Rule("[b white on chartreuse4] Downloading specification [/]").LeftAligned()); + AnsiConsole.Write(new Rule("[b white on chartreuse4] Downloading specification [/]").LeftJustified()); Console.WriteLine(); await RestSpecDownloader.DownloadAsync(downloadBranch, token); } @@ -132,7 +129,7 @@ private static async Task Generate(bool download, string branch, bool inclu if (!generateCode) return 0; Console.WriteLine(); - AnsiConsole.Render(new Rule("[b white on chartreuse4] Loading specification [/]").LeftAligned()); + AnsiConsole.Write(new Rule("[b white on chartreuse4] Loading specification [/]").LeftJustified()); Console.WriteLine(); var spec = Generator.ApiGenerator.CreateRestApiSpecModel(downloadBranch, "Core"); @@ -148,7 +145,7 @@ private static async Task Generate(bool download, string branch, bool inclu } Console.WriteLine(); - AnsiConsole.Render(new Rule("[b white on chartreuse4] Generating code [/]").LeftAligned()); + AnsiConsole.Write(new Rule("[b white on chartreuse4] Generating code [/]").LeftJustified()); Console.WriteLine(); await Generator.ApiGenerator.Generate(downloadBranch, lowLevelOnly, spec, token); @@ -157,7 +154,7 @@ private static async Task Generate(bool download, string branch, bool inclu if (warnings.Count > 0) { Console.WriteLine(); - AnsiConsole.Render(new Rule("[b black on yellow] Specification warnings [/]").LeftAligned()); + AnsiConsole.Write(new Rule("[b black on yellow] Specification warnings [/]").LeftJustified()); Console.WriteLine(); foreach (var warning in warnings.Distinct().OrderBy(w => w)) diff --git a/src/ApiGenerator/packages.lock.json b/src/ApiGenerator/packages.lock.json index 623306d514..9324a38065 100644 --- a/src/ApiGenerator/packages.lock.json +++ b/src/ApiGenerator/packages.lock.json @@ -65,11 +65,11 @@ }, "Spectre.Console": { "type": "Direct", - "requested": "[0.30.0, )", - "resolved": "0.30.0", - "contentHash": "7UG9p43sEJ2IjPuzkFNCE8zWmV1OOE0Kwh1jlJXv8/dzEADmWImzt9q868FCQ1ny5mDhNIkrZ3mfy2zxMSDagQ==", + "requested": "[0.47.0, )", + "resolved": "0.47.0", + "contentHash": "wz8mszcZr0cSOo8GyoG9e2DFW0SkMT8/n78Q/lIXX7EbCtHNXOoOKWpJ9Str+rCYtmQOGGyDutZzubrUHK/XkA==", "dependencies": { - "Wcwidth": "0.2.0" + "System.Memory": "4.5.5" } }, "System.CommandLine.DragonFruit": { @@ -305,8 +305,8 @@ }, "System.Memory": { "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==" + "resolved": "4.5.5", + "contentHash": "XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw==" }, "System.Reflection": { "type": "Transitive", @@ -459,11 +459,6 @@ "type": "Transitive", "resolved": "4.5.4", "contentHash": "zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==" - }, - "Wcwidth": { - "type": "Transitive", - "resolved": "0.2.0", - "contentHash": "H7no2W0vuLJTvSPanlrijtG3UdJNVoeWBOp2a5dJFVa2tqSQuP5GfbJw1xAtPG9agRW310nFTUUsyPz5tuVIxw==" } } } From b1fbe719b189f9a8e33e3e214536ddd6350b1e3e Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Fri, 16 Jun 2023 16:22:15 +1200 Subject: [PATCH 03/27] Implement parsing OpenAPI to internal model (#228) Signed-off-by: Thomas Farr --- src/ApiGenerator/ApiGenerator.csproj | 2 +- src/ApiGenerator/App.config | 6 - .../Configuration/CodeConfiguration.cs | 42 +- .../Configuration/GeneratorLocations.cs | 4 +- .../Domain/ApiQueryParametersPatcher.cs | 30 +- src/ApiGenerator/Domain/Code/CsharpNames.cs | 3 +- src/ApiGenerator/Domain/RestApiSpec.cs | 19 +- .../Domain/Specification/ApiEndpoint.cs | 5 +- .../Domain/Specification/UrlInformation.cs | 4 +- src/ApiGenerator/Extensions.cs | 8 +- .../Generator/ApiEndpointFactory.cs | 310 +- src/ApiGenerator/Generator/ApiGenerator.cs | 79 +- src/ApiGenerator/Generator/CodeGenerator.cs | 1 - src/ApiGenerator/OpenSearch.openapi.json | 29431 ++++++++++++++++ src/ApiGenerator/Program.cs | 6 +- src/ApiGenerator/RestSpecDownloader.cs | 143 +- .../HighLevel/Descriptors/Descriptor.cshtml | 2 +- .../Descriptors/RequestDescriptorBase.cshtml | 15 - .../Requests/PlainRequestBase.cshtml | 5 - .../Requests/RequestImplementations.cshtml | 2 +- .../LowLevel/Client/Methods/MethodDocs.cshtml | 2 +- .../RequestParameters.cshtml | 3 +- src/ApiGenerator/packages.lock.json | 62 +- src/ApiGenerator/razormachine.readme.txt | 20 - 24 files changed, 29666 insertions(+), 538 deletions(-) delete mode 100644 src/ApiGenerator/App.config create mode 100644 src/ApiGenerator/OpenSearch.openapi.json delete mode 100644 src/ApiGenerator/razormachine.readme.txt diff --git a/src/ApiGenerator/ApiGenerator.csproj b/src/ApiGenerator/ApiGenerator.csproj index 330adef566..4505f23ddf 100644 --- a/src/ApiGenerator/ApiGenerator.csproj +++ b/src/ApiGenerator/ApiGenerator.csproj @@ -11,8 +11,8 @@ + - diff --git a/src/ApiGenerator/App.config b/src/ApiGenerator/App.config deleted file mode 100644 index 434e45fb3e..0000000000 --- a/src/ApiGenerator/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/ApiGenerator/Configuration/CodeConfiguration.cs b/src/ApiGenerator/Configuration/CodeConfiguration.cs index b0053fef26..309757a0d7 100644 --- a/src/ApiGenerator/Configuration/CodeConfiguration.cs +++ b/src/ApiGenerator/Configuration/CodeConfiguration.cs @@ -36,37 +36,7 @@ namespace ApiGenerator.Configuration { public static class CodeConfiguration { - /// These APIs are not implemented yet in the low and high level client - public static string[] IgnoredApis { get; } = - { - // To be removed - "indices.upgrade.json", - "indices.get_upgrade.json", - }; - - private static string[] IgnoredApisHighLevel { get; } = - { - "indices.delete_index_template.json", - "indices.exists_index_template.json", - "indices.get_index_template.json", - "indices.put_index_template.json", - "indices.simulate_index_template.json", - "indices.simulate_template.json", - - "get_script_context.json", // 7.7 experimental - "get_script_languages.json", // 7.7 experimental - - "indices.exist_type.json", // already removed on client - - "rank_eval.json", // 7.7 experimental - "scripts_painless_context.json", // 7.7 experimental - "cluster.delete_component_template.json", // 7.8 experimental - "cluster.get_component_template.json", // 7.8 experimental - "cluster.put_component_template.json", // 7.8 experimental - "cluster.exists_component_template.json", // 7.8 experimental - }; - - /// + /// /// Map API default names for API's we are only supporting on the low level client first /// private static readonly Dictionary LowLevelApiNameMapping = new Dictionary @@ -92,18 +62,12 @@ public static class CodeConfiguration public static readonly HashSet EnableHighLevelCodeGen = new HashSet(); public static bool IsNewHighLevelApi(string apiFileName) => - // if its explicitly ignored we know about it. - !IgnoredApis.Contains(apiFileName) - && !IgnoredApisHighLevel.Contains(apiFileName) // no requests with [MapsApi("filename.json")] found - && !HighLevelApiNameMapping.ContainsKey(apiFileName.Replace(".json", "")); + !HighLevelApiNameMapping.ContainsKey(apiFileName.Replace(".json", "")); public static bool IgnoreHighLevelApi(string apiFileName) { - //explicitly ignored - if (IgnoredApis.Contains(apiFileName) || IgnoredApisHighLevel.Contains(apiFileName)) return true; - - //always generate already mapped requests + //always generate already mapped requests if (HighLevelApiNameMapping.ContainsKey(apiFileName.Replace(".json", ""))) return false; diff --git a/src/ApiGenerator/Configuration/GeneratorLocations.cs b/src/ApiGenerator/Configuration/GeneratorLocations.cs index 08467cb003..3065a155a0 100644 --- a/src/ApiGenerator/Configuration/GeneratorLocations.cs +++ b/src/ApiGenerator/Configuration/GeneratorLocations.cs @@ -34,11 +34,11 @@ 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 LastDownloadedRef { get; } = Path.Combine(Root, "last_downloaded_version.txt"); public static string OpenSearchClientFolder { get; } = $@"{Root}../../src/OpenSearch.Client/"; - public static string RestSpecificationFolder { get; } = $@"{Root}RestSpecification/"; // @formatter:on — enable formatter after this line public static string HighLevel(params string[] paths) => OpenSearchClientFolder + string.Join("/", paths); diff --git a/src/ApiGenerator/Domain/ApiQueryParametersPatcher.cs b/src/ApiGenerator/Domain/ApiQueryParametersPatcher.cs index 6bb6663e8c..744ec2af00 100644 --- a/src/ApiGenerator/Domain/ApiQueryParametersPatcher.cs +++ b/src/ApiGenerator/Domain/ApiQueryParametersPatcher.cs @@ -39,8 +39,7 @@ public static class ApiQueryParametersPatcher public static SortedDictionary Patch( string endpointName, IDictionary source, - IEndpointOverrides overrides, - bool checkCommon = true + IEndpointOverrides overrides ) { if (source == null) return null; @@ -54,32 +53,23 @@ public static SortedDictionary Patch( var obsoleteLookup = CreateObsoleteLookup(globalOverrides, overrides, declaredKeys); var patchedParams = new SortedDictionary(); - var name = overrides?.GetType().Name ?? endpointName ?? "unknown"; - foreach (var kv in source) + foreach (var (queryStringKey, value) in source) { - var queryStringKey = kv.Key; - kv.Value.QueryStringKey = queryStringKey; + value.QueryStringKey = queryStringKey; - if (checkCommon && RestApiSpec.CommonApiQueryParameters.Keys.Contains(queryStringKey)) - { - Generator.ApiGenerator.Warnings.Add($"key '{queryStringKey}' in {name} is already declared in _common.json"); - continue; - } + if (!renameLookup.TryGetValue(queryStringKey, out var preferredName)) preferredName = queryStringKey; + value.ClsName = CreateCSharpName(preferredName, endpointName); - if (!renameLookup.TryGetValue(queryStringKey, out var preferredName)) preferredName = kv.Key; - kv.Value.ClsName = CreateCSharpName(preferredName, endpointName); + if (skipList.Contains(queryStringKey)) value.Skip = true; - if (skipList.Contains(queryStringKey)) kv.Value.Skip = true; + if (partialList.Contains(queryStringKey)) value.RenderPartial = true; - if (partialList.Contains(queryStringKey)) kv.Value.RenderPartial = true; - - if (obsoleteLookup.TryGetValue(queryStringKey, out var obsolete)) kv.Value.Obsolete = obsolete; + if (obsoleteLookup.TryGetValue(queryStringKey, out var obsolete)) value.Obsolete = obsolete; //make sure source_enabled takes a boolean only - if (preferredName == "source_enabled") kv.Value.Type = "boolean"; - + if (preferredName == "source_enabled") value.Type = "boolean"; - patchedParams[preferredName] = kv.Value; + patchedParams[preferredName] = value; } return patchedParams; diff --git a/src/ApiGenerator/Domain/Code/CsharpNames.cs b/src/ApiGenerator/Domain/Code/CsharpNames.cs index c762abe066..46a77cbabe 100644 --- a/src/ApiGenerator/Domain/Code/CsharpNames.cs +++ b/src/ApiGenerator/Domain/Code/CsharpNames.cs @@ -31,7 +31,6 @@ using System.Linq; using ApiGenerator.Configuration; using ApiGenerator.Generator; -using CsQuery.ExtensionMethods.Internal; namespace ApiGenerator.Domain.Code { @@ -73,7 +72,7 @@ string Replace(string original, string ns, string find, string replace, string[] public string RestSpecName { get; } /// - /// The pascal cased method name as loaded by + /// The pascal cased method name as loaded by ///
Uses  mapping of request implementations in the OSC code base
///
public string MethodName { get; } diff --git a/src/ApiGenerator/Domain/RestApiSpec.cs b/src/ApiGenerator/Domain/RestApiSpec.cs index b9b70fb0d7..e6a1740f6c 100644 --- a/src/ApiGenerator/Domain/RestApiSpec.cs +++ b/src/ApiGenerator/Domain/RestApiSpec.cs @@ -43,11 +43,7 @@ public class EnumDescription public class RestApiSpec { - public string Commit { get; set; } - - public static SortedDictionary CommonApiQueryParameters { get; set; } - - public IDictionary Endpoints { get; set; } + public IDictionary Endpoints { get; set; } public ImmutableSortedDictionary> EndpointsPerNamespaceLowLevel => Endpoints.Values.GroupBy(e=>e.CsharpNames.Namespace) @@ -55,7 +51,7 @@ public class RestApiSpec public ImmutableSortedDictionary> EndpointsPerNamespaceHighLevel => Endpoints.Values - .Where(v => !CodeConfiguration.IgnoreHighLevelApi(v.FileName)) + .Where(v => !CodeConfiguration.IgnoreHighLevelApi(v.Name)) .GroupBy(e => e.CsharpNames.Namespace) .ToImmutableSortedDictionary(kv => kv.Key, kv => kv.ToList().AsReadOnly()); @@ -111,16 +107,7 @@ from part in e.Url.Parts .DistinctBy(e => e.Name) .ToList(); - //TODO can be removed in 8.x - var versionType = _enumDescriptions.FirstOrDefault(f => f.Name == "VersionType"); - if (versionType != null) - { - var options = new List(versionType.Options); - options.Add("force"); - versionType.Options = options; - } - - return _enumDescriptions; + return _enumDescriptions; } } } diff --git a/src/ApiGenerator/Domain/Specification/ApiEndpoint.cs b/src/ApiGenerator/Domain/Specification/ApiEndpoint.cs index 159b02fdf0..3ecf3ae089 100644 --- a/src/ApiGenerator/Domain/Specification/ApiEndpoint.cs +++ b/src/ApiGenerator/Domain/Specification/ApiEndpoint.cs @@ -40,10 +40,7 @@ namespace ApiGenerator.Domain.Specification { public class ApiEndpoint { - /// The filename of the spec describing the api endpoint - public string FileName { get; set; } - - /// The original name as declared in the spec + /// The original name as declared in the spec public string Name { get; set; } /// The original namespace as declared in the spec diff --git a/src/ApiGenerator/Domain/Specification/UrlInformation.cs b/src/ApiGenerator/Domain/Specification/UrlInformation.cs index 1c58c9e92e..e56943ae41 100644 --- a/src/ApiGenerator/Domain/Specification/UrlInformation.cs +++ b/src/ApiGenerator/Domain/Specification/UrlInformation.cs @@ -39,8 +39,8 @@ public class UrlInformation { public IDictionary Params { get; set; } = new SortedDictionary(); - [JsonProperty("paths")] - private IReadOnlyCollection OriginalPaths { get; set; } + [JsonProperty("paths")] + public IList OriginalPaths { get; set; } = new List(); [JsonProperty("parts")] public IDictionary OriginalParts { get; set; } diff --git a/src/ApiGenerator/Extensions.cs b/src/ApiGenerator/Extensions.cs index dd4251bd3b..f61b107fe7 100644 --- a/src/ApiGenerator/Extensions.cs +++ b/src/ApiGenerator/Extensions.cs @@ -31,7 +31,6 @@ using System.Globalization; using System.Linq; using System.Text.RegularExpressions; -using CsQuery.ExtensionMethods.Internal; namespace ApiGenerator { @@ -64,10 +63,13 @@ public static string ToCamelCase(this string s) var pascal = s.ToPascalCase(true); if (pascal.Length <= 1) return pascal; - return pascal[0].ToLower() + pascal.Substring(1); + 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); + } } diff --git a/src/ApiGenerator/Generator/ApiEndpointFactory.cs b/src/ApiGenerator/Generator/ApiEndpointFactory.cs index 8669d731db..8f3b492fdb 100644 --- a/src/ApiGenerator/Generator/ApiEndpointFactory.cs +++ b/src/ApiGenerator/Generator/ApiEndpointFactory.cs @@ -28,202 +28,138 @@ using System; using System.Collections.Generic; -using System.IO; +using System.Collections.Immutable; using System.Linq; using ApiGenerator.Configuration; using ApiGenerator.Configuration.Overrides; using ApiGenerator.Domain; using ApiGenerator.Domain.Code; using ApiGenerator.Domain.Specification; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; +using NJsonSchema; +using NSwag; namespace ApiGenerator.Generator { public static class ApiEndpointFactory { - private static readonly JsonSerializer Serializer = JsonSerializer.Create( - new JsonSerializerSettings { Converters = new List { new QueryParameterDeprecationConverter() } }); - - public static ApiEndpoint FromFile(string jsonFile) - { - var officialJsonSpec = JObject.Parse(File.ReadAllText(jsonFile)); - TransformNewSpecStructureToOld(officialJsonSpec); - PatchOfficialSpec(officialJsonSpec, jsonFile); - var (name, endpoint) = officialJsonSpec.ToObject>(Serializer).First(); - - endpoint.FileName = Path.GetFileName(jsonFile); - endpoint.Name = name; - var tokens = name.Split("."); - - endpoint.MethodName = tokens.Last(); - if (tokens.Length > 1) - endpoint.Namespace = tokens[0]; - //todo side effect - endpoint.CsharpNames = new CsharpNames(name, endpoint.MethodName, endpoint.Namespace); - - LoadOverridesOnEndpoint(endpoint); - PatchRequestParameters(endpoint); - - EnforceRequiredOnParts(jsonFile, endpoint.Url); - return endpoint; - } - - /// - /// This makes sure required is configured correctly by inspecting the paths. - /// Will emit a warning if the spec file got this wrong - /// - private static void EnforceRequiredOnParts(string jsonFile, UrlInformation url) - { - if (url.IsPartless) return; - foreach (var part in url.Parts) - { - var required = url.Paths.All(p => p.Path.Contains($"{{{part.Name}}}")); - if (part.Required != required) - { - var message = required - ? "is [b green] required [/] but appears in spec as [b red] optional [/]" - : "is [b green] optional [/] but marked as [b red] required [/] "; - // TODO submit PR to fix these, too noisy for now - //ApiGenerator.Warnings.Add($"[grey]{jsonFile}[/] part [b white] {part.Name} [/] {message}"); - } - part.Required = required; - } - } - - private static void LoadOverridesOnEndpoint(ApiEndpoint endpoint) - { - var method = endpoint.CsharpNames.MethodName; - if (CodeConfiguration.ApiNameMapping.TryGetValue(endpoint.Name, out var mapsApiMethodName)) - method = mapsApiMethodName; - - var namespacePrefix = typeof(GlobalOverrides).Namespace + ".Endpoints."; - var typeName = namespacePrefix + method + "Overrides"; - var type = GeneratorLocations.Assembly.GetType(typeName); - if (type != null && Activator.CreateInstance(type) is IEndpointOverrides overrides) - endpoint.Overrides = overrides; - } - - private static void PatchRequestParameters(ApiEndpoint endpoint) - { - var newParams = ApiQueryParametersPatcher.Patch(endpoint.Name, endpoint.Url.Params, endpoint.Overrides); - endpoint.Url.Params = newParams; - } - - /// - /// Finds a patch file in patches and union merges this with the official spec. - /// This allows us to check in tweaks should breaking changes occur in the spec before we catch them - /// - private static void PatchOfficialSpec(JObject original, string jsonFile) - { - var directory = Path.GetDirectoryName(jsonFile); - var patchFile = Path.Combine(directory!,"..", "_Patches", Path.GetFileNameWithoutExtension(jsonFile)) + ".patch.json"; - if (!File.Exists(patchFile)) return; - - var patchedJson = JObject.Parse(File.ReadAllText(patchFile)); - - var pathsOverride = patchedJson.SelectToken("*.url.paths"); - - original.Merge(patchedJson, new JsonMergeSettings - { - MergeArrayHandling = MergeArrayHandling.Union - }); - - if (pathsOverride != null) original.SelectToken("*.url.paths").Replace(pathsOverride); - - var methodsOverride = patchedJson.SelectToken("*.methods"); - if (methodsOverride != null) - original.SelectToken("*.methods").Replace(methodsOverride); - - var paramsOverride = patchedJson.SelectToken("*.params"); - var originalParams = original.SelectToken("*.url.params") as JObject; - originalParams?.Merge(paramsOverride, new JsonMergeSettings - { - MergeArrayHandling = MergeArrayHandling.Union - }); - - if (paramsOverride != null) originalParams?.Replace(originalParams); - - void ReplaceOptions(string path) - { - var optionsOverrides = patchedJson.SelectToken(path); - if (optionsOverrides != null) - original.SelectToken(path).Replace(optionsOverrides); - } - - ReplaceOptions("*.url.parts.metric.options"); - ReplaceOptions("*.url.parts.index_metric.options"); - } - - /// - /// Changes the structure of new REST API spec in 7.4.0 to one that matches prior spec structure. - /// - private static void TransformNewSpecStructureToOld(JObject original) - { - var name = (JProperty)original.First; - var spec = (JObject)name.Value; - - // old spec structure, nothing to change - if (spec.ContainsKey("methods")) - return; - - var methods = new HashSet(StringComparer.InvariantCultureIgnoreCase); - JObject parts = null; - var paths = new List(); - var deprecatedPaths = new List(); - - foreach (var path in spec["url"]["paths"].Cast()) - { - if (path.ContainsKey("deprecated")) - { - var deprecated = new JObject - { - ["version"] = path["deprecated"]["version"].Value(), - ["path"] = path["path"].Value(), - ["description"] = path["deprecated"]["description"].Value() - }; - - deprecatedPaths.Add(deprecated); - } - else - paths.Add(path["path"].Value()); - - if (path.ContainsKey("parts")) - { - if (parts == null) - parts = path["parts"].Value(); - else - parts.Merge(path["parts"].Value(), new JsonMergeSettings - { - MergeArrayHandling = MergeArrayHandling.Union - }); - } - - foreach (var method in path["methods"].Cast()) - methods.Add(method.Value()); - } - - - - var newUrl = new JObject - { - ["paths"] = new JArray(paths.Cast().ToArray()), - }; - - if (spec.ContainsKey("params")) - { - newUrl["params"] = spec["params"]; - spec.Remove("params"); - } - - if (parts != null) - newUrl["parts"] = parts; - - if (deprecatedPaths.Any()) - newUrl["deprecated_paths"] = new JArray(deprecatedPaths.Cast().ToArray()); - - spec["url"] = newUrl; - spec["methods"] = new JArray(methods.Cast().ToArray()); - } - } + 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 urlInfo = new UrlInformation(); + HashSet requiredPathParams = null; + var allPathParams = new List(); + + foreach (var (httpPath, path, _, operation) in variants.DistinctBy(v => v.HttpPath)) + { + urlInfo.OriginalPaths.Add(httpPath); + var pathParams = path.Parameters + .Concat(operation.Parameters) + .Where(p => p.Kind == OpenApiParameterKind.Path) + .ToList(); + var paramNames = pathParams.Select(p => p.Name); + if (requiredPathParams != null) + requiredPathParams.IntersectWith(paramNames); + else + requiredPathParams = new HashSet(paramNames); + allPathParams.AddRange(pathParams); + } + + urlInfo.OriginalParts = allPathParams.DistinctBy(p => p.Name) + .Select(p => new UrlPart + { + ClrTypeNameOverride = null, + Deprecated = p.IsDeprecated, + Description = p.Description, + Name = p.Name, + Required = requiredPathParams?.Contains(p.Name) ?? false, + Type = GetOpenSearchType(p.Schema), + Options = GetEnumOptions(p.Schema), + }) + .ToImmutableSortedDictionary(p => p.Name, p => p); + + urlInfo.Params = variants.SelectMany(v => v.Path.Parameters.Concat(v.Operation.Parameters)) + .Where(p => p.Kind == OpenApiParameterKind.Query) + .DistinctBy(p => p.Name) + .ToImmutableSortedDictionary(p => p.Name, + p => new QueryParameters + { + Type = GetOpenSearchType(p.Schema), + Description = p.Description, + Options = GetEnumOptions(p.Schema), + Deprecated = p.IsDeprecated ? new QueryParameterDeprecation { Description = p.DeprecatedMessage } : null + }); + + var endpoint = new ApiEndpoint + { + Name = name, + Namespace = ns, + MethodName = methodName, + CsharpNames = new CsharpNames(name, methodName, ns), + Stability = Stability.Stable, // TODO: for realsies + OfficialDocumentationLink = new Documentation + { + Description = variants[0].Operation.Description, + Url = variants[0].Operation.ExternalDocumentation?.Url, + }, + Url = urlInfo, + Body = variants.Select(v => v.Operation.RequestBody).FirstOrDefault(b => b != null) is {} reqBody ? new Body + { + Description = reqBody.Description, + Required = reqBody.IsRequired + } : null, + HttpMethods = variants.Select(v => v.HttpMethod.ToString().ToUpper()).Distinct().ToList(), + }; + + LoadOverridesOnEndpoint(endpoint); + PatchRequestParameters(endpoint); + + return endpoint; + } + + private static void LoadOverridesOnEndpoint(ApiEndpoint endpoint) + { + var method = endpoint.CsharpNames.MethodName; + if (CodeConfiguration.ApiNameMapping.TryGetValue(endpoint.Name, out var mapsApiMethodName)) + method = mapsApiMethodName; + + var namespacePrefix = $"{typeof(GlobalOverrides).Namespace}.Endpoints."; + var typeName = $"{namespacePrefix}{method}Overrides"; + var type = GeneratorLocations.Assembly.GetType(typeName); + if (type != null && Activator.CreateInstance(type) is IEndpointOverrides overrides) + endpoint.Overrides = overrides; + } + + private static void PatchRequestParameters(ApiEndpoint endpoint) => + endpoint.Url.Params = ApiQueryParametersPatcher.Patch(endpoint.Name, endpoint.Url.Params, endpoint.Overrides) + ?? throw new ArgumentNullException("ApiQueryParametersPatcher.Patch(endpoint.Name, endpoint.Url.Params, endpoint.Overrides)"); + + private static string GetOpenSearchType(JsonSchema schema) + { + while (schema.HasReference) schema = schema.Reference; + + if (schema.GetExtension("x-data-type") is string dataType) + return 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) + { + while (schema.HasReference) schema = schema.Reference; + + return schema.Enumeration?.Select(e => e.ToString()) ?? Enumerable.Empty(); + } + + 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 index f4c522ec00..e30861048f 100644 --- a/src/ApiGenerator/Generator/ApiGenerator.cs +++ b/src/ApiGenerator/Generator/ApiGenerator.cs @@ -28,15 +28,14 @@ using System; using System.Collections.Generic; -using System.IO; +using System.Collections.Immutable; using System.Linq; using System.Threading; using System.Threading.Tasks; using ApiGenerator.Configuration; using ApiGenerator.Domain; -using ApiGenerator.Domain.Specification; using ApiGenerator.Generator.Razor; -using Newtonsoft.Json.Linq; +using NSwag; using ShellProgressBar; namespace ApiGenerator.Generator @@ -45,7 +44,7 @@ public class ApiGenerator { public static List Warnings { get; private set; } = new List(); - public static async Task Generate(string downloadBranch, bool lowLevelOnly, RestApiSpec spec, CancellationToken token) + public static async Task Generate(bool lowLevelOnly, RestApiSpec spec, CancellationToken token) { static async Task DoGenerate(ICollection generators, RestApiSpec restApiSpec, bool highLevel, CancellationToken token) { @@ -86,68 +85,18 @@ static async Task DoGenerate(ICollection generators, RestApi } - public static RestApiSpec CreateRestApiSpecModel(string downloadBranch, params string[] folders) - { - var directories = Directory.GetDirectories(GeneratorLocations.RestSpecificationFolder, "*", SearchOption.AllDirectories) - .Where(f => folders == null || folders.Length == 0 || folders.Contains(new DirectoryInfo(f).Name)) - .OrderBy(f => new FileInfo(f).Name) - .ToList(); - - var endpoints = new SortedDictionary(); - var seenFiles = new HashSet(); - using (var pbar = new ProgressBar(directories.Count, $"Listing {directories.Count} directories", - new ProgressBarOptions { ProgressCharacter = '─', BackgroundColor = ConsoleColor.DarkGray, CollapseWhenFinished = false })) - { - var folderFiles = directories.Select(dir => - Directory.GetFiles(dir) - .Where(f => f.EndsWith(".json") && !CodeConfiguration.IgnoredApis.Contains(new FileInfo(f).Name)) - .ToList() - ); - var commonFile = Path.Combine(GeneratorLocations.RestSpecificationFolder, "Core", "_common.json"); - if (!File.Exists(commonFile)) throw new Exception($"Expected to find {commonFile}"); - - RestApiSpec.CommonApiQueryParameters = CreateCommonApiQueryParameters(commonFile); - - foreach (var jsonFiles in folderFiles) - { - using (var fileProgress = pbar.Spawn(jsonFiles.Count, $"Listing {jsonFiles.Count} files", - new ProgressBarOptions { ProgressCharacter = '─', BackgroundColor = ConsoleColor.DarkGray })) - { - foreach (var file in jsonFiles) - { - if (file.EndsWith("_common.json")) continue; - else if (file.EndsWith(".patch.json")) continue; - else - { - var endpoint = ApiEndpointFactory.FromFile(file); - seenFiles.Add(Path.GetFileNameWithoutExtension(file)); - endpoints.Add(endpoint.Name, endpoint); - } - - fileProgress.Tick(); - } - } - pbar.Tick(); - } - } - var wrongMapsApi = CodeConfiguration.ApiNameMapping.Where(k => !string.IsNullOrWhiteSpace(k.Key) && !seenFiles.Contains(k.Key)); - foreach (var (key, value) in wrongMapsApi) - { - var isIgnored = CodeConfiguration.IgnoredApis.Contains($"{value}.json"); - if (isIgnored) - Warnings.Add($"{value} uses MapsApi: {key} ignored in ${nameof(CodeConfiguration)}.{nameof(CodeConfiguration.IgnoredApis)}"); - else Warnings.Add($"{value} uses MapsApi: {key} which does not exist"); - } + public static async Task CreateRestApiSpecModel(CancellationToken token = default) + { + var document = await OpenApiYamlDocument.FromFileAsync(GeneratorLocations.OpenApiSpecFile, token); - return new RestApiSpec { Endpoints = endpoints, Commit = downloadBranch }; - } + 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()) + .Select(o => ApiEndpointFactory.From(o.Key, o.Select(i => (i.HttpPath, i.PathItem, i.HttpMethod, i.Operation)).ToList())) + .ToImmutableSortedDictionary(e => e.Name, e => e); - private static SortedDictionary CreateCommonApiQueryParameters(string jsonFile) - { - var json = File.ReadAllText(jsonFile); - var jobject = JObject.Parse(json); - var commonParameters = jobject.Property("params").Value.ToObject>(); - return ApiQueryParametersPatcher.Patch(null, commonParameters, null, false); - } + return new RestApiSpec { Endpoints = endpoints }; + } } } diff --git a/src/ApiGenerator/Generator/CodeGenerator.cs b/src/ApiGenerator/Generator/CodeGenerator.cs index b7e201e64a..3e2e78a8ee 100644 --- a/src/ApiGenerator/Generator/CodeGenerator.cs +++ b/src/ApiGenerator/Generator/CodeGenerator.cs @@ -30,7 +30,6 @@ using System.Collections.Generic; using System.Linq; using ApiGenerator.Domain.Code.HighLevel.Requests; -using CsQuery.ExtensionMethods.Internal; namespace ApiGenerator.Generator { diff --git a/src/ApiGenerator/OpenSearch.openapi.json b/src/ApiGenerator/OpenSearch.openapi.json new file mode 100644 index 0000000000..6ca528e451 --- /dev/null +++ b/src/ApiGenerator/OpenSearch.openapi.json @@ -0,0 +1,29431 @@ +{ + "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" + }, + "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": "list" + }, + "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": "list" + }, + "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" + } + } + } + }, + "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-data-type": "time" + } + } + ], + "responses": { + "200": { + "description": "IndicesUpdateAliases 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndicesUpdateAliasesResponseContent" + }, + "examples": { + "IndicesUpdateAliases_example1": { + "summary": "Examples for Post Aliases Operation.", + "description": "", + "value": { + "acknowledged": true + } + } + } + } + } + } + }, + "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" + }, + "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" + }, + "operationId": "Bulk_Post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Bulk_BodyParams" + } + } + } + }, + "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" + } + } + } + }, + "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" + }, + "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" + }, + "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" + }, + "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": "list" + }, + "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" + }, + "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-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": "list" + }, + "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-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" + }, + "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-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" + }, + "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": "list" + }, + "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" + }, + "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": "list" + }, + "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" + }, + "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-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", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CatIndicesOutputPayload" + } + } + } + } + }, + "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": "list" + }, + "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-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", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CatIndices_WithIndexOutputPayload" + } + } + } + } + }, + "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" + }, + "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-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" + }, + "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-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-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", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CatNodesOutputPayload" + } + } + } + } + }, + "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" + }, + "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-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/plugins": { + "get": { + "description": "Returns information about installed plugins across nodes node.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest" + }, + "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-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" + }, + "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": "list" + }, + "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" + }, + "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-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" + }, + "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": "list" + }, + "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" + }, + "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-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": "list" + }, + "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-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" + }, + "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-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": "list" + }, + "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-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" + }, + "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-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": "list" + }, + "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-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" + }, + "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" + }, + "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-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-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" + }, + "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-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": "list" + }, + "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-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" + }, + "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" + }, + "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" + }, + "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" + }, + "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" + }, + "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-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." + } + }, + { + "name": "ensure_node_commissioned", + "in": "query", + "description": "Checks whether local node is commissioned or not. If set to true on a local call it will throw exception if node is decommissioned.", + "schema": { + "type": "boolean", + "default": false, + "description": "Checks whether local node is commissioned or not. If set to true on a local call it will throw exception if node is decommissioned." + } + } + ], + "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": "list" + }, + "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-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." + } + }, + { + "name": "ensure_node_commissioned", + "in": "query", + "description": "Checks whether local node is commissioned or not. If set to true on a local call it will throw exception if node is decommissioned.", + "schema": { + "type": "boolean", + "default": false, + "description": "Checks whether local node is commissioned or not. If set to true on a local call it will throw exception if node is decommissioned." + } + } + ], + "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" + }, + "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": "list" + }, + "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": "list" + }, + "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-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-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" + }, + "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" + }, + "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" + }, + "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-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-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" + } + } + } + }, + "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-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-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": "list" + }, + "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-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": "list" + }, + "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": "list" + }, + "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-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" + }, + "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": "list" + }, + "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-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-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": "list" + }, + "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-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": "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" + } + } + } + }, + "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-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" + }, + "operationId": "ClusterPutComponentTemplate_Put", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClusterPutComponentTemplate_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 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-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" + }, + "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" + }, + "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" + }, + "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-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" + }, + "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-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" + }, + "operationId": "IndicesGetDataStream", + "responses": { + "200": { + "description": "IndicesGetDataStream 200 response" + } + }, + "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" + }, + "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" + }, + "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": "list" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "IndicesDeleteDataStream 200 response" + } + }, + "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": "list" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "IndicesGetDataStream_WithName 200 response" + } + }, + "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" + }, + "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" + } + }, + "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": "list" + }, + "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" + }, + "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" + }, + "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-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-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-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-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" + }, + "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-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": "list" + }, + "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-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" + }, + "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": "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" + } + } + } + }, + "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-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" + }, + "operationId": "IndicesPutIndexTemplate_Put", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndicesPutIndexTemplate_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 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-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" + }, + "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-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" + }, + "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" + } + } + } + }, + "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" + }, + "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-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": "list" + }, + "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-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" + }, + "operationId": "IngestPutPipeline", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IngestPutPipeline_BodyParams" + } + } + } + }, + "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-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" + } + } + } + }, + "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" + }, + "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-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" + }, + "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": "list" + }, + "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" + }, + "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" + } + } + } + }, + "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" + }, + "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" + } + } + } + }, + "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" + }, + "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" + } + } + } + }, + "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" + }, + "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" + }, + "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" + }, + "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": "list" + }, + "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": "list" + }, + "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", + "completion", + "docs", + "fielddata", + "query_cache", + "flush", + "get", + "indexing", + "merge", + "request_cache", + "refresh", + "search", + "segments", + "store", + "warmer", + "suggest" + ], + "x-data-type": "list" + }, + "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": "list" + }, + "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": "list" + }, + "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": "list" + }, + "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": "list" + }, + "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": "list" + }, + "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": "list" + }, + "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": "list" + }, + "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": "list" + }, + "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": "list" + }, + "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", + "completion", + "docs", + "fielddata", + "query_cache", + "flush", + "get", + "indexing", + "merge", + "request_cache", + "refresh", + "search", + "segments", + "store", + "warmer", + "suggest" + ], + "x-data-type": "list" + }, + "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": "list" + }, + "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": "list" + }, + "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": "list" + }, + "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": "list" + }, + "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": "list" + }, + "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": "list" + }, + "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" + } + }, + "/_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" + }, + "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" + } + } + } + }, + "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" + }, + "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" + }, + "operationId": "Reindex", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Reindex_BodyParams" + } + } + } + }, + "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" + }, + "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" + ] + } + } + } + } + } + }, + "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-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" + }, + "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": "list" + }, + "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" + }, + "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" + }, + "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" + }, + "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" + }, + "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-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" + }, + "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-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" + } + } + } + }, + "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-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" + }, + "operationId": "PutScript_Put", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PutScript_BodyParams" + } + } + } + }, + "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-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" + } + } + } + }, + "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-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" + } + } + } + }, + "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-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" + }, + "operationId": "DeletePit", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeletePit_BodyParams" + } + } + } + }, + "responses": { + "200": { + "description": "DeletePit 200 response" + } + }, + "x-operation-group": "delete_pit", + "x-version-added": "1.0" + } + }, + "/_search/point_in_time/_all": { + "delete": { + "description": "Deletes all active point in time searches.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest" + }, + "operationId": "DeleteAllPits", + "responses": { + "200": { + "description": "DeleteAllPits 200 response" + } + }, + "x-operation-group": "delete_all_pits", + "x-version-added": "1.0" + }, + "get": { + "description": "Lists all active point in time searches.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest" + }, + "operationId": "GetAllPits", + "responses": { + "200": { + "description": "GetAllPits 200 response" + } + }, + "x-operation-group": "get_all_pits", + "x-version-added": "1.0" + } + }, + "/_search/scroll": { + "delete": { + "description": "Explicitly clears the search context for a scroll.", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest" + }, + "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" + }, + "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": "list" + }, + "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" + }, + "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" + } + } + } + }, + "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-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" + }, + "operationId": "IndicesPutSettings", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndicesPutSettings_BodyParams" + } + } + } + }, + "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-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": "list" + }, + "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-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" + }, + "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-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" + }, + "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-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" + }, + "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": "list" + }, + "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-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": "list" + }, + "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-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" + } + } + } + }, + "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-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" + }, + "operationId": "SnapshotCreateRepository_Put", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SnapshotCreateRepository_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": "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-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-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-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" + }, + "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-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" + }, + "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-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": "list" + }, + "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-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-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" + }, + "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-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" + } + } + } + }, + "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-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" + }, + "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-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": "list" + }, + "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-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", + "completion", + "docs", + "fielddata", + "query_cache", + "flush", + "get", + "indexing", + "merge", + "request_cache", + "refresh", + "search", + "segments", + "store", + "warmer", + "suggest" + ], + "x-data-type": "list" + }, + "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" + }, + "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" + }, + "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" + }, + "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-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-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": "list" + }, + "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-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": "list" + }, + "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": "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" + } + } + } + }, + "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-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" + }, + "operationId": "IndicesPutTemplate_Put", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndicesPutTemplate_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": "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-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" + }, + "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-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-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": "list" + }, + "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": "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" + }, + "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": "list" + }, + "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-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" + }, + "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": "list" + }, + "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-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": "list" + }, + "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" + }, + "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": "list" + }, + "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": "list" + }, + "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-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": "list" + }, + "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": "list" + }, + "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": "list" + }, + "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": "list" + }, + "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": "list" + }, + "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-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" + }, + "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": "list" + }, + "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-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": "list" + }, + "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": "list" + }, + "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-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": "list" + }, + "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-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": "list" + }, + "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-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": "list" + }, + "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-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" + } + } + } + }, + "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" + } + } + } + }, + "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": "list" + }, + "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-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" + }, + "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-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" + }, + "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": "list" + }, + "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-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": "list" + }, + "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": "list" + }, + "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" + } + } + } + }, + "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" + }, + "operationId": "Create_Put", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Create_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": "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" + }, + "operationId": "DeleteByQuery", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteByQuery_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": "list" + }, + "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" + }, + "operationId": "Index_Post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Index_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 + }, + { + "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" + }, + "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" + }, + "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" + } + } + } + }, + "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" + } + } + } + }, + "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" + }, + "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": "list" + }, + "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": "list" + }, + "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": "list" + }, + "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": "list" + }, + "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": "list" + }, + "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": "list" + }, + "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-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" + } + } + } + }, + "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": "list" + }, + "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-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" + } + } + } + }, + "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": "list" + }, + "required": true, + "examples": { + "IndicesPutMapping_Put_example1": { + "summary": "Examples for Put Index Mapping with 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": "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-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" + }, + "examples": { + "IndicesPutMapping_Put_example1": { + "summary": "Examples for Put Index Mapping with index Operation.", + "description": "", + "value": { + "acknowledged": true + } + } + } + } + } + } + }, + "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": "list" + }, + "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": "list" + }, + "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" + } + } + } + }, + "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": "list" + }, + "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" + } + } + } + }, + "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": "list" + }, + "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": "list" + }, + "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" + } + } + } + }, + "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": "list" + }, + "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" + }, + "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": "list" + }, + "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": "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": "list" + }, + "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" + } + } + } + }, + "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": "list" + }, + "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": "list" + }, + "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": "list" + }, + "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": "list" + }, + "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": "list" + }, + "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": "list" + }, + "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" + }, + "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": "list" + }, + "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." + } + }, + { + "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 + } + ], + "responses": { + "200": { + "description": "CreatePit 200 response" + } + }, + "x-operation-group": "create_pit", + "x-version-added": "1.0" + } + }, + "/{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": "list" + }, + "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" + } + } + } + }, + "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": "list" + }, + "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": "list" + }, + "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": "list" + }, + "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": "list" + }, + "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": "list" + }, + "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-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" + } + } + } + }, + "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": "list" + }, + "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-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": "list" + }, + "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": "list" + }, + "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-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": "list" + }, + "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-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" + }, + "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-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" + }, + "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-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" + }, + "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-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": "list" + }, + "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": "list" + }, + "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", + "completion", + "docs", + "fielddata", + "query_cache", + "flush", + "get", + "indexing", + "merge", + "request_cache", + "refresh", + "search", + "segments", + "store", + "warmer", + "suggest" + ], + "x-data-type": "list" + }, + "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" + }, + "operationId": "Update", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Update_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": "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" + }, + "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": "list" + }, + "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": "list" + }, + "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": "list" + }, + "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": "list" + }, + "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": "list" + }, + "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": { + "ActionObjectStructure": { + "type": "object", + "properties": { + "add": { + "$ref": "#/components/schemas/UserDefinedStructure" + }, + "remove": { + "$ref": "#/components/schemas/UserDefinedStructure" + }, + "remove_index": { + "$ref": "#/components/schemas/UserDefinedStructure" + } + } + }, + "Bulk_BodyParams": { + "type": "object", + "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" + ] + }, + "CatIndicesOutputPayload": {}, + "CatIndices_WithIndexOutputPayload": {}, + "CatNodesOutputPayload": {}, + "ClearScroll_BodyParams": { + "type": "object" + }, + "ClusterAllocationExplain_BodyParams": { + "type": "object" + }, + "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" + }, + "ClusterPutSettingsResponseContent": { + "type": "object", + "properties": { + "acknowledged": { + "type": "boolean" + }, + "persistent": { + "$ref": "#/components/schemas/UserDefinedValueMap" + }, + "transient": { + "$ref": "#/components/schemas/UserDefinedValueMap" + } + } + }, + "ClusterPutSettings_BodyParams": { + "type": "object", + "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" + }, + "Conflicts": { + "type": "string", + "description": "What to do when the operation encounters version conflicts?.", + "enum": [ + "abort", + "proceed" + ] + }, + "Count_BodyParams": { + "type": "object" + }, + "Create_BodyParams": { + "type": "object" + }, + "DefaultOperator": { + "type": "string", + "description": "The default operator for query string query (AND or OR).", + "enum": [ + "AND", + "OR" + ] + }, + "DeleteByQuery_BodyParams": { + "type": "object" + }, + "DeletePit_BodyParams": { + "type": "object" + }, + "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" + }, + "FieldCaps_BodyParams": { + "type": "object" + }, + "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" + } + } + } + }, + "Index_BodyParams": { + "type": "object" + }, + "IndicesAnalyze_BodyParams": { + "type": "object" + }, + "IndicesClone_BodyParams": { + "type": "object" + }, + "IndicesCreateDataStream_BodyParams": { + "type": "object" + }, + "IndicesCreateResponseContent": { + "type": "object", + "properties": { + "index": { + "type": "string" + }, + "shards_acknowledged": { + "type": "boolean" + }, + "acknowledged": { + "type": "boolean" + } + }, + "required": [ + "acknowledged", + "index", + "shards_acknowledged" + ] + }, + "IndicesCreate_BodyParams": { + "type": "object", + "properties": { + "aliases": { + "$ref": "#/components/schemas/UserDefinedValueMap" + }, + "mapping": { + "$ref": "#/components/schemas/UserDefinedValueMap" + }, + "settings": { + "$ref": "#/components/schemas/UserDefinedValueMap" + } + } + }, + "IndicesDeleteResponseContent": { + "type": "object", + "properties": { + "acknowledged": { + "type": "boolean" + } + } + }, + "IndicesPutAlias_BodyParams": { + "type": "object" + }, + "IndicesPutIndexTemplate_BodyParams": { + "type": "object" + }, + "IndicesPutMapping_BodyParams": { + "type": "object" + }, + "IndicesPutMapping_PostResponseContent": { + "type": "object", + "properties": { + "acknowledged": { + "type": "boolean" + } + } + }, + "IndicesPutMapping_PutResponseContent": { + "type": "object", + "properties": { + "acknowledged": { + "type": "boolean" + } + } + }, + "IndicesPutSettings_BodyParams": { + "type": "object" + }, + "IndicesPutTemplate_BodyParams": { + "type": "object" + }, + "IndicesRollover_BodyParams": { + "type": "object" + }, + "IndicesShrink_BodyParams": { + "type": "object" + }, + "IndicesSimulateIndexTemplate_BodyParams": { + "type": "object" + }, + "IndicesSimulateTemplate_BodyParams": { + "type": "object" + }, + "IndicesSplit_BodyParams": { + "type": "object" + }, + "IndicesUpdateAliasesResponseContent": { + "type": "object", + "properties": { + "acknowledged": { + "type": "boolean" + } + }, + "required": [ + "acknowledged" + ] + }, + "IndicesUpdateAliases_BodyParams": { + "type": "object", + "properties": { + "actions": { + "$ref": "#/components/schemas/ActionObjectStructure" + } + } + }, + "IndicesValidateQuery_BodyParams": { + "type": "object" + }, + "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" + }, + "IngestSimulate_BodyParams": { + "type": "object" + }, + "Mget_BodyParams": { + "type": "object" + }, + "MsearchTemplate_BodyParams": { + "type": "object", + "x-serialize": "bulk" + }, + "Msearch_BodyParams": { + "type": "object", + "x-serialize": "bulk" + }, + "Mtermvectors_BodyParams": { + "type": "object" + }, + "NodesReloadSecureSettings_BodyParams": { + "type": "object" + }, + "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" + ] + }, + "PutScript_BodyParams": { + "type": "object" + }, + "RankEval_BodyParams": { + "type": "object" + }, + "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" + }, + "Relation": { + "type": "string", + "enum": [ + "eq", + "gte" + ] + }, + "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", + "properties": { + "indices": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "indices" + ] + }, + "RenderSearchTemplate_BodyParams": { + "type": "object" + }, + "SampleType": { + "type": "string", + "description": "The type to sample.", + "enum": [ + "cpu", + "wait", + "block" + ] + }, + "ScriptsPainlessExecute_BodyParams": { + "type": "object" + }, + "Scroll_BodyParams": { + "type": "object" + }, + "SearchTemplate_BodyParams": { + "type": "object" + }, + "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", + "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" + } + } + }, + "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" + }, + "SnapshotCreateRepository_BodyParams": { + "type": "object" + }, + "SnapshotCreate_BodyParams": { + "type": "object" + }, + "SnapshotRestore_BodyParams": { + "type": "object" + }, + "Status_Member": { + "type": "string", + "enum": [ + "green", + "yellow", + "red", + "all" + ] + }, + "SuggestMode": { + "type": "string", + "description": "Specify suggest mode.", + "enum": [ + "missing", + "popular", + "always" + ] + }, + "Termvectors_BodyParams": { + "type": "object" + }, + "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" + } + } + }, + "UpdateByQuery_BodyParams": { + "type": "object" + }, + "Update_BodyParams": { + "type": "object" + }, + "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": {} + }, + "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 index e64056addd..6accfaf68e 100644 --- a/src/ApiGenerator/Program.cs +++ b/src/ApiGenerator/Program.cs @@ -132,10 +132,10 @@ private static async Task Generate(bool download, string branch, bool inclu AnsiConsole.Write(new Rule("[b white on chartreuse4] Loading specification [/]").LeftJustified()); Console.WriteLine(); - var spec = Generator.ApiGenerator.CreateRestApiSpecModel(downloadBranch, "Core"); + var spec = await Generator.ApiGenerator.CreateRestApiSpecModel(token); if (!lowLevelOnly) { - foreach (var endpoint in spec.Endpoints.Select(e => e.Value.FileName)) + foreach (var endpoint in spec.Endpoints.Select(e => e.Value.Name)) { if (CodeConfiguration.IsNewHighLevelApi(endpoint) && Ask($"Generate highlevel code for new api {endpoint}", false)) @@ -148,7 +148,7 @@ private static async Task Generate(bool download, string branch, bool inclu AnsiConsole.Write(new Rule("[b white on chartreuse4] Generating code [/]").LeftJustified()); Console.WriteLine(); - await Generator.ApiGenerator.Generate(downloadBranch, lowLevelOnly, spec, token); + await Generator.ApiGenerator.Generate(lowLevelOnly, spec, token); var warnings = Generator.ApiGenerator.Warnings; if (warnings.Count > 0) diff --git a/src/ApiGenerator/RestSpecDownloader.cs b/src/ApiGenerator/RestSpecDownloader.cs index 86ef8e2dc5..5eb276ef7a 100644 --- a/src/ApiGenerator/RestSpecDownloader.cs +++ b/src/ApiGenerator/RestSpecDownloader.cs @@ -27,146 +27,25 @@ */ using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Net; using System.Net.Http; using System.Threading; using System.Threading.Tasks; using ApiGenerator.Configuration; -using CsQuery; -using ShellProgressBar; namespace ApiGenerator { - public class RestSpecDownloader + public static class RestSpecDownloader { - private readonly string _branch; - private static readonly ProgressBarOptions MainProgressBarOptions = new ProgressBarOptions - { - BackgroundColor = ConsoleColor.DarkGray, - ProgressCharacter = '─', - }; - - private static string CommitsUrl = "https://github.com/opensearch-project/opensearch-net/commits/{branch}"; - private static readonly Dictionary OnlineSpecifications = new Dictionary - { - { "Core", "https://github.com/opensearch-project/opensearch-net/tree/{ref}/rest-api-spec/src/main/resources/rest-api-spec/api" }, - }; - - private static readonly ProgressBarOptions SubProgressBarOptions = new ProgressBarOptions - { - ForegroundColor = ConsoleColor.Cyan, - ForegroundColorDone = ConsoleColor.DarkGreen, - ProgressCharacter = '─', - BackgroundColor = ConsoleColor.DarkGray, - }; - - private RestSpecDownloader(string branch) => _branch = branch; - - private async Task DownloadAsync(CancellationToken token) - { - var @ref = await ResolveLastRef(_branch, token); - - var specifications = - (from kv in OnlineSpecifications - let url = kv.Value.Replace("{ref}", @ref) - select new Specification { FolderOnDisk = kv.Key, Branch = _branch, Ref = @ref, GithubListingUrl = url }).ToList(); - - using (var pbar = new ProgressBar(specifications.Count, "Downloading specifications", MainProgressBarOptions)) - { - foreach (var spec in specifications) - { - var specFolderOnDisk = Path.Combine(GeneratorLocations.RestSpecificationFolder, spec.FolderOnDisk); - if (Directory.Exists(specFolderOnDisk)) - { - Directory.Delete(specFolderOnDisk, true); - pbar.WriteLine($"Deleted target spec folder, before downloading new copy: {specFolderOnDisk}"); - } - pbar.Message = $"Downloading rest-api-spec to {spec.FolderOnDisk} for branch {_branch}"; - await DownloadJsonDefinitions(spec, pbar, token); - pbar.Tick($"Downloaded rest-api-spec to {spec.FolderOnDisk} for branch {_branch}"); - } - } - - await File.WriteAllTextAsync(GeneratorLocations.LastDownloadedRef, @ref, token); - - } - - public static Task DownloadAsync(string branch, CancellationToken token = default) => new RestSpecDownloader(branch).DownloadAsync(token); - - private static async Task ResolveLastRef(string branch, CancellationToken token) - { - var response = await Http.GetAsync(CommitsUrl.Replace("{branch}", branch), token); - var html = await response.Content.ReadAsStringAsync(); - var dom = CQ.Create(html); - - var prefix = "/opensearch-project/opensearch-net/commit/"; - var commit = dom["a.text-mono"] - .Select(s => s.GetAttribute("href")) - .Where(a => a.StartsWith(prefix)) - .Select(a => a.Replace(prefix, "")) - .FirstOrDefault() - ?? throw new Exception($"Can not locate the latest commit on branch: {branch}"); - return commit; - } - - private static readonly HttpClient Http = new HttpClient(); - private static async Task DownloadJsonDefinitions(Specification spec, IProgressBar pbar, CancellationToken token) - { - var response = await Http.GetAsync(spec.GithubListingUrl, token); - var html = await response.Content.ReadAsStringAsync(); - - await FindJsonFilesOnListing(spec, html, pbar, token); - } - - private static async Task FindJsonFilesOnListing(Specification spec, string html, IProgressBar pbar, CancellationToken token) - { - if (!Directory.Exists(GeneratorLocations.RestSpecificationFolder)) - Directory.CreateDirectory(GeneratorLocations.RestSpecificationFolder); - - var dom = CQ.Create(html); - - var endpoints = dom[".js-navigation-open"] - .Select(s => s.InnerText) - .Where(s => !string.IsNullOrEmpty(s) && s.EndsWith(".json")) - .ToList(); - - using var subBar = pbar.Spawn(endpoints.Count, "fetching individual json files", SubProgressBarOptions); - foreach (var e in endpoints) - await WriteEndpointFile(spec, e, subBar, token); - } - - private static async Task WriteEndpointFile(Specification spec, string s, IProgressBar pbar, CancellationToken token) - { - var rawFile = spec.GithubDownloadUrl(s); - var fileName = rawFile.Split('/').Last(); - - var response = await Http.GetAsync(rawFile, token); - var json = await response.Content.ReadAsStringAsync(); - await WriteToEndpointsFolder(spec.FolderOnDisk, fileName, json, token); - pbar.Tick($"Downloading {fileName}"); - } - - private static async Task WriteToEndpointsFolder(string folder, string filename, string contents, CancellationToken token) - { - var f = Path.Combine(GeneratorLocations.RestSpecificationFolder, folder); - if (!Directory.Exists(f)) Directory.CreateDirectory(f); - var target = Path.Combine(f, filename); - await File.WriteAllTextAsync(target, contents, token); - } - - private class Specification - { - // ReSharper disable once UnusedAutoPropertyAccessor.Local - public string Branch { get; set; } - public string Ref { get; set; } - public string FolderOnDisk { get; set; } - public string GithubListingUrl { get; set; } - - public string GithubDownloadUrl(string file) => - GithubListingUrl.Replace("github.com", "raw.githubusercontent.com").Replace("tree/", "") + "/" + file; + 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/HighLevel/Descriptors/Descriptor.cshtml b/src/ApiGenerator/Views/HighLevel/Descriptors/Descriptor.cshtml index 244b56e9e1..49b3fbfdab 100644 --- a/src/ApiGenerator/Views/HighLevel/Descriptors/Descriptor.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Descriptors/Descriptor.cshtml @@ -1,8 +1,8 @@ @using System.Linq +@using ApiGenerator @using ApiGenerator.Domain.Code.HighLevel.Requests @using ApiGenerator.Domain.Specification @using ApiGenerator.Generator -@using CsQuery.ExtensionMethods.Internal @inherits global::ApiGenerator.CodeTemplatePage @{ DescriptorPartialImplementation d = Model; diff --git a/src/ApiGenerator/Views/HighLevel/Descriptors/RequestDescriptorBase.cshtml b/src/ApiGenerator/Views/HighLevel/Descriptors/RequestDescriptorBase.cshtml index 281bf02f27..4a9ead63a0 100644 --- a/src/ApiGenerator/Views/HighLevel/Descriptors/RequestDescriptorBase.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Descriptors/RequestDescriptorBase.cshtml @@ -7,20 +7,5 @@ namespace OpenSearch.Client // ReSharper disable UnusedTypeParameter public abstract partial class @Raw("RequestDescriptorBase") { -@foreach (var common in RestApiSpec.CommonApiQueryParameters.Values) -{ - var original = common.QueryStringKey; - var t = @common.TypeHighLevel; - var tSuffix = (t == "bool" || t == "bool?") ? " = true" : ""; - ///@(Raw(string.Join("", common.DescriptionHighLevel))) - public TDescriptor @(common.ClsName)(@common.DescriptorArgumentType @common.ClsArgumentName@tSuffix) => Qs("@original", @(common.ClsArgumentName)); - - if (common.IsArray) - { - ///@(Raw(string.Join("", common.DescriptionHighLevel))) - public TDescriptor @(common.ClsName)(@Raw(common.DescriptorEnumerableArgumentType) @common.ClsArgumentName@tSuffix) => Qs("@original", @(common.ClsArgumentName)); - - } -} } } diff --git a/src/ApiGenerator/Views/HighLevel/Requests/PlainRequestBase.cshtml b/src/ApiGenerator/Views/HighLevel/Requests/PlainRequestBase.cshtml index f9cadb9648..2a0780adb1 100644 --- a/src/ApiGenerator/Views/HighLevel/Requests/PlainRequestBase.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Requests/PlainRequestBase.cshtml @@ -18,10 +18,5 @@ namespace OpenSearch.Client { public abstract partial class @Raw("PlainRequestBase") { -@foreach (var common in RestApiSpec.CommonApiQueryParameters.Values) -{ - @Raw(common.InitializerGenerator(null, common.TypeHighLevel, common.ClsName, common.QueryStringKey, "value", common.DescriptionHighLevel.ToArray())) - -} } } diff --git a/src/ApiGenerator/Views/HighLevel/Requests/RequestImplementations.cshtml b/src/ApiGenerator/Views/HighLevel/Requests/RequestImplementations.cshtml index a16e7cf4f1..a1bdfb1963 100644 --- a/src/ApiGenerator/Views/HighLevel/Requests/RequestImplementations.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Requests/RequestImplementations.cshtml @@ -1,9 +1,9 @@ @using System.Linq +@using ApiGenerator @using ApiGenerator.Domain.Code @using ApiGenerator.Domain.Code.HighLevel.Requests @using ApiGenerator.Domain.Specification @using ApiGenerator.Generator -@using CsQuery.ExtensionMethods.Internal @inherits global::ApiGenerator.CodeTemplatePage @{ RequestPartialImplementation r = Model; diff --git a/src/ApiGenerator/Views/LowLevel/Client/Methods/MethodDocs.cshtml b/src/ApiGenerator/Views/LowLevel/Client/Methods/MethodDocs.cshtml index 0ec26f8228..d4948097ab 100644 --- a/src/ApiGenerator/Views/LowLevel/Client/Methods/MethodDocs.cshtml +++ b/src/ApiGenerator/Views/LowLevel/Client/Methods/MethodDocs.cshtml @@ -1,6 +1,6 @@ +@using ApiGenerator @using ApiGenerator.Domain.Code.LowLevel @using ApiGenerator.Domain.Specification -@using CsQuery.ExtensionMethods.Internal @inherits ApiGenerator.CodeTemplatePage @{ LowLevelClientMethod method = Model; diff --git a/src/ApiGenerator/Views/LowLevel/RequestParameters/RequestParameters.cshtml b/src/ApiGenerator/Views/LowLevel/RequestParameters/RequestParameters.cshtml index 2e54e83140..79ec395893 100644 --- a/src/ApiGenerator/Views/LowLevel/RequestParameters/RequestParameters.cshtml +++ b/src/ApiGenerator/Views/LowLevel/RequestParameters/RequestParameters.cshtml @@ -3,7 +3,6 @@ @using ApiGenerator @using ApiGenerator.Domain.Code @using ApiGenerator.Domain.Specification -@using CsQuery.ExtensionMethods.Internal @inherits CodeTemplatePage>> @{ await IncludeAsync("GeneratorNotice.cshtml", Model); } @{ @@ -40,4 +39,4 @@ namespace OpenSearch.Net@(ns) } } } -} \ No newline at end of file +} diff --git a/src/ApiGenerator/packages.lock.json b/src/ApiGenerator/packages.lock.json index 9324a38065..5fd411a17e 100644 --- a/src/ApiGenerator/packages.lock.json +++ b/src/ApiGenerator/packages.lock.json @@ -2,16 +2,6 @@ "version": 1, "dependencies": { "net6.0": { - "CsQuery.Core": { - "type": "Direct", - "requested": "[2.0.1, )", - "resolved": "2.0.1", - "contentHash": "JQvgD0jBnO6M3r7SGrDfdpCak6E9ZP1hQb3T8iegkXiCs3A1JawE5TWD6q49MPY4arqVegtsB3th6J+lOXZkxA==", - "dependencies": { - "Microsoft.CSharp": "4.4.1", - "Newtonsoft.Json": "11.0.2" - } - }, "Microsoft.CodeAnalysis.CSharp": { "type": "Direct", "requested": "[4.2.0, )", @@ -36,6 +26,17 @@ "resolved": "13.0.1", "contentHash": "ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==" }, + "NSwag.Core.Yaml": { + "type": "Direct", + "requested": "[13.19.0, )", + "resolved": "13.19.0", + "contentHash": "F97HsEclpnydInq1Wrd74WDQePHQ7S+e4yKi4BiYi/hLy6s88YlpRFB3R5Bx64iRkGKesU/uGiovKtFevpW2Bw==", + "dependencies": { + "NJsonSchema.Yaml": "10.9.0", + "NSwag.Core": "13.19.0", + "YamlDotNet": "11.2.1" + } + }, "RazorLight": { "type": "Direct", "requested": "[2.1.0, )", @@ -245,6 +246,42 @@ "resolved": "1.0.3", "contentHash": "AmOJZwCqnOCNp6PPcf9joyogScWLtwy0M1WkqfEQ0M9nYwyDD7EX9ZjscKS5iYnyvteX7kzSKFCKt9I9dXA6mA==" }, + "Namotion.Reflection": { + "type": "Transitive", + "resolved": "2.1.2", + "contentHash": "7tSHAzX8GWKy0qrW6OgQWD7kAZiqzhq+m1503qczuwuK6ZYhOGCQUxw+F3F4KkRM70aB6RMslsRVSCFeouIehw==", + "dependencies": { + "Microsoft.CSharp": "4.3.0" + } + }, + "NJsonSchema": { + "type": "Transitive", + "resolved": "10.9.0", + "contentHash": "IBPo6Srxn2MEcIFM3HdM4QImrJbsIeujENQyzHL2Pv6wLsKSYAyAEilecRqaLOhoy3snEiPLx7hhv7opbhOxKQ==", + "dependencies": { + "Namotion.Reflection": "2.1.2", + "Newtonsoft.Json": "9.0.1" + } + }, + "NJsonSchema.Yaml": { + "type": "Transitive", + "resolved": "10.9.0", + "contentHash": "lGOtsydEnX1mVLT2Cyre7mST7K7crveYtai9FGC2i7COKEMEFjsfbnUtgXSHKxS/bzxVEIjLa49tR6xw34WkEw==", + "dependencies": { + "Microsoft.CSharp": "4.4.1", + "NJsonSchema": "10.9.0", + "YamlDotNet": "11.2.1" + } + }, + "NSwag.Core": { + "type": "Transitive", + "resolved": "13.19.0", + "contentHash": "UkPCsEJ5WaE6mcEjarZZfMPyyRPHOWK9YuFvxNjrSHclCxVUZ7jgFtNGMX0wy0WvXkmA5b6H9IoaAJECMxcu/g==", + "dependencies": { + "NJsonSchema": "10.9.0", + "Newtonsoft.Json": "10.0.1" + } + }, "runtime.native.System": { "type": "Transitive", "resolved": "4.3.0", @@ -459,6 +496,11 @@ "type": "Transitive", "resolved": "4.5.4", "contentHash": "zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==" + }, + "YamlDotNet": { + "type": "Transitive", + "resolved": "11.2.1", + "contentHash": "tBt8K+korVfrjH9wyDEhiLKxbs8qoLCLIFwvYgkSUuMC9//w3z0cFQ8LQAI/5MCKq+BMil0cfRTRvPeE7eXhQw==" } } } diff --git a/src/ApiGenerator/razormachine.readme.txt b/src/ApiGenerator/razormachine.readme.txt deleted file mode 100644 index ff71feef32..0000000000 --- a/src/ApiGenerator/razormachine.readme.txt +++ /dev/null @@ -1,20 +0,0 @@ -Xipton.Razor v2.6.1 - -The web.config configuration file only is for activating Razor intellisense inside Razor templates, within non MVC projects. Note that for being able to use Razor intellisense MVC 3 or MVC 4 need to be installed on your system. MVC is not needed for compiling Xipton.Razor templates. - -You need to the web.config to your non MVC template project besides your default app.config. The configured MVC and Razor assemblies (here MVC version 3) need to be installed at your environment. Xipton.Razor uses Razor 2.0 (part of MVC 4), still you can use this configuration (MVC 3, Razor 1) as long as MVC 3 has been installed at your system as well. If you do not have MVC 3 installed on your system you need to configure the MVC version (and configuration) in accordance to the version that is on your system. - -Important: -If you reference Xipton.Razor as a dll (and not as a project) and you want to use intellisense you must install the signed Xipton.Razor.dll inside the GAC (this is required only for being able to use intellisense, not for deployment).In that case the @model directive does not work together with intellisense (the template will compile though). Therefore if referencing Xipton.Razor as a signed dll (that must have been installed inside the GAC) you need to use the @inherits directive for a working intellisense like "@inherits Xipton.Razor.TemplateBase". - -Within MVC projects: -If you work with Xipton.Razor together with MVC, then you use your MVC project's app.config. In that case you could install the Xipton.Razor.dll in the GAC as well. Inside the MVC app.config you add an assembly reference for the Xipton.Razor.dll like: - - - - - - - -Now inside your Xipton.Razor templates you need to use the directive @inherits, like "@inherits Xipton.Razor.TemplateBase", instead of the @model directive. - From 5dc9ef285ba3e73ed99b40513355e3976e213be8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 20 Jun 2023 12:25:40 +1200 Subject: [PATCH 04/27] 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] --- src/ApiGenerator/ApiGenerator.csproj | 4 ++-- src/ApiGenerator/packages.lock.json | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ApiGenerator/ApiGenerator.csproj b/src/ApiGenerator/ApiGenerator.csproj index 4505f23ddf..9983babff7 100644 --- a/src/ApiGenerator/ApiGenerator.csproj +++ b/src/ApiGenerator/ApiGenerator.csproj @@ -1,4 +1,4 @@ - + Exe @@ -10,7 +10,7 @@ - + diff --git a/src/ApiGenerator/packages.lock.json b/src/ApiGenerator/packages.lock.json index 5fd411a17e..439f978c99 100644 --- a/src/ApiGenerator/packages.lock.json +++ b/src/ApiGenerator/packages.lock.json @@ -22,9 +22,9 @@ }, "Newtonsoft.Json": { "type": "Direct", - "requested": "[13.0.1, )", - "resolved": "13.0.1", - "contentHash": "ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==" + "requested": "[13.0.3, )", + "resolved": "13.0.3", + "contentHash": "HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==" }, "NSwag.Core.Yaml": { "type": "Direct", From 681b16b51c649d220c98087f5511fd63ab0d72f7 Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Wed, 21 Jun 2023 00:35:05 +1200 Subject: [PATCH 05/27] Upgrade RazorLight and use embedded resource project (#233) Signed-off-by: Thomas Farr --- src/ApiGenerator/ApiGenerator.csproj | 3 +- src/ApiGenerator/CodeTemplatePage.cs | 15 +++--- .../Configuration/ViewLocations.cs | 11 ++-- .../Razor/ApiUrlsLookupsGenerator.cs | 2 +- .../Generator/Razor/DescriptorsGenerator.cs | 2 +- .../Generator/Razor/EnumsGenerator.cs | 2 +- .../HighLevelClientImplementationGenerator.cs | 2 +- .../HighLevelClientInterfaceGenerator.cs | 2 +- .../LowLevelClientImplementationGenerator.cs | 2 +- .../Razor/LowLevelClientInterfaceGenerator.cs | 2 +- .../Generator/Razor/RazorGeneratorBase.cs | 14 +++--- .../Generator/Razor/RequestsGenerator.cs | 2 +- src/ApiGenerator/Program.cs | 2 +- .../Client/FluentSyntax/FluentMethod.cshtml | 14 +++--- .../FluentSyntax/FluentMethodHeader.cshtml | 16 +++--- .../MethodImplementation.cshtml | 19 ++++--- .../OpenSearchClient.Namespace.cshtml | 16 +++--- .../Implementation/OpenSearchClient.cshtml | 7 ++- .../InitializerMethod.cshtml | 10 ++-- .../InitializerMethodHeader.cshtml | 12 ++--- .../Client/Interface/IOpenSearchClient.cshtml | 13 +++-- .../Client/Interface/MethodInterface.cshtml | 32 ++++++------ .../HighLevel/Client/MethodXmlDocs.cshtml | 7 +-- .../Views/HighLevel/Client/Usings.cshtml | 6 +-- .../HighLevel/Descriptors/Descriptor.cshtml | 20 ++++---- .../HighLevel/Descriptors/Descriptors.cshtml | 12 ++--- .../HighLevel/Descriptors/XmlDocs.cshtml | 7 +-- .../HighLevel/Requests/ApiUrlsLookup.cshtml | 9 ++-- .../Requests/PlainRequestBase.cshtml | 3 +- .../Requests/RequestImplementations.cshtml | 50 +++++++++---------- .../Requests/RequestInterface.cshtml | 16 +++--- .../Views/HighLevel/Requests/Requests.cshtml | 12 ++--- .../OpenSearchLowLevelClient.Namespace.cshtml | 15 +++--- .../OpenSearchLowLevelClient.cshtml | 12 ++--- .../IOpenSearchLowLevelClient.cshtml | 13 +++-- .../LowLevel/Client/Methods/MethodDocs.cshtml | 21 ++++---- .../Methods/MethodImplementation.cshtml | 17 +++---- .../Client/Methods/MethodInterface.cshtml | 11 ++-- .../Views/LowLevel/Client/Usings.cshtml | 6 +-- .../Views/LowLevel/Enums.Generated.cshtml | 11 ++-- .../RequestParameters.cshtml | 8 ++- src/ApiGenerator/packages.lock.json | 6 +-- 42 files changed, 204 insertions(+), 258 deletions(-) diff --git a/src/ApiGenerator/ApiGenerator.csproj b/src/ApiGenerator/ApiGenerator.csproj index 9983babff7..7ecdcb16ac 100644 --- a/src/ApiGenerator/ApiGenerator.csproj +++ b/src/ApiGenerator/ApiGenerator.csproj @@ -15,10 +15,11 @@ - + + diff --git a/src/ApiGenerator/CodeTemplatePage.cs b/src/ApiGenerator/CodeTemplatePage.cs index 7b59c684af..8b14cd1ead 100644 --- a/src/ApiGenerator/CodeTemplatePage.cs +++ b/src/ApiGenerator/CodeTemplatePage.cs @@ -26,17 +26,16 @@ * under the License. */ -using System; using System.Threading.Tasks; using RazorLight; -namespace ApiGenerator +namespace ApiGenerator { - /// This only exists to make the IDE tooling happy, not actually used to render the templates - public class CodeTemplatePage : TemplatePage - { - public override Task ExecuteAsync() => throw new NotImplementedException(); + public abstract class CodeTemplatePage : TemplatePage + { + protected new Task IncludeAsync(string key, object model = null) + => base.IncludeAsync(key.Replace('/', '.'), model); - public Task Execute() => Task.CompletedTask; - } + protected async Task IncludeGeneratorNotice() => await IncludeAsync("GeneratorNotice"); + } } diff --git a/src/ApiGenerator/Configuration/ViewLocations.cs b/src/ApiGenerator/Configuration/ViewLocations.cs index 5adfd3c46d..3339f85d1d 100644 --- a/src/ApiGenerator/Configuration/ViewLocations.cs +++ b/src/ApiGenerator/Configuration/ViewLocations.cs @@ -26,15 +26,12 @@ * under the License. */ -namespace ApiGenerator.Configuration +namespace ApiGenerator.Configuration { public static class ViewLocations { - public static string Root { get; } = $@"{GeneratorLocations.Root}Views/"; - private static string HighLevelRoot { get; } = $@"{Root}/HighLevel/"; - public static string HighLevel(params string[] paths) => HighLevelRoot + string.Join("/", paths); - - private static string LowLevelRoot { get; } = $@"{Root}/LowLevel/"; - public static string LowLevel(params string[] paths) => LowLevelRoot + string.Join("/", paths); + 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/Generator/Razor/ApiUrlsLookupsGenerator.cs b/src/ApiGenerator/Generator/Razor/ApiUrlsLookupsGenerator.cs index 35189de048..c0a2fef2bd 100644 --- a/src/ApiGenerator/Generator/Razor/ApiUrlsLookupsGenerator.cs +++ b/src/ApiGenerator/Generator/Razor/ApiUrlsLookupsGenerator.cs @@ -43,7 +43,7 @@ public override async Task Generate(RestApiSpec spec, ProgressBar progressBar, C var view = ViewLocations.HighLevel("Requests", "ApiUrlsLookup.cshtml"); var target = GeneratorLocations.HighLevel("_Generated", "ApiUrlsLookup.generated.cs"); - await DoRazor(spec, view, target, null, token); + await DoRazor(spec, view, target, token); } } } diff --git a/src/ApiGenerator/Generator/Razor/DescriptorsGenerator.cs b/src/ApiGenerator/Generator/Razor/DescriptorsGenerator.cs index fa9e3f7ff8..523ea35145 100644 --- a/src/ApiGenerator/Generator/Razor/DescriptorsGenerator.cs +++ b/src/ApiGenerator/Generator/Razor/DescriptorsGenerator.cs @@ -48,7 +48,7 @@ public override async Task Generate(RestApiSpec spec, ProgressBar progressBar, C var view = ViewLocations.HighLevel("Descriptors", "RequestDescriptorBase.cshtml"); var target = GeneratorLocations.HighLevel("Descriptors.cs"); - await DoRazor(spec, view, target, null, token); + await DoRazor(spec, view, target, token); var dependantView = ViewLocations.HighLevel("Descriptors", "Descriptors.cshtml"); string Target(string id) => GeneratorLocations.HighLevel($"Descriptors.{id}.cs"); diff --git a/src/ApiGenerator/Generator/Razor/EnumsGenerator.cs b/src/ApiGenerator/Generator/Razor/EnumsGenerator.cs index 3708c5051a..74d3c56830 100644 --- a/src/ApiGenerator/Generator/Razor/EnumsGenerator.cs +++ b/src/ApiGenerator/Generator/Razor/EnumsGenerator.cs @@ -43,7 +43,7 @@ public override async Task Generate(RestApiSpec spec, ProgressBar progressBar, C var view = ViewLocations.LowLevel("Enums.Generated.cshtml"); var target = GeneratorLocations.LowLevel("Api", "Enums.Generated.cs"); - await DoRazor(spec, view, target, null, token); + await DoRazor(spec, view, target, token); } } } diff --git a/src/ApiGenerator/Generator/Razor/HighLevelClientImplementationGenerator.cs b/src/ApiGenerator/Generator/Razor/HighLevelClientImplementationGenerator.cs index a37dc00761..eacbe058e8 100644 --- a/src/ApiGenerator/Generator/Razor/HighLevelClientImplementationGenerator.cs +++ b/src/ApiGenerator/Generator/Razor/HighLevelClientImplementationGenerator.cs @@ -49,7 +49,7 @@ public override async Task Generate(RestApiSpec spec, ProgressBar progressBar, C var view = ViewLocations.HighLevel("Client", "Implementation", "OpenSearchClient.cshtml"); var target = GeneratorLocations.HighLevel($"OpenSearchClient.{CsharpNames.RootNamespace}.cs"); - await DoRazor(spec, view, target, null, token); + await DoRazor(spec, view, target, token); string Target(string id) => GeneratorLocations.HighLevel($"OpenSearchClient.{id}.cs"); diff --git a/src/ApiGenerator/Generator/Razor/HighLevelClientInterfaceGenerator.cs b/src/ApiGenerator/Generator/Razor/HighLevelClientInterfaceGenerator.cs index 9b35b9a919..b9957db2f5 100644 --- a/src/ApiGenerator/Generator/Razor/HighLevelClientInterfaceGenerator.cs +++ b/src/ApiGenerator/Generator/Razor/HighLevelClientInterfaceGenerator.cs @@ -43,7 +43,7 @@ public override async Task Generate(RestApiSpec spec, ProgressBar progressBar, C var view = ViewLocations.HighLevel("Client", "Interface", "IOpenSearchClient.cshtml"); var target = GeneratorLocations.HighLevel("IOpenSearchClient.Generated.cs"); - await DoRazor(spec, view, target, null, token); + await DoRazor(spec, view, target, token); } } } diff --git a/src/ApiGenerator/Generator/Razor/LowLevelClientImplementationGenerator.cs b/src/ApiGenerator/Generator/Razor/LowLevelClientImplementationGenerator.cs index bd41fac4b8..da174b21db 100644 --- a/src/ApiGenerator/Generator/Razor/LowLevelClientImplementationGenerator.cs +++ b/src/ApiGenerator/Generator/Razor/LowLevelClientImplementationGenerator.cs @@ -49,7 +49,7 @@ public override async Task Generate(RestApiSpec spec, ProgressBar progressBar, C var view = ViewLocations.LowLevel("Client", "Implementation", "OpenSearchLowLevelClient.cshtml"); var target = GeneratorLocations.LowLevel($"OpenSearchLowLevelClient.{CsharpNames.RootNamespace}.cs"); - await DoRazor(spec, view, target, null, token); + await DoRazor(spec, view, target, token); var namespaced = spec.EndpointsPerNamespaceLowLevel.Where(kv => kv.Key != CsharpNames.RootNamespace).ToList(); var namespacedView = ViewLocations.LowLevel("Client", "Implementation", "OpenSearchLowLevelClient.Namespace.cshtml"); diff --git a/src/ApiGenerator/Generator/Razor/LowLevelClientInterfaceGenerator.cs b/src/ApiGenerator/Generator/Razor/LowLevelClientInterfaceGenerator.cs index f1d31074ce..6340b66b35 100644 --- a/src/ApiGenerator/Generator/Razor/LowLevelClientInterfaceGenerator.cs +++ b/src/ApiGenerator/Generator/Razor/LowLevelClientInterfaceGenerator.cs @@ -43,7 +43,7 @@ public override async Task Generate(RestApiSpec spec, ProgressBar progressBar, C var view = ViewLocations.LowLevel("Client", "Interface", "IOpenSearchLowLevelClient.cshtml"); var target = GeneratorLocations.LowLevel("IOpenSearchLowLevelClient.Generated.cs"); - await DoRazor(spec, view, target, null, token); + await DoRazor(spec, view, target, token); } } } diff --git a/src/ApiGenerator/Generator/Razor/RazorGeneratorBase.cs b/src/ApiGenerator/Generator/Razor/RazorGeneratorBase.cs index e24e7803ad..8a4ef0200a 100644 --- a/src/ApiGenerator/Generator/Razor/RazorGeneratorBase.cs +++ b/src/ApiGenerator/Generator/Razor/RazorGeneratorBase.cs @@ -45,18 +45,18 @@ namespace ApiGenerator.Generator.Razor public abstract class RazorGeneratorBase { private static readonly RazorLightEngine Engine = new RazorLightEngineBuilder() - .UseProject(new FileSystemRazorProject(Path.GetFullPath(ViewLocations.Root))) - .UseMemoryCachingProvider() + .UseProject(new EmbeddedRazorProject(typeof(CodeTemplatePage<>).Assembly, "ApiGenerator.Views")) + .SetOperatingAssembly(typeof(CodeTemplatePage<>).Assembly) + .UseMemoryCachingProvider() + .EnableDebugMode() .Build(); - protected async Task DoRazor(TModel model, string viewLocation, string targetLocation, string cacheNameSuffix, CancellationToken token) + protected async Task DoRazor(TModel model, string viewLocation, string targetLocation, CancellationToken token) { try { - var name = GetType().Name + cacheNameSuffix; - var sourceFileContents = await File.ReadAllTextAsync(viewLocation, token); token.ThrowIfCancellationRequested(); - var generated = await Engine.CompileRenderStringAsync(name, sourceFileContents, model); + var generated = await Engine.CompileRenderAsync(viewLocation, model); WriteFormattedCsharpFile(targetLocation, generated); } catch (TemplateGenerationException e) @@ -82,7 +82,7 @@ CancellationToken token { var id = identifier(item); var targetLocation = target(id); - await DoRazor(item, viewLocation, targetLocation, id, token); + await DoRazor(item, viewLocation, targetLocation, token); c.Tick($"{Title}: {id}"); } } diff --git a/src/ApiGenerator/Generator/Razor/RequestsGenerator.cs b/src/ApiGenerator/Generator/Razor/RequestsGenerator.cs index c7aa78b624..60ca992f73 100644 --- a/src/ApiGenerator/Generator/Razor/RequestsGenerator.cs +++ b/src/ApiGenerator/Generator/Razor/RequestsGenerator.cs @@ -48,7 +48,7 @@ public override async Task Generate(RestApiSpec spec, ProgressBar progressBar, C var view = ViewLocations.HighLevel("Requests", "PlainRequestBase.cshtml"); var target = GeneratorLocations.HighLevel("Requests.cs"); - await DoRazor(spec, view, target, null, token); + await DoRazor(spec, view, target, token); var dependantView = ViewLocations.HighLevel("Requests", "Requests.cshtml"); string Target(string id) => GeneratorLocations.HighLevel($"Requests.{id}.cs"); diff --git a/src/ApiGenerator/Program.cs b/src/ApiGenerator/Program.cs index 6accfaf68e..4a219ddf11 100644 --- a/src/ApiGenerator/Program.cs +++ b/src/ApiGenerator/Program.cs @@ -77,7 +77,7 @@ private static async Task Main( AnsiConsole.WriteLine(); AnsiConsole.Write(new Rule("[b white on darkred] Exception [/]").LeftJustified()); AnsiConsole.WriteLine(); - AnsiConsole.WriteException(ex); + AnsiConsole.WriteException(ex, ExceptionFormats.ShowLinks); return 1; } return 0; diff --git a/src/ApiGenerator/Views/HighLevel/Client/FluentSyntax/FluentMethod.cshtml b/src/ApiGenerator/Views/HighLevel/Client/FluentSyntax/FluentMethod.cshtml index 5847b6ee46..10b88e61eb 100644 --- a/src/ApiGenerator/Views/HighLevel/Client/FluentSyntax/FluentMethod.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Client/FluentSyntax/FluentMethod.cshtml @@ -2,19 +2,17 @@ @using ApiGenerator.Domain.Code.HighLevel.Methods @inherits ApiGenerator.CodeTemplatePage @{ - FluentSyntaxBase syntax = Model.Syntax; - - var method = !Model.Async ? syntax.MethodName : string.Format("{0}Async", syntax.MethodName); + 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 = syntax.RequestMethodGenerics; - var descriptor = syntax.DescriptorName; - var selectorArgs = syntax.SelectorArguments(); - var selectorChained = syntax.SelectorChainedDefaults(); + 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", syntax); } +@{ 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 index 547c087257..fa7873f2d9 100644 --- a/src/ApiGenerator/Views/HighLevel/Client/FluentSyntax/FluentMethodHeader.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Client/FluentSyntax/FluentMethodHeader.cshtml @@ -1,16 +1,14 @@ @using ApiGenerator.Domain.Code.HighLevel.Methods @inherits ApiGenerator.CodeTemplatePage @{ - FluentSyntaxBase syntax = Model.Syntax; - - var response = !Model.Async ? syntax.ResponseName : string.Format("Task<{0}>", syntax.ResponseName); - var method = !Model.Async ? syntax.MethodName : string.Format("{0}Async", syntax.MethodName); + 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 = syntax.MethodGenerics; - var descriptorArgs = syntax.DescriptorArguments(); - var selector = syntax.Selector; - var optionalSelector = syntax.OptionalSelectorSuffix; - var whereClause = syntax.GenericWhereClause; + 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 index 978a9b2a3e..6469fa22f1 100644 --- a/src/ApiGenerator/Views/HighLevel/Client/Implementation/MethodImplementation.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Client/Implementation/MethodImplementation.cshtml @@ -3,18 +3,17 @@ @using HighLevelModel = ApiGenerator.Domain.Code.HighLevel.Methods.HighLevelModel @inherits CodeTemplatePage @{ - HighLevelModel model = Model; - var fluentPath = "HighLevel/Client/FluentSyntax/FluentMethod.cshtml"; - var initializerPath = "HighLevel/Client/InitializerSyntax/InitializerMethod.cshtml"; + 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.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(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)); } +@{ 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 index 31934d8da9..7073b4271b 100644 --- a/src/ApiGenerator/Views/HighLevel/Client/Implementation/OpenSearchClient.Namespace.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Client/Implementation/OpenSearchClient.Namespace.cshtml @@ -5,30 +5,28 @@ @using ApiGenerator.Domain.Specification @inherits ApiGenerator.CodeTemplatePage>> @{ - KeyValuePair> model = Model; - string ns = model.Key; - var endpoints = model.Value; + var (ns, endpoints) = Model; } -@{ await IncludeAsync("GeneratorNotice.cshtml", model); } +@{ await IncludeGeneratorNotice(); } // ReSharper disable RedundantUsingDirective using System; using System.Threading; using System.Threading.Tasks; -using OpenSearch.Net.@(CsharpNames.ApiNamespace).@(ns)@(CsharpNames.ApiNamespaceSuffix); +using OpenSearch.Net.@(CsharpNames.ApiNamespace).@ns@(CsharpNames.ApiNamespaceSuffix); // ReSharper disable once CheckNamespace // ReSharper disable RedundantTypeArgumentsOfMethod -namespace OpenSearch.Client.@(CsharpNames.ApiNamespace).@(ns)@(CsharpNames.ApiNamespaceSuffix) +namespace OpenSearch.Client.@(CsharpNames.ApiNamespace).@ns@(CsharpNames.ApiNamespaceSuffix) { /// - /// @(ns.SplitPascalCase()) APIs. + /// @ns.SplitPascalCase() APIs. /// Not intended to be instantiated directly. Use the property /// on . /// /// - public class @(CsharpNames.HighLevelClientNamespacePrefix)@(model.Key)@(CsharpNames.ClientNamespaceSuffix) : NamespacedClientProxy + public class @(CsharpNames.HighLevelClientNamespacePrefix)@ns@(CsharpNames.ClientNamespaceSuffix) : NamespacedClientProxy { - internal @(CsharpNames.HighLevelClientNamespacePrefix)@(model.Key)@(CsharpNames.ClientNamespaceSuffix)(OpenSearchClient client) : base(client) {} + 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 index 1fa8f03b90..5b65ac4ba7 100644 --- a/src/ApiGenerator/Views/HighLevel/Client/Implementation/OpenSearchClient.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Client/Implementation/OpenSearchClient.cshtml @@ -3,7 +3,7 @@ @using ApiGenerator @using ApiGenerator.Domain.Code @inherits CodeTemplatePage -@{ await IncludeAsync("GeneratorNotice.cshtml", Model); } +@{ await IncludeGeneratorNotice(); } // ReSharper disable RedundantUsingDirective using System; using System.Threading; @@ -12,8 +12,7 @@ using OpenSearch.Client; @{ await IncludeAsync("HighLevel/Client/Usings.cshtml", Model);} @{ - RestApiSpec model = Model; - var namespaces = model.EndpointsPerNamespaceHighLevel.Keys.Where(k => k != CsharpNames.RootNamespace).ToList(); + var namespaces = Model.EndpointsPerNamespaceHighLevel.Keys.Where(k => k != CsharpNames.RootNamespace).ToList(); // ReSharper disable RedundantTypeArgumentsOfMethod namespace OpenSearch.Client @@ -44,7 +43,7 @@ namespace OpenSearch.Client - foreach (var kv in model.EndpointsPerNamespaceHighLevel) + foreach (var kv in Model.EndpointsPerNamespaceHighLevel) { if (kv.Key != CsharpNames.RootNamespace) { diff --git a/src/ApiGenerator/Views/HighLevel/Client/InitializerSyntax/InitializerMethod.cshtml b/src/ApiGenerator/Views/HighLevel/Client/InitializerSyntax/InitializerMethod.cshtml index ea70731bcc..0526bad6b1 100644 --- a/src/ApiGenerator/Views/HighLevel/Client/InitializerSyntax/InitializerMethod.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Client/InitializerSyntax/InitializerMethod.cshtml @@ -2,11 +2,9 @@ @using ApiGenerator.Domain.Code.HighLevel.Methods @inherits ApiGenerator.CodeTemplatePage @{ - InitializerMethod syntax = Model.Syntax; - - var dispatchMethod = !Model.Async ? syntax.DispatchMethod : string.Format("{0}Async", syntax.DispatchMethod); - var dispatchGenerics = syntax.DispatchGenerics; - var dispatchParameters = syntax.DispatchParameters; + 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; @@ -15,7 +13,7 @@ dispatchParameters += ", ct"; } } -@{ await IncludeAsync("HighLevel/Client/MethodXmlDocs.cshtml", syntax); } +@{ 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 index aaf70f0c83..f93edc5877 100644 --- a/src/ApiGenerator/Views/HighLevel/Client/InitializerSyntax/InitializerMethodHeader.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Client/InitializerSyntax/InitializerMethodHeader.cshtml @@ -1,17 +1,15 @@ @using ApiGenerator.Domain.Code.HighLevel.Methods @inherits ApiGenerator.CodeTemplatePage @{ - InitializerMethod syntax = Model.Syntax; - - var response = !Model.Async ? syntax.ResponseName : string.Format("Task<{0}>", syntax.ResponseName); - var method = !Model.Async ? syntax.MethodName : string.Format("{0}Async", syntax.MethodName); - var requestMethodGenerics = syntax.MethodGenerics; + 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", syntax.ArgumentType); + var methodsArgs = string.Format("{0} request", Model.Syntax.ArgumentType); if (Model.Async) { methodsArgs += ", CancellationToken ct = default"; } - var whereClause = syntax.GenericWhereClause; + 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 index 6b82e4375a..2cef1f859e 100644 --- a/src/ApiGenerator/Views/HighLevel/Client/Interface/IOpenSearchClient.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Client/Interface/IOpenSearchClient.cshtml @@ -3,7 +3,7 @@ @using ApiGenerator.Domain @using ApiGenerator.Domain.Code @inherits ApiGenerator.CodeTemplatePage -@{ await IncludeAsync("GeneratorNotice.cshtml", Model); } +@{ await IncludeGeneratorNotice(); } // ReSharper disable RedundantUsingDirective using System; using System.Collections.Generic; @@ -20,17 +20,16 @@ namespace OpenSearch.Client /// public partial interface IOpenSearchClient { - @foreach(var kv in Model.EndpointsPerNamespaceHighLevel) + @foreach(var (ns, endpoints) in Model.EndpointsPerNamespaceHighLevel) { - if (kv.Key != CsharpNames.RootNamespace) + if (ns != CsharpNames.RootNamespace) { - ///@(kv.Key.SplitPascalCase()) APIs - @CsharpNames.HighLevelClientNamespacePrefix@(kv.Key)@CsharpNames.ClientNamespaceSuffix @kv.Key { get; } + ///@ns.SplitPascalCase() APIs + @CsharpNames.HighLevelClientNamespacePrefix@(ns)@CsharpNames.ClientNamespaceSuffix @ns { get; } continue; } - var endpoints = kv.Value; - var models = endpoints.Select(e=>e.HighLevelModel).ToList(); + var models = endpoints.Select(e=>e.HighLevelModel).ToList(); foreach(var m in models) { 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 index e0db8b1671..e9e336e5af 100644 --- a/src/ApiGenerator/Views/HighLevel/Client/Interface/MethodInterface.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Client/Interface/MethodInterface.cshtml @@ -3,27 +3,27 @@ @using HighLevelModel = ApiGenerator.Domain.Code.HighLevel.Methods.HighLevelModel @inherits CodeTemplatePage @{ - HighLevelModel model = Model; - var fluentPath = "HighLevel/Client/FluentSyntax/FluentMethodHeader.cshtml"; - var initializerPath = "HighLevel/Client/InitializerSyntax/InitializerMethodHeader.cshtml"; + 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("HighLevel/Client/MethodXmlDocs.cshtml", model.Fluent); } -@{ await IncludeAsync(fluentPath, new FluentSyntaxView(model.Fluent, async: false)); }; -@{ await IncludeAsync("HighLevel/Client/MethodXmlDocs.cshtml", model.Fluent); } -@{ await IncludeAsync(fluentPath, new FluentSyntaxView(model.Fluent, async: true)); }; +@{ 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) +@if (Model.FluentBound != null) { - @{ await IncludeAsync("HighLevel/Client/MethodXmlDocs.cshtml", model.FluentBound); } - @{ await IncludeAsync(fluentPath, new FluentSyntaxView(model.FluentBound, async: false)); }; - @{ await IncludeAsync("HighLevel/Client/MethodXmlDocs.cshtml", model.FluentBound); } - @{ await IncludeAsync(fluentPath, new FluentSyntaxView(model.FluentBound, async: true)); }; + @{ 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("HighLevel/Client/MethodXmlDocs.cshtml", model.Initializer); } -@{ await IncludeAsync(initializerPath, new InitializerSyntaxView(model.Initializer, async: false)); }; -@{ await IncludeAsync("HighLevel/Client/MethodXmlDocs.cshtml", model.Initializer); } -@{ await IncludeAsync(initializerPath, new InitializerSyntaxView(model.Initializer, 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 index e93b97856c..26445d9ea9 100644 --- a/src/ApiGenerator/Views/HighLevel/Client/MethodXmlDocs.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Client/MethodXmlDocs.cshtml @@ -1,11 +1,8 @@ @using ApiGenerator @using ApiGenerator.Domain.Code.HighLevel.Methods; @inherits CodeTemplatePage -@{ - var syntax = Model; -} /// -/// @Raw(syntax.XmlDocSummary) +/// @Raw(Model.XmlDocSummary) /// @Raw("") -/// @syntax.DocumentationLink +/// @Model.DocumentationLink /// diff --git a/src/ApiGenerator/Views/HighLevel/Client/Usings.cshtml b/src/ApiGenerator/Views/HighLevel/Client/Usings.cshtml index 53dcab591c..807e3e4ed5 100644 --- a/src/ApiGenerator/Views/HighLevel/Client/Usings.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Client/Usings.cshtml @@ -1,11 +1,11 @@ @using ApiGenerator.Domain @using ApiGenerator.Domain.Code @inherits ApiGenerator.CodeTemplatePage -@foreach(var kv in Model.EndpointsPerNamespaceHighLevel) +@foreach(var ns in Model.EndpointsPerNamespaceHighLevel.Keys) { - if (kv.Key != CsharpNames.RootNamespace) + if (ns != CsharpNames.RootNamespace) { -using OpenSearch.Client.@(CsharpNames.ApiNamespace).@(kv.Key)@(CsharpNames.ApiNamespaceSuffix); +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 index 49b3fbfdab..6fcd52d0fe 100644 --- a/src/ApiGenerator/Views/HighLevel/Descriptors/Descriptor.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Descriptors/Descriptor.cshtml @@ -1,33 +1,31 @@ @using System.Linq @using ApiGenerator @using ApiGenerator.Domain.Code.HighLevel.Requests -@using ApiGenerator.Domain.Specification @using ApiGenerator.Generator @inherits global::ApiGenerator.CodeTemplatePage @{ - DescriptorPartialImplementation d = Model; - var names = d.CsharpNames; + var names = Model.CsharpNames; var type = names.GenericOrNonGenericDescriptorName; var concreteInterface = names.GenericOrNonGenericInterfaceName; var baseInterface = names.GenericOrNonGenericInterfacePreference; - var apiLookup = $"ApiUrlsLookups.{d.CsharpNames.Namespace}{d.CsharpNames.MethodName}"; + var apiLookup = $"ApiUrlsLookups.{Model.CsharpNames.Namespace}{Model.CsharpNames.MethodName}"; } - ///Descriptor for @names.MethodName@Raw(d.OfficialDocumentationLink.IsNullOrEmpty() ? "" : " " + d.OfficialDocumentationLink + "") + ///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 (Constructor c in d.Constructors) +@foreach (var c in Model.Constructors) { @(Raw(CodeGenerator.Constructor(c))) } // values part of the url path -@foreach (UrlPart part in d.Parts) +@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 (FluentRouteSetter c in d.GetFluentRouteSetters()) +@foreach (var c in Model.GetFluentRouteSetters()) { @(Raw(c.XmlDoc)) @@ -35,16 +33,16 @@ } // Request parameters -@foreach (var param in d.Params) +@foreach (var param in Model.Params) { var original = param.QueryStringKey; //skip parameters already part of the path portion of the url - if (d.Parts.Any(p=>p.Name == original)) + if (Model.Parts.Any(p=>p.Name == original)) { continue; } //we prefer this parameter to be explictly implemented on the request body - if (param.RenderPartial && (d.HasBody)) + if (param.RenderPartial && (Model.HasBody)) { continue; } diff --git a/src/ApiGenerator/Views/HighLevel/Descriptors/Descriptors.cshtml b/src/ApiGenerator/Views/HighLevel/Descriptors/Descriptors.cshtml index 51ee81f6e7..84f3949367 100644 --- a/src/ApiGenerator/Views/HighLevel/Descriptors/Descriptors.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Descriptors/Descriptors.cshtml @@ -1,15 +1,13 @@ -@using System.Collections.Generic @using System.Collections.ObjectModel @using ApiGenerator @using ApiGenerator.Domain.Specification @using ApiGenerator.Domain.Code @inherits CodeTemplatePage>> @{ - KeyValuePair> model = Model; - string ns = model.Key != CsharpNames.RootNamespace ? "."+CsharpNames.ApiNamespace+"." + model.Key + CsharpNames.ApiNamespaceSuffix : null; - var endpoints = model.Value; + var (ns, endpoints) = Model; + ns = ns != CsharpNames.RootNamespace ? $".{CsharpNames.ApiNamespace}.{ns}{CsharpNames.ApiNamespaceSuffix}" : null; } -@{ await IncludeAsync("GeneratorNotice.cshtml", Model); } +@{ await IncludeGeneratorNotice(); } // ReSharper disable RedundantUsingDirective using System; using System.Collections.Generic; @@ -19,7 +17,7 @@ using System.Linq.Expressions; using OpenSearch.Net; using OpenSearch.Net.Utf8Json; -@if (model.Key != CsharpNames.RootNamespace) +@if (ns != CsharpNames.RootNamespace) { using OpenSearch.Net@(ns); @@ -35,4 +33,4 @@ namespace OpenSearch.Client { await IncludeAsync("HighLevel/Descriptors/Descriptor.cshtml", endpoint.DescriptorPartialImplementation); } -} \ No newline at end of file +} diff --git a/src/ApiGenerator/Views/HighLevel/Descriptors/XmlDocs.cshtml b/src/ApiGenerator/Views/HighLevel/Descriptors/XmlDocs.cshtml index ded98d8e91..5015387ffa 100644 --- a/src/ApiGenerator/Views/HighLevel/Descriptors/XmlDocs.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Descriptors/XmlDocs.cshtml @@ -1,11 +1,8 @@ -@using System @using System.Linq -@using System.Collections.Generic @inherits ApiGenerator.CodeTemplatePage> @{ - List summary = Model; - var description = summary.Count == 1 ? summary.First() : string.Join($"{Environment.NewLine}\t\t", summary.Select(d => "/// " + d)); - if (summary.Count == 1) + var description = Model.Count == 1 ? Model.First() : string.Join($"{Environment.NewLine}\t\t", Model.Select(d => "/// " + d)); + if (Model.Count == 1) { ///@Raw(description) } diff --git a/src/ApiGenerator/Views/HighLevel/Requests/ApiUrlsLookup.cshtml b/src/ApiGenerator/Views/HighLevel/Requests/ApiUrlsLookup.cshtml index 9f2e38ffc7..92c71f127f 100644 --- a/src/ApiGenerator/Views/HighLevel/Requests/ApiUrlsLookup.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Requests/ApiUrlsLookup.cshtml @@ -3,15 +3,12 @@ @using ApiGenerator @using ApiGenerator.Configuration @inherits CodeTemplatePage -@{ - RestApiSpec m = Model; -} -@{ await IncludeAsync("GeneratorNotice.cshtml", m); } +@{ await IncludeGeneratorNotice(); } namespace OpenSearch.Client { internal static class ApiUrlsLookups { -@foreach (var endpoint in m.Endpoints.Values) +@foreach (var endpoint in Model.Endpoints.Values) { if (CodeConfiguration.IgnoreHighLevelApi(endpoint.Name)) { @@ -24,4 +21,4 @@ namespace OpenSearch.Client } } -} \ No newline at end of file +} diff --git a/src/ApiGenerator/Views/HighLevel/Requests/PlainRequestBase.cshtml b/src/ApiGenerator/Views/HighLevel/Requests/PlainRequestBase.cshtml index 2a0780adb1..b042d9c1e5 100644 --- a/src/ApiGenerator/Views/HighLevel/Requests/PlainRequestBase.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Requests/PlainRequestBase.cshtml @@ -1,7 +1,6 @@ -@using System.Linq @using ApiGenerator.Domain @inherits ApiGenerator.CodeTemplatePage -@{ await IncludeAsync("GeneratorNotice.cshtml", Model); } +@{ await IncludeGeneratorNotice(); } // ReSharper disable RedundantUsingDirective using System; using System.Collections.Generic; diff --git a/src/ApiGenerator/Views/HighLevel/Requests/RequestImplementations.cshtml b/src/ApiGenerator/Views/HighLevel/Requests/RequestImplementations.cshtml index a1bdfb1963..af7b516e5a 100644 --- a/src/ApiGenerator/Views/HighLevel/Requests/RequestImplementations.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Requests/RequestImplementations.cshtml @@ -1,20 +1,17 @@ @using System.Linq @using ApiGenerator -@using ApiGenerator.Domain.Code @using ApiGenerator.Domain.Code.HighLevel.Requests @using ApiGenerator.Domain.Specification @using ApiGenerator.Generator @inherits global::ApiGenerator.CodeTemplatePage @{ - RequestPartialImplementation r = Model; - CsharpNames names = r.CsharpNames; - var apiLookup = $"ApiUrlsLookups.{r.CsharpNames.Namespace}{r.CsharpNames.MethodName}"; + var apiLookup = $"ApiUrlsLookups.{Model.CsharpNames.Namespace}{Model.CsharpNames.MethodName}"; } -///Request for @names.MethodName@Raw(r.OfficialDocumentationLink.IsNullOrEmpty() ? "" : " " + r.OfficialDocumentationLink + "") -@if (r.Stability != Stability.Stable) +///Request for @Model.CsharpNames.MethodName@(Raw(Model.OfficialDocumentationLink.IsNullOrEmpty() ? "" : " " + Model.OfficialDocumentationLink + "")) +@if (Model.Stability != Stability.Stable) { string warningMessage = ""; - switch (r.Stability) + 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."; @@ -24,59 +21,58 @@ break; } -///@Raw("Note: " + r.Stability + " within the OpenSearch server, " + warningMessage + "") - -} - public partial class @Raw(r.Name) @Raw(string.Format(": PlainRequestBase<{0}>, {1}", names.ParametersName, r.InterfaceName)) - { - protected @(Raw(r.InterfaceName)) Self => this; +///@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 (Constructor c in r.Constructors) +@foreach (var c in Model.Constructors) { @(Raw(CodeGenerator.Constructor(c))) } // values part of the url path -@foreach (var part in r.Parts) +@foreach (var part in Model.Parts) { [IgnoreDataMember] - @(Raw(part.HighLevelTypeName)) @(Raw(r.InterfaceName)).@(part.InterfaceName) => Self.RouteValues.Get@(Raw(string.Format("<{0}>", part.HighLevelTypeName)))("@(part.Name)"); + @(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 r.Params) +@foreach (var param in Model.Params) { var original = param.QueryStringKey; //skip parameters already part of the path portion of the url - if (r.Parts.Any(p=>p.Name == original)) + 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 && (r.HasBody)) + if (param.RenderPartial && (Model.HasBody)) { continue; } var doc = param.DescriptionHighLevel.ToArray(); - @Raw(param.InitializerGenerator(r.CsharpNames.Namespace, param.TypeHighLevel, param.ClsName, original, param.SetterHighLevel, doc)) - + @Raw(param.InitializerGenerator(Model.CsharpNames.Namespace, param.TypeHighLevel, param.ClsName, original, param.SetterHighLevel, doc)) } -@if (names.DescriptorNotFoundInCodebase) +@if (Model.CsharpNames.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)] + [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 (r.NeedsGenericImplementation) +@if (Model.NeedsGenericImplementation) { - public partial class @Raw(names.GenericRequestName) @Raw(string.Format(": {0}, {1}", names.RequestName, names.GenericInterfaceName)) + public partial class @Raw(Model.CsharpNames.GenericRequestName) @Raw(string.Format(": {0}, {1}", Model.CsharpNames.RequestName, Model.CsharpNames.GenericInterfaceName)) { - protected @(Raw(names.GenericInterfaceName)) TypedSelf => this; -@foreach (Constructor c in r.GenericConstructors) + 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 index ad5642216b..efe0da4f29 100644 --- a/src/ApiGenerator/Views/HighLevel/Requests/RequestInterface.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Requests/RequestInterface.cshtml @@ -1,27 +1,25 @@ @using ApiGenerator.Domain.Code.HighLevel.Requests -@using ApiGenerator.Domain.Specification @inherits ApiGenerator.CodeTemplatePage @{ - RequestInterface i = Model; - string name = i.CsharpNames.RequestInterfaceName; + var name = Model.CsharpNames.RequestInterfaceName; } [InterfaceDataContract] - public partial interface @(Raw(i.Name)) : IRequest@(Raw(string.Format("<{0}>", i.CsharpNames.ParametersName))) - { -@foreach (UrlPart part in i.UrlParts) + 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 i.PartialParameters) +@foreach (var partialParam in Model.PartialParameters) { [DataMember(Name = "@(partialParam.QueryStringKey)")] @(Raw(partialParam.TypeHighLevel)) @(partialParam.ClsName) { get; set; } } } -@if (i.NeedsGenericInterface) +@if (Model.NeedsGenericInterface) { - public partial interface @(name)@(Raw(i.CsharpNames.GenericsDeclaredOnRequest)) : @(Raw(name)) { } + 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 index e55ea5a1ee..3263b77c3f 100644 --- a/src/ApiGenerator/Views/HighLevel/Requests/Requests.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Requests/Requests.cshtml @@ -1,15 +1,13 @@ -@using System.Collections.Generic @using System.Collections.ObjectModel @using ApiGenerator @using ApiGenerator.Domain.Specification @using ApiGenerator.Domain.Code @inherits CodeTemplatePage>> @{ - KeyValuePair> model = Model; - string ns = model.Key != CsharpNames.RootNamespace ? "."+CsharpNames.ApiNamespace+"." + model.Key + CsharpNames.ApiNamespaceSuffix : null; - var endpoints = model.Value; + var (ns, endpoints) = Model; + ns = ns != CsharpNames.RootNamespace ? $".{CsharpNames.ApiNamespace}.{ns}{CsharpNames.ApiNamespaceSuffix}" : null; } -@{ await IncludeAsync("GeneratorNotice.cshtml", Model); } +@{ await IncludeGeneratorNotice(); } // ReSharper disable RedundantUsingDirective using System; using System.Collections.Generic; @@ -19,7 +17,7 @@ using System.Linq.Expressions; using System.Runtime.Serialization; using OpenSearch.Net; using OpenSearch.Net.Utf8Json; -@if (model.Key != CsharpNames.RootNamespace) +@if (ns != CsharpNames.RootNamespace) { using OpenSearch.Net@(ns); @@ -36,4 +34,4 @@ namespace OpenSearch.Client await IncludeAsync("HighLevel/Requests/RequestInterface.cshtml", endpoint.RequestInterface); await IncludeAsync("HighLevel/Requests/RequestImplementations.cshtml", endpoint.RequestPartialImplementation); } -} \ No newline at end of file +} diff --git a/src/ApiGenerator/Views/LowLevel/Client/Implementation/OpenSearchLowLevelClient.Namespace.cshtml b/src/ApiGenerator/Views/LowLevel/Client/Implementation/OpenSearchLowLevelClient.Namespace.cshtml index 9ec2f9c3a1..87a06d99a4 100644 --- a/src/ApiGenerator/Views/LowLevel/Client/Implementation/OpenSearchLowLevelClient.Namespace.cshtml +++ b/src/ApiGenerator/Views/LowLevel/Client/Implementation/OpenSearchLowLevelClient.Namespace.cshtml @@ -1,15 +1,12 @@ -@using System.Collections.Generic @using System.Collections.ObjectModel @using System.Linq @using ApiGenerator @using ApiGenerator.Domain.Code @using ApiGenerator.Domain.Specification @inherits CodeTemplatePage>> -@{ await IncludeAsync("GeneratorNotice.cshtml", Model); } +@{ await IncludeGeneratorNotice(); } @{ - KeyValuePair> model = Model; - string ns = model.Key; - var endpoints = model.Value; + var (ns, endpoints) = Model; } // ReSharper disable RedundantUsingDirective using System; @@ -26,17 +23,17 @@ using static OpenSearch.Net.HttpMethod; // ReSharper disable once CheckNamespace // ReSharper disable InterpolatedStringExpressionIsNotIFormattable // ReSharper disable RedundantExtendsListEntry -namespace OpenSearch.Net.@(CsharpNames.ApiNamespace).@(ns)@(CsharpNames.ApiNamespaceSuffix) +namespace OpenSearch.Net.@(CsharpNames.ApiNamespace).@ns@(CsharpNames.ApiNamespaceSuffix) { /// - /// @(ns.SplitPascalCase()) APIs. + /// @ns.SplitPascalCase() APIs. /// Not intended to be instantiated directly. Use the property /// on . /// /// - public partial class @(CsharpNames.LowLevelClientNamespacePrefix)@(model.Key)@(CsharpNames.ClientNamespaceSuffix) : NamespacedClientProxy + public partial class @(CsharpNames.LowLevelClientNamespacePrefix)@ns@(CsharpNames.ClientNamespaceSuffix) : NamespacedClientProxy { - internal @(CsharpNames.LowLevelClientNamespacePrefix)@(model.Key)@(CsharpNames.ClientNamespaceSuffix)(OpenSearchLowLevelClient client) : base(client) {} + internal @(CsharpNames.LowLevelClientNamespacePrefix)@ns@(CsharpNames.ClientNamespaceSuffix)(OpenSearchLowLevelClient client) : base(client) {} @if (ns == "Cat") { protected override string ContentType { get; } = "text/plain"; diff --git a/src/ApiGenerator/Views/LowLevel/Client/Implementation/OpenSearchLowLevelClient.cshtml b/src/ApiGenerator/Views/LowLevel/Client/Implementation/OpenSearchLowLevelClient.cshtml index a4ce6b2159..84722f9763 100644 --- a/src/ApiGenerator/Views/LowLevel/Client/Implementation/OpenSearchLowLevelClient.cshtml +++ b/src/ApiGenerator/Views/LowLevel/Client/Implementation/OpenSearchLowLevelClient.cshtml @@ -3,7 +3,7 @@ @using ApiGenerator @using ApiGenerator.Domain.Code @inherits CodeTemplatePage -@{ await IncludeAsync("GeneratorNotice.cshtml", Model); } +@{ await IncludeGeneratorNotice(); } // ReSharper disable RedundantUsingDirective using System; using System.Collections.Generic; @@ -17,8 +17,7 @@ using OpenSearch.Net; using static OpenSearch.Net.HttpMethod; @{ - RestApiSpec model = Model; - var namespaces = model.EndpointsPerNamespaceLowLevel.Keys.Where(k => k != CsharpNames.RootNamespace).ToList(); + var namespaces = Model.EndpointsPerNamespaceLowLevel.Keys.Where(k => k != CsharpNames.RootNamespace).ToList(); // ReSharper disable InterpolatedStringExpressionIsNotIFormattable // ReSharper disable RedundantExtendsListEntry @@ -49,14 +48,13 @@ namespace OpenSearch.Net - foreach (var kv in model.EndpointsPerNamespaceLowLevel) + foreach (var (ns, endpoints) in Model.EndpointsPerNamespaceLowLevel) { - if (kv.Key != CsharpNames.RootNamespace) + if (ns != CsharpNames.RootNamespace) { continue; } - var endpoints = kv.Value; - var methods = endpoints.SelectMany(e=>e.LowLevelClientMethods).ToList(); + 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/Interface/IOpenSearchLowLevelClient.cshtml b/src/ApiGenerator/Views/LowLevel/Client/Interface/IOpenSearchLowLevelClient.cshtml index beadac4ff0..c18cf883b8 100644 --- a/src/ApiGenerator/Views/LowLevel/Client/Interface/IOpenSearchLowLevelClient.cshtml +++ b/src/ApiGenerator/Views/LowLevel/Client/Interface/IOpenSearchLowLevelClient.cshtml @@ -3,7 +3,7 @@ @using ApiGenerator.Domain @using ApiGenerator.Domain.Code @inherits ApiGenerator.CodeTemplatePage -@{ await IncludeAsync("GeneratorNotice.cshtml", Model); } +@{ await IncludeGeneratorNotice(); } // ReSharper disable RedundantUsingDirective using System; using System.Collections.Generic; @@ -22,18 +22,17 @@ namespace OpenSearch.Net /// public partial interface IOpenSearchLowLevelClient { - @foreach(var kv in Model.EndpointsPerNamespaceLowLevel) + @foreach(var (ns, endpoints) in Model.EndpointsPerNamespaceLowLevel) { - if (kv.Key != CsharpNames.RootNamespace) + if (ns != CsharpNames.RootNamespace) { - ///@(kv.Key.SplitPascalCase()) APIs - @CsharpNames.LowLevelClientNamespacePrefix@(kv.Key)@CsharpNames.ClientNamespaceSuffix @kv.Key { get; } + ///@ns.SplitPascalCase() APIs + @CsharpNames.LowLevelClientNamespacePrefix@(ns)@CsharpNames.ClientNamespaceSuffix @ns { get; } continue; } - var endpoints = kv.Value; - var methods = endpoints.SelectMany(e=>e.LowLevelClientMethods).ToList(); + var methods = endpoints.SelectMany(e=>e.LowLevelClientMethods).ToList(); foreach(var method in methods) { await IncludeAsync("LowLevel/Client/Methods/MethodInterface.cshtml", method); diff --git a/src/ApiGenerator/Views/LowLevel/Client/Methods/MethodDocs.cshtml b/src/ApiGenerator/Views/LowLevel/Client/Methods/MethodDocs.cshtml index d4948097ab..46423d412d 100644 --- a/src/ApiGenerator/Views/LowLevel/Client/Methods/MethodDocs.cshtml +++ b/src/ApiGenerator/Views/LowLevel/Client/Methods/MethodDocs.cshtml @@ -2,20 +2,17 @@ @using ApiGenerator.Domain.Code.LowLevel @using ApiGenerator.Domain.Specification @inherits ApiGenerator.CodeTemplatePage -@{ - LowLevelClientMethod method = Model; -} - ///@method.HttpMethod on @method.Path@Raw(method.OfficialDocumentationLink.IsNullOrEmpty() ? "" : " " + method.OfficialDocumentationLink + "") -@foreach (var part in method.Parts) +///@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 (method.Stability != Stability.Stable) + @if (Model.Stability != Stability.Stable) { string warningMessage = ""; - switch (method.Stability) + 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."; @@ -27,10 +24,10 @@ 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: " + method.Stability + " within the OpenSearch server, " + warningMessage + "") - - } - @if (method.DeprecatedPath != null) + ///@Raw("Note: " + Model.Stability + " within the OpenSearch server, " + warningMessage + "") + +} + @if (Model.DeprecatedPath != null) { - [Obsolete("Deprecated in version @(method.DeprecatedPath.Version): @Raw(method.DeprecatedPath.Description)")] + [Obsolete("Deprecated in version @Model.DeprecatedPath.Version: @Raw(Model.DeprecatedPath.Description)")] } diff --git a/src/ApiGenerator/Views/LowLevel/Client/Methods/MethodImplementation.cshtml b/src/ApiGenerator/Views/LowLevel/Client/Methods/MethodImplementation.cshtml index 211a1f5dc8..d0ececa4ef 100644 --- a/src/ApiGenerator/Views/LowLevel/Client/Methods/MethodImplementation.cshtml +++ b/src/ApiGenerator/Views/LowLevel/Client/Methods/MethodImplementation.cshtml @@ -1,14 +1,13 @@ @using ApiGenerator.Domain.Code.LowLevel @inherits ApiGenerator.CodeTemplatePage @{ - LowLevelClientMethod method = Model; - var contentType = method.CsharpNames.RestSpecName.Contains(".cat_") ? ", contentType: \"text/plain\"" : string.Empty; + var contentType = Model.CsharpNames.RestSpecName.Contains(".cat_") ? ", contentType: \"text/plain\"" : string.Empty; } -@{await IncludeAsync("LowLevel/Client/Methods/MethodDocs.cshtml", method); } - public TResponse @(method.PerPathMethodName)@(Raw(""))(@Raw(method.Arguments)) - where TResponse : class, IOpenSearchResponse, new() => DoRequest@(Raw(""))(@method.HttpMethod, @Raw(method.UrlInCode), @(method.HasBody ? "body" : "null"), RequestParams(requestParameters@(Raw(contentType)))); +@{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", method); } - [MapsApi("@(method.CsharpNames.RestSpecName)", "@(method.MapsApiArguments)")] - public Task@(Raw("")) @(method.PerPathMethodName)Async@(Raw(""))(@Raw(method.Arguments), CancellationToken ctx = default) - where TResponse : class, IOpenSearchResponse, new() => DoRequestAsync@(Raw(""))(@method.HttpMethod, @Raw(method.UrlInCode), ctx, @(method.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 index be8bef61ae..26af0feff8 100644 --- a/src/ApiGenerator/Views/LowLevel/Client/Methods/MethodInterface.cshtml +++ b/src/ApiGenerator/Views/LowLevel/Client/Methods/MethodInterface.cshtml @@ -1,10 +1,7 @@ @using ApiGenerator.Domain.Code.LowLevel @inherits ApiGenerator.CodeTemplatePage -@{ - LowLevelClientMethod method = Model; -} -@{await IncludeAsync("LowLevel/Client/Methods/MethodDocs.cshtml", method); } - TResponse @(method.PerPathMethodName)@(Raw(""))(@Raw(method.Arguments)) where TResponse : class, IOpenSearchResponse, new(); +@{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", method); } - Task@(Raw("")) @(method.PerPathMethodName)Async@(Raw(""))(@Raw(method.Arguments), CancellationToken ctx = default) 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 index 3222da33a8..7dcc951284 100644 --- a/src/ApiGenerator/Views/LowLevel/Client/Usings.cshtml +++ b/src/ApiGenerator/Views/LowLevel/Client/Usings.cshtml @@ -1,11 +1,11 @@ @using ApiGenerator.Domain @using ApiGenerator.Domain.Code @inherits ApiGenerator.CodeTemplatePage -@foreach(var kv in Model.EndpointsPerNamespaceLowLevel) +@foreach(var ns in Model.EndpointsPerNamespaceLowLevel.Keys) { - if (kv.Key != CsharpNames.RootNamespace) + if (ns != CsharpNames.RootNamespace) { -using OpenSearch.Net.@(CsharpNames.ApiNamespace).@(kv.Key)@(CsharpNames.ApiNamespaceSuffix); +using OpenSearch.Net.@(CsharpNames.ApiNamespace).@(ns)@(CsharpNames.ApiNamespaceSuffix); } } diff --git a/src/ApiGenerator/Views/LowLevel/Enums.Generated.cshtml b/src/ApiGenerator/Views/LowLevel/Enums.Generated.cshtml index d669011d30..3d4cb84b83 100644 --- a/src/ApiGenerator/Views/LowLevel/Enums.Generated.cshtml +++ b/src/ApiGenerator/Views/LowLevel/Enums.Generated.cshtml @@ -1,11 +1,10 @@ -@using System @using System.Linq @using System.Text @using ApiGenerator.Domain @using ApiGenerator @using ApiGenerator.Configuration.Overrides @inherits CodeTemplatePage -@{ await IncludeAsync("GeneratorNotice.cshtml", Model); } +@{ await IncludeGeneratorNotice(); } @functions { private const string RawSize = "Raw"; private const string SizeEnum = "Size"; @@ -54,7 +53,7 @@ using System.Runtime.Serialization; namespace OpenSearch.Net { -@foreach (EnumDescription e in Model.EnumsInTheSpec) +@foreach (var e in Model.EnumsInTheSpec) { var isFlag = IsFlag(e.Name); @@ -70,7 +69,7 @@ namespace OpenSearch.Net static KnownEnums() { - @foreach (EnumDescription e in Model.EnumsInTheSpec) + @foreach (var e in Model.EnumsInTheSpec) { EnumStringResolvers.TryAdd(typeof(@(e.Name)), (e) => GetStringValue((@(e.Name))e)); @@ -83,7 +82,7 @@ namespace OpenSearch.Net public @(Raw("Func")) Resolver { get; set; } } - @foreach (EnumDescription e in Model.EnumsInTheSpec) + @foreach (var e in Model.EnumsInTheSpec) { var isFlag = IsFlag(e.Name); @@ -170,4 +169,4 @@ namespace OpenSearch.Net }; } } -} \ No newline at end of file +} diff --git a/src/ApiGenerator/Views/LowLevel/RequestParameters/RequestParameters.cshtml b/src/ApiGenerator/Views/LowLevel/RequestParameters/RequestParameters.cshtml index 79ec395893..78c4862f41 100644 --- a/src/ApiGenerator/Views/LowLevel/RequestParameters/RequestParameters.cshtml +++ b/src/ApiGenerator/Views/LowLevel/RequestParameters/RequestParameters.cshtml @@ -1,14 +1,12 @@ -@using System.Collections.Generic @using System.Collections.ObjectModel @using ApiGenerator @using ApiGenerator.Domain.Code @using ApiGenerator.Domain.Specification @inherits CodeTemplatePage>> -@{ await IncludeAsync("GeneratorNotice.cshtml", Model); } +@{ await IncludeGeneratorNotice(); } @{ - KeyValuePair> model = Model; - string ns = model.Key != CsharpNames.RootNamespace ? "."+CsharpNames.ApiNamespace+"." + model.Key + CsharpNames.ApiNamespaceSuffix : null; - var endpoints = model.Value; + var (ns, endpoints) = Model; + ns = ns != CsharpNames.RootNamespace ? $".{CsharpNames.ApiNamespace}.{ns}{CsharpNames.ApiNamespaceSuffix}" : null; } // ReSharper disable RedundantUsingDirective diff --git a/src/ApiGenerator/packages.lock.json b/src/ApiGenerator/packages.lock.json index 439f978c99..dad38d2810 100644 --- a/src/ApiGenerator/packages.lock.json +++ b/src/ApiGenerator/packages.lock.json @@ -39,9 +39,9 @@ }, "RazorLight": { "type": "Direct", - "requested": "[2.1.0, )", - "resolved": "2.1.0", - "contentHash": "WUJUsOJXUXrRpMrlWunn2QsOigF07S+lP2QxuOEBlfswDtuO4SAGaL97tOn0Hq24lMNqR4SWepOMj4Rlx+OfsQ==", + "requested": "[2.3.1, )", + "resolved": "2.3.1", + "contentHash": "Eegx5xEQ2AvydJB5lHTZgIQQyCZJ6NLJb1ePinAGmv5S42rvj8o/FRZFxrB0jQhXmA4uu93x+J/ZVE1qBv4dLw==", "dependencies": { "Microsoft.AspNetCore.Mvc.Razor.Extensions": "6.0.0", "Microsoft.CodeAnalysis.Razor": "6.0.0", From eea919fb208a534a3d0e50b65b44fdd7be4c1683 Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Thu, 6 Jul 2023 04:54:19 +1200 Subject: [PATCH 06/27] 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 --- src/ApiGenerator/packages.lock.json | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/ApiGenerator/packages.lock.json b/src/ApiGenerator/packages.lock.json index dad38d2810..6acd339f10 100644 --- a/src/ApiGenerator/packages.lock.json +++ b/src/ApiGenerator/packages.lock.json @@ -11,15 +11,6 @@ "Microsoft.CodeAnalysis.Common": "[4.2.0]" } }, - "Microsoft.NETFramework.ReferenceAssemblies": { - "type": "Direct", - "requested": "[1.0.3, )", - "resolved": "1.0.3", - "contentHash": "vUc9Npcs14QsyOD01tnv/m8sQUnGTGOw1BCmKcv77LBJY7OxhJ+zJF7UD/sCL3lYNFuqmQEVlkfS4Quif6FyYg==", - "dependencies": { - "Microsoft.NETFramework.ReferenceAssemblies.net461": "1.0.3" - } - }, "Newtonsoft.Json": { "type": "Direct", "requested": "[13.0.3, )", @@ -241,11 +232,6 @@ "resolved": "1.1.0", "contentHash": "aOZA3BWfz9RXjpzt0sRJJMjAscAUm3Hoa4UWAfceV9UTYxgwZ1lZt5nO2myFf+/jetYQo4uTP7zS8sJY67BBxg==" }, - "Microsoft.NETFramework.ReferenceAssemblies.net461": { - "type": "Transitive", - "resolved": "1.0.3", - "contentHash": "AmOJZwCqnOCNp6PPcf9joyogScWLtwy0M1WkqfEQ0M9nYwyDD7EX9ZjscKS5iYnyvteX7kzSKFCKt9I9dXA6mA==" - }, "Namotion.Reflection": { "type": "Transitive", "resolved": "2.1.2", From 8403c3339de56d7369e473a988ac5a930dfd3945 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Jul 2023 16:01:22 +1200 Subject: [PATCH 07/27] 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] --- src/ApiGenerator/ApiGenerator.csproj | 2 +- src/ApiGenerator/packages.lock.json | 49 ++++++++++++++-------------- 2 files changed, 25 insertions(+), 26 deletions(-) diff --git a/src/ApiGenerator/ApiGenerator.csproj b/src/ApiGenerator/ApiGenerator.csproj index 7ecdcb16ac..e270485685 100644 --- a/src/ApiGenerator/ApiGenerator.csproj +++ b/src/ApiGenerator/ApiGenerator.csproj @@ -9,7 +9,7 @@ true - + diff --git a/src/ApiGenerator/packages.lock.json b/src/ApiGenerator/packages.lock.json index 6acd339f10..42d913ee09 100644 --- a/src/ApiGenerator/packages.lock.json +++ b/src/ApiGenerator/packages.lock.json @@ -4,11 +4,11 @@ "net6.0": { "Microsoft.CodeAnalysis.CSharp": { "type": "Direct", - "requested": "[4.2.0, )", - "resolved": "4.2.0", - "contentHash": "5IDwr8zGNBmDpxtzxxZj9IHwoA6HJ1/WWT/JacqPQJ4Vz/oZXaHNlzcBPVCZRGWUw+QvVdAhCKwEyJyuAuH/wg==", + "requested": "[4.6.0, )", + "resolved": "4.6.0", + "contentHash": "9pyFZUN2Lyu3C0Xfs49kezfH+CzQHMibGsQeQPu0P+GWyH2XXDwmyZ6jAaKQGNUXOJfC2OK01hWMJTJY315uDQ==", "dependencies": { - "Microsoft.CodeAnalysis.Common": "[4.2.0]" + "Microsoft.CodeAnalysis.Common": "[4.6.0]" } }, "Newtonsoft.Json": { @@ -99,21 +99,19 @@ }, "Microsoft.CodeAnalysis.Analyzers": { "type": "Transitive", - "resolved": "3.3.3", - "contentHash": "j/rOZtLMVJjrfLRlAMckJLPW/1rze9MT1yfWqSIbUPGRu1m1P0fuo9PmqapwsmePfGB5PJrudQLvmUOAMF0DqQ==" + "resolved": "3.3.4", + "contentHash": "AxkxcPR+rheX0SmvpLVIGLhOUXAKG56a64kV9VQZ4y9gR9ZmPXnqZvHJnmwLSwzrEP6junUF11vuc+aqo5r68g==" }, "Microsoft.CodeAnalysis.Common": { "type": "Transitive", - "resolved": "4.2.0", - "contentHash": "lbusGcuE7D8FtZawQ4G++UFsRQArPzZN1GGXjPQwu3gvCbw7FXDcBq1zDZrZN1vRzPTVe1qyZMvfGhVUzs1TDg==", + "resolved": "4.6.0", + "contentHash": "N3uLvekc7DjvE1BX8YW7UH7ldjA4ps/Tun2YmOoSIItJrh1gnQIMKUbK1c3uQUx2NHbLibVZI4o/VB9xb4B7tA==", "dependencies": { - "Microsoft.CodeAnalysis.Analyzers": "3.3.3", - "System.Collections.Immutable": "5.0.0", - "System.Memory": "4.5.4", - "System.Reflection.Metadata": "5.0.0", + "Microsoft.CodeAnalysis.Analyzers": "3.3.4", + "System.Collections.Immutable": "7.0.0", + "System.Reflection.Metadata": "7.0.0", "System.Runtime.CompilerServices.Unsafe": "6.0.0", - "System.Text.Encoding.CodePages": "6.0.0", - "System.Threading.Tasks.Extensions": "4.5.4" + "System.Text.Encoding.CodePages": "7.0.0" } }, "Microsoft.CodeAnalysis.Razor": { @@ -284,8 +282,11 @@ }, "System.Collections.Immutable": { "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "FXkLXiK0sVVewcso0imKQoOxjoPAj42R8HtjjbSjVPAzwDfzoyoznWxgA3c38LDbN9SJux1xXoXYAhz98j7r2g==" + "resolved": "7.0.0", + "contentHash": "dQPcs0U1IKnBdRDBkrCTi1FoajSTBzLcVTpjO4MBCMC7f4pDOIPzgBoX8JjG7X6uZRJ8EBxsi8+DR1JuwjnzOQ==", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + } }, "System.CommandLine": { "type": "Transitive", @@ -356,8 +357,11 @@ }, "System.Reflection.Metadata": { "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "5NecZgXktdGg34rh1OenY1rFNDCI8xSjFr+Z4OU4cU06AQHUdRnIIEeWENu3Wl4YowbzkymAIMvi3WyK9U53pQ==" + "resolved": "7.0.0", + "contentHash": "MclTG61lsD9sYdpNz9xsKBzjsmsfCtcMZYXz/IUr2zlhaTaABonlr1ESeompTgM+Xk+IwtGYU7/voh3YWB/fWw==", + "dependencies": { + "System.Collections.Immutable": "7.0.0" + } }, "System.Reflection.Primitives": { "type": "Transitive", @@ -444,8 +448,8 @@ }, "System.Text.Encoding.CodePages": { "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "ZFCILZuOvtKPauZ/j/swhvw68ZRi9ATCfvGbk1QfydmcXBkIWecWKn/250UH7rahZ5OoDBaiAudJtPvLwzw85A==", + "resolved": "7.0.0", + "contentHash": "LSyCblMpvOe0N3E+8e0skHcrIhgV2huaNcjUUEa8hRtgEAm36aGkRoC8Jxlb6Ra6GSfF29ftduPNywin8XolzQ==", "dependencies": { "System.Runtime.CompilerServices.Unsafe": "6.0.0" } @@ -478,11 +482,6 @@ "System.Runtime": "4.3.0" } }, - "System.Threading.Tasks.Extensions": { - "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==" - }, "YamlDotNet": { "type": "Transitive", "resolved": "11.2.1", From 134a7854788529fd0402bcb0ece50885996e5b59 Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Tue, 11 Jul 2023 09:05:05 +1200 Subject: [PATCH 08/27] 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 --- src/ApiGenerator/packages.lock.json | 492 ---------------------------- 1 file changed, 492 deletions(-) delete mode 100644 src/ApiGenerator/packages.lock.json diff --git a/src/ApiGenerator/packages.lock.json b/src/ApiGenerator/packages.lock.json deleted file mode 100644 index 42d913ee09..0000000000 --- a/src/ApiGenerator/packages.lock.json +++ /dev/null @@ -1,492 +0,0 @@ -{ - "version": 1, - "dependencies": { - "net6.0": { - "Microsoft.CodeAnalysis.CSharp": { - "type": "Direct", - "requested": "[4.6.0, )", - "resolved": "4.6.0", - "contentHash": "9pyFZUN2Lyu3C0Xfs49kezfH+CzQHMibGsQeQPu0P+GWyH2XXDwmyZ6jAaKQGNUXOJfC2OK01hWMJTJY315uDQ==", - "dependencies": { - "Microsoft.CodeAnalysis.Common": "[4.6.0]" - } - }, - "Newtonsoft.Json": { - "type": "Direct", - "requested": "[13.0.3, )", - "resolved": "13.0.3", - "contentHash": "HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==" - }, - "NSwag.Core.Yaml": { - "type": "Direct", - "requested": "[13.19.0, )", - "resolved": "13.19.0", - "contentHash": "F97HsEclpnydInq1Wrd74WDQePHQ7S+e4yKi4BiYi/hLy6s88YlpRFB3R5Bx64iRkGKesU/uGiovKtFevpW2Bw==", - "dependencies": { - "NJsonSchema.Yaml": "10.9.0", - "NSwag.Core": "13.19.0", - "YamlDotNet": "11.2.1" - } - }, - "RazorLight": { - "type": "Direct", - "requested": "[2.3.1, )", - "resolved": "2.3.1", - "contentHash": "Eegx5xEQ2AvydJB5lHTZgIQQyCZJ6NLJb1ePinAGmv5S42rvj8o/FRZFxrB0jQhXmA4uu93x+J/ZVE1qBv4dLw==", - "dependencies": { - "Microsoft.AspNetCore.Mvc.Razor.Extensions": "6.0.0", - "Microsoft.CodeAnalysis.Razor": "6.0.0", - "Microsoft.Extensions.Caching.Abstractions": "6.0.0", - "Microsoft.Extensions.Caching.Memory": "6.0.0", - "Microsoft.Extensions.DependencyInjection": "6.0.0", - "Microsoft.Extensions.DependencyModel": "6.0.0", - "Microsoft.Extensions.FileProviders.Physical": "6.0.0", - "Microsoft.Extensions.Primitives": "6.0.0", - "System.Buffers": "4.5.1" - } - }, - "ShellProgressBar": { - "type": "Direct", - "requested": "[5.2.0, )", - "resolved": "5.2.0", - "contentHash": "XwR9OG00J837mtAXlHIeaJX93di6ZqPUwQLRXTLxyjDiAsytuZDKWELjeDXpWTQCzKsq+oZVhIeK8SN3ubYTwg==", - "dependencies": { - "System.Runtime.InteropServices.RuntimeInformation": "4.3.0", - "System.Text.Encoding.CodePages": "4.0.1" - } - }, - "Spectre.Console": { - "type": "Direct", - "requested": "[0.47.0, )", - "resolved": "0.47.0", - "contentHash": "wz8mszcZr0cSOo8GyoG9e2DFW0SkMT8/n78Q/lIXX7EbCtHNXOoOKWpJ9Str+rCYtmQOGGyDutZzubrUHK/XkA==", - "dependencies": { - "System.Memory": "4.5.5" - } - }, - "System.CommandLine.DragonFruit": { - "type": "Direct", - "requested": "[0.3.0-alpha.20371.2, )", - "resolved": "0.3.0-alpha.20371.2", - "contentHash": "qLGFosjzbv/jzc3AnN5EgI88ODGGgGzcDQ5H9mt8j+boIVk+Sd9QwkGYw017A0lVT6pEgPXq3j/sLg5HmbtdeA==", - "dependencies": { - "System.CommandLine": "2.0.0-beta1.20371.2", - "System.CommandLine.Rendering": "0.3.0-alpha.20371.2" - } - }, - "System.Text.Encodings.Web": { - "type": "Direct", - "requested": "[7.0.0, )", - "resolved": "7.0.0", - "contentHash": "OP6umVGxc0Z0MvZQBVigj4/U31Pw72ITihDWP9WiWDm+q5aoe0GaJivsfYGq53o6dxH7DcXWiCTl7+0o2CGdmg==", - "dependencies": { - "System.Runtime.CompilerServices.Unsafe": "6.0.0" - } - }, - "Microsoft.AspNetCore.Mvc.Razor.Extensions": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "M0h+ChPgydX2xY17agiphnAVa/Qh05RAP8eeuqGGhQKT10claRBlLNO6d2/oSV8zy0RLHzwLnNZm5xuC/gckGA==", - "dependencies": { - "Microsoft.AspNetCore.Razor.Language": "6.0.0", - "Microsoft.CodeAnalysis.Razor": "6.0.0" - } - }, - "Microsoft.AspNetCore.Razor.Language": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "yCtBr1GSGzJrrp1NJUb4ltwFYMKHw/tJLnIDvg9g/FnkGIEzmE19tbCQqXARIJv5kdtBgsoVIdGLL+zmjxvM/A==" - }, - "Microsoft.CodeAnalysis.Analyzers": { - "type": "Transitive", - "resolved": "3.3.4", - "contentHash": "AxkxcPR+rheX0SmvpLVIGLhOUXAKG56a64kV9VQZ4y9gR9ZmPXnqZvHJnmwLSwzrEP6junUF11vuc+aqo5r68g==" - }, - "Microsoft.CodeAnalysis.Common": { - "type": "Transitive", - "resolved": "4.6.0", - "contentHash": "N3uLvekc7DjvE1BX8YW7UH7ldjA4ps/Tun2YmOoSIItJrh1gnQIMKUbK1c3uQUx2NHbLibVZI4o/VB9xb4B7tA==", - "dependencies": { - "Microsoft.CodeAnalysis.Analyzers": "3.3.4", - "System.Collections.Immutable": "7.0.0", - "System.Reflection.Metadata": "7.0.0", - "System.Runtime.CompilerServices.Unsafe": "6.0.0", - "System.Text.Encoding.CodePages": "7.0.0" - } - }, - "Microsoft.CodeAnalysis.Razor": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "uqdzuQXxD7XrJCbIbbwpI/LOv0PBJ9VIR0gdvANTHOfK5pjTaCir+XcwvYvBZ5BIzd0KGzyiamzlEWw1cK1q0w==", - "dependencies": { - "Microsoft.AspNetCore.Razor.Language": "6.0.0", - "Microsoft.CodeAnalysis.CSharp": "4.0.0", - "Microsoft.CodeAnalysis.Common": "4.0.0" - } - }, - "Microsoft.CSharp": { - "type": "Transitive", - "resolved": "4.4.1", - "contentHash": "A5hI3gk6WpcBI0QGZY6/d5CCaYUxJgi7iENn1uYEng+Olo8RfI5ReGVkjXjeu3VR3srLvVYREATXa2M0X7FYJA==" - }, - "Microsoft.Extensions.Caching.Abstractions": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "bcz5sSFJbganH0+YrfvIjJDIcKNW7TL07C4d1eTmXy/wOt52iz4LVogJb6pazs7W0+74j0YpXFErvp++Aq5Bsw==", - "dependencies": { - "Microsoft.Extensions.Primitives": "6.0.0" - } - }, - "Microsoft.Extensions.Caching.Memory": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "Ve3BlCzhAlVp5IgO3+8dacAhZk1A0GlIlFNkAcfR2TfAibLKWIt5DhVJZfu4YtW+XZ89OjYf/agMcgjDtPxdGA==", - "dependencies": { - "Microsoft.Extensions.Caching.Abstractions": "6.0.0", - "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", - "Microsoft.Extensions.Logging.Abstractions": "6.0.0", - "Microsoft.Extensions.Options": "6.0.0", - "Microsoft.Extensions.Primitives": "6.0.0" - } - }, - "Microsoft.Extensions.DependencyInjection": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "k6PWQMuoBDGGHOQTtyois2u4AwyVcIwL2LaSLlTZQm2CYcJ1pxbt6jfAnpWmzENA/wfrYRI/X9DTLoUkE4AsLw==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", - "System.Runtime.CompilerServices.Unsafe": "6.0.0" - } - }, - "Microsoft.Extensions.DependencyInjection.Abstractions": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "xlzi2IYREJH3/m6+lUrQlujzX8wDitm4QGnUu6kUXTQAWPuZY8i+ticFJbzfqaetLA6KR/rO6Ew/HuYD+bxifg==" - }, - "Microsoft.Extensions.DependencyModel": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "TD5QHg98m3+QhgEV1YVoNMl5KtBw/4rjfxLHO0e/YV9bPUBDKntApP4xdrVtGgCeQZHVfC2EXIGsdpRNrr87Pg==", - "dependencies": { - "System.Buffers": "4.5.1", - "System.Memory": "4.5.4", - "System.Runtime.CompilerServices.Unsafe": "6.0.0", - "System.Text.Encodings.Web": "6.0.0", - "System.Text.Json": "6.0.0" - } - }, - "Microsoft.Extensions.FileProviders.Abstractions": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "0pd4/fho0gC12rQswaGQxbU34jOS1TPS8lZPpkFCH68ppQjHNHYle9iRuHeev1LhrJ94YPvzcRd8UmIuFk23Qw==", - "dependencies": { - "Microsoft.Extensions.Primitives": "6.0.0" - } - }, - "Microsoft.Extensions.FileProviders.Physical": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "QvkL7l0nM8udt3gfyu0Vw8bbCXblxaKOl7c2oBfgGy4LCURRaL9XWZX1FWJrQc43oMokVneVxH38iz+bY1sbhg==", - "dependencies": { - "Microsoft.Extensions.FileProviders.Abstractions": "6.0.0", - "Microsoft.Extensions.FileSystemGlobbing": "6.0.0", - "Microsoft.Extensions.Primitives": "6.0.0" - } - }, - "Microsoft.Extensions.FileSystemGlobbing": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "ip8jnL1aPiaPeKINCqaTEbvBFDmVx9dXQEBZ2HOBRXPD1eabGNqP/bKlsIcp7U2lGxiXd5xIhoFcmY8nM4Hdiw==" - }, - "Microsoft.Extensions.Logging.Abstractions": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "/HggWBbTwy8TgebGSX5DBZ24ndhzi93sHUBDvP1IxbZD7FDokYzdAr6+vbWGjw2XAfR2EJ1sfKUotpjHnFWPxA==" - }, - "Microsoft.Extensions.Options": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "dzXN0+V1AyjOe2xcJ86Qbo233KHuLEY0njf/P2Kw8SfJU+d45HNS2ctJdnEnrWbM9Ye2eFgaC5Mj9otRMU6IsQ==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", - "Microsoft.Extensions.Primitives": "6.0.0" - } - }, - "Microsoft.Extensions.Primitives": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "9+PnzmQFfEFNR9J2aDTfJGGupShHjOuGw4VUv+JB044biSHrnmCIMD+mJHmb2H7YryrfBEXDurxQ47gJZdCKNQ==", - "dependencies": { - "System.Runtime.CompilerServices.Unsafe": "6.0.0" - } - }, - "Microsoft.NETCore.Platforms": { - "type": "Transitive", - "resolved": "1.1.0", - "contentHash": "kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==" - }, - "Microsoft.NETCore.Targets": { - "type": "Transitive", - "resolved": "1.1.0", - "contentHash": "aOZA3BWfz9RXjpzt0sRJJMjAscAUm3Hoa4UWAfceV9UTYxgwZ1lZt5nO2myFf+/jetYQo4uTP7zS8sJY67BBxg==" - }, - "Namotion.Reflection": { - "type": "Transitive", - "resolved": "2.1.2", - "contentHash": "7tSHAzX8GWKy0qrW6OgQWD7kAZiqzhq+m1503qczuwuK6ZYhOGCQUxw+F3F4KkRM70aB6RMslsRVSCFeouIehw==", - "dependencies": { - "Microsoft.CSharp": "4.3.0" - } - }, - "NJsonSchema": { - "type": "Transitive", - "resolved": "10.9.0", - "contentHash": "IBPo6Srxn2MEcIFM3HdM4QImrJbsIeujENQyzHL2Pv6wLsKSYAyAEilecRqaLOhoy3snEiPLx7hhv7opbhOxKQ==", - "dependencies": { - "Namotion.Reflection": "2.1.2", - "Newtonsoft.Json": "9.0.1" - } - }, - "NJsonSchema.Yaml": { - "type": "Transitive", - "resolved": "10.9.0", - "contentHash": "lGOtsydEnX1mVLT2Cyre7mST7K7crveYtai9FGC2i7COKEMEFjsfbnUtgXSHKxS/bzxVEIjLa49tR6xw34WkEw==", - "dependencies": { - "Microsoft.CSharp": "4.4.1", - "NJsonSchema": "10.9.0", - "YamlDotNet": "11.2.1" - } - }, - "NSwag.Core": { - "type": "Transitive", - "resolved": "13.19.0", - "contentHash": "UkPCsEJ5WaE6mcEjarZZfMPyyRPHOWK9YuFvxNjrSHclCxVUZ7jgFtNGMX0wy0WvXkmA5b6H9IoaAJECMxcu/g==", - "dependencies": { - "NJsonSchema": "10.9.0", - "Newtonsoft.Json": "10.0.1" - } - }, - "runtime.native.System": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "c/qWt2LieNZIj1jGnVNsE2Kl23Ya2aSTBuXMD6V7k9KWr6l16Tqdwq+hJScEpWER9753NWC8h96PaVNY5Ld7Jw==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0" - } - }, - "System.Buffers": { - "type": "Transitive", - "resolved": "4.5.1", - "contentHash": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==" - }, - "System.Collections.Immutable": { - "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "dQPcs0U1IKnBdRDBkrCTi1FoajSTBzLcVTpjO4MBCMC7f4pDOIPzgBoX8JjG7X6uZRJ8EBxsi8+DR1JuwjnzOQ==", - "dependencies": { - "System.Runtime.CompilerServices.Unsafe": "6.0.0" - } - }, - "System.CommandLine": { - "type": "Transitive", - "resolved": "2.0.0-beta1.20371.2", - "contentHash": "L6cnw4QgaLAOpUPSW1TjYGJGKsUvyDYvdQ/Gqv0/EnOSzByEf+IlAK1sRu+bcAhBrdws+eNPcOarg1Qj33oNDA==", - "dependencies": { - "Microsoft.CSharp": "4.4.1", - "system.memory": "4.5.4" - } - }, - "System.CommandLine.Rendering": { - "type": "Transitive", - "resolved": "0.3.0-alpha.20371.2", - "contentHash": "Giz/HUeNkosCnf1vkqHSTlbKGXIpthihn1ZDh2ZbwM3AOYGwv+ZOrgy/z9y3NNh3TCNyutHRf+c2Awg5TO27pA==", - "dependencies": { - "System.CommandLine": "2.0.0-beta1.20371.2" - } - }, - "System.Globalization": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "kYdVd2f2PAdFGblzFswE4hkNANJBKRmsfa2X5LG2AcWE1c7/4t0pYae1L8vfZ5xvE2nK/R9JprtToA61OSHWIg==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0" - } - }, - "System.IO": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "3qjaHvxQPDpSOYICjUoTsmoq5u6QJAFRUITgeT/4gqkF1bajbSmb1kwSxEA8AHlofqgcKJcM8udgieRNhaJ5Cg==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0", - "System.Text.Encoding": "4.3.0", - "System.Threading.Tasks": "4.3.0" - } - }, - "System.Memory": { - "type": "Transitive", - "resolved": "4.5.5", - "contentHash": "XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw==" - }, - "System.Reflection": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "KMiAFoW7MfJGa9nDFNcfu+FpEdiHpWgTcS2HdMpDvt9saK3y/G4GwprPyzqjFH9NTaGPQeWNHU+iDlDILj96aQ==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.IO": "4.3.0", - "System.Reflection.Primitives": "4.3.0", - "System.Runtime": "4.3.0" - } - }, - "System.Reflection.Extensions": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "rJkrJD3kBI5B712aRu4DpSIiHRtr6QlfZSQsb0hYHrDCZORXCFjQfoipo2LaMUHoT9i1B7j7MnfaEKWDFmFQNQ==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Reflection": "4.3.0", - "System.Runtime": "4.3.0" - } - }, - "System.Reflection.Metadata": { - "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "MclTG61lsD9sYdpNz9xsKBzjsmsfCtcMZYXz/IUr2zlhaTaABonlr1ESeompTgM+Xk+IwtGYU7/voh3YWB/fWw==", - "dependencies": { - "System.Collections.Immutable": "7.0.0" - } - }, - "System.Reflection.Primitives": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "5RXItQz5As4xN2/YUDxdpsEkMhvw3e6aNveFXUn4Hl/udNTCNhnKp8lT9fnc3MhvGKh1baak5CovpuQUXHAlIA==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0" - } - }, - "System.Resources.ResourceManager": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "/zrcPkkWdZmI4F92gL/TPumP98AVDu/Wxr3CSJGQQ+XN6wbRZcyfSKVoPo17ilb3iOr0cCRqJInGwNMolqhS8A==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Globalization": "4.3.0", - "System.Reflection": "4.3.0", - "System.Runtime": "4.3.0" - } - }, - "System.Runtime": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "JufQi0vPQ0xGnAczR13AUFglDyVYt4Kqnz1AZaiKZ5+GICq0/1MH/mO/eAJHt/mHW1zjKBJd7kV26SrxddAhiw==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0" - } - }, - "System.Runtime.CompilerServices.Unsafe": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg==" - }, - "System.Runtime.Handles": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "OKiSUN7DmTWeYb3l51A7EYaeNMnvxwE249YtZz7yooT4gOZhmTjIn48KgSsw2k2lYdLgTKNJw/ZIfSElwDRVgg==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0" - } - }, - "System.Runtime.InteropServices": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "uv1ynXqiMK8mp1GM3jDqPCFN66eJ5w5XNomaK2XD+TuCroNTLFGeZ+WCmBMcBDyTFKou3P6cR6J/QsaqDp7fGQ==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Reflection": "4.3.0", - "System.Reflection.Primitives": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Handles": "4.3.0" - } - }, - "System.Runtime.InteropServices.RuntimeInformation": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "cbz4YJMqRDR7oLeMRbdYv7mYzc++17lNhScCX0goO2XpGWdvAt60CGN+FHdePUEHCe/Jy9jUlvNAiNdM+7jsOw==", - "dependencies": { - "System.Reflection": "4.3.0", - "System.Reflection.Extensions": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Threading": "4.3.0", - "runtime.native.System": "4.3.0" - } - }, - "System.Text.Encoding": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "BiIg+KWaSDOITze6jGQynxg64naAPtqGHBwDrLaCtixsa5bKiR8dpPOHA7ge3C0JJQizJE+sfkz1wV+BAKAYZw==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0" - } - }, - "System.Text.Encoding.CodePages": { - "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "LSyCblMpvOe0N3E+8e0skHcrIhgV2huaNcjUUEa8hRtgEAm36aGkRoC8Jxlb6Ra6GSfF29ftduPNywin8XolzQ==", - "dependencies": { - "System.Runtime.CompilerServices.Unsafe": "6.0.0" - } - }, - "System.Text.Json": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "zaJsHfESQvJ11vbXnNlkrR46IaMULk/gHxYsJphzSF+07kTjPHv+Oc14w6QEOfo3Q4hqLJgStUaYB9DBl0TmWg==", - "dependencies": { - "System.Runtime.CompilerServices.Unsafe": "6.0.0", - "System.Text.Encodings.Web": "6.0.0" - } - }, - "System.Threading": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "VkUS0kOBcUf3Wwm0TSbrevDDZ6BlM+b/HRiapRFWjM5O0NS0LviG0glKmFK+hhPDd1XFeSdU1GmlLhb2CoVpIw==", - "dependencies": { - "System.Runtime": "4.3.0", - "System.Threading.Tasks": "4.3.0" - } - }, - "System.Threading.Tasks": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "LbSxKEdOUhVe8BezB/9uOGGppt+nZf6e1VFyw6v3DN6lqitm0OSn2uXMOdtP0M3W4iMcqcivm2J6UgqiwwnXiA==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0" - } - }, - "YamlDotNet": { - "type": "Transitive", - "resolved": "11.2.1", - "contentHash": "tBt8K+korVfrjH9wyDEhiLKxbs8qoLCLIFwvYgkSUuMC9//w3z0cFQ8LQAI/5MCKq+BMil0cfRTRvPeE7eXhQw==" - } - } - } -} \ No newline at end of file From fecb4fc11c13ad48db98f062f97e2c09a4d912b1 Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Wed, 12 Jul 2023 12:35:17 +1200 Subject: [PATCH 09/27] Add ability to generate only a subset of operations (#278) Signed-off-by: Thomas Farr --- src/ApiGenerator/ApiGenerator.csproj | 3 +- .../Configuration/CodeConfiguration.cs | 10 +- .../Configuration/GeneratorLocations.cs | 11 +- .../Generator/ApiEndpointFactory.cs | 2 +- src/ApiGenerator/Generator/ApiGenerator.cs | 68 +- .../Razor/ApiUrlsLookupsGenerator.cs | 2 +- .../Generator/Razor/DescriptorsGenerator.cs | 6 +- .../Generator/Razor/EnumsGenerator.cs | 4 +- .../HighLevelClientImplementationGenerator.cs | 6 +- .../HighLevelClientInterfaceGenerator.cs | 2 +- .../LowLevelClientImplementationGenerator.cs | 6 +- .../Razor/LowLevelClientInterfaceGenerator.cs | 2 +- .../Generator/Razor/RazorGeneratorBase.cs | 5 +- .../Razor/RequestParametersGenerator.cs | 6 +- .../Generator/Razor/RequestsGenerator.cs | 4 - src/ApiGenerator/OpenSearch.openapi.json | 771 +++++++++++++----- .../Implementation/OpenSearchClient.cshtml | 2 +- .../Descriptors/RequestDescriptorBase.cshtml | 1 + .../HighLevel/Requests/ApiUrlsLookup.cshtml | 2 +- .../OpenSearchLowLevelClient.cshtml | 2 +- .../{Enums.Generated.cshtml => Enums.cshtml} | 57 +- .../RequestParameters.cshtml | 2 +- 22 files changed, 635 insertions(+), 339 deletions(-) rename src/ApiGenerator/Views/LowLevel/{Enums.Generated.cshtml => Enums.cshtml} (67%) diff --git a/src/ApiGenerator/ApiGenerator.csproj b/src/ApiGenerator/ApiGenerator.csproj index e270485685..ea7bd766f9 100644 --- a/src/ApiGenerator/ApiGenerator.csproj +++ b/src/ApiGenerator/ApiGenerator.csproj @@ -1,4 +1,4 @@ - + Exe @@ -9,6 +9,7 @@ true + diff --git a/src/ApiGenerator/Configuration/CodeConfiguration.cs b/src/ApiGenerator/Configuration/CodeConfiguration.cs index 309757a0d7..2a6db3f9d4 100644 --- a/src/ApiGenerator/Configuration/CodeConfiguration.cs +++ b/src/ApiGenerator/Configuration/CodeConfiguration.cs @@ -31,11 +31,19 @@ using System.IO; using System.Linq; using System.Text.RegularExpressions; +using GlobExpressions; namespace ApiGenerator.Configuration { public static class CodeConfiguration - { + { + private static readonly Glob[] OperationsToInclude = + { + // e.g. new Glob("nodes.*"), + }; + + 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 /// diff --git a/src/ApiGenerator/Configuration/GeneratorLocations.cs b/src/ApiGenerator/Configuration/GeneratorLocations.cs index 3065a155a0..f97b7d80df 100644 --- a/src/ApiGenerator/Configuration/GeneratorLocations.cs +++ b/src/ApiGenerator/Configuration/GeneratorLocations.cs @@ -39,10 +39,15 @@ public static class GeneratorLocations public static string OpenSearchNetFolder { get; } = $@"{Root}../../src/OpenSearch.Net/"; public static string OpenSearchClientFolder { get; } = $@"{Root}../../src/OpenSearch.Client/"; - // @formatter:on — enable formatter after this line - public static string HighLevel(params string[] paths) => OpenSearchClientFolder + string.Join("/", paths); - public static string LowLevel(params string[] paths) => OpenSearchNetFolder + string.Join("/", paths); + 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; diff --git a/src/ApiGenerator/Generator/ApiEndpointFactory.cs b/src/ApiGenerator/Generator/ApiEndpointFactory.cs index 8f3b492fdb..2698510c4f 100644 --- a/src/ApiGenerator/Generator/ApiEndpointFactory.cs +++ b/src/ApiGenerator/Generator/ApiEndpointFactory.cs @@ -141,7 +141,7 @@ private static string GetOpenSearchType(JsonSchema schema) while (schema.HasReference) schema = schema.Reference; if (schema.GetExtension("x-data-type") is string dataType) - return dataType; + return dataType == "array" ? "list" : dataType; return schema.Type switch { diff --git a/src/ApiGenerator/Generator/ApiGenerator.cs b/src/ApiGenerator/Generator/ApiGenerator.cs index e30861048f..9dae100585 100644 --- a/src/ApiGenerator/Generator/ApiGenerator.cs +++ b/src/ApiGenerator/Generator/ApiGenerator.cs @@ -29,9 +29,10 @@ using System; using System.Collections.Generic; using System.Collections.Immutable; +using System.IO; using System.Linq; - using System.Threading; - using System.Threading.Tasks; +using System.Threading; +using System.Threading.Tasks; using ApiGenerator.Configuration; using ApiGenerator.Domain; using ApiGenerator.Generator.Razor; @@ -42,11 +43,11 @@ namespace ApiGenerator.Generator { public class ApiGenerator { - public static List Warnings { get; private set; } = new List(); + public static List Warnings { get; private set; } = new(); public static async Task Generate(bool lowLevelOnly, RestApiSpec spec, CancellationToken token) { - static async Task DoGenerate(ICollection generators, RestApiSpec restApiSpec, bool highLevel, 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"; @@ -54,36 +55,39 @@ static async Task DoGenerate(ICollection generators, RestApi foreach (var generator in generators) { pbar.Message = "Generating " + generator.Title; - await generator.Generate(restApiSpec, pbar, token); + 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 + ); - var lowLevelGenerators = new List - { - //low level client - new LowLevelClientInterfaceGenerator(), - new LowLevelClientImplementationGenerator(), - new RequestParametersGenerator(), - new EnumsGenerator(), - new ApiUrlsLookupsGenerator(), - }; - - var highLevelGenerators = new List - { - //high level client - new HighLevelClientInterfaceGenerator(), - new HighLevelClientImplementationGenerator(), - new DescriptorsGenerator(), - new RequestsGenerator(), - }; + if (lowLevelOnly) return; - await DoGenerate(lowLevelGenerators, spec, highLevel: false, token); - if (!lowLevelOnly) - await DoGenerate(highLevelGenerators, spec, highLevel: true, token); - - } + 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) { @@ -93,10 +97,18 @@ public static async Task CreateRestApiSpecModel(CancellationToken t .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/Razor/ApiUrlsLookupsGenerator.cs b/src/ApiGenerator/Generator/Razor/ApiUrlsLookupsGenerator.cs index c0a2fef2bd..3a05ab54fb 100644 --- a/src/ApiGenerator/Generator/Razor/ApiUrlsLookupsGenerator.cs +++ b/src/ApiGenerator/Generator/Razor/ApiUrlsLookupsGenerator.cs @@ -41,7 +41,7 @@ public class ApiUrlsLookupsGenerator : RazorGeneratorBase public override async Task Generate(RestApiSpec spec, ProgressBar progressBar, CancellationToken token) { var view = ViewLocations.HighLevel("Requests", "ApiUrlsLookup.cshtml"); - var target = GeneratorLocations.HighLevel("_Generated", "ApiUrlsLookup.generated.cs"); + 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 index 523ea35145..4ea3773855 100644 --- a/src/ApiGenerator/Generator/Razor/DescriptorsGenerator.cs +++ b/src/ApiGenerator/Generator/Razor/DescriptorsGenerator.cs @@ -42,11 +42,7 @@ public class DescriptorsGenerator : RazorGeneratorBase public override async Task Generate(RestApiSpec spec, ProgressBar progressBar, CancellationToken token) { - // Delete existing files - foreach (var file in Directory.GetFiles(GeneratorLocations.OpenSearchClientFolder, "Descriptors.*.cs")) - File.Delete(file); - - var view = ViewLocations.HighLevel("Descriptors", "RequestDescriptorBase.cshtml"); + var view = ViewLocations.HighLevel("Descriptors", "RequestDescriptorBase.cshtml"); var target = GeneratorLocations.HighLevel("Descriptors.cs"); await DoRazor(spec, view, target, token); diff --git a/src/ApiGenerator/Generator/Razor/EnumsGenerator.cs b/src/ApiGenerator/Generator/Razor/EnumsGenerator.cs index 74d3c56830..46b45e65d8 100644 --- a/src/ApiGenerator/Generator/Razor/EnumsGenerator.cs +++ b/src/ApiGenerator/Generator/Razor/EnumsGenerator.cs @@ -40,8 +40,8 @@ public class EnumsGenerator : RazorGeneratorBase public override async Task Generate(RestApiSpec spec, ProgressBar progressBar, CancellationToken token) { - var view = ViewLocations.LowLevel("Enums.Generated.cshtml"); - var target = GeneratorLocations.LowLevel("Api", "Enums.Generated.cs"); + 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 index eacbe058e8..362396187d 100644 --- a/src/ApiGenerator/Generator/Razor/HighLevelClientImplementationGenerator.cs +++ b/src/ApiGenerator/Generator/Razor/HighLevelClientImplementationGenerator.cs @@ -43,11 +43,7 @@ public class HighLevelClientImplementationGenerator : RazorGeneratorBase public override async Task Generate(RestApiSpec spec, ProgressBar progressBar, CancellationToken token) { - // Delete existing files - foreach (var file in Directory.GetFiles(GeneratorLocations.OpenSearchClientFolder, "OpenSearchClient.*.cs")) - File.Delete(file); - - var view = ViewLocations.HighLevel("Client", "Implementation", "OpenSearchClient.cshtml"); + var view = ViewLocations.HighLevel("Client", "Implementation", "OpenSearchClient.cshtml"); var target = GeneratorLocations.HighLevel($"OpenSearchClient.{CsharpNames.RootNamespace}.cs"); await DoRazor(spec, view, target, token); diff --git a/src/ApiGenerator/Generator/Razor/HighLevelClientInterfaceGenerator.cs b/src/ApiGenerator/Generator/Razor/HighLevelClientInterfaceGenerator.cs index b9957db2f5..1c6aafb7ac 100644 --- a/src/ApiGenerator/Generator/Razor/HighLevelClientInterfaceGenerator.cs +++ b/src/ApiGenerator/Generator/Razor/HighLevelClientInterfaceGenerator.cs @@ -41,7 +41,7 @@ public class HighLevelClientInterfaceGenerator : RazorGeneratorBase public override async Task Generate(RestApiSpec spec, ProgressBar progressBar, CancellationToken token) { var view = ViewLocations.HighLevel("Client", "Interface", "IOpenSearchClient.cshtml"); - var target = GeneratorLocations.HighLevel("IOpenSearchClient.Generated.cs"); + 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 index da174b21db..f9a9038fc1 100644 --- a/src/ApiGenerator/Generator/Razor/LowLevelClientImplementationGenerator.cs +++ b/src/ApiGenerator/Generator/Razor/LowLevelClientImplementationGenerator.cs @@ -43,11 +43,7 @@ public class LowLevelClientImplementationGenerator : RazorGeneratorBase public override async Task Generate(RestApiSpec spec, ProgressBar progressBar, CancellationToken token) { - // Delete existing files - foreach (var file in Directory.GetFiles(GeneratorLocations.OpenSearchNetFolder, "OpenSearchLowLevelClient.*.cs")) - File.Delete(file); - - var view = ViewLocations.LowLevel("Client", "Implementation", "OpenSearchLowLevelClient.cshtml"); + var view = ViewLocations.LowLevel("Client", "Implementation", "OpenSearchLowLevelClient.cshtml"); var target = GeneratorLocations.LowLevel($"OpenSearchLowLevelClient.{CsharpNames.RootNamespace}.cs"); await DoRazor(spec, view, target, token); diff --git a/src/ApiGenerator/Generator/Razor/LowLevelClientInterfaceGenerator.cs b/src/ApiGenerator/Generator/Razor/LowLevelClientInterfaceGenerator.cs index 6340b66b35..1d18a5204a 100644 --- a/src/ApiGenerator/Generator/Razor/LowLevelClientInterfaceGenerator.cs +++ b/src/ApiGenerator/Generator/Razor/LowLevelClientInterfaceGenerator.cs @@ -41,7 +41,7 @@ public class LowLevelClientInterfaceGenerator : RazorGeneratorBase public override async Task Generate(RestApiSpec spec, ProgressBar progressBar, CancellationToken token) { var view = ViewLocations.LowLevel("Client", "Interface", "IOpenSearchLowLevelClient.cshtml"); - var target = GeneratorLocations.LowLevel("IOpenSearchLowLevelClient.Generated.cs"); + 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 index 8a4ef0200a..26696a8e8a 100644 --- a/src/ApiGenerator/Generator/Razor/RazorGeneratorBase.cs +++ b/src/ApiGenerator/Generator/Razor/RazorGeneratorBase.cs @@ -93,7 +93,10 @@ protected static void WriteFormattedCsharpFile(string path, string contents) var tree = CSharpSyntaxTree.ParseText(contents); var root = tree.GetRoot().NormalizeWhitespace(indentation:"\t", "\n"); contents = root.ToFullString(); - File.WriteAllText(path, contents); + + if (Directory.GetParent(path) is { Exists: false } dir) dir.Create(); + + File.WriteAllText(path, contents); } public abstract string Title { get; } diff --git a/src/ApiGenerator/Generator/Razor/RequestParametersGenerator.cs b/src/ApiGenerator/Generator/Razor/RequestParametersGenerator.cs index 05d3609acc..0edd2cd9ac 100644 --- a/src/ApiGenerator/Generator/Razor/RequestParametersGenerator.cs +++ b/src/ApiGenerator/Generator/Razor/RequestParametersGenerator.cs @@ -42,11 +42,7 @@ public class RequestParametersGenerator : RazorGeneratorBase public override async Task Generate(RestApiSpec spec, ProgressBar progressBar, CancellationToken token) { - // Delete existing files - foreach (var file in Directory.GetFiles(GeneratorLocations.OpenSearchNetFolder, "RequestParameters.*.cs")) - File.Delete(file); - - var view = ViewLocations.LowLevel("RequestParameters", "RequestParameters.cshtml"); + var view = ViewLocations.LowLevel("RequestParameters", "RequestParameters.cshtml"); string Target(string id) => GeneratorLocations.LowLevel("Api", "RequestParameters", $"RequestParameters.{id}.cs"); var namespaced = spec.EndpointsPerNamespaceLowLevel.ToList(); diff --git a/src/ApiGenerator/Generator/Razor/RequestsGenerator.cs b/src/ApiGenerator/Generator/Razor/RequestsGenerator.cs index 60ca992f73..dc54bf101f 100644 --- a/src/ApiGenerator/Generator/Razor/RequestsGenerator.cs +++ b/src/ApiGenerator/Generator/Razor/RequestsGenerator.cs @@ -42,10 +42,6 @@ public class RequestsGenerator : RazorGeneratorBase public override async Task Generate(RestApiSpec spec, ProgressBar progressBar, CancellationToken token) { - // Delete existing files - foreach (var file in Directory.GetFiles(GeneratorLocations.OpenSearchClientFolder, "Requests.*.cs")) - File.Delete(file); - var view = ViewLocations.HighLevel("Requests", "PlainRequestBase.cshtml"); var target = GeneratorLocations.HighLevel("Requests.cs"); await DoRazor(spec, view, target, token); diff --git a/src/ApiGenerator/OpenSearch.openapi.json b/src/ApiGenerator/OpenSearch.openapi.json index 6ca528e451..dad791663a 100644 --- a/src/ApiGenerator/OpenSearch.openapi.json +++ b/src/ApiGenerator/OpenSearch.openapi.json @@ -112,7 +112,7 @@ "type": "string", "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", "description": "Comma-separated list of alias names.", - "x-data-type": "list" + "x-data-type": "array" }, "required": true }, @@ -177,7 +177,7 @@ "type": "string", "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", "description": "Comma-separated list of alias names.", - "x-data-type": "list" + "x-data-type": "array" }, "required": true }, @@ -242,7 +242,8 @@ "$ref": "#/components/schemas/IndicesUpdateAliases_BodyParams" } } - } + }, + "required": true }, "parameters": [ { @@ -289,15 +290,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/IndicesUpdateAliasesResponseContent" - }, - "examples": { - "IndicesUpdateAliases_example1": { - "summary": "Examples for Post Aliases Operation.", - "description": "", - "value": { - "acknowledged": true - } - } } } } @@ -381,7 +373,8 @@ "$ref": "#/components/schemas/Bulk_BodyParams" } } - } + }, + "required": true }, "parameters": [ { @@ -511,7 +504,8 @@ "$ref": "#/components/schemas/Bulk_BodyParams" } } - } + }, + "required": true }, "parameters": [ { @@ -882,7 +876,7 @@ "type": "string", "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", "description": "Comma-separated list of alias names.", - "x-data-type": "list" + "x-data-type": "array" }, "required": true }, @@ -1103,7 +1097,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -1417,7 +1411,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -1599,7 +1593,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -1942,14 +1936,7 @@ ], "responses": { "200": { - "description": "CatIndices 200 response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CatIndicesOutputPayload" - } - } - } + "description": "CatIndices 200 response" } }, "x-operation-group": "cat.indices", @@ -1969,7 +1956,7 @@ "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": "list" + "x-data-type": "array" }, "required": true, "examples": { @@ -2127,14 +2114,7 @@ ], "responses": { "200": { - "description": "CatIndices_WithIndex 200 response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CatIndices_WithIndexOutputPayload" - } - } - } + "description": "CatIndices_WithIndex 200 response" } }, "x-operation-group": "cat.indices", @@ -2499,14 +2479,7 @@ ], "responses": { "200": { - "description": "CatNodes 200 response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CatNodesOutputPayload" - } - } - } + "description": "CatNodes 200 response" } }, "x-operation-group": "cat.nodes", @@ -2882,7 +2855,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -3277,7 +3250,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -3544,7 +3517,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -3788,7 +3761,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -4042,7 +4015,7 @@ "type": "string", "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", "description": "Comma-separated list of repository names.", - "x-data-type": "list" + "x-data-type": "array" }, "required": true }, @@ -4650,7 +4623,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -5100,7 +5073,7 @@ "type": "string", "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", "description": "Limit the information returned to specific indicies.", - "x-data-type": "list" + "x-data-type": "array" }, "required": true }, @@ -5427,7 +5400,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -5520,7 +5493,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -5942,7 +5915,8 @@ "$ref": "#/components/schemas/ClusterPutSettings_BodyParams" } } - } + }, + "required": true }, "parameters": [ { @@ -6143,7 +6117,7 @@ "cluster_manager_node", "version" ], - "x-data-type": "list" + "x-data-type": "array" }, "required": true }, @@ -6262,7 +6236,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -6285,7 +6259,7 @@ "cluster_manager_node", "version" ], - "x-data-type": "list" + "x-data-type": "array" }, "required": true }, @@ -6444,7 +6418,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -6685,7 +6659,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -6795,7 +6769,8 @@ "$ref": "#/components/schemas/ClusterPutComponentTemplate_BodyParams" } } - } + }, + "required": true }, "parameters": [ { @@ -6878,7 +6853,8 @@ "$ref": "#/components/schemas/ClusterPutComponentTemplate_BodyParams" } } - } + }, + "required": true }, "parameters": [ { @@ -7471,7 +7447,7 @@ "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": "list" + "x-data-type": "array" }, "required": true } @@ -7496,7 +7472,7 @@ "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": "list" + "x-data-type": "array" }, "required": true } @@ -7560,7 +7536,7 @@ "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": "list" + "x-data-type": "array" }, "required": true } @@ -8330,7 +8306,7 @@ "type": "string", "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", "description": "Comma-separated names of the index templates.", - "x-data-type": "list" + "x-data-type": "array" }, "required": true }, @@ -8460,7 +8436,8 @@ "$ref": "#/components/schemas/IndicesPutIndexTemplate_BodyParams" } } - } + }, + "required": true }, "parameters": [ { @@ -8542,7 +8519,8 @@ "$ref": "#/components/schemas/IndicesPutIndexTemplate_BodyParams" } } - } + }, + "required": true }, "parameters": [ { @@ -8693,7 +8671,8 @@ "$ref": "#/components/schemas/IngestSimulate_BodyParams" } } - } + }, + "required": true }, "parameters": [ { @@ -8793,7 +8772,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -8845,7 +8824,8 @@ "$ref": "#/components/schemas/IngestPutPipeline_BodyParams" } } - } + }, + "required": true }, "parameters": [ { @@ -8950,7 +8930,8 @@ "$ref": "#/components/schemas/IngestSimulate_BodyParams" } } - } + }, + "required": true }, "parameters": [ { @@ -9101,7 +9082,7 @@ "type": "string", "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", "description": "Comma-separated list of fields.", - "x-data-type": "list" + "x-data-type": "array" }, "required": true }, @@ -9281,7 +9262,8 @@ "$ref": "#/components/schemas/Mget_BodyParams" } } - } + }, + "required": true }, "parameters": [ { @@ -9483,7 +9465,8 @@ "$ref": "#/components/schemas/Msearch_BodyParams" } } - } + }, + "required": true }, "parameters": [ { @@ -9639,7 +9622,8 @@ "$ref": "#/components/schemas/MsearchTemplate_BodyParams" } } - } + }, + "required": true }, "parameters": [ { @@ -10372,7 +10356,7 @@ "discovery", "indexing_pressure" ], - "x-data-type": "list" + "x-data-type": "array" }, "required": true }, @@ -10512,7 +10496,7 @@ "discovery", "indexing_pressure" ], - "x-data-type": "list" + "x-data-type": "array" }, "required": true }, @@ -10542,7 +10526,7 @@ "warmer", "suggest" ], - "x-data-type": "list" + "x-data-type": "array" }, "required": true }, @@ -10702,7 +10686,7 @@ "_all", "rest_actions" ], - "x-data-type": "list" + "x-data-type": "array" }, "required": true }, @@ -10741,7 +10725,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -10789,7 +10773,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -10879,7 +10863,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -10980,7 +10964,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -11018,7 +11002,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -11158,7 +11142,7 @@ "discovery", "indexing_pressure" ], - "x-data-type": "list" + "x-data-type": "array" }, "required": true }, @@ -11170,7 +11154,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -11310,7 +11294,7 @@ "discovery", "indexing_pressure" ], - "x-data-type": "list" + "x-data-type": "array" }, "required": true }, @@ -11340,7 +11324,7 @@ "warmer", "suggest" ], - "x-data-type": "list" + "x-data-type": "array" }, "required": true }, @@ -11352,7 +11336,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -11478,7 +11462,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -11520,7 +11504,7 @@ "_all", "rest_actions" ], - "x-data-type": "list" + "x-data-type": "array" }, "required": true }, @@ -11532,7 +11516,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -11570,7 +11554,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -11593,7 +11577,7 @@ "plugins", "ingest" ], - "x-data-type": "list" + "x-data-type": "array" }, "required": true }, @@ -11628,6 +11612,209 @@ "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/GetTenantsResponseContent" + } + } + } + } + }, + "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/PatchTenantsParams" + } + } + } + }, + "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/GetTenantResponseContent" + } + } + } + } + }, + "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/PatchTenantParams" + } + } + } + }, + "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" + } + } + } + }, + "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" + } + }, "/_rank_eval": { "get": { "description": "Allows to evaluate the quality of ranked search results over a set of typical search queries.", @@ -11690,7 +11877,8 @@ "$ref": "#/components/schemas/RankEval_BodyParams" } } - } + }, + "required": true }, "parameters": [ { @@ -11875,7 +12063,8 @@ "$ref": "#/components/schemas/Reindex_BodyParams" } } - } + }, + "required": true }, "parameters": [ { @@ -12055,7 +12244,8 @@ } } } - } + }, + "required": true }, "parameters": [ { @@ -12227,7 +12417,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -12448,7 +12638,8 @@ "$ref": "#/components/schemas/PutScript_BodyParams" } } - } + }, + "required": true }, "parameters": [ { @@ -12521,7 +12712,8 @@ "$ref": "#/components/schemas/PutScript_BodyParams" } } - } + }, + "required": true }, "parameters": [ { @@ -12592,7 +12784,8 @@ "$ref": "#/components/schemas/PutScript_BodyParams" } } - } + }, + "required": true }, "parameters": [ { @@ -12672,7 +12865,8 @@ "$ref": "#/components/schemas/PutScript_BodyParams" } } - } + }, + "required": true }, "parameters": [ { @@ -13724,7 +13918,8 @@ "$ref": "#/components/schemas/DeletePit_BodyParams" } } - } + }, + "required": true }, "responses": { "200": { @@ -13916,7 +14111,7 @@ "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": "list" + "x-data-type": "array" }, "required": true } @@ -14208,7 +14403,8 @@ "$ref": "#/components/schemas/SearchTemplate_BodyParams" } } - } + }, + "required": true }, "parameters": [ { @@ -14656,7 +14852,8 @@ "$ref": "#/components/schemas/IndicesPutSettings_BodyParams" } } - } + }, + "required": true }, "parameters": [ { @@ -14764,7 +14961,7 @@ "type": "string", "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", "description": "Comma-separated list of settings.", - "x-data-type": "list" + "x-data-type": "array" }, "required": true }, @@ -15043,7 +15240,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -15104,7 +15301,7 @@ "type": "string", "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", "description": "Comma-separated list of repository names.", - "x-data-type": "list" + "x-data-type": "array" }, "required": true }, @@ -15162,7 +15359,8 @@ "$ref": "#/components/schemas/SnapshotCreateRepository_BodyParams" } } - } + }, + "required": true }, "parameters": [ { @@ -15244,7 +15442,8 @@ "$ref": "#/components/schemas/SnapshotCreateRepository_BodyParams" } } - } + }, + "required": true }, "parameters": [ { @@ -15598,7 +15797,7 @@ "type": "string", "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", "description": "Comma-separated list of snapshot names.", - "x-data-type": "list" + "x-data-type": "array" }, "required": true }, @@ -15833,7 +16032,8 @@ "$ref": "#/components/schemas/SnapshotClone_BodyParams" } } - } + }, + "required": true }, "parameters": [ { @@ -16013,7 +16213,7 @@ "type": "string", "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", "description": "Comma-separated list of snapshot names.", - "x-data-type": "list" + "x-data-type": "array" }, "required": true }, @@ -16214,7 +16414,7 @@ "warmer", "suggest" ], - "x-data-type": "list" + "x-data-type": "array" }, "required": true }, @@ -16756,7 +16956,7 @@ "type": "string", "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", "description": "Comma-separated names of the index templates.", - "x-data-type": "list" + "x-data-type": "array" }, "required": true }, @@ -16830,7 +17030,7 @@ "type": "string", "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", "description": "Comma-separated names of the index templates.", - "x-data-type": "list" + "x-data-type": "array" }, "required": true }, @@ -16887,7 +17087,8 @@ "$ref": "#/components/schemas/IndicesPutTemplate_BodyParams" } } - } + }, + "required": true }, "parameters": [ { @@ -16969,7 +17170,8 @@ "$ref": "#/components/schemas/IndicesPutTemplate_BodyParams" } } - } + }, + "required": true }, "parameters": [ { @@ -17653,7 +17855,7 @@ "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": "list" + "x-data-type": "array" }, "required": true, "examples": { @@ -17758,7 +17960,7 @@ "type": "string", "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", "description": "Comma-separated list of indices.", - "x-data-type": "list" + "x-data-type": "array" }, "required": true }, @@ -17870,7 +18072,7 @@ "type": "string", "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", "description": "Comma-separated list of indices.", - "x-data-type": "list" + "x-data-type": "array" }, "required": true }, @@ -18062,7 +18264,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -18129,7 +18331,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -18141,7 +18343,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -18202,7 +18404,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -18214,7 +18416,7 @@ "type": "string", "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", "description": "Comma-separated list of alias names.", - "x-data-type": "list" + "x-data-type": "array" }, "required": true }, @@ -18275,7 +18477,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -18287,7 +18489,7 @@ "type": "string", "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", "description": "Comma-separated list of alias names.", - "x-data-type": "list" + "x-data-type": "array" }, "required": true }, @@ -18357,7 +18559,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -18442,7 +18644,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -18516,7 +18718,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -18528,7 +18730,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -18598,7 +18800,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -18679,7 +18881,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -18834,7 +19036,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -18932,7 +19134,8 @@ "$ref": "#/components/schemas/Bulk_BodyParams" } } - } + }, + "required": true }, "parameters": [ { @@ -19073,7 +19276,8 @@ "$ref": "#/components/schemas/Bulk_BodyParams" } } - } + }, + "required": true }, "parameters": [ { @@ -19218,7 +19422,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -19514,7 +19718,7 @@ "type": "string", "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", "description": "Comma-separated list of indices to close.", - "x-data-type": "list" + "x-data-type": "array" }, "required": true }, @@ -19612,7 +19816,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -19779,7 +19983,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -19937,7 +20141,8 @@ "$ref": "#/components/schemas/Create_BodyParams" } } - } + }, + "required": true }, "parameters": [ { @@ -20050,7 +20255,8 @@ "$ref": "#/components/schemas/Create_BodyParams" } } - } + }, + "required": true }, "parameters": [ { @@ -20165,7 +20371,8 @@ "$ref": "#/components/schemas/DeleteByQuery_BodyParams" } } - } + }, + "required": true }, "parameters": [ { @@ -20176,7 +20383,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -20549,7 +20756,8 @@ "$ref": "#/components/schemas/Index_BodyParams" } } - } + }, + "required": true }, "parameters": [ { @@ -21134,7 +21342,8 @@ "$ref": "#/components/schemas/Index_BodyParams" } } - } + }, + "required": true }, "parameters": [ { @@ -21281,7 +21490,8 @@ "$ref": "#/components/schemas/Index_BodyParams" } } - } + }, + "required": true }, "parameters": [ { @@ -21777,7 +21987,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -21861,7 +22071,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -21938,7 +22148,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -22008,7 +22218,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -22080,7 +22290,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -22162,7 +22372,7 @@ "type": "string", "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", "description": "Comma-separated list of indices.", - "x-data-type": "list" + "x-data-type": "array" }, "required": true }, @@ -22249,7 +22459,8 @@ "$ref": "#/components/schemas/IndicesPutMapping_BodyParams" } } - } + }, + "required": true }, "parameters": [ { @@ -22260,7 +22471,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -22366,7 +22577,8 @@ "$ref": "#/components/schemas/IndicesPutMapping_BodyParams" } } - } + }, + "required": true }, "parameters": [ { @@ -22377,16 +22589,9 @@ "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": "list" + "x-data-type": "array" }, - "required": true, - "examples": { - "IndicesPutMapping_Put_example1": { - "summary": "Examples for Put Index Mapping with index Operation.", - "description": "", - "value": "books" - } - } + "required": true }, { "name": "timeout", @@ -22468,15 +22673,6 @@ "application/json": { "schema": { "$ref": "#/components/schemas/IndicesPutMapping_PutResponseContent" - }, - "examples": { - "IndicesPutMapping_Put_example1": { - "summary": "Examples for Put Index Mapping with index Operation.", - "description": "", - "value": { - "acknowledged": true - } - } } } } @@ -22499,7 +22695,7 @@ "type": "string", "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", "description": "Comma-separated list of indices.", - "x-data-type": "list" + "x-data-type": "array" }, "required": true }, @@ -22511,7 +22707,7 @@ "type": "string", "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", "description": "Comma-separated list of fields.", - "x-data-type": "list" + "x-data-type": "array" }, "required": true }, @@ -22698,7 +22894,8 @@ "$ref": "#/components/schemas/Mget_BodyParams" } } - } + }, + "required": true }, "parameters": [ { @@ -22828,7 +23025,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -22919,7 +23116,8 @@ "$ref": "#/components/schemas/Msearch_BodyParams" } } - } + }, + "required": true }, "parameters": [ { @@ -22930,7 +23128,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -23025,7 +23223,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -23095,7 +23293,8 @@ "$ref": "#/components/schemas/MsearchTemplate_BodyParams" } } - } + }, + "required": true }, "parameters": [ { @@ -23106,7 +23305,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -23493,7 +23692,7 @@ "type": "string", "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", "description": "Comma-separated list of indices to open.", - "x-data-type": "list" + "x-data-type": "array" }, "required": true }, @@ -23580,7 +23779,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -23637,7 +23836,8 @@ "$ref": "#/components/schemas/RankEval_BodyParams" } } - } + }, + "required": true }, "parameters": [ { @@ -23648,7 +23848,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -23709,7 +23909,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -23756,7 +23956,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -23807,7 +24007,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -23860,7 +24060,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -24349,7 +24549,7 @@ "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": "list" + "x-data-type": "array" }, "required": true, "examples": { @@ -24857,7 +25057,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -24926,7 +25126,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -25074,7 +25274,8 @@ "$ref": "#/components/schemas/SearchTemplate_BodyParams" } } - } + }, + "required": true }, "parameters": [ { @@ -25085,7 +25286,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -25237,7 +25438,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -25317,7 +25518,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -25399,7 +25600,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -25462,7 +25663,7 @@ "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": "list" + "x-data-type": "array" }, "required": true, "examples": { @@ -25573,7 +25774,8 @@ "$ref": "#/components/schemas/IndicesPutSettings_BodyParams" } } - } + }, + "required": true }, "parameters": [ { @@ -25584,7 +25786,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -25693,7 +25895,7 @@ "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": "list" + "x-data-type": "array" }, "required": true, "examples": { @@ -25712,7 +25914,7 @@ "type": "string", "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", "description": "Comma-separated list of settings.", - "x-data-type": "list" + "x-data-type": "array" }, "required": true, "examples": { @@ -25827,7 +26029,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -26590,7 +26792,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -26719,7 +26921,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -26749,7 +26951,7 @@ "warmer", "suggest" ], - "x-data-type": "list" + "x-data-type": "array" }, "required": true }, @@ -27468,7 +27670,8 @@ "$ref": "#/components/schemas/Update_BodyParams" } } - } + }, + "required": true }, "parameters": [ { @@ -27660,7 +27863,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -28040,7 +28243,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -28091,7 +28294,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -28163,7 +28366,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -28304,7 +28507,7 @@ "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": "list" + "x-data-type": "array" }, "required": true }, @@ -28442,6 +28645,12 @@ } } }, + "AttributeMap": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, "Bulk_BodyParams": { "type": "object", "x-serialize": "bulk" @@ -28463,9 +28672,6 @@ "pb" ] }, - "CatIndicesOutputPayload": {}, - "CatIndices_WithIndexOutputPayload": {}, - "CatNodesOutputPayload": {}, "ClearScroll_BodyParams": { "type": "object" }, @@ -28551,6 +28757,27 @@ "Count_BodyParams": { "type": "object" }, + "CreateTenantParams": { + "type": "object", + "properties": { + "description": { + "type": "string" + } + } + }, + "CreateTenantResponseContent": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Informing of request's status." + }, + "message": { + "type": "string", + "description": "The message indicating the information of action of the model." + } + } + }, "Create_BodyParams": { "type": "object" }, @@ -28568,6 +28795,19 @@ "DeletePit_BodyParams": { "type": "object" }, + "DeleteTenantResponseContent": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Informing of request's status." + }, + "message": { + "type": "string", + "description": "The message indicating the information of action of the model." + } + } + }, "ExpandWildcards": { "type": "string", "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", @@ -28628,6 +28868,25 @@ "found" ] }, + "GetTenantResponseContent": { + "type": "object", + "properties": { + "tenant": { + "$ref": "#/components/schemas/Tenant" + } + } + }, + "GetTenantsResponseContent": { + "type": "object", + "properties": { + "tenantlist": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Tenant" + } + } + } + }, "GroupBy": { "type": "string", "description": "Group tasks by nodes or parent/child relationships.", @@ -28906,6 +29165,65 @@ "create" ] }, + "PatchOperation": { + "type": "object", + "properties": { + "op": { + "type": "string" + }, + "path": { + "type": "string" + }, + "value": { + "$ref": "#/components/schemas/AttributeMap" + } + } + }, + "PatchTenantParams": { + "type": "object", + "properties": { + "tenantPatch": { + "$ref": "#/components/schemas/PatchOperation" + } + } + }, + "PatchTenantResponseContent": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Informing of request's status." + }, + "message": { + "type": "string", + "description": "The message indicating the information of action of the model." + } + } + }, + "PatchTenantsParams": { + "type": "object", + "properties": { + "tenantsPatch": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PatchOperation" + } + } + } + }, + "PatchTenantsResponseContent": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Informing of request's status." + }, + "message": { + "type": "string", + "description": "The message indicating the information of action of the model." + } + } + }, "PutScript_BodyParams": { "type": "object" }, @@ -29219,6 +29537,23 @@ "always" ] }, + "Tenant": { + "type": "object", + "properties": { + "reserved": { + "type": "boolean" + }, + "hidden": { + "type": "boolean" + }, + "description": { + "type": "string" + }, + "static": { + "type": "boolean" + } + } + }, "Termvectors_BodyParams": { "type": "object" }, diff --git a/src/ApiGenerator/Views/HighLevel/Client/Implementation/OpenSearchClient.cshtml b/src/ApiGenerator/Views/HighLevel/Client/Implementation/OpenSearchClient.cshtml index 5b65ac4ba7..9ee1e2cd75 100644 --- a/src/ApiGenerator/Views/HighLevel/Client/Implementation/OpenSearchClient.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Client/Implementation/OpenSearchClient.cshtml @@ -30,7 +30,7 @@ namespace OpenSearch.Client } - partial void SetupNamespaces() + partial void SetupGeneratedNamespaces() { foreach (var ns in namespaces) diff --git a/src/ApiGenerator/Views/HighLevel/Descriptors/RequestDescriptorBase.cshtml b/src/ApiGenerator/Views/HighLevel/Descriptors/RequestDescriptorBase.cshtml index 4a9ead63a0..14ffe82e89 100644 --- a/src/ApiGenerator/Views/HighLevel/Descriptors/RequestDescriptorBase.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Descriptors/RequestDescriptorBase.cshtml @@ -1,5 +1,6 @@ @using ApiGenerator.Domain @inherits ApiGenerator.CodeTemplatePage +@{ await IncludeGeneratorNotice(); } using System.Collections.Generic; namespace OpenSearch.Client diff --git a/src/ApiGenerator/Views/HighLevel/Requests/ApiUrlsLookup.cshtml b/src/ApiGenerator/Views/HighLevel/Requests/ApiUrlsLookup.cshtml index 92c71f127f..93d8bdf44c 100644 --- a/src/ApiGenerator/Views/HighLevel/Requests/ApiUrlsLookup.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Requests/ApiUrlsLookup.cshtml @@ -6,7 +6,7 @@ @{ await IncludeGeneratorNotice(); } namespace OpenSearch.Client { - internal static class ApiUrlsLookups + internal static partial class ApiUrlsLookups { @foreach (var endpoint in Model.Endpoints.Values) { diff --git a/src/ApiGenerator/Views/LowLevel/Client/Implementation/OpenSearchLowLevelClient.cshtml b/src/ApiGenerator/Views/LowLevel/Client/Implementation/OpenSearchLowLevelClient.cshtml index 84722f9763..231413f7a1 100644 --- a/src/ApiGenerator/Views/LowLevel/Client/Implementation/OpenSearchLowLevelClient.cshtml +++ b/src/ApiGenerator/Views/LowLevel/Client/Implementation/OpenSearchLowLevelClient.cshtml @@ -35,7 +35,7 @@ namespace OpenSearch.Net } - partial void SetupNamespaces() + partial void SetupGeneratedNamespaces() { foreach (var ns in namespaces) diff --git a/src/ApiGenerator/Views/LowLevel/Enums.Generated.cshtml b/src/ApiGenerator/Views/LowLevel/Enums.cshtml similarity index 67% rename from src/ApiGenerator/Views/LowLevel/Enums.Generated.cshtml rename to src/ApiGenerator/Views/LowLevel/Enums.cshtml index 3d4cb84b83..630392bd6e 100644 --- a/src/ApiGenerator/Views/LowLevel/Enums.Generated.cshtml +++ b/src/ApiGenerator/Views/LowLevel/Enums.cshtml @@ -63,11 +63,9 @@ namespace OpenSearch.Net } } - public static class KnownEnums + public static partial class KnownEnums { - private static readonly @(Raw("ConcurrentDictionary>")) EnumStringResolvers = new @(Raw("ConcurrentDictionary>"))(); - - static KnownEnums() + static partial void RegisterEnumStringResolvers() { @foreach (var e in Model.EnumsInTheSpec) { @@ -76,13 +74,7 @@ namespace OpenSearch.Net } } - private class EnumDictionary : @(Raw("Dictionary")) - { - public EnumDictionary(int capacity) : base(capacity) {} - public @(Raw("Func")) Resolver { get; set; } - } - - @foreach (var e in Model.EnumsInTheSpec) + @foreach (var e in Model.EnumsInTheSpec) { var isFlag = IsFlag(e.Name); @@ -127,46 +119,5 @@ namespace OpenSearch.Net } } } - - public static string GetStringValue(this Enum e) - { - var type = e.GetType(); - var resolver = EnumStringResolvers.GetOrAdd(type, GetEnumStringResolver); - return resolver(e); - } - - private static @Raw("Func") GetEnumStringResolver(Type type) - { - var values = Enum.GetValues(type); - var dictionary = new EnumDictionary(values.Length); - - for (int index = 0; index < values.Length; index++) - { - var value = values.GetValue(index); - var info = type.GetField(value.ToString()); - var da = (EnumMemberAttribute[])info.GetCustomAttributes(typeof(EnumMemberAttribute), false); - var stringValue = da.Length > 0 ? da[0].Value : Enum.GetName(type, value); - dictionary.Add((Enum)value, stringValue); - } - - var isFlag = type.GetCustomAttributes(typeof(FlagsAttribute), false).Length > 0; - - return (e) => - { - if (isFlag) - { - var list = new @(Raw("List()")); - foreach(var kv in dictionary) - { - if (e.HasFlag(kv.Key)) list.Add(kv.Value); - } - return string.Join(",", list); - } - else - { - return dictionary[e]; - } - }; - } - } + } } diff --git a/src/ApiGenerator/Views/LowLevel/RequestParameters/RequestParameters.cshtml b/src/ApiGenerator/Views/LowLevel/RequestParameters/RequestParameters.cshtml index 78c4862f41..0094de703b 100644 --- a/src/ApiGenerator/Views/LowLevel/RequestParameters/RequestParameters.cshtml +++ b/src/ApiGenerator/Views/LowLevel/RequestParameters/RequestParameters.cshtml @@ -26,7 +26,7 @@ namespace OpenSearch.Net@(ns) var names = r.CsharpNames; ///Request options for @names.MethodName@Raw(r.OfficialDocumentationLink.IsNullOrEmpty() ? "" : " " + r.OfficialDocumentationLink + "") - public class @names.ParametersName : RequestParameters<@names.ParametersName> + public partial class @names.ParametersName : RequestParameters<@names.ParametersName> { public override HttpMethod DefaultHttpMethod => HttpMethod.@r.HttpMethod; public override bool SupportsBody => @(supportsBody ? "true" : "false"); From 9880d8008ad6d688c3a1a117076abb523f204549 Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Thu, 17 Aug 2023 14:19:11 +1200 Subject: [PATCH 10/27] Clean up old rest specification files (#319) Signed-off-by: Thomas Farr --- src/ApiGenerator/ApiGenerator.csproj | 1 - .../Domain/Specification/ApiEndpoint.cs | 6 - .../Domain/Specification/Documentation.cs | 45 ---- .../Domain/Specification/QueryParameters.cs | 18 -- .../Domain/Specification/UrlInformation.cs | 4 - .../RestSpecification/Core/_common.json | 31 --- .../RestSpecification/Core/bulk.json | 107 -------- .../RestSpecification/Core/cat.aliases.json | 75 ------ .../Core/cat.allocation.json | 88 ------- .../Core/cat.cluster_manager.json | 73 ------ .../RestSpecification/Core/cat.count.json | 59 ----- .../RestSpecification/Core/cat.fielddata.json | 80 ------ .../RestSpecification/Core/cat.health.json | 65 ----- .../RestSpecification/Core/cat.help.json | 34 --- .../RestSpecification/Core/cat.indices.json | 132 ---------- .../RestSpecification/Core/cat.master.json | 55 ---- .../RestSpecification/Core/cat.nodeattrs.json | 59 ----- .../RestSpecification/Core/cat.nodes.json | 89 ------- .../Core/cat.pending_tasks.json | 72 ------ .../RestSpecification/Core/cat.plugins.json | 64 ----- .../RestSpecification/Core/cat.recovery.json | 103 -------- .../Core/cat.repositories.json | 60 ----- .../RestSpecification/Core/cat.segments.json | 76 ------ .../RestSpecification/Core/cat.shards.json | 101 -------- .../RestSpecification/Core/cat.snapshots.json | 85 ------ .../RestSpecification/Core/cat.tasks.json | 76 ------ .../RestSpecification/Core/cat.templates.json | 71 ----- .../Core/cat.thread_pool.json | 71 ----- .../RestSpecification/Core/clear_scroll.json | 28 -- .../Core/cluster.allocation_explain.json | 38 --- .../cluster.delete_component_template.json | 43 ---- ...uster.delete_voting_config_exclusions.json | 30 --- .../cluster.exists_component_template.json | 43 ---- .../Core/cluster.get_component_template.json | 49 ---- .../Core/cluster.get_settings.json | 46 ---- .../Core/cluster.health.json | 112 -------- .../Core/cluster.pending_tasks.json | 37 --- ...cluster.post_voting_config_exclusions.json | 38 --- .../Core/cluster.put_component_template.json | 54 ---- .../Core/cluster.put_settings.json | 46 ---- .../Core/cluster.remote_info.json | 24 -- .../Core/cluster.reroute.json | 66 ----- .../RestSpecification/Core/cluster.state.json | 117 --------- .../RestSpecification/Core/cluster.stats.json | 45 ---- .../RestSpecification/Core/count.json | 113 -------- .../RestSpecification/Core/create.json | 79 ------ ...angling_indices.delete_dangling_index.json | 47 ---- ...angling_indices.import_dangling_index.json | 47 ---- ...angling_indices.list_dangling_indices.json | 24 -- .../RestSpecification/Core/delete.json | 78 ------ .../Core/delete_by_query.json | 185 ------------- .../Core/delete_by_query_rethrottle.json | 36 --- .../RestSpecification/Core/delete_script.json | 43 ---- .../RestSpecification/Core/exists.json | 81 ------ .../RestSpecification/Core/exists_source.json | 77 ------ .../RestSpecification/Core/explain.json | 93 ------- .../Core/features.get_features.json | 33 --- .../RestSpecification/Core/field_caps.json | 71 ----- .../RestSpecification/Core/get.json | 81 ------ .../RestSpecification/Core/get_script.json | 39 --- .../Core/get_script_context.json | 24 -- .../Core/get_script_languages.json | 24 -- .../RestSpecification/Core/get_source.json | 77 ------ .../RestSpecification/Core/index.json | 111 -------- .../Core/indices.add_block.json | 67 ----- .../Core/indices.analyze.json | 47 ---- .../Core/indices.clear_cache.json | 77 ------ .../RestSpecification/Core/indices.clone.json | 56 ---- .../RestSpecification/Core/indices.close.json | 67 ----- .../Core/indices.create.json | 55 ---- .../Core/indices.delete.json | 63 ----- .../Core/indices.delete_alias.json | 63 ----- .../Core/indices.delete_index_template.json | 43 ---- .../Core/indices.delete_template.json | 43 ---- .../Core/indices.exists.json | 64 ----- .../Core/indices.exists_alias.json | 71 ----- .../Core/indices.exists_index_template.json | 47 ---- .../Core/indices.exists_template.json | 47 ---- .../Core/indices.exists_type.json | 59 ----- .../RestSpecification/Core/indices.flush.json | 67 ----- .../Core/indices.forcemerge.json | 69 ----- .../RestSpecification/Core/indices.get.json | 76 ------ .../Core/indices.get_alias.json | 89 ------- .../Core/indices.get_field_mapping.json | 79 ------ .../Core/indices.get_index_template.json | 53 ---- .../Core/indices.get_mapping.json | 69 ----- .../Core/indices.get_settings.json | 106 -------- .../Core/indices.get_template.json | 57 ---- .../RestSpecification/Core/indices.open.json | 67 ----- .../Core/indices.put_alias.json | 70 ----- .../Core/indices.put_index_template.json | 55 ---- .../Core/indices.put_mapping.json | 95 ------- .../Core/indices.put_settings.json | 82 ------ .../Core/indices.put_template.json | 58 ----- .../Core/indices.recovery.json | 47 ---- .../Core/indices.refresh.json | 59 ----- .../Core/indices.resolve_index.json | 43 ---- .../Core/indices.rollover.json | 75 ------ .../Core/indices.segments.json | 62 ----- .../Core/indices.shard_stores.json | 67 ----- .../Core/indices.shrink.json | 60 ----- .../Core/indices.simulate_index_template.json | 54 ---- .../Core/indices.simulate_template.json | 60 ----- .../RestSpecification/Core/indices.split.json | 60 ----- .../RestSpecification/Core/indices.stats.json | 158 ------------ .../Core/indices.update_aliases.json | 42 --- .../Core/indices.validate_query.json | 104 -------- .../RestSpecification/Core/info.json | 24 -- .../Core/ingest.delete_pipeline.json | 43 ---- .../Core/ingest.get_pipeline.json | 45 ---- .../Core/ingest.processor_grok.json | 24 -- .../Core/ingest.put_pipeline.json | 48 ---- .../Core/ingest.simulate.json | 49 ---- .../RestSpecification/Core/mget.json | 76 ------ .../RestSpecification/Core/msearch.json | 82 ------ .../Core/msearch_template.json | 73 ------ .../RestSpecification/Core/mtermvectors.json | 103 -------- .../Core/nodes.hot_threads.json | 147 ----------- .../RestSpecification/Core/nodes.info.json | 95 ------- .../Core/nodes.reload_secure_settings.json | 46 ---- .../RestSpecification/Core/nodes.stats.json | 232 ----------------- .../RestSpecification/Core/nodes.usage.json | 77 ------ .../RestSpecification/Core/ping.json | 24 -- .../RestSpecification/Core/put_script.json | 70 ----- .../RestSpecification/Core/rank_eval.json | 72 ------ .../RestSpecification/Core/reindex.json | 67 ----- .../Core/reindex_rethrottle.json | 36 --- .../Core/render_search_template.json | 41 --- .../Core/scripts_painless_execute.json | 29 --- .../RestSpecification/Core/scroll.json | 43 ---- .../RestSpecification/Core/search.json | 243 ------------------ .../RestSpecification/Core/search_shards.json | 71 ----- .../Core/search_template.json | 112 -------- .../Core/snapshot.cleanup_repository.json | 43 ---- .../Core/snapshot.clone.json | 52 ---- .../Core/snapshot.create.json | 54 ---- .../Core/snapshot.create_repository.json | 53 ---- .../Core/snapshot.delete.json | 43 ---- .../Core/snapshot.delete_repository.json | 43 ---- .../RestSpecification/Core/snapshot.get.json | 51 ---- .../Core/snapshot.get_repository.json | 49 ---- .../Core/snapshot.restore.json | 53 ---- .../Core/snapshot.status.json | 65 ----- .../Core/snapshot.verify_repository.json | 43 ---- .../RestSpecification/Core/tasks.cancel.json | 53 ---- .../RestSpecification/Core/tasks.get.json | 39 --- .../RestSpecification/Core/tasks.list.json | 59 ----- .../RestSpecification/Core/termvectors.json | 109 -------- .../RestSpecification/Core/update.json | 93 ------- .../Core/update_by_query.json | 198 -------------- .../Core/update_by_query_rethrottle.json | 36 --- .../_Patches/cat.tasks.patch.json | 8 - .../_Patches/indices.put_mapping.patch.json | 15 -- .../_Patches/indices.stats.patch.json | 11 - .../_Patches/nodes.hot_threads.patch.json | 40 --- .../_Patches/nodes.stats.patch.json | 11 - .../_Patches/reindex.patch.patch.json | 12 - .../snapshot.cleanup_repository.patch.json | 5 - 158 files changed, 10041 deletions(-) delete mode 100644 src/ApiGenerator/RestSpecification/Core/_common.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/bulk.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/cat.aliases.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/cat.allocation.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/cat.cluster_manager.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/cat.count.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/cat.fielddata.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/cat.health.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/cat.help.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/cat.indices.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/cat.master.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/cat.nodeattrs.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/cat.nodes.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/cat.pending_tasks.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/cat.plugins.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/cat.recovery.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/cat.repositories.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/cat.segments.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/cat.shards.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/cat.snapshots.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/cat.tasks.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/cat.templates.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/cat.thread_pool.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/clear_scroll.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/cluster.allocation_explain.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/cluster.delete_component_template.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/cluster.delete_voting_config_exclusions.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/cluster.exists_component_template.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/cluster.get_component_template.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/cluster.get_settings.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/cluster.health.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/cluster.pending_tasks.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/cluster.post_voting_config_exclusions.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/cluster.put_component_template.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/cluster.put_settings.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/cluster.remote_info.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/cluster.reroute.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/cluster.state.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/cluster.stats.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/count.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/create.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/dangling_indices.delete_dangling_index.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/dangling_indices.import_dangling_index.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/dangling_indices.list_dangling_indices.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/delete.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/delete_by_query.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/delete_by_query_rethrottle.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/delete_script.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/exists.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/exists_source.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/explain.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/features.get_features.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/field_caps.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/get.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/get_script.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/get_script_context.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/get_script_languages.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/get_source.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/index.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/indices.add_block.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/indices.analyze.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/indices.clear_cache.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/indices.clone.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/indices.close.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/indices.create.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/indices.delete.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/indices.delete_alias.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/indices.delete_index_template.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/indices.delete_template.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/indices.exists.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/indices.exists_alias.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/indices.exists_index_template.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/indices.exists_template.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/indices.exists_type.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/indices.flush.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/indices.forcemerge.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/indices.get.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/indices.get_alias.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/indices.get_field_mapping.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/indices.get_index_template.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/indices.get_mapping.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/indices.get_settings.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/indices.get_template.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/indices.open.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/indices.put_alias.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/indices.put_index_template.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/indices.put_mapping.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/indices.put_settings.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/indices.put_template.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/indices.recovery.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/indices.refresh.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/indices.resolve_index.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/indices.rollover.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/indices.segments.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/indices.shard_stores.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/indices.shrink.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/indices.simulate_index_template.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/indices.simulate_template.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/indices.split.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/indices.stats.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/indices.update_aliases.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/indices.validate_query.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/info.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/ingest.delete_pipeline.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/ingest.get_pipeline.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/ingest.processor_grok.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/ingest.put_pipeline.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/ingest.simulate.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/mget.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/msearch.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/msearch_template.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/mtermvectors.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/nodes.hot_threads.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/nodes.info.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/nodes.reload_secure_settings.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/nodes.stats.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/nodes.usage.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/ping.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/put_script.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/rank_eval.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/reindex.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/reindex_rethrottle.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/render_search_template.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/scripts_painless_execute.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/scroll.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/search.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/search_shards.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/search_template.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/snapshot.cleanup_repository.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/snapshot.clone.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/snapshot.create.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/snapshot.create_repository.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/snapshot.delete.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/snapshot.delete_repository.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/snapshot.get.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/snapshot.get_repository.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/snapshot.restore.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/snapshot.status.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/snapshot.verify_repository.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/tasks.cancel.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/tasks.get.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/tasks.list.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/termvectors.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/update.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/update_by_query.json delete mode 100644 src/ApiGenerator/RestSpecification/Core/update_by_query_rethrottle.json delete mode 100644 src/ApiGenerator/RestSpecification/_Patches/cat.tasks.patch.json delete mode 100644 src/ApiGenerator/RestSpecification/_Patches/indices.put_mapping.patch.json delete mode 100644 src/ApiGenerator/RestSpecification/_Patches/indices.stats.patch.json delete mode 100644 src/ApiGenerator/RestSpecification/_Patches/nodes.hot_threads.patch.json delete mode 100644 src/ApiGenerator/RestSpecification/_Patches/nodes.stats.patch.json delete mode 100644 src/ApiGenerator/RestSpecification/_Patches/reindex.patch.patch.json delete mode 100644 src/ApiGenerator/RestSpecification/_Patches/snapshot.cleanup_repository.patch.json diff --git a/src/ApiGenerator/ApiGenerator.csproj b/src/ApiGenerator/ApiGenerator.csproj index ea7bd766f9..753f44290e 100644 --- a/src/ApiGenerator/ApiGenerator.csproj +++ b/src/ApiGenerator/ApiGenerator.csproj @@ -20,7 +20,6 @@ - diff --git a/src/ApiGenerator/Domain/Specification/ApiEndpoint.cs b/src/ApiGenerator/Domain/Specification/ApiEndpoint.cs index 3ecf3ae089..541f3cfc65 100644 --- a/src/ApiGenerator/Domain/Specification/ApiEndpoint.cs +++ b/src/ApiGenerator/Domain/Specification/ApiEndpoint.cs @@ -33,8 +33,6 @@ using ApiGenerator.Domain.Code.HighLevel.Methods; using ApiGenerator.Domain.Code.HighLevel.Requests; using ApiGenerator.Domain.Code.LowLevel; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; namespace ApiGenerator.Domain.Specification { @@ -52,18 +50,14 @@ public class ApiEndpoint /// Computed Csharp identifier names public CsharpNames CsharpNames { get; set; } - [JsonConverter(typeof(StringEnumConverter))] - [JsonProperty("stability")] public Stability Stability { get; set; } - [JsonProperty("documentation")] public Documentation OfficialDocumentationLink { get; set; } public UrlInformation Url { get; set; } public Body Body { get; set; } - [JsonProperty("methods")] public IReadOnlyCollection HttpMethods { get; set; } public IEndpointOverrides Overrides { get; internal set; } diff --git a/src/ApiGenerator/Domain/Specification/Documentation.cs b/src/ApiGenerator/Domain/Specification/Documentation.cs index 7f0cad59f5..3e38065101 100644 --- a/src/ApiGenerator/Domain/Specification/Documentation.cs +++ b/src/ApiGenerator/Domain/Specification/Documentation.cs @@ -26,12 +26,8 @@ * under the License. */ -using System; -using Newtonsoft.Json; - namespace ApiGenerator.Domain.Specification { - [JsonConverter(typeof(DocumentationConverter))] public class Documentation { public string Description { get; set; } @@ -43,45 +39,4 @@ public string Url set => _url = value?.Replace("http://", "https://"); } } - - public class DocumentationConverter : JsonConverter - { - public override bool CanWrite { get; } = false; - - public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) => throw new NotSupportedException(); - - public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) - { - - var documentation = new Documentation(); - - if (reader.TokenType == JsonToken.String) - { - documentation.Url = (string)reader.Value; - return documentation; - } - - while (reader.Read()) - { - if (reader.TokenType == JsonToken.EndObject) - break; - - var prop = (string)reader.Value; - switch (prop) - { - case "url": - documentation.Url = reader.ReadAsString(); - break; - case "description": - documentation.Description = reader.ReadAsString(); - break; - default: - throw new Exception($"Property '{prop}' unexpected in documentation object"); - } - } - return documentation; - } - - public override bool CanConvert(Type objectType) => true; - } } diff --git a/src/ApiGenerator/Domain/Specification/QueryParameters.cs b/src/ApiGenerator/Domain/Specification/QueryParameters.cs index cd8de8801d..bbd39c5344 100644 --- a/src/ApiGenerator/Domain/Specification/QueryParameters.cs +++ b/src/ApiGenerator/Domain/Specification/QueryParameters.cs @@ -30,8 +30,6 @@ using System.Collections.Generic; using System.Linq; using ApiGenerator.Generator; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; namespace ApiGenerator.Domain.Specification { @@ -203,20 +201,4 @@ public class QueryParameterDeprecation public string Description { get; set; } } - - internal class QueryParameterDeprecationConverter : JsonConverter - { - public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) => throw new NotImplementedException(); - - public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) - { - if (reader.TokenType == JsonToken.Boolean) - return new QueryParameterDeprecation(); - - var jObject = JObject.Load(reader); - return jObject.ToObject(JsonSerializer.CreateDefault()); - } - - public override bool CanConvert(Type objectType) => typeof(QueryParameterDeprecation).IsAssignableFrom(objectType); - } } diff --git a/src/ApiGenerator/Domain/Specification/UrlInformation.cs b/src/ApiGenerator/Domain/Specification/UrlInformation.cs index e56943ae41..0c05bcd805 100644 --- a/src/ApiGenerator/Domain/Specification/UrlInformation.cs +++ b/src/ApiGenerator/Domain/Specification/UrlInformation.cs @@ -29,7 +29,6 @@ using System; using System.Collections.Generic; using System.Linq; -using Newtonsoft.Json; namespace ApiGenerator.Domain.Specification { @@ -39,13 +38,10 @@ public class UrlInformation { public IDictionary Params { get; set; } = new SortedDictionary(); - [JsonProperty("paths")] public IList OriginalPaths { get; set; } = new List(); - [JsonProperty("parts")] public IDictionary OriginalParts { get; set; } - [JsonProperty("deprecated_paths")] private IReadOnlyCollection DeprecatedPaths { get; set; } private List _paths; diff --git a/src/ApiGenerator/RestSpecification/Core/_common.json b/src/ApiGenerator/RestSpecification/Core/_common.json deleted file mode 100644 index afb0f75de6..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/_common.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "documentation" : { - "description": "Parameters that are accepted by all API endpoints.", - "url": "https://opensearch.org/docs/latest/opensearch/common-parameters/" - }, - "params": { - "pretty": { - "type": "boolean", - "description": "Pretty format the returned JSON response.", - "default": false - }, - "human": { - "type": "boolean", - "description": "Return human readable values for statistics.", - "default": true - }, - "error_trace": { - "type": "boolean", - "description": "Include the stack trace of returned errors.", - "default": false - }, - "source": { - "type": "string", - "description": "The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests." - }, - "filter_path": { - "type": "list", - "description": "A comma-separated list of filters used to reduce the response." - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/bulk.json b/src/ApiGenerator/RestSpecification/Core/bulk.json deleted file mode 100644 index c4b2f102a9..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/bulk.json +++ /dev/null @@ -1,107 +0,0 @@ -{ - "bulk":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/bulk/", - "description":"Allows to perform multiple index/update/delete operations in a single request." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"], - "content_type": ["application/x-ndjson"] - }, - "url":{ - "paths":[ - { - "path":"/_bulk", - "methods":[ - "POST", - "PUT" - ] - }, - { - "path":"/{index}/_bulk", - "methods":[ - "POST", - "PUT" - ], - "parts":{ - "index":{ - "type":"string", - "description":"Default index for items which don't provide one" - } - } - }, - { - "path":"/{index}/{type}/_bulk", - "methods":[ - "POST", - "PUT" - ], - "parts":{ - "index":{ - "type":"string", - "description":"Default index for items which don't provide one" - }, - "type":{ - "type":"string", - "description":"Default document type for items which don't provide one" - } - } - } - ] - }, - "params":{ - "wait_for_active_shards":{ - "type":"string", - "description":"Sets the number of shard copies that must be active before proceeding with the bulk operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)" - }, - "refresh":{ - "type":"enum", - "options":[ - "true", - "false", - "wait_for" - ], - "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." - }, - "routing":{ - "type":"string", - "description":"Specific routing value" - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - }, - "type":{ - "type":"string", - "description":"Default document type for items which don't provide one" - }, - "_source":{ - "type":"list", - "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" - }, - "_source_excludes":{ - "type":"list", - "description":"Default list of fields to exclude from the returned _source field, can be overridden on each sub-request" - }, - "_source_includes":{ - "type":"list", - "description":"Default list of fields to extract and return from the _source field, can be overridden on each sub-request" - }, - "pipeline":{ - "type":"string", - "description":"The pipeline id to preprocess incoming documents with" - }, - "require_alias": { - "type": "boolean", - "description": "Sets require_alias for all incoming documents. Defaults to unset (false)" - } - }, - "body":{ - "description":"The operation definition and data (action-data pairs), separated by newlines", - "required":true, - "serialize":"bulk" - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/cat.aliases.json b/src/ApiGenerator/RestSpecification/Core/cat.aliases.json deleted file mode 100644 index 5790819539..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/cat.aliases.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "cat.aliases":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-aliases/", - "description":"Shows information about currently configured aliases to indices including filter and routing infos." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "text/plain", "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_cat/aliases", - "methods":[ - "GET" - ] - }, - { - "path":"/_cat/aliases/{name}", - "methods":[ - "GET" - ], - "parts":{ - "name":{ - "type":"list", - "description":"A comma-separated list of alias names to return" - } - } - } - ] - }, - "params":{ - "format":{ - "type":"string", - "description":"a short version of the Accept header, e.g. json, yaml" - }, - "local":{ - "type":"boolean", - "description":"Return local information, do not retrieve the state from master node (default: false)" - }, - "h":{ - "type":"list", - "description":"Comma-separated list of column names to display" - }, - "help":{ - "type":"boolean", - "description":"Return help information", - "default":false - }, - "s":{ - "type":"list", - "description":"Comma-separated list of column names or column aliases to sort by" - }, - "v":{ - "type":"boolean", - "description":"Verbose mode. Display column headers", - "default":false - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default": "all", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/cat.allocation.json b/src/ApiGenerator/RestSpecification/Core/cat.allocation.json deleted file mode 100644 index 6616747970..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/cat.allocation.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "cat.allocation":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-allocation/", - "description":"Provides a snapshot of how many shards are allocated to each data node and how much disk space they are using." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "text/plain", "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_cat/allocation", - "methods":[ - "GET" - ] - }, - { - "path":"/_cat/allocation/{node_id}", - "methods":[ - "GET" - ], - "parts":{ - "node_id":{ - "type":"list", - "description":"A comma-separated list of node IDs or names to limit the returned information" - } - } - } - ] - }, - "params":{ - "format":{ - "type":"string", - "description":"a short version of the Accept header, e.g. json, yaml" - }, - "bytes":{ - "type":"enum", - "description":"The unit in which to display byte values", - "options":[ - "b", - "k", - "kb", - "m", - "mb", - "g", - "gb", - "t", - "tb", - "p", - "pb" - ] - }, - "local":{ - "type":"boolean", - "description":"Return local information, do not retrieve the state from master node (default: false)" - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - }, - "h":{ - "type":"list", - "description":"Comma-separated list of column names to display" - }, - "help":{ - "type":"boolean", - "description":"Return help information", - "default":false - }, - "s":{ - "type":"list", - "description":"Comma-separated list of column names or column aliases to sort by" - }, - "v":{ - "type":"boolean", - "description":"Verbose mode. Display column headers", - "default":false - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/cat.cluster_manager.json b/src/ApiGenerator/RestSpecification/Core/cat.cluster_manager.json deleted file mode 100644 index 5056437c26..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/cat.cluster_manager.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "cat.cluster_manager":{ - "documentation":{ - "url":"https://opensearch.org/docs/2.0/opensearch/rest-api/cat/cat-cluster_manager/", - "description":"Returns information about the cluster_manager node. Introduced in OpenSearch 2.0 instead of cat-master." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "text/plain", "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_cat/cluster_manager", - "methods":[ - "GET" - ] - }, - { - "path":"/_cat/master", - "methods":[ - "GET" - ], - "deprecated":{ - "version":"2.0.0", - "description":"To promote inclusive language, please use '/_cat/cluster_manager' instead." - } - } - ] - }, - "params":{ - "format":{ - "type":"string", - "description":"a short version of the Accept header, e.g. json, yaml" - }, - "local":{ - "type":"boolean", - "description":"Return local information, do not retrieve the state from cluster-manager node (default: false)" - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node", - "deprecated":{ - "version":"2.0.0", - "description":"To promote inclusive language, use 'cluster_manager_timeout' instead." - } - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager node" - }, - "h":{ - "type":"list", - "description":"Comma-separated list of column names to display" - }, - "help":{ - "type":"boolean", - "description":"Return help information", - "default":false - }, - "s":{ - "type":"list", - "description":"Comma-separated list of column names or column aliases to sort by" - }, - "v":{ - "type":"boolean", - "description":"Verbose mode. Display column headers", - "default":false - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/cat.count.json b/src/ApiGenerator/RestSpecification/Core/cat.count.json deleted file mode 100644 index 3b1213eecc..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/cat.count.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "cat.count":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-count/", - "description":"Provides quick access to the document count of the entire cluster, or individual indices." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "text/plain", "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_cat/count", - "methods":[ - "GET" - ] - }, - { - "path":"/_cat/count/{index}", - "methods":[ - "GET" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names to limit the returned information" - } - } - } - ] - }, - "params":{ - "format":{ - "type":"string", - "description":"a short version of the Accept header, e.g. json, yaml" - }, - "h":{ - "type":"list", - "description":"Comma-separated list of column names to display" - }, - "help":{ - "type":"boolean", - "description":"Return help information", - "default":false - }, - "s":{ - "type":"list", - "description":"Comma-separated list of column names or column aliases to sort by" - }, - "v":{ - "type":"boolean", - "description":"Verbose mode. Display column headers", - "default":false - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/cat.fielddata.json b/src/ApiGenerator/RestSpecification/Core/cat.fielddata.json deleted file mode 100644 index 6d418a9547..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/cat.fielddata.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "cat.fielddata":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-field-data/", - "description":"Shows how much heap memory is currently being used by fielddata on every data node in the cluster." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "text/plain", "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_cat/fielddata", - "methods":[ - "GET" - ] - }, - { - "path":"/_cat/fielddata/{fields}", - "methods":[ - "GET" - ], - "parts":{ - "fields":{ - "type":"list", - "description":"A comma-separated list of fields to return the fielddata size" - } - } - } - ] - }, - "params":{ - "format":{ - "type":"string", - "description":"a short version of the Accept header, e.g. json, yaml" - }, - "bytes":{ - "type":"enum", - "description":"The unit in which to display byte values", - "options":[ - "b", - "k", - "kb", - "m", - "mb", - "g", - "gb", - "t", - "tb", - "p", - "pb" - ] - }, - "h":{ - "type":"list", - "description":"Comma-separated list of column names to display" - }, - "help":{ - "type":"boolean", - "description":"Return help information", - "default":false - }, - "s":{ - "type":"list", - "description":"Comma-separated list of column names or column aliases to sort by" - }, - "v":{ - "type":"boolean", - "description":"Verbose mode. Display column headers", - "default":false - }, - "fields":{ - "type":"list", - "description":"A comma-separated list of fields to return in the output" - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/cat.health.json b/src/ApiGenerator/RestSpecification/Core/cat.health.json deleted file mode 100644 index 0a3cc9be1f..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/cat.health.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "cat.health":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-health/", - "description":"Returns a concise representation of the cluster health." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "text/plain", "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_cat/health", - "methods":[ - "GET" - ] - } - ] - }, - "params":{ - "format":{ - "type":"string", - "description":"a short version of the Accept header, e.g. json, yaml" - }, - "h":{ - "type":"list", - "description":"Comma-separated list of column names to display" - }, - "help":{ - "type":"boolean", - "description":"Return help information", - "default":false - }, - "s":{ - "type":"list", - "description":"Comma-separated list of column names or column aliases to sort by" - }, - "time":{ - "type":"enum", - "description":"The unit in which to display time values", - "options":[ - "d", - "h", - "m", - "s", - "ms", - "micros", - "nanos" - ] - }, - "ts":{ - "type":"boolean", - "description":"Set to false to disable timestamping", - "default":true - }, - "v":{ - "type":"boolean", - "description":"Verbose mode. Display column headers", - "default":false - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/cat.help.json b/src/ApiGenerator/RestSpecification/Core/cat.help.json deleted file mode 100644 index 21c9e63b79..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/cat.help.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "cat.help":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-health/", - "description":"Returns help for the Cat APIs." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "text/plain" ] - }, - "url":{ - "paths":[ - { - "path":"/_cat", - "methods":[ - "GET" - ] - } - ] - }, - "params":{ - "help":{ - "type":"boolean", - "description":"Return help information", - "default":false - }, - "s":{ - "type":"list", - "description":"Comma-separated list of column names or column aliases to sort by" - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/cat.indices.json b/src/ApiGenerator/RestSpecification/Core/cat.indices.json deleted file mode 100644 index 1f6ad64e01..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/cat.indices.json +++ /dev/null @@ -1,132 +0,0 @@ -{ - "cat.indices":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-indices/", - "description":"Returns information about indices: number of primaries and replicas, document counts, disk size, ..." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "text/plain", "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_cat/indices", - "methods":[ - "GET" - ] - }, - { - "path":"/_cat/indices/{index}", - "methods":[ - "GET" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names to limit the returned information" - } - } - } - ] - }, - "params":{ - "format":{ - "type":"string", - "description":"a short version of the Accept header, e.g. json, yaml" - }, - "bytes":{ - "type":"enum", - "description":"The unit in which to display byte values", - "options":[ - "b", - "k", - "kb", - "m", - "mb", - "g", - "gb", - "t", - "tb", - "p", - "pb" - ] - }, - "local":{ - "type":"boolean", - "description":"Return local information, do not retrieve the state from master node (default: false)", - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - }, - "h":{ - "type":"list", - "description":"Comma-separated list of column names to display" - }, - "health":{ - "type":"enum", - "options":[ - "green", - "yellow", - "red" - ], - "description":"A health status (\"green\", \"yellow\", or \"red\" to filter only indices matching the specified health status" - }, - "help":{ - "type":"boolean", - "description":"Return help information", - "default":false - }, - "pri":{ - "type":"boolean", - "description":"Set to true to return stats only for primary shards", - "default":false - }, - "s":{ - "type":"list", - "description":"Comma-separated list of column names or column aliases to sort by" - }, - "time":{ - "type":"enum", - "description":"The unit in which to display time values", - "options":[ - "d", - "h", - "m", - "s", - "ms", - "micros", - "nanos" - ] - }, - "v":{ - "type":"boolean", - "description":"Verbose mode. Display column headers", - "default":false - }, - "include_unloaded_segments":{ - "type":"boolean", - "description":"If set to true segment stats will include stats for segments that are not currently loaded into memory", - "default":false - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default": "all", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/cat.master.json b/src/ApiGenerator/RestSpecification/Core/cat.master.json deleted file mode 100644 index 26e0d29110..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/cat.master.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "cat.master":{ - "documentation":{ - "url":"https://opensearch.org/docs/1.2/opensearch/rest-api/cat/cat-master/", - "description":"Returns information about the master node. Deprecated as of OpenSearch 2.0, use cat-cluster_manager instead." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "text/plain", "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_cat/master", - "methods":[ - "GET" - ] - } - ] - }, - "params":{ - "format":{ - "type":"string", - "description":"a short version of the Accept header, e.g. json, yaml" - }, - "local":{ - "type":"boolean", - "description":"Return local information, do not retrieve the state from master node (default: false)" - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "h":{ - "type":"list", - "description":"Comma-separated list of column names to display" - }, - "help":{ - "type":"boolean", - "description":"Return help information", - "default":false - }, - "s":{ - "type":"list", - "description":"Comma-separated list of column names or column aliases to sort by" - }, - "v":{ - "type":"boolean", - "description":"Verbose mode. Display column headers", - "default":false - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/cat.nodeattrs.json b/src/ApiGenerator/RestSpecification/Core/cat.nodeattrs.json deleted file mode 100644 index 61aa48cd6e..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/cat.nodeattrs.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "cat.nodeattrs":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-nodeattrs/", - "description":"Returns information about custom node attributes." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "text/plain", "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_cat/nodeattrs", - "methods":[ - "GET" - ] - } - ] - }, - "params":{ - "format":{ - "type":"string", - "description":"a short version of the Accept header, e.g. json, yaml" - }, - "local":{ - "type":"boolean", - "description":"Return local information, do not retrieve the state from master node (default: false)" - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - }, - "h":{ - "type":"list", - "description":"Comma-separated list of column names to display" - }, - "help":{ - "type":"boolean", - "description":"Return help information", - "default":false - }, - "s":{ - "type":"list", - "description":"Comma-separated list of column names or column aliases to sort by" - }, - "v":{ - "type":"boolean", - "description":"Verbose mode. Display column headers", - "default":false - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/cat.nodes.json b/src/ApiGenerator/RestSpecification/Core/cat.nodes.json deleted file mode 100644 index 3e6d9e1f2e..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/cat.nodes.json +++ /dev/null @@ -1,89 +0,0 @@ -{ - "cat.nodes":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-nodes/", - "description":"Returns basic statistics about performance of cluster nodes." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "text/plain", "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_cat/nodes", - "methods":[ - "GET" - ] - } - ] - }, - "params":{ - "bytes":{ - "type":"enum", - "description":"The unit in which to display byte values", - "options":[ - "b", - "k", - "kb", - "m", - "mb", - "g", - "gb", - "t", - "tb", - "p", - "pb" - ] - }, - "format":{ - "type":"string", - "description":"a short version of the Accept header, e.g. json, yaml" - }, - "full_id":{ - "type":"boolean", - "description":"Return the full node ID instead of the shortened version (default: false)" - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - }, - "h":{ - "type":"list", - "description":"Comma-separated list of column names to display" - }, - "help":{ - "type":"boolean", - "description":"Return help information", - "default":false - }, - "s":{ - "type":"list", - "description":"Comma-separated list of column names or column aliases to sort by" - }, - "time":{ - "type":"enum", - "description":"The unit in which to display time values", - "options":[ - "d", - "h", - "m", - "s", - "ms", - "micros", - "nanos" - ] - }, - "v":{ - "type":"boolean", - "description":"Verbose mode. Display column headers", - "default":false - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/cat.pending_tasks.json b/src/ApiGenerator/RestSpecification/Core/cat.pending_tasks.json deleted file mode 100644 index 8164f6c004..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/cat.pending_tasks.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "cat.pending_tasks":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-pending-tasks/", - "description":"Returns a concise representation of the cluster pending tasks." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "text/plain", "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_cat/pending_tasks", - "methods":[ - "GET" - ] - } - ] - }, - "params":{ - "format":{ - "type":"string", - "description":"a short version of the Accept header, e.g. json, yaml" - }, - "local":{ - "type":"boolean", - "description":"Return local information, do not retrieve the state from master node (default: false)" - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - }, - "h":{ - "type":"list", - "description":"Comma-separated list of column names to display" - }, - "help":{ - "type":"boolean", - "description":"Return help information", - "default":false - }, - "s":{ - "type":"list", - "description":"Comma-separated list of column names or column aliases to sort by" - }, - "time":{ - "type":"enum", - "description":"The unit in which to display time values", - "options":[ - "d", - "h", - "m", - "s", - "ms", - "micros", - "nanos" - ] - }, - "v":{ - "type":"boolean", - "description":"Verbose mode. Display column headers", - "default":false - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/cat.plugins.json b/src/ApiGenerator/RestSpecification/Core/cat.plugins.json deleted file mode 100644 index fd25b004c8..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/cat.plugins.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "cat.plugins":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-plugins/", - "description":"Returns information about installed plugins across nodes node." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "text/plain", "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_cat/plugins", - "methods":[ - "GET" - ] - } - ] - }, - "params":{ - "format":{ - "type":"string", - "description":"a short version of the Accept header, e.g. json, yaml" - }, - "local":{ - "type":"boolean", - "description":"Return local information, do not retrieve the state from master node (default: false)" - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - }, - "h":{ - "type":"list", - "description":"Comma-separated list of column names to display" - }, - "help":{ - "type":"boolean", - "description":"Return help information", - "default":false - }, - "include_bootstrap":{ - "type":"boolean", - "description":"Include bootstrap plugins in the response", - "default":false - }, - "s":{ - "type":"list", - "description":"Comma-separated list of column names or column aliases to sort by" - }, - "v":{ - "type":"boolean", - "description":"Verbose mode. Display column headers", - "default":false - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/cat.recovery.json b/src/ApiGenerator/RestSpecification/Core/cat.recovery.json deleted file mode 100644 index c1e9d1c844..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/cat.recovery.json +++ /dev/null @@ -1,103 +0,0 @@ -{ - "cat.recovery":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-recovery/", - "description":"Returns information about index shard recoveries, both on-going completed." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "text/plain", "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_cat/recovery", - "methods":[ - "GET" - ] - }, - { - "path":"/_cat/recovery/{index}", - "methods":[ - "GET" - ], - "parts":{ - "index":{ - "type":"list", - "description":"Comma-separated list or wildcard expression of index names to limit the returned information" - } - } - } - ] - }, - "params":{ - "format":{ - "type":"string", - "description":"a short version of the Accept header, e.g. json, yaml" - }, - "active_only":{ - "type":"boolean", - "description":"If `true`, the response only includes ongoing shard recoveries", - "default":false - }, - "bytes":{ - "type":"enum", - "description":"The unit in which to display byte values", - "options":[ - "b", - "k", - "kb", - "m", - "mb", - "g", - "gb", - "t", - "tb", - "p", - "pb" - ] - }, - "detailed":{ - "type":"boolean", - "description":"If `true`, the response includes detailed information about shard recoveries", - "default":false - }, - "h":{ - "type":"list", - "description":"Comma-separated list of column names to display" - }, - "help":{ - "type":"boolean", - "description":"Return help information", - "default":false - }, - "index":{ - "type":"list", - "description":"Comma-separated list or wildcard expression of index names to limit the returned information" - }, - "s":{ - "type":"list", - "description":"Comma-separated list of column names or column aliases to sort by" - }, - "time":{ - "type":"enum", - "description":"The unit in which to display time values", - "options":[ - "d", - "h", - "m", - "s", - "ms", - "micros", - "nanos" - ] - }, - "v":{ - "type":"boolean", - "description":"Verbose mode. Display column headers", - "default":false - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/cat.repositories.json b/src/ApiGenerator/RestSpecification/Core/cat.repositories.json deleted file mode 100644 index 294bedc001..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/cat.repositories.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "cat.repositories":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-repositories/", - "description":"Returns information about snapshot repositories registered in the cluster." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "text/plain", "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_cat/repositories", - "methods":[ - "GET" - ] - } - ] - }, - "params":{ - "format":{ - "type":"string", - "description":"a short version of the Accept header, e.g. json, yaml" - }, - "local":{ - "type":"boolean", - "description":"Return local information, do not retrieve the state from master node", - "default":false - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - }, - "h":{ - "type":"list", - "description":"Comma-separated list of column names to display" - }, - "help":{ - "type":"boolean", - "description":"Return help information", - "default":false - }, - "s":{ - "type":"list", - "description":"Comma-separated list of column names or column aliases to sort by" - }, - "v":{ - "type":"boolean", - "description":"Verbose mode. Display column headers", - "default":false - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/cat.segments.json b/src/ApiGenerator/RestSpecification/Core/cat.segments.json deleted file mode 100644 index 24a28410e5..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/cat.segments.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "cat.segments":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-segments/", - "description":"Provides low-level information about the segments in the shards of an index." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "text/plain", "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_cat/segments", - "methods":[ - "GET" - ] - }, - { - "path":"/_cat/segments/{index}", - "methods":[ - "GET" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names to limit the returned information" - } - } - } - ] - }, - "params":{ - "format":{ - "type":"string", - "description":"a short version of the Accept header, e.g. json, yaml" - }, - "bytes":{ - "type":"enum", - "description":"The unit in which to display byte values", - "options":[ - "b", - "k", - "kb", - "m", - "mb", - "g", - "gb", - "t", - "tb", - "p", - "pb" - ] - }, - "h":{ - "type":"list", - "description":"Comma-separated list of column names to display" - }, - "help":{ - "type":"boolean", - "description":"Return help information", - "default":false - }, - "s":{ - "type":"list", - "description":"Comma-separated list of column names or column aliases to sort by" - }, - "v":{ - "type":"boolean", - "description":"Verbose mode. Display column headers", - "default":false - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/cat.shards.json b/src/ApiGenerator/RestSpecification/Core/cat.shards.json deleted file mode 100644 index 7241591b38..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/cat.shards.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "cat.shards":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-shards/", - "description":"Provides a detailed view of shard allocation on nodes." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "text/plain", "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_cat/shards", - "methods":[ - "GET" - ] - }, - { - "path":"/_cat/shards/{index}", - "methods":[ - "GET" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names to limit the returned information" - } - } - } - ] - }, - "params":{ - "format":{ - "type":"string", - "description":"a short version of the Accept header, e.g. json, yaml" - }, - "bytes":{ - "type":"enum", - "description":"The unit in which to display byte values", - "options":[ - "b", - "k", - "kb", - "m", - "mb", - "g", - "gb", - "t", - "tb", - "p", - "pb" - ] - }, - "local":{ - "type":"boolean", - "description":"Return local information, do not retrieve the state from master node (default: false)", - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - }, - "h":{ - "type":"list", - "description":"Comma-separated list of column names to display" - }, - "help":{ - "type":"boolean", - "description":"Return help information", - "default":false - }, - "s":{ - "type":"list", - "description":"Comma-separated list of column names or column aliases to sort by" - }, - "time":{ - "type":"enum", - "description":"The unit in which to display time values", - "options":[ - "d", - "h", - "m", - "s", - "ms", - "micros", - "nanos" - ] - }, - "v":{ - "type":"boolean", - "description":"Verbose mode. Display column headers", - "default":false - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/cat.snapshots.json b/src/ApiGenerator/RestSpecification/Core/cat.snapshots.json deleted file mode 100644 index ce8e73d29e..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/cat.snapshots.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "cat.snapshots":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/", - "description":"Returns all snapshots in a specific repository." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "text/plain", "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_cat/snapshots", - "methods":[ - "GET" - ] - }, - { - "path":"/_cat/snapshots/{repository}", - "methods":[ - "GET" - ], - "parts":{ - "repository":{ - "type":"list", - "description":"Name of repository from which to fetch the snapshot information" - } - } - } - ] - }, - "params":{ - "format":{ - "type":"string", - "description":"a short version of the Accept header, e.g. json, yaml" - }, - "ignore_unavailable":{ - "type":"boolean", - "description":"Set to true to ignore unavailable snapshots", - "default":false - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - }, - "h":{ - "type":"list", - "description":"Comma-separated list of column names to display" - }, - "help":{ - "type":"boolean", - "description":"Return help information", - "default":false - }, - "s":{ - "type":"list", - "description":"Comma-separated list of column names or column aliases to sort by" - }, - "time":{ - "type":"enum", - "description":"The unit in which to display time values", - "options":[ - "d", - "h", - "m", - "s", - "ms", - "micros", - "nanos" - ] - }, - "v":{ - "type":"boolean", - "description":"Verbose mode. Display column headers", - "default":false - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/cat.tasks.json b/src/ApiGenerator/RestSpecification/Core/cat.tasks.json deleted file mode 100644 index 0a2bad4bbe..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/cat.tasks.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "cat.tasks":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-tasks/", - "description":"Returns information about the tasks currently executing on one or more nodes in the cluster." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "text/plain", "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_cat/tasks", - "methods":[ - "GET" - ] - } - ] - }, - "params":{ - "format":{ - "type":"string", - "description":"a short version of the Accept header, e.g. json, yaml" - }, - "nodes":{ - "type":"list", - "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" - }, - "actions":{ - "type":"list", - "description":"A comma-separated list of actions that should be returned. Leave empty to return all." - }, - "detailed":{ - "type":"boolean", - "description":"Return detailed task information (default: false)" - }, - "parent_task_id":{ - "type":"string", - "description":"Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all." - }, - "h":{ - "type":"list", - "description":"Comma-separated list of column names to display" - }, - "help":{ - "type":"boolean", - "description":"Return help information", - "default":false - }, - "s":{ - "type":"list", - "description":"Comma-separated list of column names or column aliases to sort by" - }, - "time":{ - "type":"enum", - "description":"The unit in which to display time values", - "options":[ - "d", - "h", - "m", - "s", - "ms", - "micros", - "nanos" - ] - }, - "v":{ - "type":"boolean", - "description":"Verbose mode. Display column headers", - "default":false - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/cat.templates.json b/src/ApiGenerator/RestSpecification/Core/cat.templates.json deleted file mode 100644 index d1dfdb95df..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/cat.templates.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "cat.templates":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/", - "description":"Returns information about existing templates." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "text/plain", "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_cat/templates", - "methods":[ - "GET" - ] - }, - { - "path":"/_cat/templates/{name}", - "methods":[ - "GET" - ], - "parts":{ - "name":{ - "type":"string", - "description":"A pattern that returned template names must match" - } - } - } - ] - }, - "params":{ - "format":{ - "type":"string", - "description":"a short version of the Accept header, e.g. json, yaml" - }, - "local":{ - "type":"boolean", - "description":"Return local information, do not retrieve the state from master node (default: false)" - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - }, - "h":{ - "type":"list", - "description":"Comma-separated list of column names to display" - }, - "help":{ - "type":"boolean", - "description":"Return help information", - "default":false - }, - "s":{ - "type":"list", - "description":"Comma-separated list of column names or column aliases to sort by" - }, - "v":{ - "type":"boolean", - "description":"Verbose mode. Display column headers", - "default":false - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/cat.thread_pool.json b/src/ApiGenerator/RestSpecification/Core/cat.thread_pool.json deleted file mode 100644 index 8279f0b7bc..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/cat.thread_pool.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "cat.thread_pool":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-thread-pool/", - "description":"Returns cluster-wide thread pool statistics per node.\nBy default the active, queue and rejected statistics are returned for all thread pools." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "text/plain", "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_cat/thread_pool", - "methods":[ - "GET" - ] - }, - { - "path":"/_cat/thread_pool/{thread_pool_patterns}", - "methods":[ - "GET" - ], - "parts":{ - "thread_pool_patterns":{ - "type":"list", - "description":"A comma-separated list of regular-expressions to filter the thread pools in the output" - } - } - } - ] - }, - "params":{ - "format":{ - "type":"string", - "description":"a short version of the Accept header, e.g. json, yaml" - }, - "local":{ - "type":"boolean", - "description":"Return local information, do not retrieve the state from master node (default: false)" - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - }, - "h":{ - "type":"list", - "description":"Comma-separated list of column names to display" - }, - "help":{ - "type":"boolean", - "description":"Return help information", - "default":false - }, - "s":{ - "type":"list", - "description":"Comma-separated list of column names or column aliases to sort by" - }, - "v":{ - "type":"boolean", - "description":"Verbose mode. Display column headers", - "default":false - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/clear_scroll.json b/src/ApiGenerator/RestSpecification/Core/clear_scroll.json deleted file mode 100644 index f352a421a2..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/clear_scroll.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "clear_scroll":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/scroll/", - "description":"Explicitly clears the search context for a scroll." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"], - "content_type": ["application/json","text/plain"] - }, - "url":{ - "paths":[ - { - "path":"/_search/scroll", - "methods":[ - "DELETE" - ] - } - ] - }, - "params":{}, - "body":{ - "description":"A comma-separated list of scroll IDs to clear if none was specified via the scroll_id parameter" - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/cluster.allocation_explain.json b/src/ApiGenerator/RestSpecification/Core/cluster.allocation_explain.json deleted file mode 100644 index b14bd18a45..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/cluster.allocation_explain.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "cluster.allocation_explain":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cluster-allocation/", - "description":"Provides explanations for shard allocations in the cluster." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"], - "content_type": ["application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_cluster/allocation/explain", - "methods":[ - "GET", - "POST" - ] - } - ] - }, - "params":{ - "include_yes_decisions":{ - "type":"boolean", - "description":"Return 'YES' decisions in explanation (default: false)" - }, - "include_disk_info":{ - "type":"boolean", - "description":"Return information about disk usage and shard sizes (default: false)" - } - }, - "body":{ - "description":"The index, shard, and primary flag to explain. Empty means 'explain the first unassigned shard'" - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/cluster.delete_component_template.json b/src/ApiGenerator/RestSpecification/Core/cluster.delete_component_template.json deleted file mode 100644 index b4ee56dab7..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/cluster.delete_component_template.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "cluster.delete_component_template":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/index-templates/", - "description":"Deletes a component template" - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_component_template/{name}", - "methods":[ - "DELETE" - ], - "parts":{ - "name":{ - "type":"string", - "description":"The name of the template" - } - } - } - ] - }, - "params":{ - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/cluster.delete_voting_config_exclusions.json b/src/ApiGenerator/RestSpecification/Core/cluster.delete_voting_config_exclusions.json deleted file mode 100644 index d32583908f..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/cluster.delete_voting_config_exclusions.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "cluster.delete_voting_config_exclusions":{ - "documentation":{ - "url":"", - "description":"Clears cluster voting config exclusions." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_cluster/voting_config_exclusions", - "methods":[ - "DELETE" - ] - } - ] - }, - "params":{ - "wait_for_removal": { - "type":"boolean", - "description":"Specifies whether to wait for all excluded nodes to be removed from the cluster before clearing the voting configuration exclusions list.", - "default":true - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/cluster.exists_component_template.json b/src/ApiGenerator/RestSpecification/Core/cluster.exists_component_template.json deleted file mode 100644 index 64679d2e6b..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/cluster.exists_component_template.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "cluster.exists_component_template":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/index-templates/", - "description":"Returns information about whether a particular component template exist" - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_component_template/{name}", - "methods":[ - "HEAD" - ], - "parts":{ - "name":{ - "type":"string", - "description":"The name of the template" - } - } - } - ] - }, - "params":{ - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - }, - "local":{ - "type":"boolean", - "description":"Return local information, do not retrieve the state from master node (default: false)" - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/cluster.get_component_template.json b/src/ApiGenerator/RestSpecification/Core/cluster.get_component_template.json deleted file mode 100644 index 6e3329031a..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/cluster.get_component_template.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "cluster.get_component_template":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/index-templates/", - "description":"Returns one or more component templates" - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_component_template", - "methods":[ - "GET" - ] - }, - { - "path":"/_component_template/{name}", - "methods":[ - "GET" - ], - "parts":{ - "name":{ - "type":"list", - "description":"The comma separated names of the component templates" - } - } - } - ] - }, - "params":{ - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - }, - "local":{ - "type":"boolean", - "description":"Return local information, do not retrieve the state from master node (default: false)" - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/cluster.get_settings.json b/src/ApiGenerator/RestSpecification/Core/cluster.get_settings.json deleted file mode 100644 index d329a8df2b..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/cluster.get_settings.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "cluster.get_settings":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cluster-settings/", - "description":"Returns cluster settings." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_cluster/settings", - "methods":[ - "GET" - ] - } - ] - }, - "params":{ - "flat_settings":{ - "type":"boolean", - "description":"Return settings in flat format (default: false)" - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - }, - "include_defaults":{ - "type":"boolean", - "description":"Whether to return all default clusters setting.", - "default":false - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/cluster.health.json b/src/ApiGenerator/RestSpecification/Core/cluster.health.json deleted file mode 100644 index 4aefa8d302..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/cluster.health.json +++ /dev/null @@ -1,112 +0,0 @@ -{ - "cluster.health":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cluster-health/", - "description":"Returns basic information about the health of the cluster." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_cluster/health", - "methods":[ - "GET" - ] - }, - { - "path":"/_cluster/health/{index}", - "methods":[ - "GET" - ], - "parts":{ - "index":{ - "type":"list", - "description":"Limit the information returned to a specific index" - } - } - } - ] - }, - "params":{ - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"all", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "level":{ - "type":"enum", - "options":[ - "cluster", - "indices", - "shards" - ], - "default":"cluster", - "description":"Specify the level of detail for returned information" - }, - "local":{ - "type":"boolean", - "description":"Return local information, do not retrieve the state from master node (default: false)" - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - }, - "wait_for_active_shards":{ - "type":"string", - "description":"Wait until the specified number of shards is active" - }, - "wait_for_nodes":{ - "type":"string", - "description":"Wait until the specified number of nodes is available" - }, - "wait_for_events":{ - "type":"enum", - "options":[ - "immediate", - "urgent", - "high", - "normal", - "low", - "languid" - ], - "description":"Wait until all currently queued events with the given priority are processed" - }, - "wait_for_no_relocating_shards":{ - "type":"boolean", - "description":"Whether to wait until there are no relocating shards in the cluster" - }, - "wait_for_no_initializing_shards":{ - "type":"boolean", - "description":"Whether to wait until there are no initializing shards in the cluster" - }, - "wait_for_status":{ - "type":"enum", - "options":[ - "green", - "yellow", - "red" - ], - "description":"Wait until cluster is in a specific state" - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/cluster.pending_tasks.json b/src/ApiGenerator/RestSpecification/Core/cluster.pending_tasks.json deleted file mode 100644 index 176385d912..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/cluster.pending_tasks.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "cluster.pending_tasks":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-pending-tasks/", - "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." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_cluster/pending_tasks", - "methods":[ - "GET" - ] - } - ] - }, - "params":{ - "local":{ - "type":"boolean", - "description":"Return local information, do not retrieve the state from master node (default: false)" - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/cluster.post_voting_config_exclusions.json b/src/ApiGenerator/RestSpecification/Core/cluster.post_voting_config_exclusions.json deleted file mode 100644 index d15970dbfb..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/cluster.post_voting_config_exclusions.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "cluster.post_voting_config_exclusions":{ - "documentation":{ - "url":"", - "description":"Updates the cluster voting config exclusions by node ids or node names." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_cluster/voting_config_exclusions", - "methods":[ - "POST" - ] - } - ] - }, - "params":{ - "node_ids":{ - "type":"string", - "description":"A comma-separated list of the persistent ids of the nodes to exclude from the voting configuration. If specified, you may not also specify ?node_names." - }, - "node_names":{ - "type":"string", - "description":"A comma-separated list of the names of the nodes to exclude from the voting configuration. If specified, you may not also specify ?node_ids." - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout", - "default":"30s" - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/cluster.put_component_template.json b/src/ApiGenerator/RestSpecification/Core/cluster.put_component_template.json deleted file mode 100644 index 50eed63d39..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/cluster.put_component_template.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "cluster.put_component_template":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/index-templates/", - "description":"Creates or updates a component template" - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"], - "content_type": ["application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_component_template/{name}", - "methods":[ - "PUT", - "POST" - ], - "parts":{ - "name":{ - "type":"string", - "description":"The name of the template" - } - } - } - ] - }, - "params":{ - "create":{ - "type":"boolean", - "description":"Whether the index template should only be added if new or can also replace an existing one", - "default":false - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - } - }, - "body":{ - "description":"The template definition", - "required":true - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/cluster.put_settings.json b/src/ApiGenerator/RestSpecification/Core/cluster.put_settings.json deleted file mode 100644 index 32ae4c3ac2..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/cluster.put_settings.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "cluster.put_settings":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cluster-settings/", - "description":"Updates the cluster settings." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"], - "content_type": ["application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_cluster/settings", - "methods":[ - "PUT" - ] - } - ] - }, - "params":{ - "flat_settings":{ - "type":"boolean", - "description":"Return settings in flat format (default: false)" - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - } - }, - "body":{ - "description":"The settings to be updated. Can be either `transient` or `persistent` (survives cluster restart).", - "required":true - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/cluster.remote_info.json b/src/ApiGenerator/RestSpecification/Core/cluster.remote_info.json deleted file mode 100644 index d0ba3c375a..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/cluster.remote_info.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "cluster.remote_info":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/remote-info/", - "description":"Returns the information about configured remote clusters." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_remote/info", - "methods":[ - "GET" - ] - } - ] - }, - "params":{} - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/cluster.reroute.json b/src/ApiGenerator/RestSpecification/Core/cluster.reroute.json deleted file mode 100644 index 14b75a551a..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/cluster.reroute.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "cluster.reroute":{ - "documentation":{ - "url":"", - "description":"Allows to manually change the allocation of individual shards in the cluster." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"], - "content_type": ["application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_cluster/reroute", - "methods":[ - "POST" - ] - } - ] - }, - "params":{ - "dry_run":{ - "type":"boolean", - "description":"Simulate the operation only and return the resulting state" - }, - "explain":{ - "type":"boolean", - "description":"Return an explanation of why the commands can or cannot be executed" - }, - "retry_failed":{ - "type":"boolean", - "description":"Retries allocation of shards that are blocked due to too many subsequent allocation failures" - }, - "metric":{ - "type":"list", - "options":[ - "_all", - "blocks", - "metadata", - "nodes", - "routing_table", - "master_node", - "version" - ], - "description":"Limit the information returned to the specified metrics. Defaults to all but metadata" - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - } - }, - "body":{ - "description":"The definition of `commands` to perform (`move`, `cancel`, `allocate`)" - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/cluster.state.json b/src/ApiGenerator/RestSpecification/Core/cluster.state.json deleted file mode 100644 index 89767d4dc8..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/cluster.state.json +++ /dev/null @@ -1,117 +0,0 @@ -{ - "cluster.state":{ - "documentation":{ - "url":"", - "description":"Returns a comprehensive information about the state of the cluster." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_cluster/state", - "methods":[ - "GET" - ] - }, - { - "path":"/_cluster/state/{metric}", - "methods":[ - "GET" - ], - "parts":{ - "metric":{ - "type":"list", - "options":[ - "_all", - "blocks", - "metadata", - "nodes", - "routing_table", - "routing_nodes", - "master_node", - "version" - ], - "description":"Limit the information returned to the specified metrics" - } - } - }, - { - "path":"/_cluster/state/{metric}/{index}", - "methods":[ - "GET" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" - }, - "metric":{ - "type":"list", - "options":[ - "_all", - "blocks", - "metadata", - "nodes", - "routing_table", - "routing_nodes", - "master_node", - "version" - ], - "description":"Limit the information returned to the specified metrics" - } - } - } - ] - }, - "params":{ - "local":{ - "type":"boolean", - "description":"Return local information, do not retrieve the state from master node (default: false)" - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - }, - "flat_settings":{ - "type":"boolean", - "description":"Return settings in flat format (default: false)" - }, - "wait_for_metadata_version":{ - "type":"number", - "description":"Wait for the metadata version to be equal or greater than the specified metadata version" - }, - "wait_for_timeout":{ - "type":"time", - "description":"The maximum time to wait for wait_for_metadata_version before timing out" - }, - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices":{ - "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)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/cluster.stats.json b/src/ApiGenerator/RestSpecification/Core/cluster.stats.json deleted file mode 100644 index 7545f6ba99..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/cluster.stats.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "cluster.stats":{ - "documentation":{ - "url":"", - "description":"Returns high-level overview of cluster statistics." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_cluster/stats", - "methods":[ - "GET" - ] - }, - { - "path":"/_cluster/stats/nodes/{node_id}", - "methods":[ - "GET" - ], - "parts":{ - "node_id":{ - "type":"list", - "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" - } - } - } - ] - }, - "params":{ - "flat_settings":{ - "type":"boolean", - "description":"Return settings in flat format (default: false)" - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/count.json b/src/ApiGenerator/RestSpecification/Core/count.json deleted file mode 100644 index 53aad4dde3..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/count.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "count":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/count/", - "description":"Returns number of documents matching a query." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"], - "content_type": ["application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_count", - "methods":[ - "POST", - "GET" - ] - - }, - { - "path":"/{index}/_count", - "methods":[ - "POST", - "GET" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of indices to restrict the results" - } - } - } - ] - }, - "params":{ - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "ignore_throttled":{ - "type":"boolean", - "description":"Whether specified concrete, expanded or aliased indices should be ignored when throttled" - }, - "allow_no_indices":{ - "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)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "min_score":{ - "type":"number", - "description":"Include only documents with a specific `_score` value in the result" - }, - "preference":{ - "type":"string", - "description":"Specify the node or shard the operation should be performed on (default: random)" - }, - "routing":{ - "type":"list", - "description":"A comma-separated list of specific routing values" - }, - "q":{ - "type":"string", - "description":"Query in the Lucene query string syntax" - }, - "analyzer":{ - "type":"string", - "description":"The analyzer to use for the query string" - }, - "analyze_wildcard":{ - "type":"boolean", - "description":"Specify whether wildcard and prefix queries should be analyzed (default: false)" - }, - "default_operator":{ - "type":"enum", - "options":[ - "AND", - "OR" - ], - "default":"OR", - "description":"The default operator for query string query (AND or OR)" - }, - "df":{ - "type":"string", - "description":"The field to use as default where no field prefix is given in the query string" - }, - "lenient":{ - "type":"boolean", - "description":"Specify whether format-based query failures (such as providing text to a numeric field) should be ignored" - }, - "terminate_after":{ - "type":"number", - "description":"The maximum count for each shard, upon reaching which the query execution will terminate early" - } - }, - "body":{ - "description":"A query to restrict the results specified with the Query DSL (optional)" - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/create.json b/src/ApiGenerator/RestSpecification/Core/create.json deleted file mode 100644 index a0932b971a..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/create.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "create":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/index-document/", - "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." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"], - "content_type": ["application/json"] - }, - "url":{ - "paths":[ - { - "path":"/{index}/_create/{id}", - "methods":[ - "PUT", - "POST" - ], - "parts":{ - "id":{ - "type":"string", - "description":"Document ID" - }, - "index":{ - "type":"string", - "description":"The name of the index" - } - } - } - ] - }, - "params":{ - "wait_for_active_shards":{ - "type":"string", - "description":"Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)" - }, - "refresh":{ - "type":"enum", - "options":[ - "true", - "false", - "wait_for" - ], - "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." - }, - "routing":{ - "type":"string", - "description":"Specific routing value" - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - }, - "version":{ - "type":"number", - "description":"Explicit version number for concurrency control" - }, - "version_type":{ - "type":"enum", - "options":[ - "internal", - "external", - "external_gte" - ], - "description":"Specific version type" - }, - "pipeline":{ - "type":"string", - "description":"The pipeline id to preprocess incoming documents with" - } - }, - "body":{ - "description":"The document", - "required":true - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/dangling_indices.delete_dangling_index.json b/src/ApiGenerator/RestSpecification/Core/dangling_indices.delete_dangling_index.json deleted file mode 100644 index 13670576c3..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/dangling_indices.delete_dangling_index.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "dangling_indices.delete_dangling_index": { - "documentation": { - "url": "", - "description": "Deletes the specified dangling index" - }, - "stability": "stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url": { - "paths": [ - { - "path": "/_dangling/{index_uuid}", - "methods": [ - "DELETE" - ], - "parts": { - "index_uuid": { - "type": "string", - "description": "The UUID of the dangling index" - } - } - } - ] - }, - "params": { - "accept_data_loss": { - "type": "boolean", - "description": "Must be set to true in order to delete the dangling index" - }, - "timeout": { - "type": "time", - "description": "Explicit operation timeout" - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/dangling_indices.import_dangling_index.json b/src/ApiGenerator/RestSpecification/Core/dangling_indices.import_dangling_index.json deleted file mode 100644 index 64c0568eb7..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/dangling_indices.import_dangling_index.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "dangling_indices.import_dangling_index": { - "documentation": { - "url": "", - "description": "Imports the specified dangling index" - }, - "stability": "stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url": { - "paths": [ - { - "path": "/_dangling/{index_uuid}", - "methods": [ - "POST" - ], - "parts": { - "index_uuid": { - "type": "string", - "description": "The UUID of the dangling index" - } - } - } - ] - }, - "params": { - "accept_data_loss": { - "type": "boolean", - "description": "Must be set to true in order to import the dangling index" - }, - "timeout": { - "type": "time", - "description": "Explicit operation timeout" - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/dangling_indices.list_dangling_indices.json b/src/ApiGenerator/RestSpecification/Core/dangling_indices.list_dangling_indices.json deleted file mode 100644 index 0cab5e272d..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/dangling_indices.list_dangling_indices.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "dangling_indices.list_dangling_indices": { - "documentation": { - "url": "", - "description": "Returns all dangling indices." - }, - "stability": "stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url": { - "paths": [ - { - "path": "/_dangling", - "methods": [ - "GET" - ] - } - ] - }, - "params": {} - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/delete.json b/src/ApiGenerator/RestSpecification/Core/delete.json deleted file mode 100644 index 2bbbe5114f..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/delete.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "delete":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/delete-document/", - "description":"Removes a document from the index." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/{index}/_doc/{id}", - "methods":[ - "DELETE" - ], - "parts":{ - "id":{ - "type":"string", - "description":"The document ID" - }, - "index":{ - "type":"string", - "description":"The name of the index" - } - } - } - ] - }, - "params":{ - "wait_for_active_shards":{ - "type":"string", - "description":"Sets the number of shard copies that must be active before proceeding with the delete operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)" - }, - "refresh":{ - "type":"enum", - "options":[ - "true", - "false", - "wait_for" - ], - "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." - }, - "routing":{ - "type":"string", - "description":"Specific routing value" - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - }, - "if_seq_no":{ - "type":"number", - "description":"only perform the delete operation if the last operation that has changed the document has the specified sequence number" - }, - "if_primary_term":{ - "type":"number", - "description":"only perform the delete operation if the last operation that has changed the document has the specified primary term" - }, - "version":{ - "type":"number", - "description":"Explicit version number for concurrency control" - }, - "version_type":{ - "type":"enum", - "options":[ - "internal", - "external", - "external_gte", - "force" - ], - "description":"Specific version type" - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/delete_by_query.json b/src/ApiGenerator/RestSpecification/Core/delete_by_query.json deleted file mode 100644 index c9a8e45fba..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/delete_by_query.json +++ /dev/null @@ -1,185 +0,0 @@ -{ - "delete_by_query":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/delete-by-query/", - "description":"Deletes documents matching the provided query." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"], - "content_type": ["application/json"] - }, - "url":{ - "paths":[ - { - "path":"/{index}/_delete_by_query", - "methods":[ - "POST" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices" - } - } - } - ] - }, - "params":{ - "analyzer": { - "type" : "string", - "description" : "The analyzer to use for the query string" - }, - "analyze_wildcard": { - "type" : "boolean", - "description" : "Specify whether wildcard and prefix queries should be analyzed (default: false)" - }, - "default_operator": { - "type" : "enum", - "options" : ["AND","OR"], - "default" : "OR", - "description" : "The default operator for query string query (AND or OR)" - }, - "df": { - "type" : "string", - "description" : "The field to use as default where no field prefix is given in the query string" - }, - "from": { - "type" : "number", - "description" : "Starting offset (default: 0)" - }, - "ignore_unavailable": { - "type" : "boolean", - "description" : "Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices": { - "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)" - }, - "conflicts":{ - "type":"enum", - "options":[ - "abort", - "proceed" - ], - "default":"abort", - "description":"What to do when the delete by query hits version conflicts?" - }, - "expand_wildcards": { - "type" : "enum", - "options" : [ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default" : "open", - "description" :"Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "lenient": { - "type" : "boolean", - "description" : "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored" - }, - "preference": { - "type" : "string", - "description" : "Specify the node or shard the operation should be performed on (default: random)" - }, - "q": { - "type" : "string", - "description" : "Query in the Lucene query string syntax" - }, - "routing": { - "type" : "list", - "description" : "A comma-separated list of specific routing values" - }, - "scroll": { - "type" : "time", - "description" : "Specify how long a consistent view of the index should be maintained for scrolled search" - }, - "search_type": { - "type" : "enum", - "options" : ["query_then_fetch", "dfs_query_then_fetch"], - "description" : "Search operation type" - }, - "search_timeout": { - "type" : "time", - "description" : "Explicit timeout for each search request. Defaults to no timeout." - }, - "max_docs": { - "type" : "number", - "description" : "Maximum number of documents to process (default: all documents)" - }, - "sort": { - "type" : "list", - "description" : "A comma-separated list of : pairs" - }, - "_source": { - "type" : "list", - "description" : "True or false to return the _source field or not, or a list of fields to return" - }, - "_source_excludes": { - "type" : "list", - "description" : "A list of fields to exclude from the returned _source field" - }, - "_source_includes": { - "type" : "list", - "description" : "A list of fields to extract and return from the _source field" - }, - "terminate_after": { - "type" : "number", - "description" : "The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early." - }, - "stats": { - "type" : "list", - "description" : "Specific 'tag' of the request for logging and statistical purposes" - }, - "version": { - "type" : "boolean", - "description" : "Specify whether to return document version as part of a hit" - }, - "request_cache": { - "type" : "boolean", - "description" : "Specify if request cache should be used for this request or not, defaults to index level setting" - }, - "refresh": { - "type" : "boolean", - "description" : "Should the effected indexes be refreshed?" - }, - "timeout": { - "type" : "time", - "default": "1m", - "description" : "Time each individual bulk request should wait for shards that are unavailable." - }, - "wait_for_active_shards": { - "type" : "string", - "description" : "Sets the number of shard copies that must be active before proceeding with the delete by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)" - }, - "scroll_size":{ - "type":"number", - "default":100, - "description":"Size on the scroll request powering the delete by query" - }, - "wait_for_completion": { - "type" : "boolean", - "default": true, - "description" : "Should the request should block until the delete by query is complete." - }, - "requests_per_second": { - "type": "number", - "default": 0, - "description": "The throttle for this request in sub-requests per second. -1 means no throttle." - }, - "slices": { - "type": "number|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`." - } - }, - "body":{ - "description":"The search definition using the Query DSL", - "required":true - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/delete_by_query_rethrottle.json b/src/ApiGenerator/RestSpecification/Core/delete_by_query_rethrottle.json deleted file mode 100644 index 39ff524319..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/delete_by_query_rethrottle.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "delete_by_query_rethrottle":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/delete-by-query/", - "description":"Changes the number of requests per second for a particular Delete By Query operation." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_delete_by_query/{task_id}/_rethrottle", - "methods":[ - "POST" - ], - "parts":{ - "task_id":{ - "type":"string", - "description":"The task id to rethrottle" - } - } - } - ] - }, - "params":{ - "requests_per_second":{ - "type":"number", - "required":true, - "description":"The throttle to set on this request in floating sub-requests per second. -1 means set no throttle." - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/delete_script.json b/src/ApiGenerator/RestSpecification/Core/delete_script.json deleted file mode 100644 index 36b76fb222..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/delete_script.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "delete_script":{ - "documentation":{ - "url":"", - "description":"Deletes a script." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_scripts/{id}", - "methods":[ - "DELETE" - ], - "parts":{ - "id":{ - "type":"string", - "description":"Script ID" - } - } - } - ] - }, - "params":{ - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/exists.json b/src/ApiGenerator/RestSpecification/Core/exists.json deleted file mode 100644 index c0f131064d..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/exists.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "exists":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/", - "description":"Returns information about whether a document exists in an index." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/{index}/_doc/{id}", - "methods":[ - "HEAD" - ], - "parts":{ - "id":{ - "type":"string", - "description":"The document ID" - }, - "index":{ - "type":"string", - "description":"The name of the index" - } - } - } - ] - }, - "params":{ - "stored_fields":{ - "type":"list", - "description":"A comma-separated list of stored fields to return in the response" - }, - "preference":{ - "type":"string", - "description":"Specify the node or shard the operation should be performed on (default: random)" - }, - "realtime":{ - "type":"boolean", - "description":"Specify whether to perform the operation in realtime or search mode" - }, - "refresh":{ - "type":"boolean", - "description":"Refresh the shard containing the document before performing the operation" - }, - "routing":{ - "type":"string", - "description":"Specific routing value" - }, - "_source":{ - "type":"list", - "description":"True or false to return the _source field or not, or a list of fields to return" - }, - "_source_excludes":{ - "type":"list", - "description":"A list of fields to exclude from the returned _source field" - }, - "_source_includes":{ - "type":"list", - "description":"A list of fields to extract and return from the _source field" - }, - "version":{ - "type":"number", - "description":"Explicit version number for concurrency control" - }, - "version_type":{ - "type":"enum", - "options":[ - "internal", - "external", - "external_gte", - "force" - ], - "description":"Specific version type" - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/exists_source.json b/src/ApiGenerator/RestSpecification/Core/exists_source.json deleted file mode 100644 index 0f498b7c04..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/exists_source.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "exists_source":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/", - "description":"Returns information about whether a document source exists in an index." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/{index}/_source/{id}", - "methods":[ - "HEAD" - ], - "parts":{ - "id":{ - "type":"string", - "description":"The document ID" - }, - "index":{ - "type":"string", - "description":"The name of the index" - } - } - } - ] - }, - "params":{ - "preference":{ - "type":"string", - "description":"Specify the node or shard the operation should be performed on (default: random)" - }, - "realtime":{ - "type":"boolean", - "description":"Specify whether to perform the operation in realtime or search mode" - }, - "refresh":{ - "type":"boolean", - "description":"Refresh the shard containing the document before performing the operation" - }, - "routing":{ - "type":"string", - "description":"Specific routing value" - }, - "_source":{ - "type":"list", - "description":"True or false to return the _source field or not, or a list of fields to return" - }, - "_source_excludes":{ - "type":"list", - "description":"A list of fields to exclude from the returned _source field" - }, - "_source_includes":{ - "type":"list", - "description":"A list of fields to extract and return from the _source field" - }, - "version":{ - "type":"number", - "description":"Explicit version number for concurrency control" - }, - "version_type":{ - "type":"enum", - "options":[ - "internal", - "external", - "external_gte", - "force" - ], - "description":"Specific version type" - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/explain.json b/src/ApiGenerator/RestSpecification/Core/explain.json deleted file mode 100644 index 6ae2f8a08a..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/explain.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "explain":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/explain/", - "description":"Returns information about why a specific matches (or doesn't match) a query." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"], - "content_type": ["application/json"] - }, - "url":{ - "paths":[ - { - "path":"/{index}/_explain/{id}", - "methods":[ - "GET", - "POST" - ], - "parts":{ - "id":{ - "type":"string", - "description":"The document ID" - }, - "index":{ - "type":"string", - "description":"The name of the index" - } - } - } - ] - }, - "params":{ - "analyze_wildcard":{ - "type":"boolean", - "description":"Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false)" - }, - "analyzer":{ - "type":"string", - "description":"The analyzer for the query string query" - }, - "default_operator":{ - "type":"enum", - "options":[ - "AND", - "OR" - ], - "default":"OR", - "description":"The default operator for query string query (AND or OR)" - }, - "df":{ - "type":"string", - "description":"The default field for query string query (default: _all)" - }, - "stored_fields":{ - "type":"list", - "description":"A comma-separated list of stored fields to return in the response" - }, - "lenient":{ - "type":"boolean", - "description":"Specify whether format-based query failures (such as providing text to a numeric field) should be ignored" - }, - "preference":{ - "type":"string", - "description":"Specify the node or shard the operation should be performed on (default: random)" - }, - "q":{ - "type":"string", - "description":"Query in the Lucene query string syntax" - }, - "routing":{ - "type":"string", - "description":"Specific routing value" - }, - "_source":{ - "type":"list", - "description":"True or false to return the _source field or not, or a list of fields to return" - }, - "_source_excludes":{ - "type":"list", - "description":"A list of fields to exclude from the returned _source field" - }, - "_source_includes":{ - "type":"list", - "description":"A list of fields to extract and return from the _source field" - } - }, - "body":{ - "description":"The query definition using the Query DSL" - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/features.get_features.json b/src/ApiGenerator/RestSpecification/Core/features.get_features.json deleted file mode 100644 index 3ad4adc3a9..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/features.get_features.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "features.get_features":{ - "documentation":{ - "url":"h", - "description":"Gets a list of features which can be included in snapshots using the feature_states field when creating a snapshot" - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_features", - "methods":[ - "GET" - ] - } - ] - }, - "params":{ - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/field_caps.json b/src/ApiGenerator/RestSpecification/Core/field_caps.json deleted file mode 100644 index 63382c4c22..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/field_caps.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "field_caps":{ - "documentation":{ - "url":"", - "description":"Returns the information about the capabilities of fields among multiple indices." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_field_caps", - "methods":[ - "GET", - "POST" - ] - }, - { - "path":"/{index}/_field_caps", - "methods":[ - "GET", - "POST" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" - } - } - } - ] - }, - "params":{ - "fields":{ - "type":"list", - "description":"A comma-separated list of field names" - }, - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices":{ - "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)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "include_unmapped":{ - "type":"boolean", - "default":false, - "description":"Indicates whether unmapped fields should be included in the response." - } - }, - "body":{ - "description":"An index filter specified with the Query DSL" - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/get.json b/src/ApiGenerator/RestSpecification/Core/get.json deleted file mode 100644 index cc07436a83..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/get.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "get":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/", - "description":"Returns a document." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/{index}/_doc/{id}", - "methods":[ - "GET" - ], - "parts":{ - "id":{ - "type":"string", - "description":"The document ID" - }, - "index":{ - "type":"string", - "description":"The name of the index" - } - } - } - ] - }, - "params":{ - "stored_fields":{ - "type":"list", - "description":"A comma-separated list of stored fields to return in the response" - }, - "preference":{ - "type":"string", - "description":"Specify the node or shard the operation should be performed on (default: random)" - }, - "realtime":{ - "type":"boolean", - "description":"Specify whether to perform the operation in realtime or search mode" - }, - "refresh":{ - "type":"boolean", - "description":"Refresh the shard containing the document before performing the operation" - }, - "routing":{ - "type":"string", - "description":"Specific routing value" - }, - "_source":{ - "type":"list", - "description":"True or false to return the _source field or not, or a list of fields to return" - }, - "_source_excludes":{ - "type":"list", - "description":"A list of fields to exclude from the returned _source field" - }, - "_source_includes":{ - "type":"list", - "description":"A list of fields to extract and return from the _source field" - }, - "version":{ - "type":"number", - "description":"Explicit version number for concurrency control" - }, - "version_type":{ - "type":"enum", - "options":[ - "internal", - "external", - "external_gte", - "force" - ], - "description":"Specific version type" - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/get_script.json b/src/ApiGenerator/RestSpecification/Core/get_script.json deleted file mode 100644 index b99b5d3cf1..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/get_script.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "get_script":{ - "documentation":{ - "url":"", - "description":"Returns a script." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_scripts/{id}", - "methods":[ - "GET" - ], - "parts":{ - "id":{ - "type":"string", - "description":"Script ID" - } - } - } - ] - }, - "params":{ - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager node" - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/get_script_context.json b/src/ApiGenerator/RestSpecification/Core/get_script_context.json deleted file mode 100644 index a8150af421..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/get_script_context.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "get_script_context":{ - "documentation":{ - "url": "", - "description":"Returns all script contexts." - }, - "stability":"experimental", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_script_context", - "methods":[ - "GET" - ] - } - ] - }, - "params":{} - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/get_script_languages.json b/src/ApiGenerator/RestSpecification/Core/get_script_languages.json deleted file mode 100644 index 2bf532fa14..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/get_script_languages.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "get_script_languages":{ - "documentation":{ - "url": "", - "description":"Returns available script types, languages and contexts" - }, - "stability":"experimental", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_script_language", - "methods":[ - "GET" - ] - } - ] - }, - "params":{} - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/get_source.json b/src/ApiGenerator/RestSpecification/Core/get_source.json deleted file mode 100644 index 02db4c2902..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/get_source.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "get_source":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/", - "description":"Returns the source of a document." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/{index}/_source/{id}", - "methods":[ - "GET" - ], - "parts":{ - "id":{ - "type":"string", - "description":"The document ID" - }, - "index":{ - "type":"string", - "description":"The name of the index" - } - } - } - ] - }, - "params":{ - "preference":{ - "type":"string", - "description":"Specify the node or shard the operation should be performed on (default: random)" - }, - "realtime":{ - "type":"boolean", - "description":"Specify whether to perform the operation in realtime or search mode" - }, - "refresh":{ - "type":"boolean", - "description":"Refresh the shard containing the document before performing the operation" - }, - "routing":{ - "type":"string", - "description":"Specific routing value" - }, - "_source":{ - "type":"list", - "description":"True or false to return the _source field or not, or a list of fields to return" - }, - "_source_excludes":{ - "type":"list", - "description":"A list of fields to exclude from the returned _source field" - }, - "_source_includes":{ - "type":"list", - "description":"A list of fields to extract and return from the _source field" - }, - "version":{ - "type":"number", - "description":"Explicit version number for concurrency control" - }, - "version_type":{ - "type":"enum", - "options":[ - "internal", - "external", - "external_gte", - "force" - ], - "description":"Specific version type" - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/index.json b/src/ApiGenerator/RestSpecification/Core/index.json deleted file mode 100644 index 609204b3cb..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/index.json +++ /dev/null @@ -1,111 +0,0 @@ -{ - "index":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/index-document/", - "description":"Creates or updates a document in an index." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"], - "content_type": ["application/json"] - }, - "url":{ - "paths":[ - { - "path":"/{index}/_doc/{id}", - "methods":[ - "PUT", - "POST" - ], - "parts":{ - "id":{ - "type":"string", - "description":"Document ID" - }, - "index":{ - "type":"string", - "description":"The name of the index" - } - } - }, - { - "path":"/{index}/_doc", - "methods":[ - "POST" - ], - "parts":{ - "index":{ - "type":"string", - "description":"The name of the index" - } - } - } - ] - }, - "params":{ - "wait_for_active_shards":{ - "type":"string", - "description":"Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)" - }, - "op_type":{ - "type":"enum", - "options":[ - "index", - "create" - ], - "description":"Explicit operation type. Defaults to `index` for requests with an explicit document ID, and to `create`for requests without an explicit document ID" - }, - "refresh":{ - "type":"enum", - "options":[ - "true", - "false", - "wait_for" - ], - "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." - }, - "routing":{ - "type":"string", - "description":"Specific routing value" - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - }, - "version":{ - "type":"number", - "description":"Explicit version number for concurrency control" - }, - "version_type":{ - "type":"enum", - "options":[ - "internal", - "external", - "external_gte" - ], - "description":"Specific version type" - }, - "if_seq_no":{ - "type":"number", - "description":"only perform the index operation if the last operation that has changed the document has the specified sequence number" - }, - "if_primary_term":{ - "type":"number", - "description":"only perform the index operation if the last operation that has changed the document has the specified primary term" - }, - "pipeline":{ - "type":"string", - "description":"The pipeline id to preprocess incoming documents with" - }, - "require_alias": { - "type": "boolean", - "description": "When true, requires destination to be an alias. Default is false" - } - }, - "body":{ - "description":"The document", - "required":true - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.add_block.json b/src/ApiGenerator/RestSpecification/Core/indices.add_block.json deleted file mode 100644 index f63cfab61e..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/indices.add_block.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "indices.add_block":{ - "documentation":{ - "url":"", - "description":"Adds a block to an index." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/{index}/_block/{block}", - "methods":[ - "PUT" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma separated list of indices to add a block to" - }, - "block":{ - "type":"string", - "description":"The block to add (one of read, write, read_only or metadata)" - } - } - } - ] - }, - "params":{ - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - }, - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices":{ - "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)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.analyze.json b/src/ApiGenerator/RestSpecification/Core/indices.analyze.json deleted file mode 100644 index 2f8cd48257..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/indices.analyze.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "indices.analyze":{ - "documentation":{ - "url":"", - "description":"Performs the analysis process on a text and return the tokens breakdown of the text." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"], - "content_type": ["application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_analyze", - "methods":[ - "GET", - "POST" - ] - }, - { - "path":"/{index}/_analyze", - "methods":[ - "GET", - "POST" - ], - "parts":{ - "index":{ - "type":"string", - "description":"The name of the index to scope the operation" - } - } - } - ] - }, - "params":{ - "index":{ - "type":"string", - "description":"The name of the index to scope the operation" - } - }, - "body":{ - "description":"Define analyzer/tokenizer parameters and the text on which the analysis should be performed" - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.clear_cache.json b/src/ApiGenerator/RestSpecification/Core/indices.clear_cache.json deleted file mode 100644 index 7f325513ee..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/indices.clear_cache.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "indices.clear_cache":{ - "documentation":{ - "url":"", - "description":"Clears all or specific caches for one or more indices." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_cache/clear", - "methods":[ - "POST" - ] - }, - { - "path":"/{index}/_cache/clear", - "methods":[ - "POST" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index name to limit the operation" - } - } - } - ] - }, - "params":{ - "fielddata":{ - "type":"boolean", - "description":"Clear field data" - }, - "fields":{ - "type":"list", - "description":"A comma-separated list of fields to clear when using the `fielddata` parameter (default: all)" - }, - "query":{ - "type":"boolean", - "description":"Clear query caches" - }, - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices":{ - "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)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "index":{ - "type":"list", - "description":"A comma-separated list of index name to limit the operation" - }, - "request":{ - "type":"boolean", - "description":"Clear request cache" - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.clone.json b/src/ApiGenerator/RestSpecification/Core/indices.clone.json deleted file mode 100644 index d200c10b85..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/indices.clone.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "indices.clone": { - "documentation": { - "url": "https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/clone/", - "description": "Clones an index" - }, - "stability": "stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"], - "content_type": ["application/json"] - }, - "url": { - "paths": [ - { - "path": "/{index}/_clone/{target}", - "methods": [ - "PUT", - "POST" - ], - "parts": { - "index": { - "type": "string", - "description": "The name of the source index to clone" - }, - "target": { - "type": "string", - "description": "The name of the target index to clone into" - } - } - } - ] - }, - "params": { - "timeout": { - "type" : "time", - "description" : "Explicit operation timeout" - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - }, - "wait_for_active_shards": { - "type" : "string", - "description" : "Set the number of active shards to wait for on the cloned index before the operation returns." - } - }, - "body": { - "description" : "The configuration for the target index (`settings` and `aliases`)" - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.close.json b/src/ApiGenerator/RestSpecification/Core/indices.close.json deleted file mode 100644 index 75ac41325e..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/indices.close.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "indices.close":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/close-index/", - "description":"Closes an index." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/{index}/_close", - "methods":[ - "POST" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma separated list of indices to close" - } - } - } - ] - }, - "params":{ - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - }, - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices":{ - "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)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "wait_for_active_shards":{ - "type":"string", - "description":"Sets the number of active shards to wait for before the operation returns. Set to `index-setting` to wait according to the index setting `index.write.wait_for_active_shards`, or `all` to wait for all shards, or an integer. Defaults to `0`." - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.create.json b/src/ApiGenerator/RestSpecification/Core/indices.create.json deleted file mode 100644 index 02ddc9c760..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/indices.create.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "indices.create":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/create-index/", - "description":"Creates an index with optional settings and mappings." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"], - "content_type": ["application/json"] - }, - "url":{ - "paths":[ - { - "path":"/{index}", - "methods":[ - "PUT" - ], - "parts":{ - "index":{ - "type":"string", - "description":"The name of the index" - } - } - } - ] - }, - "params":{ - "include_type_name":{ - "type":"boolean", - "description":"Whether a type should be expected in the body of the mappings." - }, - "wait_for_active_shards":{ - "type":"string", - "description":"Set the number of active shards to wait for before the operation returns." - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - } - }, - "body":{ - "description":"The configuration for the index (`settings` and `mappings`)" - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.delete.json b/src/ApiGenerator/RestSpecification/Core/indices.delete.json deleted file mode 100644 index 2ba5dda8c3..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/indices.delete.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "indices.delete":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/delete-index/", - "description":"Deletes an index." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/{index}", - "methods":[ - "DELETE" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices" - } - } - } - ] - }, - "params":{ - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - }, - "ignore_unavailable":{ - "type":"boolean", - "description":"Ignore unavailable indexes (default: false)" - }, - "allow_no_indices":{ - "type":"boolean", - "description":"Ignore if a wildcard expression resolves to no concrete indices (default: false)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether wildcard expressions should get expanded to open or closed indices (default: open)" - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.delete_alias.json b/src/ApiGenerator/RestSpecification/Core/indices.delete_alias.json deleted file mode 100644 index 6b3a133166..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/indices.delete_alias.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "indices.delete_alias":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/alias/", - "description":"Deletes an alias." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/{index}/_alias/{name}", - "methods":[ - "DELETE" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names (supports wildcards); use `_all` for all indices" - }, - "name":{ - "type":"list", - "description":"A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices." - } - } - }, - { - "path":"/{index}/_aliases/{name}", - "methods":[ - "DELETE" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names (supports wildcards); use `_all` for all indices" - }, - "name":{ - "type":"list", - "description":"A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices." - } - } - } - ] - }, - "params":{ - "timeout":{ - "type":"time", - "description":"Explicit timestamp for the document" - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.delete_index_template.json b/src/ApiGenerator/RestSpecification/Core/indices.delete_index_template.json deleted file mode 100644 index 3fd849a339..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/indices.delete_index_template.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "indices.delete_index_template":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/", - "description":"Deletes an index template." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_index_template/{name}", - "methods":[ - "DELETE" - ], - "parts":{ - "name":{ - "type":"string", - "description":"The name of the template" - } - } - } - ] - }, - "params":{ - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.delete_template.json b/src/ApiGenerator/RestSpecification/Core/indices.delete_template.json deleted file mode 100644 index f16a62f6cb..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/indices.delete_template.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "indices.delete_template":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/", - "description":"Deletes an index template." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_template/{name}", - "methods":[ - "DELETE" - ], - "parts":{ - "name":{ - "type":"string", - "description":"The name of the template" - } - } - } - ] - }, - "params":{ - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.exists.json b/src/ApiGenerator/RestSpecification/Core/indices.exists.json deleted file mode 100644 index 8847793949..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/indices.exists.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "indices.exists":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/exists/", - "description":"Returns information about whether a particular index exists." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/{index}", - "methods":[ - "HEAD" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names" - } - } - } - ] - }, - "params":{ - "local":{ - "type":"boolean", - "description":"Return local information, do not retrieve the state from master node (default: false)" - }, - "ignore_unavailable":{ - "type":"boolean", - "description":"Ignore unavailable indexes (default: false)" - }, - "allow_no_indices":{ - "type":"boolean", - "description":"Ignore if a wildcard expression resolves to no concrete indices (default: false)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether wildcard expressions should get expanded to open or closed indices (default: open)" - }, - "flat_settings":{ - "type":"boolean", - "description":"Return settings in flat format (default: false)" - }, - "include_defaults":{ - "type":"boolean", - "description":"Whether to return all default setting for each of the indices.", - "default":false - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.exists_alias.json b/src/ApiGenerator/RestSpecification/Core/indices.exists_alias.json deleted file mode 100644 index 6782ae4422..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/indices.exists_alias.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "indices.exists_alias":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/alias/", - "description":"Returns information about whether a particular alias exists." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_alias/{name}", - "methods":[ - "HEAD" - ], - "parts":{ - "name":{ - "type":"list", - "description":"A comma-separated list of alias names to return" - } - } - }, - { - "path":"/{index}/_alias/{name}", - "methods":[ - "HEAD" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names to filter aliases" - }, - "name":{ - "type":"list", - "description":"A comma-separated list of alias names to return" - } - } - } - ] - }, - "params":{ - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices":{ - "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)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"all", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "local":{ - "type":"boolean", - "description":"Return local information, do not retrieve the state from master node (default: false)" - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.exists_index_template.json b/src/ApiGenerator/RestSpecification/Core/indices.exists_index_template.json deleted file mode 100644 index 762477a23f..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/indices.exists_index_template.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "indices.exists_index_template":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/", - "description":"Returns information about whether a particular index template exists." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_index_template/{name}", - "methods":[ - "HEAD" - ], - "parts":{ - "name":{ - "type":"string", - "description":"The name of the template" - } - } - } - ] - }, - "params":{ - "flat_settings":{ - "type":"boolean", - "description":"Return settings in flat format (default: false)" - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - }, - "local":{ - "type":"boolean", - "description":"Return local information, do not retrieve the state from master node (default: false)" - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.exists_template.json b/src/ApiGenerator/RestSpecification/Core/indices.exists_template.json deleted file mode 100644 index d04305300c..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/indices.exists_template.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "indices.exists_template":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/", - "description":"Returns information about whether a particular index template exists." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_template/{name}", - "methods":[ - "HEAD" - ], - "parts":{ - "name":{ - "type":"list", - "description":"The comma separated names of the index templates" - } - } - } - ] - }, - "params":{ - "flat_settings":{ - "type":"boolean", - "description":"Return settings in flat format (default: false)" - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - }, - "local":{ - "type":"boolean", - "description":"Return local information, do not retrieve the state from master node (default: false)" - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.exists_type.json b/src/ApiGenerator/RestSpecification/Core/indices.exists_type.json deleted file mode 100644 index c1d763c453..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/indices.exists_type.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "indices.exists_type":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/exists/", - "description":"Returns information about whether a particular document type exists." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/{index}/_mapping/{type}", - "methods":[ - "HEAD" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names; use `_all` to check the types across all indices" - }, - "type":{ - "type":"list", - "description":"A comma-separated list of document types to check" - } - } - } - ] - }, - "params":{ - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices":{ - "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)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "local":{ - "type":"boolean", - "description":"Return local information, do not retrieve the state from master node (default: false)" - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.flush.json b/src/ApiGenerator/RestSpecification/Core/indices.flush.json deleted file mode 100644 index ce8053844c..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/indices.flush.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "indices.flush":{ - "documentation":{ - "url":"", - "description":"Performs the flush operation on one or more indices." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_flush", - "methods":[ - "POST", - "GET" - ] - }, - { - "path":"/{index}/_flush", - "methods":[ - "POST", - "GET" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names; use `_all` or empty string for all indices" - } - } - } - ] - }, - "params":{ - "force":{ - "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)" - }, - "wait_if_ongoing":{ - "type":"boolean", - "description":"If set to true the flush operation will block until the flush can be executed if another flush operation is already executing. The default is true. If set to false the flush will be skipped iff if another flush operation is already running." - }, - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices":{ - "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)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.forcemerge.json b/src/ApiGenerator/RestSpecification/Core/indices.forcemerge.json deleted file mode 100644 index 893b0bb2e3..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/indices.forcemerge.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "indices.forcemerge":{ - "documentation":{ - "url":"", - "description":"Performs the force merge operation on one or more indices." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_forcemerge", - "methods":[ - "POST" - ] - }, - { - "path":"/{index}/_forcemerge", - "methods":[ - "POST" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" - } - } - } - ] - }, - "params":{ - "flush":{ - "type":"boolean", - "description":"Specify whether the index should be flushed after performing the operation (default: true)" - }, - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices":{ - "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)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "max_num_segments":{ - "type":"number", - "description":"The number of segments the index should be merged into (default: dynamic)" - }, - "only_expunge_deletes":{ - "type":"boolean", - "description":"Specify whether the operation should only expunge deleted documents" - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.get.json b/src/ApiGenerator/RestSpecification/Core/indices.get.json deleted file mode 100644 index ad98d5b660..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/indices.get.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "indices.get":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/get-index/", - "description":"Returns information about one or more indices." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/{index}", - "methods":[ - "GET" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names" - } - } - } - ] - }, - "params":{ - "include_type_name":{ - "type":"boolean", - "description":"Whether to add the type name to the response (default: false)" - }, - "local":{ - "type":"boolean", - "description":"Return local information, do not retrieve the state from master node (default: false)" - }, - "ignore_unavailable":{ - "type":"boolean", - "description":"Ignore unavailable indexes (default: false)" - }, - "allow_no_indices":{ - "type":"boolean", - "description":"Ignore if a wildcard expression resolves to no concrete indices (default: false)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether wildcard expressions should get expanded to open or closed indices (default: open)" - }, - "flat_settings":{ - "type":"boolean", - "description":"Return settings in flat format (default: false)" - }, - "include_defaults":{ - "type":"boolean", - "description":"Whether to return all default setting for each of the indices.", - "default":false - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.get_alias.json b/src/ApiGenerator/RestSpecification/Core/indices.get_alias.json deleted file mode 100644 index 502e22265f..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/indices.get_alias.json +++ /dev/null @@ -1,89 +0,0 @@ -{ - "indices.get_alias":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/alias/", - "description":"Returns an alias." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_alias", - "methods":[ - "GET" - ] - }, - { - "path":"/_alias/{name}", - "methods":[ - "GET" - ], - "parts":{ - "name":{ - "type":"list", - "description":"A comma-separated list of alias names to return" - } - } - }, - { - "path":"/{index}/_alias/{name}", - "methods":[ - "GET" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names to filter aliases" - }, - "name":{ - "type":"list", - "description":"A comma-separated list of alias names to return" - } - } - }, - { - "path":"/{index}/_alias", - "methods":[ - "GET" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names to filter aliases" - } - } - } - ] - }, - "params":{ - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices":{ - "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)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default": "all", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "local":{ - "type":"boolean", - "description":"Return local information, do not retrieve the state from master node (default: false)" - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.get_field_mapping.json b/src/ApiGenerator/RestSpecification/Core/indices.get_field_mapping.json deleted file mode 100644 index 42983da2b8..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/indices.get_field_mapping.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "indices.get_field_mapping":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/update-mapping/", - "description":"Returns mapping for one or more fields." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_mapping/field/{fields}", - "methods":[ - "GET" - ], - "parts":{ - "fields":{ - "type":"list", - "description":"A comma-separated list of fields" - } - } - }, - { - "path":"/{index}/_mapping/field/{fields}", - "methods":[ - "GET" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names" - }, - "fields":{ - "type":"list", - "description":"A comma-separated list of fields" - } - } - } - ] - }, - "params":{ - "include_type_name":{ - "type":"boolean", - "description":"Whether a type should be returned in the body of the mappings." - }, - "include_defaults":{ - "type":"boolean", - "description":"Whether the default mapping values should be returned as well" - }, - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices":{ - "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)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "local":{ - "type":"boolean", - "description":"Return local information, do not retrieve the state from master node (default: false)" - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.get_index_template.json b/src/ApiGenerator/RestSpecification/Core/indices.get_index_template.json deleted file mode 100644 index a8392a1d8a..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/indices.get_index_template.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "indices.get_index_template":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/", - "description":"Returns an index template." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_index_template", - "methods":[ - "GET" - ] - }, - { - "path":"/_index_template/{name}", - "methods":[ - "GET" - ], - "parts":{ - "name":{ - "type":"list", - "description":"The comma separated names of the index templates" - } - } - } - ] - }, - "params":{ - "flat_settings":{ - "type":"boolean", - "description":"Return settings in flat format (default: false)" - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - }, - "local":{ - "type":"boolean", - "description":"Return local information, do not retrieve the state from master node (default: false)" - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.get_mapping.json b/src/ApiGenerator/RestSpecification/Core/indices.get_mapping.json deleted file mode 100644 index 7e29e1d29d..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/indices.get_mapping.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "indices.get_mapping":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/update-mapping/", - "description":"Returns mappings for one or more indices." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_mapping", - "methods":[ - "GET" - ] - }, - { - "path":"/{index}/_mapping", - "methods":[ - "GET" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names" - } - } - } - ] - }, - "params":{ - "include_type_name":{ - "type":"boolean", - "description":"Whether to add the type name to the response (default: false)" - }, - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices":{ - "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)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.get_settings.json b/src/ApiGenerator/RestSpecification/Core/indices.get_settings.json deleted file mode 100644 index 39fb4847f3..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/indices.get_settings.json +++ /dev/null @@ -1,106 +0,0 @@ -{ - "indices.get_settings":{ - "documentation":{ - "url":"", - "description":"Returns settings for one or more indices." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_settings", - "methods":[ - "GET" - ] - }, - { - "path":"/{index}/_settings", - "methods":[ - "GET" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" - } - } - }, - { - "path":"/{index}/_settings/{name}", - "methods":[ - "GET" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" - }, - "name":{ - "type":"list", - "description":"The name of the settings that should be included" - } - } - }, - { - "path":"/_settings/{name}", - "methods":[ - "GET" - ], - "parts":{ - "name":{ - "type":"list", - "description":"The name of the settings that should be included" - } - } - } - ] - }, - "params":{ - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - }, - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices":{ - "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)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default": "all", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "flat_settings":{ - "type":"boolean", - "description":"Return settings in flat format (default: false)" - }, - "local":{ - "type":"boolean", - "description":"Return local information, do not retrieve the state from master node (default: false)" - }, - "include_defaults":{ - "type":"boolean", - "description":"Whether to return all default setting for each of the indices.", - "default":false - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.get_template.json b/src/ApiGenerator/RestSpecification/Core/indices.get_template.json deleted file mode 100644 index 66cb7a73ff..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/indices.get_template.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "indices.get_template":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/", - "description":"Returns an index template." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_template", - "methods":[ - "GET" - ] - }, - { - "path":"/_template/{name}", - "methods":[ - "GET" - ], - "parts":{ - "name":{ - "type":"list", - "description":"The comma separated names of the index templates" - } - } - } - ] - }, - "params":{ - "include_type_name":{ - "type":"boolean", - "description":"Whether a type should be returned in the body of the mappings." - }, - "flat_settings":{ - "type":"boolean", - "description":"Return settings in flat format (default: false)" - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - }, - "local":{ - "type":"boolean", - "description":"Return local information, do not retrieve the state from master node (default: false)" - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.open.json b/src/ApiGenerator/RestSpecification/Core/indices.open.json deleted file mode 100644 index 3c094844af..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/indices.open.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "indices.open":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/close-index/", - "description":"Opens an index." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/{index}/_open", - "methods":[ - "POST" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma separated list of indices to open" - } - } - } - ] - }, - "params":{ - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - }, - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices":{ - "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)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"closed", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "wait_for_active_shards":{ - "type":"string", - "description":"Sets the number of active shards to wait for before the operation returns." - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.put_alias.json b/src/ApiGenerator/RestSpecification/Core/indices.put_alias.json deleted file mode 100644 index c45f0aa36f..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/indices.put_alias.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "indices.put_alias":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/alias/", - "description":"Creates or updates an alias." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"], - "content_type": ["application/json"] - }, - "url":{ - "paths":[ - { - "path":"/{index}/_alias/{name}", - "methods":[ - "PUT", - "POST" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the operation on all indices." - }, - "name":{ - "type":"string", - "description":"The name of the alias to be created or updated" - } - } - }, - { - "path":"/{index}/_aliases/{name}", - "methods":[ - "PUT", - "POST" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the operation on all indices." - }, - "name":{ - "type":"string", - "description":"The name of the alias to be created or updated" - } - } - } - ] - }, - "params":{ - "timeout":{ - "type":"time", - "description":"Explicit timestamp for the document" - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - } - }, - "body":{ - "description":"The settings for the alias, such as `routing` or `filter`", - "required":false - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.put_index_template.json b/src/ApiGenerator/RestSpecification/Core/indices.put_index_template.json deleted file mode 100644 index 4963df1614..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/indices.put_index_template.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "indices.put_index_template":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/", - "description":"Creates or updates an index template." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"], - "content_type": ["application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_index_template/{name}", - "methods":[ - "PUT", - "POST" - ], - "parts":{ - "name":{ - "type":"string", - "description":"The name of the template" - } - } - } - ] - }, - "params":{ - "create":{ - "type":"boolean", - "description":"Whether the index template should only be added if new or can also replace an existing one", - "default":false - }, - "cause":{ - "type":"string", - "description":"User defined reason for creating/updating the index template", - "default":false - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - } - }, - "body":{ - "description":"The template definition", - "required":true - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.put_mapping.json b/src/ApiGenerator/RestSpecification/Core/indices.put_mapping.json deleted file mode 100644 index 7bc6e47cd4..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/indices.put_mapping.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "indices.put_mapping":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/update-mapping/", - "description":"Updates the index mappings." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"], - "content_type": ["application/json"] - }, - "url":{ - "paths":[ - { - "path":"/{index}/_mapping", - "methods":[ - "PUT", - "POST" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices." - } - } - }, - { - "path":"/{index}/_mappings", - "methods":[ - "PUT", - "POST" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices." - } - }, - "deprecated":{ - "version":"1.0.0", - "description":"The plural mappings is accepted but only /_mapping is documented" - } - } - ] - }, - "params":{ - "include_type_name":{ - "type":"boolean", - "description":"Whether a type should be expected in the body of the mappings." - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - }, - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices":{ - "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)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "write_index_only":{ - "type":"boolean", - "default":false, - "description":"When true, applies mappings only to the write index of an alias or data stream" - } - }, - "body":{ - "description":"The mapping definition", - "required":true - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.put_settings.json b/src/ApiGenerator/RestSpecification/Core/indices.put_settings.json deleted file mode 100644 index 09be5ce207..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/indices.put_settings.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "indices.put_settings":{ - "documentation":{ - "url":"", - "description":"Updates the index settings." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"], - "content_type": ["application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_settings", - "methods":[ - "PUT" - ] - }, - { - "path":"/{index}/_settings", - "methods":[ - "PUT" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" - } - } - } - ] - }, - "params":{ - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - }, - "preserve_existing":{ - "type":"boolean", - "description":"Whether to update existing settings. If set to `true` existing settings on an index remain unchanged, the default is `false`" - }, - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices":{ - "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)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "flat_settings":{ - "type":"boolean", - "description":"Return settings in flat format (default: false)" - } - }, - "body":{ - "description":"The index settings to be updated", - "required":true - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.put_template.json b/src/ApiGenerator/RestSpecification/Core/indices.put_template.json deleted file mode 100644 index 50d0034a75..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/indices.put_template.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "indices.put_template":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/", - "description":"Creates or updates an index template." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"], - "content_type": ["application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_template/{name}", - "methods":[ - "PUT", - "POST" - ], - "parts":{ - "name":{ - "type":"string", - "description":"The name of the template" - } - } - } - ] - }, - "params":{ - "include_type_name":{ - "type":"boolean", - "description":"Whether a type should be returned in the body of the mappings." - }, - "order":{ - "type":"number", - "description":"The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers)" - }, - "create":{ - "type":"boolean", - "description":"Whether the index template should only be added if new or can also replace an existing one", - "default":false - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - } - }, - "body":{ - "description":"The template definition", - "required":true - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.recovery.json b/src/ApiGenerator/RestSpecification/Core/indices.recovery.json deleted file mode 100644 index 24d96f2e1d..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/indices.recovery.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "indices.recovery":{ - "documentation":{ - "url":"", - "description":"Returns information about ongoing index shard recoveries." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_recovery", - "methods":[ - "GET" - ] - }, - { - "path":"/{index}/_recovery", - "methods":[ - "GET" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" - } - } - } - ] - }, - "params":{ - "detailed":{ - "type":"boolean", - "description":"Whether to display detailed information about shard recovery", - "default":false - }, - "active_only":{ - "type":"boolean", - "description":"Display only those recoveries that are currently on-going", - "default":false - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.refresh.json b/src/ApiGenerator/RestSpecification/Core/indices.refresh.json deleted file mode 100644 index 10d63e8eaa..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/indices.refresh.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "indices.refresh":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/", - "description":"Performs the refresh operation in one or more indices." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_refresh", - "methods":[ - "POST", - "GET" - ] - }, - { - "path":"/{index}/_refresh", - "methods":[ - "POST", - "GET" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" - } - } - } - ] - }, - "params":{ - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices":{ - "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)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.resolve_index.json b/src/ApiGenerator/RestSpecification/Core/indices.resolve_index.json deleted file mode 100644 index 21264ead72..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/indices.resolve_index.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "indices.resolve_index":{ - "documentation":{ - "url":"", - "description":"Returns information about any matching indices, aliases, and data streams" - }, - "stability":"experimental", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_resolve/index/{name}", - "methods":[ - "GET" - ], - "parts":{ - "name":{ - "type":"list", - "description":"A comma-separated list of names or wildcard expressions" - } - } - } - ] - }, - "params":{ - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether wildcard expressions should get expanded to open or closed indices (default: open)" - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.rollover.json b/src/ApiGenerator/RestSpecification/Core/indices.rollover.json deleted file mode 100644 index 9d43a18fd6..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/indices.rollover.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "indices.rollover":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/data-streams/#step-5-rollover-a-data-stream", - "description":"Updates an alias to point to a new index when the existing index\nis considered to be too large or too old." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"], - "content_type": ["application/json"] - }, - "url":{ - "paths":[ - { - "path":"/{alias}/_rollover", - "methods":[ - "POST" - ], - "parts":{ - "alias":{ - "type":"string", - "description":"The name of the alias to rollover" - } - } - }, - { - "path":"/{alias}/_rollover/{new_index}", - "methods":[ - "POST" - ], - "parts":{ - "alias":{ - "type":"string", - "description":"The name of the alias to rollover" - }, - "new_index":{ - "type":"string", - "description":"The name of the rollover index" - } - } - } - ] - }, - "params":{ - "include_type_name":{ - "type":"boolean", - "description":"Whether a type should be included in the body of the mappings." - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - }, - "dry_run":{ - "type":"boolean", - "description":"If set to true the rollover action will only be validated but not actually performed even if a condition matches. The default is false" - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - }, - "wait_for_active_shards":{ - "type":"string", - "description":"Set the number of active shards to wait for on the newly created rollover index before the operation returns." - } - }, - "body":{ - "description":"The conditions that needs to be met for executing rollover" - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.segments.json b/src/ApiGenerator/RestSpecification/Core/indices.segments.json deleted file mode 100644 index fe44a81bfd..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/indices.segments.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "indices.segments":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-segments/", - "description":"Provides low-level information about segments in a Lucene index." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_segments", - "methods":[ - "GET" - ] - }, - { - "path":"/{index}/_segments", - "methods":[ - "GET" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" - } - } - } - ] - }, - "params":{ - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices":{ - "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)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "verbose":{ - "type":"boolean", - "description":"Includes detailed memory usage by Lucene.", - "default":false - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.shard_stores.json b/src/ApiGenerator/RestSpecification/Core/indices.shard_stores.json deleted file mode 100644 index c241aeab89..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/indices.shard_stores.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "indices.shard_stores":{ - "documentation":{ - "url":"", - "description":"Provides store information for shard copies of indices." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_shard_stores", - "methods":[ - "GET" - ] - }, - { - "path":"/{index}/_shard_stores", - "methods":[ - "GET" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" - } - } - } - ] - }, - "params":{ - "status":{ - "type":"list", - "options":[ - "green", - "yellow", - "red", - "all" - ], - "description":"A comma-separated list of statuses used to filter on shards to get store information for" - }, - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices":{ - "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)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.shrink.json b/src/ApiGenerator/RestSpecification/Core/indices.shrink.json deleted file mode 100644 index 16a781df6a..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/indices.shrink.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "indices.shrink":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/shrink-index/", - "description":"Allow to shrink an existing index into a new index with fewer primary shards." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"], - "content_type": ["application/json"] - }, - "url":{ - "paths":[ - { - "path":"/{index}/_shrink/{target}", - "methods":[ - "PUT", - "POST" - ], - "parts":{ - "index":{ - "type":"string", - "description":"The name of the source index to shrink" - }, - "target":{ - "type":"string", - "description":"The name of the target index to shrink into" - } - } - } - ] - }, - "params":{ - "copy_settings": { - "type" : "boolean", - "description" : "whether or not to copy settings from the source index (defaults to false)" - }, - "timeout": { - "type" : "time", - "description" : "Explicit operation timeout" - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - }, - "wait_for_active_shards": { - "type" : "string", - "description" : "Set the number of active shards to wait for on the shrunken index before the operation returns." - } - }, - "body":{ - "description":"The configuration for the target index (`settings` and `aliases`)" - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.simulate_index_template.json b/src/ApiGenerator/RestSpecification/Core/indices.simulate_index_template.json deleted file mode 100644 index 295a457442..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/indices.simulate_index_template.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "indices.simulate_index_template":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/", - "description": "Simulate matching the given index name against the index templates in the system" - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"], - "content_type": ["application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_index_template/_simulate_index/{name}", - "methods":[ - "POST" - ], - "parts":{ - "name":{ - "type":"string", - "description":"The name of the index (it must be a concrete index name)" - } - } - } - ] - }, - "params":{ - "create":{ - "type":"boolean", - "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", - "default":false - }, - "cause":{ - "type":"string", - "description":"User defined reason for dry-run creating the new template for simulation purposes", - "default":false - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - } - }, - "body":{ - "description":"New index template definition, which will be included in the simulation, as if it already exists in the system", - "required":false - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.simulate_template.json b/src/ApiGenerator/RestSpecification/Core/indices.simulate_template.json deleted file mode 100644 index a6a8a23dd7..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/indices.simulate_template.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "indices.simulate_template":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/", - "description": "Simulate resolving the given template name or body" - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"], - "content_type": ["application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_index_template/_simulate", - "methods":[ - "POST" - ] - }, - { - "path":"/_index_template/_simulate/{name}", - "methods":[ - "POST" - ], - "parts":{ - "name":{ - "type":"string", - "description":"The name of the index template" - } - } - } - ] - }, - "params":{ - "create":{ - "type":"boolean", - "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", - "default":false - }, - "cause":{ - "type":"string", - "description":"User defined reason for dry-run creating the new template for simulation purposes", - "default":false - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - } - }, - "body":{ - "description":"New index template definition to be simulated, if no index template name is specified", - "required":false - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.split.json b/src/ApiGenerator/RestSpecification/Core/indices.split.json deleted file mode 100644 index cc56dff46c..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/indices.split.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "indices.split":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/split/", - "description":"Allows you to split an existing index into a new index with more primary shards." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"], - "content_type": ["application/json"] - }, - "url":{ - "paths":[ - { - "path":"/{index}/_split/{target}", - "methods":[ - "PUT", - "POST" - ], - "parts":{ - "index":{ - "type":"string", - "description":"The name of the source index to split" - }, - "target":{ - "type":"string", - "description":"The name of the target index to split into" - } - } - } - ] - }, - "params": { - "copy_settings": { - "type" : "boolean", - "description" : "whether or not to copy settings from the source index (defaults to false)" - }, - "timeout": { - "type" : "time", - "description" : "Explicit operation timeout" - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - }, - "wait_for_active_shards": { - "type" : "string", - "description" : "Set the number of active shards to wait for on the shrunken index before the operation returns." - } - }, - "body":{ - "description":"The configuration for the target index (`settings` and `aliases`)" - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.stats.json b/src/ApiGenerator/RestSpecification/Core/indices.stats.json deleted file mode 100644 index ac0221cafd..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/indices.stats.json +++ /dev/null @@ -1,158 +0,0 @@ -{ - "indices.stats":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/stats-api/", - "description":"Provides statistics on operations happening in an index." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_stats", - "methods":[ - "GET" - ] - }, - { - "path":"/_stats/{metric}", - "methods":[ - "GET" - ], - "parts":{ - "metric":{ - "type":"list", - "options":[ - "_all", - "completion", - "docs", - "fielddata", - "query_cache", - "flush", - "get", - "indexing", - "merge", - "request_cache", - "refresh", - "search", - "segments", - "store", - "warmer", - "suggest" - ], - "description":"Limit the information returned the specific metrics." - } - } - }, - { - "path":"/{index}/_stats", - "methods":[ - "GET" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" - } - } - }, - { - "path":"/{index}/_stats/{metric}", - "methods":[ - "GET" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices" - }, - "metric":{ - "type":"list", - "options":[ - "_all", - "completion", - "docs", - "fielddata", - "query_cache", - "flush", - "get", - "indexing", - "merge", - "request_cache", - "refresh", - "search", - "segments", - "store", - "warmer", - "suggest" - ], - "description":"Limit the information returned the specific metrics." - } - } - } - ] - }, - "params":{ - "completion_fields":{ - "type":"list", - "description":"A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards)" - }, - "fielddata_fields":{ - "type":"list", - "description":"A comma-separated list of fields for `fielddata` index metric (supports wildcards)" - }, - "fields":{ - "type":"list", - "description":"A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards)" - }, - "groups":{ - "type":"list", - "description":"A comma-separated list of search groups for `search` index metric" - }, - "level":{ - "type":"enum", - "description":"Return stats aggregated at cluster, index or shard level", - "options":[ - "cluster", - "indices", - "shards" - ], - "default":"indices" - }, - "types":{ - "type":"list", - "description":"A comma-separated list of document types for the `indexing` index metric" - }, - "include_segment_file_sizes":{ - "type":"boolean", - "description":"Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested)", - "default":false - }, - "include_unloaded_segments":{ - "type":"boolean", - "description":"If set to true segment stats will include stats for segments that are not currently loaded into memory", - "default":false - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "forbid_closed_indices":{ - "type":"boolean", - "description":"If set to false stats will also collected from closed indices if explicitly specified or if expand_wildcards expands to closed indices", - "default":true - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.update_aliases.json b/src/ApiGenerator/RestSpecification/Core/indices.update_aliases.json deleted file mode 100644 index 7ef9f4a9e3..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/indices.update_aliases.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "indices.update_aliases":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/alias/", - "description":"Updates index aliases." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"], - "content_type": ["application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_aliases", - "methods":[ - "POST" - ] - } - ] - }, - "params":{ - "timeout":{ - "type":"time", - "description":"Request timeout" - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - } - }, - "body":{ - "description":"The definition of `actions` to perform", - "required":true - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/indices.validate_query.json b/src/ApiGenerator/RestSpecification/Core/indices.validate_query.json deleted file mode 100644 index 4132f1a9eb..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/indices.validate_query.json +++ /dev/null @@ -1,104 +0,0 @@ -{ - "indices.validate_query":{ - "documentation":{ - "url":"", - "description":"Allows a user to validate a potentially expensive query without executing it." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"], - "content_type": ["application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_validate/query", - "methods":[ - "GET", - "POST" - ] - }, - { - "path":"/{index}/_validate/query", - "methods":[ - "GET", - "POST" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices" - } - } - } - ] - }, - "params":{ - "explain":{ - "type":"boolean", - "description":"Return detailed information about the error" - }, - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices":{ - "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)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "q":{ - "type":"string", - "description":"Query in the Lucene query string syntax" - }, - "analyzer":{ - "type":"string", - "description":"The analyzer to use for the query string" - }, - "analyze_wildcard":{ - "type":"boolean", - "description":"Specify whether wildcard and prefix queries should be analyzed (default: false)" - }, - "default_operator":{ - "type":"enum", - "options":[ - "AND", - "OR" - ], - "default":"OR", - "description":"The default operator for query string query (AND or OR)" - }, - "df":{ - "type":"string", - "description":"The field to use as default where no field prefix is given in the query string" - }, - "lenient":{ - "type":"boolean", - "description":"Specify whether format-based query failures (such as providing text to a numeric field) should be ignored" - }, - "rewrite":{ - "type":"boolean", - "description":"Provide a more detailed explanation showing the actual Lucene query that will be executed." - }, - "all_shards":{ - "type":"boolean", - "description":"Execute validation on all shards instead of one random shard per index" - } - }, - "body":{ - "description":"The query definition specified with the Query DSL" - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/info.json b/src/ApiGenerator/RestSpecification/Core/info.json deleted file mode 100644 index c07c5c760c..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/info.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "info":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/index/", - "description":"Returns basic information about the cluster." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/", - "methods":[ - "GET" - ] - } - ] - }, - "params":{} - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/ingest.delete_pipeline.json b/src/ApiGenerator/RestSpecification/Core/ingest.delete_pipeline.json deleted file mode 100644 index b67eb57c3f..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/ingest.delete_pipeline.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "ingest.delete_pipeline":{ - "documentation":{ - "url":"", - "description":"Deletes a pipeline." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_ingest/pipeline/{id}", - "methods":[ - "DELETE" - ], - "parts":{ - "id":{ - "type":"string", - "description":"Pipeline ID" - } - } - } - ] - }, - "params":{ - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/ingest.get_pipeline.json b/src/ApiGenerator/RestSpecification/Core/ingest.get_pipeline.json deleted file mode 100644 index 0c1d15854b..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/ingest.get_pipeline.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "ingest.get_pipeline":{ - "documentation":{ - "url":"", - "description":"Returns a pipeline." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_ingest/pipeline", - "methods":[ - "GET" - ] - }, - { - "path":"/_ingest/pipeline/{id}", - "methods":[ - "GET" - ], - "parts":{ - "id":{ - "type":"string", - "description":"Comma separated list of pipeline ids. Wildcards supported" - } - } - } - ] - }, - "params":{ - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/ingest.processor_grok.json b/src/ApiGenerator/RestSpecification/Core/ingest.processor_grok.json deleted file mode 100644 index 8449ea41b9..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/ingest.processor_grok.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "ingest.processor_grok":{ - "documentation":{ - "url":"", - "description":"Returns a list of the built-in patterns." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_ingest/processor/grok", - "methods":[ - "GET" - ] - } - ] - }, - "params":{} - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/ingest.put_pipeline.json b/src/ApiGenerator/RestSpecification/Core/ingest.put_pipeline.json deleted file mode 100644 index c01fb37d24..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/ingest.put_pipeline.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "ingest.put_pipeline":{ - "documentation":{ - "url":"", - "description":"Creates or updates a pipeline." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"], - "content_type": ["application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_ingest/pipeline/{id}", - "methods":[ - "PUT" - ], - "parts":{ - "id":{ - "type":"string", - "description":"Pipeline ID" - } - } - } - ] - }, - "params":{ - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - } - }, - "body":{ - "description":"The ingest definition", - "required":true - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/ingest.simulate.json b/src/ApiGenerator/RestSpecification/Core/ingest.simulate.json deleted file mode 100644 index 538931232e..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/ingest.simulate.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "ingest.simulate":{ - "documentation":{ - "url":"", - "description":"Allows to simulate a pipeline with example documents." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"], - "content_type": ["application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_ingest/pipeline/_simulate", - "methods":[ - "GET", - "POST" - ] - }, - { - "path":"/_ingest/pipeline/{id}/_simulate", - "methods":[ - "GET", - "POST" - ], - "parts":{ - "id":{ - "type":"string", - "description":"Pipeline ID" - } - } - } - ] - }, - "params":{ - "verbose":{ - "type":"boolean", - "description":"Verbose mode. Display data output for each processor in executed pipeline", - "default":false - } - }, - "body":{ - "description":"The simulate definition", - "required":true - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/mget.json b/src/ApiGenerator/RestSpecification/Core/mget.json deleted file mode 100644 index 31261b97ba..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/mget.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "mget":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/multi-get/", - "description":"Allows to get multiple documents in one request." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"], - "content_type": ["application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_mget", - "methods":[ - "GET", - "POST" - ] - }, - { - "path":"/{index}/_mget", - "methods":[ - "GET", - "POST" - ], - "parts":{ - "index":{ - "type":"string", - "description":"The name of the index" - } - } - } - ] - }, - "params":{ - "stored_fields":{ - "type":"list", - "description":"A comma-separated list of stored fields to return in the response" - }, - "preference":{ - "type":"string", - "description":"Specify the node or shard the operation should be performed on (default: random)" - }, - "realtime":{ - "type":"boolean", - "description":"Specify whether to perform the operation in realtime or search mode" - }, - "refresh":{ - "type":"boolean", - "description":"Refresh the shard containing the document before performing the operation" - }, - "routing":{ - "type":"string", - "description":"Specific routing value" - }, - "_source":{ - "type":"list", - "description":"True or false to return the _source field or not, or a list of fields to return" - }, - "_source_excludes":{ - "type":"list", - "description":"A list of fields to exclude from the returned _source field" - }, - "_source_includes":{ - "type":"list", - "description":"A list of fields to extract and return from the _source field" - } - }, - "body":{ - "description":"Document identifiers; can be either `docs` (containing full document information) or `ids` (when index and type is provided in the URL.", - "required":true - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/msearch.json b/src/ApiGenerator/RestSpecification/Core/msearch.json deleted file mode 100644 index 706e1ba9a4..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/msearch.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "msearch":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/multi-search/", - "description":"Allows to execute several search operations in one request." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"], - "content_type": ["application/x-ndjson"] - }, - "url":{ - "paths":[ - { - "path":"/_msearch", - "methods":[ - "GET", - "POST" - ] - }, - { - "path":"/{index}/_msearch", - "methods":[ - "GET", - "POST" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names to use as default" - } - } - } - ] - }, - "params": { - "search_type":{ - "type":"enum", - "options":[ - "query_then_fetch", - "query_and_fetch", - "dfs_query_then_fetch", - "dfs_query_and_fetch" - ], - "description":"Search operation type" - }, - "max_concurrent_searches" : { - "type" : "number", - "description" : "Controls the maximum number of concurrent searches the multi search api will execute" - }, - "typed_keys": { - "type" : "boolean", - "description" : "Specify whether aggregation and suggester names should be prefixed by their respective types in the response" - }, - "pre_filter_shard_size":{ - "type":"number", - "description" : "A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint." - }, - "max_concurrent_shard_requests" : { - "type" : "number", - "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", - "default" : 5 - }, - "rest_total_hits_as_int" : { - "type": "boolean", - "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response", - "default": false - }, - "ccs_minimize_roundtrips":{ - "type":"boolean", - "description":"Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution", - "default":"true" - } - }, - "body":{ - "description":"The request definitions (metadata-search request definition pairs), separated by newlines", - "required":true, - "serialize":"bulk" - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/msearch_template.json b/src/ApiGenerator/RestSpecification/Core/msearch_template.json deleted file mode 100644 index 39a2b2985b..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/msearch_template.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "msearch_template":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/multi-search/", - "description":"Allows to execute several search template operations in one request." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"], - "content_type": ["application/x-ndjson"] - }, - "url":{ - "paths":[ - { - "path":"/_msearch/template", - "methods":[ - "GET", - "POST" - ] - }, - { - "path":"/{index}/_msearch/template", - "methods":[ - "GET", - "POST" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names to use as default" - } - } - } - ] - }, - "params": { - "search_type":{ - "type":"enum", - "options":[ - "query_then_fetch", - "query_and_fetch", - "dfs_query_then_fetch", - "dfs_query_and_fetch" - ], - "description":"Search operation type" - }, - "typed_keys": { - "type" : "boolean", - "description" : "Specify whether aggregation and suggester names should be prefixed by their respective types in the response" - }, - "max_concurrent_searches" : { - "type" : "number", - "description" : "Controls the maximum number of concurrent searches the multi search api will execute" - }, - "rest_total_hits_as_int" : { - "type" : "boolean", - "description" : "Indicates whether hits.total should be rendered as an integer or an object in the rest search response", - "default" : false - }, - "ccs_minimize_roundtrips": { - "type" : "boolean", - "description" : "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution", - "default" : "true" - } - }, - "body":{ - "description":"The request definitions (metadata-search request definition pairs), separated by newlines", - "required":true, - "serialize":"bulk" - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/mtermvectors.json b/src/ApiGenerator/RestSpecification/Core/mtermvectors.json deleted file mode 100644 index 156a410e21..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/mtermvectors.json +++ /dev/null @@ -1,103 +0,0 @@ -{ - "mtermvectors":{ - "documentation":{ - "url":"", - "description":"Returns multiple termvectors in one request." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"], - "content_type": ["application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_mtermvectors", - "methods":[ - "GET", - "POST" - ] - }, - { - "path":"/{index}/_mtermvectors", - "methods":[ - "GET", - "POST" - ], - "parts":{ - "index":{ - "type":"string", - "description":"The index in which the document resides." - } - } - } - ] - }, - "params":{ - "ids":{ - "type":"list", - "description":"A comma-separated list of documents ids. You must define ids as parameter or set \"ids\" or \"docs\" in the request body" - }, - "term_statistics":{ - "type":"boolean", - "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\".", - "default":false - }, - "field_statistics":{ - "type":"boolean", - "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\".", - "default":true - }, - "fields":{ - "type":"list", - "description":"A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\"." - }, - "offsets":{ - "type":"boolean", - "description":"Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\".", - "default":true - }, - "positions":{ - "type":"boolean", - "description":"Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\".", - "default":true - }, - "payloads":{ - "type":"boolean", - "description":"Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\".", - "default":true - }, - "preference":{ - "type":"string", - "description":"Specify the node or shard the operation should be performed on (default: random) .Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\"." - }, - "routing":{ - "type":"string", - "description":"Specific routing value. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\"." - }, - "realtime":{ - "type":"boolean", - "description":"Specifies if requests are real-time as opposed to near-real-time (default: true)." - }, - "version":{ - "type":"number", - "description":"Explicit version number for concurrency control" - }, - "version_type":{ - "type":"enum", - "options":[ - "internal", - "external", - "external_gte", - "force" - ], - "description":"Specific version type" - } - }, - "body":{ - "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.", - "required":false - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/nodes.hot_threads.json b/src/ApiGenerator/RestSpecification/Core/nodes.hot_threads.json deleted file mode 100644 index c31e997965..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/nodes.hot_threads.json +++ /dev/null @@ -1,147 +0,0 @@ -{ - "nodes.hot_threads":{ - "documentation":{ - "url":"", - "description":"Returns information about hot threads on each node in the cluster." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "text/plain"] - }, - "url":{ - "paths":[ - { - "path":"/_nodes/hot_threads", - "methods":[ - "GET" - ] - }, - { - "path":"/_nodes/{node_id}/hot_threads", - "methods":[ - "GET" - ], - "parts":{ - "node_id":{ - "type":"list", - "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" - } - } - }, - { - "path":"/_cluster/nodes/hotthreads", - "methods":[ - "GET" - ], - "parts":{}, - "deprecated":{ - "version":"1.0.0", - "description":"The hot threads API accepts `hotthreads` but only `hot_threads` is documented" - } - }, - { - "path":"/_cluster/nodes/{node_id}/hotthreads", - "methods":[ - "GET" - ], - "parts":{ - "node_id":{ - "type":"list", - "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" - } - }, - "deprecated":{ - "version":"1.0.0", - "description":"The hot threads API accepts `hotthreads` but only `hot_threads` is documented" - } - }, - { - "path":"/_nodes/hotthreads", - "methods":[ - "GET" - ], - "parts":{}, - "deprecated":{ - "version":"1.0.0", - "description":"The hot threads API accepts `hotthreads` but only `hot_threads` is documented" - } - }, - { - "path":"/_nodes/{node_id}/hotthreads", - "methods":[ - "GET" - ], - "parts":{ - "node_id":{ - "type":"list", - "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" - } - }, - "deprecated":{ - "version":"1.0.0", - "description":"The hot threads API accepts `hotthreads` but only `hot_threads` is documented" - } - }, - { - "path":"/_cluster/nodes/hot_threads", - "methods":[ - "GET" - ], - "parts":{}, - "deprecated":{ - "version":"1.0.0", - "description":"The hot accepts /_cluster/nodes as prefix for backwards compatibility reasons" - } - }, - { - "path":"/_cluster/nodes/{node_id}/hot_threads", - "methods":[ - "GET" - ], - "parts":{ - "node_id":{ - "type":"list", - "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" - } - }, - "deprecated":{ - "version":"1.0.0", - "description":"The hot accepts /_cluster/nodes as prefix for backwards compatibility reasons" - } - } - ] - }, - "params":{ - "interval":{ - "type":"time", - "description":"The interval for the second sampling of threads" - }, - "snapshots":{ - "type":"number", - "description":"Number of samples of thread stacktrace (default: 10)" - }, - "threads":{ - "type":"number", - "description":"Specify the number of threads to provide information for (default: 3)" - }, - "ignore_idle_threads":{ - "type":"boolean", - "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 (default: true)" - }, - "type":{ - "type":"enum", - "options":[ - "cpu", - "wait", - "block" - ], - "description":"The type to sample (default: cpu)" - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/nodes.info.json b/src/ApiGenerator/RestSpecification/Core/nodes.info.json deleted file mode 100644 index 3333df769d..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/nodes.info.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "nodes.info":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-nodes/", - "description":"Returns information about nodes in the cluster." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_nodes", - "methods":[ - "GET" - ] - }, - { - "path":"/_nodes/{node_id}", - "methods":[ - "GET" - ], - "parts":{ - "node_id":{ - "type":"list", - "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" - } - } - }, - { - "path":"/_nodes/{metric}", - "methods":[ - "GET" - ], - "parts":{ - "metric":{ - "type":"list", - "options":[ - "settings", - "os", - "process", - "jvm", - "thread_pool", - "transport", - "http", - "plugins", - "ingest" - ], - "description":"A comma-separated list of metrics you wish returned. Leave empty to return all." - } - } - }, - { - "path":"/_nodes/{node_id}/{metric}", - "methods":[ - "GET" - ], - "parts":{ - "node_id":{ - "type":"list", - "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" - }, - "metric":{ - "type":"list", - "options":[ - "settings", - "os", - "process", - "jvm", - "thread_pool", - "transport", - "http", - "plugins", - "ingest" - ], - "description":"A comma-separated list of metrics you wish returned. Leave empty to return all." - } - } - } - ] - }, - "params":{ - "flat_settings":{ - "type":"boolean", - "description":"Return settings in flat format (default: false)" - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/nodes.reload_secure_settings.json b/src/ApiGenerator/RestSpecification/Core/nodes.reload_secure_settings.json deleted file mode 100644 index 4ca0f27cd9..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/nodes.reload_secure_settings.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "nodes.reload_secure_settings":{ - "documentation":{ - "url":"", - "description":"Reloads secure settings." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"], - "content_type": [ "application/json" ] - }, - "url":{ - "paths":[ - { - "path":"/_nodes/reload_secure_settings", - "methods":[ - "POST" - ] - }, - { - "path":"/_nodes/{node_id}/reload_secure_settings", - "methods":[ - "POST" - ], - "parts":{ - "node_id":{ - "type":"list", - "description":"A comma-separated list of node IDs to span the reload/reinit call. Should stay empty because reloading usually involves all cluster nodes." - } - } - } - ] - }, - "params": { - "timeout": { - "type": "time", - "description": "Explicit operation timeout" - } - }, - "body": { - "description": "An object containing the password for the opensearch keystore", - "required": false - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/nodes.stats.json b/src/ApiGenerator/RestSpecification/Core/nodes.stats.json deleted file mode 100644 index a6d2ad1442..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/nodes.stats.json +++ /dev/null @@ -1,232 +0,0 @@ -{ - "nodes.stats":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/stats-api/", - "description":"Returns statistical information about nodes in the cluster." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_nodes/stats", - "methods":[ - "GET" - ] - }, - { - "path":"/_nodes/{node_id}/stats", - "methods":[ - "GET" - ], - "parts":{ - "node_id":{ - "type":"list", - "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" - } - } - }, - { - "path":"/_nodes/stats/{metric}", - "methods":[ - "GET" - ], - "parts":{ - "metric":{ - "type":"list", - "options":[ - "_all", - "breaker", - "fs", - "http", - "indices", - "jvm", - "os", - "process", - "thread_pool", - "transport", - "discovery", - "indexing_pressure" - ], - "description":"Limit the information returned to the specified metrics" - } - } - }, - { - "path":"/_nodes/{node_id}/stats/{metric}", - "methods":[ - "GET" - ], - "parts":{ - "metric":{ - "type":"list", - "options":[ - "_all", - "breaker", - "fs", - "http", - "indices", - "jvm", - "os", - "process", - "thread_pool", - "transport", - "discovery", - "indexing_pressure" - ], - "description":"Limit the information returned to the specified metrics" - }, - "node_id":{ - "type":"list", - "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" - } - } - }, - { - "path":"/_nodes/stats/{metric}/{index_metric}", - "methods":[ - "GET" - ], - "parts":{ - "metric":{ - "type":"list", - "options":[ - "_all", - "breaker", - "fs", - "http", - "indices", - "jvm", - "os", - "process", - "thread_pool", - "transport", - "discovery", - "indexing_pressure" - ], - "description":"Limit the information returned to the specified metrics" - }, - "index_metric":{ - "type":"list", - "options":[ - "_all", - "completion", - "docs", - "fielddata", - "query_cache", - "flush", - "get", - "indexing", - "merge", - "request_cache", - "refresh", - "search", - "segments", - "store", - "warmer", - "suggest" - ], - "description":"Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified." - } - } - }, - { - "path":"/_nodes/{node_id}/stats/{metric}/{index_metric}", - "methods":[ - "GET" - ], - "parts":{ - "metric":{ - "type":"list", - "options":[ - "_all", - "breaker", - "fs", - "http", - "indices", - "jvm", - "os", - "process", - "thread_pool", - "transport", - "discovery", - "indexing_pressure" - ], - "description":"Limit the information returned to the specified metrics" - }, - "index_metric":{ - "type":"list", - "options":[ - "_all", - "completion", - "docs", - "fielddata", - "query_cache", - "flush", - "get", - "indexing", - "merge", - "request_cache", - "refresh", - "search", - "segments", - "store", - "warmer", - "suggest" - ], - "description":"Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified." - }, - "node_id":{ - "type":"list", - "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" - } - } - } - ] - }, - "params":{ - "completion_fields":{ - "type":"list", - "description":"A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards)" - }, - "fielddata_fields":{ - "type":"list", - "description":"A comma-separated list of fields for `fielddata` index metric (supports wildcards)" - }, - "fields":{ - "type":"list", - "description":"A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards)" - }, - "groups":{ - "type":"boolean", - "description":"A comma-separated list of search groups for `search` index metric" - }, - "level":{ - "type":"enum", - "description":"Return indices stats aggregated at index, node or shard level", - "options":[ - "indices", - "node", - "shards" - ], - "default":"node" - }, - "types":{ - "type":"list", - "description":"A comma-separated list of document types for the `indexing` index metric" - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - }, - "include_segment_file_sizes":{ - "type":"boolean", - "description":"Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested)", - "default":false - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/nodes.usage.json b/src/ApiGenerator/RestSpecification/Core/nodes.usage.json deleted file mode 100644 index ce7c0d9137..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/nodes.usage.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "nodes.usage":{ - "documentation":{ - "url":"", - "description":"Returns low-level information about REST actions usage on nodes." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_nodes/usage", - "methods":[ - "GET" - ] - }, - { - "path":"/_nodes/{node_id}/usage", - "methods":[ - "GET" - ], - "parts":{ - "node_id":{ - "type":"list", - "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" - } - } - }, - { - "path":"/_nodes/usage/{metric}", - "methods":[ - "GET" - ], - "parts":{ - "metric":{ - "type":"list", - "options":[ - "_all", - "rest_actions" - ], - "description":"Limit the information returned to the specified metrics" - } - } - }, - { - "path":"/_nodes/{node_id}/usage/{metric}", - "methods":[ - "GET" - ], - "parts":{ - "metric":{ - "type":"list", - "options":[ - "_all", - "rest_actions" - ], - "description":"Limit the information returned to the specified metrics" - }, - "node_id":{ - "type":"list", - "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" - } - } - } - ] - }, - "params":{ - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/ping.json b/src/ApiGenerator/RestSpecification/Core/ping.json deleted file mode 100644 index 87226096fd..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/ping.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "ping":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/index/", - "description":"Returns whether the cluster is running." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/", - "methods":[ - "HEAD" - ] - } - ] - }, - "params":{} - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/put_script.json b/src/ApiGenerator/RestSpecification/Core/put_script.json deleted file mode 100644 index de125549c8..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/put_script.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "put_script":{ - "documentation":{ - "url":"", - "description":"Creates or updates a script." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"], - "content_type": ["application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_scripts/{id}", - "methods":[ - "PUT", - "POST" - ], - "parts":{ - "id":{ - "type":"string", - "description":"Script ID" - } - } - }, - { - "path":"/_scripts/{id}/{context}", - "methods":[ - "PUT", - "POST" - ], - "parts":{ - "id":{ - "type":"string", - "description":"Script ID" - }, - "context":{ - "type":"string", - "description":"Script context" - } - } - } - ] - }, - "params":{ - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - }, - "context":{ - "type":"string", - "description":"Context name to compile script against" - } - }, - "body":{ - "description":"The document", - "required":true - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/rank_eval.json b/src/ApiGenerator/RestSpecification/Core/rank_eval.json deleted file mode 100644 index 91bd3121aa..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/rank_eval.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "rank_eval":{ - "documentation":{ - "url":"", - "description":"Allows to evaluate the quality of ranked search results over a set of typical search queries" - }, - "stability":"experimental", - "visibility":"public", - "headers":{ - "accept": [ "application/json"], - "content_type": ["application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_rank_eval", - "methods":[ - "GET", - "POST" - ] - }, - { - "path":"/{index}/_rank_eval", - "methods":[ - "GET", - "POST" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices" - } - } - } - ] - }, - "params":{ - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices":{ - "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)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "search_type":{ - "type":"enum", - "options":[ - "query_then_fetch", - "dfs_query_then_fetch" - ], - "description":"Search operation type" - } - }, - "body":{ - "description":"The ranking evaluation search definition, including search requests, document ratings and ranking metric definition.", - "required":true - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/reindex.json b/src/ApiGenerator/RestSpecification/Core/reindex.json deleted file mode 100644 index 8ed380265f..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/reindex.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "reindex":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/reindex/", - "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." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"], - "content_type": ["application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_reindex", - "methods":[ - "POST" - ] - } - ] - }, - "params":{ - "refresh":{ - "type":"boolean", - "description":"Should the affected indexes be refreshed?" - }, - "timeout":{ - "type":"time", - "default":"1m", - "description":"Time each individual bulk request should wait for shards that are unavailable." - }, - "wait_for_active_shards":{ - "type":"string", - "description":"Sets the number of shard copies that must be active before proceeding with the reindex operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)" - }, - "wait_for_completion":{ - "type":"boolean", - "default":true, - "description":"Should the request should block until the reindex is complete." - }, - "requests_per_second":{ - "type":"number", - "default":0, - "description":"The throttle to set on this request in sub-requests per second. -1 means no throttle." - }, - "scroll":{ - "type":"time", - "description":"Control how long to keep the search context alive", - "default":"5m" - }, - "slices":{ - "type":"number|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`." - }, - "max_docs":{ - "type":"number", - "description":"Maximum number of documents to process (default: all documents)" - } - }, - "body":{ - "description":"The search definition using the Query DSL and the prototype for the index request.", - "required":true - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/reindex_rethrottle.json b/src/ApiGenerator/RestSpecification/Core/reindex_rethrottle.json deleted file mode 100644 index 548f02c1f8..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/reindex_rethrottle.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "reindex_rethrottle":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/reindex/", - "description":"Changes the number of requests per second for a particular Reindex operation." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_reindex/{task_id}/_rethrottle", - "methods":[ - "POST" - ], - "parts":{ - "task_id":{ - "type":"string", - "description":"The task id to rethrottle" - } - } - } - ] - }, - "params":{ - "requests_per_second":{ - "type":"number", - "required":true, - "description":"The throttle to set on this request in floating sub-requests per second. -1 means set no throttle." - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/render_search_template.json b/src/ApiGenerator/RestSpecification/Core/render_search_template.json deleted file mode 100644 index de148aec03..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/render_search_template.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "render_search_template":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/search-template/", - "description":"Allows to use the Mustache language to pre-render a search definition." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"], - "content_type": ["application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_render/template", - "methods":[ - "GET", - "POST" - ] - }, - { - "path":"/_render/template/{id}", - "methods":[ - "GET", - "POST" - ], - "parts":{ - "id":{ - "type":"string", - "description":"The id of the stored search template" - } - } - } - ] - }, - "body":{ - "description":"The search definition template and its params" - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/scripts_painless_execute.json b/src/ApiGenerator/RestSpecification/Core/scripts_painless_execute.json deleted file mode 100644 index c27d25bf03..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/scripts_painless_execute.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "scripts_painless_execute":{ - "documentation":{ - "url":"", - "description":"Allows an arbitrary script to be executed and a result to be returned" - }, - "stability":"experimental", - "visibility":"public", - "headers":{ - "accept": [ "application/json"], - "content_type": ["application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_scripts/painless/_execute", - "methods":[ - "GET", - "POST" - ] - } - ] - }, - "params":{}, - "body":{ - "description":"The script to execute" - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/scroll.json b/src/ApiGenerator/RestSpecification/Core/scroll.json deleted file mode 100644 index 42dda8508d..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/scroll.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "scroll":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/search/#request-body", - "description":"Allows to retrieve a large numbers of results from a single search request." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"], - "content_type": ["application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_search/scroll", - "methods":[ - "GET", - "POST" - ] - } - ] - }, - "params":{ - "scroll":{ - "type":"time", - "description":"Specify how long a consistent view of the index should be maintained for scrolled search" - }, - "scroll_id":{ - "type":"string", - "description":"The scroll ID for scrolled search" - }, - "rest_total_hits_as_int":{ - "type":"boolean", - "description":"Indicates whether hits.total should be rendered as an integer or an object in the rest search response", - "default":false - } - }, - "body":{ - "description":"The scroll ID if not passed by URL or query parameter." - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/search.json b/src/ApiGenerator/RestSpecification/Core/search.json deleted file mode 100644 index 6651077680..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/search.json +++ /dev/null @@ -1,243 +0,0 @@ -{ - "search":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/search/", - "description":"Returns results matching a query." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"], - "content_type": ["application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_search", - "methods":[ - "GET", - "POST" - ] - }, - { - "path":"/{index}/_search", - "methods":[ - "GET", - "POST" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices" - } - } - } - ] - }, - "params":{ - "analyzer":{ - "type":"string", - "description":"The analyzer to use for the query string" - }, - "analyze_wildcard":{ - "type":"boolean", - "description":"Specify whether wildcard and prefix queries should be analyzed (default: false)" - }, - "ccs_minimize_roundtrips":{ - "type":"boolean", - "description":"Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution", - "default":"true" - }, - "default_operator":{ - "type":"enum", - "options":[ - "AND", - "OR" - ], - "default":"OR", - "description":"The default operator for query string query (AND or OR)" - }, - "df":{ - "type":"string", - "description":"The field to use as default where no field prefix is given in the query string" - }, - "explain":{ - "type":"boolean", - "description":"Specify whether to return detailed information about score computation as part of a hit" - }, - "stored_fields":{ - "type":"list", - "description":"A comma-separated list of stored fields to return as part of a hit" - }, - "docvalue_fields":{ - "type":"list", - "description":"A comma-separated list of fields to return as the docvalue representation of a field for each hit" - }, - "from":{ - "type":"number", - "description":"Starting offset (default: 0)" - }, - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "ignore_throttled":{ - "type":"boolean", - "description":"Whether specified concrete, expanded or aliased indices should be ignored when throttled" - }, - "allow_no_indices":{ - "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)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "lenient":{ - "type":"boolean", - "description":"Specify whether format-based query failures (such as providing text to a numeric field) should be ignored" - }, - "preference":{ - "type":"string", - "description":"Specify the node or shard the operation should be performed on (default: random)" - }, - "q":{ - "type":"string", - "description":"Query in the Lucene query string syntax" - }, - "routing":{ - "type":"list", - "description":"A comma-separated list of specific routing values" - }, - "scroll":{ - "type":"time", - "description":"Specify how long a consistent view of the index should be maintained for scrolled search" - }, - "search_type":{ - "type":"enum", - "options":[ - "query_then_fetch", - "dfs_query_then_fetch" - ], - "description":"Search operation type" - }, - "size":{ - "type":"number", - "description":"Number of hits to return (default: 10)" - }, - "sort":{ - "type":"list", - "description":"A comma-separated list of : pairs" - }, - "_source":{ - "type":"list", - "description":"True or false to return the _source field or not, or a list of fields to return" - }, - "_source_excludes":{ - "type":"list", - "description":"A list of fields to exclude from the returned _source field" - }, - "_source_includes":{ - "type":"list", - "description":"A list of fields to extract and return from the _source field" - }, - "terminate_after":{ - "type":"number", - "description":"The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early." - }, - "stats":{ - "type":"list", - "description":"Specific 'tag' of the request for logging and statistical purposes" - }, - "suggest_field":{ - "type":"string", - "description":"Specify which field to use for suggestions" - }, - "suggest_mode":{ - "type":"enum", - "options":[ - "missing", - "popular", - "always" - ], - "default":"missing", - "description":"Specify suggest mode" - }, - "suggest_size":{ - "type":"number", - "description":"How many suggestions to return in response" - }, - "suggest_text":{ - "type":"string", - "description":"The source text for which the suggestions should be returned" - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - }, - "track_scores":{ - "type":"boolean", - "description":"Whether to calculate and return scores even if they are not used for sorting" - }, - "track_total_hits":{ - "type":"boolean", - "description":"Indicate if the number of documents that match the query should be tracked" - }, - "allow_partial_search_results":{ - "type":"boolean", - "default":true, - "description":"Indicate if an error should be returned if there is a partial search failure or timeout" - }, - "typed_keys":{ - "type":"boolean", - "description":"Specify whether aggregation and suggester names should be prefixed by their respective types in the response" - }, - "version":{ - "type":"boolean", - "description":"Specify whether to return document version as part of a hit" - }, - "seq_no_primary_term":{ - "type":"boolean", - "description":"Specify whether to return sequence number and primary term of the last modification of each hit" - }, - "request_cache":{ - "type":"boolean", - "description":"Specify if request cache should be used for this request or not, defaults to index level setting" - }, - "batched_reduce_size":{ - "type":"number", - "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.", - "default":512 - }, - "max_concurrent_shard_requests":{ - "type":"number", - "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", - "default":5 - }, - "pre_filter_shard_size":{ - "type":"number", - "description":"A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint." - }, - "rest_total_hits_as_int":{ - "type":"boolean", - "description":"Indicates whether hits.total should be rendered as an integer or an object in the rest search response", - "default":false - }, - "min_compatible_shard_node":{ - "type":"string", - "description":"The minimum compatible version that all shards involved in search should have for this request to be successful" - } - }, - "body":{ - "description":"The search definition using the Query DSL" - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/search_shards.json b/src/ApiGenerator/RestSpecification/Core/search_shards.json deleted file mode 100644 index c013caeaa3..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/search_shards.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "search_shards":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/security-plugin/access-control/cross-cluster-search/", - "description":"Returns information about the indices and shards that a search request would be executed against." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_search_shards", - "methods":[ - "GET", - "POST" - ] - }, - { - "path":"/{index}/_search_shards", - "methods":[ - "GET", - "POST" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices" - } - } - } - ] - }, - "params":{ - "preference":{ - "type":"string", - "description":"Specify the node or shard the operation should be performed on (default: random)" - }, - "routing":{ - "type":"string", - "description":"Specific routing value" - }, - "local":{ - "type":"boolean", - "description":"Return local information, do not retrieve the state from master node (default: false)" - }, - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices":{ - "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)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/search_template.json b/src/ApiGenerator/RestSpecification/Core/search_template.json deleted file mode 100644 index b6a2adbeb9..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/search_template.json +++ /dev/null @@ -1,112 +0,0 @@ -{ - "search_template":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/search-template/", - "description":"Allows to use the Mustache language to pre-render a search definition." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"], - "content_type": ["application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_search/template", - "methods":[ - "GET", - "POST" - ] - }, - { - "path":"/{index}/_search/template", - "methods":[ - "GET", - "POST" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices" - } - } - } - ] - }, - "params":{ - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "ignore_throttled":{ - "type":"boolean", - "description":"Whether specified concrete, expanded or aliased indices should be ignored when throttled" - }, - "allow_no_indices":{ - "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)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "preference":{ - "type":"string", - "description":"Specify the node or shard the operation should be performed on (default: random)" - }, - "routing":{ - "type":"list", - "description":"A comma-separated list of specific routing values" - }, - "scroll":{ - "type":"time", - "description":"Specify how long a consistent view of the index should be maintained for scrolled search" - }, - "search_type":{ - "type":"enum", - "options":[ - "query_then_fetch", - "query_and_fetch", - "dfs_query_then_fetch", - "dfs_query_and_fetch" - ], - "description":"Search operation type" - }, - "explain":{ - "type":"boolean", - "description":"Specify whether to return detailed information about score computation as part of a hit" - }, - "profile":{ - "type":"boolean", - "description":"Specify whether to profile the query execution" - }, - "typed_keys":{ - "type":"boolean", - "description":"Specify whether aggregation and suggester names should be prefixed by their respective types in the response" - }, - "rest_total_hits_as_int":{ - "type":"boolean", - "description":"Indicates whether hits.total should be rendered as an integer or an object in the rest search response", - "default":false - }, - "ccs_minimize_roundtrips": { - "type" : "boolean", - "description" : "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution", - "default" : "true" - } - }, - "body":{ - "description":"The search definition template and its params", - "required":true - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/snapshot.cleanup_repository.json b/src/ApiGenerator/RestSpecification/Core/snapshot.cleanup_repository.json deleted file mode 100644 index 9783af5d07..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/snapshot.cleanup_repository.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "snapshot.cleanup_repository": { - "documentation": { - "url": "", - "description": "Removes stale data from repository." - }, - "stability": "stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url": { - "paths": [ - { - "path": "/_snapshot/{repository}/_cleanup", - "methods": [ - "POST" - ], - "parts": { - "repository": { - "type": "string", - "description": "A repository name" - } - } - } - ] - }, - "params": { - "master_timeout": { - "type": "time", - "description": "Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout": { - "type": "time", - "description": "Explicit operation timeout for connection to cluster_manager_timeout node" - }, - "timeout": { - "type": "time", - "description": "Explicit operation timeout" - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/snapshot.clone.json b/src/ApiGenerator/RestSpecification/Core/snapshot.clone.json deleted file mode 100644 index c069bdcd5a..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/snapshot.clone.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "snapshot.clone":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/", - "description":"Clones indices from one snapshot into another snapshot in the same repository." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"], - "content_type": ["application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_snapshot/{repository}/{snapshot}/_clone/{target_snapshot}", - "methods":[ - "PUT" - ], - "parts":{ - "repository":{ - "type":"string", - "description":"A repository name" - }, - "snapshot":{ - "type":"string", - "description":"The name of the snapshot to clone from" - }, - "target_snapshot":{ - "type":"string", - "description":"The name of the cloned snapshot to create" - } - } - } - ] - }, - "params":{ - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - }, - }, - "body":{ - "description":"The snapshot clone definition", - "required":true - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/snapshot.create.json b/src/ApiGenerator/RestSpecification/Core/snapshot.create.json deleted file mode 100644 index c05e4d650c..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/snapshot.create.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "snapshot.create":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/", - "description":"Creates a snapshot in a repository." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"], - "content_type": ["application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_snapshot/{repository}/{snapshot}", - "methods":[ - "PUT", - "POST" - ], - "parts":{ - "repository":{ - "type":"string", - "description":"A repository name" - }, - "snapshot":{ - "type":"string", - "description":"A snapshot name" - } - } - } - ] - }, - "params":{ - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - }, - "wait_for_completion":{ - "type":"boolean", - "description":"Should this request wait until the operation has completed before returning", - "default":false - } - }, - "body":{ - "description":"The snapshot definition", - "required":false - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/snapshot.create_repository.json b/src/ApiGenerator/RestSpecification/Core/snapshot.create_repository.json deleted file mode 100644 index b5d89f5282..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/snapshot.create_repository.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "snapshot.create_repository":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/", - "description":"Creates a repository." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"], - "content_type": ["application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_snapshot/{repository}", - "methods":[ - "PUT", - "POST" - ], - "parts":{ - "repository":{ - "type":"string", - "description":"A repository name" - } - } - } - ] - }, - "params":{ - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - }, - "verify":{ - "type":"boolean", - "description":"Whether to verify the repository after creation" - } - }, - "body":{ - "description":"The repository definition", - "required":true - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/snapshot.delete.json b/src/ApiGenerator/RestSpecification/Core/snapshot.delete.json deleted file mode 100644 index 227d3aec7c..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/snapshot.delete.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "snapshot.delete":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/", - "description":"Deletes a snapshot." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_snapshot/{repository}/{snapshot}", - "methods":[ - "DELETE" - ], - "parts":{ - "repository":{ - "type":"string", - "description":"A repository name" - }, - "snapshot":{ - "type":"string", - "description":"A snapshot name" - } - } - } - ] - }, - "params":{ - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/snapshot.delete_repository.json b/src/ApiGenerator/RestSpecification/Core/snapshot.delete_repository.json deleted file mode 100644 index 4cbf5b31f5..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/snapshot.delete_repository.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "snapshot.delete_repository":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/", - "description":"Deletes a repository." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_snapshot/{repository}", - "methods":[ - "DELETE" - ], - "parts":{ - "repository":{ - "type":"list", - "description":"Name of the snapshot repository to unregister. Wildcard (`*`) patterns are supported." - } - } - } - ] - }, - "params":{ - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/snapshot.get.json b/src/ApiGenerator/RestSpecification/Core/snapshot.get.json deleted file mode 100644 index 7d526adcbc..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/snapshot.get.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "snapshot.get":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/", - "description":"Returns information about a snapshot." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_snapshot/{repository}/{snapshot}", - "methods":[ - "GET" - ], - "parts":{ - "repository":{ - "type":"string", - "description":"A repository name" - }, - "snapshot":{ - "type":"list", - "description":"A comma-separated list of snapshot names" - } - } - } - ] - }, - "params":{ - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - }, - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown" - }, - "verbose":{ - "type":"boolean", - "description":"Whether to show verbose snapshot info or only show the basic info found in the repository index blob" - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/snapshot.get_repository.json b/src/ApiGenerator/RestSpecification/Core/snapshot.get_repository.json deleted file mode 100644 index 3a03941ed3..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/snapshot.get_repository.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "snapshot.get_repository":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/", - "description":"Returns information about a repository." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_snapshot", - "methods":[ - "GET" - ] - }, - { - "path":"/_snapshot/{repository}", - "methods":[ - "GET" - ], - "parts":{ - "repository":{ - "type":"list", - "description":"A comma-separated list of repository names" - } - } - } - ] - }, - "params":{ - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - }, - "local":{ - "type":"boolean", - "description":"Return local information, do not retrieve the state from master node (default: false)" - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/snapshot.restore.json b/src/ApiGenerator/RestSpecification/Core/snapshot.restore.json deleted file mode 100644 index 630381ede2..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/snapshot.restore.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "snapshot.restore":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/", - "description":"Restores a snapshot." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"], - "content_type": ["application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_snapshot/{repository}/{snapshot}/_restore", - "methods":[ - "POST" - ], - "parts":{ - "repository":{ - "type":"string", - "description":"A repository name" - }, - "snapshot":{ - "type":"string", - "description":"A snapshot name" - } - } - } - ] - }, - "params":{ - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - }, - "wait_for_completion":{ - "type":"boolean", - "description":"Should this request wait until the operation has completed before returning", - "default":false - } - }, - "body":{ - "description":"Details of what to restore", - "required":false - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/snapshot.status.json b/src/ApiGenerator/RestSpecification/Core/snapshot.status.json deleted file mode 100644 index 40acfc5521..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/snapshot.status.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "snapshot.status":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/", - "description":"Returns information about the status of a snapshot." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_snapshot/_status", - "methods":[ - "GET" - ] - }, - { - "path":"/_snapshot/{repository}/_status", - "methods":[ - "GET" - ], - "parts":{ - "repository":{ - "type":"string", - "description":"A repository name" - } - } - }, - { - "path":"/_snapshot/{repository}/{snapshot}/_status", - "methods":[ - "GET" - ], - "parts":{ - "repository":{ - "type":"string", - "description":"A repository name" - }, - "snapshot":{ - "type":"list", - "description":"A comma-separated list of snapshot names" - } - } - } - ] - }, - "params":{ - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - }, - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown" - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/snapshot.verify_repository.json b/src/ApiGenerator/RestSpecification/Core/snapshot.verify_repository.json deleted file mode 100644 index b0d52a80ca..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/snapshot.verify_repository.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "snapshot.verify_repository":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/", - "description":"Verifies a repository." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_snapshot/{repository}/_verify", - "methods":[ - "POST" - ], - "parts":{ - "repository":{ - "type":"string", - "description":"A repository name" - } - } - } - ] - }, - "params":{ - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "cluster_manager_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to cluster_manager_timeout node" - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/tasks.cancel.json b/src/ApiGenerator/RestSpecification/Core/tasks.cancel.json deleted file mode 100644 index 8a31e844a4..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/tasks.cancel.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "tasks.cancel":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-tasks/", - "description":"Cancels a task, if it can be cancelled through an API." - }, - "stability":"experimental", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_tasks/_cancel", - "methods":[ - "POST" - ] - }, - { - "path":"/_tasks/{task_id}/_cancel", - "methods":[ - "POST" - ], - "parts":{ - "task_id":{ - "type":"string", - "description":"Cancel the task with specified task id (node_id:task_number)" - } - } - } - ] - }, - "params":{ - "nodes":{ - "type":"list", - "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" - }, - "actions":{ - "type":"list", - "description":"A comma-separated list of actions that should be cancelled. Leave empty to cancel all." - }, - "parent_task_id":{ - "type":"string", - "description":"Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all." - }, - "wait_for_completion": { - "type":"boolean", - "description":"Should the request block until the cancellation of the task and its descendant tasks is completed. Defaults to false" - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/tasks.get.json b/src/ApiGenerator/RestSpecification/Core/tasks.get.json deleted file mode 100644 index 1d8d576111..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/tasks.get.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "tasks.get":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-tasks/", - "description":"Returns information about a task." - }, - "stability":"experimental", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_tasks/{task_id}", - "methods":[ - "GET" - ], - "parts":{ - "task_id":{ - "type":"string", - "description":"Return the task with specified id (node_id:task_number)" - } - } - } - ] - }, - "params":{ - "wait_for_completion":{ - "type":"boolean", - "description":"Wait for the matching tasks to complete (default: false)" - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/tasks.list.json b/src/ApiGenerator/RestSpecification/Core/tasks.list.json deleted file mode 100644 index e669d8d66c..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/tasks.list.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "tasks.list":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-tasks/", - "description":"Returns a list of tasks." - }, - "stability":"experimental", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_tasks", - "methods":[ - "GET" - ] - } - ] - }, - "params":{ - "nodes":{ - "type":"list", - "description":"A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes" - }, - "actions":{ - "type":"list", - "description":"A comma-separated list of actions that should be returned. Leave empty to return all." - }, - "detailed":{ - "type":"boolean", - "description":"Return detailed task information (default: false)" - }, - "parent_task_id":{ - "type":"string", - "description":"Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all." - }, - "wait_for_completion":{ - "type":"boolean", - "description":"Wait for the matching tasks to complete (default: false)" - }, - "group_by":{ - "type":"enum", - "description":"Group tasks by nodes or parent/child relationships", - "options":[ - "nodes", - "parents", - "none" - ], - "default":"nodes" - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/termvectors.json b/src/ApiGenerator/RestSpecification/Core/termvectors.json deleted file mode 100644 index 98fd8216ba..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/termvectors.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "termvectors":{ - "documentation":{ - "url":"", - "description":"Returns information and statistics about terms in the fields of a particular document." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"], - "content_type": ["application/json"] - }, - "url":{ - "paths":[ - { - "path":"/{index}/_termvectors/{id}", - "methods":[ - "GET", - "POST" - ], - "parts":{ - "index":{ - "type":"string", - "description":"The index in which the document resides." - }, - "id":{ - "type":"string", - "description":"The id of the document, when not specified a doc param should be supplied." - } - } - }, - { - "path":"/{index}/_termvectors", - "methods":[ - "GET", - "POST" - ], - "parts":{ - "index":{ - "type":"string", - "description":"The index in which the document resides." - } - } - } - ] - }, - "params":{ - "term_statistics":{ - "type":"boolean", - "description":"Specifies if total term frequency and document frequency should be returned.", - "default":false - }, - "field_statistics":{ - "type":"boolean", - "description":"Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned.", - "default":true - }, - "fields":{ - "type":"list", - "description":"A comma-separated list of fields to return." - }, - "offsets":{ - "type":"boolean", - "description":"Specifies if term offsets should be returned.", - "default":true - }, - "positions":{ - "type":"boolean", - "description":"Specifies if term positions should be returned.", - "default":true - }, - "payloads":{ - "type":"boolean", - "description":"Specifies if term payloads should be returned.", - "default":true - }, - "preference":{ - "type":"string", - "description":"Specify the node or shard the operation should be performed on (default: random)." - }, - "routing":{ - "type":"string", - "description":"Specific routing value." - }, - "realtime":{ - "type":"boolean", - "description":"Specifies if request is real-time as opposed to near-real-time (default: true)." - }, - "version":{ - "type":"number", - "description":"Explicit version number for concurrency control" - }, - "version_type":{ - "type":"enum", - "options":[ - "internal", - "external", - "external_gte", - "force" - ], - "description":"Specific version type" - } - }, - "body":{ - "description":"Define parameters and or supply a document to get termvectors for. See documentation.", - "required":false - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/update.json b/src/ApiGenerator/RestSpecification/Core/update.json deleted file mode 100644 index 800b9f1116..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/update.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "update":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/update-document/", - "description":"Updates a document with a script or partial document." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"], - "content_type": ["application/json"] - }, - "url":{ - "paths":[ - { - "path":"/{index}/_update/{id}", - "methods":[ - "POST" - ], - "parts":{ - "id":{ - "type":"string", - "description":"Document ID" - }, - "index":{ - "type":"string", - "description":"The name of the index" - } - } - } - ] - }, - "params":{ - "wait_for_active_shards":{ - "type":"string", - "description":"Sets the number of shard copies that must be active before proceeding with the update operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)" - }, - "_source":{ - "type":"list", - "description":"True or false to return the _source field or not, or a list of fields to return" - }, - "_source_excludes":{ - "type":"list", - "description":"A list of fields to exclude from the returned _source field" - }, - "_source_includes":{ - "type":"list", - "description":"A list of fields to extract and return from the _source field" - }, - "lang":{ - "type":"string", - "description":"The script language (default: painless)" - }, - "refresh":{ - "type":"enum", - "options":[ - "true", - "false", - "wait_for" - ], - "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." - }, - "retry_on_conflict":{ - "type":"number", - "description":"Specify how many times should the operation be retried when a conflict occurs (default: 0)" - }, - "routing":{ - "type":"string", - "description":"Specific routing value" - }, - "timeout":{ - "type":"time", - "description":"Explicit operation timeout" - }, - "if_seq_no":{ - "type":"number", - "description":"only perform the update operation if the last operation that has changed the document has the specified sequence number" - }, - "if_primary_term":{ - "type":"number", - "description":"only perform the update operation if the last operation that has changed the document has the specified primary term" - }, - "require_alias": { - "type": "boolean", - "description": "When true, requires destination is an alias. Default is false" - } - }, - "body":{ - "description":"The request definition requires either `script` or partial `doc`", - "required":true - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/update_by_query.json b/src/ApiGenerator/RestSpecification/Core/update_by_query.json deleted file mode 100644 index 0e83281217..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/update_by_query.json +++ /dev/null @@ -1,198 +0,0 @@ -{ - "update_by_query":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/update-by-query/", - "description":"Performs an update on every document in the index without changing the source,\nfor example to pick up a mapping change." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"], - "content_type": ["application/json"] - }, - "url":{ - "paths":[ - { - "path":"/{index}/_update_by_query", - "methods":[ - "POST" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices" - } - } - } - ] - }, - "params":{ - "analyzer":{ - "type":"string", - "description":"The analyzer to use for the query string" - }, - "analyze_wildcard":{ - "type":"boolean", - "description":"Specify whether wildcard and prefix queries should be analyzed (default: false)" - }, - "default_operator":{ - "type":"enum", - "options":[ - "AND", - "OR" - ], - "default":"OR", - "description":"The default operator for query string query (AND or OR)" - }, - "df":{ - "type":"string", - "description":"The field to use as default where no field prefix is given in the query string" - }, - "from":{ - "type":"number", - "description":"Starting offset (default: 0)" - }, - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices":{ - "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)" - }, - "conflicts":{ - "type":"enum", - "options":[ - "abort", - "proceed" - ], - "default":"abort", - "description":"What to do when the update by query hits version conflicts?" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "lenient":{ - "type":"boolean", - "description":"Specify whether format-based query failures (such as providing text to a numeric field) should be ignored" - }, - "pipeline":{ - "type":"string", - "description":"Ingest pipeline to set on index requests made by this action. (default: none)" - }, - "preference":{ - "type":"string", - "description":"Specify the node or shard the operation should be performed on (default: random)" - }, - "q":{ - "type":"string", - "description":"Query in the Lucene query string syntax" - }, - "routing":{ - "type":"list", - "description":"A comma-separated list of specific routing values" - }, - "scroll":{ - "type":"time", - "description":"Specify how long a consistent view of the index should be maintained for scrolled search" - }, - "search_type":{ - "type":"enum", - "options":[ - "query_then_fetch", - "dfs_query_then_fetch" - ], - "description":"Search operation type" - }, - "search_timeout":{ - "type":"time", - "description":"Explicit timeout for each search request. Defaults to no timeout." - }, - "max_docs":{ - "type":"number", - "description":"Maximum number of documents to process (default: all documents)" - }, - "sort":{ - "type":"list", - "description":"A comma-separated list of : pairs" - }, - "_source":{ - "type":"list", - "description":"True or false to return the _source field or not, or a list of fields to return" - }, - "_source_excludes":{ - "type":"list", - "description":"A list of fields to exclude from the returned _source field" - }, - "_source_includes":{ - "type":"list", - "description":"A list of fields to extract and return from the _source field" - }, - "terminate_after":{ - "type":"number", - "description":"The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early." - }, - "stats":{ - "type":"list", - "description":"Specific 'tag' of the request for logging and statistical purposes" - }, - "version":{ - "type":"boolean", - "description":"Specify whether to return document version as part of a hit" - }, - "version_type":{ - "type":"boolean", - "description":"Should the document increment the version number (internal) on hit or not (reindex)" - }, - "request_cache":{ - "type":"boolean", - "description":"Specify if request cache should be used for this request or not, defaults to index level setting" - }, - "refresh":{ - "type":"boolean", - "description":"Should the affected indexes be refreshed?" - }, - "timeout":{ - "type":"time", - "default":"1m", - "description":"Time each individual bulk request should wait for shards that are unavailable." - }, - "wait_for_active_shards":{ - "type":"string", - "description":"Sets the number of shard copies that must be active before proceeding with the update by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)" - }, - "scroll_size":{ - "type":"number", - "default":100, - "description":"Size on the scroll request powering the update by query" - }, - "wait_for_completion":{ - "type":"boolean", - "default":true, - "description":"Should the request should block until the update by query operation is complete." - }, - "requests_per_second":{ - "type":"number", - "default":0, - "description":"The throttle to set on this request in sub-requests per second. -1 means no throttle." - }, - "slices":{ - "type":"number|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`." - } - }, - "body":{ - "description":"The search definition using the Query DSL" - } - } -} diff --git a/src/ApiGenerator/RestSpecification/Core/update_by_query_rethrottle.json b/src/ApiGenerator/RestSpecification/Core/update_by_query_rethrottle.json deleted file mode 100644 index ee11e0e927..0000000000 --- a/src/ApiGenerator/RestSpecification/Core/update_by_query_rethrottle.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "update_by_query_rethrottle":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/update-by-query/", - "description":"Changes the number of requests per second for a particular Update By Query operation." - }, - "stability":"stable", - "visibility":"public", - "headers":{ - "accept": [ "application/json"] - }, - "url":{ - "paths":[ - { - "path":"/_update_by_query/{task_id}/_rethrottle", - "methods":[ - "POST" - ], - "parts":{ - "task_id":{ - "type":"string", - "description":"The task id to rethrottle" - } - } - } - ] - }, - "params":{ - "requests_per_second":{ - "type":"number", - "required":true, - "description":"The throttle to set on this request in floating sub-requests per second. -1 means set no throttle." - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/_Patches/cat.tasks.patch.json b/src/ApiGenerator/RestSpecification/_Patches/cat.tasks.patch.json deleted file mode 100644 index ca5a5100d9..0000000000 --- a/src/ApiGenerator/RestSpecification/_Patches/cat.tasks.patch.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "cat.tasks": { - "stability" : "experimental", - "url": { - "path": "/_cat/tasks" - } - } -} \ No newline at end of file diff --git a/src/ApiGenerator/RestSpecification/_Patches/indices.put_mapping.patch.json b/src/ApiGenerator/RestSpecification/_Patches/indices.put_mapping.patch.json deleted file mode 100644 index 87be1e7c1c..0000000000 --- a/src/ApiGenerator/RestSpecification/_Patches/indices.put_mapping.patch.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "indices.put_mapping": { - "url": { - "path": "{index}/_mapping", - "paths": ["{index}/_mapping"], - "deprecated_paths" : [ - { - "version" : "1.0", - "path" : "{index}/_mappings", - "description" : "The plural mappings is accepted but only /_mapping is documented" - } - ] - } - } -} diff --git a/src/ApiGenerator/RestSpecification/_Patches/indices.stats.patch.json b/src/ApiGenerator/RestSpecification/_Patches/indices.stats.patch.json deleted file mode 100644 index 9a805273b9..0000000000 --- a/src/ApiGenerator/RestSpecification/_Patches/indices.stats.patch.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "indices.stats": { - "url": { - "parts": { - "metric" : { - "options": [ "_all", "store", "indexing", "get", "search", "merge", "flush", "refresh", "query_cache", "fielddata", "docs", "warmer", "completion", "segments", "translog", "request_cache", "recovery" ] - } - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/_Patches/nodes.hot_threads.patch.json b/src/ApiGenerator/RestSpecification/_Patches/nodes.hot_threads.patch.json deleted file mode 100644 index c895018667..0000000000 --- a/src/ApiGenerator/RestSpecification/_Patches/nodes.hot_threads.patch.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "nodes.hot_threads": { - "url": { - "path": "/_nodes/hot_threads", - "paths": [ "/_nodes/hot_threads", "/_nodes/{node_id}/hot_threads" ], - "deprecated_paths": [ - { - "version": "1.0", - "path": "/_cluster/nodes/hotthreads", - "description": "The hot threads API accepts `hotthreads` but only `hot_threads` is documented" - }, - { - "version": "1.0", - "path": "/_cluster/nodes/{node_id}/hotthreads", - "description": "The hot threads API accepts `hotthreads` but only `hot_threads` is documented" - }, - { - "version": "1.0", - "path": "/_nodes/hotthreads", - "description": "The hot threads API accepts `hotthreads` but only `hot_threads` is documented" - }, - { - "version": "1.0", - "path": "/_nodes/{node_id}/hotthreads", - "description": "The hot threads API accepts `hotthreads` but only `hot_threads` is documented" - }, - { - "version": "1.0", - "path": "/_cluster/nodes/hot_threads", - "description": "The hot accepts /_cluster/nodes as prefix for backwards compatibility reasons" - }, - { - "version": "1.0", - "path": "/_cluster/nodes/{node_id}/hot_threads", - "description": "The hot accepts /_cluster/nodes as prefix for backwards compatibility reasons" - } - ] - } - } -} diff --git a/src/ApiGenerator/RestSpecification/_Patches/nodes.stats.patch.json b/src/ApiGenerator/RestSpecification/_Patches/nodes.stats.patch.json deleted file mode 100644 index b43cb36f3c..0000000000 --- a/src/ApiGenerator/RestSpecification/_Patches/nodes.stats.patch.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "nodes.stats": { - "url": { - "parts": { - "index_metric" : { - "options": [ "_all", "store", "indexing", "get", "search", "merge", "flush", "refresh", "query_cache", "fielddata", "docs", "warmer", "completion", "segments", "translog", "request_cache", "recovery" ] - } - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/_Patches/reindex.patch.patch.json b/src/ApiGenerator/RestSpecification/_Patches/reindex.patch.patch.json deleted file mode 100644 index 1c1240317d..0000000000 --- a/src/ApiGenerator/RestSpecification/_Patches/reindex.patch.patch.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "reindex": { - "url": { - "params": { - "scroll": { - "type" : "time", - "description" : "Specify how long a consistent view of the index should be maintained for scrolled search" - } - } - } - } -} diff --git a/src/ApiGenerator/RestSpecification/_Patches/snapshot.cleanup_repository.patch.json b/src/ApiGenerator/RestSpecification/_Patches/snapshot.cleanup_repository.patch.json deleted file mode 100644 index 7c4a52b6af..0000000000 --- a/src/ApiGenerator/RestSpecification/_Patches/snapshot.cleanup_repository.patch.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "snapshot.cleanup_repository": { - "body": { } - } -} From 4cd1502128ae1da30f0b559620af7f01efa174ff Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Wed, 23 Aug 2023 11:56:06 +1200 Subject: [PATCH 11/27] Re-generate tasks namespace (#320) Signed-off-by: Thomas Farr --- src/ApiGenerator/ApiGenerator.csproj | 2 +- .../Configuration/CodeConfiguration.cs | 1 + .../Generator/Razor/RazorGeneratorBase.cs | 46 +- src/ApiGenerator/OpenSearch.openapi.json | 21775 +++++++++------- .../OpenSearchClient.Namespace.cshtml | 2 +- .../HighLevel/Descriptors/Descriptors.cshtml | 2 +- .../Views/HighLevel/Requests/Requests.cshtml | 2 +- 7 files changed, 12241 insertions(+), 9589 deletions(-) diff --git a/src/ApiGenerator/ApiGenerator.csproj b/src/ApiGenerator/ApiGenerator.csproj index 753f44290e..65c2ca0f24 100644 --- a/src/ApiGenerator/ApiGenerator.csproj +++ b/src/ApiGenerator/ApiGenerator.csproj @@ -9,8 +9,8 @@ true + - diff --git a/src/ApiGenerator/Configuration/CodeConfiguration.cs b/src/ApiGenerator/Configuration/CodeConfiguration.cs index 2a6db3f9d4..e238dce547 100644 --- a/src/ApiGenerator/Configuration/CodeConfiguration.cs +++ b/src/ApiGenerator/Configuration/CodeConfiguration.cs @@ -40,6 +40,7 @@ public static class CodeConfiguration private static readonly Glob[] OperationsToInclude = { // e.g. new Glob("nodes.*"), + new("tasks.*") }; public static bool IncludeOperation(string name) => OperationsToInclude.Any(g => g.IsMatch(name)); diff --git a/src/ApiGenerator/Generator/Razor/RazorGeneratorBase.cs b/src/ApiGenerator/Generator/Razor/RazorGeneratorBase.cs index 26696a8e8a..4d40ca84e4 100644 --- a/src/ApiGenerator/Generator/Razor/RazorGeneratorBase.cs +++ b/src/ApiGenerator/Generator/Razor/RazorGeneratorBase.cs @@ -31,10 +31,8 @@ using System.IO; using System.Threading; using System.Threading.Tasks; -using ApiGenerator.Configuration; using ApiGenerator.Domain; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.CSharp; +using CSharpier; using RazorLight; using RazorLight.Generation; using RazorLight.Razor; @@ -51,13 +49,13 @@ public abstract class RazorGeneratorBase .EnableDebugMode() .Build(); - protected async Task DoRazor(TModel model, string viewLocation, string targetLocation, CancellationToken token) + protected static async Task DoRazor(TModel model, string viewLocation, string targetLocation, CancellationToken token) { try { token.ThrowIfCancellationRequested(); var generated = await Engine.CompileRenderAsync(viewLocation, model); - WriteFormattedCsharpFile(targetLocation, generated); + await WriteFormattedCsharpFile(targetLocation, generated); } catch (TemplateGenerationException e) { @@ -71,32 +69,28 @@ protected async Task DoRazorDependantFiles( 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}"); - } - } - } + { + 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}"); + } + } - protected static void WriteFormattedCsharpFile(string path, string contents) + private static async Task WriteFormattedCsharpFile(string path, string contents) { - var tree = CSharpSyntaxTree.ParseText(contents); - var root = tree.GetRoot().NormalizeWhitespace(indentation:"\t", "\n"); - contents = root.ToFullString(); + contents = (await CodeFormatter.FormatAsync(contents)).Code; if (Directory.GetParent(path) is { Exists: false } dir) dir.Create(); - File.WriteAllText(path, contents); + await File.WriteAllTextAsync(path, contents); } public abstract string Title { get; } diff --git a/src/ApiGenerator/OpenSearch.openapi.json b/src/ApiGenerator/OpenSearch.openapi.json index dad791663a..f0929abadf 100644 --- a/src/ApiGenerator/OpenSearch.openapi.json +++ b/src/ApiGenerator/OpenSearch.openapi.json @@ -49,7 +49,7 @@ "description": "Returns an alias.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/im-plugin/index-alias/" }, "operationId": "IndicesGetAlias", "parameters": [ @@ -110,7 +110,7 @@ "description": "Comma-separated list of alias names.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", "description": "Comma-separated list of alias names.", "x-data-type": "array" }, @@ -175,7 +175,7 @@ "description": "Comma-separated list of alias names.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", "description": "Comma-separated list of alias names.", "x-data-type": "array" }, @@ -304,7 +304,7 @@ "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" + "url": "https://opensearch.org/docs/latest/api-reference/analyze-apis/perform-text-analysis/" }, "operationId": "IndicesAnalyze_Get", "parameters": [ @@ -363,7 +363,7 @@ "description": "Allows to perform multiple index/update/delete operations in a single request.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/api-reference/document-apis/bulk/" }, "operationId": "Bulk_Post", "requestBody": { @@ -631,7 +631,7 @@ "description": "Clears all or specific caches for one or more indices.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/api-reference/index-apis/clear-index-cache/" }, "operationId": "IndicesClearCache", "parameters": [ @@ -731,7 +731,7 @@ "description": "Returns help for the Cat APIs.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/api-reference/cat/index/" }, "operationId": "CatHelp", "parameters": [ @@ -774,7 +774,7 @@ "description": "Shows information about currently configured aliases to indices including filter and routing infos.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/api-reference/cat/cat-aliases/" }, "operationId": "CatAliases", "parameters": [ @@ -874,7 +874,7 @@ "description": "Comma-separated list of alias names.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", "description": "Comma-separated list of alias names.", "x-data-type": "array" }, @@ -970,7 +970,7 @@ "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" + "url": "https://opensearch.org/docs/latest/api-reference/cat/cat-allocation/" }, "operationId": "CatAllocation", "parameters": [ @@ -1095,7 +1095,7 @@ "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)", + "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" }, @@ -1216,7 +1216,7 @@ "description": "Returns information about the cluster-manager node.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/api-reference/cat/cat-cluster_manager/" }, "operationId": "CatClusterManager", "parameters": [ @@ -1327,7 +1327,7 @@ "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" + "url": "https://opensearch.org/docs/latest/api-reference/cat/cat-count/" }, "operationId": "CatCount", "parameters": [ @@ -1409,7 +1409,7 @@ "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)", + "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" }, @@ -1487,7 +1487,7 @@ "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" + "url": "https://opensearch.org/docs/latest/api-reference/cat/cat-field-data/" }, "operationId": "CatFielddata", "parameters": [ @@ -1591,7 +1591,7 @@ "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)", + "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" }, @@ -1691,7 +1691,7 @@ "description": "Returns a concise representation of the cluster health.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/api-reference/cat/cat-health/" }, "operationId": "CatHealth", "parameters": [ @@ -1954,7 +1954,7 @@ "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)", + "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" }, @@ -2126,7 +2126,7 @@ "description": "Returns information about the cluster-manager node.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/api-reference/cat/cat-cluster_manager/" }, "operationId": "CatMaster", "deprecated": true, @@ -2240,7 +2240,7 @@ "description": "Returns information about custom node attributes.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/api-reference/cat/cat-nodeattrs/" }, "operationId": "CatNodeattrs", "parameters": [ @@ -2491,7 +2491,7 @@ "description": "Returns a concise representation of the cluster pending tasks.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/api-reference/cat/cat-pending-tasks/" }, "operationId": "CatPendingTasks", "parameters": [ @@ -2605,12 +2605,69 @@ "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" + "url": "https://opensearch.org/docs/latest/api-reference/cat/cat-plugins/" }, "operationId": "CatPlugins", "parameters": [ @@ -2721,7 +2778,7 @@ "description": "Returns information about index shard recoveries, both on-going completed.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/api-reference/cat/cat-plugins/" }, "operationId": "CatRecovery", "parameters": [ @@ -2853,7 +2910,7 @@ "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)", + "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" }, @@ -2981,7 +3038,7 @@ "description": "Returns information about snapshot repositories registered in the cluster.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/api-reference/cat/cat-repositories/" }, "operationId": "CatRepositories", "parameters": [ @@ -3092,7 +3149,7 @@ "description": "Returns information about both on-going and latest completed Segment Replication events.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/api-reference/cat/cat-segment-replication/" }, "operationId": "CatSegmentReplication", "parameters": [ @@ -3248,7 +3305,7 @@ "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)", + "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" }, @@ -3400,7 +3457,7 @@ "description": "Provides low-level information about the segments in the shards of an index.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/api-reference/cat/cat-segments/" }, "operationId": "CatSegments", "parameters": [ @@ -3515,7 +3572,7 @@ "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)", + "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" }, @@ -3626,7 +3683,7 @@ "description": "Provides a detailed view of shard allocation on nodes.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/api-reference/cat/cat-shards/" }, "operationId": "CatShards", "parameters": [ @@ -3759,7 +3816,7 @@ "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)", + "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" }, @@ -3888,7 +3945,7 @@ "description": "Returns all snapshots in a specific repository.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/api-reference/cat/cat-snapshots/" }, "operationId": "CatSnapshots", "parameters": [ @@ -4013,7 +4070,7 @@ "description": "Comma-separated list of repository names.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", "description": "Comma-separated list of repository names.", "x-data-type": "array" }, @@ -4134,7 +4191,7 @@ "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" + "url": "https://opensearch.org/docs/latest/api-reference/cat/cat-tasks/" }, "operationId": "CatTasks", "parameters": [ @@ -4265,7 +4322,7 @@ "description": "Returns information about existing templates.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/api-reference/cat/cat-templates/" }, "operationId": "CatTemplates", "parameters": [ @@ -4382,7 +4439,7 @@ "description": "The name of the template.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", "description": "The name of the template." }, "required": true @@ -4494,7 +4551,7 @@ "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" + "url": "https://opensearch.org/docs/latest/api-reference/cat/cat-thread-pool/" }, "operationId": "CatThreadPool", "parameters": [ @@ -4621,7 +4678,7 @@ "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)", + "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" }, @@ -4744,7 +4801,7 @@ "description": "Provides explanations for shard allocations in the cluster.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-allocation/" }, "operationId": "ClusterAllocationExplain_Get", "parameters": [ @@ -4825,7 +4882,7 @@ "description": "Delete any existing decommission.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-decommission/#example-decommissioning-and-recommissioning-a-zone" }, "operationId": "ClusterDeleteDecommissionAwareness", "responses": { @@ -4842,7 +4899,7 @@ "description": "Get details and status of decommissioned attribute.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-decommission/#example-getting-zone-decommission-status" }, "operationId": "ClusterGetDecommissionAwareness", "parameters": [ @@ -4852,7 +4909,7 @@ "description": "Awareness attribute name.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", "description": "Awareness attribute name." }, "required": true @@ -4872,7 +4929,7 @@ "description": "Decommissions an awareness attribute.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-decommission/#example-decommissioning-and-recommissioning-a-zone" }, "operationId": "ClusterPutDecommissionAwareness", "parameters": [ @@ -4882,7 +4939,7 @@ "description": "Awareness attribute name.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", "description": "Awareness attribute name." }, "required": true @@ -4893,7 +4950,7 @@ "description": "Awareness attribute value.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", "description": "Awareness attribute value." }, "required": true @@ -4913,7 +4970,7 @@ "description": "Returns basic information about the health of the cluster.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-health/" }, "operationId": "ClusterHealth", "parameters": [ @@ -5071,7 +5128,7 @@ "description": "Limit the information returned to specific indicies.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", "description": "Limit the information returned to specific indicies.", "x-data-type": "array" }, @@ -5225,7 +5282,7 @@ "description": "Returns information about hot threads on each node in the cluster.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/api-reference/nodes-apis/nodes-hot-threads/" }, "operationId": "NodesHotThreads_DeprecatedDash", "deprecated": true, @@ -5398,7 +5455,7 @@ "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)", + "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" }, @@ -5491,7 +5548,7 @@ "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)", + "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" }, @@ -5736,7 +5793,7 @@ "description": "Delete weighted shard routing weights.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-awareness/#example-deleting-weights" }, "operationId": "ClusterDeleteWeightedRouting", "responses": { @@ -5753,7 +5810,7 @@ "description": "Fetches weighted shard routing weights.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-awareness/#example-getting-weights-for-all-zones" }, "operationId": "ClusterGetWeightedRouting", "parameters": [ @@ -5763,7 +5820,7 @@ "description": "Awareness attribute name.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", "description": "Awareness attribute name." }, "required": true @@ -5781,7 +5838,7 @@ "description": "Updates weighted shard routing weights.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-awareness/#example-weighted-round-robin-search" }, "operationId": "ClusterPutWeightedRouting", "parameters": [ @@ -5791,7 +5848,7 @@ "description": "Awareness attribute name.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", "description": "Awareness attribute name." }, "required": true @@ -5811,7 +5868,7 @@ "description": "Returns cluster settings.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest/api-reference/cluster-settings/" + "url": "https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-settings/" }, "operationId": "ClusterGetSettings", "parameters": [ @@ -6104,7 +6161,7 @@ "description": "Limit the information returned to the specified metrics.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", "description": "Limit the information returned to the specified metrics.", "x-enum-options": [ "_all", @@ -6234,7 +6291,7 @@ "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)", + "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" }, @@ -6246,7 +6303,7 @@ "description": "Limit the information returned to the specified metrics.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", "description": "Limit the information returned to the specified metrics.", "x-enum-options": [ "_all", @@ -6370,7 +6427,7 @@ "description": "Returns high-level overview of cluster statistics.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-stats/" }, "operationId": "ClusterStats", "parameters": [ @@ -6416,7 +6473,7 @@ "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)", + "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" }, @@ -6597,7 +6654,7 @@ "description": "The name of the template.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", "description": "The name of the template." }, "required": true @@ -6657,7 +6714,7 @@ "description": "The Comma-separated names of the component templates.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", "description": "The Comma-separated names of the component templates.", "x-data-type": "array" }, @@ -6721,7 +6778,7 @@ "description": "The name of the template.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", "description": "The name of the template." }, "required": true @@ -6779,7 +6836,7 @@ "description": "The name of the template.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", "description": "The name of the template." }, "required": true @@ -6843,7 +6900,7 @@ "description": "Creates or updates a component template.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/im-plugin/index-templates/#use-component-templates-to-create-an-index-template" }, "operationId": "ClusterPutComponentTemplate_Put", "requestBody": { @@ -6863,7 +6920,7 @@ "description": "The name of the template.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", "description": "The name of the template." }, "required": true @@ -7075,7 +7132,7 @@ "description": "Returns number of documents matching a query.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/api-reference/count/" }, "operationId": "Count_Post", "requestBody": { @@ -7236,7 +7293,7 @@ "description": "Returns all dangling indices.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/api-reference/index-apis/dangling-index/" }, "operationId": "DanglingIndicesListDanglingIndices", "responses": { @@ -7253,7 +7310,7 @@ "description": "Deletes the specified dangling index.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/api-reference/index-apis/dangling-index/" }, "operationId": "DanglingIndicesDeleteDanglingIndex", "parameters": [ @@ -7263,7 +7320,7 @@ "description": "The UUID of the dangling index.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", "description": "The UUID of the dangling index." }, "required": true @@ -7326,7 +7383,7 @@ "description": "Imports the specified dangling index.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/api-reference/index-apis/dangling-index/" }, "operationId": "DanglingIndicesImportDanglingIndex", "parameters": [ @@ -7336,7 +7393,7 @@ "description": "The UUID of the dangling index.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", "description": "The UUID of the dangling index." }, "required": true @@ -7401,12 +7458,19 @@ "description": "Returns data streams.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/im-plugin/data-streams/" }, "operationId": "IndicesGetDataStream", "responses": { "200": { - "description": "IndicesGetDataStream 200 response" + "description": "IndicesGetDataStream 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndicesGetDataStreamResponseContent" + } + } + } } }, "x-operation-group": "indices.get_data_stream", @@ -7418,7 +7482,7 @@ "description": "Provides statistics on operations happening in a data stream.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/im-plugin/data-streams/" }, "operationId": "IndicesDataStreamsStats", "responses": { @@ -7435,7 +7499,7 @@ "description": "Deletes a data stream.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/im-plugin/data-streams/" }, "operationId": "IndicesDeleteDataStream", "parameters": [ @@ -7445,7 +7509,7 @@ "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)", + "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" }, @@ -7454,7 +7518,14 @@ ], "responses": { "200": { - "description": "IndicesDeleteDataStream 200 response" + "description": "IndicesDeleteDataStream 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndicesDeleteDataStreamResponseContent" + } + } + } } }, "x-operation-group": "indices.delete_data_stream", @@ -7470,7 +7541,7 @@ "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)", + "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" }, @@ -7479,7 +7550,14 @@ ], "responses": { "200": { - "description": "IndicesGetDataStream_WithName 200 response" + "description": "IndicesGetDataStream_WithName 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndicesGetDataStream_WithNameResponseContent" + } + } + } } }, "x-operation-group": "indices.get_data_stream", @@ -7489,7 +7567,7 @@ "description": "Creates or updates a data stream.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/im-plugin/data-streams/" }, "operationId": "IndicesCreateDataStream", "requestBody": { @@ -7508,7 +7586,7 @@ "description": "The name of the data stream.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", "description": "The name of the data stream." }, "required": true @@ -7516,7 +7594,14 @@ ], "responses": { "200": { - "description": "IndicesCreateDataStream 200 response" + "description": "IndicesCreateDataStream 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndicesCreateDataStreamResponseContent" + } + } + } } }, "x-operation-group": "indices.create_data_stream", @@ -7534,7 +7619,7 @@ "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)", + "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" }, @@ -7565,7 +7650,7 @@ "description": "The task id to rethrottle.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", "description": "The task id to rethrottle." }, "required": true @@ -7596,7 +7681,7 @@ "description": "Returns the information about the capabilities of fields among multiple indices.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/field-types/supported-field-types/alias/#using-aliases-in-field-capabilities-api-operations" }, "operationId": "FieldCaps_Get", "parameters": [ @@ -7933,7 +8018,7 @@ "description": "Returns an index template.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/im-plugin/index-templates/" }, "operationId": "IndicesGetIndexTemplate", "parameters": [ @@ -8085,7 +8170,7 @@ "description": "The name of the template.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", "description": "The name of the template." }, "required": true @@ -8169,7 +8254,7 @@ "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)", + "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 @@ -8234,7 +8319,7 @@ "description": "Deletes an index template.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/im-plugin/index-templates/#delete-a-template" }, "operationId": "IndicesDeleteIndexTemplate", "parameters": [ @@ -8244,7 +8329,7 @@ "description": "The name of the template.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", "description": "The name of the template." }, "required": true @@ -8304,7 +8389,7 @@ "description": "Comma-separated names of the index templates.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", "description": "Comma-separated names of the index templates.", "x-data-type": "array" }, @@ -8368,7 +8453,7 @@ "description": "Returns information about whether a particular index template exists.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/im-plugin/index-templates/" }, "operationId": "IndicesExistsIndexTemplate", "parameters": [ @@ -8378,7 +8463,7 @@ "description": "The name of the template.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", "description": "The name of the template." }, "required": true @@ -8446,7 +8531,7 @@ "description": "The name of the template.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", "description": "The name of the template." }, "required": true @@ -8509,7 +8594,7 @@ "description": "Creates or updates an index template.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/im-plugin/index-templates/" }, "operationId": "IndicesPutIndexTemplate_Put", "requestBody": { @@ -8529,7 +8614,7 @@ "description": "The name of the template.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", "description": "The name of the template." }, "required": true @@ -8594,7 +8679,7 @@ "description": "Returns a pipeline.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/api-reference/ingest-apis/get-ingest/" }, "operationId": "IngestGetPipeline", "parameters": [ @@ -8638,7 +8723,7 @@ "description": "Allows to simulate a pipeline with example documents.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/api-reference/ingest-apis/simulate-ingest/" }, "operationId": "IngestSimulate_Get", "parameters": [ @@ -8700,7 +8785,7 @@ "description": "Deletes a pipeline.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/api-reference/ingest-apis/delete-ingest/" }, "operationId": "IngestDeletePipeline", "parameters": [ @@ -8710,7 +8795,7 @@ "description": "Pipeline ID.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", "description": "Pipeline ID." }, "required": true @@ -8770,7 +8855,7 @@ "description": "Comma-separated list of pipeline ids. Wildcards supported.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", "description": "Comma-separated list of pipeline ids. Wildcards supported.", "x-data-type": "array" }, @@ -8814,7 +8899,7 @@ "description": "Creates or updates a pipeline.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/api-reference/ingest-apis/create-update-ingest/" }, "operationId": "IngestPutPipeline", "requestBody": { @@ -8834,7 +8919,7 @@ "description": "Pipeline ID.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", "description": "Pipeline ID." }, "required": true @@ -8896,7 +8981,7 @@ "description": "Pipeline ID.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", "description": "Pipeline ID." }, "required": true @@ -8940,7 +9025,7 @@ "description": "Pipeline ID.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", "description": "Pipeline ID." }, "required": true @@ -8987,7 +9072,7 @@ "description": "Returns mappings for one or more indices.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/field-types/index/#get-a-mapping" }, "operationId": "IndicesGetMapping", "parameters": [ @@ -9070,7 +9155,7 @@ "description": "Returns mapping for one or more fields.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/field-types/index/" }, "operationId": "IndicesGetFieldMapping", "parameters": [ @@ -9080,7 +9165,7 @@ "description": "Comma-separated list of fields.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", "description": "Comma-separated list of fields.", "x-data-type": "array" }, @@ -9146,7 +9231,7 @@ "description": "Allows to get multiple documents in one request.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/api-reference/document-apis/multi-get/" }, "operationId": "Mget_Get", "parameters": [ @@ -9374,7 +9459,7 @@ "description": "Allows to execute several search operations in one request.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/api-reference/multi-search/" }, "operationId": "Msearch_Get", "parameters": [ @@ -9552,7 +9637,7 @@ "description": "Allows to execute several search template operations in one request.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/search-plugins/search-template/" }, "operationId": "MsearchTemplate_Get", "parameters": [ @@ -9979,7 +10064,7 @@ "description": "Returns information about nodes in the cluster.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/api-reference/nodes-apis/nodes-info/" }, "operationId": "NodesInfo", "parameters": [ @@ -10177,7 +10262,7 @@ "description": "Reloads secure settings.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/api-reference/nodes-apis/nodes-reload-secure/" }, "operationId": "NodesReloadSecureSettings", "requestBody": { @@ -10216,7 +10301,7 @@ "description": "Returns statistical information about nodes in the cluster.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/api-reference/nodes-apis/nodes-usage/" }, "operationId": "NodesStats", "parameters": [ @@ -10340,7 +10425,7 @@ "description": "Limit the information returned to the specified metrics.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", "description": "Limit the information returned to the specified metrics.", "x-enum-options": [ "_all", @@ -10480,7 +10565,7 @@ "description": "Limit the information returned to the specified metrics.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", "description": "Limit the information returned to the specified metrics.", "x-enum-options": [ "_all", @@ -10506,7 +10591,7 @@ "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)", + "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", @@ -10680,7 +10765,7 @@ "description": "Limit the information returned to the specified metrics.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", "description": "Limit the information returned to the specified metrics.", "x-enum-options": [ "_all", @@ -10722,7 +10807,7 @@ "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)", + "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" @@ -10771,7 +10856,7 @@ "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)", + "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" }, @@ -10861,7 +10946,7 @@ "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)", + "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" }, @@ -10962,7 +11047,7 @@ "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)", + "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" }, @@ -11000,7 +11085,7 @@ "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)", + "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" }, @@ -11126,7 +11211,7 @@ "description": "Limit the information returned to the specified metrics.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", "description": "Limit the information returned to the specified metrics.", "x-enum-options": [ "_all", @@ -11152,7 +11237,7 @@ "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)", + "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" }, @@ -11278,7 +11363,7 @@ "description": "Limit the information returned to the specified metrics.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", "description": "Limit the information returned to the specified metrics.", "x-enum-options": [ "_all", @@ -11304,7 +11389,7 @@ "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)", + "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", @@ -11334,7 +11419,7 @@ "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)", + "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" }, @@ -11460,7 +11545,7 @@ "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)", + "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" }, @@ -11498,7 +11583,7 @@ "description": "Limit the information returned to the specified metrics.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", "description": "Limit the information returned to the specified metrics.", "x-enum-options": [ "_all", @@ -11514,7 +11599,7 @@ "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)", + "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" }, @@ -11552,7 +11637,7 @@ "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)", + "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" }, @@ -11564,7 +11649,7 @@ "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)", + "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", @@ -11612,145 +11697,207 @@ "x-version-added": "1.0" } }, - "/_plugins/_security/api/tenants/": { + "/_plugins/_security/api/account": { "get": { - "description": "Retrieves all tenants.", + "description": "Returns account details for the current user.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/2.7/security/access-control/api/#get-tenants" + "url": "https://opensearch.org/docs/latest/security/access-control/api/#get-account-details" }, - "operationId": "GetTenants", + "operationId": "GetAccountDetails", "responses": { "200": { - "description": "GetTenants 200 response", + "description": "GetAccountDetails 200 response", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetTenantsResponseContent" + "$ref": "#/components/schemas/AccountDetails" } } } } }, - "x-operation-group": "security.get_tenants", + "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": "Add, delete, or modify multiple tenants in a single call.", + "description": "Creates, updates, or deletes multiple action groups in a single call.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/2.7/security/access-control/api/#patch-tenants" + "url": "https://opensearch.org/docs/latest/security/access-control/api/#patch-action-groups" }, - "operationId": "PatchTenants", + "operationId": "PatchActionGroups", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PatchTenantsParams" + "$ref": "#/components/schemas/PatchActionGroupsInputPayload" } } } }, "responses": { "200": { - "description": "PatchTenants 200 response", + "description": "PatchActionGroups 200 response", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PatchTenantsResponseContent" + "$ref": "#/components/schemas/PatchActionGroupsResponseContent" } } } } }, - "x-operation-group": "security.patch_tenants", + "x-operation-group": "security.patch_action_groups", "x-version-added": "1.0" } }, - "/_plugins/_security/api/tenants/{tenant}": { + "/_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 the specified tenant.", + "description": "Delete a specified action group.", "externalDocs": { "description": "API Reference", "url": "https://opensearch.org/docs/latest/security/access-control/api/#delete-action-group" }, - "operationId": "DeleteTenant", + "operationId": "DeleteActionGroup", "parameters": [ { - "name": "tenant", + "name": "action_group", "in": "path", + "description": "Action group to delete.", "schema": { - "type": "string" + "type": "string", + "description": "Action group to delete." }, "required": true } ], "responses": { "200": { - "description": "DeleteTenant 200 response", + "description": "DeleteActionGroup 200 response", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DeleteTenantResponseContent" + "$ref": "#/components/schemas/DeleteActionGroupResponseContent" } } } } }, - "x-operation-group": "security.delete_tenant", + "x-operation-group": "security.delete_action_group", "x-version-added": "1.0" }, "get": { - "description": "Retrieves one tenant.", + "description": "Retrieves one action group.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/2.7/security/access-control/api/#get-tenant" + "url": "https://opensearch.org/docs/latest/security/access-control/api/#get-action-group" }, - "operationId": "GetTenant", + "operationId": "GetActionGroup", "parameters": [ { - "name": "tenant", + "name": "action_group", "in": "path", + "description": "Action group to retrieve.", "schema": { - "type": "string" + "type": "string", + "description": "Action group to retrieve." }, "required": true } ], "responses": { "200": { - "description": "GetTenant 200 response", + "description": "GetActionGroup 200 response", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetTenantResponseContent" + "$ref": "#/components/schemas/ActionGroupsMap" } } } } }, - "x-operation-group": "security.get_tenant", + "x-operation-group": "security.get_action_group", "x-version-added": "1.0" }, "patch": { - "description": "Add, delete, or modify a single tenant.", + "description": "Updates individual attributes of an action group.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/2.7/security/access-control/api/#patch-tenant" + "url": "https://opensearch.org/docs/latest/security/access-control/api/#patch-action-group" }, - "operationId": "PatchTenant", + "operationId": "PatchActionGroup", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PatchTenantParams" + "$ref": "#/components/schemas/PatchActionGroupInputPayload" } } } }, "parameters": [ { - "name": "tenant", + "name": "action_group", "in": "path", "schema": { "type": "string" @@ -11760,307 +11907,303 @@ ], "responses": { "200": { - "description": "PatchTenant 200 response", + "description": "PatchActionGroup 200 response", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PatchTenantResponseContent" + "$ref": "#/components/schemas/PatchActionGroupResponseContent" } } } } }, - "x-operation-group": "security.patch_tenant", + "x-operation-group": "security.patch_action_group", "x-version-added": "1.0" }, "put": { - "description": "Creates or replaces the specified tenant.", + "description": "Creates or replaces the specified action group.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/2.7/security/access-control/api/#create-tenant" + "url": "https://opensearch.org/docs/latest/security/access-control/api/#create-action-group" }, - "operationId": "CreateTenant", + "operationId": "CreateActionGroup", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateTenantParams" + "$ref": "#/components/schemas/Action_Group" } } } }, "parameters": [ { - "name": "tenant", + "name": "action_group", "in": "path", + "description": "The name of the action group to create or replace", "schema": { - "type": "string" + "type": "string", + "description": "The name of the action group to create or replace" }, "required": true } ], "responses": { "200": { - "description": "CreateTenant 200 response", + "description": "CreateActionGroup 200 response", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateTenantResponseContent" + "$ref": "#/components/schemas/CreateActionGroupResponseContent" } } } } }, - "x-operation-group": "security.create_tenant", + "x-operation-group": "security.create_action_group", "x-version-added": "1.0" } }, - "/_rank_eval": { + "/_plugins/_security/api/audit": { "get": { - "description": "Allows to evaluate the quality of ranked search results over a set of typical search queries.", + "description": "Retrieves the audit configuration.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/security/access-control/api/#audit-logs" }, - "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)." + "operationId": "GetAuditConfiguration", + "responses": { + "200": { + "description": "GetAuditConfiguration 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuditConfigWithReadOnly" + } + } } - }, - { - "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)." + } + }, + "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" + } } }, - { - "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" - } - } - ], + "required": true + }, "responses": { "200": { - "description": "RankEval_Get 200 response" + "description": "PatchAuditConfiguration 200 response" } }, - "x-operation-group": "rank_eval", + "x-operation-group": "security.patch_audit_configuration", "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", + } + }, + "/_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/RankEval_BodyParams" + "$ref": "#/components/schemas/AuditConfig" } } }, "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": "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": "RankEval_Post 200 response" + "description": "FlushCache 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FlushCacheResponseContent" + } + } + } } }, - "x-operation-group": "rank_eval", + "x-operation-group": "security.flush_cache", "x-version-added": "1.0" } }, - "/_recovery": { + "/_plugins/_security/api/internalusers": { "get": { - "description": "Returns information about ongoing index shard recoveries.", + "description": "Retrieve all internal users.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/security/access-control/api/#get-users" }, - "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." + "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": "IndicesRecovery 200 response" + "description": "PatchUsers 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PatchUsersResponseContent" + } + } + } } }, - "x-operation-group": "indices.recovery", + "x-operation-group": "security.patch_users", "x-version-added": "1.0" } }, - "/_refresh": { - "get": { - "description": "Performs the refresh operation in one or more indices.", - "operationId": "IndicesRefresh_Get", + "/_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": "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.", + "name": "username", + "in": "path", "schema": { - "$ref": "#/components/schemas/ExpandWildcards" - } + "type": "string" + }, + "required": true } ], "responses": { "200": { - "description": "IndicesRefresh_Get 200 response" + "description": "DeleteUser 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteUserResponseContent" + } + } + } } }, - "x-operation-group": "indices.refresh", + "x-operation-group": "security.delete_user", "x-version-added": "1.0" }, - "post": { - "description": "Performs the refresh operation in one or more indices.", + "get": { + "description": "Retrieve one internal user.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/security/access-control/api/#get-user" }, - "operationId": "IndicesRefresh_Post", + "operationId": "GetUser", "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.", + "name": "username", + "in": "path", "schema": { - "$ref": "#/components/schemas/ExpandWildcards" - } + "type": "string" + }, + "required": true } ], "responses": { "200": { - "description": "IndicesRefresh_Post 200 response" + "description": "GetUser 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UsersMap" + } + } + } } }, - "x-operation-group": "indices.refresh", + "x-operation-group": "security.get_user", "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.", + }, + "patch": { + "description": "Updates individual attributes of an internal user.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/security/access-control/api/#patch-user" }, - "operationId": "Reindex", + "operationId": "PatchUser", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Reindex_BodyParams" + "$ref": "#/components/schemas/PatchUserInputPayload" } } }, @@ -12068,574 +12211,408 @@ }, "parameters": [ { - "name": "refresh", - "in": "query", - "description": "Should the affected indexes be refreshed?.", + "name": "username", + "in": "path", "schema": { - "type": "boolean", - "description": "Should the affected indexes be refreshed?." + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "PatchUser 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PatchUserResponseContent" + } + } } - }, - { - "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-operation-group": "security.patch_user", "x-version-added": "1.0" - } - }, - "/_reindex/{task_id}/_rethrottle": { - "post": { - "description": "Changes the number of requests per second for a particular Reindex operation.", + }, + "put": { + "description": "Creates or replaces the specified user.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "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 }, - "operationId": "ReindexRethrottle", "parameters": [ { - "name": "task_id", + "name": "username", "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" + "type": "string" }, "required": true } ], "responses": { "200": { - "description": "ReindexRethrottle 200 response" + "description": "CreateUser 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateUserResponseContent" + } + } + } } }, - "x-operation-group": "reindex_rethrottle", + "x-operation-group": "security.create_user", "x-version-added": "1.0" } }, - "/_remote/info": { + "/_plugins/_security/api/nodesdn": { "get": { - "description": "Returns the information about configured remote clusters.", + "description": "Retrieves all distinguished names in the allow list.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/security/access-control/api/#get-distinguished-names" }, - "operationId": "ClusterRemoteInfo", + "operationId": "GetDistinguishedNames", "responses": { "200": { - "description": "ClusterRemoteInfo 200 response" + "description": "GetDistinguishedNames 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DistinguishedNamesMap" + } + } + } } }, - "x-operation-group": "cluster.remote_info", + "x-operation-group": "security.get_distinguished_names", "x-version-added": "1.0" - } - }, - "/_remotestore/_restore": { - "post": { - "description": "Restores from remote store.", + }, + "patch": { + "description": "Bulk update of distinguished names.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest/opensearch/remote/#restoring-from-a-backup" + "url": "https://opensearch.org/docs/latest/security/access-control/api/#update-all-distinguished-names" }, - "operationId": "RemoteStoreRestore", + "operationId": "PatchDistinguishedNames", "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" - ] - } - } + "$ref": "#/components/schemas/PatchDistinguishedNamesInputPayload" } } }, "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-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", + "description": "PatchDistinguishedNames 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 - } - } - } - } + "$ref": "#/components/schemas/PatchDistinguishedNamesResponseContent" } } } } }, - "x-operation-group": "remote_store.restore", + "x-operation-group": "security.patch_distinguished_names", "x-version-added": "1.0" } }, - "/_render/template": { - "get": { - "description": "Allows to use the Mustache language to pre-render a search definition.", + "/_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" + "url": "https://opensearch.org/docs/latest/security/access-control/api/#delete-distinguished-names" }, - "operationId": "RenderSearchTemplate_Get", + "operationId": "DeleteDistinguishedNames", + "parameters": [ + { + "name": "cluster_name", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + } + ], "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" + "description": "DeleteDistinguishedNames 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteDistinguishedNamesResponseContent" + } } } } }, - "responses": { - "200": { - "description": "RenderSearchTemplate_Post 200 response" - } - }, - "x-operation-group": "render_search_template", + "x-operation-group": "security.delete_distinguished_names", "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", + "description": "Retrieve distinguished names of a specified cluster.", + "operationId": "GetDistinguishedNamesWithClusterName", "parameters": [ { - "name": "id", + "name": "cluster_name", "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." + "type": "string" }, "required": true } ], "responses": { "200": { - "description": "RenderSearchTemplate_Get_WithId 200 response" + "description": "GetDistinguishedNamesWithClusterName 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DistinguishedNamesMap" + } + } + } } }, - "x-operation-group": "render_search_template", + "x-operation-group": "security.get_distinguished_names", "x-version-added": "1.0" }, - "post": { - "description": "Allows to use the Mustache language to pre-render a search definition.", - "operationId": "RenderSearchTemplate_Post_WithId", + "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/RenderSearchTemplate_BodyParams" + "$ref": "#/components/schemas/DistinguishedNames" } } } }, "parameters": [ { - "name": "id", + "name": "cluster_name", "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." + "type": "string" }, "required": true } ], "responses": { "200": { - "description": "RenderSearchTemplate_Post_WithId 200 response" + "description": "UpdateDistinguishedNames 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateDistinguishedNamesResponseContent" + } + } + } } }, - "x-operation-group": "render_search_template", + "x-operation-group": "security.update_distinguished_names", "x-version-added": "1.0" } }, - "/_resolve/index/{name}": { - "get": { - "description": "Returns information about any matching indices, aliases, and data streams.", + "/_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" + "url": "https://opensearch.org/docs/latest/security/access-control/api/#patch-roles" }, - "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" + "operationId": "PatchRoles", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PatchRolesInputPayload" + } } - } - ], - "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" + }, + "required": true }, - "operationId": "GetScriptContext", "responses": { "200": { - "description": "GetScriptContext 200 response" + "description": "PatchRoles 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PatchRolesResponseContent" + } + } + } } }, - "x-operation-group": "get_script_context", + "x-operation-group": "security.patch_roles", "x-version-added": "1.0" } }, - "/_script_language": { + "/_plugins/_security/api/roles/": { "get": { - "description": "Returns available script types, languages and contexts.", + "description": "Retrieves all roles.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/security/access-control/api/#get-roles" }, - "operationId": "GetScriptLanguages", + "operationId": "GetRoles", "responses": { "200": { - "description": "GetScriptLanguages 200 response" + "description": "GetRoles 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RolesMap" + } + } + } } }, - "x-operation-group": "get_script_languages", + "x-operation-group": "security.get_roles", "x-version-added": "1.0" } }, - "/_scripts/painless/_execute": { - "get": { - "description": "Allows an arbitrary script to be executed and a result to be returned.", + "/_plugins/_security/api/roles/{role}": { + "delete": { + "description": "Delete the specified role.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/security/access-control/api/#delete-role" }, - "operationId": "ScriptsPainlessExecute_Get", + "operationId": "DeleteRole", + "parameters": [ + { + "name": "role", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + } + ], "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" + "description": "DeleteRole 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteRoleResponseContent" + } } } } }, - "responses": { - "200": { - "description": "ScriptsPainlessExecute_Post 200 response" - } - }, - "x-operation-group": "scripts_painless_execute", + "x-operation-group": "security.delete_role", "x-version-added": "1.0" - } - }, - "/_scripts/{id}": { - "delete": { - "description": "Deletes a script.", + }, + "get": { + "description": "Retrieves one role.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/security/access-control/api/#get-role" }, - "operationId": "DeleteScript", + "operationId": "GetRole", "parameters": [ { - "name": "id", + "name": "role", "in": "path", - "description": "Script ID.", "schema": { - "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", - "description": "Script ID." + "type": "string" }, "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-data-type": "time" - } } ], "responses": { "200": { - "description": "DeleteScript 200 response" + "description": "GetRole 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RolesMap" + } + } + } } }, - "x-operation-group": "delete_script", + "x-operation-group": "security.get_role", "x-version-added": "1.0" }, - "get": { - "description": "Returns a script.", + "patch": { + "description": "Updates individual attributes of a role.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "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 }, - "operationId": "GetScript", "parameters": [ { - "name": "id", + "name": "role", "in": "path", - "description": "Script ID.", "schema": { - "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", - "description": "Script ID." + "type": "string" }, "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-data-type": "time" - } } ], "responses": { "200": { - "description": "GetScript 200 response" + "description": "PatchRole 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PatchRoleResponseContent" + } + } + } } }, - "x-operation-group": "get_script", + "x-operation-group": "security.patch_role", "x-version-added": "1.0" }, - "post": { - "description": "Creates or updates a script.", - "operationId": "PutScript_Post", + "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/PutScript_BodyParams" + "$ref": "#/components/schemas/Role" } } }, @@ -12643,145 +12620,163 @@ }, "parameters": [ { - "name": "id", + "name": "role", "in": "path", - "description": "Script ID.", "schema": { - "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", - "description": "Script ID." + "type": "string" }, "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-data-type": "time" - } } ], "responses": { "200": { - "description": "PutScript_Post 200 response" + "description": "CreateRole 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateRoleResponseContent" + } + } + } } }, - "x-operation-group": "put_script", + "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" }, - "put": { - "description": "Creates or updates a script.", + "patch": { + "description": "Creates or updates multiple role mappings in a single call.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/security/access-control/api/#patch-role-mappings" }, - "operationId": "PutScript_Put", + "operationId": "PatchRoleMappings", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PutScript_BodyParams" + "$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": "id", + "name": "role", "in": "path", - "description": "Script ID.", "schema": { - "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", - "description": "Script ID." + "type": "string" }, "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 + } + ], + "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": "cluster_manager_timeout", - "in": "query", - "description": "Operation timeout for connection to cluster-manager node.", + "name": "role", + "in": "path", "schema": { - "type": "string", - "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", - "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" - } + "type": "string" + }, + "required": true } ], "responses": { "200": { - "description": "PutScript_Put 200 response" + "description": "GetRoleMapping 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RoleMappings" + } + } + } } }, - "x-operation-group": "put_script", + "x-operation-group": "security.get_role_mapping", "x-version-added": "1.0" - } - }, - "/_scripts/{id}/{context}": { - "post": { - "description": "Creates or updates a script.", - "operationId": "PutScript_Post_WithContext", + }, + "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/PutScript_BodyParams" + "$ref": "#/components/schemas/PatchRoleMappingInputPayload" } } }, @@ -12789,80 +12784,41 @@ }, "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", + "name": "role", "in": "path", - "description": "Script context.", "schema": { - "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", - "description": "Script context." + "type": "string" }, "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-data-type": "time" - } } ], "responses": { "200": { - "description": "PutScript_Post_WithContext 200 response" + "description": "PatchRoleMapping 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PatchRoleMappingResponseContent" + } + } + } } }, - "x-operation-group": "put_script", + "x-operation-group": "security.patch_role_mapping", "x-version-added": "1.0" }, "put": { - "description": "Creates or updates a script.", - "operationId": "PutScript_Put_WithContext", + "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/PutScript_BodyParams" + "$ref": "#/components/schemas/RoleMapping" } } }, @@ -12870,262 +12826,454 @@ }, "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", + "name": "role", "in": "path", - "description": "Script context.", "schema": { - "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", - "description": "Script context." + "type": "string" }, "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-data-type": "time" - } } ], "responses": { "200": { - "description": "PutScript_Put_WithContext 200 response" + "description": "CreateRoleMapping 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateRoleMappingResponseContent" + } + } + } } }, - "x-operation-group": "put_script", + "x-operation-group": "security.create_role_mapping", "x-version-added": "1.0" } }, - "/_search": { + "/_plugins/_security/api/securityconfig": { "get": { - "description": "Returns results matching a query.", + "description": "Returns the current Security plugin configuration in JSON format.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest/api-reference/search/" + "url": "https://opensearch.org/docs/2.7/security/access-control/api/#get-configuration" }, - "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." + "operationId": "GetConfiguration", + "responses": { + "200": { + "description": "GetConfiguration 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DynamicConfig" + } + } } - }, - { - "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." + } + }, + "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" + } } }, - { - "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." + "required": true + }, + "responses": { + "200": { + "description": "PatchConfiguration 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PatchConfigurationResponseContent" + } + } } - }, - { - "name": "default_operator", - "in": "query", - "description": "The default operator for query string query (AND or OR).", - "schema": { - "$ref": "#/components/schemas/DefaultOperator" + } + }, + "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" + } } }, - { - "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." + "required": true + }, + "responses": { + "200": { + "description": "UpdateConfiguration 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateConfigurationResponseContent" + } + } } - }, - { - "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." + } + }, + "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" + } + } } - }, - { - "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" + } + }, + "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" + } + } } - }, - { - "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)." + } + }, + "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" + } + } } - }, - { - "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." + } + }, + "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" + } + } } - }, - { - "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)." + } + }, + "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": "expand_wildcards", - "in": "query", - "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "name": "tenant", + "in": "path", "schema": { - "$ref": "#/components/schemas/ExpandWildcards" + "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": "lenient", - "in": "query", - "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored.", + "name": "tenant", + "in": "path", "schema": { - "type": "boolean", - "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored." + "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": "preference", - "in": "query", - "description": "Specify the node or shard the operation should be performed on.", + "name": "tenant", + "in": "path", "schema": { - "type": "string", - "default": "random", - "description": "Specify the node or shard the operation should be performed on." + "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" + } + } + } + }, + "parameters": [ { - "name": "q", + "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": "Query in the Lucene query string syntax.", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", "schema": { - "type": "string", - "description": "Query in the Lucene query string syntax." + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." } }, { - "name": "routing", + "name": "allow_no_indices", "in": "query", - "description": "Comma-separated list of specific routing values.", - "style": "form", + "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": "array", - "items": { - "type": "string" - }, - "description": "Comma-separated list of specific routing values." - }, - "explode": true + "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": "scroll", + "name": "expand_wildcards", "in": "query", - "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", "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" + "$ref": "#/components/schemas/ExpandWildcards" } }, { @@ -13135,618 +13283,1040 @@ "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" + } + ], + "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": "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", + "name": "ignore_unavailable", "in": "query", - "description": "True or false to return the _source field or not, or a list of fields to return.", - "style": "form", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", "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 + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } }, { - "name": "_source_excludes", + "name": "allow_no_indices", "in": "query", - "description": "List of fields to exclude from the returned _source field.", - "style": "form", + "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": "array", - "items": { - "type": "string" - }, - "description": "List of fields to exclude from the returned _source field." - }, - "explode": true + "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": "_source_includes", + "name": "expand_wildcards", "in": "query", - "description": "List of fields to extract and return from the _source field.", - "style": "form", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of fields to extract and return from the _source field." - }, - "explode": true + "$ref": "#/components/schemas/ExpandWildcards" + } }, { - "name": "terminate_after", + "name": "search_type", "in": "query", - "description": "The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.", + "description": "Search operation type.", "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" + "$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": "stats", + "name": "detailed", "in": "query", - "description": "Specific 'tag' of the request for logging and statistical purposes.", - "style": "form", + "description": "Whether to display detailed information about shard recovery.", "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Specific 'tag' of the request for logging and statistical purposes." - }, - "explode": true + "type": "boolean", + "default": false, + "description": "Whether to display detailed information about shard recovery." + } }, { - "name": "suggest_field", + "name": "active_only", "in": "query", - "description": "Specify which field to use for suggestions.", + "description": "Display only those recoveries that are currently on-going.", "schema": { - "type": "string", - "description": "Specify which field to use for suggestions." + "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": "suggest_mode", + "name": "ignore_unavailable", "in": "query", - "description": "Specify suggest mode.", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", "schema": { - "$ref": "#/components/schemas/SuggestMode" + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." } }, { - "name": "suggest_size", + "name": "allow_no_indices", "in": "query", - "description": "How many suggestions to return in response.", + "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": "integer", - "description": "How many suggestions to return in response.", - "format": "int32" + "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": "suggest_text", + "name": "expand_wildcards", "in": "query", - "description": "The source text for which the suggestions should be returned.", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", "schema": { - "type": "string", - "description": "The source text for which the suggestions should be returned." + "$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": "timeout", + "name": "ignore_unavailable", "in": "query", - "description": "Operation timeout.", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", "schema": { - "type": "string", - "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", - "description": "Operation timeout.", - "x-data-type": "time" + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." } }, { - "name": "track_scores", + "name": "allow_no_indices", "in": "query", - "description": "Whether to calculate and return scores even if they are not used for sorting.", + "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 calculate and return scores even if they are not used for sorting." + "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": "track_total_hits", + "name": "expand_wildcards", "in": "query", - "description": "Indicate if the number of documents that match the query should be tracked.", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", "schema": { - "type": "boolean", - "description": "Indicate if the number of documents that match the query should be tracked." + "$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": "allow_partial_search_results", + "name": "refresh", "in": "query", - "description": "Indicate if an error should be returned if there is a partial search failure or timeout.", + "description": "Should the affected indexes be refreshed?.", "schema": { "type": "boolean", - "default": true, - "description": "Indicate if an error should be returned if there is a partial search failure or timeout." + "description": "Should the affected indexes be refreshed?." } }, { - "name": "typed_keys", + "name": "timeout", "in": "query", - "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response.", + "description": "Time each individual bulk request should wait for shards that are unavailable.", "schema": { - "type": "boolean", - "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response." + "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": "version", + "name": "wait_for_active_shards", "in": "query", - "description": "Whether to return document version as part of a hit.", + "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": "boolean", - "description": "Whether to return document version as part of a hit." + "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": "seq_no_primary_term", + "name": "wait_for_completion", "in": "query", - "description": "Specify whether to return sequence number and primary term of the last modification of each hit.", + "description": "Should this request wait until the operation has completed before returning.", "schema": { "type": "boolean", - "description": "Specify whether to return sequence number and primary term of the last modification of each hit." + "default": true, + "description": "Should this request wait until the operation has completed before returning." } }, { - "name": "request_cache", + "name": "requests_per_second", "in": "query", - "description": "Specify if request cache should be used for this request or not, defaults to index level setting.", + "description": "The throttle for this request in sub-requests per second. -1 means no throttle.", "schema": { - "type": "boolean", - "description": "Specify if request cache should be used for this request or not, defaults to index level setting." + "type": "integer", + "default": 0, + "description": "The throttle for this request in sub-requests per second. -1 means no throttle.", + "format": "int32" } }, { - "name": "batched_reduce_size", + "name": "scroll", "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.", + "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", "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" + "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": "max_concurrent_shard_requests", + "name": "slices", "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.", + "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": "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" + "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": "pre_filter_shard_size", + "name": "max_docs", "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.", + "description": "Maximum number of documents to process (default: all documents).", "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.", + "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": "rest_total_hits_as_int", + "name": "requests_per_second", "in": "query", - "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response.", + "description": "The throttle for this request in sub-requests per second. -1 means no throttle.", "schema": { - "type": "boolean", - "default": false, - "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response." - } + "type": "integer", + "description": "The throttle for this request in sub-requests per second. -1 means no throttle.", + "format": "int32" + }, + "required": true } ], "responses": { "200": { - "description": "Search_Get 200 response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Search_GetResponseContent" - } - } - } + "description": "ReindexRethrottle 200 response" } }, - "x-operation-group": "search", + "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": "Returns results matching a query.", - "operationId": "Search_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/Search_BodyParams" + "$ref": "#/components/schemas/RemoteStoreRestore_BodyParams" }, "examples": { - "Search_Post_example1": { - "summary": "Examples for Post Search Operation.", + "RemoteStoreRestore_example1": { + "summary": "Examples for Post Remote Storage Restore Operation.", "description": "", "value": { - "query": { - "match_all": {} - }, - "fields": [ - "*" + "indices": [ + "books" ] } } } } - } + }, + "required": true }, "parameters": [ { - "name": "analyzer", + "name": "cluster_manager_timeout", "in": "query", - "description": "The analyzer to use for the query string.", + "description": "Operation timeout for connection to cluster-manager node.", "schema": { "type": "string", - "description": "The analyzer to use for the query string." + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-data-type": "time" } }, { - "name": "analyze_wildcard", + "name": "wait_for_completion", "in": "query", - "description": "Specify whether wildcard and prefix queries should be analyzed.", + "description": "Should this request wait until the operation has completed before returning.", "schema": { "type": "boolean", "default": false, - "description": "Specify whether wildcard and prefix queries should be analyzed." + "description": "Should this request wait until the operation has completed before returning." } - }, - { - "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": "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 + } + } + } + } + } + } } - }, - { - "name": "default_operator", - "in": "query", - "description": "The default operator for query string query (AND or OR).", - "schema": { - "$ref": "#/components/schemas/DefaultOperator" + } + }, + "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" + } } - }, - { - "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." - } - }, + } + }, + "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": "explain", - "in": "query", - "description": "Specify whether to return detailed information about score computation as part of a hit.", + "name": "id", + "in": "path", + "description": "The id of the stored search template.", "schema": { - "type": "boolean", - "description": "Specify whether to return detailed information about score computation as part of a hit." + "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": "stored_fields", - "in": "query", - "description": "Comma-separated list of stored fields to return.", - "style": "form", + "name": "id", + "in": "path", + "description": "The id of the stored search template.", "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Comma-separated list of stored fields to return." + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The id of the stored search template." }, - "explode": true - }, + "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": "docvalue_fields", - "in": "query", - "description": "Comma-separated list of fields to return as the docvalue representation of a field for each hit.", - "style": "form", + "name": "name", + "in": "path", + "description": "Comma-separated list of names or wildcard expressions.", "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Comma-separated list of fields to return as the docvalue representation of a field for each hit." + "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" }, - "explode": true + "required": true }, { - "name": "from", + "name": "expand_wildcards", "in": "query", - "description": "Starting offset.", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", "schema": { - "type": "integer", - "default": 0, - "description": "Starting offset.", - "format": "int32" + "$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)." + } + ], + "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": "ignore_throttled", - "in": "query", - "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled.", + "name": "id", + "in": "path", + "description": "Script ID.", "schema": { - "type": "boolean", - "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled." - } + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Script ID." + }, + "required": true }, { - "name": "allow_no_indices", + "name": "timeout", "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).", + "description": "Operation timeout.", "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)." + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" } }, { - "name": "expand_wildcards", + "name": "master_timeout", "in": "query", - "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "description": "Operation timeout for connection to master node.", "schema": { - "$ref": "#/components/schemas/ExpandWildcards" + "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": "lenient", + "name": "cluster_manager_timeout", "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.", + "description": "Operation timeout for connection to cluster-manager node.", "schema": { "type": "string", - "default": "random", - "description": "Specify the node or shard the operation should be performed on." + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "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": "q", - "in": "query", - "description": "Query in the Lucene query string syntax.", + "name": "id", + "in": "path", + "description": "Script ID.", "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." + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Script ID." }, - "explode": true + "required": true }, { - "name": "scroll", + "name": "master_timeout", "in": "query", - "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", + "description": "Operation timeout for connection to master node.", "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" - } + "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": "search_type", + "name": "cluster_manager_timeout", "in": "query", - "description": "Search operation type.", + "description": "Operation timeout for connection to cluster-manager node.", "schema": { - "$ref": "#/components/schemas/SearchType" + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-data-type": "time" } - }, - { - "name": "size", - "in": "query", - "description": "Number of hits to return.", - "schema": { - "type": "integer", - "default": 10, - "description": "Number of hits to return.", - "format": "int32" + } + ], + "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": "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", + "name": "id", + "in": "path", + "description": "Script ID.", "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "True or false to return the _source field or not, or a list of fields to return." + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Script ID." }, - "explode": true + "required": true }, { - "name": "_source_excludes", + "name": "timeout", "in": "query", - "description": "List of fields to exclude from the returned _source field.", - "style": "form", + "description": "Operation timeout.", "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of fields to exclude from the returned _source field." - }, - "explode": true + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } }, { - "name": "_source_includes", + "name": "master_timeout", "in": "query", - "description": "List of fields to extract and return from the _source field.", - "style": "form", + "description": "Operation timeout for connection to master node.", "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of fields to extract and return from the _source field." - }, - "explode": true + "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": "terminate_after", + "name": "cluster_manager_timeout", "in": "query", - "description": "The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.", + "description": "Operation timeout for connection to cluster-manager node.", "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" + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "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": "stats", - "in": "query", - "description": "Specific 'tag' of the request for logging and statistical purposes.", - "style": "form", + "name": "id", + "in": "path", + "description": "Script ID.", "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Specific 'tag' of the request for logging and statistical purposes." + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Script ID." }, - "explode": true + "required": true }, { - "name": "suggest_field", + "name": "timeout", "in": "query", - "description": "Specify which field to use for suggestions.", + "description": "Operation timeout.", "schema": { "type": "string", - "description": "Specify which field to use for suggestions." + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" } }, { - "name": "suggest_mode", + "name": "master_timeout", "in": "query", - "description": "Specify suggest mode.", + "description": "Operation timeout for connection to master node.", "schema": { - "$ref": "#/components/schemas/SuggestMode" + "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": "suggest_size", + "name": "cluster_manager_timeout", "in": "query", - "description": "How many suggestions to return in response.", + "description": "Operation timeout for connection to cluster-manager node.", "schema": { - "type": "integer", - "description": "How many suggestions to return in response.", - "format": "int32" + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "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": "suggest_text", + "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": "The source text for which the suggestions should be returned.", + "description": "Operation timeout.", "schema": { "type": "string", - "description": "The source text for which the suggestions should be returned." + "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-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", @@ -13759,294 +14329,220 @@ } }, { - "name": "track_scores", + "name": "master_timeout", "in": "query", - "description": "Whether to calculate and return scores even if they are not used for sorting.", + "description": "Operation timeout for connection to master node.", "schema": { - "type": "boolean", - "description": "Whether to calculate and return scores even if they are not used for sorting." + "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": "track_total_hits", + "name": "cluster_manager_timeout", "in": "query", - "description": "Indicate if the number of documents that match the query should be tracked.", + "description": "Operation timeout for connection to cluster-manager node.", "schema": { - "type": "boolean", - "description": "Indicate if the number of documents that match the query should be tracked." + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "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": "allow_partial_search_results", + "name": "analyze_wildcard", "in": "query", - "description": "Indicate if an error should be returned if there is a partial search failure or timeout.", + "description": "Specify whether wildcard and prefix queries should be analyzed.", "schema": { "type": "boolean", - "default": true, - "description": "Indicate if an error should be returned if there is a partial search failure or timeout." + "default": false, + "description": "Specify whether wildcard and prefix queries should be analyzed." } }, { - "name": "typed_keys", + "name": "ccs_minimize_roundtrips", "in": "query", - "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response.", + "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution.", "schema": { "type": "boolean", - "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response." + "default": true, + "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution." } }, { - "name": "version", + "name": "default_operator", "in": "query", - "description": "Whether to return document version as part of a hit.", + "description": "The default operator for query string query (AND or OR).", "schema": { - "type": "boolean", - "description": "Whether to return document version as part of a hit." + "$ref": "#/components/schemas/DefaultOperator" } }, { - "name": "seq_no_primary_term", + "name": "df", "in": "query", - "description": "Specify whether to return sequence number and primary term of the last modification of each hit.", + "description": "The field to use as default where no field prefix is given in the query string.", "schema": { - "type": "boolean", - "description": "Specify whether to return sequence number and primary term of the last modification of each hit." + "type": "string", + "description": "The field to use as default where no field prefix is given in the query string." } }, { - "name": "request_cache", + "name": "explain", "in": "query", - "description": "Specify if request cache should be used for this request or not, defaults to index level setting.", + "description": "Specify whether to return detailed information about score computation as part of a hit.", "schema": { "type": "boolean", - "description": "Specify if request cache should be used for this request or not, defaults to index level setting." + "description": "Specify whether to return detailed information about score computation as part of a hit." } }, { - "name": "batched_reduce_size", + "name": "stored_fields", "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.", + "description": "Comma-separated list of stored fields to return.", + "style": "form", "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" - } + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of stored fields to return." + }, + "explode": true }, { - "name": "max_concurrent_shard_requests", + "name": "docvalue_fields", "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.", + "description": "Comma-separated list of fields to return as the docvalue representation of a field for each hit.", + "style": "form", "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" - } + "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": "pre_filter_shard_size", + "name": "from", "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.", + "description": "Starting offset.", "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.", + "default": 0, + "description": "Starting offset.", "format": "int32" } }, { - "name": "rest_total_hits_as_int", + "name": "ignore_unavailable", "in": "query", - "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response.", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", "schema": { "type": "boolean", - "default": false, - "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response." + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." } - } - ], - "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": [] - } - } - } - } - } + }, + { + "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." } - } - }, - "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" - }, - "operationId": "DeletePit", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DeletePit_BodyParams" - } + }, + { + "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)." } }, - "required": true - }, - "responses": { - "200": { - "description": "DeletePit 200 response" - } - }, - "x-operation-group": "delete_pit", - "x-version-added": "1.0" - } - }, - "/_search/point_in_time/_all": { - "delete": { - "description": "Deletes all active point in time searches.", - "externalDocs": { - "description": "API Reference", - "url": "https://opensearch.org/docs/latest" - }, - "operationId": "DeleteAllPits", - "responses": { - "200": { - "description": "DeleteAllPits 200 response" - } - }, - "x-operation-group": "delete_all_pits", - "x-version-added": "1.0" - }, - "get": { - "description": "Lists all active point in time searches.", - "externalDocs": { - "description": "API Reference", - "url": "https://opensearch.org/docs/latest" - }, - "operationId": "GetAllPits", - "responses": { - "200": { - "description": "GetAllPits 200 response" - } - }, - "x-operation-group": "get_all_pits", - "x-version-added": "1.0" - } - }, - "/_search/scroll": { - "delete": { - "description": "Explicitly clears the search context for a scroll.", - "externalDocs": { - "description": "API Reference", - "url": "https://opensearch.org/docs/latest" - }, - "operationId": "ClearScroll", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ClearScroll_BodyParams" - } + { + "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": "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" - }, - "operationId": "Scroll_Get", - "parameters": [ + }, { - "name": "scroll", + "name": "lenient", "in": "query", - "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", + "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored.", "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" + "type": "boolean", + "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored." } }, { - "name": "scroll_id", + "name": "preference", "in": "query", - "description": "Scroll ID.", + "description": "Specify the node or shard the operation should be performed on.", "schema": { "type": "string", - "description": "Scroll ID." + "default": "random", + "description": "Specify the node or shard the operation should be performed on." } }, { - "name": "rest_total_hits_as_int", + "name": "q", "in": "query", - "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response.", + "description": "Query in the Lucene query string syntax.", "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" - } + "type": "string", + "description": "Query in the Lucene query string syntax." } - } - }, - "parameters": [ + }, + { + "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", @@ -14059,309 +14555,245 @@ } }, { - "name": "scroll_id", + "name": "search_type", "in": "query", - "description": "Scroll ID.", + "description": "Search operation type.", "schema": { - "type": "string", - "description": "Scroll ID." + "$ref": "#/components/schemas/SearchType" } }, { - "name": "rest_total_hits_as_int", + "name": "size", "in": "query", - "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response.", + "description": "Number of hits to return.", "schema": { - "type": "boolean", - "default": false, - "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response." + "type": "integer", + "default": 10, + "description": "Number of hits to return.", + "format": "int32" } - } - ], - "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.", + "name": "sort", + "in": "query", + "description": "Comma-separated list of : pairs.", + "style": "form", "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" + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of : pairs." }, - "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": [ + "explode": true + }, { - "name": "scroll_id", - "in": "path", - "description": "Scroll ID.", + "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": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", - "description": "Scroll ID." + "type": "array", + "items": { + "type": "string" + }, + "description": "True or false to return the _source field or not, or a list of fields to return." }, - "required": true + "explode": true }, { - "name": "scroll", + "name": "_source_excludes", "in": "query", - "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", + "description": "List of fields to exclude from the returned _source field.", + "style": "form", "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" + "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": "scroll_id", + "name": "stats", "in": "query", - "description": "Scroll ID.", + "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": "Scroll ID." + "description": "Specify which field to use for suggestions." } }, { - "name": "rest_total_hits_as_int", + "name": "suggest_mode", "in": "query", - "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response.", + "description": "Specify suggest mode.", "schema": { - "type": "boolean", - "default": false, - "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response." + "$ref": "#/components/schemas/SuggestMode" } - } - ], - "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" - } + }, + { + "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" } - } - }, - "deprecated": true, - "parameters": [ + }, { - "name": "scroll_id", - "in": "path", - "description": "Scroll ID.", + "name": "suggest_text", + "in": "query", + "description": "The source text for which the suggestions should be returned.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", - "description": "Scroll ID." - }, - "required": true + "description": "The source text for which the suggestions should be returned." + } }, { - "name": "scroll", + "name": "timeout", "in": "query", - "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", + "description": "Operation timeout.", "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.", + "description": "Operation timeout.", "x-data-type": "time" } }, { - "name": "scroll_id", + "name": "track_scores", "in": "query", - "description": "Scroll ID.", + "description": "Whether to calculate and return scores even if they are not used for sorting.", "schema": { - "type": "string", - "description": "Scroll ID." + "type": "boolean", + "description": "Whether to calculate and return scores even if they are not used for sorting." } }, { - "name": "rest_total_hits_as_int", + "name": "track_total_hits", "in": "query", - "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response.", + "description": "Indicate if the number of documents that match the query should be tracked.", "schema": { "type": "boolean", - "default": false, - "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response." + "description": "Indicate if the number of documents that match the query should be tracked." } - } - ], - "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" - }, - "operationId": "SearchTemplate_Get", - "parameters": [ + }, { - "name": "ignore_unavailable", + "name": "allow_partial_search_results", "in": "query", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "description": "Indicate if an error should be returned if there is a partial search failure or timeout.", "schema": { "type": "boolean", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + "default": true, + "description": "Indicate if an error should be returned if there is a partial search failure or timeout." } }, { - "name": "ignore_throttled", + "name": "typed_keys", "in": "query", - "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled.", + "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response.", "schema": { "type": "boolean", - "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled." + "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response." } }, { - "name": "allow_no_indices", + "name": "version", "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).", + "description": "Whether to return document version as part of a hit.", "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)." + "description": "Whether to return document version as part of a hit." } }, { - "name": "expand_wildcards", + "name": "seq_no_primary_term", "in": "query", - "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "description": "Specify whether to return sequence number and primary term of the last modification of each hit.", "schema": { - "$ref": "#/components/schemas/ExpandWildcards" + "type": "boolean", + "description": "Specify whether to return sequence number and primary term of the last modification of each hit." } }, { - "name": "preference", + "name": "request_cache", "in": "query", - "description": "Specify the node or shard the operation should be performed on.", + "description": "Specify if request cache should be used for this request or not, defaults to index level setting.", "schema": { - "type": "string", - "default": "random", - "description": "Specify the node or shard the operation should be performed on." + "type": "boolean", + "description": "Specify if request cache should be used for this request or not, defaults to index level setting." } }, { - "name": "routing", + "name": "batched_reduce_size", "in": "query", - "description": "Comma-separated list of specific routing values.", - "style": "form", + "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": "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." + "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": "profile", + "name": "max_concurrent_shard_requests", "in": "query", - "description": "Specify whether to profile the query execution.", + "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": "boolean", - "description": "Specify whether to profile the query execution." + "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": "typed_keys", + "name": "pre_filter_shard_size", "in": "query", - "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response.", + "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": "boolean", - "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response." + "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" } }, { @@ -14373,184 +14805,188 @@ "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" + "description": "Search_Get 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Search_GetResponseContent" + } + } + } } }, - "x-operation-group": "search_template", + "x-operation-group": "search", "x-version-added": "1.0" }, "post": { - "description": "Allows to use the Mustache language to pre-render a search definition.", - "operationId": "SearchTemplate_Post", + "description": "Returns results matching a query.", + "operationId": "Search_Post", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SearchTemplate_BodyParams" + "$ref": "#/components/schemas/Search_BodyParams" + }, + "examples": { + "Search_Post_example1": { + "summary": "Examples for Post Search Operation.", + "description": "", + "value": { + "query": { + "match_all": {} + }, + "fields": [ + "*" + ] + } + } } } - }, - "required": true + } }, "parameters": [ { - "name": "ignore_unavailable", + "name": "analyzer", "in": "query", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "description": "The analyzer to use for the query string.", "schema": { - "type": "boolean", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + "type": "string", + "description": "The analyzer to use for the query string." } }, { - "name": "ignore_throttled", + "name": "analyze_wildcard", "in": "query", - "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled.", + "description": "Specify whether wildcard and prefix queries should be analyzed.", "schema": { "type": "boolean", - "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled." + "default": false, + "description": "Specify whether wildcard and prefix queries should be analyzed." } }, { - "name": "allow_no_indices", + "name": "ccs_minimize_roundtrips", "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).", + "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution.", "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)." + "default": true, + "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution." } }, { - "name": "expand_wildcards", + "name": "default_operator", "in": "query", - "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "description": "The default operator for query string query (AND or OR).", "schema": { - "$ref": "#/components/schemas/ExpandWildcards" + "$ref": "#/components/schemas/DefaultOperator" } }, { - "name": "preference", + "name": "df", "in": "query", - "description": "Specify the node or shard the operation should be performed on.", + "description": "The field to use as default where no field prefix is given in the query string.", "schema": { "type": "string", - "default": "random", - "description": "Specify the node or shard the operation should be performed on." + "description": "The field to use as default where no field prefix is given in the query string." } }, { - "name": "routing", + "name": "explain", "in": "query", - "description": "Comma-separated list of specific routing values.", + "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 specific routing values." + "description": "Comma-separated list of stored fields to return." }, "explode": true }, { - "name": "scroll", + "name": "docvalue_fields", "in": "query", - "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", + "description": "Comma-separated list of fields to return as the docvalue representation of a field for each hit.", + "style": "form", "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" - } + "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": "search_type", + "name": "from", "in": "query", - "description": "Search operation type.", + "description": "Starting offset.", "schema": { - "$ref": "#/components/schemas/SearchTypeMulti" + "type": "integer", + "default": 0, + "description": "Starting offset.", + "format": "int32" } }, { - "name": "explain", + "name": "ignore_unavailable", "in": "query", - "description": "Specify whether to return detailed information about score computation as part of a hit.", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", "schema": { "type": "boolean", - "description": "Specify whether to return detailed information about score computation as part of a hit." + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." } }, { - "name": "profile", + "name": "ignore_throttled", "in": "query", - "description": "Specify whether to profile the query execution.", + "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled.", "schema": { "type": "boolean", - "description": "Specify whether to profile the query execution." + "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled." } }, { - "name": "typed_keys", + "name": "allow_no_indices", "in": "query", - "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response.", + "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": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response." + "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": "rest_total_hits_as_int", + "name": "expand_wildcards", "in": "query", - "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response.", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", "schema": { - "type": "boolean", - "default": false, - "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response." + "$ref": "#/components/schemas/ExpandWildcards" } }, { - "name": "ccs_minimize_roundtrips", + "name": "lenient", "in": "query", - "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution.", + "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored.", "schema": { "type": "boolean", - "default": true, - "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution." + "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored." } - } - ], - "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", @@ -14562,530 +14998,729 @@ } }, { - "name": "routing", + "name": "q", "in": "query", - "description": "Routing value.", + "description": "Query in the Lucene query string syntax.", "schema": { "type": "string", - "description": "Routing value." + "description": "Query in the Lucene query string syntax." } }, { - "name": "local", + "name": "routing", "in": "query", - "description": "Return local information, do not retrieve the state from cluster-manager node.", + "description": "Comma-separated list of specific routing values.", + "style": "form", "schema": { - "type": "boolean", - "default": false, - "description": "Return local information, do not retrieve the state from cluster-manager node." - } + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of specific routing values." + }, + "explode": true }, { - "name": "ignore_unavailable", + "name": "scroll", "in": "query", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", "schema": { - "type": "boolean", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + "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": "allow_no_indices", + "name": "search_type", "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).", + "description": "Search operation type.", "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)." + "$ref": "#/components/schemas/SearchType" } }, { - "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", + "name": "size", "in": "query", - "description": "Specify the node or shard the operation should be performed on.", + "description": "Number of hits to return.", "schema": { - "type": "string", - "default": "random", - "description": "Specify the node or shard the operation should be performed on." + "type": "integer", + "default": 10, + "description": "Number of hits to return.", + "format": "int32" } }, { - "name": "routing", + "name": "sort", "in": "query", - "description": "Routing value.", + "description": "Comma-separated list of : pairs.", + "style": "form", "schema": { - "type": "string", - "description": "Routing value." - } + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of : pairs." + }, + "explode": true }, { - "name": "local", + "name": "_source", "in": "query", - "description": "Return local information, do not retrieve the state from cluster-manager node.", + "description": "True or false to return the _source field or not, or a list of fields to return.", + "style": "form", "schema": { - "type": "boolean", - "default": false, - "description": "Return local information, do not retrieve the state from cluster-manager node." - } + "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": "ignore_unavailable", + "name": "_source_excludes", "in": "query", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "description": "List of fields to exclude from the returned _source field.", + "style": "form", "schema": { - "type": "boolean", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." - } + "type": "array", + "items": { + "type": "string" + }, + "description": "List of fields to exclude from the returned _source field." + }, + "explode": true }, { - "name": "allow_no_indices", + "name": "_source_includes", "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).", + "description": "List of fields to extract and return from the _source field.", + "style": "form", "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)." - } + "type": "array", + "items": { + "type": "string" + }, + "description": "List of fields to extract and return from the _source field." + }, + "explode": true }, { - "name": "expand_wildcards", + "name": "terminate_after", "in": "query", - "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "description": "The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.", "schema": { - "$ref": "#/components/schemas/ExpandWildcards" + "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": "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", + "name": "stats", "in": "query", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "description": "Specific 'tag' of the request for logging and statistical purposes.", + "style": "form", "schema": { - "type": "boolean", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." - } + "type": "array", + "items": { + "type": "string" + }, + "description": "Specific 'tag' of the request for logging and statistical purposes." + }, + "explode": true }, { - "name": "allow_no_indices", + "name": "suggest_field", "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).", + "description": "Specify which field to use for suggestions.", "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)." + "type": "string", + "description": "Specify which field to use for suggestions." } }, { - "name": "expand_wildcards", + "name": "suggest_mode", "in": "query", - "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "description": "Specify suggest mode.", "schema": { - "$ref": "#/components/schemas/ExpandWildcards" + "$ref": "#/components/schemas/SuggestMode" } }, { - "name": "verbose", + "name": "suggest_size", "in": "query", - "description": "Includes detailed memory usage by Lucene.", + "description": "How many suggestions to return in response.", "schema": { - "type": "boolean", - "default": false, - "description": "Includes detailed memory usage by Lucene." + "type": "integer", + "description": "How many suggestions to return in response.", + "format": "int32" } - } - ], - "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", + "name": "suggest_text", "in": "query", - "description": "Operation timeout for connection to master node.", + "description": "The source text for which the suggestions should be returned.", "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 + "description": "The source text for which the suggestions should be returned." } }, { - "name": "cluster_manager_timeout", + "name": "timeout", "in": "query", - "description": "Operation timeout for connection to cluster-manager node.", + "description": "Operation timeout.", "schema": { "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", - "description": "Operation timeout for connection to cluster-manager node.", + "description": "Operation timeout.", "x-data-type": "time" } }, { - "name": "ignore_unavailable", + "name": "track_scores", "in": "query", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "description": "Whether to calculate and return scores even if they are not used for sorting.", "schema": { "type": "boolean", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + "description": "Whether to calculate and return scores even if they are not used for sorting." } }, { - "name": "allow_no_indices", + "name": "track_total_hits", "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).", + "description": "Indicate if the number of documents that match the query should be tracked.", "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)." + "description": "Indicate if the number of documents that match the query should be tracked." } }, { - "name": "expand_wildcards", + "name": "allow_partial_search_results", "in": "query", - "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "description": "Indicate if an error should be returned if there is a partial search failure or timeout.", "schema": { - "$ref": "#/components/schemas/ExpandWildcards" + "type": "boolean", + "default": true, + "description": "Indicate if an error should be returned if there is a partial search failure or timeout." } }, { - "name": "flat_settings", + "name": "typed_keys", "in": "query", - "description": "Return settings in flat format.", + "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response.", "schema": { "type": "boolean", - "default": false, - "description": "Return settings in flat format." + "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response." } }, { - "name": "local", + "name": "version", "in": "query", - "description": "Return local information, do not retrieve the state from cluster-manager node.", + "description": "Whether to return document version as part of a hit.", "schema": { "type": "boolean", - "default": false, - "description": "Return local information, do not retrieve the state from cluster-manager node." + "description": "Whether to return document version as part of a hit." } }, { - "name": "include_defaults", + "name": "seq_no_primary_term", "in": "query", - "description": "Whether to return all default setting for each of the indices.", + "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": "Whether to return all default setting for each of the indices." + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response." } } ], "responses": { "200": { - "description": "IndicesGetSettings 200 response" + "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": "indices.get_settings", + "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" }, - "put": { - "description": "Updates the index settings.", + "get": { + "description": "Lists all active point in time searches.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/search-plugins/point-in-time-api/#list-all-pits" }, - "operationId": "IndicesPutSettings", + "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/IndicesPutSettings_BodyParams" + "$ref": "#/components/schemas/ClearScroll_BodyParams" } } - }, - "required": true + } + }, + "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": "master_timeout", + "name": "scroll", "in": "query", - "description": "Operation timeout for connection to master node.", + "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": "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 + "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", + "x-data-type": "time" } }, { - "name": "cluster_manager_timeout", + "name": "scroll_id", "in": "query", - "description": "Operation timeout for connection to cluster-manager node.", + "description": "Scroll ID.", "schema": { "type": "string", - "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", - "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "description": "Scroll ID." } }, { - "name": "timeout", + "name": "rest_total_hits_as_int", "in": "query", - "description": "Operation timeout.", + "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": "Operation timeout.", + "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", "x-data-type": "time" } }, { - "name": "preserve_existing", + "name": "scroll_id", "in": "query", - "description": "Whether to update existing settings. If set to `true` existing settings on an index remain unchanged.", + "description": "Scroll ID.", "schema": { - "type": "boolean", - "default": false, - "description": "Whether to update existing settings. If set to `true` existing settings on an index remain unchanged." + "type": "string", + "description": "Scroll ID." } }, { - "name": "ignore_unavailable", + "name": "rest_total_hits_as_int", "in": "query", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response.", "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." + "default": false, + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response." } } ], "responses": { "200": { - "description": "IndicesPutSettings 200 response" + "description": "Scroll_Post 200 response" } }, - "x-operation-group": "indices.put_settings", + "x-operation-group": "scroll", "x-version-added": "1.0" } }, - "/_settings/{name}": { - "get": { - "description": "Returns settings for one or more indices.", - "operationId": "IndicesGetSettings_WithName", + "/_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": "name", + "name": "scroll_id", "in": "path", - "description": "Comma-separated list of settings.", + "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 settings.", + "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": "master_timeout", - "in": "query", - "description": "Operation timeout for connection to master node.", + "name": "scroll_id", + "in": "path", + "description": "Scroll ID.", "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 - } + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Scroll ID." + }, + "required": true }, { - "name": "cluster_manager_timeout", + "name": "scroll", "in": "query", - "description": "Operation timeout for connection to cluster-manager node.", + "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": "Operation timeout for connection to cluster-manager node.", + "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", "x-data-type": "time" } }, { - "name": "ignore_unavailable", + "name": "scroll_id", "in": "query", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "description": "Scroll ID.", "schema": { - "type": "boolean", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + "type": "string", + "description": "Scroll ID." } }, { - "name": "allow_no_indices", + "name": "rest_total_hits_as_int", "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).", + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response.", "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)." + "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": "expand_wildcards", - "in": "query", - "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "name": "scroll_id", + "in": "path", + "description": "Scroll ID.", "schema": { - "$ref": "#/components/schemas/ExpandWildcards" - } + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Scroll ID." + }, + "required": true }, { - "name": "flat_settings", + "name": "scroll", "in": "query", - "description": "Return settings in flat format.", + "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", "schema": { - "type": "boolean", - "default": false, - "description": "Return settings in flat format." + "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": "local", + "name": "scroll_id", "in": "query", - "description": "Return local information, do not retrieve the state from cluster-manager node.", + "description": "Scroll ID.", "schema": { - "type": "boolean", - "default": false, - "description": "Return local information, do not retrieve the state from cluster-manager node." + "type": "string", + "description": "Scroll ID." } }, { - "name": "include_defaults", + "name": "rest_total_hits_as_int", "in": "query", - "description": "Whether to return all default setting for each of the indices.", + "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": "Whether to return all default setting for each of the indices." + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response." } } ], "responses": { "200": { - "description": "IndicesGetSettings_WithName 200 response" + "description": "Scroll_Post_WithScrollId 200 response" } }, - "x-operation-group": "indices.get_settings", - "x-version-added": "1.0" + "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" } }, - "/_shard_stores": { + "/_search/template": { "get": { - "description": "Provides store information for shard copies of indices.", + "description": "Allows to use the Mustache language to pre-render a search definition.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/search-plugins/search-template/" }, - "operationId": "IndicesShardStores", + "operationId": "SearchTemplate_Get", "parameters": [ { - "name": "status", + "name": "ignore_unavailable", "in": "query", - "description": "Comma-separated list of statuses used to filter on shards to get store information for.", - "style": "form", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", "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 + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } }, { - "name": "ignore_unavailable", + "name": "ignore_throttled", "in": "query", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled.", "schema": { "type": "boolean", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled." } }, { @@ -15104,259 +15739,114 @@ "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" - }, - "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", + "name": "preference", "in": "query", - "description": "Operation timeout for connection to cluster-manager node.", + "description": "Specify the node or shard the operation should be performed on.", "schema": { "type": "string", - "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", - "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "default": "random", + "description": "Specify the node or shard the operation should be performed on." } }, { - "name": "local", + "name": "routing", "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" - }, - "operationId": "SnapshotStatus", - "parameters": [ - { - "name": "master_timeout", - "in": "query", - "description": "Operation timeout for connection to master node.", + "description": "Comma-separated list of specific routing values.", + "style": "form", "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 - } + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of specific routing values." + }, + "explode": true }, { - "name": "cluster_manager_timeout", + "name": "scroll", "in": "query", - "description": "Operation timeout for connection to cluster-manager node.", + "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": "Operation timeout for connection to cluster-manager node.", + "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", "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" - }, - "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", + "name": "search_type", "in": "query", - "description": "Operation timeout for connection to master node.", + "description": "Search operation type.", "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 + "$ref": "#/components/schemas/SearchTypeMulti" } }, { - "name": "cluster_manager_timeout", + "name": "explain", "in": "query", - "description": "Operation timeout for connection to cluster-manager node.", + "description": "Specify whether to return detailed information about score computation as part of a hit.", "schema": { - "type": "string", - "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", - "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "type": "boolean", + "description": "Specify whether to return detailed information about score computation as part of a hit." } }, { - "name": "timeout", + "name": "profile", "in": "query", - "description": "Operation timeout.", + "description": "Specify whether to profile the query execution.", "schema": { - "type": "string", - "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", - "description": "Operation timeout.", - "x-data-type": "time" + "type": "boolean", + "description": "Specify whether to profile the query execution." } - } - ], - "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", + "name": "typed_keys", "in": "query", - "description": "Operation timeout for connection to master node.", + "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response.", "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 + "type": "boolean", + "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response." } }, { - "name": "cluster_manager_timeout", + "name": "rest_total_hits_as_int", "in": "query", - "description": "Operation timeout for connection to cluster-manager node.", + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response.", "schema": { - "type": "string", - "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", - "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "type": "boolean", + "default": false, + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response." } }, { - "name": "local", + "name": "ccs_minimize_roundtrips", "in": "query", - "description": "Return local information, do not retrieve the state from cluster-manager node.", + "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution.", "schema": { "type": "boolean", - "default": false, - "description": "Return local information, do not retrieve the state from cluster-manager node." + "default": true, + "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution." } } ], "responses": { "200": { - "description": "SnapshotGetRepository_WithRepository 200 response" + "description": "SearchTemplate_Get 200 response" } }, - "x-operation-group": "snapshot.get_repository", + "x-operation-group": "search_template", "x-version-added": "1.0" }, "post": { - "description": "Creates a repository.", - "operationId": "SnapshotCreateRepository_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/SnapshotCreateRepository_BodyParams" + "$ref": "#/components/schemas/SearchTemplate_BodyParams" } } }, @@ -15364,378 +15854,346 @@ }, "parameters": [ { - "name": "repository", - "in": "path", - "description": "Repository name.", + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", "schema": { - "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", - "description": "Repository name." - }, - "required": true + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } }, { - "name": "master_timeout", + "name": "ignore_throttled", "in": "query", - "description": "Operation timeout for connection to master node.", + "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled.", "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 + "type": "boolean", + "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled." } }, { - "name": "cluster_manager_timeout", + "name": "allow_no_indices", "in": "query", - "description": "Operation timeout for connection to cluster-manager node.", + "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": "string", - "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", - "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "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": "timeout", + "name": "expand_wildcards", "in": "query", - "description": "Operation timeout.", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", "schema": { - "type": "string", - "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", - "description": "Operation timeout.", - "x-data-type": "time" + "$ref": "#/components/schemas/ExpandWildcards" } }, { - "name": "verify", + "name": "preference", "in": "query", - "description": "Whether to verify the repository after creation.", + "description": "Specify the node or shard the operation should be performed on.", "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" - }, - "operationId": "SnapshotCreateRepository_Put", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SnapshotCreateRepository_BodyParams" - } + "type": "string", + "default": "random", + "description": "Specify the node or shard the operation should be performed on." } }, - "required": true - }, - "parameters": [ { - "name": "repository", - "in": "path", - "description": "Repository name.", + "name": "routing", + "in": "query", + "description": "Comma-separated list of specific routing values.", + "style": "form", "schema": { - "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", - "description": "Repository name." + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of specific routing values." }, - "required": true + "explode": true }, { - "name": "master_timeout", + "name": "scroll", "in": "query", - "description": "Operation timeout for connection to master node.", + "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": "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 + "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", + "x-data-type": "time" } }, { - "name": "cluster_manager_timeout", + "name": "search_type", "in": "query", - "description": "Operation timeout for connection to cluster-manager node.", + "description": "Search operation type.", "schema": { - "type": "string", - "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", - "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "$ref": "#/components/schemas/SearchTypeMulti" } }, { - "name": "timeout", + "name": "explain", "in": "query", - "description": "Operation timeout.", + "description": "Specify whether to return detailed information about score computation as part of a hit.", "schema": { - "type": "string", - "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", - "description": "Operation timeout.", - "x-data-type": "time" + "type": "boolean", + "description": "Specify whether to return detailed information about score computation as part of a hit." } }, { - "name": "verify", + "name": "profile", "in": "query", - "description": "Whether to verify the repository after creation.", + "description": "Specify whether to profile the query execution.", "schema": { "type": "boolean", - "description": "Whether to verify the repository after creation." + "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": "SnapshotCreateRepository_Put 200 response" + "description": "SearchTemplate_Post 200 response" } }, - "x-operation-group": "snapshot.create_repository", + "x-operation-group": "search_template", "x-version-added": "1.0" } }, - "/_snapshot/{repository}/_cleanup": { - "post": { - "description": "Removes stale data from repository.", + "/_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": "SnapshotCleanupRepository", + "operationId": "SearchShards_Get", "parameters": [ { - "name": "repository", - "in": "path", - "description": "Repository name.", + "name": "preference", + "in": "query", + "description": "Specify the node or shard the operation should be performed on.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", - "description": "Repository name." - }, - "required": true + "default": "random", + "description": "Specify the node or shard the operation should be performed on." + } }, { - "name": "master_timeout", + "name": "routing", "in": "query", - "description": "Operation timeout for connection to master node.", + "description": "Routing value.", "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 + "description": "Routing value." } }, { - "name": "cluster_manager_timeout", + "name": "local", "in": "query", - "description": "Operation timeout for connection to cluster-manager node.", + "description": "Return local information, do not retrieve the state from 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-data-type": "time" + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." } }, { - "name": "timeout", + "name": "ignore_unavailable", "in": "query", - "description": "Operation timeout.", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", "schema": { - "type": "string", - "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", - "description": "Operation timeout.", - "x-data-type": "time" + "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": "SnapshotCleanupRepository 200 response" + "description": "SearchShards_Get 200 response" } }, - "x-operation-group": "snapshot.cleanup_repository", + "x-operation-group": "search_shards", "x-version-added": "1.0" - } - }, - "/_snapshot/{repository}/_status": { - "get": { - "description": "Returns information about the status of a snapshot.", - "operationId": "SnapshotStatus_WithRepository", + }, + "post": { + "description": "Returns information about the indices and shards that a search request would be executed against.", + "operationId": "SearchShards_Post", "parameters": [ { - "name": "repository", - "in": "path", - "description": "Repository name.", + "name": "preference", + "in": "query", + "description": "Specify the node or shard the operation should be performed on.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", - "description": "Repository name." - }, - "required": true + "default": "random", + "description": "Specify the node or shard the operation should be performed on." + } }, { - "name": "master_timeout", + "name": "routing", "in": "query", - "description": "Operation timeout for connection to master node.", + "description": "Routing value.", "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 + "description": "Routing value." } }, { - "name": "cluster_manager_timeout", + "name": "local", "in": "query", - "description": "Operation timeout for connection to cluster-manager node.", + "description": "Return local information, do not retrieve the state from 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-data-type": "time" + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." } }, { "name": "ignore_unavailable", "in": "query", - "description": "Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown.", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", "schema": { "type": "boolean", - "default": false, - "description": "Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown." + "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": "SnapshotStatus_WithRepository 200 response" + "description": "SearchShards_Post 200 response" } }, - "x-operation-group": "snapshot.status", + "x-operation-group": "search_shards", "x-version-added": "1.0" } }, - "/_snapshot/{repository}/_verify": { - "post": { - "description": "Verifies a repository.", + "/_segments": { + "get": { + "description": "Provides low-level information about segments in a Lucene index.", "externalDocs": { "description": "API Reference", "url": "https://opensearch.org/docs/latest" }, - "operationId": "SnapshotVerifyRepository", + "operationId": "IndicesSegments", "parameters": [ { - "name": "repository", - "in": "path", - "description": "Repository name.", + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", "schema": { - "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", - "description": "Repository name." - }, - "required": true + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } }, { - "name": "master_timeout", + "name": "allow_no_indices", "in": "query", - "description": "Operation timeout for connection to master node.", + "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": "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 + "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": "cluster_manager_timeout", + "name": "expand_wildcards", "in": "query", - "description": "Operation timeout for connection to cluster-manager node.", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", "schema": { - "type": "string", - "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", - "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "$ref": "#/components/schemas/ExpandWildcards" } }, { - "name": "timeout", + "name": "verbose", "in": "query", - "description": "Operation timeout.", + "description": "Includes detailed memory usage by Lucene.", "schema": { - "type": "string", - "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", - "description": "Operation timeout.", - "x-data-type": "time" + "type": "boolean", + "default": false, + "description": "Includes detailed memory usage by Lucene." } } ], "responses": { "200": { - "description": "SnapshotVerifyRepository 200 response" + "description": "IndicesSegments 200 response" } }, - "x-operation-group": "snapshot.verify_repository", + "x-operation-group": "indices.segments", "x-version-added": "1.0" } }, - "/_snapshot/{repository}/{snapshot}": { - "delete": { - "description": "Deletes a snapshot.", + "/_settings": { + "get": { + "description": "Returns settings for one or more indices.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/api-reference/index-apis/get-settings/" }, - "operationId": "SnapshotDelete", + "operationId": "IndicesGetSettings", "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", @@ -15760,135 +16218,90 @@ "description": "Operation timeout for connection to cluster-manager node.", "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.", + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", "schema": { - "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", - "description": "Repository name." - }, - "required": true + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } }, { - "name": "snapshot", - "in": "path", - "description": "Comma-separated list of snapshot names.", + "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": "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 + "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": "master_timeout", + "name": "expand_wildcards", "in": "query", - "description": "Operation timeout for connection to master node.", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", "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 + "$ref": "#/components/schemas/ExpandWildcards" } }, { - "name": "cluster_manager_timeout", + "name": "flat_settings", "in": "query", - "description": "Operation timeout for connection to cluster-manager node.", + "description": "Return settings in flat format.", "schema": { - "type": "string", - "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", - "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "type": "boolean", + "default": false, + "description": "Return settings in flat format." } }, { - "name": "ignore_unavailable", + "name": "local", "in": "query", - "description": "Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown.", + "description": "Return local information, do not retrieve the state from cluster-manager node.", "schema": { "type": "boolean", "default": false, - "description": "Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown." + "description": "Return local information, do not retrieve the state from cluster-manager node." } }, { - "name": "verbose", + "name": "include_defaults", "in": "query", - "description": "Whether to show verbose snapshot info or only show the basic info found in the repository index blob.", + "description": "Whether to return all default setting for each of the indices.", "schema": { "type": "boolean", - "description": "Whether to show verbose snapshot info or only show the basic info found in the repository index blob." + "default": false, + "description": "Whether to return all default setting for each of the indices." } } ], "responses": { "200": { - "description": "SnapshotGet 200 response" + "description": "IndicesGetSettings 200 response" } }, - "x-operation-group": "snapshot.get", + "x-operation-group": "indices.get_settings", "x-version-added": "1.0" }, - "post": { - "description": "Creates a snapshot in a repository.", - "operationId": "SnapshotCreate_Post", + "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/SnapshotCreate_BodyParams" + "$ref": "#/components/schemas/IndicesPutSettings_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": "master_timeout", "in": "query", @@ -15915,60 +16328,86 @@ } }, { - "name": "wait_for_completion", + "name": "timeout", "in": "query", - "description": "Should this request wait until the operation has completed before returning.", + "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": "Should this request wait until the operation has completed before returning." + "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": "SnapshotCreate_Post 200 response" + "description": "IndicesPutSettings 200 response" } }, - "x-operation-group": "snapshot.create", + "x-operation-group": "indices.put_settings", "x-version-added": "1.0" - }, - "put": { - "description": "Creates a snapshot in a repository.", - "externalDocs": { - "description": "API Reference", - "url": "https://opensearch.org/docs/latest" - }, - "operationId": "SnapshotCreate_Put", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SnapshotCreate_BodyParams" - } - } - } - }, + } + }, + "/_settings/{name}": { + "get": { + "description": "Returns settings for one or more indices.", + "operationId": "IndicesGetSettings_WithName", "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", + "name": "name", "in": "path", - "description": "Snapshot name.", + "description": "Comma-separated list of settings.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", - "description": "Snapshot name." + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of settings.", + "x-data-type": "array" }, "required": true }, @@ -15998,152 +16437,139 @@ } }, { - "name": "wait_for_completion", + "name": "ignore_unavailable", "in": "query", - "description": "Should this request wait until the operation has completed before returning.", + "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": "Should this request wait until the operation has completed before returning." + "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": "SnapshotCreate_Put 200 response" + "description": "IndicesGetSettings_WithName 200 response" } }, - "x-operation-group": "snapshot.create", + "x-operation-group": "indices.get_settings", "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.", + "/_shard_stores": { + "get": { + "description": "Provides store information for shard copies of indices.", "externalDocs": { "description": "API Reference", "url": "https://opensearch.org/docs/latest" }, - "operationId": "SnapshotClone", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SnapshotClone_BodyParams" - } - } - }, - "required": true - }, + "operationId": "IndicesShardStores", "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.", + "name": "status", + "in": "query", + "description": "Comma-separated list of statuses used to filter on shards to get store information for.", + "style": "form", "schema": { - "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", - "description": "Snapshot name." + "type": "array", + "items": { + "$ref": "#/components/schemas/Status_Member" + }, + "description": "Comma-separated list of statuses used to filter on shards to get store information for." }, - "required": true + "explode": true }, { - "name": "target_snapshot", - "in": "path", - "description": "The name of the cloned snapshot to create.", + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", "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 + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } }, { - "name": "master_timeout", + "name": "allow_no_indices", "in": "query", - "description": "Operation timeout for connection to master node.", + "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": "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 + "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": "cluster_manager_timeout", + "name": "expand_wildcards", "in": "query", - "description": "Operation timeout for connection to cluster-manager node.", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", "schema": { - "type": "string", - "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", - "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "$ref": "#/components/schemas/ExpandWildcards" } } ], "responses": { "200": { - "description": "SnapshotClone 200 response" + "description": "IndicesShardStores 200 response" } }, - "x-operation-group": "snapshot.clone", + "x-operation-group": "indices.shard_stores", "x-version-added": "1.0" } }, - "/_snapshot/{repository}/{snapshot}/_restore": { - "post": { - "description": "Restores a snapshot.", + "/_snapshot": { + "get": { + "description": "Returns information about a repository.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" - }, - "operationId": "SnapshotRestore", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SnapshotRestore_BodyParams" - } - } - } + "url": "https://opensearch.org/docs/latest/api-reference/snapshots/get-snapshot-repository/" }, + "operationId": "SnapshotGetRepository", "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", @@ -16170,53 +16596,34 @@ } }, { - "name": "wait_for_completion", + "name": "local", "in": "query", - "description": "Should this request wait until the operation has completed before returning.", + "description": "Return local information, do not retrieve the state from cluster-manager node.", "schema": { "type": "boolean", "default": false, - "description": "Should this request wait until the operation has completed before returning." + "description": "Return local information, do not retrieve the state from cluster-manager node." } } ], "responses": { "200": { - "description": "SnapshotRestore 200 response" + "description": "SnapshotGetRepository 200 response" } }, - "x-operation-group": "snapshot.restore", + "x-operation-group": "snapshot.get_repository", "x-version-added": "1.0" } }, - "/_snapshot/{repository}/{snapshot}/_status": { + "/_snapshot/_status": { "get": { "description": "Returns information about the status of a snapshot.", - "operationId": "SnapshotStatus_WithRepositorySnapshot", + "externalDocs": { + "description": "API Reference", + "url": "https://opensearch.org/docs/latest/api-reference/snapshots/get-snapshot-status/" + }, + "operationId": "SnapshotStatus", "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", @@ -16255,353 +16662,345 @@ ], "responses": { "200": { - "description": "SnapshotStatus_WithRepositorySnapshot 200 response" + "description": "SnapshotStatus 200 response" } }, "x-operation-group": "snapshot.status", "x-version-added": "1.0" } }, - "/_stats": { - "get": { - "description": "Provides statistics on operations happening in an index.", - "externalDocs": { + "/_snapshot/{repository}": { + "delete": { + "description": "Deletes a repository.", + "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/api-reference/snapshots/delete-snapshot-repository/" }, - "operationId": "IndicesStats", + "operationId": "SnapshotDeleteRepository", "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", + "name": "repository", + "in": "path", + "description": "Name of the snapshot repository to unregister. Wildcard (`*`) patterns are supported.", "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Comma-separated list of fields for `fielddata` index metric (supports wildcards)." + "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" }, - "explode": true + "required": true }, { - "name": "fields", + "name": "master_timeout", "in": "query", - "description": "Comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards).", - "style": "form", + "description": "Operation timeout for connection to master node.", "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards)." - }, - "explode": true + "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": "groups", + "name": "cluster_manager_timeout", "in": "query", - "description": "Comma-separated list of search groups for `search` index metric.", - "style": "form", + "description": "Operation timeout for connection to cluster-manager node.", "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Comma-separated list of search groups for `search` index metric." - }, - "explode": true + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-data-type": "time" + } }, { - "name": "level", + "name": "timeout", "in": "query", - "description": "Return stats aggregated at cluster, index or shard level.", + "description": "Operation timeout.", "schema": { - "$ref": "#/components/schemas/IndiciesStatLevel" + "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": "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).", + "name": "repository", + "in": "path", + "description": "Comma-separated list of repository names.", "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)." - } + "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": "include_unloaded_segments", + "name": "master_timeout", "in": "query", - "description": "If set to true segment stats will include stats for segments that are not currently loaded into memory.", + "description": "Operation timeout for connection to master node.", "schema": { - "type": "boolean", - "default": false, - "description": "If set to true segment stats will include stats for segments that are not currently loaded into memory." + "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": "expand_wildcards", + "name": "cluster_manager_timeout", "in": "query", - "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "description": "Operation timeout for connection to cluster-manager node.", "schema": { - "$ref": "#/components/schemas/ExpandWildcards" + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-data-type": "time" } }, { - "name": "forbid_closed_indices", + "name": "local", "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.", + "description": "Return local information, do not retrieve the state from cluster-manager node.", "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." + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." } } ], "responses": { "200": { - "description": "IndicesStats 200 response" + "description": "SnapshotGetRepository_WithRepository 200 response" } }, - "x-operation-group": "indices.stats", + "x-operation-group": "snapshot.get_repository", "x-version-added": "1.0" - } - }, - "/_stats/{metric}": { - "get": { - "description": "Provides statistics on operations happening in an index.", - "operationId": "IndicesStats_WithMetric", + }, + "post": { + "description": "Creates a repository.", + "operationId": "SnapshotCreateRepository_Post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SnapshotCreateRepository_BodyParams" + } + } + }, + "required": true + }, "parameters": [ { - "name": "metric", + "name": "repository", "in": "path", - "description": "Limit the information returned the specific metrics.", + "description": "Repository name.", "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", - "completion", - "docs", - "fielddata", - "query_cache", - "flush", - "get", - "indexing", - "merge", - "request_cache", - "refresh", - "search", - "segments", - "store", - "warmer", - "suggest" - ], - "x-data-type": "array" + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Repository name." }, "required": true }, { - "name": "completion_fields", + "name": "master_timeout", "in": "query", - "description": "Comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards).", - "style": "form", + "description": "Operation timeout for connection to master node.", "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards)." - }, - "explode": true + "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": "fielddata_fields", + "name": "cluster_manager_timeout", "in": "query", - "description": "Comma-separated list of fields for `fielddata` index metric (supports wildcards).", - "style": "form", + "description": "Operation timeout for connection to cluster-manager node.", "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Comma-separated list of fields for `fielddata` index metric (supports wildcards)." - }, - "explode": true + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-data-type": "time" + } }, { - "name": "fields", + "name": "timeout", "in": "query", - "description": "Comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards).", - "style": "form", + "description": "Operation timeout.", "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards)." - }, - "explode": true + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } }, { - "name": "groups", + "name": "verify", "in": "query", - "description": "Comma-separated list of search groups for `search` index metric.", - "style": "form", + "description": "Whether to verify the repository after creation.", "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Comma-separated list of search groups for `search` index metric." - }, - "explode": true + "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": "level", - "in": "query", - "description": "Return stats aggregated at cluster, index or shard level.", + "name": "repository", + "in": "path", + "description": "Repository name.", "schema": { - "$ref": "#/components/schemas/IndiciesStatLevel" - } + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Repository name." + }, + "required": true }, { - "name": "include_segment_file_sizes", + "name": "master_timeout", "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).", + "description": "Operation timeout for connection to master node.", "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)." + "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": "include_unloaded_segments", + "name": "cluster_manager_timeout", "in": "query", - "description": "If set to true segment stats will include stats for segments that are not currently loaded into memory.", + "description": "Operation timeout for connection to cluster-manager node.", "schema": { - "type": "boolean", - "default": false, - "description": "If set to true segment stats will include stats for segments that are not currently loaded into memory." + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-data-type": "time" } }, { - "name": "expand_wildcards", + "name": "timeout", "in": "query", - "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "description": "Operation timeout.", "schema": { - "$ref": "#/components/schemas/ExpandWildcards" + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" } }, { - "name": "forbid_closed_indices", + "name": "verify", "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.", + "description": "Whether to verify the repository after creation.", "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." + "description": "Whether to verify the repository after creation." } } ], "responses": { "200": { - "description": "IndicesStats_WithMetric 200 response" + "description": "SnapshotCreateRepository_Put 200 response" } }, - "x-operation-group": "indices.stats", + "x-operation-group": "snapshot.create_repository", "x-version-added": "1.0" } }, - "/_tasks": { - "get": { - "description": "Returns a list of tasks.", + "/_snapshot/{repository}/_cleanup": { + "post": { + "description": "Removes stale data from repository.", "externalDocs": { "description": "API Reference", "url": "https://opensearch.org/docs/latest" }, - "operationId": "TasksList", + "operationId": "SnapshotCleanupRepository", "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", + "name": "repository", + "in": "path", + "description": "Repository name.", "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Comma-separated list of actions that should be returned. Leave empty to return all." + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Repository name." }, - "explode": true - }, - { - "name": "detailed", - "in": "query", - "description": "Return detailed task information.", - "schema": { - "type": "boolean", - "default": false, - "description": "Return detailed task information." - } + "required": true }, { - "name": "parent_task_id", + "name": "master_timeout", "in": "query", - "description": "Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all.", + "description": "Operation timeout for connection to master node.", "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." + "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": "group_by", + "name": "cluster_manager_timeout", "in": "query", - "description": "Group tasks by nodes or parent/child relationships.", + "description": "Operation timeout for connection to cluster-manager node.", "schema": { - "$ref": "#/components/schemas/GroupBy" + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-data-type": "time" } }, { @@ -16618,107 +17017,117 @@ ], "responses": { "200": { - "description": "TasksList 200 response" + "description": "SnapshotCleanupRepository 200 response" } }, - "x-operation-group": "tasks.list", + "x-operation-group": "snapshot.cleanup_repository", "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" - }, - "operationId": "TasksCancel", + "/_snapshot/{repository}/_status": { + "get": { + "description": "Returns information about the status of a snapshot.", + "operationId": "SnapshotStatus_WithRepository", "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", + "name": "repository", + "in": "path", + "description": "Repository name.", "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." + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Repository name." }, - "explode": true + "required": true }, { - "name": "actions", + "name": "master_timeout", "in": "query", - "description": "Comma-separated list of actions that should be cancelled. Leave empty to cancel all.", - "style": "form", + "description": "Operation timeout for connection to master node.", "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Comma-separated list of actions that should be cancelled. Leave empty to cancel all." - }, - "explode": true + "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": "parent_task_id", + "name": "cluster_manager_timeout", "in": "query", - "description": "Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all.", + "description": "Operation timeout for connection to cluster-manager node.", "schema": { "type": "string", - "description": "Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all." + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-data-type": "time" } }, { - "name": "wait_for_completion", + "name": "ignore_unavailable", "in": "query", - "description": "Should this request wait until the operation has completed before returning.", + "description": "Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown.", "schema": { "type": "boolean", "default": false, - "description": "Should this request wait until the operation has completed before returning." + "description": "Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown." } } ], "responses": { "200": { - "description": "TasksCancel 200 response" + "description": "SnapshotStatus_WithRepository 200 response" } }, - "x-operation-group": "tasks.cancel", + "x-operation-group": "snapshot.status", "x-version-added": "1.0" } }, - "/_tasks/{task_id}": { - "get": { - "description": "Returns information about a task.", + "/_snapshot/{repository}/_verify": { + "post": { + "description": "Verifies a repository.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/api-reference/snapshots/verify-snapshot-repository/" }, - "operationId": "TasksGet", + "operationId": "SnapshotVerifyRepository", "parameters": [ { - "name": "task_id", + "name": "repository", "in": "path", - "description": "Return the task with specified id (node_id:task_number).", + "description": "Repository name.", "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)." + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Repository name." }, "required": true }, { - "name": "wait_for_completion", + "name": "master_timeout", "in": "query", - "description": "Should this request wait until the operation has completed before returning.", + "description": "Operation timeout for connection to master node.", "schema": { - "type": "boolean", - "default": false, - "description": "Should this request wait until the operation has completed before returning." + "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-data-type": "time" } }, { @@ -16735,104 +17144,108 @@ ], "responses": { "200": { - "description": "TasksGet 200 response" + "description": "SnapshotVerifyRepository 200 response" } }, - "x-operation-group": "tasks.get", + "x-operation-group": "snapshot.verify_repository", "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", + "/_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": "task_id", + "name": "repository", "in": "path", - "description": "Cancel the task with specified task id (node_id:task_number).", + "description": "Repository name.", "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)." + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Repository name." }, "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", + "name": "snapshot", + "in": "path", + "description": "Snapshot name.", "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Comma-separated list of actions that should be cancelled. Leave empty to cancel all." + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Snapshot name." }, - "explode": true + "required": true }, { - "name": "parent_task_id", + "name": "master_timeout", "in": "query", - "description": "Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all.", + "description": "Operation timeout for connection to master node.", "schema": { "type": "string", - "description": "Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all." + "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": "wait_for_completion", + "name": "cluster_manager_timeout", "in": "query", - "description": "Should this request wait until the operation has completed before returning.", + "description": "Operation timeout for connection to cluster-manager node.", "schema": { - "type": "boolean", - "default": false, - "description": "Should this request wait until the operation has completed before returning." + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-data-type": "time" } } ], "responses": { "200": { - "description": "TasksCancel_WithTaskId 200 response" + "description": "SnapshotDelete 200 response" } }, - "x-operation-group": "tasks.cancel", + "x-operation-group": "snapshot.delete", "x-version-added": "1.0" - } - }, - "/_template": { + }, "get": { - "description": "Returns an index template.", + "description": "Returns information about a snapshot.", "externalDocs": { "description": "API Reference", "url": "https://opensearch.org/docs/latest" }, - "operationId": "IndicesGetTemplate", + "operationId": "SnapshotGet", "parameters": [ { - "name": "flat_settings", - "in": "query", - "description": "Return settings in flat format.", + "name": "repository", + "in": "path", + "description": "Repository name.", "schema": { - "type": "boolean", - "default": false, - "description": "Return settings in flat format." - } + "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", @@ -16860,55 +17273,67 @@ } }, { - "name": "local", + "name": "ignore_unavailable", "in": "query", - "description": "Return local information, do not retrieve the state from cluster-manager node.", + "description": "Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown.", "schema": { "type": "boolean", "default": false, - "description": "Return local information, do not retrieve the state from cluster-manager node." + "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": "IndicesGetTemplate 200 response" + "description": "SnapshotGet 200 response" } }, - "x-operation-group": "indices.get_template", + "x-operation-group": "snapshot.get", "x-version-added": "1.0" - } - }, - "/_template/{name}": { - "delete": { - "description": "Deletes an index template.", - "externalDocs": { - "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + }, + "post": { + "description": "Creates a snapshot in a repository.", + "operationId": "SnapshotCreate_Post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SnapshotCreate_BodyParams" + } + } + } }, - "operationId": "IndicesDeleteTemplate", "parameters": [ { - "name": "name", + "name": "repository", "in": "path", - "description": "The name of the template.", + "description": "Repository name.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", - "description": "The name of the template." + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Repository name." }, "required": true }, { - "name": "timeout", - "in": "query", - "description": "Operation timeout.", + "name": "snapshot", + "in": "path", + "description": "Snapshot name.", "schema": { "type": "string", - "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", - "description": "Operation timeout.", - "x-data-type": "time" - } + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Snapshot name." + }, + "required": true }, { "name": "master_timeout", @@ -16934,41 +17359,64 @@ "description": "Operation timeout for connection to cluster-manager node.", "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": "IndicesDeleteTemplate 200 response" + "description": "SnapshotCreate_Post 200 response" } }, - "x-operation-group": "indices.delete_template", + "x-operation-group": "snapshot.create", "x-version-added": "1.0" }, - "get": { - "description": "Returns an index template.", - "operationId": "IndicesGetTemplate_WithName", + "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": "name", + "name": "repository", "in": "path", - "description": "Comma-separated names of the index templates.", + "description": "Repository name.", "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" + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Repository name." }, "required": true }, { - "name": "flat_settings", - "in": "query", - "description": "Return settings in flat format.", + "name": "snapshot", + "in": "path", + "description": "Snapshot name.", "schema": { - "type": "boolean", - "default": false, - "description": "Return settings in flat format." - } + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Snapshot name." + }, + "required": true }, { "name": "master_timeout", @@ -16996,53 +17444,76 @@ } }, { - "name": "local", + "name": "wait_for_completion", "in": "query", - "description": "Return local information, do not retrieve the state from cluster-manager node.", + "description": "Should this request wait until the operation has completed before returning.", "schema": { "type": "boolean", "default": false, - "description": "Return local information, do not retrieve the state from cluster-manager node." + "description": "Should this request wait until the operation has completed before returning." } } ], "responses": { "200": { - "description": "IndicesGetTemplate_WithName 200 response" + "description": "SnapshotCreate_Put 200 response" } }, - "x-operation-group": "indices.get_template", + "x-operation-group": "snapshot.create", "x-version-added": "1.0" - }, - "head": { - "description": "Returns information about whether a particular index template exists.", + } + }, + "/_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": "IndicesExistsTemplate", + "operationId": "SnapshotClone", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SnapshotClone_BodyParams" + } + } + }, + "required": true + }, "parameters": [ { - "name": "name", + "name": "repository", "in": "path", - "description": "Comma-separated names of the index templates.", + "description": "Repository name.", "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" + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Repository name." }, "required": true }, { - "name": "flat_settings", - "in": "query", - "description": "Return settings in flat format.", + "name": "snapshot", + "in": "path", + "description": "Snapshot name.", "schema": { - "type": "boolean", - "default": false, - "description": "Return settings in flat format." - } + "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", @@ -17059,68 +17530,65 @@ } }, { - "name": "local", + "name": "cluster_manager_timeout", "in": "query", - "description": "Return local information, do not retrieve the state from cluster-manager node.", + "description": "Operation timeout for connection to cluster-manager node.", "schema": { - "type": "boolean", - "default": false, - "description": "Return local information, do not retrieve the state from cluster-manager node." + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-data-type": "time" } } ], "responses": { "200": { - "description": "IndicesExistsTemplate 200 response" + "description": "SnapshotClone 200 response" } }, - "x-operation-group": "indices.exists_template", + "x-operation-group": "snapshot.clone", "x-version-added": "1.0" - }, + } + }, + "/_snapshot/{repository}/{snapshot}/_restore": { "post": { - "description": "Creates or updates an index template.", - "operationId": "IndicesPutTemplate_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/IndicesPutTemplate_BodyParams" + "$ref": "#/components/schemas/SnapshotRestore_BodyParams" } } - }, - "required": true + } }, "parameters": [ { - "name": "name", + "name": "repository", "in": "path", - "description": "The name of the template.", + "description": "Repository name.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", - "description": "The name of the template." + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Repository name." }, "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.", + "name": "snapshot", + "in": "path", + "description": "Snapshot name.", "schema": { - "type": "boolean", - "default": false, - "description": "Whether the index template should only be added if new or can also replace an existing one." - } + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Snapshot name." + }, + "required": true }, { "name": "master_timeout", @@ -17146,64 +17614,54 @@ "description": "Operation timeout for connection to cluster-manager node.", "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": "IndicesPutTemplate_Post 200 response" + "description": "SnapshotRestore 200 response" } }, - "x-operation-group": "indices.put_template", + "x-operation-group": "snapshot.restore", "x-version-added": "1.0" - }, - "put": { - "description": "Creates or updates an index template.", - "externalDocs": { - "description": "API Reference", - "url": "https://opensearch.org/docs/latest" - }, - "operationId": "IndicesPutTemplate_Put", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/IndicesPutTemplate_BodyParams" - } - } - }, - "required": true - }, + } + }, + "/_snapshot/{repository}/{snapshot}/_status": { + "get": { + "description": "Returns information about the status of a snapshot.", + "operationId": "SnapshotStatus_WithRepositorySnapshot", "parameters": [ { - "name": "name", + "name": "repository", "in": "path", - "description": "The name of the template.", + "description": "Repository name.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", - "description": "The name of the template." + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Repository name." }, "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.", + "name": "snapshot", + "in": "path", + "description": "Comma-separated list of snapshot names.", "schema": { - "type": "boolean", - "default": false, - "description": "Whether the index template should only be added if new or can also replace an existing one." - } + "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", @@ -17229,569 +17687,597 @@ "description": "Operation timeout for connection to cluster-manager node.", "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", + "name": "ignore_unavailable", "in": "query", - "description": "The throttle for this request in sub-requests per second. -1 means no throttle.", + "description": "Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown.", "schema": { - "type": "integer", - "description": "The throttle for this request in sub-requests per second. -1 means no throttle.", - "format": "int32" - }, - "required": true + "type": "boolean", + "default": false, + "description": "Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown." + } } ], "responses": { "200": { - "description": "UpdateByQueryRethrottle 200 response" + "description": "SnapshotStatus_WithRepositorySnapshot 200 response" } }, - "x-operation-group": "update_by_query_rethrottle", + "x-operation-group": "snapshot.status", "x-version-added": "1.0" } }, - "/_upgrade": { + "/_stats": { "get": { - "description": "The _upgrade API is no longer useful and will be removed.", + "description": "Provides statistics on operations happening in an index.", "externalDocs": { "description": "API Reference", "url": "https://opensearch.org/docs/latest" }, - "operationId": "IndicesGetUpgrade", + "operationId": "IndicesStats", "parameters": [ { - "name": "ignore_unavailable", + "name": "completion_fields", "in": "query", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "description": "Comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards).", + "style": "form", "schema": { - "type": "boolean", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." - } + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards)." + }, + "explode": true }, { - "name": "allow_no_indices", + "name": "fielddata_fields", "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).", + "description": "Comma-separated list of fields for `fielddata` index metric (supports wildcards).", + "style": "form", "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", + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields for `fielddata` index metric (supports wildcards)." + }, + "explode": true + }, + { + "name": "fields", "in": "query", - "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "description": "Comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards).", + "style": "form", "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": [ + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards)." + }, + "explode": true + }, { - "name": "allow_no_indices", + "name": "groups", "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).", + "description": "Comma-separated list of search groups for `search` index metric.", + "style": "form", "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)." - } + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of search groups for `search` index metric." + }, + "explode": true }, { - "name": "expand_wildcards", + "name": "level", "in": "query", - "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "description": "Return stats aggregated at cluster, index or shard level.", "schema": { - "$ref": "#/components/schemas/ExpandWildcards" + "$ref": "#/components/schemas/IndiciesStatLevel" } }, { - "name": "ignore_unavailable", + "name": "include_segment_file_sizes", "in": "query", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "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", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + "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": "wait_for_completion", + "name": "include_unloaded_segments", "in": "query", - "description": "Should this request wait until the operation has completed before returning.", + "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": "Should this request wait until the operation has completed before returning." + "description": "If set to true segment stats will include stats for segments that are not currently loaded into memory." } }, { - "name": "only_ancient_segments", + "name": "expand_wildcards", "in": "query", - "description": "If true, only ancient (an older Lucene major release) segments will be upgraded.", + "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", - "description": "If true, only ancient (an older Lucene major release) segments will be upgraded." + "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": "IndicesUpgrade 200 response" + "description": "IndicesStats 200 response" } }, - "x-operation-group": "indices.upgrade", + "x-operation-group": "indices.stats", "x-version-added": "1.0" } }, - "/_validate/query": { + "/_stats/{metric}": { "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", + "description": "Provides statistics on operations happening in an index.", + "operationId": "IndicesStats_WithMetric", "parameters": [ { - "name": "explain", - "in": "query", - "description": "Return detailed information about the error.", + "name": "metric", + "in": "path", + "description": "Limit the information returned the specific metrics.", "schema": { - "type": "boolean", - "description": "Return detailed information about the error." - } + "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", + "completion", + "docs", + "fielddata", + "query_cache", + "flush", + "get", + "indexing", + "merge", + "request_cache", + "refresh", + "search", + "segments", + "store", + "warmer", + "suggest" + ], + "x-data-type": "array" + }, + "required": true }, { - "name": "ignore_unavailable", + "name": "completion_fields", "in": "query", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "description": "Comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards).", + "style": "form", "schema": { - "type": "boolean", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." - } + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards)." + }, + "explode": true }, { - "name": "allow_no_indices", + "name": "fielddata_fields", "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).", + "description": "Comma-separated list of fields for `fielddata` index metric (supports wildcards).", + "style": "form", "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)." - } + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields for `fielddata` index metric (supports wildcards)." + }, + "explode": true }, { - "name": "expand_wildcards", + "name": "fields", "in": "query", - "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "description": "Comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards).", + "style": "form", "schema": { - "$ref": "#/components/schemas/ExpandWildcards" - } + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards)." + }, + "explode": true }, { - "name": "q", + "name": "groups", "in": "query", - "description": "Query in the Lucene query string syntax.", + "description": "Comma-separated list of search groups for `search` index metric.", + "style": "form", "schema": { - "type": "string", - "description": "Query in the Lucene query string syntax." - } + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of search groups for `search` index metric." + }, + "explode": true }, { - "name": "analyzer", + "name": "level", "in": "query", - "description": "The analyzer to use for the query string.", + "description": "Return stats aggregated at cluster, index or shard level.", "schema": { - "type": "string", - "description": "The analyzer to use for the query string." + "$ref": "#/components/schemas/IndiciesStatLevel" } }, { - "name": "analyze_wildcard", + "name": "include_segment_file_sizes", "in": "query", - "description": "Specify whether wildcard and prefix queries should be analyzed.", + "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": "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." + "description": "Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested)." } }, { - "name": "lenient", + "name": "include_unloaded_segments", "in": "query", - "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored.", + "description": "If set to true segment stats will include stats for segments that are not currently loaded into memory.", "schema": { "type": "boolean", - "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored." + "default": false, + "description": "If set to true segment stats will include stats for segments that are not currently loaded into memory." } }, { - "name": "rewrite", + "name": "expand_wildcards", "in": "query", - "description": "Provide a more detailed explanation showing the actual Lucene query that will be executed.", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", "schema": { - "type": "boolean", - "description": "Provide a more detailed explanation showing the actual Lucene query that will be executed." + "$ref": "#/components/schemas/ExpandWildcards" } }, { - "name": "all_shards", + "name": "forbid_closed_indices", "in": "query", - "description": "Execute validation on all shards instead of one random shard per index.", + "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", - "description": "Execute validation on all shards instead of one random shard per index." + "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": "IndicesValidateQuery_Get 200 response" + "description": "IndicesStats_WithMetric 200 response" } }, - "x-operation-group": "indices.validate_query", + "x-operation-group": "indices.stats", "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" - } - } - } + } + }, + "/_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": "explain", + "name": "nodes", "in": "query", - "description": "Return detailed information about the error.", + "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": "boolean", - "description": "Return detailed information about the error." - } + "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": "ignore_unavailable", + "name": "actions", "in": "query", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "description": "Comma-separated list of actions that should be returned. Leave empty to return all.", + "style": "form", "schema": { - "type": "boolean", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." - } + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of actions that should be returned. Leave empty to return all." + }, + "explode": true }, { - "name": "allow_no_indices", + "name": "detailed", "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).", + "description": "Return detailed task information.", "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." + "default": false, + "description": "Return detailed task information." } }, { - "name": "analyzer", + "name": "parent_task_id", "in": "query", - "description": "The analyzer to use for the query string.", + "description": "Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all.", "schema": { "type": "string", - "description": "The analyzer to use for the query string." + "description": "Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all." } }, { - "name": "analyze_wildcard", + "name": "wait_for_completion", "in": "query", - "description": "Specify whether wildcard and prefix queries should be analyzed.", + "description": "Should this request wait until the operation has completed before returning.", "schema": { "type": "boolean", "default": false, - "description": "Specify whether wildcard and prefix queries should be analyzed." + "description": "Should this request wait until the operation has completed before returning." } }, { - "name": "default_operator", + "name": "group_by", "in": "query", - "description": "The default operator for query string query (AND or OR).", + "description": "Group tasks by nodes or parent/child relationships.", "schema": { - "$ref": "#/components/schemas/DefaultOperator" + "$ref": "#/components/schemas/GroupBy" } }, { - "name": "df", + "name": "timeout", "in": "query", - "description": "The field to use as default where no field prefix is given in the query string.", + "description": "Operation timeout.", "schema": { "type": "string", - "description": "The field to use as default where no field prefix is given in the query 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": "lenient", + "name": "actions", "in": "query", - "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored.", + "description": "Comma-separated list of actions that should be cancelled. Leave empty to cancel all.", + "style": "form", "schema": { - "type": "boolean", - "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored." - } + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of actions that should be cancelled. Leave empty to cancel all." + }, + "explode": true }, { - "name": "rewrite", + "name": "parent_task_id", "in": "query", - "description": "Provide a more detailed explanation showing the actual Lucene query that will be executed.", + "description": "Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all.", "schema": { - "type": "boolean", - "description": "Provide a more detailed explanation showing the actual Lucene query that will be executed." + "type": "string", + "description": "Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all." } }, { - "name": "all_shards", + "name": "wait_for_completion", "in": "query", - "description": "Execute validation on all shards instead of one random shard per index.", + "description": "Should this request wait until the operation has completed before returning.", "schema": { "type": "boolean", - "description": "Execute validation on all shards instead of one random shard per index." + "default": false, + "description": "Should this request wait until the operation has completed before returning." } } ], "responses": { "200": { - "description": "IndicesValidateQuery_Post 200 response" + "description": "TasksCancel 200 response" } }, - "x-operation-group": "indices.validate_query", + "x-operation-group": "tasks.cancel", "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.", + "/_tasks/{task_id}": { + "get": { + "description": "Returns information about a task.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" - }, - "operationId": "IndicesRollover", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/IndicesRollover_BodyParams" - } - } - } + "url": "https://opensearch.org/docs/latest/api-reference/tasks/" }, + "operationId": "TasksGet", "parameters": [ { - "name": "alias", + "name": "task_id", "in": "path", - "description": "The name of the alias to rollover.", + "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": "The name of the alias to rollover." + "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": "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", + "name": "wait_for_completion", "in": "query", - "description": "If set to true the rollover action will only be validated but not actually performed even if a condition matches.", + "description": "Should this request wait until the operation has completed before returning.", "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 + "description": "Should this request wait until the operation has completed before returning." } }, { - "name": "cluster_manager_timeout", + "name": "timeout", "in": "query", - "description": "Operation timeout for connection to cluster-manager node.", + "description": "Operation timeout.", "schema": { "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", - "description": "Operation timeout for connection to cluster-manager node.", + "description": "Operation timeout.", "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" + "description": "TasksGet 200 response" } }, - "x-operation-group": "indices.rollover", + "x-operation-group": "tasks.get", "x-version-added": "1.0" } }, - "/{alias}/_rollover/{new_index}": { + "/_tasks/{task_id}/_cancel": { "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" - } - } - } - }, + "description": "Cancels a task, if it can be cancelled through an API.", + "operationId": "TasksCancel_WithTaskId", "parameters": [ { - "name": "alias", + "name": "task_id", "in": "path", - "description": "The name of the alias to rollover.", + "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": "The name of the alias to rollover." + "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": "new_index", - "in": "path", - "description": "The name of the rollover index.", + "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": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", - "description": "The name of the rollover index." + "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." }, - "required": true + "explode": true }, { - "name": "timeout", + "name": "actions", "in": "query", - "description": "Operation timeout.", + "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", - "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", - "description": "Operation timeout.", - "x-data-type": "time" + "description": "Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all." } }, { - "name": "dry_run", + "name": "wait_for_completion", "in": "query", - "description": "If set to true the rollover action will only be validated but not actually performed even if a condition matches.", + "description": "Should this request wait until the operation has completed before returning.", "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." + "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." } }, { @@ -17820,51 +18306,44 @@ } }, { - "name": "wait_for_active_shards", + "name": "local", "in": "query", - "description": "Set the number of active shards to wait for on the newly created rollover index before the operation returns.", + "description": "Return local information, do not retrieve the state from cluster-manager node.", "schema": { - "type": "string", - "description": "Set the number of active shards to wait for on the newly created rollover index before the operation returns." + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." } } ], "responses": { "200": { - "description": "IndicesRollover_WithNewIndex 200 response" + "description": "IndicesGetTemplate 200 response" } }, - "x-operation-group": "indices.rollover", + "x-operation-group": "indices.get_template", "x-version-added": "1.0" } }, - "/{index}": { + "/_template/{name}": { "delete": { - "description": "Deletes an index.", + "description": "Deletes an index template.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest/api-reference/index-apis/delete-index/" + "url": "https://opensearch.org/docs/latest" }, - "operationId": "IndicesDelete", + "operationId": "IndicesDeleteTemplate", "parameters": [ { - "name": "index", + "name": "name", "in": "path", - "description": "Comma-separated list of indices to delete; use `_all` or `*` string to delete all indices.", + "description": "The name of the template.", "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" + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the template." }, - "required": true, - "examples": { - "IndicesDelete_example1": { - "summary": "Examples for Delete Index Operation.", - "description": "", - "value": "books" - } - } + "required": true }, { "name": "timeout", @@ -17892,116 +18371,41 @@ } }, { - "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", + "name": "cluster_manager_timeout", "in": "query", - "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "description": "Operation timeout for connection to cluster-manager node.", "schema": { - "$ref": "#/components/schemas/ExpandWildcards" + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-data-type": "time" } } ], "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 - } - } - } - } - } + "description": "IndicesDeleteTemplate 200 response" } }, - "x-operation-group": "indices.delete", + "x-operation-group": "indices.delete_template", "x-version-added": "1.0" }, "get": { - "description": "Returns information about one or more indices.", - "externalDocs": { - "description": "API Reference", - "url": "https://opensearch.org/docs/latest" - }, - "operationId": "IndicesGet", + "description": "Returns an index template.", + "operationId": "IndicesGetTemplate_WithName", "parameters": [ { - "name": "index", + "name": "name", "in": "path", - "description": "Comma-separated list of indices.", + "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 list of indices.", + "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": "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", @@ -18012,16 +18416,6 @@ "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", @@ -18046,156 +18440,215 @@ "description": "Operation timeout for connection to cluster-manager node.", "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": "IndicesGet 200 response" + "description": "IndicesGetTemplate_WithName 200 response" } }, - "x-operation-group": "indices.get", + "x-operation-group": "indices.get_template", "x-version-added": "1.0" }, "head": { - "description": "Returns information about whether a particular index exists.", + "description": "Returns information about whether a particular index template exists.", "externalDocs": { "description": "API Reference", "url": "https://opensearch.org/docs/latest" }, - "operationId": "IndicesExists", + "operationId": "IndicesExistsTemplate", "parameters": [ { - "name": "index", + "name": "name", "in": "path", - "description": "Comma-separated list of indices.", + "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 list of indices.", + "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": "local", + "name": "flat_settings", "in": "query", - "description": "Return local information, do not retrieve the state from cluster-manager node.", + "description": "Return settings in flat format.", "schema": { "type": "boolean", "default": false, - "description": "Return local information, do not retrieve the state from cluster-manager node." + "description": "Return settings in flat format." } }, { - "name": "ignore_unavailable", + "name": "master_timeout", "in": "query", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "description": "Operation timeout for connection to master node.", "schema": { - "type": "boolean", - "default": false, - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + "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": "allow_no_indices", + "name": "local", "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).", + "description": "Return local information, do not retrieve the state from cluster-manager node.", "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)." + "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": "expand_wildcards", + "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": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "description": "The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers).", "schema": { - "$ref": "#/components/schemas/ExpandWildcards" + "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": "flat_settings", + "name": "create", "in": "query", - "description": "Return settings in flat format.", + "description": "Whether the index template should only be added if new or can also replace an existing one.", "schema": { "type": "boolean", "default": false, - "description": "Return settings in flat format." + "description": "Whether the index template should only be added if new or can also replace an existing one." } }, { - "name": "include_defaults", + "name": "master_timeout", "in": "query", - "description": "Whether to return all default setting for each of the indices.", + "description": "Operation timeout for connection to master node.", "schema": { - "type": "boolean", - "default": false, - "description": "Whether to return all default setting for each of the indices." + "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-data-type": "time" } } ], "responses": { "200": { - "description": "IndicesExists 200 response" + "description": "IndicesPutTemplate_Post 200 response" } }, - "x-operation-group": "indices.exists", + "x-operation-group": "indices.put_template", "x-version-added": "1.0" }, "put": { - "description": "Creates an index with optional settings and mappings.", + "description": "Creates or updates an index template.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest/api-reference/index-apis/create-index/" + "url": "https://opensearch.org/docs/latest/im-plugin/index-templates/" }, - "operationId": "IndicesCreate", + "operationId": "IndicesPutTemplate_Put", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/IndicesCreate_BodyParams" + "$ref": "#/components/schemas/IndicesPutTemplate_BodyParams" } } - } + }, + "required": true }, "parameters": [ { - "name": "index", + "name": "name", "in": "path", - "description": "Index name.", + "description": "The name of the template.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", - "description": "Index name." + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the template." }, - "required": true, - "examples": { - "IndicesCreate_example1": { - "summary": "Examples for Create Index Operation.", - "description": "", - "value": "books" - } - } + "required": true }, { - "name": "wait_for_active_shards", + "name": "order", "in": "query", - "description": "Set the number of active shards to wait for before the operation returns.", + "description": "The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers).", "schema": { - "type": "string", - "description": "Set the number of active shards to wait for before the operation returns." + "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": "timeout", + "name": "create", "in": "query", - "description": "Operation timeout.", + "description": "Whether the index template should only be added if new or can also replace an existing one.", "schema": { - "type": "string", - "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", - "description": "Operation timeout.", - "x-data-type": "time" + "type": "boolean", + "default": false, + "description": "Whether the index template should only be added if new or can also replace an existing one." } }, { @@ -18226,48 +18679,63 @@ ], "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 - } - } - } - } - } + "description": "IndicesPutTemplate_Put 200 response" } }, - "x-operation-group": "indices.create", + "x-operation-group": "indices.put_template", "x-version-added": "1.0" } }, - "/{index}/_alias": { - "get": { - "description": "Returns an alias.", - "operationId": "IndicesGetAlias_WithIndex", + "/_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": "index", + "name": "task_id", "in": "path", - "description": "Comma-separated list of indices to filter aliases.", + "description": "The task id to rethrottle.", "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" + "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", @@ -18293,132 +18761,96 @@ "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" + "description": "IndicesGetUpgrade 200 response" } }, - "x-operation-group": "indices.get_alias", + "x-operation-group": "indices.get_upgrade", "x-version-added": "1.0" - } - }, - "/{index}/_alias/{name}": { - "delete": { - "description": "Deletes an alias.", + }, + "post": { + "description": "The _upgrade API is no longer useful and will be removed.", "externalDocs": { "description": "API Reference", "url": "https://opensearch.org/docs/latest" }, - "operationId": "IndicesDeleteAlias", + "operationId": "IndicesUpgrade", "parameters": [ { - "name": "index", - "in": "path", - "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "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": "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 + "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": "name", - "in": "path", - "description": "Comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices.", + "name": "expand_wildcards", + "in": "query", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", "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 + "$ref": "#/components/schemas/ExpandWildcards" + } }, { - "name": "timeout", + "name": "ignore_unavailable", "in": "query", - "description": "Operation timeout.", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", "schema": { - "type": "string", - "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", - "description": "Operation timeout.", - "x-data-type": "time" + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." } }, { - "name": "master_timeout", + "name": "wait_for_completion", "in": "query", - "description": "Operation timeout for connection to master node.", + "description": "Should this request wait until the operation has completed before returning.", "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 + "type": "boolean", + "default": false, + "description": "Should this request wait until the operation has completed before returning." } }, { - "name": "cluster_manager_timeout", + "name": "only_ancient_segments", "in": "query", - "description": "Operation timeout for connection to cluster-manager node.", + "description": "If true, only ancient (an older Lucene major release) segments will be upgraded.", "schema": { - "type": "string", - "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", - "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "type": "boolean", + "description": "If true, only ancient (an older Lucene major release) segments will be upgraded." } } ], "responses": { "200": { - "description": "IndicesDeleteAlias 200 response" + "description": "IndicesUpgrade 200 response" } }, - "x-operation-group": "indices.delete_alias", + "x-operation-group": "indices.upgrade", "x-version-added": "1.0" - }, + } + }, + "/_validate/query": { "get": { - "description": "Returns an alias.", - "operationId": "IndicesGetAlias_WithIndexName", + "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": "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.", + "name": "explain", + "in": "query", + "description": "Return detailed information about the error.", "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 + "type": "boolean", + "description": "Return detailed information about the error." + } }, { "name": "ignore_unavailable", @@ -18447,290 +18879,242 @@ } }, { - "name": "local", + "name": "q", "in": "query", - "description": "Return local information, do not retrieve the state from cluster-manager node.", + "description": "Query in the Lucene query string syntax.", "schema": { - "type": "boolean", - "default": false, - "description": "Return local information, do not retrieve the state from cluster-manager node." + "type": "string", + "description": "Query in the Lucene query string syntax." } - } - ], - "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.", + "name": "analyzer", + "in": "query", + "description": "The analyzer to use for the query string.", "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 + "description": "The analyzer to use for the query string." + } }, { - "name": "name", - "in": "path", - "description": "Comma-separated list of alias names.", + "name": "analyze_wildcard", + "in": "query", + "description": "Specify whether wildcard and prefix queries should be analyzed.", "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 + "type": "boolean", + "default": false, + "description": "Specify whether wildcard and prefix queries should be analyzed." + } }, { - "name": "ignore_unavailable", + "name": "default_operator", "in": "query", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "description": "The default operator for query string query (AND or OR).", "schema": { - "type": "boolean", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + "$ref": "#/components/schemas/DefaultOperator" } }, { - "name": "allow_no_indices", + "name": "df", "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).", + "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": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)." + "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored." } }, { - "name": "expand_wildcards", + "name": "rewrite", "in": "query", - "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "description": "Provide a more detailed explanation showing the actual Lucene query that will be executed.", "schema": { - "$ref": "#/components/schemas/ExpandWildcards" + "type": "boolean", + "description": "Provide a more detailed explanation showing the actual Lucene query that will be executed." } }, { - "name": "local", + "name": "all_shards", "in": "query", - "description": "Return local information, do not retrieve the state from cluster-manager node.", + "description": "Execute validation on all shards instead of one random shard per index.", "schema": { "type": "boolean", - "default": false, - "description": "Return local information, do not retrieve the state from cluster-manager node." + "description": "Execute validation on all shards instead of one random shard per index." } } ], "responses": { "200": { - "description": "IndicesExistsAlias_WithIndex 200 response" + "description": "IndicesValidateQuery_Get 200 response" } }, - "x-operation-group": "indices.exists_alias", + "x-operation-group": "indices.validate_query", "x-version-added": "1.0" }, "post": { - "description": "Creates or updates an alias.", - "operationId": "IndicesPutAlias_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/IndicesPutAlias_BodyParams" + "$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.", + "name": "explain", + "in": "query", + "description": "Return detailed information about the error.", "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 + "type": "boolean", + "description": "Return detailed information about the error." + } }, { - "name": "name", - "in": "path", - "description": "The name of the alias to be created or updated.", + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", "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 + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } }, { - "name": "timeout", + "name": "allow_no_indices", "in": "query", - "description": "Operation timeout.", + "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": "string", - "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", - "description": "Operation timeout.", - "x-data-type": "time" + "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": "master_timeout", + "name": "expand_wildcards", "in": "query", - "description": "Operation timeout for connection to master node.", + "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", - "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 + "description": "Query in the Lucene query string syntax." } }, { - "name": "cluster_manager_timeout", + "name": "analyzer", "in": "query", - "description": "Operation timeout for connection to cluster-manager node.", + "description": "The analyzer to use for the query string.", "schema": { "type": "string", - "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", - "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "description": "The analyzer to use for the query string." } - } - ], - "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" - }, - "operationId": "IndicesPutAlias_Put", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/IndicesPutAlias_BodyParams" - } + }, + { + "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." } - } - }, - "parameters": [ + }, { - "name": "index", - "in": "path", - "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "name": "default_operator", + "in": "query", + "description": "The default operator for query string query (AND or OR).", "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 + "$ref": "#/components/schemas/DefaultOperator" + } }, { - "name": "name", - "in": "path", - "description": "The name of the alias to be created or updated.", + "name": "df", + "in": "query", + "description": "The field to use as default where no field prefix is given in the query string.", "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 + "description": "The field to use as default where no field prefix is given in the query string." + } }, { - "name": "timeout", + "name": "lenient", "in": "query", - "description": "Operation timeout.", + "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored.", "schema": { - "type": "string", - "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", - "description": "Operation timeout.", - "x-data-type": "time" + "type": "boolean", + "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored." } }, { - "name": "master_timeout", + "name": "rewrite", "in": "query", - "description": "Operation timeout for connection to master node.", + "description": "Provide a more detailed explanation showing the actual Lucene query that will be executed.", "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 + "type": "boolean", + "description": "Provide a more detailed explanation showing the actual Lucene query that will be executed." } }, { - "name": "cluster_manager_timeout", + "name": "all_shards", "in": "query", - "description": "Operation timeout for connection to cluster-manager node.", + "description": "Execute validation on all shards instead of one random shard per index.", "schema": { - "type": "string", - "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", - "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "type": "boolean", + "description": "Execute validation on all shards instead of one random shard per index." } } ], "responses": { "200": { - "description": "IndicesPutAlias_Put 200 response" + "description": "IndicesValidateQuery_Post 200 response" } }, - "x-operation-group": "indices.put_alias", + "x-operation-group": "indices.validate_query", "x-version-added": "1.0" } }, - "/{index}/_aliases/{name}": { - "delete": { - "description": "Deletes an alias.", - "operationId": "IndicesDeleteAlias_Plural", + "/{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": "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", + "name": "alias", "in": "path", - "description": "Comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices.", + "description": "The name of the alias to rollover.", "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" + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the alias to rollover." }, "required": true }, @@ -18745,6 +19129,16 @@ "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", @@ -18769,49 +19163,59 @@ "description": "Operation timeout for connection to cluster-manager node.", "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": "IndicesDeleteAlias_Plural 200 response" + "description": "IndicesRollover 200 response" } }, - "x-operation-group": "indices.delete_alias", + "x-operation-group": "indices.rollover", "x-version-added": "1.0" - }, + } + }, + "/{alias}/_rollover/{new_index}": { "post": { - "description": "Creates or updates an alias.", - "operationId": "IndicesPutAlias_Post_Plural", + "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/IndicesPutAlias_BodyParams" + "$ref": "#/components/schemas/IndicesRollover_BodyParams" } } } }, "parameters": [ { - "name": "index", + "name": "alias", "in": "path", - "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "description": "The name of the alias to rollover.", "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" + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the alias to rollover." }, "required": true }, { - "name": "name", + "name": "new_index", "in": "path", - "description": "The name of the alias to be created or updated.", + "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 alias to be created or updated." + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the rollover index." }, "required": true }, @@ -18826,6 +19230,16 @@ "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", @@ -18850,51 +19264,53 @@ "description": "Operation timeout for connection to cluster-manager node.", "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": "IndicesPutAlias_Post_Plural 200 response" + "description": "IndicesRollover_WithNewIndex 200 response" } }, - "x-operation-group": "indices.put_alias", + "x-operation-group": "indices.rollover", "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" - } - } - } + } + }, + "/{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; use `_all` or empty string to perform the operation on all indices.", + "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; use `_all` or empty string to perform the operation on all indices.", + "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 - }, - { - "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 + "required": true, + "examples": { + "IndicesDelete_example1": { + "summary": "Examples for Delete Index Operation.", + "description": "", + "value": "books" + } + } }, { "name": "timeout", @@ -18922,144 +19338,134 @@ } }, { - "name": "cluster_manager_timeout", + "name": "ignore_unavailable", "in": "query", - "description": "Operation timeout for connection to cluster-manager node.", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", "schema": { - "type": "string", - "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", - "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "type": "boolean", + "default": false, + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." } - } - ], - "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.", + "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": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", - "description": "The name of the index to scope the operation." - }, - "required": true + "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": "index", + "name": "expand_wildcards", "in": "query", - "description": "The name of the index to scope the operation.", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", "schema": { - "type": "string", - "description": "The name of the index to scope the operation." + "$ref": "#/components/schemas/ExpandWildcards" } } ], "responses": { "200": { - "description": "IndicesAnalyze_Get_WithIndex 200 response" + "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.analyze", + "x-operation-group": "indices.delete", "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" - } - } - } + "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": "The name of the index to scope the operation.", + "description": "Comma-separated list of indices.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", - "description": "The name of the index to scope the operation." + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices.", + "x-data-type": "array" }, "required": true }, { - "name": "index", + "name": "local", "in": "query", - "description": "The name of the index to scope the operation.", + "description": "Return local information, do not retrieve the state from cluster-manager node.", "schema": { - "type": "string", - "description": "The name of the index to scope the operation." + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." } - } - ], - "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.", + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", "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 + "type": "boolean", + "default": false, + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } }, { - "name": "block", - "in": "path", - "description": "The block to add (one of read, write, read_only or metadata).", + "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": "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 + "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": "timeout", + "name": "expand_wildcards", "in": "query", - "description": "Operation timeout.", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", "schema": { - "type": "string", - "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", - "description": "Operation timeout.", - "x-data-type": "time" + "$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." } }, { @@ -19086,6 +19492,45 @@ "description": "Operation timeout for connection to cluster-manager node.", "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", @@ -19093,6 +19538,7 @@ "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)." } }, @@ -19102,6 +19548,7 @@ "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)." } }, @@ -19112,351 +19559,385 @@ "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": "IndicesAddBlock 200 response" + "description": "IndicesExists 200 response" } }, - "x-operation-group": "indices.add_block", + "x-operation-group": "indices.exists", "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", + }, + "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/Bulk_BodyParams" + "$ref": "#/components/schemas/IndicesCreate_BodyParams" } } - }, - "required": true + } }, "parameters": [ { "name": "index", "in": "path", - "description": "Default index for items which don't provide one.", + "description": "Index name.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", - "description": "Default index for items which don't provide one." + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Index name." }, - "required": true + "required": true, + "examples": { + "IndicesCreate_example1": { + "summary": "Examples for Create Index Operation.", + "description": "", + "value": "books" + } + } }, { "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).", + "description": "Set the number of active shards to wait for before the operation returns.", "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)." + "description": "Set the number of active shards to wait for before the operation returns." } }, { - "name": "refresh", + "name": "timeout", "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.", + "description": "Operation timeout.", "schema": { - "$ref": "#/components/schemas/RefreshEnum" + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" } }, { - "name": "routing", + "name": "master_timeout", "in": "query", - "description": "Routing value.", + "description": "Operation timeout for connection to master node.", "schema": { "type": "string", - "description": "Routing value." + "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": "timeout", + "name": "cluster_manager_timeout", "in": "query", - "description": "Operation timeout.", + "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.", + "description": "Operation timeout for connection to cluster-manager node.", "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." + } + ], + "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": "_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", + "name": "index", + "in": "path", + "description": "Comma-separated list of indices to filter aliases.", "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." + "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" }, - "explode": true + "required": true }, { - "name": "_source_excludes", + "name": "ignore_unavailable", "in": "query", - "description": "Default list of fields to exclude from the returned _source field, can be overridden on each sub-request.", - "style": "form", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", "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 + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } }, { - "name": "_source_includes", + "name": "allow_no_indices", "in": "query", - "description": "Default list of fields to extract and return from the _source field, can be overridden on each sub-request.", - "style": "form", + "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": "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 + "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": "pipeline", + "name": "expand_wildcards", "in": "query", - "description": "The pipeline id to preprocess incoming documents with.", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", "schema": { - "type": "string", - "description": "The pipeline id to preprocess incoming documents with." + "$ref": "#/components/schemas/ExpandWildcards" } }, { - "name": "require_alias", + "name": "local", "in": "query", - "description": "Sets require_alias for all incoming documents.", + "description": "Return local information, do not retrieve the state from cluster-manager node.", "schema": { "type": "boolean", "default": false, - "description": "Sets require_alias for all incoming documents." + "description": "Return local information, do not retrieve the state from cluster-manager node." } } ], "responses": { "200": { - "description": "Bulk_Post_WithIndex 200 response" + "description": "IndicesGetAlias_WithIndex 200 response" } }, - "x-operation-group": "bulk", + "x-operation-group": "indices.get_alias", "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 + } + }, + "/{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": "Default index for items which don't provide one.", + "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": "Default index for items which don't provide one." + "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": "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).", + "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", - "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)." - } + "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": "refresh", + "name": "timeout", "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.", + "description": "Operation timeout.", "schema": { - "$ref": "#/components/schemas/RefreshEnum" + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" } }, { - "name": "routing", + "name": "master_timeout", "in": "query", - "description": "Routing value.", + "description": "Operation timeout for connection to master node.", "schema": { "type": "string", - "description": "Routing value." + "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": "timeout", + "name": "cluster_manager_timeout", "in": "query", - "description": "Operation timeout.", + "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.", + "description": "Operation timeout for connection to cluster-manager node.", "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": "type", - "in": "query", - "description": "Default document type for items which don't provide one.", + "name": "index", + "in": "path", + "description": "Comma-separated list of indices to filter aliases.", "schema": { "type": "string", - "description": "Default document type for items which don't provide one." - } + "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": "_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", + "name": "name", + "in": "path", + "description": "Comma-separated list of alias names.", "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." + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of alias names.", + "x-data-type": "array" }, - "explode": true + "required": true }, { - "name": "_source_excludes", + "name": "ignore_unavailable", "in": "query", - "description": "Default list of fields to exclude from the returned _source field, can be overridden on each sub-request.", - "style": "form", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", "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 + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } }, { - "name": "_source_includes", + "name": "allow_no_indices", "in": "query", - "description": "Default list of fields to extract and return from the _source field, can be overridden on each sub-request.", - "style": "form", + "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": "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 + "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": "pipeline", + "name": "expand_wildcards", "in": "query", - "description": "The pipeline id to preprocess incoming documents with.", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", "schema": { - "type": "string", - "description": "The pipeline id to preprocess incoming documents with." + "$ref": "#/components/schemas/ExpandWildcards" } }, { - "name": "require_alias", + "name": "local", "in": "query", - "description": "Sets require_alias for all incoming documents.", + "description": "Return local information, do not retrieve the state from cluster-manager node.", "schema": { "type": "boolean", "default": false, - "description": "Sets require_alias for all incoming documents." + "description": "Return local information, do not retrieve the state from cluster-manager node." } } ], "responses": { "200": { - "description": "Bulk_Put_WithIndex 200 response" + "description": "IndicesGetAlias_WithIndexName 200 response" } }, - "x-operation-group": "bulk", + "x-operation-group": "indices.get_alias", "x-version-added": "1.0" - } - }, - "/{index}/_cache/clear": { - "post": { - "description": "Clears all or specific caches for one or more indices.", - "operationId": "IndicesClearCache_WithIndex", + }, + "head": { + "description": "Returns information about whether a particular alias exists.", + "operationId": "IndicesExistsAlias_WithIndex", "parameters": [ { "name": "index", "in": "path", - "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "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; use `_all` or empty string to perform the operation on all indices.", + "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": "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", + "name": "name", + "in": "path", + "description": "Comma-separated list of alias names.", "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Comma-separated list of fields to clear when using the `fielddata` parameter (default: all)." + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of alias names.", + "x-data-type": "array" }, - "explode": true - }, - { - "name": "query", - "in": "query", - "description": "Clear query caches.", - "schema": { - "type": "boolean", - "description": "Clear query caches." - } + "required": true }, { "name": "ignore_unavailable", @@ -19485,47 +19966,32 @@ } }, { - "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", + "name": "local", "in": "query", - "description": "Clear request cache.", + "description": "Return local information, do not retrieve the state from cluster-manager node.", "schema": { "type": "boolean", - "description": "Clear request cache." + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." } } ], "responses": { "200": { - "description": "IndicesClearCache_WithIndex 200 response" + "description": "IndicesExistsAlias_WithIndex 200 response" } }, - "x-operation-group": "indices.clear_cache", + "x-operation-group": "indices.exists_alias", "x-version-added": "1.0" - } - }, - "/{index}/_clone/{target}": { + }, "post": { - "description": "Clones an index.", - "operationId": "IndicesClone_Post", + "description": "Creates or updates an alias.", + "operationId": "IndicesPutAlias_Post", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/IndicesClone_BodyParams" + "$ref": "#/components/schemas/IndicesPutAlias_BodyParams" } } } @@ -19534,22 +20000,23 @@ { "name": "index", "in": "path", - "description": "The name of the source index to clone.", + "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": "The name of the source index to clone." + "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": "target", + "name": "name", "in": "path", - "description": "The name of the target index.", + "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 target index." + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the alias to be created or updated." }, "required": true }, @@ -19588,37 +20055,28 @@ "description": "Operation timeout for connection to cluster-manager node.", "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" + "description": "IndicesPutAlias_Post 200 response" } }, - "x-operation-group": "indices.clone", + "x-operation-group": "indices.put_alias", "x-version-added": "1.0" }, "put": { - "description": "Clones an index.", + "description": "Creates or updates an alias.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/im-plugin/index-alias/#create-aliases" }, - "operationId": "IndicesClone_Put", + "operationId": "IndicesPutAlias_Put", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/IndicesClone_BodyParams" + "$ref": "#/components/schemas/IndicesPutAlias_BodyParams" } } } @@ -19627,22 +20085,23 @@ { "name": "index", "in": "path", - "description": "The name of the source index to clone.", + "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": "The name of the source index to clone." + "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": "target", + "name": "name", "in": "path", - "description": "The name of the target index.", + "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 target index." + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the alias to be created or updated." }, "required": true }, @@ -19681,43 +20140,42 @@ "description": "Operation timeout for connection to cluster-manager node.", "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" + "description": "IndicesPutAlias_Put 200 response" } }, - "x-operation-group": "indices.clone", + "x-operation-group": "indices.put_alias", "x-version-added": "1.0" } }, - "/{index}/_close": { - "post": { - "description": "Closes an index.", - "externalDocs": { - "description": "API Reference", - "url": "https://opensearch.org/docs/latest" - }, - "operationId": "IndicesClose", + "/{index}/_aliases/{name}": { + "delete": { + "description": "Deletes an alias.", + "operationId": "IndicesDeleteAlias_Plural", "parameters": [ { "name": "index", "in": "path", - "description": "Comma-separated list of indices to close.", + "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 to close.", + "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 @@ -19757,219 +20215,221 @@ "description": "Operation timeout for connection to cluster-manager node.", "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" + "description": "IndicesDeleteAlias_Plural 200 response" } }, - "x-operation-group": "indices.close", + "x-operation-group": "indices.delete_alias", "x-version-added": "1.0" - } - }, - "/{index}/_count": { - "get": { - "description": "Returns number of documents matching a query.", - "operationId": "Count_Get_WithIndex", + }, + "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 to restrict the results.", + "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 to restrict the results.", + "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).", + "name": "name", + "in": "path", + "description": "The name of the alias to be created or updated.", "schema": { - "type": "boolean", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." - } + "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": "ignore_throttled", + "name": "timeout", "in": "query", - "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled.", + "description": "Operation timeout.", "schema": { - "type": "boolean", - "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled." + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" } }, { - "name": "allow_no_indices", + "name": "master_timeout", "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).", + "description": "Operation timeout for connection to master node.", "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)." + "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": "expand_wildcards", + "name": "cluster_manager_timeout", "in": "query", - "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "description": "Operation timeout for connection to cluster-manager node.", "schema": { - "$ref": "#/components/schemas/ExpandWildcards" + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-data-type": "time" } - }, - { - "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" + } + ], + "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": "preference", - "in": "query", - "description": "Specify the node or shard the operation should be performed on.", + "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", - "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." + "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" }, - "explode": true + "required": true }, { - "name": "q", - "in": "query", - "description": "Query in the Lucene query string syntax.", + "name": "name", + "in": "path", + "description": "The name of the alias to be created or updated.", "schema": { "type": "string", - "description": "Query in the Lucene query string syntax." - } + "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": "analyzer", + "name": "timeout", "in": "query", - "description": "The analyzer to use for the query string.", + "description": "Operation timeout.", "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." + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" } }, { - "name": "default_operator", + "name": "master_timeout", "in": "query", - "description": "The default operator for query string query (AND or OR).", + "description": "Operation timeout for connection to master node.", "schema": { - "$ref": "#/components/schemas/DefaultOperator" + "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": "df", + "name": "cluster_manager_timeout", "in": "query", - "description": "The field to use as default where no field prefix is given in the query string.", + "description": "Operation timeout for connection to cluster-manager node.", "schema": { "type": "string", - "description": "The field to use as default where no field prefix is given in the query string." + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "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": "lenient", - "in": "query", - "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored.", + "name": "index", + "in": "path", + "description": "The name of the index to scope the operation.", "schema": { - "type": "boolean", - "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored." - } + "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": "terminate_after", + "name": "index", "in": "query", - "description": "The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.", + "description": "The name of the index to scope the operation.", "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" + "type": "string", + "description": "The name of the index to scope the operation." } } ], "responses": { "200": { - "description": "Count_Get_WithIndex 200 response" + "description": "IndicesAnalyze_Get_WithIndex 200 response" } }, - "x-operation-group": "count", + "x-operation-group": "indices.analyze", "x-version-added": "1.0" }, "post": { - "description": "Returns number of documents matching a query.", - "operationId": "Count_Post_WithIndex", + "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/Count_BodyParams" + "$ref": "#/components/schemas/IndicesAnalyze_BodyParams" } } } @@ -19978,192 +20438,160 @@ { "name": "index", "in": "path", - "description": "Comma-separated list of indices to restrict the results.", + "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": "Comma-separated list of indices to restrict the results.", - "x-data-type": "array" + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the index to scope the operation." }, "required": true }, { - "name": "ignore_unavailable", + "name": "index", "in": "query", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "description": "The name of the index to scope the operation.", "schema": { - "type": "boolean", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + "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": "ignore_throttled", - "in": "query", - "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled.", + "name": "index", + "in": "path", + "description": "Comma-separated list of indices to add a block to.", "schema": { - "type": "boolean", - "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled." - } + "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": "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.", + "name": "block", + "in": "path", + "description": "The block to add (one of read, write, read_only or metadata).", "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." + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The block to add (one of read, write, read_only or metadata)." }, - "explode": true + "required": true }, { - "name": "q", + "name": "timeout", "in": "query", - "description": "Query in the Lucene query string syntax.", + "description": "Operation timeout.", "schema": { "type": "string", - "description": "Query in the Lucene query string syntax." + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" } }, { - "name": "analyzer", + "name": "master_timeout", "in": "query", - "description": "The analyzer to use for the query string.", + "description": "Operation timeout for connection to master node.", "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." + "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": "default_operator", + "name": "cluster_manager_timeout", "in": "query", - "description": "The default operator for query string query (AND or OR).", + "description": "Operation timeout for connection to cluster-manager node.", "schema": { - "$ref": "#/components/schemas/DefaultOperator" + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-data-type": "time" } }, { - "name": "df", + "name": "ignore_unavailable", "in": "query", - "description": "The field to use as default where no field prefix is given in the query string.", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", "schema": { - "type": "string", - "description": "The field to use as default where no field prefix is given in the query string." + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." } }, { - "name": "lenient", + "name": "allow_no_indices", "in": "query", - "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored.", + "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": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored." + "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": "terminate_after", + "name": "expand_wildcards", "in": "query", - "description": "The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", "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" + "$ref": "#/components/schemas/ExpandWildcards" } } ], "responses": { "200": { - "description": "Count_Post_WithIndex 200 response" + "description": "IndicesAddBlock 200 response" } }, - "x-operation-group": "count", + "x-operation-group": "indices.add_block", "x-version-added": "1.0" } }, - "/{index}/_create/{id}": { + "/{index}/_bulk": { "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", + "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/Create_BodyParams" + "$ref": "#/components/schemas/Bulk_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.", + "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": "Index name." + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Default index for items which don't provide one." }, "required": true }, @@ -20206,22 +20634,55 @@ } }, { - "name": "version", + "name": "type", "in": "query", - "description": "Explicit version number for concurrency control.", + "description": "Default document type for items which don't provide one.", "schema": { - "type": "integer", - "description": "Explicit version number for concurrency control.", - "format": "int32" + "type": "string", + "description": "Default document type for items which don't provide one." } }, { - "name": "version_type", + "name": "_source", "in": "query", - "description": "Specific version type.", + "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": { - "$ref": "#/components/schemas/VersionType" - } + "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", @@ -20231,53 +20692,48 @@ "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": "Create_Post 200 response" + "description": "Bulk_Post_WithIndex 200 response" } }, - "x-operation-group": "create", + "x-operation-group": "bulk", "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" - }, - "operationId": "Create_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/Create_BodyParams" + "$ref": "#/components/schemas/Bulk_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.", + "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": "Index name." + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Default index for items which don't provide one." }, "required": true }, @@ -20320,118 +20776,132 @@ } }, { - "name": "version", + "name": "type", "in": "query", - "description": "Explicit version number for concurrency control.", + "description": "Default document type for items which don't provide one.", "schema": { - "type": "integer", - "description": "Explicit version number for concurrency control.", - "format": "int32" + "type": "string", + "description": "Default document type for items which don't provide one." } }, { - "name": "version_type", + "name": "_source", "in": "query", - "description": "Specific version type.", + "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": { - "$ref": "#/components/schemas/VersionType" - } + "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": "pipeline", + "name": "_source_excludes", "in": "query", - "description": "The pipeline id to preprocess incoming documents with.", + "description": "Default list of fields to exclude from the returned _source field, can be overridden on each sub-request.", + "style": "form", "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" - }, - "operationId": "DeleteByQuery", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DeleteByQuery_BodyParams" - } - } + "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 }, - "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.", + "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": "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" + "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." }, - "required": true + "explode": true }, { - "name": "analyzer", + "name": "pipeline", "in": "query", - "description": "The analyzer to use for the query string.", + "description": "The pipeline id to preprocess incoming documents with.", "schema": { "type": "string", - "description": "The analyzer to use for the query string." + "description": "The pipeline id to preprocess incoming documents with." } }, { - "name": "analyze_wildcard", + "name": "require_alias", "in": "query", - "description": "Specify whether wildcard and prefix queries should be analyzed.", + "description": "Sets require_alias for all incoming documents.", "schema": { "type": "boolean", "default": false, - "description": "Specify whether wildcard and prefix queries should be analyzed." + "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": "default_operator", + "name": "fielddata", "in": "query", - "description": "The default operator for query string query (AND or OR).", + "description": "Clear field data.", "schema": { - "$ref": "#/components/schemas/DefaultOperator" + "type": "boolean", + "description": "Clear field data." } }, { - "name": "df", + "name": "fields", "in": "query", - "description": "The field to use as default where no field prefix is given in the query string.", + "description": "Comma-separated list of fields to clear when using the `fielddata` parameter (default: all).", + "style": "form", "schema": { - "type": "string", - "description": "The field to use as default where no field prefix is given in the query string." - } + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields to clear when using the `fielddata` parameter (default: all)." + }, + "explode": true }, { - "name": "from", + "name": "query", "in": "query", - "description": "Starting offset.", + "description": "Clear query caches.", "schema": { - "type": "integer", - "default": 0, - "description": "Starting offset.", - "format": "int32" + "type": "boolean", + "description": "Clear query caches." } }, { @@ -20452,14 +20922,6 @@ "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", @@ -20469,673 +20931,725 @@ } }, { - "name": "lenient", + "name": "index", "in": "query", - "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored.", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "style": "form", "schema": { - "type": "boolean", - "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored." - } + "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": "preference", + "name": "request", "in": "query", - "description": "Specify the node or shard the operation should be performed on.", + "description": "Clear request cache.", "schema": { - "type": "string", - "default": "random", - "description": "Specify the node or shard the operation should be performed on." + "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": "q", - "in": "query", - "description": "Query in the Lucene query string syntax.", + "name": "index", + "in": "path", + "description": "The name of the source index to clone.", "schema": { "type": "string", - "description": "Query in the Lucene query string syntax." - } + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the source index to clone." + }, + "required": true }, { - "name": "routing", - "in": "query", - "description": "Comma-separated list of specific routing values.", - "style": "form", + "name": "target", + "in": "path", + "description": "The name of the target index.", "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Comma-separated list of specific routing values." + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the target index." }, - "explode": true + "required": true }, { - "name": "scroll", + "name": "timeout", "in": "query", - "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", + "description": "Operation timeout.", "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.", + "description": "Operation timeout.", "x-data-type": "time" } }, { - "name": "search_type", + "name": "master_timeout", "in": "query", - "description": "Search operation type.", + "description": "Operation timeout for connection to master node.", "schema": { - "$ref": "#/components/schemas/SearchType" + "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": "search_timeout", + "name": "cluster_manager_timeout", "in": "query", - "description": "Explicit timeout for each search request. Defaults to no timeout.", + "description": "Operation timeout for connection to cluster-manager node.", "schema": { "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", - "description": "Explicit timeout for each search request. Defaults to no timeout.", + "description": "Operation timeout for connection to cluster-manager node.", "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", + "name": "wait_for_active_shards", "in": "query", - "description": "Maximum number of documents to process (default: all documents).", + "description": "Set the number of active shards to wait for on the cloned index before the operation returns.", "schema": { - "type": "integer", - "description": "Maximum number of documents to process (default: all documents).", - "format": "int32" + "type": "string", + "description": "Set the number of active shards to wait for on the cloned index before the operation returns." } - }, - { - "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 - }, + } + ], + "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": "_source", - "in": "query", - "description": "True or false to return the _source field or not, or a list of fields to return.", - "style": "form", + "name": "index", + "in": "path", + "description": "The name of the source index to clone.", "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "True or false to return the _source field or not, or a list of fields to return." + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the source index to clone." }, - "explode": true + "required": true }, { - "name": "_source_excludes", - "in": "query", - "description": "List of fields to exclude from the returned _source field.", - "style": "form", + "name": "target", + "in": "path", + "description": "The name of the target index.", "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of fields to exclude from the returned _source field." + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the target index." }, - "explode": true + "required": true }, { - "name": "_source_includes", + "name": "timeout", "in": "query", - "description": "List of fields to extract and return from the _source field.", - "style": "form", + "description": "Operation timeout.", "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of fields to extract and return from the _source field." - }, - "explode": true + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } }, { - "name": "terminate_after", + "name": "master_timeout", "in": "query", - "description": "The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.", + "description": "Operation timeout for connection to master node.", "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" + "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": "stats", + "name": "cluster_manager_timeout", "in": "query", - "description": "Specific 'tag' of the request for logging and statistical purposes.", - "style": "form", + "description": "Operation timeout for connection to cluster-manager node.", "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Specific 'tag' of the request for logging and statistical purposes." - }, - "explode": true + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-data-type": "time" + } }, { - "name": "version", + "name": "wait_for_active_shards", "in": "query", - "description": "Whether to return document version as part of a hit.", + "description": "Set the number of active shards to wait for on the cloned index before the operation returns.", "schema": { - "type": "boolean", - "description": "Whether to return document version as part of a hit." + "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": "request_cache", - "in": "query", - "description": "Specify if request cache should be used for this request or not, defaults to index level setting.", + "name": "index", + "in": "path", + "description": "Comma-separated list of indices to close.", "schema": { - "type": "boolean", - "description": "Specify if request cache should be used for this request or not, defaults to index level setting." - } + "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": "refresh", + "name": "timeout", "in": "query", - "description": "Refresh the shard containing the document before performing the operation.", + "description": "Operation timeout.", "schema": { - "type": "boolean", - "description": "Refresh the shard containing the document before performing the operation." + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" } }, { - "name": "timeout", + "name": "master_timeout", "in": "query", - "description": "Time each individual bulk request should wait for shards that are unavailable.", + "description": "Operation timeout for connection to master node.", "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" + "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": "wait_for_active_shards", + "name": "cluster_manager_timeout", "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).", + "description": "Operation timeout for connection to cluster-manager node.", "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)." + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-data-type": "time" } }, { - "name": "scroll_size", + "name": "ignore_unavailable", "in": "query", - "description": "Size on the scroll request powering the operation.", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", "schema": { - "type": "integer", - "default": 100, - "description": "Size on the scroll request powering the operation.", - "format": "int32" + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." } }, { - "name": "wait_for_completion", + "name": "allow_no_indices", "in": "query", - "description": "Should this request wait until the operation has completed before returning.", + "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": true, - "description": "Should this request wait until the operation has completed before returning." + "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": "requests_per_second", + "name": "expand_wildcards", "in": "query", - "description": "The throttle for this request in sub-requests per second. -1 means no throttle.", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", "schema": { - "type": "integer", - "default": 0, - "description": "The throttle for this request in sub-requests per second. -1 means no throttle.", - "format": "int32" + "$ref": "#/components/schemas/ExpandWildcards" } }, { - "name": "slices", + "name": "wait_for_active_shards", "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`.", + "description": "Sets the number of active shards to wait for before the operation returns.", "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`." + "description": "Sets the number of active shards to wait for before the operation returns." } } ], "responses": { "200": { - "description": "DeleteByQuery 200 response" + "description": "IndicesClose 200 response" } }, - "x-operation-group": "delete_by_query", + "x-operation-group": "indices.close", "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" - }, - "operationId": "Index_Post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Index_BodyParams" - } - } - }, - "required": true - }, + "/{index}/_count": { + "get": { + "description": "Returns number of documents matching a query.", + "operationId": "Count_Get_WithIndex", "parameters": [ { "name": "index", "in": "path", - "description": "Index name.", + "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": "Index name." + "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": "wait_for_active_shards", + "name": "ignore_unavailable", "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).", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", "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)." + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." } }, { - "name": "op_type", + "name": "ignore_throttled", "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.", + "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled.", "schema": { - "$ref": "#/components/schemas/OpType" + "type": "boolean", + "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled." } }, { - "name": "refresh", + "name": "allow_no_indices", "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.", + "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": { - "$ref": "#/components/schemas/RefreshEnum" + "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": "routing", + "name": "expand_wildcards", "in": "query", - "description": "Routing value.", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", "schema": { - "type": "string", - "description": "Routing value." + "$ref": "#/components/schemas/ExpandWildcards" } }, { - "name": "timeout", + "name": "min_score", "in": "query", - "description": "Operation timeout.", + "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", - "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", - "description": "Operation timeout.", - "x-data-type": "time" + "default": "random", + "description": "Specify the node or shard the operation should be performed on." } }, { - "name": "version", + "name": "routing", "in": "query", - "description": "Explicit version number for concurrency control.", + "description": "Comma-separated list of specific routing values.", + "style": "form", "schema": { - "type": "integer", - "description": "Explicit version number for concurrency control.", - "format": "int32" + "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": "version_type", + "name": "analyzer", "in": "query", - "description": "Specific version type.", + "description": "The analyzer to use for the query string.", "schema": { - "$ref": "#/components/schemas/VersionType" + "type": "string", + "description": "The analyzer to use for the query string." } }, { - "name": "if_seq_no", + "name": "analyze_wildcard", "in": "query", - "description": "only perform the operation if the last operation that has changed the document has the specified sequence number.", + "description": "Specify whether wildcard and prefix queries should be analyzed.", "schema": { - "type": "integer", - "description": "only perform the operation if the last operation that has changed the document has the specified sequence number.", - "format": "int32" + "type": "boolean", + "default": false, + "description": "Specify whether wildcard and prefix queries should be analyzed." } }, { - "name": "if_primary_term", + "name": "default_operator", "in": "query", - "description": "only perform the operation if the last operation that has changed the document has the specified primary term.", + "description": "The default operator for query string query (AND or OR).", "schema": { - "type": "integer", - "description": "only perform the operation if the last operation that has changed the document has the specified primary term.", - "format": "int32" + "$ref": "#/components/schemas/DefaultOperator" } }, { - "name": "pipeline", + "name": "df", "in": "query", - "description": "The pipeline id to preprocess incoming documents with.", + "description": "The field to use as default where no field prefix is given in the query string.", "schema": { "type": "string", - "description": "The pipeline id to preprocess incoming documents with." + "description": "The field to use as default where no field prefix is given in the query string." } }, { - "name": "require_alias", + "name": "lenient", "in": "query", - "description": "When true, requires destination to be an alias.", + "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored.", "schema": { "type": "boolean", - "default": false, - "description": "When true, requires destination to be an alias." + "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": "Index_Post 200 response" + "description": "Count_Get_WithIndex 200 response" } }, - "x-operation-group": "index", + "x-operation-group": "count", "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" + }, + "post": { + "description": "Returns number of documents matching a query.", + "operationId": "Count_Post_WithIndex", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Count_BodyParams" + } + } + } }, - "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.", + "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": "Index name." + "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": "wait_for_active_shards", + "name": "ignore_unavailable", "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).", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", "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)." + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." } }, { - "name": "refresh", + "name": "ignore_throttled", "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.", + "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled.", "schema": { - "$ref": "#/components/schemas/RefreshEnum" + "type": "boolean", + "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled." } }, { - "name": "routing", + "name": "allow_no_indices", "in": "query", - "description": "Routing value.", + "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": "string", - "description": "Routing value." + "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": "timeout", + "name": "expand_wildcards", "in": "query", - "description": "Operation timeout.", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", "schema": { - "type": "string", - "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", - "description": "Operation timeout.", - "x-data-type": "time" + "$ref": "#/components/schemas/ExpandWildcards" } }, { - "name": "if_seq_no", + "name": "min_score", "in": "query", - "description": "only perform the operation if the last operation that has changed the document has the specified sequence number.", + "description": "Include only documents with a specific `_score` value in the result.", "schema": { "type": "integer", - "description": "only perform the operation if the last operation that has changed the document has the specified sequence number.", + "description": "Include only documents with a specific `_score` value in the result.", "format": "int32" } }, { - "name": "if_primary_term", + "name": "preference", "in": "query", - "description": "only perform the operation if the last operation that has changed the document has the specified primary term.", + "description": "Specify the node or shard the operation should be performed on.", "schema": { - "type": "integer", - "description": "only perform the operation if the last operation that has changed the document has the specified primary term.", - "format": "int32" + "type": "string", + "default": "random", + "description": "Specify the node or shard the operation should be performed on." } }, { - "name": "version", + "name": "routing", "in": "query", - "description": "Explicit version number for concurrency control.", + "description": "Comma-separated list of specific routing values.", + "style": "form", "schema": { - "type": "integer", - "description": "Explicit version number for concurrency control.", - "format": "int32" - } + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of specific routing values." + }, + "explode": true }, { - "name": "version_type", + "name": "q", "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.", + "description": "Query in the Lucene query string syntax.", "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" - } + "description": "Query in the Lucene query string syntax." } }, { - "name": "index", - "in": "path", - "description": "Index name.", + "name": "analyzer", + "in": "query", + "description": "The analyzer to use for the query string.", "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" - } + "description": "The analyzer to use for the query string." } }, { - "name": "stored_fields", + "name": "analyze_wildcard", "in": "query", - "description": "Comma-separated list of stored fields to return.", - "style": "form", + "description": "Specify whether wildcard and prefix queries should be analyzed.", "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Comma-separated list of stored fields to return." - }, - "explode": true + "type": "boolean", + "default": false, + "description": "Specify whether wildcard and prefix queries should be analyzed." + } }, { - "name": "preference", + "name": "default_operator", "in": "query", - "description": "Specify the node or shard the operation should be performed on.", + "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", - "default": "random", - "description": "Specify the node or shard the operation should be performed on." + "description": "The field to use as default where no field prefix is given in the query string." } }, { - "name": "realtime", + "name": "lenient", "in": "query", - "description": "Specify whether to perform the operation in realtime or search mode.", + "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored.", "schema": { "type": "boolean", - "description": "Specify whether to perform the operation in realtime or search mode." + "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored." } }, { - "name": "refresh", + "name": "terminate_after", "in": "query", - "description": "Refresh the shard containing the document before performing the operation.", + "description": "The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.", "schema": { - "type": "boolean", - "description": "Refresh the shard containing the document before performing the operation." + "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": "routing", + "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": "Routing value.", + "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", - "description": "Routing value." + "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", + "name": "refresh", "in": "query", - "description": "True or false to return the _source field or not, or a list of fields to return.", - "style": "form", + "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": { - "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 + "$ref": "#/components/schemas/RefreshEnum" + } }, { - "name": "_source_excludes", + "name": "routing", "in": "query", - "description": "List of fields to exclude from the returned _source field.", - "style": "form", + "description": "Routing value.", "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of fields to exclude from the returned _source field." - }, - "explode": true + "type": "string", + "description": "Routing value." + } }, { - "name": "_source_includes", + "name": "timeout", "in": "query", - "description": "List of fields to extract and return from the _source field.", - "style": "form", + "description": "Operation timeout.", "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of fields to extract and return from the _source field." - }, - "explode": true + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } }, { "name": "version", @@ -21154,41 +21668,42 @@ "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": "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 - } - } - } - } - } + "description": "Create_Post 200 response" } }, - "x-operation-group": "get", + "x-operation-group": "create", "x-version-added": "1.0" }, - "head": { - "description": "Returns information about whether a document exists in an index.", + "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" + "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 }, - "operationId": "Exists", "parameters": [ { "name": "id", @@ -21196,7 +21711,7 @@ "description": "Document ID.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", "description": "Document ID." }, "required": true @@ -21207,108 +21722,53 @@ "description": "Index name.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", + "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", + "name": "wait_for_active_shards", "in": "query", - "description": "Specify the node or shard the operation should be performed on.", + "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": "random", - "description": "Specify the node or shard the operation should be performed on." + "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": "realtime", + "name": "refresh", "in": "query", - "description": "Specify whether to perform the operation in realtime or search mode.", + "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": { - "type": "boolean", - "description": "Specify whether to perform the operation in realtime or search mode." + "$ref": "#/components/schemas/RefreshEnum" } }, { - "name": "refresh", + "name": "routing", "in": "query", - "description": "Refresh the shard containing the document before performing the operation.", + "description": "Routing value.", "schema": { - "type": "boolean", - "description": "Refresh the shard containing the document before performing the operation." + "type": "string", + "description": "Routing value." } }, { - "name": "routing", + "name": "timeout", "in": "query", - "description": "Routing value.", + "description": "Operation timeout.", "schema": { "type": "string", - "description": "Routing value." + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" } }, { - "name": "_source", + "name": "version", "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.", + "description": "Explicit version number for concurrency control.", "schema": { "type": "integer", "description": "Explicit version number for concurrency control.", @@ -21322,432 +21782,244 @@ "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": "Exists 200 response" + "description": "Create_Put 200 response" } }, - "x-operation-group": "exists", + "x-operation-group": "create", "x-version-added": "1.0" - }, + } + }, + "/{index}/_delete_by_query": { "post": { - "description": "Creates or updates a document in an index.", - "operationId": "Index_Post_WithId", + "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/Index_BodyParams" + "$ref": "#/components/schemas/DeleteByQuery_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.", + "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": "Index name." + "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": "wait_for_active_shards", + "name": "analyzer", "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).", + "description": "The analyzer to use for the query string.", "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" + "description": "The analyzer to use for the query string." } }, { - "name": "refresh", + "name": "analyze_wildcard", "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.", + "description": "Specify whether wildcard and prefix queries should be analyzed.", "schema": { - "$ref": "#/components/schemas/RefreshEnum" + "type": "boolean", + "default": false, + "description": "Specify whether wildcard and prefix queries should be analyzed." } }, { - "name": "routing", + "name": "default_operator", "in": "query", - "description": "Routing value.", + "description": "The default operator for query string query (AND or OR).", "schema": { - "type": "string", - "description": "Routing value." + "$ref": "#/components/schemas/DefaultOperator" } }, { - "name": "timeout", + "name": "df", "in": "query", - "description": "Operation timeout.", + "description": "The field to use as default where no field prefix is given in the query string.", "schema": { "type": "string", - "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", - "description": "Operation timeout.", - "x-data-type": "time" + "description": "The field to use as default where no field prefix is given in the query string." } }, { - "name": "version", + "name": "from", "in": "query", - "description": "Explicit version number for concurrency control.", + "description": "Starting offset.", "schema": { "type": "integer", - "description": "Explicit version number for concurrency control.", + "default": 0, + "description": "Starting offset.", "format": "int32" } }, { - "name": "version_type", + "name": "ignore_unavailable", "in": "query", - "description": "Specific version type.", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", "schema": { - "$ref": "#/components/schemas/VersionType" + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." } }, { - "name": "if_seq_no", + "name": "allow_no_indices", "in": "query", - "description": "only perform the operation if the last operation that has changed the document has the specified sequence number.", + "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": "integer", - "description": "only perform the operation if the last operation that has changed the document has the specified sequence number.", - "format": "int32" + "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": "if_primary_term", + "name": "conflicts", "in": "query", - "description": "only perform the operation if the last operation that has changed the document has the specified primary term.", + "description": "What to do when the operation encounters version conflicts?.", "schema": { - "type": "integer", - "description": "only perform the operation if the last operation that has changed the document has the specified primary term.", - "format": "int32" + "$ref": "#/components/schemas/Conflicts" } }, { - "name": "pipeline", + "name": "expand_wildcards", "in": "query", - "description": "The pipeline id to preprocess incoming documents with.", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", "schema": { - "type": "string", - "description": "The pipeline id to preprocess incoming documents with." + "$ref": "#/components/schemas/ExpandWildcards" } }, { - "name": "require_alias", + "name": "lenient", "in": "query", - "description": "When true, requires destination to be an alias.", + "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored.", "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" - } + "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored." } }, - "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.", + "name": "preference", + "in": "query", + "description": "Specify the node or shard the operation should be performed on.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", - "description": "Index name." - }, - "required": true + "default": "random", + "description": "Specify the node or shard the operation should be performed on." + } }, { - "name": "wait_for_active_shards", + "name": "q", "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).", + "description": "Query in the Lucene query string syntax.", "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)." + "description": "Query in the Lucene query string syntax." } }, { - "name": "op_type", + "name": "routing", "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.", + "description": "Comma-separated list of specific routing values.", + "style": "form", "schema": { - "$ref": "#/components/schemas/OpType" - } + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of specific routing values." + }, + "explode": true }, { - "name": "refresh", + "name": "scroll", "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.", + "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", "schema": { - "$ref": "#/components/schemas/RefreshEnum" + "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": "routing", + "name": "search_type", "in": "query", - "description": "Routing value.", + "description": "Search operation type.", "schema": { - "type": "string", - "description": "Routing value." + "$ref": "#/components/schemas/SearchType" } }, { - "name": "timeout", + "name": "search_timeout", "in": "query", - "description": "Operation timeout.", + "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": "Operation timeout.", + "description": "Explicit timeout for each search request. Defaults to no timeout.", "x-data-type": "time" } }, { - "name": "version", + "name": "size", "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.", + "description": "Deprecated, please use `max_docs` instead.", "schema": { "type": "integer", - "description": "only perform the operation if the last operation that has changed the document has the specified sequence number.", + "description": "Deprecated, please use `max_docs` instead.", "format": "int32" } }, { - "name": "if_primary_term", + "name": "max_docs", "in": "query", - "description": "only perform the operation if the last operation that has changed the document has the specified primary term.", + "description": "Maximum number of documents to process (default: all documents).", "schema": { "type": "integer", - "description": "only perform the operation if the last operation that has changed the document has the specified primary term.", + "description": "Maximum number of documents to process (default: all documents).", "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" - }, - "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", + "name": "sort", "in": "query", - "description": "Comma-separated list of stored fields to return.", + "description": "Comma-separated list of : pairs.", "style": "form", "schema": { "type": "array", "items": { "type": "string" }, - "description": "Comma-separated list of stored fields to return." + "description": "Comma-separated list of : pairs." }, "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", @@ -21789,674 +22061,731 @@ "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.", + "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": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", - "description": "Document ID." - }, - "required": true + "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": "index", - "in": "path", - "description": "Index name.", + "name": "stats", + "in": "query", + "description": "Specific 'tag' of the request for logging and statistical purposes.", + "style": "form", "schema": { - "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", - "description": "Index name." + "type": "array", + "items": { + "type": "string" + }, + "description": "Specific 'tag' of the request for logging and statistical purposes." }, - "required": true + "explode": true }, { - "name": "analyze_wildcard", + "name": "version", "in": "query", - "description": "Specify whether wildcards and prefix queries in the query string query should be analyzed.", + "description": "Whether to return document version as part of a hit.", "schema": { "type": "boolean", - "default": false, - "description": "Specify whether wildcards and prefix queries in the query string query should be analyzed." + "description": "Whether to return document version as part of a hit." } }, { - "name": "analyzer", + "name": "request_cache", "in": "query", - "description": "The analyzer to use for the query string.", + "description": "Specify if request cache should be used for this request or not, defaults to index level setting.", "schema": { - "type": "string", - "description": "The analyzer to use for the query string." + "type": "boolean", + "description": "Specify if request cache should be used for this request or not, defaults to index level setting." } }, { - "name": "default_operator", + "name": "refresh", "in": "query", - "description": "The default operator for query string query (AND or OR).", + "description": "Refresh the shard containing the document before performing the operation.", "schema": { - "$ref": "#/components/schemas/DefaultOperator" + "type": "boolean", + "description": "Refresh the shard containing the document before performing the operation." } }, { - "name": "df", + "name": "timeout", "in": "query", - "description": "The default field for query string query.", + "description": "Time each individual bulk request should wait for shards that are unavailable.", "schema": { "type": "string", - "default": "_all", - "description": "The default field for query string query." + "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": "stored_fields", + "name": "wait_for_active_shards", "in": "query", - "description": "Comma-separated list of stored fields to return.", - "style": "form", + "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": "array", - "items": { - "type": "string" - }, - "description": "Comma-separated list of stored fields to return." - }, - "explode": true + "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": "lenient", + "name": "scroll_size", "in": "query", - "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored.", + "description": "Size on the scroll request powering the operation.", "schema": { - "type": "boolean", - "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored." + "type": "integer", + "default": 100, + "description": "Size on the scroll request powering the operation.", + "format": "int32" } }, { - "name": "preference", + "name": "wait_for_completion", "in": "query", - "description": "Specify the node or shard the operation should be performed on.", + "description": "Should this request wait until the operation has completed before returning.", "schema": { - "type": "string", - "default": "random", - "description": "Specify the node or shard the operation should be performed on." + "type": "boolean", + "default": true, + "description": "Should this request wait until the operation has completed before returning." } }, { - "name": "q", + "name": "requests_per_second", "in": "query", - "description": "Query in the Lucene query string syntax.", + "description": "The throttle for this request in sub-requests per second. -1 means no throttle.", "schema": { - "type": "string", - "description": "Query in the Lucene query string syntax." + "type": "integer", + "default": 0, + "description": "The throttle for this request in sub-requests per second. -1 means no throttle.", + "format": "int32" } }, { - "name": "routing", + "name": "slices", "in": "query", - "description": "Routing value.", + "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", - "description": "Routing value." + "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": "_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" + "description": "DeleteByQuery 200 response" } }, - "x-operation-group": "explain", + "x-operation-group": "delete_by_query", "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", + "/{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": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "description": "Index name.", "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" + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Index name." }, "required": true }, { - "name": "fields", + "name": "wait_for_active_shards", "in": "query", - "description": "Comma-separated list of field names.", - "style": "form", + "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": "array", - "items": { - "type": "string" - }, - "description": "Comma-separated list of field names." - }, - "explode": true + "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": "ignore_unavailable", + "name": "op_type", "in": "query", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "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": { - "type": "boolean", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + "$ref": "#/components/schemas/OpType" } }, { - "name": "allow_no_indices", + "name": "refresh", "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).", + "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": { - "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)." + "$ref": "#/components/schemas/RefreshEnum" } }, { - "name": "expand_wildcards", + "name": "routing", "in": "query", - "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "description": "Routing value.", "schema": { - "$ref": "#/components/schemas/ExpandWildcards" + "type": "string", + "description": "Routing value." } }, { - "name": "include_unmapped", + "name": "timeout", "in": "query", - "description": "Indicates whether unmapped fields should be included in the response.", + "description": "Operation timeout.", "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" - } + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" } - } - }, - "parameters": [ + }, { - "name": "index", - "in": "path", - "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "name": "version", + "in": "query", + "description": "Explicit version number for concurrency control.", "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 + "type": "integer", + "description": "Explicit version number for concurrency control.", + "format": "int32" + } }, { - "name": "fields", + "name": "version_type", "in": "query", - "description": "Comma-separated list of field names.", - "style": "form", + "description": "Specific version type.", "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Comma-separated list of field names." - }, - "explode": true + "$ref": "#/components/schemas/VersionType" + } }, { - "name": "ignore_unavailable", + "name": "if_seq_no", "in": "query", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "description": "only perform the operation if the last operation that has changed the document has the specified sequence number.", "schema": { - "type": "boolean", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + "type": "integer", + "description": "only perform the operation if the last operation that has changed the document has the specified sequence number.", + "format": "int32" } }, { - "name": "allow_no_indices", + "name": "if_primary_term", "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).", + "description": "only perform the operation if the last operation that has changed the document has the specified primary term.", "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)." + "type": "integer", + "description": "only perform the operation if the last operation that has changed the document has the specified primary term.", + "format": "int32" } }, { - "name": "expand_wildcards", + "name": "pipeline", "in": "query", - "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "description": "The pipeline id to preprocess incoming documents with.", "schema": { - "$ref": "#/components/schemas/ExpandWildcards" + "type": "string", + "description": "The pipeline id to preprocess incoming documents with." } }, { - "name": "include_unmapped", + "name": "require_alias", "in": "query", - "description": "Indicates whether unmapped fields should be included in the response.", + "description": "When true, requires destination to be an alias.", "schema": { "type": "boolean", "default": false, - "description": "Indicates whether unmapped fields should be included in the response." + "description": "When true, requires destination to be an alias." } } ], "responses": { "200": { - "description": "FieldCaps_Post_WithIndex 200 response" + "description": "Index_Post 200 response" } }, - "x-operation-group": "field_caps", + "x-operation-group": "index", "x-version-added": "1.0" } }, - "/{index}/_flush": { - "get": { - "description": "Performs the flush operation on one or more indices.", - "operationId": "IndicesFlush_Get_WithIndex", + "/{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": "index", + "name": "id", "in": "path", - "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "description": "Document ID.", "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" + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Document ID." }, "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).", + "name": "index", + "in": "path", + "description": "Index name.", "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)." - } + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Index name." + }, + "required": true }, { - "name": "wait_if_ongoing", + "name": "wait_for_active_shards", "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.", + "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": "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." + "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": "ignore_unavailable", + "name": "refresh", "in": "query", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "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": { - "type": "boolean", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + "$ref": "#/components/schemas/RefreshEnum" } }, { - "name": "allow_no_indices", + "name": "routing", "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).", + "description": "Routing value.", "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)." + "type": "string", + "description": "Routing value." } }, { - "name": "expand_wildcards", + "name": "timeout", "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.", + "description": "Operation timeout.", "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)." + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" } }, { - "name": "wait_if_ongoing", + "name": "if_seq_no", "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.", + "description": "only perform the operation if the last operation that has changed the document has the specified sequence number.", "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." + "type": "integer", + "description": "only perform the operation if the last operation that has changed the document has the specified sequence number.", + "format": "int32" } }, { - "name": "ignore_unavailable", + "name": "if_primary_term", "in": "query", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "description": "only perform the operation if the last operation that has changed the document has the specified primary term.", "schema": { - "type": "boolean", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + "type": "integer", + "description": "only perform the operation if the last operation that has changed the document has the specified primary term.", + "format": "int32" } }, { - "name": "allow_no_indices", + "name": "version", "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).", + "description": "Explicit version number for concurrency control.", "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)." + "type": "integer", + "description": "Explicit version number for concurrency control.", + "format": "int32" } }, { - "name": "expand_wildcards", + "name": "version_type", "in": "query", - "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "description": "Specific version type.", "schema": { - "$ref": "#/components/schemas/ExpandWildcards" + "$ref": "#/components/schemas/VersionType" } } ], "responses": { "200": { - "description": "IndicesFlush_Post_WithIndex 200 response" + "description": "Delete 200 response" } }, - "x-operation-group": "indices.flush", + "x-operation-group": "delete", "x-version-added": "1.0" - } - }, - "/{index}/_forcemerge": { - "post": { - "description": "Performs the force merge operation on one or more indices.", - "operationId": "IndicesForcemerge_WithIndex", + }, + "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": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "description": "Index name.", "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" + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Index name." }, - "required": true + "required": true, + "examples": { + "Get_example1": { + "summary": "Examples for Get document doc Operation.", + "description": "", + "value": "books" + } + } }, { - "name": "flush", + "name": "stored_fields", "in": "query", - "description": "Specify whether the index should be flushed after performing the operation.", + "description": "Comma-separated list of stored fields to return.", + "style": "form", "schema": { - "type": "boolean", - "default": true, - "description": "Specify whether the index should be flushed after performing the operation." + "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": "ignore_unavailable", + "name": "realtime", "in": "query", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "description": "Specify whether to perform the operation in realtime or search mode.", "schema": { "type": "boolean", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + "description": "Specify whether to perform the operation in realtime or search mode." } }, { - "name": "allow_no_indices", + "name": "refresh", "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).", + "description": "Refresh the shard containing the document before performing the operation.", "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)." + "description": "Refresh the shard containing the document before performing the operation." } }, { - "name": "expand_wildcards", + "name": "routing", "in": "query", - "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "description": "Routing value.", "schema": { - "$ref": "#/components/schemas/ExpandWildcards" + "type": "string", + "description": "Routing value." } }, { - "name": "max_num_segments", + "name": "_source", "in": "query", - "description": "The number of segments the index should be merged into (default: dynamic).", + "description": "True or false to return the _source field or not, or a list of fields to return.", + "style": "form", "schema": { - "type": "integer", - "description": "The number of segments the index should be merged into (default: dynamic).", - "format": "int32" - } + "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": "only_expunge_deletes", + "name": "_source_excludes", "in": "query", - "description": "Specify whether the operation should only expunge deleted documents.", + "description": "List of fields to exclude from the returned _source field.", + "style": "form", "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", + "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": "Comma-separated list of indices.", + "description": "Index name.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", - "description": "Comma-separated list of indices.", - "x-data-type": "array" + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Index name." }, "required": true }, { - "name": "ignore_unavailable", + "name": "stored_fields", "in": "query", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "description": "Comma-separated list of stored fields to return.", + "style": "form", "schema": { - "type": "boolean", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + "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": "allow_no_indices", + "name": "realtime", "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).", + "description": "Specify whether to perform the operation in realtime or search mode.", "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)." + "description": "Specify whether to perform the operation in realtime or search mode." } }, { - "name": "expand_wildcards", + "name": "refresh", "in": "query", - "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "description": "Refresh the shard containing the document before performing the operation.", "schema": { - "$ref": "#/components/schemas/ExpandWildcards" + "type": "boolean", + "description": "Refresh the shard containing the document before performing the operation." } }, { - "name": "master_timeout", + "name": "routing", "in": "query", - "description": "Operation timeout for connection to master node.", + "description": "Routing value.", "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 + "description": "Routing value." } }, { - "name": "cluster_manager_timeout", + "name": "_source", "in": "query", - "description": "Operation timeout for connection to cluster-manager node.", + "description": "True or false to return the _source field or not, or a list of fields to return.", + "style": "form", "schema": { - "type": "string", - "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", - "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "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": "local", + "name": "version_type", "in": "query", - "description": "Return local information, do not retrieve the state from cluster-manager node.", + "description": "Specific version type.", "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 + "$ref": "#/components/schemas/VersionType" } } ], "responses": { "200": { - "description": "IndicesGetMapping_WithIndex 200 response" + "description": "Exists 200 response" } }, - "x-operation-group": "indices.get_mapping", + "x-operation-group": "exists", "x-version-added": "1.0" }, "post": { - "description": "Updates the index mappings.", - "operationId": "IndicesPutMapping_Post", + "description": "Creates or updates a document in an index.", + "operationId": "Index_Post_WithId", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/IndicesPutMapping_BodyParams" + "$ref": "#/components/schemas/Index_BodyParams" } } }, @@ -22464,135 +22793,210 @@ }, "parameters": [ { - "name": "index", + "name": "id", "in": "path", - "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "description": "Document ID.", "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" + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Document ID." }, "required": true }, { - "name": "timeout", - "in": "query", - "description": "Operation timeout.", + "name": "index", + "in": "path", + "description": "Index name.", "schema": { "type": "string", - "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", - "description": "Operation timeout.", - "x-data-type": "time" - } + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Index name." + }, + "required": true }, { - "name": "master_timeout", + "name": "wait_for_active_shards", "in": "query", - "description": "Operation timeout for connection to master node.", + "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", - "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 + "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": "cluster_manager_timeout", + "name": "op_type", "in": "query", - "description": "Operation timeout for connection to cluster-manager node.", + "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": { - "type": "string", - "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", - "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "$ref": "#/components/schemas/OpType" } }, { - "name": "ignore_unavailable", + "name": "refresh", "in": "query", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "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": { - "type": "boolean", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + "$ref": "#/components/schemas/RefreshEnum" } }, { - "name": "allow_no_indices", + "name": "routing", "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).", + "description": "Routing value.", "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)." + "type": "string", + "description": "Routing value." } }, { - "name": "expand_wildcards", + "name": "timeout", "in": "query", - "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "description": "Operation timeout.", "schema": { - "$ref": "#/components/schemas/ExpandWildcards" + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" } }, { - "name": "write_index_only", + "name": "version", "in": "query", - "description": "When true, applies mappings only to the write index of an alias or data stream.", + "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, applies mappings only to the write index of an alias or data stream." + "description": "When true, requires destination to be an alias." } } ], "responses": { "200": { - "description": "IndicesPutMapping_Post 200 response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/IndicesPutMapping_PostResponseContent" - } - } - } + "description": "Index_Post_WithId 200 response" } }, - "x-operation-group": "indices.put_mapping", + "x-operation-group": "index", "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", + "description": "Creates or updates a document in an index.", + "operationId": "Index_Put_WithId", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/IndicesPutMapping_BodyParams" + "$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": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "description": "Index name.", "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" + "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", @@ -22605,182 +23009,139 @@ } }, { - "name": "master_timeout", + "name": "version", "in": "query", - "description": "Operation timeout for connection to master node.", + "description": "Explicit version number for concurrency control.", "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 + "type": "integer", + "description": "Explicit version number for concurrency control.", + "format": "int32" } }, { - "name": "cluster_manager_timeout", + "name": "version_type", "in": "query", - "description": "Operation timeout for connection to cluster-manager node.", + "description": "Specific version type.", "schema": { - "type": "string", - "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", - "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "$ref": "#/components/schemas/VersionType" } }, { - "name": "ignore_unavailable", + "name": "if_seq_no", "in": "query", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "description": "only perform the operation if the last operation that has changed the document has the specified sequence number.", "schema": { - "type": "boolean", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + "type": "integer", + "description": "only perform the operation if the last operation that has changed the document has the specified sequence number.", + "format": "int32" } }, { - "name": "allow_no_indices", + "name": "if_primary_term", "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).", + "description": "only perform the operation if the last operation that has changed the document has the specified primary term.", "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)." + "type": "integer", + "description": "only perform the operation if the last operation that has changed the document has the specified primary term.", + "format": "int32" } }, { - "name": "expand_wildcards", + "name": "pipeline", "in": "query", - "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "description": "The pipeline id to preprocess incoming documents with.", "schema": { - "$ref": "#/components/schemas/ExpandWildcards" + "type": "string", + "description": "The pipeline id to preprocess incoming documents with." } }, { - "name": "write_index_only", + "name": "require_alias", "in": "query", - "description": "When true, applies mappings only to the write index of an alias or data stream.", + "description": "When true, requires destination to be an alias.", "schema": { "type": "boolean", "default": false, - "description": "When true, applies mappings only to the write index of an alias or data stream." + "description": "When true, requires destination to be an alias." } } ], "responses": { "200": { - "description": "IndicesPutMapping_Put 200 response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/IndicesPutMapping_PutResponseContent" - } - } - } + "description": "Index_Put_WithId 200 response" } }, - "x-operation-group": "indices.put_mapping", + "x-operation-group": "index", "x-version-added": "1.0" } }, - "/{index}/_mapping/field/{fields}": { + "/{index}/_explain/{id}": { "get": { - "description": "Returns mapping for one or more fields.", - "operationId": "IndicesGetFieldMapping_WithIndex", + "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": "index", + "name": "id", "in": "path", - "description": "Comma-separated list of indices.", + "description": "Document ID.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", - "description": "Comma-separated list of indices.", - "x-data-type": "array" + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Document ID." }, "required": true }, { - "name": "fields", + "name": "index", "in": "path", - "description": "Comma-separated list of fields.", + "description": "Index name.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", - "description": "Comma-separated list of fields.", - "x-data-type": "array" + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Index name." }, "required": true }, { - "name": "include_defaults", + "name": "analyze_wildcard", "in": "query", - "description": "Whether the default mapping values should be returned as well.", + "description": "Specify whether wildcards and prefix queries in the query string query should be analyzed.", "schema": { "type": "boolean", - "description": "Whether the default mapping values should be returned as well." + "default": false, + "description": "Specify whether wildcards and prefix queries in the query string query should be analyzed." } }, { - "name": "ignore_unavailable", + "name": "analyzer", "in": "query", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "description": "The analyzer to use for the query string.", "schema": { - "type": "boolean", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + "type": "string", + "description": "The analyzer to use for the query string." } }, { - "name": "allow_no_indices", + "name": "default_operator", "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).", + "description": "The default operator for query string query (AND or OR).", "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" + "$ref": "#/components/schemas/DefaultOperator" } }, { - "name": "local", + "name": "df", "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.", + "description": "The default field for query string query.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", - "description": "Index name." - }, - "required": true + "default": "_all", + "description": "The default field for query string query." + } }, { "name": "stored_fields", @@ -22797,31 +23158,31 @@ "explode": true }, { - "name": "preference", + "name": "lenient", "in": "query", - "description": "Specify the node or shard the operation should be performed on.", + "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored.", "schema": { - "type": "string", - "default": "random", - "description": "Specify the node or shard the operation should be performed on." + "type": "boolean", + "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored." } }, { - "name": "realtime", + "name": "preference", "in": "query", - "description": "Specify whether to perform the operation in realtime or search mode.", + "description": "Specify the node or shard the operation should be performed on.", "schema": { - "type": "boolean", - "description": "Specify whether to perform the operation in realtime or search mode." + "type": "string", + "default": "random", + "description": "Specify the node or shard the operation should be performed on." } }, { - "name": "refresh", + "name": "q", "in": "query", - "description": "Refresh the shard containing the document before performing the operation.", + "description": "Query in the Lucene query string syntax.", "schema": { - "type": "boolean", - "description": "Refresh the shard containing the document before performing the operation." + "type": "string", + "description": "Query in the Lucene query string syntax." } }, { @@ -22878,37 +23239,84 @@ ], "responses": { "200": { - "description": "Mget_Get_WithIndex 200 response" + "description": "Explain_Get 200 response" } }, - "x-operation-group": "mget", + "x-operation-group": "explain", "x-version-added": "1.0" }, "post": { - "description": "Allows to get multiple documents in one request.", - "operationId": "Mget_Post_WithIndex", + "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/Mget_BodyParams" + "$ref": "#/components/schemas/Explain_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)", + "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", @@ -22924,31 +23332,31 @@ "explode": true }, { - "name": "preference", + "name": "lenient", "in": "query", - "description": "Specify the node or shard the operation should be performed on.", + "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored.", "schema": { - "type": "string", - "default": "random", - "description": "Specify the node or shard the operation should be performed on." + "type": "boolean", + "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored." } }, { - "name": "realtime", + "name": "preference", "in": "query", - "description": "Specify whether to perform the operation in realtime or search mode.", + "description": "Specify the node or shard the operation should be performed on.", "schema": { - "type": "boolean", - "description": "Specify whether to perform the operation in realtime or search mode." + "type": "string", + "default": "random", + "description": "Specify the node or shard the operation should be performed on." } }, { - "name": "refresh", + "name": "q", "in": "query", - "description": "Refresh the shard containing the document before performing the operation.", + "description": "Query in the Lucene query string syntax.", "schema": { - "type": "boolean", - "description": "Refresh the shard containing the document before performing the operation." + "type": "string", + "description": "Query in the Lucene query string syntax." } }, { @@ -23005,693 +23413,510 @@ ], "responses": { "200": { - "description": "Mget_Post_WithIndex 200 response" + "description": "Explain_Post 200 response" } }, - "x-operation-group": "mget", + "x-operation-group": "explain", "x-version-added": "1.0" } }, - "/{index}/_msearch": { + "/{index}/_field_caps": { "get": { - "description": "Allows to execute several search operations in one request.", - "operationId": "Msearch_Get_WithIndex", + "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 to use as default.", + "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 to use as default.", + "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": "search_type", - "in": "query", - "description": "Search operation type.", - "schema": { - "$ref": "#/components/schemas/SearchTypeMulti" - } - }, - { - "name": "max_concurrent_searches", + "name": "fields", "in": "query", - "description": "Controls the maximum number of concurrent searches the multi search api will execute.", + "description": "Comma-separated list of field names.", + "style": "form", "schema": { - "type": "integer", - "description": "Controls the maximum number of concurrent searches the multi search api will execute.", - "format": "int32" - } + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of field names." + }, + "explode": true }, { - "name": "typed_keys", + "name": "ignore_unavailable", "in": "query", - "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response.", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", "schema": { "type": "boolean", - "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response." + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." } }, { - "name": "pre_filter_shard_size", + "name": "allow_no_indices", "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.", + "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": "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" + "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": "max_concurrent_shard_requests", + "name": "expand_wildcards", "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.", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", "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" + "$ref": "#/components/schemas/ExpandWildcards" } }, { - "name": "rest_total_hits_as_int", + "name": "include_unmapped", "in": "query", - "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response.", + "description": "Indicates whether unmapped fields should be included in the 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." + "description": "Indicates whether unmapped fields should be included in the response." } } ], "responses": { "200": { - "description": "Msearch_Get_WithIndex 200 response" + "description": "FieldCaps_Get_WithIndex 200 response" } }, - "x-operation-group": "msearch", + "x-operation-group": "field_caps", "x-version-added": "1.0" }, "post": { - "description": "Allows to execute several search operations in one request.", - "operationId": "Msearch_Post_WithIndex", + "description": "Returns the information about the capabilities of fields among multiple indices.", + "operationId": "FieldCaps_Post_WithIndex", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Msearch_BodyParams" + "$ref": "#/components/schemas/FieldCaps_BodyParams" } } - }, - "required": true + } }, "parameters": [ { "name": "index", "in": "path", - "description": "Comma-separated list of indices to use as default.", + "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 to use as default.", + "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": "search_type", + "name": "fields", "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.", + "description": "Comma-separated list of field names.", + "style": "form", "schema": { - "type": "integer", - "description": "Controls the maximum number of concurrent searches the multi search api will execute.", - "format": "int32" - } + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of field names." + }, + "explode": true }, { - "name": "typed_keys", + "name": "ignore_unavailable", "in": "query", - "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response.", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", "schema": { "type": "boolean", - "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response." + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." } }, { - "name": "pre_filter_shard_size", + "name": "allow_no_indices", "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.", + "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": "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" + "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": "max_concurrent_shard_requests", + "name": "expand_wildcards", "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.", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", "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" + "$ref": "#/components/schemas/ExpandWildcards" } }, { - "name": "rest_total_hits_as_int", + "name": "include_unmapped", "in": "query", - "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response.", + "description": "Indicates whether unmapped fields should be included in the 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." + "description": "Indicates whether unmapped fields should be included in the response." } } ], "responses": { "200": { - "description": "Msearch_Post_WithIndex 200 response" + "description": "FieldCaps_Post_WithIndex 200 response" } }, - "x-operation-group": "msearch", + "x-operation-group": "field_caps", "x-version-added": "1.0" } }, - "/{index}/_msearch/template": { + "/{index}/_flush": { "get": { - "description": "Allows to execute several search template operations in one request.", - "operationId": "MsearchTemplate_Get_WithIndex", + "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 to use as default.", + "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 to use as default.", + "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": "search_type", + "name": "force", "in": "query", - "description": "Search operation type.", + "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": { - "$ref": "#/components/schemas/SearchTypeMulti" + "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": "typed_keys", + "name": "wait_if_ongoing", "in": "query", - "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response.", + "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", - "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response." + "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": "max_concurrent_searches", + "name": "ignore_unavailable", "in": "query", - "description": "Controls the maximum number of concurrent searches the multi search api will execute.", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", "schema": { - "type": "integer", - "description": "Controls the maximum number of concurrent searches the multi search api will execute.", - "format": "int32" + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." } }, { - "name": "rest_total_hits_as_int", + "name": "allow_no_indices", "in": "query", - "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response.", + "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": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response." + "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": "ccs_minimize_roundtrips", + "name": "expand_wildcards", "in": "query", - "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution.", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", "schema": { - "type": "boolean", - "default": true, - "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution." + "$ref": "#/components/schemas/ExpandWildcards" } } ], "responses": { "200": { - "description": "MsearchTemplate_Get_WithIndex 200 response" + "description": "IndicesFlush_Get_WithIndex 200 response" } }, - "x-operation-group": "msearch_template", + "x-operation-group": "indices.flush", "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 - }, + "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 to use as default.", + "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 to use as default.", + "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": "search_type", + "name": "force", "in": "query", - "description": "Search operation type.", + "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": { - "$ref": "#/components/schemas/SearchTypeMulti" + "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": "typed_keys", + "name": "wait_if_ongoing", "in": "query", - "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response.", + "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", - "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response." + "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": "max_concurrent_searches", + "name": "ignore_unavailable", "in": "query", - "description": "Controls the maximum number of concurrent searches the multi search api will execute.", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", "schema": { - "type": "integer", - "description": "Controls the maximum number of concurrent searches the multi search api will execute.", - "format": "int32" + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." } }, { - "name": "rest_total_hits_as_int", + "name": "allow_no_indices", "in": "query", - "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response.", + "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": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response." + "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": "ccs_minimize_roundtrips", + "name": "expand_wildcards", "in": "query", - "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution.", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", "schema": { - "type": "boolean", - "default": true, - "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution." + "$ref": "#/components/schemas/ExpandWildcards" } } ], "responses": { "200": { - "description": "MsearchTemplate_Post_WithIndex 200 response" + "description": "IndicesFlush_Post_WithIndex 200 response" } }, - "x-operation-group": "msearch_template", + "x-operation-group": "indices.flush", "x-version-added": "1.0" } }, - "/{index}/_mtermvectors": { - "get": { - "description": "Returns multiple termvectors in one request.", - "operationId": "Mtermvectors_Get_WithIndex", + "/{index}/_forcemerge": { + "post": { + "description": "Performs the force merge operation on one or more indices.", + "operationId": "IndicesForcemerge_WithIndex", "parameters": [ { "name": "index", "in": "path", - "description": "The index in which the document resides.", + "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": "The index in which the document resides." + "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": "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", + "name": "flush", "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'.", + "description": "Specify whether the index should be flushed after performing the operation.", "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'." + "default": true, + "description": "Specify whether the index should be flushed after performing the operation." } }, { - "name": "field_statistics", + "name": "ignore_unavailable", "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'.", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", "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'." + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." } }, { - "name": "fields", + "name": "allow_no_indices", "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", + "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": "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 + "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": "offsets", + "name": "expand_wildcards", "in": "query", - "description": "Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'.", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", "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'." + "$ref": "#/components/schemas/ExpandWildcards" } }, { - "name": "positions", + "name": "max_num_segments", "in": "query", - "description": "Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'.", + "description": "The number of segments the index should be merged into (default: dynamic).", "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'." + "type": "integer", + "description": "The number of segments the index should be merged into (default: dynamic).", + "format": "int32" } }, { - "name": "payloads", + "name": "only_expunge_deletes", "in": "query", - "description": "Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'.", + "description": "Specify whether the operation should only expunge deleted documents.", "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" + "description": "Specify whether the operation should only expunge deleted documents." } } ], "responses": { "200": { - "description": "Mtermvectors_Get_WithIndex 200 response" + "description": "IndicesForcemerge_WithIndex 200 response" } }, - "x-operation-group": "mtermvectors", + "x-operation-group": "indices.forcemerge", "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" - } - } - } - }, + } + }, + "/{index}/_mapping": { + "get": { + "description": "Returns mappings for one or more indices.", + "operationId": "IndicesGetMapping_WithIndex", "parameters": [ { "name": "index", "in": "path", - "description": "The index in which the document resides.", + "description": "Comma-separated list of indices.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", - "description": "The index in which the document resides." + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices.", + "x-data-type": "array" }, "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", + "name": "ignore_unavailable", "in": "query", - "description": "Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'.", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", "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'." + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." } }, { - "name": "positions", + "name": "allow_no_indices", "in": "query", - "description": "Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'.", + "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": true, - "description": "Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'." + "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": "payloads", + "name": "expand_wildcards", "in": "query", - "description": "Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'.", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", "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'." + "$ref": "#/components/schemas/ExpandWildcards" } }, { - "name": "preference", + "name": "master_timeout", "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'.", + "description": "Operation timeout for connection to master node.", "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'." + "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": "routing", + "name": "cluster_manager_timeout", "in": "query", - "description": "Routing value. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'.", + "description": "Operation timeout for connection to cluster-manager node.", "schema": { "type": "string", - "description": "Routing value. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'." + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-data-type": "time" } }, { - "name": "realtime", + "name": "local", "in": "query", - "description": "Specifies if requests are real-time as opposed to near-real-time.", + "description": "Return local information, do not retrieve the state from cluster-manager node.", "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" + "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": "Mtermvectors_Post_WithIndex 200 response" + "description": "IndicesGetMapping_WithIndex 200 response" } }, - "x-operation-group": "mtermvectors", + "x-operation-group": "indices.get_mapping", "x-version-added": "1.0" - } - }, - "/{index}/_open": { + }, "post": { - "description": "Opens an index.", - "externalDocs": { - "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "description": "Updates the index mappings.", + "operationId": "IndicesPutMapping_Post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndicesPutMapping_BodyParams" + } + } + }, + "required": true }, - "operationId": "IndicesOpen", "parameters": [ { "name": "index", "in": "path", - "description": "Comma-separated list of indices to open.", + "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 to open.", + "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 @@ -23721,6 +23946,17 @@ "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-data-type": "time" + } + }, { "name": "ignore_unavailable", "in": "query", @@ -23748,28 +23984,48 @@ } }, { - "name": "wait_for_active_shards", + "name": "write_index_only", "in": "query", - "description": "Sets the number of active shards to wait for before the operation returns.", + "description": "When true, applies mappings only to the write index of an alias or data stream.", "schema": { - "type": "string", - "description": "Sets the number of active shards to wait for before the operation returns." + "type": "boolean", + "default": false, + "description": "When true, applies mappings only to the write index of an alias or data stream." } } ], "responses": { "200": { - "description": "IndicesOpen 200 response" + "description": "IndicesPutMapping_Post 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndicesPutMapping_PostResponseContent" + } + } + } } }, - "x-operation-group": "indices.open", + "x-operation-group": "indices.put_mapping", "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", + }, + "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", @@ -23777,80 +24033,47 @@ "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)", + "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", + "name": "timeout", "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).", + "description": "Operation timeout.", "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)." + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" } }, { - "name": "expand_wildcards", + "name": "master_timeout", "in": "query", - "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "description": "Operation timeout for connection to master node.", "schema": { - "$ref": "#/components/schemas/ExpandWildcards" + "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": "search_type", + "name": "cluster_manager_timeout", "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.", + "description": "Operation timeout for connection to cluster-manager node.", "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 + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-data-type": "time" + } }, { "name": "ignore_unavailable", @@ -23879,86 +24102,69 @@ } }, { - "name": "search_type", + "name": "write_index_only", "in": "query", - "description": "Search operation type.", + "description": "When true, applies mappings only to the write index of an alias or data stream.", "schema": { - "$ref": "#/components/schemas/SearchType" + "type": "boolean", + "default": false, + "description": "When true, applies mappings only to the write index of an alias or data stream." } } ], "responses": { "200": { - "description": "RankEval_Post_WithIndex 200 response" + "description": "IndicesPutMapping_Put 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndicesPutMapping_PutResponseContent" + } + } + } } }, - "x-operation-group": "rank_eval", + "x-operation-group": "indices.put_mapping", "x-version-added": "1.0" } }, - "/{index}/_recovery": { + "/{index}/_mapping/field/{fields}": { "get": { - "description": "Returns information about ongoing index shard recoveries.", - "operationId": "IndicesRecovery_WithIndex", + "description": "Returns mapping for one or more fields.", + "operationId": "IndicesGetFieldMapping_WithIndex", "parameters": [ { "name": "index", "in": "path", - "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "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; use `_all` or empty string to perform the operation on all indices.", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of indices.", "x-data-type": "array" }, "required": true }, { - "name": "detailed", - "in": "query", - "description": "Whether to display detailed information about shard recovery.", + "name": "fields", + "in": "path", + "description": "Comma-separated list of fields.", "schema": { - "type": "boolean", - "default": false, - "description": "Whether to display detailed information about shard recovery." - } + "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": "active_only", + "name": "include_defaults", "in": "query", - "description": "Display only those recoveries that are currently on-going.", + "description": "Whether the default mapping values should be returned as well.", "schema": { "type": "boolean", - "default": false, - "description": "Display only those recoveries that are currently on-going." + "description": "Whether the default mapping values should be returned as well." } - } - ], - "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", @@ -23985,299 +24191,220 @@ "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", + "name": "local", "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).", + "description": "Return local information, do not retrieve the state from cluster-manager node.", "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" + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." } } ], "responses": { "200": { - "description": "IndicesRefresh_Post_WithIndex 200 response" + "description": "IndicesGetFieldMapping_WithIndex 200 response" } }, - "x-operation-group": "indices.refresh", + "x-operation-group": "indices.get_field_mapping", "x-version-added": "1.0" } }, - "/{index}/_search": { + "/{index}/_mget": { "get": { - "description": "Returns results matching a query.", - "operationId": "Search_Get_WithIndex", + "description": "Allows to get multiple documents in one request.", + "operationId": "Mget_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.", + "description": "Index name.", "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" + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Index name." }, "required": true }, { - "name": "analyzer", + "name": "stored_fields", "in": "query", - "description": "The analyzer to use for the query string.", + "description": "Comma-separated list of stored fields to return.", + "style": "form", "schema": { - "type": "string", - "description": "The analyzer to use for the query string." - } + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of stored fields to return." + }, + "explode": true }, { - "name": "analyze_wildcard", + "name": "preference", "in": "query", - "description": "Specify whether wildcard and prefix queries should be analyzed.", + "description": "Specify the node or shard the operation should be performed on.", "schema": { - "type": "boolean", - "default": false, - "description": "Specify whether wildcard and prefix queries should be analyzed." + "type": "string", + "default": "random", + "description": "Specify the node or shard the operation should be performed on." } }, { - "name": "ccs_minimize_roundtrips", + "name": "realtime", "in": "query", - "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution.", + "description": "Specify whether to perform the operation in realtime or search mode.", "schema": { "type": "boolean", - "default": true, - "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution." + "description": "Specify whether to perform the operation in realtime or search mode." } }, { - "name": "default_operator", + "name": "refresh", "in": "query", - "description": "The default operator for query string query (AND or OR).", + "description": "Refresh the shard containing the document before performing the operation.", "schema": { - "$ref": "#/components/schemas/DefaultOperator" + "type": "boolean", + "description": "Refresh the shard containing the document before performing the operation." } }, { - "name": "df", + "name": "routing", "in": "query", - "description": "The field to use as default where no field prefix is given in the query string.", + "description": "Routing value.", "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." + "description": "Routing value." } }, { - "name": "stored_fields", + "name": "_source", "in": "query", - "description": "Comma-separated list of stored fields to return.", + "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": "Comma-separated list of stored fields to return." + "description": "True or false to return the _source field or not, or a list of fields to return." }, "explode": true }, { - "name": "docvalue_fields", + "name": "_source_excludes", "in": "query", - "description": "Comma-separated list of fields to return as the docvalue representation of a field for each hit.", + "description": "List of fields to exclude from the returned _source field.", "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." + "description": "List of fields to exclude from the returned _source field." }, "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", + "name": "_source_includes", "in": "query", - "description": "Specify the node or shard the operation should be performed on.", + "description": "List of fields to extract and return from the _source field.", + "style": "form", "schema": { - "type": "string", - "default": "random", - "description": "Specify the node or shard the operation should be performed on." + "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": "q", - "in": "query", - "description": "Query in the Lucene query string syntax.", + "name": "index", + "in": "path", + "description": "Index name.", "schema": { "type": "string", - "description": "Query in the Lucene query string syntax." - } + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Index name." + }, + "required": true }, { - "name": "routing", + "name": "stored_fields", "in": "query", - "description": "Comma-separated list of specific routing values.", + "description": "Comma-separated list of stored fields to return.", "style": "form", "schema": { "type": "array", "items": { "type": "string" }, - "description": "Comma-separated list of specific routing values." + "description": "Comma-separated list of stored fields to return." }, "explode": true }, { - "name": "scroll", + "name": "preference", "in": "query", - "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", + "description": "Specify the node or shard the operation should be performed on.", "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" + "default": "random", + "description": "Specify the node or shard the operation should be performed on." } }, { - "name": "search_type", + "name": "realtime", "in": "query", - "description": "Search operation type.", + "description": "Specify whether to perform the operation in realtime or search mode.", "schema": { - "$ref": "#/components/schemas/SearchType" + "type": "boolean", + "description": "Specify whether to perform the operation in realtime or search mode." } }, { - "name": "size", + "name": "refresh", "in": "query", - "description": "Number of hits to return.", + "description": "Refresh the shard containing the document before performing the operation.", "schema": { - "type": "integer", - "default": 10, - "description": "Number of hits to return.", - "format": "int32" + "type": "boolean", + "description": "Refresh the shard containing the document before performing the operation." } }, { - "name": "sort", + "name": "routing", "in": "query", - "description": "Comma-separated list of : pairs.", - "style": "form", + "description": "Routing value.", "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Comma-separated list of : pairs." - }, - "explode": true + "type": "string", + "description": "Routing value." + } }, { "name": "_source", @@ -24320,104 +24447,153 @@ "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": "terminate_after", + "name": "search_type", "in": "query", - "description": "The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.", + "description": "Search operation type.", "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" + "$ref": "#/components/schemas/SearchTypeMulti" } }, { - "name": "stats", + "name": "max_concurrent_searches", "in": "query", - "description": "Specific 'tag' of the request for logging and statistical purposes.", - "style": "form", + "description": "Controls the maximum number of concurrent searches the multi search api will execute.", "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Specific 'tag' of the request for logging and statistical purposes." - }, - "explode": true + "type": "integer", + "description": "Controls the maximum number of concurrent searches the multi search api will execute.", + "format": "int32" + } }, { - "name": "suggest_field", + "name": "typed_keys", "in": "query", - "description": "Specify which field to use for suggestions.", + "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response.", "schema": { - "type": "string", - "description": "Specify which field to use for suggestions." + "type": "boolean", + "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response." } }, { - "name": "suggest_mode", + "name": "pre_filter_shard_size", "in": "query", - "description": "Specify suggest mode.", + "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": { - "$ref": "#/components/schemas/SuggestMode" + "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": "suggest_size", + "name": "max_concurrent_shard_requests", "in": "query", - "description": "How many suggestions to return in response.", + "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", - "description": "How many suggestions to return in response.", + "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": "suggest_text", + "name": "rest_total_hits_as_int", "in": "query", - "description": "The source text for which the suggestions should be returned.", + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response.", "schema": { - "type": "string", - "description": "The source text for which the suggestions should be returned." + "type": "boolean", + "default": false, + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response." } }, { - "name": "timeout", + "name": "ccs_minimize_roundtrips", "in": "query", - "description": "Operation timeout.", + "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution.", "schema": { - "type": "string", - "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", - "description": "Operation timeout.", - "x-data-type": "time" + "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": "track_scores", - "in": "query", - "description": "Whether to calculate and return scores even if they are not used for sorting.", + "name": "index", + "in": "path", + "description": "Comma-separated list of indices to use as default.", "schema": { - "type": "boolean", - "description": "Whether to calculate and return scores even if they are not used for sorting." - } + "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": "track_total_hits", + "name": "search_type", "in": "query", - "description": "Indicate if the number of documents that match the query should be tracked.", + "description": "Search operation type.", "schema": { - "type": "boolean", - "description": "Indicate if the number of documents that match the query should be tracked." + "$ref": "#/components/schemas/SearchTypeMulti" } }, { - "name": "allow_partial_search_results", + "name": "max_concurrent_searches", "in": "query", - "description": "Indicate if an error should be returned if there is a partial search failure or timeout.", + "description": "Controls the maximum number of concurrent searches the multi search api will execute.", "schema": { - "type": "boolean", - "default": true, - "description": "Indicate if an error should be returned if there is a partial search failure or timeout." + "type": "integer", + "description": "Controls the maximum number of concurrent searches the multi search api will execute.", + "format": "int32" } }, { @@ -24430,61 +24606,97 @@ } }, { - "name": "version", + "name": "pre_filter_shard_size", "in": "query", - "description": "Whether to return document version as part of a hit.", + "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": "boolean", - "description": "Whether to return document version as part of a hit." + "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": "seq_no_primary_term", + "name": "max_concurrent_shard_requests", "in": "query", - "description": "Specify whether to return sequence number and primary term of the last modification of each hit.", + "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", - "description": "Specify whether to return sequence number and primary term of the last modification of each hit." + "default": false, + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response." } }, { - "name": "request_cache", + "name": "ccs_minimize_roundtrips", "in": "query", - "description": "Specify if request cache should be used for this request or not, defaults to index level setting.", + "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution.", "schema": { "type": "boolean", - "description": "Specify if request cache should be used for this request or not, defaults to index level setting." + "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": "batched_reduce_size", + "name": "search_type", "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.", + "description": "Search operation type.", "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" + "$ref": "#/components/schemas/SearchTypeMulti" } }, { - "name": "max_concurrent_shard_requests", + "name": "typed_keys", "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.", + "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response.", "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" + "type": "boolean", + "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response." } }, { - "name": "pre_filter_shard_size", + "name": "max_concurrent_searches", "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.", + "description": "Controls the maximum number of concurrent searches the multi search api will execute.", "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.", + "description": "Controls the maximum number of concurrent searches the multi search api will execute.", "format": "int32" } }, @@ -24497,557 +24709,513 @@ "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": "Search_Get_WithIndex 200 response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Search_Get_WithIndexResponseContent" - } - } - } + "description": "MsearchTemplate_Get_WithIndex 200 response" } }, - "x-operation-group": "search", + "x-operation-group": "msearch_template", "x-version-added": "1.0" }, "post": { - "description": "Returns results matching a query.", - "operationId": "Search_Post_WithIndex", + "description": "Allows to execute several search template operations in one request.", + "operationId": "MsearchTemplate_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": [ - "*" - ] - } - } + "$ref": "#/components/schemas/MsearchTemplate_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.", + "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; use `_all` or empty string to perform the operation on all indices.", + "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, - "examples": { - "Search_Post_WithIndex_example1": { - "summary": "Examples for Post Search With Index Operation.", - "description": "", - "value": "books" - } - } + "required": true }, { - "name": "analyzer", + "name": "search_type", "in": "query", - "description": "The analyzer to use for the query string.", + "description": "Search operation type.", "schema": { - "type": "string", - "description": "The analyzer to use for the query string." + "$ref": "#/components/schemas/SearchTypeMulti" } }, { - "name": "analyze_wildcard", + "name": "typed_keys", "in": "query", - "description": "Specify whether wildcard and prefix queries should be analyzed.", + "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response.", "schema": { "type": "boolean", - "default": false, - "description": "Specify whether wildcard and prefix queries should be analyzed." + "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response." } }, { - "name": "ccs_minimize_roundtrips", + "name": "max_concurrent_searches", "in": "query", - "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution.", + "description": "Controls the maximum number of concurrent searches the multi search api will execute.", "schema": { - "type": "boolean", - "default": true, - "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution." + "type": "integer", + "description": "Controls the maximum number of concurrent searches the multi search api will execute.", + "format": "int32" } }, { - "name": "default_operator", + "name": "rest_total_hits_as_int", "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.", + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response.", "schema": { - "type": "string", - "description": "The field to use as default where no field prefix is given in the query string." + "type": "boolean", + "default": false, + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response." } }, { - "name": "explain", + "name": "ccs_minimize_roundtrips", "in": "query", - "description": "Specify whether to return detailed information about score computation as part of a hit.", + "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution.", "schema": { "type": "boolean", - "description": "Specify whether to return detailed information about score computation as part of a hit." + "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": "stored_fields", - "in": "query", - "description": "Comma-separated list of stored fields to return.", - "style": "form", + "name": "index", + "in": "path", + "description": "The index in which the document resides.", "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Comma-separated list of stored fields to return." + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The index in which the document resides." }, - "explode": true + "required": true }, { - "name": "docvalue_fields", + "name": "ids", "in": "query", - "description": "Comma-separated list of fields to return as the docvalue representation of a field for each hit.", + "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 fields to return as the docvalue representation of a field for each hit." + "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": "from", + "name": "term_statistics", "in": "query", - "description": "Starting offset.", + "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": "integer", - "default": 0, - "description": "Starting offset.", - "format": "int32" + "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": "ignore_unavailable", + "name": "field_statistics", "in": "query", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "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", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + "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": "ignore_throttled", + "name": "fields", "in": "query", - "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled.", + "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": "boolean", - "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled." - } + "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": "allow_no_indices", + "name": "offsets", "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).", + "description": "Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'.", "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)." + "default": true, + "description": "Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'." } }, { - "name": "expand_wildcards", + "name": "positions", "in": "query", - "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "description": "Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'.", "schema": { - "$ref": "#/components/schemas/ExpandWildcards" + "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": "lenient", + "name": "payloads", "in": "query", - "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored.", + "description": "Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'.", "schema": { "type": "boolean", - "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored." + "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.", + "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." + "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": "q", + "name": "routing", "in": "query", - "description": "Query in the Lucene query string syntax.", + "description": "Routing value. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'.", "schema": { "type": "string", - "description": "Query in the Lucene query string syntax." + "description": "Routing value. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'." } }, { - "name": "routing", + "name": "realtime", "in": "query", - "description": "Comma-separated list of specific routing values.", - "style": "form", + "description": "Specifies if requests are real-time as opposed to near-real-time.", "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Comma-separated list of specific routing values." - }, - "explode": true + "type": "boolean", + "default": true, + "description": "Specifies if requests are real-time as opposed to near-real-time." + } }, { - "name": "scroll", + "name": "version", "in": "query", - "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", + "description": "Explicit version number for concurrency control.", "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" - } + "type": "integer", + "description": "Explicit version number for concurrency control.", + "format": "int32" } }, { - "name": "search_type", + "name": "version_type", "in": "query", - "description": "Search operation type.", + "description": "Specific version type.", "schema": { - "$ref": "#/components/schemas/SearchType" + "$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": "size", - "in": "query", - "description": "Number of hits to return.", + "name": "index", + "in": "path", + "description": "The index in which the document resides.", "schema": { - "type": "integer", - "default": 10, - "description": "Number of hits to return.", - "format": "int32" - } + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The index in which the document resides." + }, + "required": true }, { - "name": "sort", + "name": "ids", "in": "query", - "description": "Comma-separated list of : pairs.", + "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 : pairs." + "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": "_source", + "name": "term_statistics", "in": "query", - "description": "True or false to return the _source field or not, or a list of fields to return.", - "style": "form", + "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": "array", - "items": { - "type": "string" - }, - "description": "True or false to return the _source field or not, or a list of fields to return." - }, - "explode": true + "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": "_source_excludes", + "name": "field_statistics", "in": "query", - "description": "List of fields to exclude from the returned _source field.", - "style": "form", + "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": "array", - "items": { - "type": "string" - }, - "description": "List of fields to exclude from the returned _source field." - }, - "explode": true + "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": "_source_includes", + "name": "fields", "in": "query", - "description": "List of fields to extract and return from the _source field.", + "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": "List of fields to extract and return from the _source field." + "description": "Comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'." }, "explode": true }, { - "name": "terminate_after", + "name": "offsets", "in": "query", - "description": "The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.", + "description": "Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'.", "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." + "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": "suggest_mode", + "name": "positions", "in": "query", - "description": "Specify suggest mode.", + "description": "Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'.", "schema": { - "$ref": "#/components/schemas/SuggestMode" + "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": "suggest_size", + "name": "payloads", "in": "query", - "description": "How many suggestions to return in response.", + "description": "Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'.", "schema": { - "type": "integer", - "description": "How many suggestions to return in response.", - "format": "int32" + "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": "suggest_text", + "name": "preference", "in": "query", - "description": "The source text for which the suggestions should be returned.", + "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", - "description": "The source text for which the suggestions should be returned." + "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": "timeout", + "name": "routing", "in": "query", - "description": "Operation timeout.", + "description": "Routing value. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'.", "schema": { "type": "string", - "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", - "description": "Operation timeout.", - "x-data-type": "time" + "description": "Routing value. Applies to all returned documents unless otherwise specified in body 'params' or 'docs'." } }, { - "name": "track_scores", + "name": "realtime", "in": "query", - "description": "Whether to calculate and return scores even if they are not used for sorting.", + "description": "Specifies if requests are real-time as opposed to near-real-time.", "schema": { "type": "boolean", - "description": "Whether to calculate and return scores even if they are not used for sorting." + "default": true, + "description": "Specifies if requests are real-time as opposed to near-real-time." } }, { - "name": "track_total_hits", + "name": "version", "in": "query", - "description": "Indicate if the number of documents that match the query should be tracked.", + "description": "Explicit version number for concurrency control.", "schema": { - "type": "boolean", - "description": "Indicate if the number of documents that match the query should be tracked." + "type": "integer", + "description": "Explicit version number for concurrency control.", + "format": "int32" } }, { - "name": "allow_partial_search_results", + "name": "version_type", "in": "query", - "description": "Indicate if an error should be returned if there is a partial search failure or timeout.", + "description": "Specific version type.", "schema": { - "type": "boolean", - "default": true, - "description": "Indicate if an error should be returned if there is a partial search failure or timeout." + "$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": "typed_keys", - "in": "query", - "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response.", + "name": "index", + "in": "path", + "description": "Comma-separated list of indices to open.", "schema": { - "type": "boolean", - "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response." - } + "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": "version", + "name": "timeout", "in": "query", - "description": "Whether to return document version as part of a hit.", + "description": "Operation timeout.", "schema": { - "type": "boolean", - "description": "Whether to return document version as part of a hit." + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" } }, { - "name": "seq_no_primary_term", + "name": "master_timeout", "in": "query", - "description": "Specify whether to return sequence number and primary term of the last modification of each hit.", + "description": "Operation timeout for connection to master node.", "schema": { - "type": "boolean", - "description": "Specify whether to return sequence number and primary term of the last modification of each hit." + "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": "request_cache", + "name": "ignore_unavailable", "in": "query", - "description": "Specify if request cache should be used for this request or not, defaults to index level setting.", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", "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" + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." } }, { - "name": "max_concurrent_shard_requests", + "name": "allow_no_indices", "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.", + "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": "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" + "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": "pre_filter_shard_size", + "name": "expand_wildcards", "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.", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", "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" + "$ref": "#/components/schemas/ExpandWildcards" } }, { - "name": "rest_total_hits_as_int", + "name": "wait_for_active_shards", "in": "query", - "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response.", + "description": "Sets the number of active shards to wait for before the operation returns.", "schema": { - "type": "boolean", - "default": false, - "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response." + "type": "string", + "description": "Sets the number of active shards to wait for before the operation returns." } } ], "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": [] - } - } - } - } - } - } + "description": "IndicesOpen 200 response" } }, - "x-operation-group": "search", + "x-operation-group": "indices.open", "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" - }, - "operationId": "CreatePit", + "/{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", @@ -25055,68 +25223,68 @@ "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)", + "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", + "name": "ignore_unavailable", "in": "query", - "description": "Allow if point in time can be created with partial failures.", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", "schema": { "type": "boolean", - "description": "Allow if point in time can be created with partial failures." + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." } }, { - "name": "keep_alive", + "name": "allow_no_indices", "in": "query", - "description": "Specify the keep alive for point in time.", + "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": "string", - "description": "Specify the keep alive for point in time." + "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": "preference", + "name": "expand_wildcards", "in": "query", - "description": "Specify the node or shard the operation should be performed on.", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", "schema": { - "type": "string", - "default": "random", - "description": "Specify the node or shard the operation should be performed on." + "$ref": "#/components/schemas/ExpandWildcards" } }, { - "name": "routing", + "name": "search_type", "in": "query", - "description": "Comma-separated list of specific routing values.", - "style": "form", + "description": "Search operation type.", "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Comma-separated list of specific routing values." - }, - "explode": true + "$ref": "#/components/schemas/SearchType" + } } ], "responses": { "200": { - "description": "CreatePit 200 response" + "description": "RankEval_Get_WithIndex 200 response" } }, - "x-operation-group": "create_pit", + "x-operation-group": "rank_eval", "x-version-added": "1.0" - } - }, - "/{index}/_search/template": { - "get": { - "description": "Allows to use the Mustache language to pre-render a search definition.", - "operationId": "SearchTemplate_Get_WithIndex", + }, + "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", @@ -25124,7 +25292,7 @@ "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)", + "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" }, @@ -25139,15 +25307,6 @@ "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", @@ -25166,117 +25325,125 @@ } }, { - "name": "preference", + "name": "search_type", "in": "query", - "description": "Specify the node or shard the operation should be performed on.", + "description": "Search operation type.", "schema": { - "type": "string", - "default": "random", - "description": "Specify the node or shard the operation should be performed on." + "$ref": "#/components/schemas/SearchType" } - }, - { - "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 - }, + } + ], + "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": "scroll", - "in": "query", - "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", + "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": "^([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" - } + "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": "search_type", + "name": "detailed", "in": "query", - "description": "Search operation type.", + "description": "Whether to display detailed information about shard recovery.", "schema": { - "$ref": "#/components/schemas/SearchTypeMulti" + "type": "boolean", + "default": false, + "description": "Whether to display detailed information about shard recovery." } }, { - "name": "explain", + "name": "active_only", "in": "query", - "description": "Specify whether to return detailed information about score computation as part of a hit.", + "description": "Display only those recoveries that are currently on-going.", "schema": { "type": "boolean", - "description": "Specify whether to return detailed information about score computation as part of a hit." + "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": "profile", - "in": "query", - "description": "Specify whether to profile the query execution.", + "name": "index", + "in": "path", + "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", "schema": { - "type": "boolean", - "description": "Specify whether to profile the query execution." - } + "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": "typed_keys", + "name": "ignore_unavailable", "in": "query", - "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response.", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", "schema": { "type": "boolean", - "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response." + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." } }, { - "name": "rest_total_hits_as_int", + "name": "allow_no_indices", "in": "query", - "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response.", + "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": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response." + "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": "ccs_minimize_roundtrips", + "name": "expand_wildcards", "in": "query", - "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution.", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", "schema": { - "type": "boolean", - "default": true, - "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution." + "$ref": "#/components/schemas/ExpandWildcards" } } ], "responses": { "200": { - "description": "SearchTemplate_Get_WithIndex 200 response" + "description": "IndicesRefresh_Get_WithIndex 200 response" } }, - "x-operation-group": "search_template", + "x-operation-group": "indices.refresh", "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 - }, + "description": "Performs the refresh operation in one or more indices.", + "operationId": "IndicesRefresh_Post_WithIndex", "parameters": [ { "name": "index", @@ -25284,7 +25451,7 @@ "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)", + "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" }, @@ -25299,15 +25466,6 @@ "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", @@ -25324,160 +25482,144 @@ "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": "preference", - "in": "query", - "description": "Specify the node or shard the operation should be performed on.", + "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", - "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." + "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" }, - "explode": true + "required": true }, { - "name": "scroll", + "name": "analyzer", "in": "query", - "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", + "description": "The analyzer to use for the query string.", "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" + "description": "The analyzer to use for the query string." } }, { - "name": "search_type", + "name": "analyze_wildcard", "in": "query", - "description": "Search operation type.", + "description": "Specify whether wildcard and prefix queries should be analyzed.", "schema": { - "$ref": "#/components/schemas/SearchTypeMulti" + "type": "boolean", + "default": false, + "description": "Specify whether wildcard and prefix queries should be analyzed." } }, { - "name": "explain", + "name": "ccs_minimize_roundtrips", "in": "query", - "description": "Specify whether to return detailed information about score computation as part of a hit.", + "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution.", "schema": { "type": "boolean", - "description": "Specify whether to return detailed information about score computation as part of a hit." + "default": true, + "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution." } }, { - "name": "profile", + "name": "default_operator", "in": "query", - "description": "Specify whether to profile the query execution.", + "description": "The default operator for query string query (AND or OR).", "schema": { - "type": "boolean", - "description": "Specify whether to profile the query execution." + "$ref": "#/components/schemas/DefaultOperator" } }, { - "name": "typed_keys", + "name": "df", "in": "query", - "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response.", + "description": "The field to use as default where no field prefix is given in the query string.", "schema": { - "type": "boolean", - "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response." + "type": "string", + "description": "The field to use as default where no field prefix is given in the query string." } }, { - "name": "rest_total_hits_as_int", + "name": "explain", "in": "query", - "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response.", + "description": "Specify whether to return detailed information about score computation as part of a hit.", "schema": { "type": "boolean", - "default": false, - "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response." + "description": "Specify whether to return detailed information about score computation as part of a hit." } }, { - "name": "ccs_minimize_roundtrips", + "name": "stored_fields", "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.", + "description": "Comma-separated list of stored fields to return.", + "style": "form", "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" + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of stored fields to return." }, - "required": true + "explode": true }, { - "name": "preference", + "name": "docvalue_fields", "in": "query", - "description": "Specify the node or shard the operation should be performed on.", + "description": "Comma-separated list of fields to return as the docvalue representation of a field for each hit.", + "style": "form", "schema": { - "type": "string", - "default": "random", - "description": "Specify the node or shard the operation should be performed on." - } + "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": "routing", + "name": "from", "in": "query", - "description": "Routing value.", + "description": "Starting offset.", "schema": { - "type": "string", - "description": "Routing value." + "type": "integer", + "default": 0, + "description": "Starting offset.", + "format": "int32" } }, { - "name": "local", + "name": "ignore_unavailable", "in": "query", - "description": "Return local information, do not retrieve the state from cluster-manager node.", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", "schema": { "type": "boolean", - "default": false, - "description": "Return local information, do not retrieve the state from cluster-manager node." + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." } }, { - "name": "ignore_unavailable", + "name": "ignore_throttled", "in": "query", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled.", "schema": { "type": "boolean", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled." } }, { @@ -25496,31 +25638,15 @@ "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.", + "name": "lenient", + "in": "query", + "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored.", "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 + "type": "boolean", + "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored." + } }, { "name": "preference", @@ -25533,520 +25659,447 @@ } }, { - "name": "routing", + "name": "q", "in": "query", - "description": "Routing value.", + "description": "Query in the Lucene query string syntax.", "schema": { "type": "string", - "description": "Routing value." + "description": "Query in the Lucene query string syntax." } }, { - "name": "local", + "name": "routing", "in": "query", - "description": "Return local information, do not retrieve the state from cluster-manager node.", + "description": "Comma-separated list of specific routing values.", + "style": "form", "schema": { - "type": "boolean", - "default": false, - "description": "Return local information, do not retrieve the state from cluster-manager node." - } + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of specific routing values." + }, + "explode": true }, { - "name": "ignore_unavailable", + "name": "scroll", "in": "query", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", "schema": { - "type": "boolean", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + "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": "allow_no_indices", + "name": "search_type", "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).", + "description": "Search operation type.", "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)." + "$ref": "#/components/schemas/SearchType" } }, { - "name": "expand_wildcards", + "name": "size", "in": "query", - "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "description": "Number of hits to return.", "schema": { - "$ref": "#/components/schemas/ExpandWildcards" + "type": "integer", + "default": 10, + "description": "Number of hits to return.", + "format": "int32" } - } - ], - "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.", + "name": "sort", + "in": "query", + "description": "Comma-separated list of : pairs.", + "style": "form", "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" + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of : pairs." }, - "required": true + "explode": true }, { - "name": "ignore_unavailable", + "name": "_source", "in": "query", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "description": "True or false to return the _source field or not, or a list of fields to return.", + "style": "form", "schema": { - "type": "boolean", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." - } + "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": "allow_no_indices", + "name": "_source_excludes", "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).", + "description": "List of fields to exclude from the returned _source field.", + "style": "form", "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)." - } + "type": "array", + "items": { + "type": "string" + }, + "description": "List of fields to exclude from the returned _source field." + }, + "explode": true }, { - "name": "expand_wildcards", + "name": "_source_includes", "in": "query", - "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "description": "List of fields to extract and return from the _source field.", + "style": "form", "schema": { - "$ref": "#/components/schemas/ExpandWildcards" - } + "type": "array", + "items": { + "type": "string" + }, + "description": "List of fields to extract and return from the _source field." + }, + "explode": true }, { - "name": "verbose", + "name": "terminate_after", "in": "query", - "description": "Includes detailed memory usage by Lucene.", + "description": "The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.", "schema": { - "type": "boolean", - "default": false, - "description": "Includes detailed memory usage by Lucene." + "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": "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.", + "name": "stats", + "in": "query", + "description": "Specific 'tag' of the request for logging and statistical purposes.", + "style": "form", "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" + "type": "array", + "items": { + "type": "string" + }, + "description": "Specific 'tag' of the request for logging and statistical purposes." }, - "required": true, - "examples": { - "IndicesGetSettings_WithIndex_example1": { - "summary": "Examples for Get settings Index Operation.", - "description": "", - "value": "books" - } - } + "explode": true }, { - "name": "master_timeout", + "name": "suggest_field", "in": "query", - "description": "Operation timeout for connection to master node.", + "description": "Specify which field to use for suggestions.", "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 + "description": "Specify which field to use for suggestions." } }, { - "name": "cluster_manager_timeout", + "name": "suggest_mode", "in": "query", - "description": "Operation timeout for connection to cluster-manager node.", + "description": "Specify suggest mode.", "schema": { - "type": "string", - "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", - "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "$ref": "#/components/schemas/SuggestMode" } }, { - "name": "ignore_unavailable", + "name": "suggest_size", "in": "query", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "description": "How many suggestions to return in response.", "schema": { - "type": "boolean", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + "type": "integer", + "description": "How many suggestions to return in response.", + "format": "int32" } }, { - "name": "allow_no_indices", + "name": "suggest_text", "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).", + "description": "The source text for which the suggestions should be returned.", "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)." + "type": "string", + "description": "The source text for which the suggestions should be returned." } }, { - "name": "expand_wildcards", + "name": "timeout", "in": "query", - "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "description": "Operation timeout.", "schema": { - "$ref": "#/components/schemas/ExpandWildcards" + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" } }, { - "name": "flat_settings", + "name": "track_scores", "in": "query", - "description": "Return settings in flat format.", + "description": "Whether to calculate and return scores even if they are not used for sorting.", "schema": { "type": "boolean", - "default": false, - "description": "Return settings in flat format." + "description": "Whether to calculate and return scores even if they are not used for sorting." } }, { - "name": "local", + "name": "track_total_hits", "in": "query", - "description": "Return local information, do not retrieve the state from cluster-manager node.", + "description": "Indicate if the number of documents that match the query should be tracked.", "schema": { "type": "boolean", - "default": false, - "description": "Return local information, do not retrieve the state from cluster-manager node." + "description": "Indicate if the number of documents that match the query should be tracked." } }, { - "name": "include_defaults", + "name": "allow_partial_search_results", "in": "query", - "description": "Whether to return all default setting for each of the indices.", + "description": "Indicate if an error should be returned if there is a partial search failure or timeout.", "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" - } + "default": true, + "description": "Indicate if an error should be returned if there is a partial search failure or timeout." } }, - "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", + "name": "typed_keys", "in": "query", - "description": "Operation timeout for connection to master node.", + "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response.", "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 + "type": "boolean", + "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response." } }, { - "name": "cluster_manager_timeout", + "name": "version", "in": "query", - "description": "Operation timeout for connection to cluster-manager node.", + "description": "Whether to return document version as part of a hit.", "schema": { - "type": "string", - "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", - "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "type": "boolean", + "description": "Whether to return document version as part of a hit." } }, { - "name": "timeout", + "name": "seq_no_primary_term", "in": "query", - "description": "Operation timeout.", + "description": "Specify whether to return sequence number and primary term of the last modification of each hit.", "schema": { - "type": "string", - "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", - "description": "Operation timeout.", - "x-data-type": "time" + "type": "boolean", + "description": "Specify whether to return sequence number and primary term of the last modification of each hit." } }, { - "name": "preserve_existing", + "name": "request_cache", "in": "query", - "description": "Whether to update existing settings. If set to `true` existing settings on an index remain unchanged.", + "description": "Specify if request cache should be used for this request or not, defaults to index level setting.", "schema": { "type": "boolean", - "default": false, - "description": "Whether to update existing settings. If set to `true` existing settings on an index remain unchanged." + "description": "Specify if request cache should be used for this request or not, defaults to index level setting." } }, { - "name": "ignore_unavailable", + "name": "batched_reduce_size", "in": "query", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "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": "boolean", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + "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": "allow_no_indices", + "name": "max_concurrent_shard_requests", "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).", + "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": "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)." + "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": "expand_wildcards", + "name": "pre_filter_shard_size", "in": "query", - "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "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": { - "$ref": "#/components/schemas/ExpandWildcards" + "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": "flat_settings", + "name": "rest_total_hits_as_int", "in": "query", - "description": "Return settings in flat format.", + "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": "Return settings in flat format." + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response." } } ], "responses": { "200": { - "description": "IndicesPutSettings_WithIndex 200 response" + "description": "Search_Get_WithIndex 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Search_Get_WithIndexResponseContent" + } + } + } } }, - "x-operation-group": "indices.put_settings", + "x-operation-group": "search", "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" + }, + "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": "name", + "name": "index", "in": "path", - "description": "Comma-separated list of settings.", + "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 settings.", + "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.", + "Search_Post_WithIndex_example1": { + "summary": "Examples for Post Search With Index Operation.", "description": "", - "value": "index" + "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", + "name": "analyzer", "in": "query", - "description": "Operation timeout for connection to cluster-manager node.", + "description": "The analyzer to use for the query string.", "schema": { "type": "string", - "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", - "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "description": "The analyzer to use for the query string." } }, { - "name": "ignore_unavailable", + "name": "analyze_wildcard", "in": "query", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "description": "Specify whether wildcard and prefix queries should be analyzed.", "schema": { "type": "boolean", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + "default": false, + "description": "Specify whether wildcard and prefix queries should be analyzed." } }, { - "name": "allow_no_indices", + "name": "ccs_minimize_roundtrips", "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).", + "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution.", "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)." + "default": true, + "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution." } }, { - "name": "expand_wildcards", + "name": "default_operator", "in": "query", - "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "description": "The default operator for query string query (AND or OR).", "schema": { - "$ref": "#/components/schemas/ExpandWildcards" + "$ref": "#/components/schemas/DefaultOperator" } }, { - "name": "flat_settings", + "name": "df", "in": "query", - "description": "Return settings in flat format.", + "description": "The field to use as default where no field prefix is given in the query string.", "schema": { - "type": "boolean", - "default": false, - "description": "Return settings in flat format." + "type": "string", + "description": "The field to use as default where no field prefix is given in the query string." } }, { - "name": "local", + "name": "explain", "in": "query", - "description": "Return local information, do not retrieve the state from cluster-manager node.", + "description": "Specify whether to return detailed information about score computation as part of a hit.", "schema": { "type": "boolean", - "default": false, - "description": "Return local information, do not retrieve the state from cluster-manager node." + "description": "Specify whether to return detailed information about score computation as part of a hit." } }, { - "name": "include_defaults", + "name": "stored_fields", "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.", + "description": "Comma-separated list of stored fields to return.", + "style": "form", "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" + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of stored fields to return." }, - "required": true + "explode": true }, { - "name": "status", + "name": "docvalue_fields", "in": "query", - "description": "Comma-separated list of statuses used to filter on shards to get store information for.", + "description": "Comma-separated list of fields to return as the docvalue representation of a field for each hit.", "style": "form", "schema": { "type": "array", "items": { - "$ref": "#/components/schemas/Status_Member" + "type": "string" }, - "description": "Comma-separated list of statuses used to filter on shards to get store information for." + "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", @@ -26056,6 +26109,15 @@ "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", @@ -26072,302 +26134,99 @@ "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", + "name": "lenient", "in": "query", - "description": "whether or not to copy settings from the source index.", + "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored.", "schema": { "type": "boolean", - "default": false, - "description": "whether or not to copy settings from the source index." + "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored." } }, { - "name": "timeout", + "name": "preference", "in": "query", - "description": "Operation timeout.", + "description": "Specify the node or shard the operation should be performed on.", "schema": { "type": "string", - "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", - "description": "Operation timeout.", - "x-data-type": "time" + "default": "random", + "description": "Specify the node or shard the operation should be performed on." } }, { - "name": "master_timeout", + "name": "q", "in": "query", - "description": "Operation timeout for connection to master node.", + "description": "Query in the Lucene query string syntax.", "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 + "description": "Query in the Lucene query string syntax." } }, { - "name": "cluster_manager_timeout", + "name": "routing", "in": "query", - "description": "Operation timeout for connection to cluster-manager node.", + "description": "Comma-separated list of specific routing values.", + "style": "form", "schema": { - "type": "string", - "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", - "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" - } + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of specific routing values." + }, + "explode": true }, { - "name": "wait_for_active_shards", + "name": "scroll", "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" - }, - "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.", + "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": "Operation timeout for connection to cluster-manager node.", + "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", "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.", + "Search_Post_WithIndex_example1": { + "summary": "Examples for Post Search With Index Operation.", "description": "", - "value": "books" + "value": "1d" } } }, { - "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", + "name": "search_type", "in": "query", - "description": "Specify whether to perform the operation in realtime or search mode.", + "description": "Search operation type.", "schema": { - "type": "boolean", - "description": "Specify whether to perform the operation in realtime or search mode." + "$ref": "#/components/schemas/SearchType" } }, { - "name": "refresh", + "name": "size", "in": "query", - "description": "Refresh the shard containing the document before performing the operation.", + "description": "Number of hits to return.", "schema": { - "type": "boolean", - "description": "Refresh the shard containing the document before performing the operation." + "type": "integer", + "default": 10, + "description": "Number of hits to return.", + "format": "int32" } }, { - "name": "routing", + "name": "sort", "in": "query", - "description": "Routing value.", + "description": "Comma-separated list of : pairs.", + "style": "form", "schema": { - "type": "string", - "description": "Routing value." - } + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of : pairs." + }, + "explode": true }, { "name": "_source", @@ -26412,377 +26271,313 @@ "explode": true }, { - "name": "version", + "name": "terminate_after", "in": "query", - "description": "Explicit version number for concurrency control.", + "description": "The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.", "schema": { "type": "integer", - "description": "Explicit version number for concurrency control.", + "description": "The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.", "format": "int32" } }, { - "name": "version_type", + "name": "stats", "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" - }, - "operationId": "ExistsSource", - "parameters": [ - { - "name": "id", - "in": "path", - "description": "Document ID.", + "description": "Specific 'tag' of the request for logging and statistical purposes.", + "style": "form", "schema": { - "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", - "description": "Document ID." + "type": "array", + "items": { + "type": "string" + }, + "description": "Specific 'tag' of the request for logging and statistical purposes." }, - "required": true + "explode": true }, { - "name": "index", - "in": "path", - "description": "Index name.", + "name": "suggest_field", + "in": "query", + "description": "Specify which field to use for suggestions.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", - "description": "Index name." - }, - "required": true + "description": "Specify which field to use for suggestions." + } }, { - "name": "preference", + "name": "suggest_mode", "in": "query", - "description": "Specify the node or shard the operation should be performed on.", + "description": "Specify suggest mode.", "schema": { - "type": "string", - "default": "random", - "description": "Specify the node or shard the operation should be performed on." + "$ref": "#/components/schemas/SuggestMode" } }, { - "name": "realtime", + "name": "suggest_size", "in": "query", - "description": "Specify whether to perform the operation in realtime or search mode.", + "description": "How many suggestions to return in response.", "schema": { - "type": "boolean", - "description": "Specify whether to perform the operation in realtime or search mode." + "type": "integer", + "description": "How many suggestions to return in response.", + "format": "int32" } }, { - "name": "refresh", + "name": "suggest_text", "in": "query", - "description": "Refresh the shard containing the document before performing the operation.", + "description": "The source text for which the suggestions should be returned.", "schema": { - "type": "boolean", - "description": "Refresh the shard containing the document before performing the operation." + "type": "string", + "description": "The source text for which the suggestions should be returned." } }, { - "name": "routing", + "name": "timeout", "in": "query", - "description": "Routing value.", + "description": "Operation timeout.", "schema": { "type": "string", - "description": "Routing value." + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" } }, { - "name": "_source", + "name": "track_scores", "in": "query", - "description": "True or false to return the _source field or not, or a list of fields to return.", - "style": "form", + "description": "Whether to calculate and return scores even if they are not used for sorting.", "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 + "type": "boolean", + "description": "Whether to calculate and return scores even if they are not used for sorting." + } }, { - "name": "_source_excludes", + "name": "track_total_hits", "in": "query", - "description": "List of fields to exclude from the returned _source field.", - "style": "form", + "description": "Indicate if the number of documents that match the query should be tracked.", "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of fields to exclude from the returned _source field." - }, - "explode": true + "type": "boolean", + "description": "Indicate if the number of documents that match the query should be tracked." + } }, { - "name": "_source_includes", + "name": "allow_partial_search_results", "in": "query", - "description": "List of fields to extract and return from the _source field.", - "style": "form", + "description": "Indicate if an error should be returned if there is a partial search failure or timeout.", "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of fields to extract and return from the _source field." - }, - "explode": true + "type": "boolean", + "default": true, + "description": "Indicate if an error should be returned if there is a partial search failure or timeout." + } }, { - "name": "version", + "name": "typed_keys", "in": "query", - "description": "Explicit version number for concurrency control.", + "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response.", "schema": { - "type": "integer", - "description": "Explicit version number for concurrency control.", - "format": "int32" + "type": "boolean", + "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response." } }, { - "name": "version_type", + "name": "version", "in": "query", - "description": "Specific version type.", + "description": "Whether to return document version as part of a hit.", "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" - } + "type": "boolean", + "description": "Whether to return document version as part of a hit." } - } - }, - "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.", + "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": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", - "description": "The name of the target index." - }, - "required": true + "type": "boolean", + "description": "Specify whether to return sequence number and primary term of the last modification of each hit." + } }, { - "name": "copy_settings", + "name": "request_cache", "in": "query", - "description": "whether or not to copy settings from the source index.", + "description": "Specify if request cache should be used for this request or not, defaults to index level setting.", "schema": { "type": "boolean", - "default": false, - "description": "whether or not to copy settings from the source index." + "description": "Specify if request cache should be used for this request or not, defaults to index level setting." } }, { - "name": "timeout", + "name": "batched_reduce_size", "in": "query", - "description": "Operation timeout.", + "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": "string", - "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", - "description": "Operation timeout.", - "x-data-type": "time" + "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": "master_timeout", + "name": "max_concurrent_shard_requests", "in": "query", - "description": "Operation timeout for connection to master node.", + "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": "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 + "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": "cluster_manager_timeout", + "name": "pre_filter_shard_size", "in": "query", - "description": "Operation timeout for connection to cluster-manager node.", + "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": "string", - "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", - "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "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": "wait_for_active_shards", + "name": "rest_total_hits_as_int", "in": "query", - "description": "Set the number of active shards to wait for on the shrunken index before the operation returns.", + "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response.", "schema": { - "type": "string", - "description": "Set the number of active shards to wait for on the shrunken index before the operation returns." + "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": "IndicesSplit_Post 200 response" + "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": "indices.split", + "x-operation-group": "search", "x-version-added": "1.0" - }, - "put": { - "description": "Allows you to split an existing index into a new index with more primary shards.", + } + }, + "/{index}/_search/point_in_time": { + "post": { + "description": "Creates point in time context.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" - }, - "operationId": "IndicesSplit_Put", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/IndicesSplit_BodyParams" - } - } - } + "url": "https://opensearch.org/docs/latest/search-plugins/point-in-time-api/#create-a-pit" }, + "operationId": "CreatePit", "parameters": [ { "name": "index", "in": "path", - "description": "The name of the source index to split.", + "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": "The name of the source index to split." + "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": "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", + "name": "allow_partial_pit_creation", "in": "query", - "description": "whether or not to copy settings from the source index.", + "description": "Allow if point in time can be created with partial failures.", "schema": { "type": "boolean", - "default": false, - "description": "whether or not to copy settings from the source index." + "description": "Allow if point in time can be created with partial failures." } }, { - "name": "timeout", + "name": "keep_alive", "in": "query", - "description": "Operation timeout.", + "description": "Specify the keep alive for point in time.", "schema": { "type": "string", - "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", - "description": "Operation timeout.", - "x-data-type": "time" + "description": "Specify the keep alive for point in time." } }, { - "name": "master_timeout", + "name": "preference", "in": "query", - "description": "Operation timeout for connection to master node.", + "description": "Specify the node or shard the operation should be performed on.", "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 + "default": "random", + "description": "Specify the node or shard the operation should be performed on." } }, { - "name": "cluster_manager_timeout", + "name": "routing", "in": "query", - "description": "Operation timeout for connection to cluster-manager node.", + "description": "Comma-separated list of specific routing values.", + "style": "form", "schema": { - "type": "string", - "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", - "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" - } + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of specific routing values." + }, + "explode": true }, { - "name": "wait_for_active_shards", + "name": "expand_wildcards", "in": "query", - "description": "Set the number of active shards to wait for on the shrunken index before the operation returns.", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", "schema": { - "type": "string", - "description": "Set the number of active shards to wait for on the shrunken index before the operation returns." + "$ref": "#/components/schemas/ExpandWildcards" } } ], "responses": { "200": { - "description": "IndicesSplit_Put 200 response" + "description": "CreatePit 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreatePitResponseContent" + } + } + } } }, - "x-operation-group": "indices.split", - "x-version-added": "1.0" + "x-operation-group": "create_pit", + "x-version-added": "2.4" } }, - "/{index}/_stats": { + "/{index}/_search/template": { "get": { - "description": "Provides statistics on operations happening in an index.", - "operationId": "IndicesStats_WithIndex", + "description": "Allows to use the Mustache language to pre-render a search definition.", + "operationId": "SearchTemplate_Get_WithIndex", "parameters": [ { "name": "index", @@ -26790,128 +26585,159 @@ "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)", + "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", + "name": "ignore_unavailable", "in": "query", - "description": "Comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards).", - "style": "form", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards)." - }, - "explode": true + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } }, { - "name": "fielddata_fields", + "name": "ignore_throttled", "in": "query", - "description": "Comma-separated list of fields for `fielddata` index metric (supports wildcards).", - "style": "form", + "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled.", "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Comma-separated list of fields for `fielddata` index metric (supports wildcards)." - }, - "explode": true + "type": "boolean", + "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled." + } }, { - "name": "fields", + "name": "allow_no_indices", "in": "query", - "description": "Comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards).", - "style": "form", + "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": "array", - "items": { - "type": "string" - }, - "description": "Comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards)." - }, - "explode": true + "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": "groups", + "name": "expand_wildcards", "in": "query", - "description": "Comma-separated list of search groups for `search` index metric.", + "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 search groups for `search` index metric." + "description": "Comma-separated list of specific routing values." }, "explode": true }, { - "name": "level", + "name": "scroll", "in": "query", - "description": "Return stats aggregated at cluster, index or shard level.", + "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", "schema": { - "$ref": "#/components/schemas/IndiciesStatLevel" + "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": "include_segment_file_sizes", + "name": "search_type", "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).", + "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", - "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)." + "description": "Specify whether to return detailed information about score computation as part of a hit." } }, { - "name": "include_unloaded_segments", + "name": "profile", "in": "query", - "description": "If set to true segment stats will include stats for segments that are not currently loaded into memory.", + "description": "Specify whether to profile the query execution.", "schema": { "type": "boolean", - "default": false, - "description": "If set to true segment stats will include stats for segments that are not currently loaded into memory." + "description": "Specify whether to profile the query execution." } }, { - "name": "expand_wildcards", + "name": "typed_keys", "in": "query", - "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response.", "schema": { - "$ref": "#/components/schemas/ExpandWildcards" + "type": "boolean", + "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response." } }, { - "name": "forbid_closed_indices", + "name": "rest_total_hits_as_int", "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.", + "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": "If set to false stats will also collected from closed indices if explicitly specified or if expand_wildcards expands to closed indices." + "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution." } } ], "responses": { "200": { - "description": "IndicesStats_WithIndex 200 response" + "description": "SearchTemplate_Get_WithIndex 200 response" } }, - "x-operation-group": "indices.stats", + "x-operation-group": "search_template", "x-version-added": "1.0" - } - }, - "/{index}/_stats/{metric}": { - "get": { - "description": "Provides statistics on operations happening in an index.", - "operationId": "IndicesStats_WithIndexMetric", + }, + "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", @@ -26919,237 +26745,243 @@ "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)", + "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.", + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", "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", - "completion", - "docs", - "fielddata", - "query_cache", - "flush", - "get", - "indexing", - "merge", - "request_cache", - "refresh", - "search", - "segments", - "store", - "warmer", - "suggest" - ], - "x-data-type": "array" - }, - "required": true + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } }, { - "name": "completion_fields", + "name": "ignore_throttled", "in": "query", - "description": "Comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards).", - "style": "form", + "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled.", "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards)." - }, - "explode": true + "type": "boolean", + "description": "Whether specified concrete, expanded or aliased indices should be ignored when throttled." + } }, { - "name": "fielddata_fields", + "name": "allow_no_indices", "in": "query", - "description": "Comma-separated list of fields for `fielddata` index metric (supports wildcards).", - "style": "form", + "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": "array", - "items": { - "type": "string" - }, - "description": "Comma-separated list of fields for `fielddata` index metric (supports wildcards)." - }, - "explode": true + "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": "fields", + "name": "expand_wildcards", "in": "query", - "description": "Comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards).", - "style": "form", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards)." - }, - "explode": true + "$ref": "#/components/schemas/ExpandWildcards" + } }, { - "name": "groups", + "name": "preference", "in": "query", - "description": "Comma-separated list of search groups for `search` index metric.", + "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 search groups for `search` index metric." + "description": "Comma-separated list of specific routing values." }, "explode": true }, { - "name": "level", + "name": "scroll", "in": "query", - "description": "Return stats aggregated at cluster, index or shard level.", + "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", "schema": { - "$ref": "#/components/schemas/IndiciesStatLevel" + "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": "include_segment_file_sizes", + "name": "search_type", "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).", + "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", - "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)." + "description": "Specify whether to return detailed information about score computation as part of a hit." } }, { - "name": "include_unloaded_segments", + "name": "profile", "in": "query", - "description": "If set to true segment stats will include stats for segments that are not currently loaded into memory.", + "description": "Specify whether to profile the query execution.", "schema": { "type": "boolean", - "default": false, - "description": "If set to true segment stats will include stats for segments that are not currently loaded into memory." + "description": "Specify whether to profile the query execution." } }, { - "name": "expand_wildcards", + "name": "typed_keys", "in": "query", - "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response.", "schema": { - "$ref": "#/components/schemas/ExpandWildcards" + "type": "boolean", + "description": "Specify whether aggregation and suggester names should be prefixed by their respective types in the response." } }, { - "name": "forbid_closed_indices", + "name": "rest_total_hits_as_int", "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.", + "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": "If set to false stats will also collected from closed indices if explicitly specified or if expand_wildcards expands to closed indices." + "description": "Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution." } } ], "responses": { "200": { - "description": "IndicesStats_WithIndexMetric 200 response" + "description": "SearchTemplate_Post_WithIndex 200 response" } }, - "x-operation-group": "indices.stats", + "x-operation-group": "search_template", "x-version-added": "1.0" } }, - "/{index}/_termvectors": { + "/{index}/_search_shards": { "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", + "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": "The index in which the document resides.", + "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": "The index in which the document resides." + "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": "term_statistics", + "name": "preference", "in": "query", - "description": "Specifies if total term frequency and document frequency should be returned.", + "description": "Specify the node or shard the operation should be performed on.", "schema": { - "type": "boolean", - "default": false, - "description": "Specifies if total term frequency and document frequency should be returned." + "type": "string", + "default": "random", + "description": "Specify the node or shard the operation should be performed on." } }, { - "name": "field_statistics", + "name": "routing", "in": "query", - "description": "Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned.", + "description": "Routing value.", "schema": { - "type": "boolean", - "default": true, - "description": "Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned." + "type": "string", + "description": "Routing value." } }, { - "name": "fields", + "name": "local", "in": "query", - "description": "Comma-separated list of fields to return.", - "style": "form", + "description": "Return local information, do not retrieve the state from cluster-manager node.", "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Comma-separated list of fields to return." - }, - "explode": true + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." + } }, { - "name": "offsets", + "name": "ignore_unavailable", "in": "query", - "description": "Specifies if term offsets should be returned.", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", "schema": { "type": "boolean", - "default": true, - "description": "Specifies if term offsets should be returned." + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." } }, { - "name": "positions", + "name": "allow_no_indices", "in": "query", - "description": "Specifies if term positions should be returned.", + "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": true, - "description": "Specifies if term positions should be returned." + "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": "payloads", + "name": "expand_wildcards", "in": "query", - "description": "Specifies if term payloads should be returned.", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", "schema": { - "type": "boolean", - "default": true, - "description": "Specifies if term payloads should be returned." + "$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", @@ -27171,619 +27003,694 @@ } }, { - "name": "realtime", + "name": "local", "in": "query", - "description": "Specifies if request is real-time as opposed to near-real-time.", + "description": "Return local information, do not retrieve the state from cluster-manager node.", "schema": { "type": "boolean", - "default": true, - "description": "Specifies if request is real-time as opposed to near-real-time." + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." } }, { - "name": "version", + "name": "ignore_unavailable", "in": "query", - "description": "Explicit version number for concurrency control.", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", "schema": { - "type": "integer", - "description": "Explicit version number for concurrency control.", - "format": "int32" + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." } }, { - "name": "version_type", + "name": "allow_no_indices", "in": "query", - "description": "Specific version type.", + "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": { - "$ref": "#/components/schemas/VersionType" + "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": "Termvectors_Get 200 response" + "description": "SearchShards_Post_WithIndex 200 response" } }, - "x-operation-group": "termvectors", + "x-operation-group": "search_shards", "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" - } - } - } - }, + } + }, + "/{index}/_segments": { + "get": { + "description": "Provides low-level information about segments in a Lucene index.", + "operationId": "IndicesSegments_WithIndex", "parameters": [ { "name": "index", "in": "path", - "description": "The index in which the document resides.", + "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": "The index in which the document resides." + "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": "term_statistics", + "name": "ignore_unavailable", "in": "query", - "description": "Specifies if total term frequency and document frequency should be returned.", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", "schema": { "type": "boolean", - "default": false, - "description": "Specifies if total term frequency and document frequency should be returned." + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." } }, { - "name": "field_statistics", + "name": "allow_no_indices", "in": "query", - "description": "Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned.", + "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": true, - "description": "Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned." + "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": "fields", + "name": "expand_wildcards", "in": "query", - "description": "Comma-separated list of fields to return.", - "style": "form", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Comma-separated list of fields to return." - }, - "explode": true + "$ref": "#/components/schemas/ExpandWildcards" + } }, { - "name": "offsets", + "name": "verbose", "in": "query", - "description": "Specifies if term offsets should be returned.", + "description": "Includes detailed memory usage by Lucene.", "schema": { "type": "boolean", - "default": true, - "description": "Specifies if term offsets should be returned." + "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": "positions", + "name": "master_timeout", "in": "query", - "description": "Specifies if term positions should be returned.", + "description": "Operation timeout for connection to master node.", "schema": { - "type": "boolean", - "default": true, - "description": "Specifies if term positions should be returned." + "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": "payloads", + "name": "cluster_manager_timeout", "in": "query", - "description": "Specifies if term payloads should be returned.", + "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-data-type": "time" + } + }, + { + "name": "ignore_unavailable", + "in": "query", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", "schema": { "type": "boolean", - "default": true, - "description": "Specifies if term payloads should be returned." + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." } }, { - "name": "preference", + "name": "allow_no_indices", "in": "query", - "description": "Specify the node or shard the operation should be performed on.", + "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": "string", - "default": "random", - "description": "Specify the node or shard the operation should be performed on." + "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": "routing", + "name": "expand_wildcards", "in": "query", - "description": "Routing value.", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", "schema": { - "type": "string", - "description": "Routing value." + "$ref": "#/components/schemas/ExpandWildcards" } }, { - "name": "realtime", + "name": "flat_settings", "in": "query", - "description": "Specifies if request is real-time as opposed to near-real-time.", + "description": "Return settings in flat format.", "schema": { "type": "boolean", - "default": true, - "description": "Specifies if request is real-time as opposed to near-real-time." + "default": false, + "description": "Return settings in flat format." } }, { - "name": "version", + "name": "local", "in": "query", - "description": "Explicit version number for concurrency control.", + "description": "Return local information, do not retrieve the state from cluster-manager node.", "schema": { - "type": "integer", - "description": "Explicit version number for concurrency control.", - "format": "int32" + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." } }, { - "name": "version_type", + "name": "include_defaults", "in": "query", - "description": "Specific version type.", + "description": "Whether to return all default setting for each of the indices.", "schema": { - "$ref": "#/components/schemas/VersionType" + "type": "boolean", + "default": false, + "description": "Whether to return all default setting for each of the indices." } } ], "responses": { "200": { - "description": "Termvectors_Post 200 response" + "description": "IndicesGetSettings_WithIndex 200 response" } }, - "x-operation-group": "termvectors", + "x-operation-group": "indices.get_settings", "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", + }, + "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": "The index in which the document resides.", + "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": "The index in which the document resides." + "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": "id", - "in": "path", - "description": "Document ID. When not specified a doc param should be supplied.", + "name": "master_timeout", + "in": "query", + "description": "Operation timeout for connection to master node.", "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 + "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": "term_statistics", + "name": "cluster_manager_timeout", "in": "query", - "description": "Specifies if total term frequency and document frequency should be returned.", + "description": "Operation timeout for connection to cluster-manager node.", "schema": { - "type": "boolean", - "default": false, - "description": "Specifies if total term frequency and document frequency should be returned." + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-data-type": "time" } }, { - "name": "field_statistics", + "name": "timeout", "in": "query", - "description": "Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned.", + "description": "Operation timeout.", "schema": { - "type": "boolean", - "default": true, - "description": "Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned." + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" } }, { - "name": "fields", + "name": "preserve_existing", "in": "query", - "description": "Comma-separated list of fields to return.", - "style": "form", + "description": "Whether to update existing settings. If set to `true` existing settings on an index remain unchanged.", "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Comma-separated list of fields to return." - }, - "explode": true + "type": "boolean", + "default": false, + "description": "Whether to update existing settings. If set to `true` existing settings on an index remain unchanged." + } }, { - "name": "offsets", + "name": "ignore_unavailable", "in": "query", - "description": "Specifies if term offsets should be returned.", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", "schema": { "type": "boolean", - "default": true, - "description": "Specifies if term offsets should be returned." + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." } }, { - "name": "positions", + "name": "allow_no_indices", "in": "query", - "description": "Specifies if term positions should be returned.", + "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": true, - "description": "Specifies if term positions should be returned." + "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": "payloads", + "name": "expand_wildcards", "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.", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", "schema": { - "type": "string", - "description": "Routing value." + "$ref": "#/components/schemas/ExpandWildcards" } }, { - "name": "realtime", + "name": "flat_settings", "in": "query", - "description": "Specifies if request is real-time as opposed to near-real-time.", + "description": "Return settings in flat format.", "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" + "default": false, + "description": "Return settings in flat format." } } ], "responses": { "200": { - "description": "Termvectors_Get_WithId 200 response" + "description": "IndicesPutSettings_WithIndex 200 response" } }, - "x-operation-group": "termvectors", + "x-operation-group": "indices.put_settings", "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" - } - } - } - }, + } + }, + "/{index}/_settings/{name}": { + "get": { + "description": "Returns settings for one or more indices.", + "operationId": "IndicesGetSettings_WithIndexName", "parameters": [ { "name": "index", "in": "path", - "description": "The index in which the document resides.", + "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": "The index in which the document resides." + "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 + "required": true, + "examples": { + "IndicesGetSettings_WithIndexName_example1": { + "summary": "Examples for Get settings Index-setting Operation.", + "description": "", + "value": "books" + } + } }, { - "name": "id", + "name": "name", "in": "path", - "description": "Document ID. When not specified a doc param should be supplied.", + "description": "Comma-separated list of settings.", "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." + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Comma-separated list of settings.", + "x-data-type": "array" }, - "required": true + "required": true, + "examples": { + "IndicesGetSettings_WithIndexName_example1": { + "summary": "Examples for Get settings Index-setting Operation.", + "description": "", + "value": "index" + } + } }, { - "name": "term_statistics", + "name": "master_timeout", "in": "query", - "description": "Specifies if total term frequency and document frequency should be returned.", + "description": "Operation timeout for connection to master node.", "schema": { - "type": "boolean", - "default": false, - "description": "Specifies if total term frequency and document frequency should be returned." + "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": "field_statistics", + "name": "cluster_manager_timeout", "in": "query", - "description": "Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned.", + "description": "Operation timeout for connection to cluster-manager node.", "schema": { - "type": "boolean", - "default": true, - "description": "Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned." + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-data-type": "time" } }, { - "name": "fields", + "name": "ignore_unavailable", "in": "query", - "description": "Comma-separated list of fields to return.", - "style": "form", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Comma-separated list of fields to return." - }, - "explode": true + "type": "boolean", + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + } }, { - "name": "offsets", + "name": "allow_no_indices", "in": "query", - "description": "Specifies if term offsets should be returned.", + "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": true, - "description": "Specifies if term offsets should be returned." + "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": "positions", + "name": "expand_wildcards", "in": "query", - "description": "Specifies if term positions should be returned.", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", "schema": { - "type": "boolean", - "default": true, - "description": "Specifies if term positions should be returned." + "$ref": "#/components/schemas/ExpandWildcards" } }, { - "name": "payloads", + "name": "flat_settings", "in": "query", - "description": "Specifies if term payloads should be returned.", + "description": "Return settings in flat format.", "schema": { "type": "boolean", - "default": true, - "description": "Specifies if term payloads should be returned." + "default": false, + "description": "Return settings in flat format." } }, { - "name": "preference", + "name": "local", "in": "query", - "description": "Specify the node or shard the operation should be performed on.", + "description": "Return local information, do not retrieve the state from cluster-manager node.", "schema": { - "type": "string", - "default": "random", - "description": "Specify the node or shard the operation should be performed on." + "type": "boolean", + "default": false, + "description": "Return local information, do not retrieve the state from cluster-manager node." } }, { - "name": "routing", + "name": "include_defaults", "in": "query", - "description": "Routing value.", + "description": "Whether to return all default setting for each of the indices.", "schema": { - "type": "string", - "description": "Routing value." + "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": "realtime", + "name": "status", "in": "query", - "description": "Specifies if request is real-time as opposed to near-real-time.", + "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", - "default": true, - "description": "Specifies if request is real-time as opposed to near-real-time." + "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." } }, { - "name": "version", + "name": "allow_no_indices", "in": "query", - "description": "Explicit version number for concurrency control.", + "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": "integer", - "description": "Explicit version number for concurrency control.", - "format": "int32" + "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": "version_type", + "name": "expand_wildcards", "in": "query", - "description": "Specific version type.", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", "schema": { - "$ref": "#/components/schemas/VersionType" + "$ref": "#/components/schemas/ExpandWildcards" } } ], "responses": { "200": { - "description": "Termvectors_Post_WithId 200 response" + "description": "IndicesShardStores_WithIndex 200 response" } }, - "x-operation-group": "termvectors", + "x-operation-group": "indices.shard_stores", "x-version-added": "1.0" } }, - "/{index}/_update/{id}": { + "/{index}/_shrink/{target}": { "post": { - "description": "Updates a document with a script or partial document.", - "externalDocs": { - "description": "API Reference", - "url": "https://opensearch.org/docs/latest" - }, - "operationId": "Update", + "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/Update_BodyParams" + "$ref": "#/components/schemas/IndicesShrink_BodyParams" } } - }, - "required": true + } }, "parameters": [ { - "name": "id", + "name": "index", "in": "path", - "description": "Document ID.", + "description": "The name of the source index to shrink.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", - "description": "Document ID." + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the source index to shrink." }, "required": true }, { - "name": "index", + "name": "target", "in": "path", - "description": "Index name.", + "description": "The name of the target index.", "schema": { "type": "string", - "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless)", - "description": "Index name." + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the target index." }, "required": true }, { - "name": "wait_for_active_shards", + "name": "copy_settings", "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).", + "description": "whether or not to copy settings from the source index.", "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)." + "type": "boolean", + "default": false, + "description": "whether or not to copy settings from the source index." } }, { - "name": "_source", + "name": "timeout", "in": "query", - "description": "True or false to return the _source field or not, or a list of fields to return.", - "style": "form", + "description": "Operation timeout.", "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 + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" + } }, { - "name": "_source_excludes", + "name": "master_timeout", "in": "query", - "description": "List of fields to exclude from the returned _source field.", - "style": "form", + "description": "Operation timeout for connection to master node.", "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of fields to exclude from the returned _source field." - }, - "explode": true + "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": "_source_includes", + "name": "cluster_manager_timeout", "in": "query", - "description": "List of fields to extract and return from the _source field.", - "style": "form", + "description": "Operation timeout for connection to cluster-manager node.", "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of fields to extract and return from the _source field." - }, - "explode": true + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-data-type": "time" + } }, { - "name": "lang", + "name": "wait_for_active_shards", "in": "query", - "description": "The script language.", + "description": "Set the number of active shards to wait for on the shrunken index before the operation returns.", "schema": { "type": "string", - "default": "painless", - "description": "The script language." + "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": "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.", + "name": "index", + "in": "path", + "description": "The name of the source index to shrink.", "schema": { - "$ref": "#/components/schemas/RefreshEnum" - } + "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": "retry_on_conflict", - "in": "query", - "description": "Specify how many times should the operation be retried when a conflict occurs.", + "name": "target", + "in": "path", + "description": "The name of the target index.", "schema": { - "type": "integer", - "default": 0, - "description": "Specify how many times should the operation be retried when a conflict occurs.", - "format": "int32" - } + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the target index." + }, + "required": true }, { - "name": "routing", + "name": "copy_settings", "in": "query", - "description": "Routing value.", + "description": "whether or not to copy settings from the source index.", "schema": { - "type": "string", - "description": "Routing value." + "type": "boolean", + "default": false, + "description": "whether or not to copy settings from the source index." } }, { @@ -27798,173 +27705,229 @@ } }, { - "name": "if_seq_no", + "name": "master_timeout", "in": "query", - "description": "only perform the operation if the last operation that has changed the document has the specified sequence number.", + "description": "Operation timeout for connection to master node.", "schema": { - "type": "integer", - "description": "only perform the operation if the last operation that has changed the document has the specified sequence number.", - "format": "int32" + "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": "if_primary_term", + "name": "cluster_manager_timeout", "in": "query", - "description": "only perform the operation if the last operation that has changed the document has the specified primary term.", + "description": "Operation timeout for connection to cluster-manager node.", "schema": { - "type": "integer", - "description": "only perform the operation if the last operation that has changed the document has the specified primary term.", - "format": "int32" + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-data-type": "time" } }, { - "name": "require_alias", + "name": "wait_for_active_shards", "in": "query", - "description": "When true, requires destination to be an alias.", + "description": "Set the number of active shards to wait for on the shrunken index before the operation returns.", "schema": { - "type": "boolean", - "default": false, - "description": "When true, requires destination to be an alias." + "type": "string", + "description": "Set the number of active shards to wait for on the shrunken index before the operation returns." } } ], "responses": { "200": { - "description": "Update 200 response" + "description": "IndicesShrink_Put 200 response" } }, - "x-operation-group": "update", + "x-operation-group": "indices.shrink", "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.", + "/{index}/_source/{id}": { + "get": { + "description": "Returns the source of a document.", "externalDocs": { "description": "API Reference", - "url": "https://opensearch.org/docs/latest" + "url": "https://opensearch.org/docs/latest/api-reference/document-apis/get-documents/" }, - "operationId": "UpdateByQuery", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateByQuery_BodyParams" + "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" } } - } - }, - "parameters": [ + }, { "name": "index", "in": "path", - "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "description": "Index name.", "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" + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Index name." }, - "required": true + "required": true, + "examples": { + "GetSource_example1": { + "summary": "Examples for Get document source Operation.", + "description": "", + "value": "books" + } + } }, { - "name": "analyzer", + "name": "preference", "in": "query", - "description": "The analyzer to use for the query string.", + "description": "Specify the node or shard the operation should be performed on.", "schema": { "type": "string", - "description": "The analyzer to use for the query string." + "default": "random", + "description": "Specify the node or shard the operation should be performed on." } }, { - "name": "analyze_wildcard", + "name": "realtime", "in": "query", - "description": "Specify whether wildcard and prefix queries should be analyzed.", + "description": "Specify whether to perform the operation in realtime or search mode.", "schema": { "type": "boolean", - "default": false, - "description": "Specify whether wildcard and prefix queries should be analyzed." + "description": "Specify whether to perform the operation in realtime or search mode." } }, { - "name": "default_operator", + "name": "refresh", "in": "query", - "description": "The default operator for query string query (AND or OR).", + "description": "Refresh the shard containing the document before performing the operation.", "schema": { - "$ref": "#/components/schemas/DefaultOperator" + "type": "boolean", + "description": "Refresh the shard containing the document before performing the operation." } }, { - "name": "df", + "name": "routing", "in": "query", - "description": "The field to use as default where no field prefix is given in the query string.", + "description": "Routing value.", "schema": { "type": "string", - "description": "The field to use as default where no field prefix is given in the query string." + "description": "Routing value." } }, { - "name": "from", + "name": "_source", "in": "query", - "description": "Starting offset.", + "description": "True or false to return the _source field or not, or a list of fields to return.", + "style": "form", "schema": { - "type": "integer", - "default": 0, - "description": "Starting offset.", - "format": "int32" - } + "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": "ignore_unavailable", + "name": "_source_excludes", "in": "query", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "description": "List of fields to exclude from the returned _source field.", + "style": "form", "schema": { - "type": "boolean", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." - } + "type": "array", + "items": { + "type": "string" + }, + "description": "List of fields to exclude from the returned _source field." + }, + "explode": true }, { - "name": "allow_no_indices", + "name": "_source_includes", "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).", + "description": "List of fields to extract and return from the _source field.", + "style": "form", "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)." - } + "type": "array", + "items": { + "type": "string" + }, + "description": "List of fields to extract and return from the _source field." + }, + "explode": true }, { - "name": "conflicts", + "name": "version", "in": "query", - "description": "What to do when the operation encounters version conflicts?.", + "description": "Explicit version number for concurrency control.", "schema": { - "$ref": "#/components/schemas/Conflicts" + "type": "integer", + "description": "Explicit version number for concurrency control.", + "format": "int32" } }, { - "name": "expand_wildcards", + "name": "version_type", "in": "query", - "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "description": "Specific version type.", "schema": { - "$ref": "#/components/schemas/ExpandWildcards" + "$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": "lenient", - "in": "query", - "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored.", + "name": "id", + "in": "path", + "description": "Document ID.", "schema": { - "type": "boolean", - "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored." - } + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Document ID." + }, + "required": true }, { - "name": "pipeline", - "in": "query", - "description": "The pipeline id to preprocess incoming documents with.", + "name": "index", + "in": "path", + "description": "Index name.", "schema": { "type": "string", - "description": "The pipeline id to preprocess incoming documents with." - } + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "Index name." + }, + "required": true }, { "name": "preference", @@ -27977,92 +27940,32 @@ } }, { - "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", + "name": "realtime", "in": "query", - "description": "Specify how long a consistent view of the index should be maintained for scrolled search.", + "description": "Specify whether to perform the operation in realtime or search mode.", "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" + "type": "boolean", + "description": "Specify whether to perform the operation in realtime or search mode." } }, { - "name": "search_type", + "name": "refresh", "in": "query", - "description": "Search operation type.", + "description": "Refresh the shard containing the document before performing the operation.", "schema": { - "$ref": "#/components/schemas/SearchType" + "type": "boolean", + "description": "Refresh the shard containing the document before performing the operation." } }, { - "name": "search_timeout", + "name": "routing", "in": "query", - "description": "Explicit timeout for each search request. Defaults to no timeout.", + "description": "Routing value.", "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" + "description": "Routing value." } }, - { - "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", @@ -28106,257 +28009,241 @@ "explode": true }, { - "name": "terminate_after", + "name": "version", "in": "query", - "description": "The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.", + "description": "Explicit version number for concurrency control.", "schema": { "type": "integer", - "description": "The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.", + "description": "Explicit version number for concurrency control.", "format": "int32" } }, { - "name": "stats", + "name": "version_type", "in": "query", - "description": "Specific 'tag' of the request for logging and statistical purposes.", - "style": "form", + "description": "Specific version type.", "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Specific 'tag' of the request for logging and statistical purposes." + "$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." }, - "explode": true + "required": 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.", + "name": "target", + "in": "path", + "description": "The name of the target index.", "schema": { - "type": "boolean", - "description": "Specify if request cache should be used for this request or not, defaults to index level setting." - } + "type": "string", + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the target index." + }, + "required": true }, { - "name": "refresh", + "name": "copy_settings", "in": "query", - "description": "Should the affected indexes be refreshed?.", + "description": "whether or not to copy settings from the source index.", "schema": { "type": "boolean", - "description": "Should the affected indexes be refreshed?." + "default": false, + "description": "whether or not to copy settings from the source index." } }, { "name": "timeout", "in": "query", - "description": "Time each individual bulk request should wait for shards that are unavailable.", + "description": "Operation timeout.", "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.", + "description": "Operation timeout.", "x-data-type": "time" } }, { - "name": "wait_for_active_shards", + "name": "master_timeout", "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).", + "description": "Operation timeout for connection to master node.", "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." + "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": "requests_per_second", + "name": "cluster_manager_timeout", "in": "query", - "description": "The throttle for this request in sub-requests per second. -1 means no throttle.", + "description": "Operation timeout for connection to cluster-manager node.", "schema": { - "type": "integer", - "default": 0, - "description": "The throttle for this request in sub-requests per second. -1 means no throttle.", - "format": "int32" + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-data-type": "time" } }, { - "name": "slices", + "name": "wait_for_active_shards", "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`.", + "description": "Set the number of active shards to wait for on the shrunken index before the operation returns.", "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`." + "description": "Set the number of active shards to wait for on the shrunken index before the operation returns." } } ], "responses": { "200": { - "description": "UpdateByQuery 200 response" + "description": "IndicesSplit_Post 200 response" } }, - "x-operation-group": "update_by_query", + "x-operation-group": "indices.split", "x-version-added": "1.0" - } - }, - "/{index}/_upgrade": { - "get": { - "description": "The _upgrade API is no longer useful and will be removed.", - "operationId": "IndicesGetUpgrade_WithIndex", + }, + "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": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "description": "The name of the source index to split.", "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" + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the source index to split." }, "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", + "name": "target", "in": "path", - "description": "Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices.", + "description": "The name of the target index.", "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" + "pattern": "^(?!_|template|query|field|point|clear|usage|stats|hot|reload|painless).+$", + "description": "The name of the target index." }, "required": true }, { - "name": "allow_no_indices", + "name": "copy_settings", "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).", + "description": "whether or not to copy settings from the source index.", "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)." + "default": false, + "description": "whether or not to copy settings from the source index." } }, { - "name": "expand_wildcards", + "name": "timeout", "in": "query", - "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "description": "Operation timeout.", "schema": { - "$ref": "#/components/schemas/ExpandWildcards" + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout.", + "x-data-type": "time" } }, { - "name": "ignore_unavailable", + "name": "master_timeout", "in": "query", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "description": "Operation timeout for connection to master node.", "schema": { - "type": "boolean", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." + "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": "wait_for_completion", + "name": "cluster_manager_timeout", "in": "query", - "description": "Should this request wait until the operation has completed before returning.", + "description": "Operation timeout for connection to cluster-manager node.", "schema": { - "type": "boolean", - "default": false, - "description": "Should this request wait until the operation has completed before returning." + "type": "string", + "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", + "description": "Operation timeout for connection to cluster-manager node.", + "x-data-type": "time" } }, { - "name": "only_ancient_segments", + "name": "wait_for_active_shards", "in": "query", - "description": "If true, only ancient (an older Lucene major release) segments will be upgraded.", + "description": "Set the number of active shards to wait for on the shrunken index before the operation returns.", "schema": { - "type": "boolean", - "description": "If true, only ancient (an older Lucene major release) segments will be upgraded." + "type": "string", + "description": "Set the number of active shards to wait for on the shrunken index before the operation returns." } } ], "responses": { "200": { - "description": "IndicesUpgrade_WithIndex 200 response" + "description": "IndicesSplit_Put 200 response" } }, - "x-operation-group": "indices.upgrade", + "x-operation-group": "indices.split", "x-version-added": "1.0" } }, - "/{index}/_validate/query": { + "/{index}/_stats": { "get": { - "description": "Allows a user to validate a potentially expensive query without executing it.", - "operationId": "IndicesValidateQuery_Get_WithIndex", + "description": "Provides statistics on operations happening in an index.", + "operationId": "IndicesStats_WithIndex", "parameters": [ { "name": "index", @@ -28364,140 +28251,128 @@ "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)", + "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", + "name": "completion_fields", "in": "query", - "description": "Return detailed information about the error.", + "description": "Comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards).", + "style": "form", "schema": { - "type": "boolean", - "description": "Return detailed information about the error." - } + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards)." + }, + "explode": true }, { - "name": "ignore_unavailable", + "name": "fielddata_fields", "in": "query", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "description": "Comma-separated list of fields for `fielddata` index metric (supports wildcards).", + "style": "form", "schema": { - "type": "boolean", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." - } + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields for `fielddata` index metric (supports wildcards)." + }, + "explode": true }, { - "name": "allow_no_indices", + "name": "fields", "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).", + "description": "Comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards).", + "style": "form", "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" - } + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards)." + }, + "explode": true }, { - "name": "q", + "name": "groups", "in": "query", - "description": "Query in the Lucene query string syntax.", + "description": "Comma-separated list of search groups for `search` index metric.", + "style": "form", "schema": { - "type": "string", - "description": "Query in the Lucene query string syntax." - } + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of search groups for `search` index metric." + }, + "explode": true }, { - "name": "analyzer", + "name": "level", "in": "query", - "description": "The analyzer to use for the query string.", + "description": "Return stats aggregated at cluster, index or shard level.", "schema": { - "type": "string", - "description": "The analyzer to use for the query string." + "$ref": "#/components/schemas/IndiciesStatLevel" } }, { - "name": "analyze_wildcard", + "name": "include_segment_file_sizes", "in": "query", - "description": "Specify whether wildcard and prefix queries should be analyzed.", + "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": "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." + "description": "Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested)." } }, { - "name": "lenient", + "name": "include_unloaded_segments", "in": "query", - "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored.", + "description": "If set to true segment stats will include stats for segments that are not currently loaded into memory.", "schema": { "type": "boolean", - "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored." + "default": false, + "description": "If set to true segment stats will include stats for segments that are not currently loaded into memory." } }, { - "name": "rewrite", + "name": "expand_wildcards", "in": "query", - "description": "Provide a more detailed explanation showing the actual Lucene query that will be executed.", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", "schema": { - "type": "boolean", - "description": "Provide a more detailed explanation showing the actual Lucene query that will be executed." + "$ref": "#/components/schemas/ExpandWildcards" } }, { - "name": "all_shards", + "name": "forbid_closed_indices", "in": "query", - "description": "Execute validation on all shards instead of one random shard per index.", + "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", - "description": "Execute validation on all shards instead of one random shard per index." + "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": "IndicesValidateQuery_Get_WithIndex 200 response" + "description": "IndicesStats_WithIndex 200 response" } }, - "x-operation-group": "indices.validate_query", + "x-operation-group": "indices.stats", "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" - } - } - } - }, + } + }, + "/{index}/_stats/{metric}": { + "get": { + "description": "Provides statistics on operations happening in an index.", + "operationId": "IndicesStats_WithIndexMetric", "parameters": [ { "name": "index", @@ -28505,326 +28380,2570 @@ "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)", + "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.", + "name": "metric", + "in": "path", + "description": "Limit the information returned the specific metrics.", "schema": { - "type": "boolean", - "description": "Return detailed information about the error." - } + "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", + "completion", + "docs", + "fielddata", + "query_cache", + "flush", + "get", + "indexing", + "merge", + "request_cache", + "refresh", + "search", + "segments", + "store", + "warmer", + "suggest" + ], + "x-data-type": "array" + }, + "required": true }, { - "name": "ignore_unavailable", + "name": "completion_fields", "in": "query", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed).", + "description": "Comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards).", + "style": "form", "schema": { - "type": "boolean", - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)." - } + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards)." + }, + "explode": true }, { - "name": "allow_no_indices", + "name": "fielddata_fields", "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).", + "description": "Comma-separated list of fields for `fielddata` index metric (supports wildcards).", + "style": "form", "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)." - } + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields for `fielddata` index metric (supports wildcards)." + }, + "explode": true }, { - "name": "expand_wildcards", + "name": "fields", "in": "query", - "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "description": "Comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards).", + "style": "form", "schema": { - "$ref": "#/components/schemas/ExpandWildcards" - } + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards)." + }, + "explode": true }, { - "name": "q", + "name": "groups", "in": "query", - "description": "Query in the Lucene query string syntax.", + "description": "Comma-separated list of search groups for `search` index metric.", + "style": "form", "schema": { - "type": "string", - "description": "Query in the Lucene query string syntax." - } + "type": "array", + "items": { + "type": "string" + }, + "description": "Comma-separated list of search groups for `search` index metric." + }, + "explode": true }, { - "name": "analyzer", + "name": "level", "in": "query", - "description": "The analyzer to use for the query string.", + "description": "Return stats aggregated at cluster, index or shard level.", "schema": { - "type": "string", - "description": "The analyzer to use for the query string." + "$ref": "#/components/schemas/IndiciesStatLevel" } }, { - "name": "analyze_wildcard", + "name": "include_segment_file_sizes", "in": "query", - "description": "Specify whether wildcard and prefix queries should be analyzed.", + "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": "Specify whether wildcard and prefix queries should be analyzed." + "description": "Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested)." } }, { - "name": "default_operator", + "name": "include_unloaded_segments", "in": "query", - "description": "The default operator for query string query (AND or OR).", + "description": "If set to true segment stats will include stats for segments that are not currently loaded into memory.", "schema": { - "$ref": "#/components/schemas/DefaultOperator" + "type": "boolean", + "default": false, + "description": "If set to true segment stats will include stats for segments that are not currently loaded into memory." } }, { - "name": "df", + "name": "expand_wildcards", "in": "query", - "description": "The field to use as default where no field prefix is given in the query string.", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", "schema": { - "type": "string", - "description": "The field to use as default where no field prefix is given in the query string." + "$ref": "#/components/schemas/ExpandWildcards" } }, { - "name": "lenient", + "name": "forbid_closed_indices", "in": "query", - "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored.", + "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", - "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored." + "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": "rewrite", - "in": "query", - "description": "Provide a more detailed explanation showing the actual Lucene query that will be executed.", + "name": "index", + "in": "path", + "description": "The index in which the document resides.", "schema": { - "type": "boolean", + "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." - } + { + "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" } - ], - "responses": { - "200": { - "description": "IndicesValidateQuery_Post_WithIndex 200 response" + } + }, + "CreateUserResponseContent": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Security Operation Status" + }, + "message": { + "type": "string", + "description": "Security Operation Message" } - }, - "x-operation-group": "indices.validate_query", - "x-version-added": "1.0" - } - } - }, - "components": { - "schemas": { - "ActionObjectStructure": { + } + }, + "Create_BodyParams": { + "type": "object", + "description": "The document" + }, + "DataStream": { "type": "object", "properties": { - "add": { - "$ref": "#/components/schemas/UserDefinedStructure" + "name": { + "type": "string" }, - "remove": { - "$ref": "#/components/schemas/UserDefinedStructure" + "timestamp_field": { + "$ref": "#/components/schemas/DataStreamTimestampField" }, - "remove_index": { - "$ref": "#/components/schemas/UserDefinedStructure" + "indices": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DataStreamIndex" + } + }, + "generation": { + "type": "integer", + "format": "int64" + }, + "status": { + "$ref": "#/components/schemas/DataStreamStatus" + }, + "template": { + "type": "string" } } }, - "AttributeMap": { + "DataStreamIndex": { "type": "object", - "additionalProperties": { - "type": "string" + "properties": { + "index_name": { + "type": "string" + }, + "index_uuid": { + "type": "string" + } } }, - "Bulk_BodyParams": { + "DataStreamStatus": { + "type": "string", + "enum": [ + "green", + "yellow", + "red" + ] + }, + "DataStreamTimestampField": { "type": "object", - "x-serialize": "bulk" + "properties": { + "name": { + "type": "string" + } + } }, - "Bytes": { + "DefaultOperator": { "type": "string", - "description": "The unit in which to display byte values.", + "description": "The default operator for query string query (AND or OR).", "enum": [ - "b", - "k", - "kb", - "m", - "mb", - "g", - "gb", - "t", - "tb", - "p", - "pb" + "AND", + "OR" ] }, - "ClearScroll_BodyParams": { - "type": "object" + "DeleteActionGroupResponseContent": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Security Operation Status" + }, + "message": { + "type": "string", + "description": "Security Operation Message" + } + } }, - "ClusterAllocationExplain_BodyParams": { - "type": "object" + "DeleteAllPitsResponseContent": { + "type": "object", + "properties": { + "pits": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PitsDetailsDeleteAll" + } + } + } }, - "ClusterGetSettingsResponseContent": { + "DeleteByQuery_BodyParams": { + "type": "object", + "description": "The search definition using the Query DSL" + }, + "DeleteDistinguishedNamesResponseContent": { "type": "object", "properties": { - "persistent": { - "$ref": "#/components/schemas/UserDefinedValueMap" - }, - "transient": { - "$ref": "#/components/schemas/UserDefinedValueMap" + "status": { + "type": "string", + "description": "Security Operation Status" }, - "defaults": { - "$ref": "#/components/schemas/UserDefinedValueMap" + "message": { + "type": "string", + "description": "Security Operation Message" } } }, - "ClusterHealthLevel": { - "type": "string", - "description": "Specify the level of detail for returned information.", - "enum": [ - "cluster", - "indices", - "shards", - "awareness_attributes" + "DeletePitResponseContent": { + "type": "object", + "properties": { + "pits": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DeletedPit" + } + } + } + }, + "DeletePit_BodyParams": { + "type": "object", + "properties": { + "pit_id": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "pit_id" ] }, - "ClusterPutComponentTemplate_BodyParams": { - "type": "object" + "DeleteRoleMappingResponseContent": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Security Operation Status" + }, + "message": { + "type": "string", + "description": "Security Operation Message" + } + } }, - "ClusterPutSettingsResponseContent": { + "DeleteRoleResponseContent": { "type": "object", "properties": { - "acknowledged": { - "type": "boolean" + "status": { + "type": "string", + "description": "Security Operation Status" }, - "persistent": { - "$ref": "#/components/schemas/UserDefinedValueMap" + "message": { + "type": "string", + "description": "Security Operation Message" + } + } + }, + "DeleteTenantResponseContent": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Security Operation Status" }, - "transient": { - "$ref": "#/components/schemas/UserDefinedValueMap" + "message": { + "type": "string", + "description": "Security Operation Message" } } }, - "ClusterPutSettings_BodyParams": { + "DeleteUserResponseContent": { "type": "object", "properties": { - "persistent": { - "$ref": "#/components/schemas/UserDefinedValueMap" + "status": { + "type": "string", + "description": "Security Operation Status" }, - "transient": { - "$ref": "#/components/schemas/UserDefinedValueMap" + "message": { + "type": "string", + "description": "Security Operation Message" } } }, - "ClusterRerouteMetric_Member": { - "type": "string", - "enum": [ - "_all", - "blocks", - "metadata", - "nodes", - "routing_table", - "master_node", - "cluster_manager_node", - "version" - ] + "DeletedPit": { + "type": "object", + "properties": { + "successful": { + "type": "boolean" + }, + "pit_id": { + "type": "string" + } + } }, - "ClusterReroute_BodyParams": { - "type": "object" + "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" + } + } }, - "Conflicts": { + "ExpandWildcards": { "type": "string", - "description": "What to do when the operation encounters version conflicts?.", + "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", "enum": [ - "abort", - "proceed" + "all", + "open", + "closed", + "hidden", + "none" ] }, - "Count_BodyParams": { - "type": "object" + "Explain_BodyParams": { + "type": "object", + "description": "The query definition using the Query DSL" }, - "CreateTenantParams": { + "FieldCaps_BodyParams": { "type": "object", - "properties": { - "description": { - "type": "string" - } - } + "description": "An index filter specified with the Query DSL" }, - "CreateTenantResponseContent": { + "FlushCacheResponseContent": { "type": "object", "properties": { "status": { "type": "string", - "description": "Informing of request's status." + "description": "Security Operation Status" }, "message": { "type": "string", - "description": "The message indicating the information of action of the model." + "description": "Security Operation Message" } } }, - "Create_BodyParams": { - "type": "object" - }, - "DefaultOperator": { - "type": "string", - "description": "The default operator for query string query (AND or OR).", - "enum": [ - "AND", - "OR" - ] - }, - "DeleteByQuery_BodyParams": { - "type": "object" - }, - "DeletePit_BodyParams": { - "type": "object" + "GetAllPitsResponseContent": { + "type": "object", + "properties": { + "pits": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PitDetail" + } + } + } }, - "DeleteTenantResponseContent": { + "GetCertificatesResponseContent": { "type": "object", "properties": { - "status": { - "type": "string", - "description": "Informing of request's status." + "http_certificates_list": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CertificatesDetail" + } }, - "message": { - "type": "string", - "description": "The message indicating the information of action of the model." + "transport_certificates_list": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CertificatesDetail" + } } } }, - "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" - }, - "FieldCaps_BodyParams": { - "type": "object" - }, "GetResponseContent": { "type": "object", "properties": { @@ -28868,25 +30987,6 @@ "found" ] }, - "GetTenantResponseContent": { - "type": "object", - "properties": { - "tenant": { - "$ref": "#/components/schemas/Tenant" - } - } - }, - "GetTenantsResponseContent": { - "type": "object", - "properties": { - "tenantlist": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Tenant" - } - } - } - }, "GroupBy": { "type": "string", "description": "Group tasks by nodes or parent/child relationships.", @@ -28943,17 +31043,58 @@ } } }, + "IndexPermission": { + "type": "object", + "properties": { + "index_patterns": { + "type": "array", + "items": { + "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" + "type": "object", + "description": "The document" }, "IndicesAnalyze_BodyParams": { - "type": "object" + "type": "object", + "description": "Define analyzer/tokenizer parameters and the text on which the analysis should be performed" }, "IndicesClone_BodyParams": { - "type": "object" + "type": "object", + "description": "The configuration for the target index (`settings` and `aliases`)" + }, + "IndicesCreateDataStreamResponseContent": { + "type": "object", + "properties": { + "acknowledged": { + "type": "boolean" + } + } }, "IndicesCreateDataStream_BodyParams": { - "type": "object" + "type": "object", + "description": "The data stream definition" }, "IndicesCreateResponseContent": { "type": "object", @@ -28976,6 +31117,7 @@ }, "IndicesCreate_BodyParams": { "type": "object", + "description": "The configuration for the index (`settings` and `mappings`)", "properties": { "aliases": { "$ref": "#/components/schemas/UserDefinedValueMap" @@ -28988,6 +31130,14 @@ } } }, + "IndicesDeleteDataStreamResponseContent": { + "type": "object", + "properties": { + "acknowledged": { + "type": "boolean" + } + } + }, "IndicesDeleteResponseContent": { "type": "object", "properties": { @@ -28996,14 +31146,39 @@ } } }, + "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" + "type": "object", + "description": "The settings for the alias, such as `routing` or `filter`" }, "IndicesPutIndexTemplate_BodyParams": { - "type": "object" + "type": "object", + "description": "The template definition" }, "IndicesPutMapping_BodyParams": { - "type": "object" + "type": "object", + "description": "The mapping definition" }, "IndicesPutMapping_PostResponseContent": { "type": "object", @@ -29022,25 +31197,32 @@ } }, "IndicesPutSettings_BodyParams": { - "type": "object" + "type": "object", + "description": "The index settings to be updated" }, "IndicesPutTemplate_BodyParams": { - "type": "object" + "type": "object", + "description": "The template definition" }, "IndicesRollover_BodyParams": { - "type": "object" + "type": "object", + "description": "The conditions that needs to be met for executing rollover" }, "IndicesShrink_BodyParams": { - "type": "object" + "type": "object", + "description": "The configuration for the target index (`settings` and `aliases`)" }, "IndicesSimulateIndexTemplate_BodyParams": { - "type": "object" + "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" + "type": "object", + "description": "New index template definition to be simulated, if no index template name is specified" }, "IndicesSplit_BodyParams": { - "type": "object" + "type": "object", + "description": "The configuration for the target index (`settings` and `aliases`)" }, "IndicesUpdateAliasesResponseContent": { "type": "object", @@ -29055,6 +31237,7 @@ }, "IndicesUpdateAliases_BodyParams": { "type": "object", + "description": "The definition of `actions` to perform", "properties": { "actions": { "$ref": "#/components/schemas/ActionObjectStructure" @@ -29062,7 +31245,8 @@ } }, "IndicesValidateQuery_BodyParams": { - "type": "object" + "type": "object", + "description": "The query definition specified with the Query DSL" }, "IndiciesStatLevel": { "type": "string", @@ -29126,27 +31310,34 @@ } }, "IngestPutPipeline_BodyParams": { - "type": "object" + "type": "object", + "description": "The ingest definition" }, "IngestSimulate_BodyParams": { - "type": "object" + "type": "object", + "description": "The simulate definition" }, "Mget_BodyParams": { - "type": "object" + "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" + "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" + "type": "object", + "description": "An object containing the password for the opensearch keystore" }, "NodesStatLevel": { "type": "string", @@ -29165,70 +31356,294 @@ "create" ] }, - "PatchOperation": { + "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": { - "op": { - "type": "string" - }, - "path": { - "type": "string" + "status": { + "type": "string", + "description": "Security Operation Status" }, - "value": { - "$ref": "#/components/schemas/AttributeMap" + "message": { + "type": "string", + "description": "Security Operation Message" } } }, - "PatchTenantParams": { + "PatchTenantInputPayload": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PatchOperation" + } + }, + "PatchTenantResponseContent": { "type": "object", "properties": { - "tenantPatch": { - "$ref": "#/components/schemas/PatchOperation" + "status": { + "type": "string", + "description": "Security Operation Status" + }, + "message": { + "type": "string", + "description": "Security Operation Message" } } }, - "PatchTenantResponseContent": { + "PatchTenantsInputPayload": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PatchOperation" + } + }, + "PatchTenantsResponseContent": { "type": "object", "properties": { "status": { "type": "string", - "description": "Informing of request's status." + "description": "Security Operation Status" }, "message": { "type": "string", - "description": "The message indicating the information of action of the model." + "description": "Security Operation Message" } } }, - "PatchTenantsParams": { + "PatchUserInputPayload": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PatchOperation" + } + }, + "PatchUserResponseContent": { "type": "object", "properties": { - "tenantsPatch": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PatchOperation" - } + "status": { + "type": "string", + "description": "Security Operation Status" + }, + "message": { + "type": "string", + "description": "Security Operation Message" } } }, - "PatchTenantsResponseContent": { + "PatchUsersInputPayload": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PatchOperation" + } + }, + "PatchUsersResponseContent": { "type": "object", "properties": { "status": { "type": "string", - "description": "Informing of request's status." + "description": "Security Operation Status" }, "message": { "type": "string", - "description": "The message indicating the information of action of the model." + "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" + "type": "object", + "description": "The document" }, "RankEval_BodyParams": { - "type": "object" + "type": "object", + "description": "The ranking evaluation search definition, including search requests, document ratings and ranking metric definition." }, "RefreshEnum": { "type": "string", @@ -29240,7 +31655,8 @@ ] }, "Reindex_BodyParams": { - "type": "object" + "type": "object", + "description": "The search definition using the Query DSL and the prototype for the index request." }, "Relation": { "type": "string", @@ -29249,6 +31665,32 @@ "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": { @@ -29296,6 +31738,7 @@ }, "RemoteStoreRestore_BodyParams": { "type": "object", + "description": "Comma-separated list of index IDs", "properties": { "indices": { "type": "array", @@ -29309,7 +31752,90 @@ ] }, "RenderSearchTemplate_BodyParams": { - "type": "object" + "type": "object", + "description": "The search definition template and its params" + }, + "Role": { + "type": "object", + "properties": { + "reserved": { + "type": "boolean" + }, + "hidden": { + "type": "boolean" + }, + "description": { + "type": "string" + }, + "cluster_permission": { + "type": "array", + "items": { + "type": "string" + } + }, + "index_permission": { + "$ref": "#/components/schemas/IndexPermission" + }, + "tenant_permissions": { + "type": "array", + "items": { + "type": "string" + } + }, + "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", @@ -29321,13 +31847,16 @@ ] }, "ScriptsPainlessExecute_BodyParams": { - "type": "object" + "type": "object", + "description": "The script to execute" }, "Scroll_BodyParams": { - "type": "object" + "type": "object", + "description": "The scroll ID if not passed by URL or query parameter." }, "SearchTemplate_BodyParams": { - "type": "object" + "type": "object", + "description": "The search definition template and its params" }, "SearchType": { "type": "string", @@ -29349,6 +31878,7 @@ }, "Search_BodyParams": { "type": "object", + "description": "The search definition using the Query DSL", "properties": { "docvalue_fields": { "type": "string" @@ -29486,6 +32016,20 @@ } } }, + "SecurityHealthResponseContent": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "mode": { + "type": "string" + }, + "status": { + "type": "string" + } + } + }, "ShardStatistics": { "type": "object", "properties": { @@ -29508,16 +32052,20 @@ } }, "SnapshotClone_BodyParams": { - "type": "object" + "type": "object", + "description": "The snapshot clone definition" }, "SnapshotCreateRepository_BodyParams": { - "type": "object" + "type": "object", + "description": "The repository definition" }, "SnapshotCreate_BodyParams": { - "type": "object" + "type": "object", + "description": "The snapshot definition" }, "SnapshotRestore_BodyParams": { - "type": "object" + "type": "object", + "description": "Details of what to restore" }, "Status_Member": { "type": "string", @@ -29554,8 +32102,15 @@ } } }, + "TenantsMap": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Tenant" + } + }, "Termvectors_BodyParams": { - "type": "object" + "type": "object", + "description": "Define parameters and or supply a document to get termvectors for. See documentation." }, "Time": { "type": "string", @@ -29582,11 +32137,93 @@ } } }, + "UpdateAuditConfigurationResponseContent": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Security Operation Status" + }, + "message": { + "type": "string", + "description": "Security Operation Message" + } + } + }, "UpdateByQuery_BodyParams": { - "type": "object" + "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" + "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", @@ -29718,6 +32355,26 @@ "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.", diff --git a/src/ApiGenerator/Views/HighLevel/Client/Implementation/OpenSearchClient.Namespace.cshtml b/src/ApiGenerator/Views/HighLevel/Client/Implementation/OpenSearchClient.Namespace.cshtml index 7073b4271b..331099fb9b 100644 --- a/src/ApiGenerator/Views/HighLevel/Client/Implementation/OpenSearchClient.Namespace.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Client/Implementation/OpenSearchClient.Namespace.cshtml @@ -24,7 +24,7 @@ namespace OpenSearch.Client.@(CsharpNames.ApiNamespace).@ns@(CsharpNames.ApiName /// on . /// /// - public class @(CsharpNames.HighLevelClientNamespacePrefix)@ns@(CsharpNames.ClientNamespaceSuffix) : NamespacedClientProxy + public partial class @(CsharpNames.HighLevelClientNamespacePrefix)@ns@(CsharpNames.ClientNamespaceSuffix) : NamespacedClientProxy { internal @(CsharpNames.HighLevelClientNamespacePrefix)@ns@(CsharpNames.ClientNamespaceSuffix)(OpenSearchClient client) : base(client) {} @foreach(var e in endpoints) diff --git a/src/ApiGenerator/Views/HighLevel/Descriptors/Descriptors.cshtml b/src/ApiGenerator/Views/HighLevel/Descriptors/Descriptors.cshtml index 84f3949367..ca37a794ec 100644 --- a/src/ApiGenerator/Views/HighLevel/Descriptors/Descriptors.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Descriptors/Descriptors.cshtml @@ -27,7 +27,7 @@ using OpenSearch.Net.Utf8Json; // ReSharper disable UnusedTypeParameter // ReSharper disable PartialMethodWithSinglePart // ReSharper disable RedundantNameQualifier -namespace OpenSearch.Client +namespace OpenSearch.Client@(ns) { @foreach (var endpoint in endpoints) { diff --git a/src/ApiGenerator/Views/HighLevel/Requests/Requests.cshtml b/src/ApiGenerator/Views/HighLevel/Requests/Requests.cshtml index 3263b77c3f..ccf86d4973 100644 --- a/src/ApiGenerator/Views/HighLevel/Requests/Requests.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Requests/Requests.cshtml @@ -27,7 +27,7 @@ using OpenSearch.Net.Utf8Json; // ReSharper disable UnusedTypeParameter // ReSharper disable PartialMethodWithSinglePart // ReSharper disable RedundantNameQualifier -namespace OpenSearch.Client +namespace OpenSearch.Client@(ns) { @foreach (var endpoint in endpoints) { From d4c6a15be4a58e3b7c1887133f3604351e659f84 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Aug 2023 15:17:01 +1200 Subject: [PATCH 12/27] 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] --- src/ApiGenerator/ApiGenerator.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ApiGenerator/ApiGenerator.csproj b/src/ApiGenerator/ApiGenerator.csproj index 65c2ca0f24..5204b3a3d0 100644 --- a/src/ApiGenerator/ApiGenerator.csproj +++ b/src/ApiGenerator/ApiGenerator.csproj @@ -1,4 +1,4 @@ - + Exe @@ -12,7 +12,7 @@ - + From b80dfe2f489c4902877b5684a73757eb3093a657 Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Tue, 29 Aug 2023 08:55:33 +1200 Subject: [PATCH 13/27] 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 --- .../Configuration/CodeConfiguration.cs | 1 + .../Domain/Specification/QueryParameters.cs | 6 +- .../Generator/ApiEndpointFactory.cs | 13 +- src/ApiGenerator/Generator/CodeGenerator.cs | 5 +- src/ApiGenerator/OpenSearch.openapi.json | 318 ++++++++++++------ .../HighLevel/Descriptors/Descriptor.cshtml | 11 +- .../HighLevel/Requests/ApiUrlsLookup.cshtml | 2 +- .../Requests/RequestImplementations.cshtml | 2 +- .../RequestParameters.cshtml | 2 +- 9 files changed, 244 insertions(+), 116 deletions(-) diff --git a/src/ApiGenerator/Configuration/CodeConfiguration.cs b/src/ApiGenerator/Configuration/CodeConfiguration.cs index e238dce547..bbe62a0ad4 100644 --- a/src/ApiGenerator/Configuration/CodeConfiguration.cs +++ b/src/ApiGenerator/Configuration/CodeConfiguration.cs @@ -40,6 +40,7 @@ public static class CodeConfiguration private static readonly Glob[] OperationsToInclude = { // e.g. new Glob("nodes.*"), + new("dangling_indices.*"), new("tasks.*") }; diff --git a/src/ApiGenerator/Domain/Specification/QueryParameters.cs b/src/ApiGenerator/Domain/Specification/QueryParameters.cs index bbd39c5344..f77b851068 100644 --- a/src/ApiGenerator/Domain/Specification/QueryParameters.cs +++ b/src/ApiGenerator/Domain/Specification/QueryParameters.cs @@ -45,6 +45,8 @@ public class QueryParameters public string Description { get; set; } + public string VersionAdded { get; set; } + public IEnumerable DescriptionHighLevel { get @@ -191,8 +193,8 @@ public string TypeLowLevel } - public string InitializerGenerator(string @namespace, string type, string name, string key, string setter, params string[] doc) => - CodeGenerator.Property(@namespace, type, name, key, setter, Obsolete, doc); + public string InitializerGenerator(string @namespace, string type, string name, string key, string setter, string versionAdded, params string[] doc) => + CodeGenerator.Property(@namespace, type, name, key, setter, Obsolete, versionAdded, doc); } public class QueryParameterDeprecation diff --git a/src/ApiGenerator/Generator/ApiEndpointFactory.cs b/src/ApiGenerator/Generator/ApiEndpointFactory.cs index 2698510c4f..db67cc890f 100644 --- a/src/ApiGenerator/Generator/ApiEndpointFactory.cs +++ b/src/ApiGenerator/Generator/ApiEndpointFactory.cs @@ -89,7 +89,8 @@ public static ApiEndpoint From(string name, List<(string HttpPath, OpenApiPathIt Type = GetOpenSearchType(p.Schema), Description = p.Description, Options = GetEnumOptions(p.Schema), - Deprecated = p.IsDeprecated ? new QueryParameterDeprecation { Description = p.DeprecatedMessage } : null + Deprecated = GetDeprecation(p.Schema), + VersionAdded = p.Schema.GetExtension("x-version-added") as string, }); var endpoint = new ApiEndpoint @@ -159,6 +160,16 @@ private static IEnumerable GetEnumOptions(JsonSchema schema) return schema.Enumeration?.Select(e => e.ToString()) ?? Enumerable.Empty(); } + private static QueryParameterDeprecation GetDeprecation(IJsonExtensionObject schema) + { + var message = schema.GetExtension("x-deprecation-message") as string; + var version = schema.GetExtension("x-version-deprecated") as string; + + return message != null || version != null + ? new QueryParameterDeprecation { Description = message, Version = version } + : 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/CodeGenerator.cs b/src/ApiGenerator/Generator/CodeGenerator.cs index 3e2e78a8ee..0f9b35e627 100644 --- a/src/ApiGenerator/Generator/CodeGenerator.cs +++ b/src/ApiGenerator/Generator/CodeGenerator.cs @@ -45,11 +45,12 @@ public static string CatFormatPropertyGenerator(string type, string name, string 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, params string[] doc) + public static string Property(string @namespace, string type, string name, string key, string setter, string obsolete, string versionAdded, params string[] doc) { var components = new List(); foreach (var d in RenderDocumentation(doc)) A(d); - if (!string.IsNullOrWhiteSpace(obsolete)) A($"[Obsolete(\"Scheduled to be removed in 8.0, {obsolete}\")]"); + if (!string.IsNullOrWhiteSpace(versionAdded)) 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) diff --git a/src/ApiGenerator/OpenSearch.openapi.json b/src/ApiGenerator/OpenSearch.openapi.json index f0929abadf..ee92752dcb 100644 --- a/src/ApiGenerator/OpenSearch.openapi.json +++ b/src/ApiGenerator/OpenSearch.openapi.json @@ -279,7 +279,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } } ], @@ -1023,7 +1024,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -1150,7 +1152,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -1261,7 +1264,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -1838,7 +1842,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -2016,7 +2021,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -2172,7 +2178,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -2285,7 +2292,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -2417,7 +2425,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -2536,7 +2545,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -2712,7 +2722,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -3083,7 +3094,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -3500,7 +3512,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -3617,7 +3630,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -3736,7 +3750,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -3871,7 +3886,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -3990,7 +4006,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -4117,7 +4134,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -4367,7 +4385,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -4485,7 +4504,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -4606,7 +4626,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -4735,7 +4756,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -5022,7 +5044,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -5182,7 +5205,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -5670,7 +5694,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } } ], @@ -5764,7 +5789,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -5904,7 +5930,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -6008,7 +6035,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -6080,7 +6108,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -6210,7 +6239,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -6352,7 +6382,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -6616,7 +6647,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -6692,7 +6724,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } } ], @@ -6742,7 +6775,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -6884,7 +6918,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } } ], @@ -6968,7 +7003,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } } ], @@ -7367,7 +7403,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } } ], @@ -7440,7 +7477,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } } ], @@ -8054,7 +8092,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -8137,7 +8176,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } } ], @@ -8217,7 +8257,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } } ], @@ -8301,7 +8342,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } } ], @@ -8367,7 +8409,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } } ], @@ -8427,7 +8470,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -8578,7 +8622,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } } ], @@ -8661,7 +8706,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } } ], @@ -8705,7 +8751,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } } ], @@ -8822,7 +8869,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -8883,7 +8931,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } } ], @@ -8946,7 +8995,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -9124,7 +9174,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -13682,7 +13733,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -13989,7 +14041,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } } ], @@ -14042,7 +14095,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } } ], @@ -14112,7 +14166,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } } ], @@ -14186,7 +14241,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } } ], @@ -14269,7 +14325,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } } ], @@ -14350,7 +14407,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } } ], @@ -16216,7 +16274,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -16324,7 +16383,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -16433,7 +16493,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -16592,7 +16653,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -16646,7 +16708,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -16712,7 +16775,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -16773,7 +16837,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -16842,7 +16907,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -16925,7 +16991,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -17000,7 +17067,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -17062,7 +17130,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -17127,7 +17196,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -17204,7 +17274,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } } ], @@ -17269,7 +17340,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -17357,7 +17429,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -17440,7 +17513,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -17537,7 +17611,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } } ], @@ -17612,7 +17687,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -17685,7 +17761,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -18302,7 +18379,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -18378,7 +18456,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } } ], @@ -18438,7 +18517,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -18590,7 +18670,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } } ], @@ -18673,7 +18754,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } } ], @@ -19161,7 +19243,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -19262,7 +19345,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -19490,7 +19574,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } } ], @@ -19666,7 +19751,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } } ], @@ -19826,7 +19912,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } } ], @@ -20053,7 +20140,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } } ], @@ -20138,7 +20226,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } } ], @@ -20213,7 +20302,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } } ], @@ -20294,7 +20384,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } } ], @@ -20375,7 +20466,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } } ], @@ -20530,7 +20622,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -21032,7 +21125,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -21125,7 +21219,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -21201,7 +21296,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -23870,7 +23966,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -23954,7 +24051,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -24072,7 +24170,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -27157,7 +27256,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -27273,7 +27373,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -27408,7 +27509,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -27623,7 +27725,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -27726,7 +27829,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -28115,7 +28219,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { @@ -28218,7 +28323,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time" + "x-data-type": "time", + "x-version-added": "2.0.0" } }, { diff --git a/src/ApiGenerator/Views/HighLevel/Descriptors/Descriptor.cshtml b/src/ApiGenerator/Views/HighLevel/Descriptors/Descriptor.cshtml index 6fcd52d0fe..f2ca53d42f 100644 --- a/src/ApiGenerator/Views/HighLevel/Descriptors/Descriptor.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Descriptors/Descriptor.cshtml @@ -53,10 +53,17 @@ var desc = param.DescriptionHighLevel.ToList(); await IncludeAsync("HighLevel/Descriptors/XmlDocs.cshtml", desc); - if(!string.IsNullOrWhiteSpace(param.Obsolete)) + + if (!string.IsNullOrWhiteSpace(param.VersionAdded)) + { + + ///Supported by OpenSearch servers of version @(param.VersionAdded) or greater. + } + + if(!string.IsNullOrWhiteSpace(param.Obsolete)) { - [Obsolete("Scheduled to be removed in 8.0, @param.Obsolete")] + [Obsolete("@Raw(param.Obsolete)")] } diff --git a/src/ApiGenerator/Views/HighLevel/Requests/ApiUrlsLookup.cshtml b/src/ApiGenerator/Views/HighLevel/Requests/ApiUrlsLookup.cshtml index 93d8bdf44c..be7a574d24 100644 --- a/src/ApiGenerator/Views/HighLevel/Requests/ApiUrlsLookup.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Requests/ApiUrlsLookup.cshtml @@ -17,7 +17,7 @@ namespace OpenSearch.Client var propertyName = $"{endpoint.CsharpNames.Namespace}{endpoint.CsharpNames.MethodName}"; var paths = endpoint.Url.Paths.Count == 0 ? endpoint.Url.PathsWithDeprecations : endpoint.Url.Paths; - internal static ApiUrls @(Raw(propertyName)) = new ApiUrls(new [] {@Raw(string.Join(", ", paths.Select(p=>$"\"{p.Path.TrimStart('/')}\"")))}); + internal static ApiUrls @(Raw(propertyName)) = new(new [] {@Raw(string.Join(", ", paths.Select(p=>$"\"{p.Path.TrimStart('/')}\"")))}); } } diff --git a/src/ApiGenerator/Views/HighLevel/Requests/RequestImplementations.cshtml b/src/ApiGenerator/Views/HighLevel/Requests/RequestImplementations.cshtml index af7b516e5a..b438e2feff 100644 --- a/src/ApiGenerator/Views/HighLevel/Requests/RequestImplementations.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Requests/RequestImplementations.cshtml @@ -57,7 +57,7 @@ continue; } var doc = param.DescriptionHighLevel.ToArray(); - @Raw(param.InitializerGenerator(Model.CsharpNames.Namespace, param.TypeHighLevel, param.ClsName, original, param.SetterHighLevel, doc)) + @Raw(param.InitializerGenerator(Model.CsharpNames.Namespace, param.TypeHighLevel, param.ClsName, original, param.SetterHighLevel, param.VersionAdded, doc)) } @if (Model.CsharpNames.DescriptorNotFoundInCodebase) { diff --git a/src/ApiGenerator/Views/LowLevel/RequestParameters/RequestParameters.cshtml b/src/ApiGenerator/Views/LowLevel/RequestParameters/RequestParameters.cshtml index 0094de703b..0295c09fd4 100644 --- a/src/ApiGenerator/Views/LowLevel/RequestParameters/RequestParameters.cshtml +++ b/src/ApiGenerator/Views/LowLevel/RequestParameters/RequestParameters.cshtml @@ -32,7 +32,7 @@ namespace OpenSearch.Net@(ns) 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.Description)) + @Raw(param.InitializerGenerator(r.CsharpNames.Namespace, param.TypeLowLevel, param.ClsName, param.QueryStringKey, param.SetterLowLevel, param.VersionAdded, param.Description)) } } From 941a6491a74fad3995883697a0ecb34a978fd45c Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Wed, 6 Sep 2023 10:46:06 +1200 Subject: [PATCH 14/27] Re-generate `ingest` namespace (#340) Signed-off-by: Thomas Farr --- .../Configuration/CodeConfiguration.cs | 1 + .../Generator/ApiEndpointFactory.cs | 58 ++- src/ApiGenerator/OpenSearch.openapi.json | 436 +++++++++--------- 3 files changed, 256 insertions(+), 239 deletions(-) diff --git a/src/ApiGenerator/Configuration/CodeConfiguration.cs b/src/ApiGenerator/Configuration/CodeConfiguration.cs index bbe62a0ad4..43d90c8470 100644 --- a/src/ApiGenerator/Configuration/CodeConfiguration.cs +++ b/src/ApiGenerator/Configuration/CodeConfiguration.cs @@ -41,6 +41,7 @@ public static class CodeConfiguration { // e.g. new Glob("nodes.*"), new("dangling_indices.*"), + new("ingest.*"), new("tasks.*") }; diff --git a/src/ApiGenerator/Generator/ApiEndpointFactory.cs b/src/ApiGenerator/Generator/ApiEndpointFactory.cs index db67cc890f..c5ae4a719a 100644 --- a/src/ApiGenerator/Generator/ApiEndpointFactory.cs +++ b/src/ApiGenerator/Generator/ApiEndpointFactory.cs @@ -30,6 +30,7 @@ using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; +using System.Net.Mime; using ApiGenerator.Configuration; using ApiGenerator.Configuration.Overrides; using ApiGenerator.Domain; @@ -76,7 +77,7 @@ public static ApiEndpoint From(string name, List<(string HttpPath, OpenApiPathIt Name = p.Name, Required = requiredPathParams?.Contains(p.Name) ?? false, Type = GetOpenSearchType(p.Schema), - Options = GetEnumOptions(p.Schema), + Options = GetEnumOptions(p.Schema) }) .ToImmutableSortedDictionary(p => p.Name, p => p); @@ -90,7 +91,7 @@ public static ApiEndpoint From(string name, List<(string HttpPath, OpenApiPathIt Description = p.Description, Options = GetEnumOptions(p.Schema), Deprecated = GetDeprecation(p.Schema), - VersionAdded = p.Schema.GetExtension("x-version-added") as string, + VersionAdded = p.Schema.XVersionAdded() }); var endpoint = new ApiEndpoint @@ -103,14 +104,14 @@ public static ApiEndpoint From(string name, List<(string HttpPath, OpenApiPathIt OfficialDocumentationLink = new Documentation { Description = variants[0].Operation.Description, - Url = variants[0].Operation.ExternalDocumentation?.Url, + Url = variants[0].Operation.ExternalDocumentation?.Url }, Url = urlInfo, - Body = variants.Select(v => v.Operation.RequestBody).FirstOrDefault(b => b != null) is {} reqBody ? new Body - { - Description = reqBody.Description, - Required = reqBody.IsRequired - } : null, + 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(), }; @@ -138,10 +139,10 @@ private static void PatchRequestParameters(ApiEndpoint endpoint) => ?? throw new ArgumentNullException("ApiQueryParametersPatcher.Patch(endpoint.Name, endpoint.Url.Params, endpoint.Overrides)"); private static string GetOpenSearchType(JsonSchema schema) - { - while (schema.HasReference) schema = schema.Reference; + { + schema = schema.ActualSchema; - if (schema.GetExtension("x-data-type") is string dataType) + if (schema.XDataType() is {} dataType) return dataType == "array" ? "list" : dataType; return schema.Type switch @@ -153,23 +154,38 @@ private static string GetOpenSearchType(JsonSchema schema) }; } - private static IEnumerable GetEnumOptions(JsonSchema schema) - { - while (schema.HasReference) schema = schema.Reference; + private static IEnumerable GetEnumOptions(JsonSchema schema) => + schema.ActualSchema.Enumeration?.Select(e => e.ToString()) ?? Enumerable.Empty(); - return schema.Enumeration?.Select(e => e.ToString()) ?? Enumerable.Empty(); - } + private static QueryParameterDeprecation GetDeprecation(IJsonExtensionObject schema) => + (schema.XDeprecationMessage(), schema.XVersionDeprecated()) switch + { + (null, null) => null, + var (m, v) => new QueryParameterDeprecation { Description = m, Version = v } + }; - private static QueryParameterDeprecation GetDeprecation(IJsonExtensionObject schema) + private static string GetDescription(OpenApiRequestBody requestBody) { - var message = schema.GetExtension("x-deprecation-message") as string; - var version = schema.GetExtension("x-version-deprecated") as string; + if (!string.IsNullOrWhiteSpace(requestBody.Description)) + return requestBody.Description; - return message != null || version != null - ? new QueryParameterDeprecation { Description = message, Version = version } + 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 string XVersionAdded(this IJsonExtensionObject schema) => + schema.GetExtension("x-version-added") as string; + + private static string XDataType(this IJsonExtensionObject schema) => + schema.GetExtension("x-data-type") as string; + private static object GetExtension(this IJsonExtensionObject schema, string key) => schema.ExtensionData?.TryGetValue(key, out var value) ?? false ? value : null; } diff --git a/src/ApiGenerator/OpenSearch.openapi.json b/src/ApiGenerator/OpenSearch.openapi.json index ee92752dcb..fb73202fd2 100644 --- a/src/ApiGenerator/OpenSearch.openapi.json +++ b/src/ApiGenerator/OpenSearch.openapi.json @@ -279,8 +279,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } } ], @@ -1024,8 +1024,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -1152,8 +1152,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -1264,8 +1264,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -1842,8 +1842,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -2021,8 +2021,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -2178,8 +2178,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -2292,8 +2292,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -2425,8 +2425,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -2545,8 +2545,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -2722,8 +2722,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -3094,8 +3094,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -3512,8 +3512,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -3630,8 +3630,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -3750,8 +3750,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -3886,8 +3886,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -4006,8 +4006,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -4134,8 +4134,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -4385,8 +4385,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -4504,8 +4504,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -4626,8 +4626,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -4756,8 +4756,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -5044,8 +5044,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -5205,8 +5205,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -5380,7 +5380,7 @@ } }, "x-deprecation-message": "The hot accepts /_cluster/nodes as prefix for backwards compatibility reasons", - "x-ignorable": "true", + "x-ignorable": true, "x-operation-group": "nodes.hot_threads", "x-version-added": "1.0", "x-version-deprecated": "1.0" @@ -5461,7 +5461,7 @@ } }, "x-deprecation-message": "The hot threads API accepts `hotthreads` but only `hot_threads` is documented", - "x-ignorable": "true", + "x-ignorable": true, "x-operation-group": "nodes.hot_threads", "x-version-added": "1.0", "x-version-deprecated": "1.0" @@ -5554,7 +5554,7 @@ } }, "x-deprecation-message": "The hot accepts /_cluster/nodes as prefix for backwards compatibility reasons", - "x-ignorable": "true", + "x-ignorable": true, "x-operation-group": "nodes.hot_threads", "x-version-added": "1.0", "x-version-deprecated": "1.0" @@ -5647,7 +5647,7 @@ } }, "x-deprecation-message": "The hot threads API accepts `hotthreads` but only `hot_threads` is documented", - "x-ignorable": "true", + "x-ignorable": true, "x-operation-group": "nodes.hot_threads", "x-version-added": "1.0", "x-version-deprecated": "1.0" @@ -5694,8 +5694,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } } ], @@ -5789,8 +5789,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -5930,8 +5930,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -6035,8 +6035,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -6108,8 +6108,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -6239,8 +6239,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -6382,8 +6382,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -6647,8 +6647,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -6724,8 +6724,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } } ], @@ -6775,8 +6775,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -6918,8 +6918,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } } ], @@ -7003,8 +7003,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } } ], @@ -7403,8 +7403,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } } ], @@ -7477,8 +7477,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } } ], @@ -8092,8 +8092,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -8176,8 +8176,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } } ], @@ -8257,8 +8257,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } } ], @@ -8342,8 +8342,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } } ], @@ -8409,8 +8409,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } } ], @@ -8470,8 +8470,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -8622,8 +8622,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } } ], @@ -8706,8 +8706,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } } ], @@ -8751,8 +8751,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } } ], @@ -8869,8 +8869,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -8931,8 +8931,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } } ], @@ -8995,8 +8995,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -9174,8 +9174,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -10302,7 +10302,7 @@ } }, "x-deprecation-message": "The hot threads API accepts `hotthreads` but only `hot_threads` is documented", - "x-ignorable": "true", + "x-ignorable": true, "x-operation-group": "nodes.hot_threads", "x-version-added": "1.0", "x-version-deprecated": "1.0" @@ -11072,7 +11072,7 @@ } }, "x-deprecation-message": "The hot threads API accepts `hotthreads` but only `hot_threads` is documented", - "x-ignorable": "true", + "x-ignorable": true, "x-operation-group": "nodes.hot_threads", "x-version-added": "1.0", "x-version-deprecated": "1.0" @@ -13733,8 +13733,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -14041,8 +14041,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } } ], @@ -14095,8 +14095,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } } ], @@ -14166,8 +14166,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } } ], @@ -14241,8 +14241,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } } ], @@ -14325,8 +14325,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } } ], @@ -14407,8 +14407,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } } ], @@ -16274,8 +16274,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -16383,8 +16383,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -16493,8 +16493,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -16653,8 +16653,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -16708,8 +16708,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -16775,8 +16775,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -16837,8 +16837,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -16907,8 +16907,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -16991,8 +16991,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -17067,8 +17067,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -17130,8 +17130,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -17196,8 +17196,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -17274,8 +17274,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } } ], @@ -17340,8 +17340,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -17429,8 +17429,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -17513,8 +17513,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -17611,8 +17611,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } } ], @@ -17687,8 +17687,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -17761,8 +17761,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -18379,8 +18379,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -18456,8 +18456,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } } ], @@ -18517,8 +18517,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -18670,8 +18670,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } } ], @@ -18754,8 +18754,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } } ], @@ -19243,8 +19243,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -19345,8 +19345,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -19574,8 +19574,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } } ], @@ -19751,8 +19751,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } } ], @@ -19912,8 +19912,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } } ], @@ -20140,8 +20140,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } } ], @@ -20226,8 +20226,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } } ], @@ -20302,8 +20302,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } } ], @@ -20384,8 +20384,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } } ], @@ -20466,8 +20466,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } } ], @@ -20622,8 +20622,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -21125,8 +21125,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -21219,8 +21219,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -21296,8 +21296,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -23966,8 +23966,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -24051,8 +24051,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -24170,8 +24170,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -27256,8 +27256,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -27373,8 +27373,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -27509,8 +27509,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -27725,8 +27725,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -27829,8 +27829,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -28219,8 +28219,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { @@ -28323,8 +28323,8 @@ "type": "string", "pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$", "description": "Operation timeout for connection to cluster-manager node.", - "x-data-type": "time", - "x-version-added": "2.0.0" + "x-version-added": "2.0.0", + "x-data-type": "time" } }, { From a977319d36214f995f1b6f2771746d53e3183f0b Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Wed, 6 Sep 2023 11:35:54 +1200 Subject: [PATCH 15/27] Re-generate `snapshot` namespace (#351) Signed-off-by: Thomas Farr --- .../Configuration/CodeConfiguration.cs | 1 + .../Domain/Specification/ApiEndpoint.cs | 17 +++++++---------- .../HighLevelClientImplementationGenerator.cs | 2 +- .../LowLevelClientImplementationGenerator.cs | 2 +- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/ApiGenerator/Configuration/CodeConfiguration.cs b/src/ApiGenerator/Configuration/CodeConfiguration.cs index 43d90c8470..e26d906491 100644 --- a/src/ApiGenerator/Configuration/CodeConfiguration.cs +++ b/src/ApiGenerator/Configuration/CodeConfiguration.cs @@ -42,6 +42,7 @@ public static class CodeConfiguration // e.g. new Glob("nodes.*"), new("dangling_indices.*"), new("ingest.*"), + new("snapshot.*"), new("tasks.*") }; diff --git a/src/ApiGenerator/Domain/Specification/ApiEndpoint.cs b/src/ApiGenerator/Domain/Specification/ApiEndpoint.cs index 541f3cfc65..d1ffdeb14b 100644 --- a/src/ApiGenerator/Domain/Specification/ApiEndpoint.cs +++ b/src/ApiGenerator/Domain/Specification/ApiEndpoint.cs @@ -103,17 +103,14 @@ public class ApiEndpoint HttpMethod = PreferredHttpMethod }; - public string PreferredHttpMethod - { - get + public string PreferredHttpMethod => + HttpMethods.OrderByDescending(m => m switch { - var first = HttpMethods.First(); - if (HttpMethods.Count > 1 && first.ToUpperInvariant() == "GET") - return HttpMethods.Last(); - - return first; - } - } + "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:"; diff --git a/src/ApiGenerator/Generator/Razor/HighLevelClientImplementationGenerator.cs b/src/ApiGenerator/Generator/Razor/HighLevelClientImplementationGenerator.cs index 362396187d..fe5a37ef96 100644 --- a/src/ApiGenerator/Generator/Razor/HighLevelClientImplementationGenerator.cs +++ b/src/ApiGenerator/Generator/Razor/HighLevelClientImplementationGenerator.cs @@ -44,7 +44,7 @@ public class HighLevelClientImplementationGenerator : RazorGeneratorBase public override async Task Generate(RestApiSpec spec, ProgressBar progressBar, CancellationToken token) { var view = ViewLocations.HighLevel("Client", "Implementation", "OpenSearchClient.cshtml"); - var target = GeneratorLocations.HighLevel($"OpenSearchClient.{CsharpNames.RootNamespace}.cs"); + var target = GeneratorLocations.HighLevel($"OpenSearchClient.cs"); await DoRazor(spec, view, target, token); string Target(string id) => GeneratorLocations.HighLevel($"OpenSearchClient.{id}.cs"); diff --git a/src/ApiGenerator/Generator/Razor/LowLevelClientImplementationGenerator.cs b/src/ApiGenerator/Generator/Razor/LowLevelClientImplementationGenerator.cs index f9a9038fc1..8136fa30f0 100644 --- a/src/ApiGenerator/Generator/Razor/LowLevelClientImplementationGenerator.cs +++ b/src/ApiGenerator/Generator/Razor/LowLevelClientImplementationGenerator.cs @@ -44,7 +44,7 @@ public class LowLevelClientImplementationGenerator : RazorGeneratorBase public override async Task Generate(RestApiSpec spec, ProgressBar progressBar, CancellationToken token) { var view = ViewLocations.LowLevel("Client", "Implementation", "OpenSearchLowLevelClient.cshtml"); - var target = GeneratorLocations.LowLevel($"OpenSearchLowLevelClient.{CsharpNames.RootNamespace}.cs"); + var target = GeneratorLocations.LowLevel("OpenSearchLowLevelClient.cs"); await DoRazor(spec, view, target, token); var namespaced = spec.EndpointsPerNamespaceLowLevel.Where(kv => kv.Key != CsharpNames.RootNamespace).ToList(); From 5848604a4d4676e6029ebc2836e61606e6dc7f95 Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Thu, 7 Sep 2023 14:31:31 +1200 Subject: [PATCH 16/27] 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 --- .../Configuration/CodeConfiguration.cs | 2 +- .../Endpoints/NodesHotThreadsOverrides.cs | 41 ------------ .../Domain/ApiQueryParametersPatcher.cs | 3 +- src/ApiGenerator/Domain/RestApiSpec.cs | 64 ++++++++---------- .../Domain/Specification/ApiEndpoint.cs | 26 ++++---- .../Domain/Specification/UrlInformation.cs | 10 ++- .../Generator/ApiEndpointFactory.cs | 65 +++++++++++++++---- src/ApiGenerator/Generator/ApiGenerator.cs | 2 + src/ApiGenerator/OpenSearch.openapi.json | 48 +++++++------- .../HighLevel/Requests/ApiUrlsLookup.cshtml | 4 +- src/ApiGenerator/Views/LowLevel/Enums.cshtml | 2 +- 11 files changed, 134 insertions(+), 133 deletions(-) delete mode 100644 src/ApiGenerator/Configuration/Overrides/Endpoints/NodesHotThreadsOverrides.cs diff --git a/src/ApiGenerator/Configuration/CodeConfiguration.cs b/src/ApiGenerator/Configuration/CodeConfiguration.cs index e26d906491..e143193073 100644 --- a/src/ApiGenerator/Configuration/CodeConfiguration.cs +++ b/src/ApiGenerator/Configuration/CodeConfiguration.cs @@ -39,9 +39,9 @@ public static class CodeConfiguration { private static readonly Glob[] OperationsToInclude = { - // e.g. new Glob("nodes.*"), new("dangling_indices.*"), new("ingest.*"), + new("nodes.*"), new("snapshot.*"), new("tasks.*") }; diff --git a/src/ApiGenerator/Configuration/Overrides/Endpoints/NodesHotThreadsOverrides.cs b/src/ApiGenerator/Configuration/Overrides/Endpoints/NodesHotThreadsOverrides.cs deleted file mode 100644 index 409876cf2d..0000000000 --- a/src/ApiGenerator/Configuration/Overrides/Endpoints/NodesHotThreadsOverrides.cs +++ /dev/null @@ -1,41 +0,0 @@ -/* 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 NodesHotThreadsOverrides : EndpointOverridesBase - { - public override IDictionary RenameQueryStringParams => new Dictionary - { - { "type", "thread_type" } - }; - } -} diff --git a/src/ApiGenerator/Domain/ApiQueryParametersPatcher.cs b/src/ApiGenerator/Domain/ApiQueryParametersPatcher.cs index 744ec2af00..d5757a3a23 100644 --- a/src/ApiGenerator/Domain/ApiQueryParametersPatcher.cs +++ b/src/ApiGenerator/Domain/ApiQueryParametersPatcher.cs @@ -58,7 +58,8 @@ IEndpointOverrides overrides value.QueryStringKey = queryStringKey; if (!renameLookup.TryGetValue(queryStringKey, out var preferredName)) preferredName = queryStringKey; - value.ClsName = CreateCSharpName(preferredName, endpointName); + + value.ClsName ??= CreateCSharpName(preferredName, endpointName); if (skipList.Contains(queryStringKey)) value.Skip = true; diff --git a/src/ApiGenerator/Domain/RestApiSpec.cs b/src/ApiGenerator/Domain/RestApiSpec.cs index e6a1740f6c..c474fa71d6 100644 --- a/src/ApiGenerator/Domain/RestApiSpec.cs +++ b/src/ApiGenerator/Domain/RestApiSpec.cs @@ -43,7 +43,7 @@ public class EnumDescription public class RestApiSpec { - public IDictionary Endpoints { get; set; } + public ImmutableSortedDictionary Endpoints { get; set; } public ImmutableSortedDictionary> EndpointsPerNamespaceLowLevel => Endpoints.Values.GroupBy(e=>e.CsharpNames.Namespace) @@ -63,44 +63,32 @@ public IEnumerable EnumsInTheSpec { if (_enumDescriptions != null) return _enumDescriptions; - string CreateName(string name, string methodName, string @namespace) - { - if ( - name.ToLowerInvariant().Contains("metric") - ||(name.ToLowerInvariant() == "status") - ||(name.ToLowerInvariant() == "format") - ) - { - if (methodName.StartsWith(@namespace)) - return methodName + name; - else - return @namespace + methodName + name; - } + var urlParameterEnums = Endpoints + .Values + .SelectMany(e => e.Url.Params.Values) + .Where(p => p.Options != null && p.Options.Any()) + .Select(p => new EnumDescription + { + Name = p.ClsName, + Options = p.Options + }) + .ToList(); - return name; - } - - var urlParameterEnums = ( - from e in Endpoints.Values - from para in e.Url.Params.Values - where para.Options != null && para.Options.Any() - let name = CreateName(para.ClsName, e.CsharpNames.MethodName, e.CsharpNames.Namespace) - where name != "Time" - select new EnumDescription - { - Name = name, - Options = para.Options - }).ToList(); - - var urlPartEnums = ( - from e in Endpoints.Values - from part in e.Url.Parts - where part.Options != null && part.Options.Any() - select new EnumDescription - { - Name = CreateName(part.Name.ToPascalCase(), e.CsharpNames.MethodName, e.CsharpNames.Namespace), - Options = part.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) diff --git a/src/ApiGenerator/Domain/Specification/ApiEndpoint.cs b/src/ApiGenerator/Domain/Specification/ApiEndpoint.cs index d1ffdeb14b..8ff2f8c41f 100644 --- a/src/ApiGenerator/Domain/Specification/ApiEndpoint.cs +++ b/src/ApiGenerator/Domain/Specification/ApiEndpoint.cs @@ -62,44 +62,46 @@ public class ApiEndpoint public IEndpointOverrides Overrides { get; internal set; } - public RequestInterface RequestInterface => new RequestInterface - { + 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() : Url.Params.Values.Where(p => p.RenderPartial && !p.Skip).ToList(), + Body == null ? Enumerable.Empty().ToList() : ParamsToGenerate.Where(p => p.RenderPartial).ToList(), OfficialDocumentationLink = OfficialDocumentationLink?.Url }; - public RequestPartialImplementation RequestPartialImplementation => new RequestPartialImplementation - { + public RequestPartialImplementation RequestPartialImplementation => new() + { CsharpNames = CsharpNames, OfficialDocumentationLink = OfficialDocumentationLink?.Url, Stability = Stability, Paths = Url.Paths, Parts = Url.Parts, - Params = Url.Params.Values.Where(p => !p.Skip).ToList(), + 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 DescriptorPartialImplementation - { + public DescriptorPartialImplementation DescriptorPartialImplementation => new() + { CsharpNames = CsharpNames, OfficialDocumentationLink = OfficialDocumentationLink?.Url, Constructors = Constructor.DescriptorConstructors(CsharpNames, Url).ToList(), Paths = Url.Paths, Parts = Url.Parts, - Params = Url.Params.Values.Where(p => !p.Skip).ToList(), + Params = ParamsToGenerate.ToList(), HasBody = Body != null, }; - public RequestParameterImplementation RequestParameterImplementation => new RequestParameterImplementation - { + public RequestParameterImplementation RequestParameterImplementation => new() + { CsharpNames = CsharpNames, OfficialDocumentationLink = OfficialDocumentationLink?.Url, - Params = Url.Params.Values.Where(p => !p.Skip).ToList(), + Params = ParamsToGenerate.ToList(), HttpMethod = PreferredHttpMethod }; diff --git a/src/ApiGenerator/Domain/Specification/UrlInformation.cs b/src/ApiGenerator/Domain/Specification/UrlInformation.cs index 0c05bcd805..e64e36d2ff 100644 --- a/src/ApiGenerator/Domain/Specification/UrlInformation.cs +++ b/src/ApiGenerator/Domain/Specification/UrlInformation.cs @@ -28,6 +28,7 @@ using System; using System.Collections.Generic; +using System.Collections.Immutable; using System.Linq; namespace ApiGenerator.Domain.Specification @@ -42,7 +43,7 @@ public class UrlInformation public IDictionary OriginalParts { get; set; } - private IReadOnlyCollection DeprecatedPaths { get; set; } + public IList DeprecatedPaths { get; set; } = new List(); private List _paths; public IReadOnlyCollection Paths @@ -113,7 +114,11 @@ public IReadOnlyCollection PathsWithDeprecations } - public IReadOnlyCollection Parts => Paths.SelectMany(p => p.Parts).DistinctBy(p => p.Name).ToList(); + public IReadOnlyCollection Parts => Paths + .SelectMany(p => p.Parts) + .DistinctBy(p => p.Name) + .OrderBy(p => p.Name) + .ToList(); public bool IsPartless => !Parts.Any(); @@ -135,6 +140,5 @@ public bool TryGetDocumentApiPath(out UrlPath path) path = new UrlPath(mostVerbosePath.Path, OriginalParts, mostVerbosePath.Parts); return true; } - } } diff --git a/src/ApiGenerator/Generator/ApiEndpointFactory.cs b/src/ApiGenerator/Generator/ApiEndpointFactory.cs index c5ae4a719a..a8640adbe5 100644 --- a/src/ApiGenerator/Generator/ApiEndpointFactory.cs +++ b/src/ApiGenerator/Generator/ApiEndpointFactory.cs @@ -37,6 +37,7 @@ using ApiGenerator.Domain.Code; using ApiGenerator.Domain.Specification; using NJsonSchema; +using NJsonSchema.References; using NSwag; namespace ApiGenerator.Generator @@ -55,16 +56,37 @@ public static ApiEndpoint From(string name, List<(string HttpPath, OpenApiPathIt foreach (var (httpPath, path, _, operation) in variants.DistinctBy(v => v.HttpPath)) { - urlInfo.OriginalPaths.Add(httpPath); + if (!operation.IsDeprecated) + urlInfo.OriginalPaths.Add(httpPath); + else + { + urlInfo.DeprecatedPaths.Add(new DeprecatedPath + { + Path = httpPath, + Version = operation.GetExtension("x-version-deprecated") as string, + Description = operation.GetExtension("x-deprecation-message") as string + }); + } + var pathParams = path.Parameters .Concat(operation.Parameters) .Where(p => p.Kind == OpenApiParameterKind.Path) .ToList(); + + foreach (var overloadedParam in pathParams.Where(p => p.Schema.XOverloadedParam() != null)) + { + urlInfo.OriginalPaths.Add(httpPath.Replace( + $"{{{overloadedParam.Name}}}", + $"{{{overloadedParam.Schema.XOverloadedParam()}}}" + )); + } + var paramNames = pathParams.Select(p => p.Name); - if (requiredPathParams != null) + if (requiredPathParams != null) requiredPathParams.IntersectWith(paramNames); else requiredPathParams = new HashSet(paramNames); + allPathParams.AddRange(pathParams); } @@ -84,15 +106,7 @@ public static ApiEndpoint From(string name, List<(string HttpPath, OpenApiPathIt urlInfo.Params = variants.SelectMany(v => v.Path.Parameters.Concat(v.Operation.Parameters)) .Where(p => p.Kind == OpenApiParameterKind.Query) .DistinctBy(p => p.Name) - .ToImmutableSortedDictionary(p => p.Name, - p => new QueryParameters - { - Type = GetOpenSearchType(p.Schema), - Description = p.Description, - Options = GetEnumOptions(p.Schema), - Deprecated = GetDeprecation(p.Schema), - VersionAdded = p.Schema.XVersionAdded() - }); + .ToImmutableSortedDictionary(p => p.Name, BuildQueryParam); var endpoint = new ApiEndpoint { @@ -138,6 +152,25 @@ private static void PatchRequestParameters(ApiEndpoint endpoint) => endpoint.Url.Params = ApiQueryParametersPatcher.Patch(endpoint.Name, endpoint.Url.Params, endpoint.Overrides) ?? throw new ArgumentNullException("ApiQueryParametersPatcher.Patch(endpoint.Name, endpoint.Url.Params, endpoint.Overrides)"); + 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; @@ -155,7 +188,9 @@ private static string GetOpenSearchType(JsonSchema schema) } private static IEnumerable GetEnumOptions(JsonSchema schema) => - schema.ActualSchema.Enumeration?.Select(e => e.ToString()) ?? Enumerable.Empty(); + schema.ActualSchema.XEnumOptions() + ?? schema.ActualSchema.Enumeration?.Select(e => e.ToString()) + ?? Enumerable.Empty(); private static QueryParameterDeprecation GetDeprecation(IJsonExtensionObject schema) => (schema.XDeprecationMessage(), schema.XVersionDeprecated()) switch @@ -186,6 +221,12 @@ private static string XVersionAdded(this IJsonExtensionObject schema) => 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 index 9dae100585..9b0d7d4f13 100644 --- a/src/ApiGenerator/Generator/ApiGenerator.cs +++ b/src/ApiGenerator/Generator/ApiGenerator.cs @@ -36,6 +36,7 @@ using ApiGenerator.Configuration; using ApiGenerator.Domain; using ApiGenerator.Generator.Razor; +using NJsonSchema; using NSwag; using ShellProgressBar; @@ -92,6 +93,7 @@ await DoGenerate( 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 }) diff --git a/src/ApiGenerator/OpenSearch.openapi.json b/src/ApiGenerator/OpenSearch.openapi.json index fb73202fd2..438eafcb6c 100644 --- a/src/ApiGenerator/OpenSearch.openapi.json +++ b/src/ApiGenerator/OpenSearch.openapi.json @@ -10646,21 +10646,23 @@ "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", - "completion", - "docs", - "fielddata", - "query_cache", - "flush", - "get", + "store", "indexing", + "get", + "search", "merge", - "request_cache", + "flush", "refresh", - "search", - "segments", - "store", + "query_cache", + "fielddata", + "docs", "warmer", - "suggest" + "completion", + "segments", + "translog", + "suggest", + "request_cache", + "recovery" ], "x-data-type": "array" }, @@ -11444,21 +11446,23 @@ "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", - "completion", - "docs", - "fielddata", - "query_cache", - "flush", - "get", + "store", "indexing", + "get", + "search", "merge", - "request_cache", + "flush", "refresh", - "search", - "segments", - "store", + "query_cache", + "fielddata", + "docs", "warmer", - "suggest" + "completion", + "segments", + "translog", + "suggest", + "request_cache", + "recovery" ], "x-data-type": "array" }, diff --git a/src/ApiGenerator/Views/HighLevel/Requests/ApiUrlsLookup.cshtml b/src/ApiGenerator/Views/HighLevel/Requests/ApiUrlsLookup.cshtml index be7a574d24..68d92443e6 100644 --- a/src/ApiGenerator/Views/HighLevel/Requests/ApiUrlsLookup.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Requests/ApiUrlsLookup.cshtml @@ -6,7 +6,7 @@ @{ await IncludeGeneratorNotice(); } namespace OpenSearch.Client { - internal static partial class ApiUrlsLookups + internal static partial class ApiUrlsLookups { @foreach (var endpoint in Model.Endpoints.Values) { @@ -17,7 +17,7 @@ namespace OpenSearch.Client var propertyName = $"{endpoint.CsharpNames.Namespace}{endpoint.CsharpNames.MethodName}"; var paths = endpoint.Url.Paths.Count == 0 ? endpoint.Url.PathsWithDeprecations : endpoint.Url.Paths; - internal static ApiUrls @(Raw(propertyName)) = new(new [] {@Raw(string.Join(", ", paths.Select(p=>$"\"{p.Path.TrimStart('/')}\"")))}); + internal static readonly ApiUrls @(Raw(propertyName)) = new(new [] {@Raw(string.Join(", ", paths.Select(p=>$"\"{p.Path.TrimStart('/')}\"")))}); } } diff --git a/src/ApiGenerator/Views/LowLevel/Enums.cshtml b/src/ApiGenerator/Views/LowLevel/Enums.cshtml index 630392bd6e..30ba1f0109 100644 --- a/src/ApiGenerator/Views/LowLevel/Enums.cshtml +++ b/src/ApiGenerator/Views/LowLevel/Enums.cshtml @@ -69,7 +69,7 @@ namespace OpenSearch.Net { @foreach (var e in Model.EnumsInTheSpec) { - EnumStringResolvers.TryAdd(typeof(@(e.Name)), (e) => GetStringValue((@(e.Name))e)); + EnumStringResolvers.TryAdd(typeof(@(e.Name)), e => GetStringValue((@(e.Name))e)); } } From 3d8d667c9ef373d57f4829c82f460a1113075f98 Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Wed, 4 Oct 2023 13:21:13 +1300 Subject: [PATCH 17/27] 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 --- .../Configuration/CodeConfiguration.cs | 9 +++ src/ApiGenerator/OpenSearch.openapi.json | 60 +++++++++++-------- 2 files changed, 43 insertions(+), 26 deletions(-) diff --git a/src/ApiGenerator/Configuration/CodeConfiguration.cs b/src/ApiGenerator/Configuration/CodeConfiguration.cs index e143193073..8e182c4d14 100644 --- a/src/ApiGenerator/Configuration/CodeConfiguration.cs +++ b/src/ApiGenerator/Configuration/CodeConfiguration.cs @@ -39,6 +39,15 @@ public static class CodeConfiguration { private static readonly Glob[] OperationsToInclude = { + new("cluster.allocation_explain"), + new("cluster.delete_component_template"), + new("cluster.delete_voting_config_exclusions"), + new("cluster.exists_component_template"), + new("cluster.get_component_template"), + new("cluster.get_settings"), + new("cluster.health"), + new("cluster.pending_tasks"), + new("dangling_indices.*"), new("ingest.*"), new("nodes.*"), diff --git a/src/ApiGenerator/OpenSearch.openapi.json b/src/ApiGenerator/OpenSearch.openapi.json index 438eafcb6c..a34c78380d 100644 --- a/src/ApiGenerator/OpenSearch.openapi.json +++ b/src/ApiGenerator/OpenSearch.openapi.json @@ -11823,7 +11823,8 @@ "$ref": "#/components/schemas/PatchActionGroupsInputPayload" } } - } + }, + "required": true }, "responses": { "200": { @@ -11948,7 +11949,8 @@ "$ref": "#/components/schemas/PatchActionGroupInputPayload" } } - } + }, + "required": true }, "parameters": [ { @@ -11989,7 +11991,8 @@ "$ref": "#/components/schemas/Action_Group" } } - } + }, + "required": true }, "parameters": [ { @@ -13244,7 +13247,8 @@ "$ref": "#/components/schemas/CreateTenantParams" } } - } + }, + "required": true }, "parameters": [ { @@ -17925,21 +17929,23 @@ "description": "Limit the information returned the specific metrics.", "x-enum-options": [ "_all", - "completion", - "docs", - "fielddata", - "query_cache", - "flush", - "get", + "store", "indexing", + "get", + "search", "merge", - "request_cache", + "flush", "refresh", - "search", - "segments", - "store", + "query_cache", + "fielddata", + "docs", "warmer", - "suggest" + "completion", + "segments", + "translog", + "suggest", + "request_cache", + "recovery" ], "x-data-type": "array" }, @@ -28506,21 +28512,23 @@ "description": "Limit the information returned the specific metrics.", "x-enum-options": [ "_all", - "completion", - "docs", - "fielddata", - "query_cache", - "flush", - "get", + "store", "indexing", + "get", + "search", "merge", - "request_cache", + "flush", "refresh", - "search", - "segments", - "store", + "query_cache", + "fielddata", + "docs", "warmer", - "suggest" + "completion", + "segments", + "translog", + "suggest", + "request_cache", + "recovery" ], "x-data-type": "array" }, From 2a6c5a652527476bf3559b9db0cfa3f697ed5bcc Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Tue, 17 Oct 2023 09:28:41 +1300 Subject: [PATCH 18/27] 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 --- src/ApiGenerator/ApiGenerator.csproj | 1 + .../HighLevel/Methods/BoundFluentMethod.cs | 19 +- .../Code/HighLevel/Methods/FluentMethod.cs | 7 +- .../HighLevel/Methods/FluentSyntaxBase.cs | 25 +-- .../HighLevel/Methods/InitializerMethod.cs | 4 +- .../HighLevel/Methods/MethodSyntaxBase.cs | 11 +- .../Code/HighLevel/Requests/Constructor.cs | 2 +- .../DescriptorPartialImplementation.cs | 12 +- .../Code/LowLevel/LowLevelClientMethod.cs | 29 ++- src/ApiGenerator/Domain/RestApiSpec.cs | 2 +- .../Domain/Specification/ApiEndpoint.cs | 47 +++-- .../Domain/Specification/Deprecation.cs | 45 +++++ .../Domain/Specification/QueryParameters.cs | 36 +--- .../Domain/Specification/UrlInformation.cs | 84 +-------- .../Domain/Specification/UrlPart.cs | 41 ++--- .../Domain/Specification/UrlPath.cs | 48 ++--- src/ApiGenerator/Extensions.cs | 3 + .../Generator/ApiEndpointFactory.cs | 165 ++++++++++++------ src/ApiGenerator/Generator/CodeGenerator.cs | 11 +- .../Client/FluentSyntax/FluentMethod.cshtml | 6 +- .../OpenSearchClient.Namespace.cshtml | 6 +- .../Implementation/OpenSearchClient.cshtml | 12 +- .../Client/Interface/IOpenSearchClient.cshtml | 10 +- .../HighLevel/Client/MethodXmlDocs.cshtml | 10 ++ .../HighLevel/Descriptors/Descriptor.cshtml | 27 +-- .../HighLevel/Descriptors/XmlDocs.cshtml | 20 ++- .../HighLevel/Requests/ApiUrlsLookup.cshtml | 2 +- .../Requests/RequestImplementations.cshtml | 6 +- .../OpenSearchLowLevelClient.Namespace.cshtml | 12 +- .../OpenSearchLowLevelClient.cshtml | 12 +- .../IOpenSearchLowLevelClient.cshtml | 10 +- .../LowLevel/Client/Methods/MethodDocs.cshtml | 20 ++- .../RequestParameters.cshtml | 4 +- 33 files changed, 386 insertions(+), 363 deletions(-) create mode 100644 src/ApiGenerator/Domain/Specification/Deprecation.cs diff --git a/src/ApiGenerator/ApiGenerator.csproj b/src/ApiGenerator/ApiGenerator.csproj index 5204b3a3d0..ea6d9cc7eb 100644 --- a/src/ApiGenerator/ApiGenerator.csproj +++ b/src/ApiGenerator/ApiGenerator.csproj @@ -13,6 +13,7 @@ + diff --git a/src/ApiGenerator/Domain/Code/HighLevel/Methods/BoundFluentMethod.cs b/src/ApiGenerator/Domain/Code/HighLevel/Methods/BoundFluentMethod.cs index 7e005f027f..54e96d8645 100644 --- a/src/ApiGenerator/Domain/Code/HighLevel/Methods/BoundFluentMethod.cs +++ b/src/ApiGenerator/Domain/Code/HighLevel/Methods/BoundFluentMethod.cs @@ -30,17 +30,18 @@ using System.Linq; using ApiGenerator.Configuration; using ApiGenerator.Domain.Specification; +using SemanticVersioning; -namespace ApiGenerator.Domain.Code.HighLevel.Methods +namespace ApiGenerator.Domain.Code.HighLevel.Methods { public class BoundFluentMethod : FluentSyntaxBase { - public BoundFluentMethod(CsharpNames names, IReadOnlyCollection parts, bool selectorIsOptional, string link, string summary) - : base(names, parts, selectorIsOptional, link, summary) { } + 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)); @@ -48,17 +49,17 @@ public BoundFluentMethod(CsharpNames names, IReadOnlyCollection parts, || !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) + + 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 index 07c5ccd5a9..fe7f3a3690 100644 --- a/src/ApiGenerator/Domain/Code/HighLevel/Methods/FluentMethod.cs +++ b/src/ApiGenerator/Domain/Code/HighLevel/Methods/FluentMethod.cs @@ -29,13 +29,14 @@ using System.Collections.Generic; using System.Linq; using ApiGenerator.Domain.Specification; +using SemanticVersioning; -namespace ApiGenerator.Domain.Code.HighLevel.Methods +namespace ApiGenerator.Domain.Code.HighLevel.Methods { public class FluentMethod : FluentSyntaxBase { - public FluentMethod(CsharpNames names, IReadOnlyCollection parts, bool selectorIsOptional, string link, string summary) - : base(names, parts, selectorIsOptional, link, summary) { } + 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 diff --git a/src/ApiGenerator/Domain/Code/HighLevel/Methods/FluentSyntaxBase.cs b/src/ApiGenerator/Domain/Code/HighLevel/Methods/FluentSyntaxBase.cs index abff18c282..e3f9d02765 100644 --- a/src/ApiGenerator/Domain/Code/HighLevel/Methods/FluentSyntaxBase.cs +++ b/src/ApiGenerator/Domain/Code/HighLevel/Methods/FluentSyntaxBase.cs @@ -30,15 +30,16 @@ using System.Linq; using ApiGenerator.Configuration; using ApiGenerator.Domain.Specification; +using SemanticVersioning; -namespace ApiGenerator.Domain.Code.HighLevel.Methods +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) - : base(names, link, summary) => + 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; } @@ -61,7 +62,7 @@ protected FluentSyntaxBase(CsharpNames names, IReadOnlyCollection parts CodeConfiguration.GenericOnlyInterfaces.Contains(CsharpNames.RequestInterfaceName) ? CsharpNames.GenericsDeclaredOnRequest : DescriptorGenerics; - + public virtual string RequestMethodGenerics => CodeConfiguration.GenericOnlyInterfaces.Contains(CsharpNames.RequestInterfaceName) ? CsharpNames.GenericsDeclaredOnRequest @@ -74,11 +75,11 @@ protected FluentSyntaxBase(CsharpNames names, IReadOnlyCollection parts 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") { @@ -113,15 +114,15 @@ private List CreateDescriptorArgs(IReadOnlyCollection parts) } private bool IsDocumentRequest => CodeConfiguration.DocumentRequests.Contains(CsharpNames.RequestInterfaceName); - private string GenericFirstArgument => + 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; @@ -136,17 +137,17 @@ public string SelectorArguments() 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()}"; } diff --git a/src/ApiGenerator/Domain/Code/HighLevel/Methods/InitializerMethod.cs b/src/ApiGenerator/Domain/Code/HighLevel/Methods/InitializerMethod.cs index d47228b3ce..f0f048e494 100644 --- a/src/ApiGenerator/Domain/Code/HighLevel/Methods/InitializerMethod.cs +++ b/src/ApiGenerator/Domain/Code/HighLevel/Methods/InitializerMethod.cs @@ -28,12 +28,14 @@ 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) : base(names, link, summary) { } + public InitializerMethod(CsharpNames names, string link, string summary, Deprecation deprecated, Version versionAdded) : base(names, link, summary, deprecated, versionAdded) { } public string MethodName => CsharpNames.MethodName; diff --git a/src/ApiGenerator/Domain/Code/HighLevel/Methods/MethodSyntaxBase.cs b/src/ApiGenerator/Domain/Code/HighLevel/Methods/MethodSyntaxBase.cs index 5e27c6d8e2..a0b1f329df 100644 --- a/src/ApiGenerator/Domain/Code/HighLevel/Methods/MethodSyntaxBase.cs +++ b/src/ApiGenerator/Domain/Code/HighLevel/Methods/MethodSyntaxBase.cs @@ -26,17 +26,24 @@ * 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) => - (CsharpNames, DocumentationLink, XmlDocSummary) = (names, link, summary); + 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<"); diff --git a/src/ApiGenerator/Domain/Code/HighLevel/Requests/Constructor.cs b/src/ApiGenerator/Domain/Code/HighLevel/Requests/Constructor.cs index a46a85660e..fcf1562b36 100644 --- a/src/ApiGenerator/Domain/Code/HighLevel/Requests/Constructor.cs +++ b/src/ApiGenerator/Domain/Code/HighLevel/Requests/Constructor.cs @@ -127,7 +127,7 @@ string generic Parameterless = true, Generated = $"protected {typeName}() : base()", Description = - $"///Used for serialization purposes, making sure we have a parameterless constructor{Indent}[SerializationConstructor]", + $"/// 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 index 3039482559..3f5a39882d 100644 --- a/src/ApiGenerator/Domain/Code/HighLevel/Requests/DescriptorPartialImplementation.cs +++ b/src/ApiGenerator/Domain/Code/HighLevel/Requests/DescriptorPartialImplementation.cs @@ -30,7 +30,7 @@ using System.Linq; using ApiGenerator.Domain.Specification; -namespace ApiGenerator.Domain.Code.HighLevel.Requests +namespace ApiGenerator.Domain.Code.HighLevel.Requests { public class DescriptorPartialImplementation { @@ -41,7 +41,7 @@ public class DescriptorPartialImplementation public IReadOnlyCollection Paths { get; set; } public IReadOnlyCollection Params { get; set; } public bool HasBody { get; set; } - + public IEnumerable GetFluentRouteSetters() { var setters = new List(); @@ -67,26 +67,26 @@ public IEnumerable GetFluentRouteSetters() var code = $"public {returnType} {p.InterfaceName}({p.HighLevelTypeName} {paramName}) => Assign({paramName}, (a,v)=>a.RouteValues.{routeSetter}(\"{p.Name}\", {routeValue}));"; - var xmlDoc = $"///{p.Description}"; + 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))"; + 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)"; + 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}"; + xmlDoc = $"/// {p.Description}"; setters.Add(new FluentRouteSetter { Code = code, XmlDoc = xmlDoc }); } } diff --git a/src/ApiGenerator/Domain/Code/LowLevel/LowLevelClientMethod.cs b/src/ApiGenerator/Domain/Code/LowLevel/LowLevelClientMethod.cs index f00f74f9e5..a81e269163 100644 --- a/src/ApiGenerator/Domain/Code/LowLevel/LowLevelClientMethod.cs +++ b/src/ApiGenerator/Domain/Code/LowLevel/LowLevelClientMethod.cs @@ -30,6 +30,7 @@ using System.Linq; using System.Text.RegularExpressions; using ApiGenerator.Domain.Specification; +using SemanticVersioning; namespace ApiGenerator.Domain.Code.LowLevel { @@ -44,35 +45,31 @@ public class LowLevelClientMethod public string PerPathMethodName { get; set; } public string HttpMethod { get; set; } - public DeprecatedPath DeprecatedPath { 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 { - string Evaluator(Match m) - { - - var arg = m.Groups[^1].Value.ToCamelCase(); - return $"{{{arg}:{arg}}}"; - } - - var url = Path.TrimStart('/'); - var options = Url.OriginalParts?.Select(p => p.Key) ?? Enumerable.Empty(); + 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("{")) - { - var patchedUrl = Regex.Replace(url, "{(" + pattern + ")}", Evaluator); - urlCode = $"Url($\"{patchedUrl}\")"; - } - return urlCode; + 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}\")"; } } diff --git a/src/ApiGenerator/Domain/RestApiSpec.cs b/src/ApiGenerator/Domain/RestApiSpec.cs index c474fa71d6..042910cefb 100644 --- a/src/ApiGenerator/Domain/RestApiSpec.cs +++ b/src/ApiGenerator/Domain/RestApiSpec.cs @@ -66,7 +66,7 @@ public IEnumerable EnumsInTheSpec var urlParameterEnums = Endpoints .Values .SelectMany(e => e.Url.Params.Values) - .Where(p => p.Options != null && p.Options.Any()) + .Where(p => !p.Skip && p.Options != null && p.Options.Any()) .Select(p => new EnumDescription { Name = p.ClsName, diff --git a/src/ApiGenerator/Domain/Specification/ApiEndpoint.cs b/src/ApiGenerator/Domain/Specification/ApiEndpoint.cs index 8ff2f8c41f..f22c15731f 100644 --- a/src/ApiGenerator/Domain/Specification/ApiEndpoint.cs +++ b/src/ApiGenerator/Domain/Specification/ApiEndpoint.cs @@ -33,6 +33,7 @@ using ApiGenerator.Domain.Code.HighLevel.Methods; using ApiGenerator.Domain.Code.HighLevel.Requests; using ApiGenerator.Domain.Code.LowLevel; +using SemanticVersioning; namespace ApiGenerator.Domain.Specification { @@ -78,7 +79,7 @@ public class ApiEndpoint CsharpNames = CsharpNames, OfficialDocumentationLink = OfficialDocumentationLink?.Url, Stability = Stability, - Paths = Url.Paths, + Paths = Url.Paths.ToList(), Parts = Url.Parts, Params = ParamsToGenerate.ToList(), Constructors = Constructor.RequestConstructors(CsharpNames, Url, inheritsFromPlainRequestBase: true).ToList(), @@ -91,7 +92,7 @@ public class ApiEndpoint CsharpNames = CsharpNames, OfficialDocumentationLink = OfficialDocumentationLink?.Url, Constructors = Constructor.DescriptorConstructors(CsharpNames, Url).ToList(), - Paths = Url.Paths, + Paths = Url.Paths.ToList(), Parts = Url.Parts, Params = ParamsToGenerate.ToList(), HasBody = Body != null, @@ -117,24 +118,45 @@ public class ApiEndpoint public string HighLevelMethodXmlDocDescription => $"{PreferredHttpMethod} request to the {Name} API, read more about this API online:"; - public HighLevelModel HighLevelModel => new HighLevelModel - { + 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: Body == null || !Body.Required || HttpMethods.Contains("GET"), + selectorIsOptional: BodyIsOptional, link: OfficialDocumentationLink?.Url, - summary: HighLevelMethodXmlDocDescription + summary: HighLevelMethodXmlDocDescription, + deprecated: Deprecated, + versionAdded: VersionAdded ), FluentBound = !CsharpNames.DescriptorBindsOverMultipleDocuments ? null : new BoundFluentMethod(CsharpNames, Url.Parts, - selectorIsOptional: Body == null || !Body.Required || HttpMethods.Contains("GET"), + selectorIsOptional: BodyIsOptional, link: OfficialDocumentationLink?.Url, - summary: HighLevelMethodXmlDocDescription + summary: HighLevelMethodXmlDocDescription, + deprecated: Deprecated, + versionAdded: VersionAdded ), Initializer = new InitializerMethod(CsharpNames, link: OfficialDocumentationLink?.Url, - summary: HighLevelMethodXmlDocDescription + summary: HighLevelMethodXmlDocDescription, + deprecated: Deprecated, + versionAdded: VersionAdded ) }; @@ -153,7 +175,7 @@ public IReadOnlyCollection LowLevelClientMethods Generator.ApiGenerator.Warnings.Add($"API '{Name}' has no documentation"); var httpMethod = PreferredHttpMethod; - foreach (var path in Url.PathsWithDeprecations) + foreach (var path in Url.AllPaths) { var methodName = CsharpNames.PerPathMethodName(path.Path); var parts = new List(path.Parts); @@ -183,11 +205,12 @@ public IReadOnlyCollection LowLevelClientMethods HttpMethod = httpMethod, OfficialDocumentationLink = OfficialDocumentationLink?.Url, Stability = Stability, - DeprecatedPath = path.Deprecation, + Deprecation = path.Deprecation, Path = path.Path, Parts = parts, Url = Url, - HasBody = Body != null + HasBody = Body != null, + VersionAdded = path.VersionAdded, }; _lowLevelClientMethods.Add(apiMethod); } 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/QueryParameters.cs b/src/ApiGenerator/Domain/Specification/QueryParameters.cs index f77b851068..71fae53ebd 100644 --- a/src/ApiGenerator/Domain/Specification/QueryParameters.cs +++ b/src/ApiGenerator/Domain/Specification/QueryParameters.cs @@ -30,6 +30,7 @@ using System.Collections.Generic; using System.Linq; using ApiGenerator.Generator; +using Version = SemanticVersioning.Version; namespace ApiGenerator.Domain.Specification { @@ -45,7 +46,7 @@ public class QueryParameters public string Description { get; set; } - public string VersionAdded { get; set; } + public Version VersionAdded { get; set; } public IEnumerable DescriptionHighLevel { @@ -97,27 +98,13 @@ public IEnumerable DescriptionHighLevel public string Obsolete { - get - { - if (!string.IsNullOrEmpty(_obsolete)) return _obsolete; - if (Deprecated != null) - { - if (!string.IsNullOrEmpty(Deprecated.Version) && !string.IsNullOrEmpty(Deprecated.Description)) - return $"Deprecated as of: {Deprecated.Version}, reason: {Deprecated.Description}"; - if (!string.IsNullOrEmpty(Deprecated.Version)) - return $"Deprecated as of: {Deprecated.Version}"; - if (!string.IsNullOrEmpty(Deprecated.Description)) - return $"reason: {Deprecated.Description}"; - - return "deprecated"; - } - - return null; - } - set => _obsolete = value; + get => !string.IsNullOrEmpty(_obsolete) + ? _obsolete + : Deprecated?.ToString(); + set => _obsolete = value; } - public QueryParameterDeprecation Deprecated { get; set; } + public Deprecation Deprecated { get; set; } public IEnumerable Options { get; set; } public string QueryStringKey { get; set; } @@ -193,14 +180,7 @@ public string TypeLowLevel } - public string InitializerGenerator(string @namespace, string type, string name, string key, string setter, string versionAdded, params string[] doc) => + 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); } - - public class QueryParameterDeprecation - { - public string Version { get; set; } - - public string Description { get; set; } - } } diff --git a/src/ApiGenerator/Domain/Specification/UrlInformation.cs b/src/ApiGenerator/Domain/Specification/UrlInformation.cs index e64e36d2ff..34f7c55591 100644 --- a/src/ApiGenerator/Domain/Specification/UrlInformation.cs +++ b/src/ApiGenerator/Domain/Specification/UrlInformation.cs @@ -26,9 +26,7 @@ * under the License. */ -using System; using System.Collections.Generic; -using System.Collections.Immutable; using System.Linq; namespace ApiGenerator.Domain.Specification @@ -39,80 +37,10 @@ public class UrlInformation { public IDictionary Params { get; set; } = new SortedDictionary(); - public IList OriginalPaths { get; set; } = new List(); - - public IDictionary OriginalParts { get; set; } - - public IList DeprecatedPaths { get; set; } = new List(); - - private List _paths; - public IReadOnlyCollection Paths - { - get - { - if (_paths != null && _paths.Count > 0) return _paths; - - _paths = OriginalPaths.Select(p => new UrlPath(p, OriginalParts)).ToList(); - return _paths; - } - } - - private List _pathsWithDeprecation; - public IReadOnlyCollection PathsWithDeprecations - { - get - { - if (_pathsWithDeprecation != null && _pathsWithDeprecation.Count > 0) return _pathsWithDeprecation; - - var paths = Paths ?? new UrlPath[] {}; - if (DeprecatedPaths == null || DeprecatedPaths.Count == 0) return Paths; - if (OriginalParts == null) return Paths; - - //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 canonicalPartNameLookup = paths.Select(path => new HashSet(path.Parts.Select(p => p.Name))).ToList(); - var withoutDeprecatedAliases = DeprecatedPaths - .Select(deprecatedPath => new - { - deprecatedPath, - parts = new HashSet(OriginalParts.Keys.Where(k => deprecatedPath.Path.Contains($"{{{k}}}"))) - }) - .GroupBy(t => t.parts, HashSet.CreateSetComparer()) - .Where(grouped => !canonicalPartNameLookup.Any(set => set.SetEquals(grouped.Key))) - .Select(grouped => grouped.First().deprecatedPath); - - _pathsWithDeprecation = paths - .Concat(withoutDeprecatedAliases.Select(p => new UrlPath(p, OriginalParts, Paths))) - .ToList(); - - // 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); - } - } - - _pathsWithDeprecation = finalPathsWithDeprecations; - - return _pathsWithDeprecation; - } - } + 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) @@ -127,7 +55,7 @@ public IReadOnlyCollection PathsWithDeprecations public bool IsDocumentApi => IsADocumentRoute(Parts); public static bool IsADocumentRoute(IReadOnlyCollection parts) => - parts.Count() == DocumentApiParts.Length + parts.Count == DocumentApiParts.Length && parts.All(p => DocumentApiParts.Contains(p.Name)); @@ -136,8 +64,8 @@ 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, OriginalParts, mostVerbosePath.Parts); + 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 index f0f0c27bbb..08a3d02089 100644 --- a/src/ApiGenerator/Domain/Specification/UrlPart.cs +++ b/src/ApiGenerator/Domain/Specification/UrlPart.cs @@ -30,16 +30,6 @@ namespace ApiGenerator.Domain.Specification { - - // Rename this type to Deprecation and remove Path duplication - public class DeprecatedPath - { - public string Version { get; set; } - public string Path { get; set; } - public string Description { get; set; } - } - - public class UrlPart { private string _description; @@ -146,30 +136,23 @@ public string Description set => _description = CleanUpDescription(value); } - public string InterfaceName - { - get - { - switch (Name) - { - case "repository": return "RepositoryName"; - default: return Name.ToPascalCase(); - } - } - } + public string InterfaceName => + Name switch + { + "repository" => "RepositoryName", + _ => Name.ToPascalCase() + }; - public string Name { get; set; } + 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 string CleanUpDescription(string value) - { - if (string.IsNullOrWhiteSpace(value)) return value; - - return value.Replace("use `_all` or empty string", "use the special string `_all` or Indices.All"); - } - } + 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 index b1546f4f6e..63f215ea07 100644 --- a/src/ApiGenerator/Domain/Specification/UrlPath.cs +++ b/src/ApiGenerator/Domain/Specification/UrlPath.cs @@ -26,50 +26,28 @@ * under the License. */ -using System; using System.Collections.Generic; using System.Linq; +using SemanticVersioning; -namespace ApiGenerator.Domain.Specification +namespace ApiGenerator.Domain.Specification { public class UrlPath { - private readonly List _additionalPartsForConstructor; + private readonly IList _additionalPartsForConstructor; public string Path { get; } - public DeprecatedPath Deprecation { get; } + public Deprecation Deprecation { get; } + public Version VersionAdded { get; } + public IList Parts { get; } - - public List Parts { get; } - - //TODO mark the parts that are deprecated - public UrlPath(DeprecatedPath path, IDictionary originalParts, IReadOnlyCollection allNonDeprecatedPaths) - : this(path.Path, originalParts) - { - Deprecation = path; - foreach (var part in Parts) - { - if (!part.Deprecated && !allNonDeprecatedPaths.Any(p => p.Path.Contains($"{{{part.Name}}}"))) - part.Deprecated = true; - } - } - public UrlPath(string path, IDictionary allParts, List additionalPartsForConstructor = null) + public UrlPath(string path, IList parts, Deprecation deprecation, Version versionAdded, IList additionalPartsForConstructor = null) { _additionalPartsForConstructor = additionalPartsForConstructor ?? new List(); Path = LeadingBackslash(path); - if (allParts == null) - { - Parts = new List(); - return; - } - var parts = - from p in allParts - //so deliciously side effect-y but at least its more isolated then in ApiEndpoint.CsharpMethods - let name = p.Value.Name = p.Key - where path.Contains($"{{{name}}}") - orderby path.IndexOf($"{{{name}}}", StringComparison.Ordinal) - select p.Value; - Parts = parts.ToList(); - } + Parts = parts; + Deprecation = deprecation; + VersionAdded = versionAdded; + } public string ConstructorArguments => string.Join(", ", Parts.Select(p => $"{p.HighLevelTypeName} {p.NameAsArgument}")); public string RequestBaseArguments => @@ -95,7 +73,7 @@ public string DocumentPathConstructorArgument(string generic) => string.Join(", public string GetXmlDocs(string indent, bool skipResolvable = false, bool documentConstructor = false) { - var doc = $@"///{Path}"; + var doc = $@"/// {Path}"; var parts = Parts.Where(p => !skipResolvable || !ResolvabeFromT.Contains(p.Name)).ToList(); if (!parts.Any()) return doc; @@ -112,7 +90,7 @@ string GetDescription(UrlPart p) } } - private string P(string name, string description) => $"///{description}"; + 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 index f61b107fe7..9484b5b428 100644 --- a/src/ApiGenerator/Extensions.cs +++ b/src/ApiGenerator/Extensions.cs @@ -71,5 +71,8 @@ public static string SplitPascalCase(this string s) => 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 index a8640adbe5..f7827792c5 100644 --- a/src/ApiGenerator/Generator/ApiEndpointFactory.cs +++ b/src/ApiGenerator/Generator/ApiEndpointFactory.cs @@ -31,6 +31,7 @@ using System.Collections.Immutable; using System.Linq; using System.Net.Mime; +using System.Text.RegularExpressions; using ApiGenerator.Configuration; using ApiGenerator.Configuration.Overrides; using ApiGenerator.Domain; @@ -39,6 +40,8 @@ using NJsonSchema; using NJsonSchema.References; using NSwag; +using SemanticVersioning; +using Version = SemanticVersioning.Version; namespace ApiGenerator.Generator { @@ -50,63 +53,103 @@ public static ApiEndpoint From(string name, List<(string HttpPath, OpenApiPathIt var methodName = tokens[^1]; var ns = tokens.Length > 1 ? tokens[0] : null; - var urlInfo = new UrlInformation(); - HashSet requiredPathParams = null; - var allPathParams = new List(); + 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)) - { - if (!operation.IsDeprecated) - urlInfo.OriginalPaths.Add(httpPath); - else - { - urlInfo.DeprecatedPaths.Add(new DeprecatedPath - { - Path = httpPath, - Version = operation.GetExtension("x-version-deprecated") as string, - Description = operation.GetExtension("x-deprecation-message") as string - }); - } - - var pathParams = path.Parameters - .Concat(operation.Parameters) - .Where(p => p.Kind == OpenApiParameterKind.Path) - .ToList(); - - foreach (var overloadedParam in pathParams.Where(p => p.Schema.XOverloadedParam() != null)) + { + 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)) { - urlInfo.OriginalPaths.Add(httpPath.Replace( - $"{{{overloadedParam.Name}}}", - $"{{{overloadedParam.Schema.XOverloadedParam()}}}" - )); + 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)); } - var paramNames = pathParams.Select(p => p.Name); - if (requiredPathParams != null) - requiredPathParams.IntersectWith(paramNames); - else - requiredPathParams = new HashSet(paramNames); + parts.SortBy(p => httpPath.IndexOf($"{{{p.Name}}}", StringComparison.Ordinal)); - allPathParams.AddRange(pathParams); + 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; } - urlInfo.OriginalParts = allPathParams.DistinctBy(p => p.Name) - .Select(p => new UrlPart - { - ClrTypeNameOverride = null, - Deprecated = p.IsDeprecated, - Description = p.Description, - Name = p.Name, - Required = requiredPathParams?.Contains(p.Name) ?? false, - Type = GetOpenSearchType(p.Schema), - Options = GetEnumOptions(p.Schema) - }) - .ToImmutableSortedDictionary(p => p.Name, p => p); - - urlInfo.Params = variants.SelectMany(v => v.Path.Parameters.Concat(v.Operation.Parameters)) - .Where(p => p.Kind == OpenApiParameterKind.Query) - .DistinctBy(p => p.Name) - .ToImmutableSortedDictionary(p => p.Name, BuildQueryParam); + 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(); + 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; var endpoint = new ApiEndpoint { @@ -120,7 +163,14 @@ public static ApiEndpoint From(string name, List<(string HttpPath, OpenApiPathIt Description = variants[0].Operation.Description, Url = variants[0].Operation.ExternalDocumentation?.Url }, - Url = urlInfo, + Url = new UrlInformation + { + AllPaths = paths, + Params = variants.SelectMany(v => v.Path.Parameters.Concat(v.Operation.Parameters)) + .Where(p => p.Kind == OpenApiParameterKind.Query) + .DistinctBy(p => p.Name) + .ToImmutableSortedDictionary(p => p.Name, BuildQueryParam) + }, Body = variants .Select(v => v.Operation.RequestBody) .FirstOrDefault(b => b != null) is { } reqBody @@ -192,11 +242,11 @@ private static IEnumerable GetEnumOptions(JsonSchema schema) => ?? schema.ActualSchema.Enumeration?.Select(e => e.ToString()) ?? Enumerable.Empty(); - private static QueryParameterDeprecation GetDeprecation(IJsonExtensionObject schema) => + private static Deprecation GetDeprecation(IJsonExtensionObject schema) => (schema.XDeprecationMessage(), schema.XVersionDeprecated()) switch { (null, null) => null, - var (m, v) => new QueryParameterDeprecation { Description = m, Version = v } + var (m, v) => new Deprecation { Description = m, Version = v } }; private static string GetDescription(OpenApiRequestBody requestBody) @@ -215,8 +265,15 @@ private static string XDeprecationMessage(this IJsonExtensionObject schema) => private static string XVersionDeprecated(this IJsonExtensionObject schema) => schema.GetExtension("x-version-deprecated") as string; - private static string XVersionAdded(this IJsonExtensionObject schema) => - schema.GetExtension("x-version-added") 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; diff --git a/src/ApiGenerator/Generator/CodeGenerator.cs b/src/ApiGenerator/Generator/CodeGenerator.cs index 0f9b35e627..9a0a5cb025 100644 --- a/src/ApiGenerator/Generator/CodeGenerator.cs +++ b/src/ApiGenerator/Generator/CodeGenerator.cs @@ -30,6 +30,7 @@ using System.Collections.Generic; using System.Linq; using ApiGenerator.Domain.Code.HighLevel.Requests; +using Version = SemanticVersioning.Version; namespace ApiGenerator.Generator { @@ -45,11 +46,11 @@ public static string CatFormatPropertyGenerator(string type, string name, string 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, string versionAdded, params string[] doc) + 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 (!string.IsNullOrWhiteSpace(versionAdded)) A($"///Supported by OpenSearch servers of version {versionAdded} or greater."); + 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" @@ -89,15 +90,15 @@ private static IEnumerable RenderDocumentation(params string[] doc) { case 0: yield break; case 1: - yield return $"///{doc[0]}"; + yield return $"/// {doc[0]}"; yield break; default: - yield return "///"; + yield return "/// "; foreach (var d in doc) yield return $"/// {d}"; - yield return "///"; + yield return "/// "; yield break; } diff --git a/src/ApiGenerator/Views/HighLevel/Client/FluentSyntax/FluentMethod.cshtml b/src/ApiGenerator/Views/HighLevel/Client/FluentSyntax/FluentMethod.cshtml index 10b88e61eb..e748bf9fff 100644 --- a/src/ApiGenerator/Views/HighLevel/Client/FluentSyntax/FluentMethod.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Client/FluentSyntax/FluentMethod.cshtml @@ -3,10 +3,10 @@ @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 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 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(); diff --git a/src/ApiGenerator/Views/HighLevel/Client/Implementation/OpenSearchClient.Namespace.cshtml b/src/ApiGenerator/Views/HighLevel/Client/Implementation/OpenSearchClient.Namespace.cshtml index 331099fb9b..c3c8e5d31b 100644 --- a/src/ApiGenerator/Views/HighLevel/Client/Implementation/OpenSearchClient.Namespace.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Client/Implementation/OpenSearchClient.Namespace.cshtml @@ -18,12 +18,12 @@ using OpenSearch.Net.@(CsharpNames.ApiNamespace).@ns@(CsharpNames.ApiNamespaceSu // 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) {} diff --git a/src/ApiGenerator/Views/HighLevel/Client/Implementation/OpenSearchClient.cshtml b/src/ApiGenerator/Views/HighLevel/Client/Implementation/OpenSearchClient.cshtml index 9ee1e2cd75..c57e3e1dfe 100644 --- a/src/ApiGenerator/Views/HighLevel/Client/Implementation/OpenSearchClient.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Client/Implementation/OpenSearchClient.cshtml @@ -1,6 +1,6 @@ @using System.Linq @using ApiGenerator.Domain -@using ApiGenerator +@using ApiGenerator @using ApiGenerator.Domain.Code @inherits CodeTemplatePage @{ await IncludeGeneratorNotice(); } @@ -17,15 +17,15 @@ using OpenSearch.Client; // ReSharper disable RedundantTypeArgumentsOfMethod namespace OpenSearch.Client { - /// - ///OpenSearch high level client - /// + /// + /// OpenSearch high level client + /// public partial class OpenSearchClient : IOpenSearchClient { foreach (var ns in namespaces) { - ///@(ns.SplitPascalCase()) APIs + /// @(ns.SplitPascalCase()) APIs public @CsharpNames.HighLevelClientNamespacePrefix@(ns)@CsharpNames.ClientNamespaceSuffix @ns { get; private set; } } @@ -41,7 +41,7 @@ namespace OpenSearch.Client } - + foreach (var kv in Model.EndpointsPerNamespaceHighLevel) { diff --git a/src/ApiGenerator/Views/HighLevel/Client/Interface/IOpenSearchClient.cshtml b/src/ApiGenerator/Views/HighLevel/Client/Interface/IOpenSearchClient.cshtml index 2cef1f859e..3dd2c0ba9d 100644 --- a/src/ApiGenerator/Views/HighLevel/Client/Interface/IOpenSearchClient.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Client/Interface/IOpenSearchClient.cshtml @@ -15,16 +15,16 @@ using OpenSearch.Client; namespace OpenSearch.Client { - /// - ///OpenSearch high level client - /// - public partial interface IOpenSearchClient + /// + /// OpenSearch high level client + /// + public partial interface IOpenSearchClient { @foreach(var (ns, endpoints) in Model.EndpointsPerNamespaceHighLevel) { if (ns != CsharpNames.RootNamespace) { - ///@ns.SplitPascalCase() APIs + /// @ns.SplitPascalCase() APIs @CsharpNames.HighLevelClientNamespacePrefix@(ns)@CsharpNames.ClientNamespaceSuffix @ns { get; } continue; diff --git a/src/ApiGenerator/Views/HighLevel/Client/MethodXmlDocs.cshtml b/src/ApiGenerator/Views/HighLevel/Client/MethodXmlDocs.cshtml index 26445d9ea9..0a4ec9a61b 100644 --- a/src/ApiGenerator/Views/HighLevel/Client/MethodXmlDocs.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Client/MethodXmlDocs.cshtml @@ -1,8 +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/Descriptors/Descriptor.cshtml b/src/ApiGenerator/Views/HighLevel/Descriptors/Descriptor.cshtml index f2ca53d42f..2e0626c3c1 100644 --- a/src/ApiGenerator/Views/HighLevel/Descriptors/Descriptor.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Descriptors/Descriptor.cshtml @@ -10,9 +10,9 @@ var baseInterface = names.GenericOrNonGenericInterfacePreference; var apiLookup = $"ApiUrlsLookups.{Model.CsharpNames.Namespace}{Model.CsharpNames.MethodName}"; } - ///Descriptor for @names.MethodName@(Raw(Model.OfficialDocumentationLink.IsNullOrEmpty() ? "" : " " + Model.OfficialDocumentationLink + "")) + /// 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) { @@ -50,36 +50,27 @@ var tSuffix = (t == "bool" || t == "bool?") ? " = true" : ""; var typed = !string.IsNullOrEmpty(names.GenericsDeclaredOnDescriptor); var g = typed ? names.GenericsDeclaredOnDescriptor.Replace("<", "").Replace(">", "") : "T"; - var desc = param.DescriptionHighLevel.ToList(); - - await IncludeAsync("HighLevel/Descriptors/XmlDocs.cshtml", desc); - if (!string.IsNullOrWhiteSpace(param.VersionAdded)) - { - - ///Supported by OpenSearch servers of version @(param.VersionAdded) or greater. - } + await IncludeAsync("HighLevel/Descriptors/XmlDocs.cshtml", param); if(!string.IsNullOrWhiteSpace(param.Obsolete)) { - - [Obsolete("@Raw(param.Obsolete)")] - + [Obsolete("@Raw(param.Obsolete)")] + } - - public @Raw(type) @(param.ClsName)(@param.DescriptorArgumentType @param.ClsArgumentName@tSuffix) => Qs("@original", @(param.ClsArgumentName)); + public @Raw(type) @(param.ClsName)(@param.DescriptorArgumentType @param.ClsArgumentName@tSuffix) => Qs("@original", @(param.ClsArgumentName)); if (param.IsFieldsParam) { - ///@param.Description + /// @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 + /// @param.Description public @Raw(type) @param.ClsName@(Raw(typed ? "" : ""))(@Raw("Expression>") field) @Raw(typed ? "" : "where " + g + " : class") => Qs("@original", (Field)field); } @@ -90,6 +81,6 @@ public bool IsUnmapped => true; public bool UseIsUnmapped => IsUnmapped; - } + } } diff --git a/src/ApiGenerator/Views/HighLevel/Descriptors/XmlDocs.cshtml b/src/ApiGenerator/Views/HighLevel/Descriptors/XmlDocs.cshtml index 5015387ffa..5435af2bf5 100644 --- a/src/ApiGenerator/Views/HighLevel/Descriptors/XmlDocs.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Descriptors/XmlDocs.cshtml @@ -1,16 +1,24 @@ @using System.Linq -@inherits ApiGenerator.CodeTemplatePage> +@using Version = SemanticVersioning.Version +@inherits ApiGenerator.CodeTemplatePage @{ - var description = Model.Count == 1 ? Model.First() : string.Join($"{Environment.NewLine}\t\t", Model.Select(d => "/// " + d)); - if (Model.Count == 1) + 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) + /// @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 index 68d92443e6..4cebf146e9 100644 --- a/src/ApiGenerator/Views/HighLevel/Requests/ApiUrlsLookup.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Requests/ApiUrlsLookup.cshtml @@ -15,7 +15,7 @@ namespace OpenSearch.Client continue; } var propertyName = $"{endpoint.CsharpNames.Namespace}{endpoint.CsharpNames.MethodName}"; - var paths = endpoint.Url.Paths.Count == 0 ? endpoint.Url.PathsWithDeprecations : endpoint.Url.Paths; + 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/RequestImplementations.cshtml b/src/ApiGenerator/Views/HighLevel/Requests/RequestImplementations.cshtml index b438e2feff..0be9404b61 100644 --- a/src/ApiGenerator/Views/HighLevel/Requests/RequestImplementations.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Requests/RequestImplementations.cshtml @@ -7,7 +7,7 @@ @{ var apiLookup = $"ApiUrlsLookups.{Model.CsharpNames.Namespace}{Model.CsharpNames.MethodName}"; } -///Request for @Model.CsharpNames.MethodName@(Raw(Model.OfficialDocumentationLink.IsNullOrEmpty() ? "" : " " + Model.OfficialDocumentationLink + "")) +/// Request for @Model.CsharpNames.MethodName@(Raw(Model.OfficialDocumentationLink.IsNullOrEmpty() ? "" : " " + Model.OfficialDocumentationLink + "")) @if (Model.Stability != Stability.Stable) { string warningMessage = ""; @@ -20,8 +20,8 @@ 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 + "") + +/// @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)) diff --git a/src/ApiGenerator/Views/LowLevel/Client/Implementation/OpenSearchLowLevelClient.Namespace.cshtml b/src/ApiGenerator/Views/LowLevel/Client/Implementation/OpenSearchLowLevelClient.Namespace.cshtml index 87a06d99a4..7711359b87 100644 --- a/src/ApiGenerator/Views/LowLevel/Client/Implementation/OpenSearchLowLevelClient.Namespace.cshtml +++ b/src/ApiGenerator/Views/LowLevel/Client/Implementation/OpenSearchLowLevelClient.Namespace.cshtml @@ -1,6 +1,6 @@ @using System.Collections.ObjectModel @using System.Linq -@using ApiGenerator +@using ApiGenerator @using ApiGenerator.Domain.Code @using ApiGenerator.Domain.Specification @inherits CodeTemplatePage>> @@ -25,20 +25,20 @@ using static OpenSearch.Net.HttpMethod; // 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 { get; } = "text/plain"; + protected override string ContentType => "text/plain"; } - @{ + @{ var methods = endpoints.SelectMany(e=>e.LowLevelClientMethods).ToList(); foreach (var method in methods) { diff --git a/src/ApiGenerator/Views/LowLevel/Client/Implementation/OpenSearchLowLevelClient.cshtml b/src/ApiGenerator/Views/LowLevel/Client/Implementation/OpenSearchLowLevelClient.cshtml index 231413f7a1..2795157ec4 100644 --- a/src/ApiGenerator/Views/LowLevel/Client/Implementation/OpenSearchLowLevelClient.cshtml +++ b/src/ApiGenerator/Views/LowLevel/Client/Implementation/OpenSearchLowLevelClient.cshtml @@ -1,6 +1,6 @@ @using System.Linq @using ApiGenerator.Domain -@using ApiGenerator +@using ApiGenerator @using ApiGenerator.Domain.Code @inherits CodeTemplatePage @{ await IncludeGeneratorNotice(); } @@ -23,15 +23,15 @@ using static OpenSearch.Net.HttpMethod; // ReSharper disable RedundantExtendsListEntry namespace OpenSearch.Net { - /// - ///OpenSearch low level client - /// + /// + /// OpenSearch low level client + /// public partial class OpenSearchLowLevelClient : IOpenSearchLowLevelClient { foreach (var ns in namespaces) { - public @(CsharpNames.LowLevelClientNamespacePrefix)@(ns)@(CsharpNames.ClientNamespaceSuffix) @ns { get; private set; } + public @(CsharpNames.LowLevelClientNamespacePrefix)@(ns)@(CsharpNames.ClientNamespaceSuffix) @ns { get; private set; } } @@ -46,7 +46,7 @@ namespace OpenSearch.Net } - + foreach (var (ns, endpoints) in Model.EndpointsPerNamespaceLowLevel) { diff --git a/src/ApiGenerator/Views/LowLevel/Client/Interface/IOpenSearchLowLevelClient.cshtml b/src/ApiGenerator/Views/LowLevel/Client/Interface/IOpenSearchLowLevelClient.cshtml index c18cf883b8..4a90af2fb8 100644 --- a/src/ApiGenerator/Views/LowLevel/Client/Interface/IOpenSearchLowLevelClient.cshtml +++ b/src/ApiGenerator/Views/LowLevel/Client/Interface/IOpenSearchLowLevelClient.cshtml @@ -17,17 +17,17 @@ using OpenSearch.Net; namespace OpenSearch.Net { - /// - ///OpenSearch low level client - /// - public partial interface IOpenSearchLowLevelClient + /// + /// OpenSearch low level client + /// + public partial interface IOpenSearchLowLevelClient { @foreach(var (ns, endpoints) in Model.EndpointsPerNamespaceLowLevel) { if (ns != CsharpNames.RootNamespace) { - ///@ns.SplitPascalCase() APIs + /// @ns.SplitPascalCase() APIs @CsharpNames.LowLevelClientNamespacePrefix@(ns)@CsharpNames.ClientNamespaceSuffix @ns { get; } continue; diff --git a/src/ApiGenerator/Views/LowLevel/Client/Methods/MethodDocs.cshtml b/src/ApiGenerator/Views/LowLevel/Client/Methods/MethodDocs.cshtml index 46423d412d..2801001566 100644 --- a/src/ApiGenerator/Views/LowLevel/Client/Methods/MethodDocs.cshtml +++ b/src/ApiGenerator/Views/LowLevel/Client/Methods/MethodDocs.cshtml @@ -1,14 +1,16 @@ @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 + "")) +/// @Model.HttpMethod on @Model.Path@(Raw(Model.OfficialDocumentationLink.IsNullOrEmpty() ? "" : " " + Model.OfficialDocumentationLink + "")) @foreach (var part in Model.Parts) { - ///@Raw("")@part.Description@Raw("") + /// @Raw("")@part.Description@Raw("") } - ///@Raw(@"Request specific configuration such as querystring parameters & request specific connection settings.") + /// @Raw(@"Request specific configuration such as querystring parameters & request specific connection settings.") @if (Model.Stability != Stability.Stable) { string warningMessage = ""; @@ -23,11 +25,15 @@ } 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 + "") + /// @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.DeprecatedPath != null) + @if (Model.Deprecation is {} deprecation) { - [Obsolete("Deprecated in version @Model.DeprecatedPath.Version: @Raw(Model.DeprecatedPath.Description)")] + [Obsolete("Deprecated in version @deprecation.Version: @Raw(deprecation.Description)")] } diff --git a/src/ApiGenerator/Views/LowLevel/RequestParameters/RequestParameters.cshtml b/src/ApiGenerator/Views/LowLevel/RequestParameters/RequestParameters.cshtml index 0295c09fd4..fd477d54ef 100644 --- a/src/ApiGenerator/Views/LowLevel/RequestParameters/RequestParameters.cshtml +++ b/src/ApiGenerator/Views/LowLevel/RequestParameters/RequestParameters.cshtml @@ -25,8 +25,8 @@ namespace OpenSearch.Net@(ns) 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> + /// 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"); From 0657e84c7b7e612013f9a021edaf5be813d27379 Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Mon, 6 Nov 2023 12:01:13 +1300 Subject: [PATCH 19/27] 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 --- .../Configuration/CodeConfiguration.cs | 3 + src/ApiGenerator/OpenSearch.openapi.json | 115 ++++++++++++++---- .../HighLevel/Descriptors/Descriptors.cshtml | 2 +- .../Views/HighLevel/Requests/Requests.cshtml | 2 +- 4 files changed, 95 insertions(+), 27 deletions(-) diff --git a/src/ApiGenerator/Configuration/CodeConfiguration.cs b/src/ApiGenerator/Configuration/CodeConfiguration.cs index 8e182c4d14..4bf1f461e3 100644 --- a/src/ApiGenerator/Configuration/CodeConfiguration.cs +++ b/src/ApiGenerator/Configuration/CodeConfiguration.cs @@ -39,6 +39,9 @@ public static class CodeConfiguration { private static readonly Glob[] OperationsToInclude = { + new("{create,delete}_pit"), + new("{delete,get}_all_pits"), + new("cluster.allocation_explain"), new("cluster.delete_component_template"), new("cluster.delete_voting_config_exclusions"), diff --git a/src/ApiGenerator/OpenSearch.openapi.json b/src/ApiGenerator/OpenSearch.openapi.json index a34c78380d..fe1126c5e3 100644 --- a/src/ApiGenerator/OpenSearch.openapi.json +++ b/src/ApiGenerator/OpenSearch.openapi.json @@ -5119,16 +5119,6 @@ "type": "string", "description": "The awareness attribute for which the health is required." } - }, - { - "name": "ensure_node_commissioned", - "in": "query", - "description": "Checks whether local node is commissioned or not. If set to true on a local call it will throw exception if node is decommissioned.", - "schema": { - "type": "boolean", - "default": false, - "description": "Checks whether local node is commissioned or not. If set to true on a local call it will throw exception if node is decommissioned." - } } ], "responses": { @@ -5280,16 +5270,6 @@ "type": "string", "description": "The awareness attribute for which the health is required." } - }, - { - "name": "ensure_node_commissioned", - "in": "query", - "description": "Checks whether local node is commissioned or not. If set to true on a local call it will throw exception if node is decommissioned.", - "schema": { - "type": "boolean", - "default": false, - "description": "Checks whether local node is commissioned or not. If set to true on a local call it will throw exception if node is decommissioned." - } } ], "responses": { @@ -6831,6 +6811,18 @@ "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", @@ -8536,6 +8528,18 @@ "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", @@ -18594,6 +18598,18 @@ "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", @@ -19451,6 +19467,18 @@ "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", @@ -25302,6 +25330,18 @@ "$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", @@ -26631,7 +26671,8 @@ "description": "Specify the keep alive for point in time.", "schema": { "type": "string", - "description": "Specify the keep alive for point in time." + "description": "Specify the keep alive for point in time.", + "x-data-type": "time" } }, { @@ -30868,6 +30909,7 @@ }, "DeletePit_BodyParams": { "type": "object", + "description": "The point-in-time ids to be deleted", "properties": { "pit_id": { "type": "array", @@ -31170,6 +31212,9 @@ "type": "string" } }, + "dls": { + "type": "string" + }, "fls": { "type": "array", "items": { @@ -31885,19 +31930,22 @@ "description": { "type": "string" }, - "cluster_permission": { + "cluster_permissions": { "type": "array", "items": { "type": "string" } }, - "index_permission": { - "$ref": "#/components/schemas/IndexPermission" + "index_permissions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/IndexPermission" + } }, "tenant_permissions": { "type": "array", "items": { - "type": "string" + "$ref": "#/components/schemas/TenantPermission" } }, "static": { @@ -32220,6 +32268,23 @@ } } }, + "TenantPermission": { + "type": "object", + "properties": { + "tenant_patterns": { + "type": "array", + "items": { + "type": "string" + } + }, + "allowed_actions": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, "TenantsMap": { "type": "object", "additionalProperties": { diff --git a/src/ApiGenerator/Views/HighLevel/Descriptors/Descriptors.cshtml b/src/ApiGenerator/Views/HighLevel/Descriptors/Descriptors.cshtml index ca37a794ec..edded9028a 100644 --- a/src/ApiGenerator/Views/HighLevel/Descriptors/Descriptors.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Descriptors/Descriptors.cshtml @@ -17,7 +17,7 @@ using System.Linq.Expressions; using OpenSearch.Net; using OpenSearch.Net.Utf8Json; -@if (ns != CsharpNames.RootNamespace) +@if (ns != null) { using OpenSearch.Net@(ns); diff --git a/src/ApiGenerator/Views/HighLevel/Requests/Requests.cshtml b/src/ApiGenerator/Views/HighLevel/Requests/Requests.cshtml index ccf86d4973..b0eef938ac 100644 --- a/src/ApiGenerator/Views/HighLevel/Requests/Requests.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Requests/Requests.cshtml @@ -17,7 +17,7 @@ using System.Linq.Expressions; using System.Runtime.Serialization; using OpenSearch.Net; using OpenSearch.Net.Utf8Json; -@if (ns != CsharpNames.RootNamespace) +@if (ns != null) { using OpenSearch.Net@(ns); From d32b1bbe8b386cca01fd0c5a214b356ce5964dfc Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Thu, 9 Nov 2023 10:20:13 +1300 Subject: [PATCH 20/27] Revert breaking namespace changes (#425) Reverts #200, #202, #203, #205, #206, #207, #208, #209 Signed-off-by: Thomas Farr --- src/ApiGenerator/Views/HighLevel/Descriptors/Descriptors.cshtml | 2 +- src/ApiGenerator/Views/HighLevel/Requests/Requests.cshtml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ApiGenerator/Views/HighLevel/Descriptors/Descriptors.cshtml b/src/ApiGenerator/Views/HighLevel/Descriptors/Descriptors.cshtml index edded9028a..9cc724477e 100644 --- a/src/ApiGenerator/Views/HighLevel/Descriptors/Descriptors.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Descriptors/Descriptors.cshtml @@ -27,7 +27,7 @@ using OpenSearch.Net.Utf8Json; // ReSharper disable UnusedTypeParameter // ReSharper disable PartialMethodWithSinglePart // ReSharper disable RedundantNameQualifier -namespace OpenSearch.Client@(ns) +namespace OpenSearch.Client { @foreach (var endpoint in endpoints) { diff --git a/src/ApiGenerator/Views/HighLevel/Requests/Requests.cshtml b/src/ApiGenerator/Views/HighLevel/Requests/Requests.cshtml index b0eef938ac..aad12489f7 100644 --- a/src/ApiGenerator/Views/HighLevel/Requests/Requests.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Requests/Requests.cshtml @@ -27,7 +27,7 @@ using OpenSearch.Net.Utf8Json; // ReSharper disable UnusedTypeParameter // ReSharper disable PartialMethodWithSinglePart // ReSharper disable RedundantNameQualifier -namespace OpenSearch.Client@(ns) +namespace OpenSearch.Client { @foreach (var endpoint in endpoints) { From 26edced8bc53b975cc1f8365edd7387e5c80a000 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Nov 2023 16:12:56 +1300 Subject: [PATCH 21/27] 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] --- src/ApiGenerator/ApiGenerator.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ApiGenerator/ApiGenerator.csproj b/src/ApiGenerator/ApiGenerator.csproj index ea6d9cc7eb..2d97e1ab96 100644 --- a/src/ApiGenerator/ApiGenerator.csproj +++ b/src/ApiGenerator/ApiGenerator.csproj @@ -9,7 +9,7 @@ true - + From 74f9b6c10993b40a986323b3d77f14d4eed12ac5 Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Mon, 13 Nov 2023 20:27:05 +1300 Subject: [PATCH 22/27] 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 --- src/ApiGenerator/Configuration/CodeConfiguration.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ApiGenerator/Configuration/CodeConfiguration.cs b/src/ApiGenerator/Configuration/CodeConfiguration.cs index 4bf1f461e3..beafe56cae 100644 --- a/src/ApiGenerator/Configuration/CodeConfiguration.cs +++ b/src/ApiGenerator/Configuration/CodeConfiguration.cs @@ -43,14 +43,13 @@ public static class CodeConfiguration new("{delete,get}_all_pits"), new("cluster.allocation_explain"), - new("cluster.delete_component_template"), new("cluster.delete_voting_config_exclusions"), - new("cluster.exists_component_template"), - new("cluster.get_component_template"), new("cluster.get_settings"), new("cluster.health"), new("cluster.pending_tasks"), + new("cluster.*_component_template"), + new("dangling_indices.*"), new("ingest.*"), new("nodes.*"), From ef157689151cdd64757326c22beb92f85e319cec Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Wed, 22 Nov 2023 05:05:33 +1300 Subject: [PATCH 23/27] 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 --- .../Configuration/CodeConfiguration.cs | 10 +-- .../Overrides/EndpointOverridesBase.cs | 2 + .../Overrides/GlobalOverrides.cs | 6 +- .../Overrides/IEndpointOverrides.cs | 7 +- ...cher.cs => ApiRequestParametersPatcher.cs} | 63 ++++++++------ .../Domain/Specification/UrlPath.cs | 2 +- .../Generator/ApiEndpointFactory.cs | 82 +++++++++---------- src/ApiGenerator/Views/LowLevel/Enums.cshtml | 15 ++-- 8 files changed, 102 insertions(+), 85 deletions(-) rename src/ApiGenerator/Domain/{ApiQueryParametersPatcher.cs => ApiRequestParametersPatcher.cs} (71%) diff --git a/src/ApiGenerator/Configuration/CodeConfiguration.cs b/src/ApiGenerator/Configuration/CodeConfiguration.cs index beafe56cae..758473e7b7 100644 --- a/src/ApiGenerator/Configuration/CodeConfiguration.cs +++ b/src/ApiGenerator/Configuration/CodeConfiguration.cs @@ -51,6 +51,9 @@ public static class CodeConfiguration new("cluster.*_component_template"), new("dangling_indices.*"), + + new("indices.{delete,exists,get,put}_index_template"), + new("ingest.*"), new("nodes.*"), new("snapshot.*"), @@ -62,11 +65,8 @@ public static class CodeConfiguration /// /// Map API default names for API's we are only supporting on the low level client first /// - private static readonly Dictionary LowLevelApiNameMapping = new Dictionary - { - { "indices.delete_index_template", "DeleteIndexTemplateV2" }, - { "indices.get_index_template", "GetIndexTemplateV2" }, - { "indices.put_index_template", "PutIndexTemplateV2" } + private static readonly Dictionary LowLevelApiNameMapping = new() + { }; /// diff --git a/src/ApiGenerator/Configuration/Overrides/EndpointOverridesBase.cs b/src/ApiGenerator/Configuration/Overrides/EndpointOverridesBase.cs index d7066a7dc1..db2f891293 100644 --- a/src/ApiGenerator/Configuration/Overrides/EndpointOverridesBase.cs +++ b/src/ApiGenerator/Configuration/Overrides/EndpointOverridesBase.cs @@ -33,6 +33,8 @@ 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(); diff --git a/src/ApiGenerator/Configuration/Overrides/GlobalOverrides.cs b/src/ApiGenerator/Configuration/Overrides/GlobalOverrides.cs index 9cda96e15d..22fa44eb5e 100644 --- a/src/ApiGenerator/Configuration/Overrides/GlobalOverrides.cs +++ b/src/ApiGenerator/Configuration/Overrides/GlobalOverrides.cs @@ -31,7 +31,11 @@ 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" } } } diff --git a/src/ApiGenerator/Configuration/Overrides/IEndpointOverrides.cs b/src/ApiGenerator/Configuration/Overrides/IEndpointOverrides.cs index 5c5838638a..82946907db 100644 --- a/src/ApiGenerator/Configuration/Overrides/IEndpointOverrides.cs +++ b/src/ApiGenerator/Configuration/Overrides/IEndpointOverrides.cs @@ -35,10 +35,15 @@ namespace ApiGenerator.Configuration.Overrides /// 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; set; } + IDictionary ObsoleteQueryStringParams { get; } /// /// Override how the query param name is exposed to the client. diff --git a/src/ApiGenerator/Domain/ApiQueryParametersPatcher.cs b/src/ApiGenerator/Domain/ApiRequestParametersPatcher.cs similarity index 71% rename from src/ApiGenerator/Domain/ApiQueryParametersPatcher.cs rename to src/ApiGenerator/Domain/ApiRequestParametersPatcher.cs index d5757a3a23..e4be8819ac 100644 --- a/src/ApiGenerator/Domain/ApiQueryParametersPatcher.cs +++ b/src/ApiGenerator/Domain/ApiRequestParametersPatcher.cs @@ -34,23 +34,37 @@ namespace ApiGenerator.Domain { - public static class ApiQueryParametersPatcher + public static class ApiRequestParametersPatcher { - public static SortedDictionary Patch( + 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 ) { - if (source == null) return null; - - var globalOverrides = new GlobalOverrides(); var declaredKeys = source.Keys; - var skipList = CreateSkipList(globalOverrides, overrides, declaredKeys); - var partialList = CreatePartialList(globalOverrides, overrides, declaredKeys); + var skipList = CreateSkipList(overrides, declaredKeys); + var partialList = CreatePartialList(overrides, declaredKeys); - var renameLookup = CreateRenameLookup(globalOverrides, overrides, declaredKeys); - var obsoleteLookup = CreateObsoleteLookup(globalOverrides, overrides, declaredKeys); + var renameLookup = CreateRenameLookup(overrides, declaredKeys); + var obsoleteLookup = CreateObsoleteLookup(overrides, declaredKeys); var patchedParams = new SortedDictionary(); foreach (var (queryStringKey, value) in source) @@ -96,18 +110,18 @@ private static string CreateCSharpName(string queryStringKey, string endpointNam } } - private static IList CreateSkipList(IEndpointOverrides global, IEndpointOverrides local, ICollection declaredKeys) => - CreateList(global, local, "skip", e => e.SkipQueryStringParams, declaredKeys); + private static IList CreateSkipList(IEndpointOverrides local, ICollection declaredKeys) => + CreateList(local, "skip", e => e.SkipQueryStringParams, declaredKeys); - private static IList CreatePartialList(IEndpointOverrides global, IEndpointOverrides local, ICollection declaredKeys) => - CreateList(global, local, "partial", e => e.RenderPartial, declaredKeys); + private static IList CreatePartialList(IEndpointOverrides local, ICollection declaredKeys) => + CreateList(local, "partial", e => e.RenderPartial, declaredKeys); - private static IDictionary CreateLookup(IEndpointOverrides global, IEndpointOverrides local, string type, + private static IDictionary CreateLookup(IEndpointOverrides local, string type, Func> @from, ICollection declaredKeys ) { var d = new SortedDictionary(); - foreach (var kv in from(global)) d[kv.Key] = kv.Value; + foreach (var kv in from(GlobalOverrides.Instance)) d[kv.Key] = kv.Value; if (local == null) return d; @@ -121,12 +135,12 @@ Func> @from, ICollection return d; } - private static IList CreateList(IEndpointOverrides global, IEndpointOverrides local, string type, + private static IList CreateList(IEndpointOverrides local, string type, Func> @from, ICollection declaredKeys ) { var list = new List(); - if (global != null) list.AddRange(from(global)); + list.AddRange(from(GlobalOverrides.Instance)); if (local != null) { var localList = from(local).ToList(); @@ -138,14 +152,13 @@ Func> @from, ICollection declare return list.Distinct().ToList(); } - private static IDictionary CreateRenameLookup(IEndpointOverrides global, IEndpointOverrides local, - ICollection declaredKeys - ) => - CreateLookup(global, local, "rename", e => e.RenameQueryStringParams, declaredKeys); + 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 global, IEndpointOverrides local, - ICollection declaredKeys - ) => - CreateLookup(global, local, "obsolete", e => e.ObsoleteQueryStringParams, declaredKeys); + private static IDictionary CreateObsoleteLookup(IEndpointOverrides local, ICollection declaredKeys) => + CreateLookup(local, "obsolete", e => e.ObsoleteQueryStringParams, declaredKeys); } } diff --git a/src/ApiGenerator/Domain/Specification/UrlPath.cs b/src/ApiGenerator/Domain/Specification/UrlPath.cs index 63f215ea07..7d77290b07 100644 --- a/src/ApiGenerator/Domain/Specification/UrlPath.cs +++ b/src/ApiGenerator/Domain/Specification/UrlPath.cs @@ -35,7 +35,7 @@ namespace ApiGenerator.Domain.Specification public class UrlPath { private readonly IList _additionalPartsForConstructor; - public string Path { get; } + public string Path { get; set; } public Deprecation Deprecation { get; } public Version VersionAdded { get; } public IList Parts { get; } diff --git a/src/ApiGenerator/Generator/ApiEndpointFactory.cs b/src/ApiGenerator/Generator/ApiEndpointFactory.cs index f7827792c5..bb6915f39f 100644 --- a/src/ApiGenerator/Generator/ApiEndpointFactory.cs +++ b/src/ApiGenerator/Generator/ApiEndpointFactory.cs @@ -28,10 +28,8 @@ using System; using System.Collections.Generic; -using System.Collections.Immutable; using System.Linq; using System.Net.Mime; -using System.Text.RegularExpressions; using ApiGenerator.Configuration; using ApiGenerator.Configuration.Overrides; using ApiGenerator.Domain; @@ -40,7 +38,6 @@ using NJsonSchema; using NJsonSchema.References; using NSwag; -using SemanticVersioning; using Version = SemanticVersioning.Version; namespace ApiGenerator.Generator @@ -52,6 +49,8 @@ public static ApiEndpoint From(string name, List<(string HttpPath, OpenApiPathIt 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(); @@ -126,6 +125,9 @@ public static ApiEndpoint From(string name, List<(string HttpPath, OpenApiPathIt .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)) @@ -151,58 +153,52 @@ public static ApiEndpoint From(string name, List<(string HttpPath, OpenApiPathIt foreach (var partName in requiredPathParts ?? Enumerable.Empty()) allParts[partName].Required = true; - var endpoint = new ApiEndpoint - { - Name = name, - Namespace = ns, - MethodName = methodName, - CsharpNames = new CsharpNames(name, methodName, ns), - Stability = Stability.Stable, // TODO: for realsies - OfficialDocumentationLink = new Documentation - { - Description = variants[0].Operation.Description, - Url = variants[0].Operation.ExternalDocumentation?.Url - }, - Url = new UrlInformation + 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 = variants.SelectMany(v => v.Path.Parameters.Concat(v.Operation.Parameters)) - .Where(p => p.Kind == OpenApiParameterKind.Query) - .DistinctBy(p => p.Name) - .ToImmutableSortedDictionary(p => p.Name, BuildQueryParam) + Params = queryParams }, - Body = variants + 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(), - }; - - LoadOverridesOnEndpoint(endpoint); - PatchRequestParameters(endpoint); - - return endpoint; + HttpMethods = variants.Select(v => v.HttpMethod.ToString().ToUpper()).Distinct().ToList(), + }; } - private static void LoadOverridesOnEndpoint(ApiEndpoint endpoint) + private static IEndpointOverrides LoadOverrides(string endpointName, string methodName) { - var method = endpoint.CsharpNames.MethodName; - if (CodeConfiguration.ApiNameMapping.TryGetValue(endpoint.Name, out var mapsApiMethodName)) - method = mapsApiMethodName; + if (CodeConfiguration.ApiNameMapping.TryGetValue(endpointName, out var mapsApiMethodName)) + methodName = mapsApiMethodName; var namespacePrefix = $"{typeof(GlobalOverrides).Namespace}.Endpoints."; - var typeName = $"{namespacePrefix}{method}Overrides"; + var typeName = $"{namespacePrefix}{methodName}Overrides"; var type = GeneratorLocations.Assembly.GetType(typeName); - if (type != null && Activator.CreateInstance(type) is IEndpointOverrides overrides) - endpoint.Overrides = overrides; - } - private static void PatchRequestParameters(ApiEndpoint endpoint) => - endpoint.Url.Params = ApiQueryParametersPatcher.Patch(endpoint.Name, endpoint.Url.Params, endpoint.Overrides) - ?? throw new ArgumentNullException("ApiQueryParametersPatcher.Patch(endpoint.Name, endpoint.Url.Params, endpoint.Overrides)"); + return type != null && Activator.CreateInstance(type) is IEndpointOverrides overrides ? overrides : null; + } - private static QueryParameters BuildQueryParam(OpenApiParameter p) + private static QueryParameters BuildQueryParam(OpenApiParameter p) { var param = new QueryParameters { @@ -214,11 +210,9 @@ private static QueryParameters BuildQueryParam(OpenApiParameter p) }; if (param.Type == "enum" && p.Schema.HasReference) - { - param.ClsName = ((IJsonReference)p.Schema).ReferencePath.Split('/').Last(); - } + param.ClsName = ((IJsonReference)p.Schema).ReferencePath.Split('/').Last(); - return param; + return param; } private static string GetOpenSearchType(JsonSchema schema) diff --git a/src/ApiGenerator/Views/LowLevel/Enums.cshtml b/src/ApiGenerator/Views/LowLevel/Enums.cshtml index 30ba1f0109..5bb81aa7c1 100644 --- a/src/ApiGenerator/Views/LowLevel/Enums.cshtml +++ b/src/ApiGenerator/Views/LowLevel/Enums.cshtml @@ -8,13 +8,12 @@ @functions { private const string RawSize = "Raw"; private const string SizeEnum = "Size"; - private static GlobalOverrides GlobalOverrides = new GlobalOverrides(); 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.ObsoleteEnumMembers.TryGetValue(enumName, out var d) && d.TryGetValue(value, out var obsolete)) + 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); } @@ -23,7 +22,7 @@ private string CreateCase(string e, string o) { var enumValue = GetEnumValue(e, o); - var isObsolete = GlobalOverrides.ObsoleteEnumMembers.TryGetValue(e, out var d) && d.TryGetValue(o, out _); + 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)); @@ -37,8 +36,8 @@ private string GetEnumValue(string enumName, string value) { - return enumName == SizeEnum && value == string.Empty - ? RawSize + return enumName == SizeEnum && value == string.Empty + ? RawSize : value.ToPascalCase(true); } } @@ -91,7 +90,7 @@ namespace OpenSearch.Net } var list = new @(Raw("List()")); - var g = GlobalOverrides.ObsoleteEnumMembers.TryGetValue(e.Name, out var d); + 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); @@ -99,12 +98,12 @@ namespace OpenSearch.Net #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); } From 4fe5a10f4de62012af51d2660ba422cbd5533cca Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Thu, 23 Nov 2023 03:17:23 +1300 Subject: [PATCH 24/27] 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 --- src/ApiGenerator/Configuration/CodeConfiguration.cs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/ApiGenerator/Configuration/CodeConfiguration.cs b/src/ApiGenerator/Configuration/CodeConfiguration.cs index 758473e7b7..b09c34bb95 100644 --- a/src/ApiGenerator/Configuration/CodeConfiguration.cs +++ b/src/ApiGenerator/Configuration/CodeConfiguration.cs @@ -42,14 +42,7 @@ public static class CodeConfiguration new("{create,delete}_pit"), new("{delete,get}_all_pits"), - new("cluster.allocation_explain"), - new("cluster.delete_voting_config_exclusions"), - new("cluster.get_settings"), - new("cluster.health"), - new("cluster.pending_tasks"), - - new("cluster.*_component_template"), - + new("cluster.*"), new("dangling_indices.*"), new("indices.{delete,exists,get,put}_index_template"), From ce3188de0d5bc86063d275dfc08c75938d5179df Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Nov 2023 15:44:04 +1300 Subject: [PATCH 25/27] 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] --- src/ApiGenerator/ApiGenerator.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ApiGenerator/ApiGenerator.csproj b/src/ApiGenerator/ApiGenerator.csproj index 2d97e1ab96..08e1e9449d 100644 --- a/src/ApiGenerator/ApiGenerator.csproj +++ b/src/ApiGenerator/ApiGenerator.csproj @@ -15,7 +15,7 @@ - + From aa2d27f4b8c64d1509f5e64d848bca3b58c4346f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Nov 2023 22:41:42 +1300 Subject: [PATCH 26/27] 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] --- src/ApiGenerator/ApiGenerator.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ApiGenerator/ApiGenerator.csproj b/src/ApiGenerator/ApiGenerator.csproj index 08e1e9449d..fbf0fbab81 100644 --- a/src/ApiGenerator/ApiGenerator.csproj +++ b/src/ApiGenerator/ApiGenerator.csproj @@ -9,7 +9,7 @@ true - + From 6ca6ee49d8861229292f3a5eaf0cabf4154f75fc Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Fri, 1 Dec 2023 10:52:18 +1300 Subject: [PATCH 27/27] 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 --- src/ApiGenerator/CodeTemplatePage.cs | 15 ++++--- .../Generator/Razor/DescriptorsGenerator.cs | 45 +++++++++++-------- .../HighLevelClientImplementationGenerator.cs | 41 ++++++++++------- .../LowLevelClientImplementationGenerator.cs | 45 +++++++++++-------- .../Razor/RequestParametersGenerator.cs | 40 ++++++++++------- .../Generator/Razor/RequestsGenerator.cs | 31 +++++++++---- src/ApiGenerator/Views/GeneratorNotice.cshtml | 14 +++--- .../OpenSearchClient.Namespace.cshtml | 2 +- .../Implementation/OpenSearchClient.cshtml | 30 ++++++------- .../Client/Interface/IOpenSearchClient.cshtml | 37 ++++++++------- .../Views/HighLevel/Client/Usings.cshtml | 13 +++--- .../HighLevel/Descriptors/Descriptors.cshtml | 2 +- .../Descriptors/RequestDescriptorBase.cshtml | 2 +- .../HighLevel/Requests/ApiUrlsLookup.cshtml | 2 +- .../Requests/PlainRequestBase.cshtml | 2 +- .../Views/HighLevel/Requests/Requests.cshtml | 2 +- .../OpenSearchLowLevelClient.Namespace.cshtml | 2 +- .../OpenSearchLowLevelClient.cshtml | 26 +++++------ .../IOpenSearchLowLevelClient.cshtml | 37 ++++++++------- .../Views/LowLevel/Client/Usings.cshtml | 13 +++--- src/ApiGenerator/Views/LowLevel/Enums.cshtml | 2 +- .../RequestParameters.cshtml | 2 +- 22 files changed, 233 insertions(+), 172 deletions(-) diff --git a/src/ApiGenerator/CodeTemplatePage.cs b/src/ApiGenerator/CodeTemplatePage.cs index 8b14cd1ead..62e88b6de3 100644 --- a/src/ApiGenerator/CodeTemplatePage.cs +++ b/src/ApiGenerator/CodeTemplatePage.cs @@ -29,13 +29,14 @@ using System.Threading.Tasks; using RazorLight; -namespace ApiGenerator +namespace ApiGenerator; + +public abstract class CodeTemplatePage : TemplatePage { - public abstract class CodeTemplatePage : TemplatePage - { - protected new Task IncludeAsync(string key, object model = null) - => base.IncludeAsync(key.Replace('/', '.'), model); + 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"); - } + protected async Task IncludeGeneratorNotice() => await IncludeAsync("GeneratorNotice", false); } diff --git a/src/ApiGenerator/Generator/Razor/DescriptorsGenerator.cs b/src/ApiGenerator/Generator/Razor/DescriptorsGenerator.cs index 4ea3773855..647022027d 100644 --- a/src/ApiGenerator/Generator/Razor/DescriptorsGenerator.cs +++ b/src/ApiGenerator/Generator/Razor/DescriptorsGenerator.cs @@ -26,30 +26,39 @@ * under the License. */ -using System.IO; 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 +namespace ApiGenerator.Generator.Razor; + +public class DescriptorsGenerator : RazorGeneratorBase { - public class DescriptorsGenerator : RazorGeneratorBase - { - public override string Title => "OpenSearch.Client descriptors"; - - public override async Task Generate(RestApiSpec spec, ProgressBar progressBar, CancellationToken token) - { - var view = ViewLocations.HighLevel("Descriptors", "RequestDescriptorBase.cshtml"); - var target = GeneratorLocations.HighLevel("Descriptors.cs"); - await DoRazor(spec, view, target, token); - - var dependantView = ViewLocations.HighLevel("Descriptors", "Descriptors.cshtml"); - string Target(string id) => GeneratorLocations.HighLevel($"Descriptors.{id}.cs"); - var namespaced = spec.EndpointsPerNamespaceHighLevel.ToList(); - await DoRazorDependantFiles(progressBar, namespaced, dependantView, kv => kv.Key, id => Target(id), token); - } - } + 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/HighLevelClientImplementationGenerator.cs b/src/ApiGenerator/Generator/Razor/HighLevelClientImplementationGenerator.cs index fe5a37ef96..945de9ae74 100644 --- a/src/ApiGenerator/Generator/Razor/HighLevelClientImplementationGenerator.cs +++ b/src/ApiGenerator/Generator/Razor/HighLevelClientImplementationGenerator.cs @@ -26,33 +26,42 @@ * under the License. */ -using System.IO; +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 +namespace ApiGenerator.Generator.Razor; + +public class HighLevelClientImplementationGenerator : RazorGeneratorBase { - public class HighLevelClientImplementationGenerator : RazorGeneratorBase - { - public override string Title => "OpenSearch.Client client implementation"; + 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); - public override async Task Generate(RestApiSpec spec, ProgressBar progressBar, CancellationToken token) - { - var view = ViewLocations.HighLevel("Client", "Implementation", "OpenSearchClient.cshtml"); - var target = GeneratorLocations.HighLevel($"OpenSearchClient.cs"); - await DoRazor(spec, view, target, token); + await DoRazorDependantFiles( + progressBar, + spec.EndpointsPerNamespaceHighLevel.Where(kv => kv.Key != CsharpNames.RootNamespace).ToList(), + View("Namespace"), + kv => kv.Key, + Target, + token + ); - string Target(string id) => GeneratorLocations.HighLevel($"OpenSearchClient.{id}.cs"); + return; - var namespaced = spec.EndpointsPerNamespaceHighLevel.Where(kv => kv.Key != CsharpNames.RootNamespace).ToList(); - var dependantView = ViewLocations.HighLevel("Client", "Implementation", "OpenSearchClient.Namespace.cshtml"); - await DoRazorDependantFiles(progressBar, namespaced, dependantView, kv => kv.Key, id => Target(id), token); + 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/LowLevelClientImplementationGenerator.cs b/src/ApiGenerator/Generator/Razor/LowLevelClientImplementationGenerator.cs index 8136fa30f0..c5d6328c41 100644 --- a/src/ApiGenerator/Generator/Razor/LowLevelClientImplementationGenerator.cs +++ b/src/ApiGenerator/Generator/Razor/LowLevelClientImplementationGenerator.cs @@ -26,7 +26,6 @@ * under the License. */ -using System.IO; using System.Linq; using System.Threading; using System.Threading.Tasks; @@ -35,22 +34,32 @@ using ApiGenerator.Domain.Code; using ShellProgressBar; -namespace ApiGenerator.Generator.Razor +namespace ApiGenerator.Generator.Razor; + +public class LowLevelClientImplementationGenerator : RazorGeneratorBase { - public class LowLevelClientImplementationGenerator : RazorGeneratorBase - { - public override string Title { get; } = "OpenSearch.Net client implementation"; - - public override async Task Generate(RestApiSpec spec, ProgressBar progressBar, CancellationToken token) - { - var view = ViewLocations.LowLevel("Client", "Implementation", "OpenSearchLowLevelClient.cshtml"); - var target = GeneratorLocations.LowLevel("OpenSearchLowLevelClient.cs"); - await DoRazor(spec, view, target, token); - - var namespaced = spec.EndpointsPerNamespaceLowLevel.Where(kv => kv.Key != CsharpNames.RootNamespace).ToList(); - var namespacedView = ViewLocations.LowLevel("Client", "Implementation", "OpenSearchLowLevelClient.Namespace.cshtml"); - await DoRazorDependantFiles(progressBar, namespaced, namespacedView, kv => kv.Key, - id => GeneratorLocations.LowLevel($"OpenSearchLowLevelClient.{id}.cs"), token); - } - } + 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/RequestParametersGenerator.cs b/src/ApiGenerator/Generator/Razor/RequestParametersGenerator.cs index 0edd2cd9ac..9187f22739 100644 --- a/src/ApiGenerator/Generator/Razor/RequestParametersGenerator.cs +++ b/src/ApiGenerator/Generator/Razor/RequestParametersGenerator.cs @@ -26,27 +26,37 @@ * under the License. */ -using System.IO; 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 +namespace ApiGenerator.Generator.Razor; + +public class RequestParametersGenerator : RazorGeneratorBase { - public class RequestParametersGenerator : RazorGeneratorBase - { - public override string Title { get; } = "OpenSearch.Net request parameters"; - - public override async Task Generate(RestApiSpec spec, ProgressBar progressBar, CancellationToken token) - { - var view = ViewLocations.LowLevel("RequestParameters", "RequestParameters.cshtml"); - string Target(string id) => GeneratorLocations.LowLevel("Api", "RequestParameters", $"RequestParameters.{id}.cs"); - - var namespaced = spec.EndpointsPerNamespaceLowLevel.ToList(); - await DoRazorDependantFiles(progressBar, namespaced, view, kv => kv.Key, id => Target(id), token); - } - } + 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 index dc54bf101f..0e4d0c45fe 100644 --- a/src/ApiGenerator/Generator/Razor/RequestsGenerator.cs +++ b/src/ApiGenerator/Generator/Razor/RequestsGenerator.cs @@ -26,12 +26,16 @@ * 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 @@ -42,14 +46,23 @@ public class RequestsGenerator : RazorGeneratorBase public override async Task Generate(RestApiSpec spec, ProgressBar progressBar, CancellationToken token) { - var view = ViewLocations.HighLevel("Requests", "PlainRequestBase.cshtml"); - var target = GeneratorLocations.HighLevel("Requests.cs"); - await DoRazor(spec, view, target, token); - - var dependantView = ViewLocations.HighLevel("Requests", "Requests.cshtml"); - string Target(string id) => GeneratorLocations.HighLevel($"Requests.{id}.cs"); - var namespaced = spec.EndpointsPerNamespaceHighLevel.ToList(); - await DoRazorDependantFiles(progressBar, namespaced, dependantView, kv => kv.Key, id => Target(id), 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/Views/GeneratorNotice.cshtml b/src/ApiGenerator/Views/GeneratorNotice.cshtml index fc624a8e9e..039524ceae 100644 --- a/src/ApiGenerator/Views/GeneratorNotice.cshtml +++ b/src/ApiGenerator/Views/GeneratorNotice.cshtml @@ -1,11 +1,12 @@ @using ApiGenerator -@inherits CodeTemplatePage +@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. @@ -27,15 +28,16 @@ * specific language governing permissions and limitations * under the License. */ +} // ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ // ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ -// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ -// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ // ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ // ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ // ----------------------------------------------- -// -// This file is automatically generated +// +// This file is automatically generated // Please do not edit these files manually // Run the following in the root of the repos: // diff --git a/src/ApiGenerator/Views/HighLevel/Client/Implementation/OpenSearchClient.Namespace.cshtml b/src/ApiGenerator/Views/HighLevel/Client/Implementation/OpenSearchClient.Namespace.cshtml index c3c8e5d31b..ebbbf3bc60 100644 --- a/src/ApiGenerator/Views/HighLevel/Client/Implementation/OpenSearchClient.Namespace.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Client/Implementation/OpenSearchClient.Namespace.cshtml @@ -7,7 +7,7 @@ @{ var (ns, endpoints) = Model; } -@{ await IncludeGeneratorNotice(); } +@{ await IncludeLegacyGeneratorNotice(); } // ReSharper disable RedundantUsingDirective using System; using System.Threading; diff --git a/src/ApiGenerator/Views/HighLevel/Client/Implementation/OpenSearchClient.cshtml b/src/ApiGenerator/Views/HighLevel/Client/Implementation/OpenSearchClient.cshtml index c57e3e1dfe..d4c6cd28e3 100644 --- a/src/ApiGenerator/Views/HighLevel/Client/Implementation/OpenSearchClient.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Client/Implementation/OpenSearchClient.cshtml @@ -3,7 +3,7 @@ @using ApiGenerator @using ApiGenerator.Domain.Code @inherits CodeTemplatePage -@{ await IncludeGeneratorNotice(); } +@{ await IncludeLegacyGeneratorNotice(); } // ReSharper disable RedundantUsingDirective using System; using System.Threading; @@ -12,7 +12,10 @@ using OpenSearch.Client; @{ await IncludeAsync("HighLevel/Client/Usings.cshtml", Model);} @{ - var namespaces = Model.EndpointsPerNamespaceHighLevel.Keys.Where(k => k != CsharpNames.RootNamespace).ToList(); + var namespaces = Model.EndpointsPerNamespaceHighLevel.Keys.ToHashSet(); + namespaces.Remove(CsharpNames.RootNamespace); + namespaces.Add("Http"); + // ReSharper disable RedundantTypeArgumentsOfMethod namespace OpenSearch.Client @@ -35,27 +38,20 @@ namespace OpenSearch.Client foreach (var ns in namespaces) { - @ns = new @(CsharpNames.HighLevelClientNamespacePrefix)@(ns)@(CsharpNames.ClientNamespaceSuffix)(this); + @(ns) = new @(CsharpNames.HighLevelClientNamespacePrefix)@(ns)@(CsharpNames.ClientNamespaceSuffix)(this); } } - - foreach (var kv in Model.EndpointsPerNamespaceHighLevel) - { - if (kv.Key != CsharpNames.RootNamespace) - { - continue; - } - var endpoints = kv.Value; - var models = endpoints.Select(e=>e.HighLevelModel).ToList(); - foreach (var m in models) - { - await IncludeAsync("HighLevel/Client/Implementation/MethodImplementation.cshtml", m); - } - } + 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/Interface/IOpenSearchClient.cshtml b/src/ApiGenerator/Views/HighLevel/Client/Interface/IOpenSearchClient.cshtml index 3dd2c0ba9d..fc35066b57 100644 --- a/src/ApiGenerator/Views/HighLevel/Client/Interface/IOpenSearchClient.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Client/Interface/IOpenSearchClient.cshtml @@ -3,7 +3,7 @@ @using ApiGenerator.Domain @using ApiGenerator.Domain.Code @inherits ApiGenerator.CodeTemplatePage -@{ await IncludeGeneratorNotice(); } +@{ await IncludeLegacyGeneratorNotice(); } // ReSharper disable RedundantUsingDirective using System; using System.Collections.Generic; @@ -19,21 +19,26 @@ namespace OpenSearch.Client /// OpenSearch high level client /// public partial interface IOpenSearchClient - { - @foreach(var (ns, endpoints) in Model.EndpointsPerNamespaceHighLevel) - { - if (ns != CsharpNames.RootNamespace) - { + { + @{ + 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; } + @CsharpNames.HighLevelClientNamespacePrefix@(ns)@CsharpNames.ClientNamespaceSuffix @ns { get; } - continue; - } - var models = endpoints.Select(e=>e.HighLevelModel).ToList(); - foreach(var m in models) - { - await IncludeAsync("HighLevel/Client/Interface/MethodInterface.cshtml", m); - } - } - } + } + + 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/Usings.cshtml b/src/ApiGenerator/Views/HighLevel/Client/Usings.cshtml index 807e3e4ed5..65b76adb6e 100644 --- a/src/ApiGenerator/Views/HighLevel/Client/Usings.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Client/Usings.cshtml @@ -1,11 +1,14 @@ @using ApiGenerator.Domain @using ApiGenerator.Domain.Code @inherits ApiGenerator.CodeTemplatePage -@foreach(var ns in Model.EndpointsPerNamespaceHighLevel.Keys) -{ - if (ns != CsharpNames.RootNamespace) - { +@{ + 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/Descriptors.cshtml b/src/ApiGenerator/Views/HighLevel/Descriptors/Descriptors.cshtml index 9cc724477e..46c8bcba21 100644 --- a/src/ApiGenerator/Views/HighLevel/Descriptors/Descriptors.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Descriptors/Descriptors.cshtml @@ -7,7 +7,7 @@ var (ns, endpoints) = Model; ns = ns != CsharpNames.RootNamespace ? $".{CsharpNames.ApiNamespace}.{ns}{CsharpNames.ApiNamespaceSuffix}" : null; } -@{ await IncludeGeneratorNotice(); } +@{ await IncludeLegacyGeneratorNotice(); } // ReSharper disable RedundantUsingDirective using System; using System.Collections.Generic; diff --git a/src/ApiGenerator/Views/HighLevel/Descriptors/RequestDescriptorBase.cshtml b/src/ApiGenerator/Views/HighLevel/Descriptors/RequestDescriptorBase.cshtml index 14ffe82e89..43d6ed6d08 100644 --- a/src/ApiGenerator/Views/HighLevel/Descriptors/RequestDescriptorBase.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Descriptors/RequestDescriptorBase.cshtml @@ -1,6 +1,6 @@ @using ApiGenerator.Domain @inherits ApiGenerator.CodeTemplatePage -@{ await IncludeGeneratorNotice(); } +@{ await IncludeLegacyGeneratorNotice(); } using System.Collections.Generic; namespace OpenSearch.Client diff --git a/src/ApiGenerator/Views/HighLevel/Requests/ApiUrlsLookup.cshtml b/src/ApiGenerator/Views/HighLevel/Requests/ApiUrlsLookup.cshtml index 4cebf146e9..eaca2173f2 100644 --- a/src/ApiGenerator/Views/HighLevel/Requests/ApiUrlsLookup.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Requests/ApiUrlsLookup.cshtml @@ -3,7 +3,7 @@ @using ApiGenerator @using ApiGenerator.Configuration @inherits CodeTemplatePage -@{ await IncludeGeneratorNotice(); } +@{ await IncludeLegacyGeneratorNotice(); } namespace OpenSearch.Client { internal static partial class ApiUrlsLookups diff --git a/src/ApiGenerator/Views/HighLevel/Requests/PlainRequestBase.cshtml b/src/ApiGenerator/Views/HighLevel/Requests/PlainRequestBase.cshtml index b042d9c1e5..8a0fbafbc6 100644 --- a/src/ApiGenerator/Views/HighLevel/Requests/PlainRequestBase.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Requests/PlainRequestBase.cshtml @@ -1,6 +1,6 @@ @using ApiGenerator.Domain @inherits ApiGenerator.CodeTemplatePage -@{ await IncludeGeneratorNotice(); } +@{ await IncludeLegacyGeneratorNotice(); } // ReSharper disable RedundantUsingDirective using System; using System.Collections.Generic; diff --git a/src/ApiGenerator/Views/HighLevel/Requests/Requests.cshtml b/src/ApiGenerator/Views/HighLevel/Requests/Requests.cshtml index aad12489f7..ceb8018eca 100644 --- a/src/ApiGenerator/Views/HighLevel/Requests/Requests.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Requests/Requests.cshtml @@ -7,7 +7,7 @@ var (ns, endpoints) = Model; ns = ns != CsharpNames.RootNamespace ? $".{CsharpNames.ApiNamespace}.{ns}{CsharpNames.ApiNamespaceSuffix}" : null; } -@{ await IncludeGeneratorNotice(); } +@{ await IncludeLegacyGeneratorNotice(); } // ReSharper disable RedundantUsingDirective using System; using System.Collections.Generic; diff --git a/src/ApiGenerator/Views/LowLevel/Client/Implementation/OpenSearchLowLevelClient.Namespace.cshtml b/src/ApiGenerator/Views/LowLevel/Client/Implementation/OpenSearchLowLevelClient.Namespace.cshtml index 7711359b87..ebfd4cb1a8 100644 --- a/src/ApiGenerator/Views/LowLevel/Client/Implementation/OpenSearchLowLevelClient.Namespace.cshtml +++ b/src/ApiGenerator/Views/LowLevel/Client/Implementation/OpenSearchLowLevelClient.Namespace.cshtml @@ -4,7 +4,7 @@ @using ApiGenerator.Domain.Code @using ApiGenerator.Domain.Specification @inherits CodeTemplatePage>> -@{ await IncludeGeneratorNotice(); } +@{ await IncludeLegacyGeneratorNotice(); } @{ var (ns, endpoints) = Model; } diff --git a/src/ApiGenerator/Views/LowLevel/Client/Implementation/OpenSearchLowLevelClient.cshtml b/src/ApiGenerator/Views/LowLevel/Client/Implementation/OpenSearchLowLevelClient.cshtml index 2795157ec4..655d586510 100644 --- a/src/ApiGenerator/Views/LowLevel/Client/Implementation/OpenSearchLowLevelClient.cshtml +++ b/src/ApiGenerator/Views/LowLevel/Client/Implementation/OpenSearchLowLevelClient.cshtml @@ -3,7 +3,7 @@ @using ApiGenerator @using ApiGenerator.Domain.Code @inherits CodeTemplatePage -@{ await IncludeGeneratorNotice(); } +@{ await IncludeLegacyGeneratorNotice(); } // ReSharper disable RedundantUsingDirective using System; using System.Collections.Generic; @@ -17,7 +17,9 @@ using OpenSearch.Net; using static OpenSearch.Net.HttpMethod; @{ - var namespaces = Model.EndpointsPerNamespaceLowLevel.Keys.Where(k => k != CsharpNames.RootNamespace).ToList(); + var namespaces = Model.EndpointsPerNamespaceLowLevel.Keys.ToHashSet(); + namespaces.Remove(CsharpNames.RootNamespace); + namespaces.Add("Http"); // ReSharper disable InterpolatedStringExpressionIsNotIFormattable // ReSharper disable RedundantExtendsListEntry @@ -47,19 +49,13 @@ namespace OpenSearch.Net } - - foreach (var (ns, endpoints) in Model.EndpointsPerNamespaceLowLevel) - { - if (ns != CsharpNames.RootNamespace) - { - continue; - } - var methods = endpoints.SelectMany(e=>e.LowLevelClientMethods).ToList(); - foreach (var method in methods) - { - await IncludeAsync("LowLevel/Client/Methods/MethodImplementation.cshtml", method); - } - } + 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 index 4a90af2fb8..399f4984f7 100644 --- a/src/ApiGenerator/Views/LowLevel/Client/Interface/IOpenSearchLowLevelClient.cshtml +++ b/src/ApiGenerator/Views/LowLevel/Client/Interface/IOpenSearchLowLevelClient.cshtml @@ -3,7 +3,7 @@ @using ApiGenerator.Domain @using ApiGenerator.Domain.Code @inherits ApiGenerator.CodeTemplatePage -@{ await IncludeGeneratorNotice(); } +@{ await IncludeLegacyGeneratorNotice(); } // ReSharper disable RedundantUsingDirective using System; using System.Collections.Generic; @@ -21,22 +21,27 @@ namespace OpenSearch.Net /// OpenSearch low level client /// public partial interface IOpenSearchLowLevelClient - { - @foreach(var (ns, endpoints) in Model.EndpointsPerNamespaceLowLevel) - { - if (ns != CsharpNames.RootNamespace) - { + { + @{ + 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; } + /// @ns.SplitPascalCase() APIs + @CsharpNames.LowLevelClientNamespacePrefix@(ns)@CsharpNames.ClientNamespaceSuffix @ns { get; } - continue; - } - var methods = endpoints.SelectMany(e=>e.LowLevelClientMethods).ToList(); - foreach(var method in methods) - { - await IncludeAsync("LowLevel/Client/Methods/MethodInterface.cshtml", method); - } - } + } + + 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/Usings.cshtml b/src/ApiGenerator/Views/LowLevel/Client/Usings.cshtml index 7dcc951284..5abe91e7ab 100644 --- a/src/ApiGenerator/Views/LowLevel/Client/Usings.cshtml +++ b/src/ApiGenerator/Views/LowLevel/Client/Usings.cshtml @@ -1,11 +1,14 @@ @using ApiGenerator.Domain @using ApiGenerator.Domain.Code @inherits ApiGenerator.CodeTemplatePage -@foreach(var ns in Model.EndpointsPerNamespaceLowLevel.Keys) -{ - if (ns != CsharpNames.RootNamespace) - { +@{ + 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 index 5bb81aa7c1..65bc11fe9f 100644 --- a/src/ApiGenerator/Views/LowLevel/Enums.cshtml +++ b/src/ApiGenerator/Views/LowLevel/Enums.cshtml @@ -4,7 +4,7 @@ @using ApiGenerator @using ApiGenerator.Configuration.Overrides @inherits CodeTemplatePage -@{ await IncludeGeneratorNotice(); } +@{ await IncludeLegacyGeneratorNotice(); } @functions { private const string RawSize = "Raw"; private const string SizeEnum = "Size"; diff --git a/src/ApiGenerator/Views/LowLevel/RequestParameters/RequestParameters.cshtml b/src/ApiGenerator/Views/LowLevel/RequestParameters/RequestParameters.cshtml index fd477d54ef..110f7f51bc 100644 --- a/src/ApiGenerator/Views/LowLevel/RequestParameters/RequestParameters.cshtml +++ b/src/ApiGenerator/Views/LowLevel/RequestParameters/RequestParameters.cshtml @@ -3,7 +3,7 @@ @using ApiGenerator.Domain.Code @using ApiGenerator.Domain.Specification @inherits CodeTemplatePage>> -@{ await IncludeGeneratorNotice(); } +@{ await IncludeLegacyGeneratorNotice(); } @{ var (ns, endpoints) = Model; ns = ns != CsharpNames.RootNamespace ? $".{CsharpNames.ApiNamespace}.{ns}{CsharpNames.ApiNamespaceSuffix}" : null;