diff --git a/.github/opensearch-cluster/docker-compose.yml b/.github/opensearch-cluster/docker-compose.yml index 8225c8ff8..07533766d 100644 --- a/.github/opensearch-cluster/docker-compose.yml +++ b/.github/opensearch-cluster/docker-compose.yml @@ -2,7 +2,7 @@ version: '3' services: opensearch-cluster: - image: ${OPENSEARCH_DOCKER_HUB_PROJECT:-opensearchproject}/opensearch:${OPENSEARCH_VERSION:-latest} + image: ${OPENSEARCH_DOCKER_HUB_PROJECT:-opensearchproject}/opensearch:${OPENSEARCH_VERSION:-latest}${OPENSEARCH_DOCKER_REF} ports: - '9200:9200' - '9600:9600' diff --git a/.github/workflows/test-spec.yml b/.github/workflows/test-spec.yml index 975bf8834..8e290cdf2 100644 --- a/.github/workflows/test-spec.yml +++ b/.github/workflows/test-spec.yml @@ -6,6 +6,7 @@ on: - .github/workflows/test-spec.yml - package*.json - spec/** + - tests/** - tools/src/tester/** - tsconfig.json pull_request: @@ -13,6 +14,7 @@ on: - .github/workflows/test-spec.yml - package*.json - spec/** + - tests/** - tools/src/tester/** - tsconfig.json @@ -21,15 +23,17 @@ jobs: strategy: matrix: entry: + - {version: 1.3.17, admin_password: admin} - {version: 2.0.0, admin_password: admin} - {version: 2.15.0} - - {version: 2.16.0, hub: opensearchstaging} + - {version: 2.16.0, hub: opensearchstaging, ref: '@sha256:aa99ce3e2c9c94cd934cf98bab753a9920bfdbbb74bdc932d1b443d31c18d6b2'} name: test-opensearch-spec (version=${{ matrix.entry.version }}, hub=${{ matrix.entry.hub || 'opensearchproject' }}) runs-on: ubuntu-latest env: OPENSEARCH_DOCKER_HUB_PROJECT: ${{ matrix.entry.hub || 'opensearchproject' }} + OPENSEARCH_DOCKER_REF: ${{ matrix.entry.ref }} OPENSEARCH_VERSION: ${{ matrix.entry.version }} OPENSEARCH_PASSWORD: ${{ matrix.entry.admin_password || 'myStrongPassword123!' }} diff --git a/CHANGELOG.md b/CHANGELOG.md index d4a709673..d520d3f8c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,7 +26,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Added tests for response payload ([#347](https://github.com/opensearch-project/opensearch-api-specification/pull/347)) - Added `cancel_after_time_interval` and `phase_took` in `_search` ([#353](https://github.com/opensearch-project/opensearch-api-specification/pull/353)) - Added support for testing `application/x-ndjson` payloads ([#355](https://github.com/opensearch-project/opensearch-api-specification/pull/355)) -- Added SPECIFICATION_TESTING.md [#359](https://github.com/opensearch-project/opensearch-api-specification/pull/359) +- Added TESTING_GUIDE.md ([#359](https://github.com/opensearch-project/opensearch-api-specification/pull/359)) - Added StoryValidator to validate stories before running them ([#354](https://github.com/opensearch-project/opensearch-api-specification/issues/354)) - Added support for `text/plain` responses in `_cat` APIs ([#360](https://github.com/opensearch-project/opensearch-api-specification/pull/360)) - Added support for `application/yaml` responses ([#363](https://github.com/opensearch-project/opensearch-api-specification/pull/363)) @@ -42,6 +42,13 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Added `file` to `/_cache/clear` and `/{index}/_cache/clear` ([#396](https://github.com/opensearch-project/opensearch-api-specification/pull/396)) - Added a workflow to run tests against the next version of OpenSearch ([#409](https://github.com/opensearch-project/opensearch-api-specification/pull/409)) - Added support for skipping tests using semver range ([#410](https://github.com/opensearch-project/opensearch-api-specification/pull/410)) +- Added `cluster_manager_timeout` to `HEAD /{index}` ([#421](https://github.com/opensearch-project/opensearch-api-specification/pull/421)) +- Added missing fields to `/_nodes/stats` ([#415](https://github.com/opensearch-project/opensearch-api-specification/pull/415)) +- Added missing metrics options to `/_nodes/stats` ([#422](https://github.com/opensearch-project/opensearch-api-specification/pull/422)) +- Added tests against OpenSearch 1.3 ([#424](https://github.com/opensearch-project/opensearch-api-specification/pull/424)) +- Added `is_hidden` to `/{index}/_alias/{name}` and `/{index}/_aliases/{name}` ([#429](https://github.com/opensearch-project/opensearch-api-specification/pull/429)) +- Added `ignore_unmapped` to `GeoDistanceQuery` ([#427](https://github.com/opensearch-project/opensearch-api-specification/pull/427)) +- Added missing variants of `indices.put_alias` ([#434](https://github.com/opensearch-project/opensearch-api-specification/pull/434)) ### Changed @@ -49,9 +56,10 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Refactored spec tester internals to improve reusability ([#302](https://github.com/opensearch-project/opensearch-api-specification/pull/302)) - Renamed `main` release tag to `main-latest` ([#321](https://github.com/opensearch-project/opensearch-api-specification/pull/321)) - Replaced usages of `Opensearch` with `OpenSearch` ([#335](https://github.com/opensearch-project/opensearch-api-specification/pull/335)) -- Prevented merger tool from printing warnings when used by tester tool [#359](https://github.com/opensearch-project/opensearch-api-specification/pull/359) -- Replaced the deprecated fs.rmdirSync with fs.rmSync [#359](https://github.com/opensearch-project/opensearch-api-specification/pull/359) -- Tester tool now provides better context for non-2XX responses when --verbose is used [#359](https://github.com/opensearch-project/opensearch-api-specification/pull/359) +- Prevented merger tool from printing warnings when used by tester tool ([#359](https://github.com/opensearch-project/opensearch-api-specification/pull/359)) +- Replaced the deprecated fs.rmdirSync with fs.rmSync ([#359](https://github.com/opensearch-project/opensearch-api-specification/pull/359)) +- Tester tool now provides better context for non-2XX responses when --verbose is used ([#359](https://github.com/opensearch-project/opensearch-api-specification/pull/359)) +- Lock testing for next release of OpenSearch to a specific SHA ([#431](https://github.com/opensearch-project/opensearch-api-specification/pull/431)) ### Deprecated @@ -77,6 +85,8 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Fixed `/_data_stream` health status and required fields ([#401](https://github.com/opensearch-project/opensearch-api-specification/pull/401)) - Fixed query DSL `match` that supports a field name and value ([#405](https://github.com/opensearch-project/opensearch-api-specification/pull/405)) - Fixed `/_mapping` with `index` in query ([#385](https://github.com/opensearch-project/opensearch-api-specification/pull/385)) +- Fixed duplicate `/_nodes/{node_id}` path ([#416](https://github.com/opensearch-project/opensearch-api-specification/pull/416)) +- Fixed `_source` accepting an array of fields in `/_search` ([#430](https://github.com/opensearch-project/opensearch-api-specification/pull/430)) ### Security diff --git a/CLIENT_GENERATOR_GUIDE.md b/CLIENT_GENERATOR_GUIDE.md index 29077c229..84ea7beb7 100644 --- a/CLIENT_GENERATOR_GUIDE.md +++ b/CLIENT_GENERATOR_GUIDE.md @@ -1,3 +1,12 @@ +- [Generate Clients for OpenSearch using OpenAPI Specification](#generate-clients-for-opensearch-using-openapi-specification) + - [The Grouping of API Operations](#the-grouping-of-api-operations) + - [Overloaded Name](#overloaded-name) + - [Handling Bulk Operations](#handling-bulk-operations) + - [Parameter Validation](#parameter-validation) + - [Global Parameters](#global-parameters) + - [Default Parameter Values](#default-parameter-values) + - [Duplicate Paths](#duplicate-paths) + # Generate Clients for OpenSearch using OpenAPI Specification OpenSearch Clients are available in multiple programming languages. The biggest challenge with this is keeping the clients up to date with the latest changes in OpenSearch. To solve this problem, we're automating the process of generating clients for OpenSearch using the OpenAPI specification. While OpenAPI comes with many well established off-the-shelf client generators for most languages, the OpenSearch APIs come with a lot of quirkiness that makes it near impossible to use these off-the-shelf generators. For this reason, we've opted to write our own client generators that is specifically tailored to the OpenSearch APIs. This document will walk you through the process of generating clients from [the published OpenSearch OpenAPI spec](https://github.com/opensearch-project/opensearch-api-specification/releases), more specifically client API methods. @@ -58,4 +67,23 @@ Some clients also check for the validity of query string parameter names to guar All operations in the spec contain a set of parameters that are common across all operations. These parameters are denoted with `x-global: true` vendor extension. The generated clients should find a way to DRY these parameters in type definitions and method documentation. ## Default Parameter Values -Parameters can have default values either through schema or the `x-default` vendor extension. When both are present, `x-default` will take precedence. \ No newline at end of file +Parameters can have default values either through schema or the `x-default` vendor extension. When both are present, `x-default` will take precedence. + +## Duplicate Paths +OpenAPI does not allow duplicate paths, which makes it challenging to express certain OpenSearch APIs, such as `/_nodes/{node_id}` and `/_nodes/{metric}`. In this example the server expects either a `node_id` or a `metric`. The API specification handles this by defining a `/_nodes/{node_id_or_metric}` path, and decorating the `node_id_or_metric` type with a `title` field. + +```yaml +name: node_id_or_metric +schema: +anyOf: + - title: node_id + $ref: '../schemas/_common.yaml#/components/schemas/NodeIds' + - title: metric + type: array + items: + $ref: '../schemas/nodes.info.yaml#/components/schemas/Metric' +``` + +See [#416](https://github.com/opensearch-project/opensearch-api-specification/pull/416) for a complete example. + +Clients should generate multiple methods or a method that accepts multiple parameters in this case. diff --git a/DEVELOPER_GUIDE.md b/DEVELOPER_GUIDE.md index d86e29295..e941171c5 100644 --- a/DEVELOPER_GUIDE.md +++ b/DEVELOPER_GUIDE.md @@ -149,7 +149,7 @@ This repository includes several OpenAPI Specification Extensions to fill in any ## Writing Spec Tests -To assure the correctness of the spec, you must add tests for the spec, when making changes. Check [SPECIFICATION_TESTING.md](SPECIFICATION_TESTING.md) for more information. +To assure the correctness of the spec, you must add tests for the spec, when making changes. Check [TESTING_GUIDE.md](TESTING_GUIDE.md) for more information. ## Tools diff --git a/PUBLISHING_SPECS.md b/PUBLISHING_GUIDE.md similarity index 100% rename from PUBLISHING_SPECS.md rename to PUBLISHING_GUIDE.md diff --git a/README.md b/README.md index 9412efb1b..7b05be832 100644 --- a/README.md +++ b/README.md @@ -12,25 +12,25 @@ - [Welcome!](#welcome) - [Project Resources](#project-resources) - [Code of Conduct](#code-of-conduct) -- [Developer Guide](#developer-guide) -- [Client Generator Guide](#client-generator-guide) -- [Published Spec](#published-spec) - [Security](#security) - [License](#license) - [Copyright](#copyright) ## Welcome! -`opensearch-api-specification` is an open source, community-driven collection of API model specifications for -[OpenSearch](https://github.com/opensearch-project/OpenSearch) APIs. The API models are written in OpenAPI format and are used to generate client libraries and documentation. +The `opensearch-api-specification` is an open source, community-driven collection of API model specifications for [OpenSearch](https://github.com/opensearch-project/OpenSearch) APIs. The API models are written in OpenAPI format and are used to generate client libraries and documentation. You can find the latest version of the API specification [here](https://github.com/opensearch-project/opensearch-api-specification/releases/download/main-latest/opensearch-openapi.yaml). -To contribute to this project or to track the developments head over to [Projects](https://github.com/opensearch-project/opensearch-api-specification/projects) -board. Follow the [Developer guide](DEVELOPER_GUIDE.md) and [Contributing guidelines](CONTRIBUTING.md) for instructions +To contribute to this project or to track the developments head over to [Projects](https://github.com/opensearch-project/opensearch-api-specification/projects) board. Follow the [Developer guide](DEVELOPER_GUIDE.md) and [Contributing guidelines](CONTRIBUTING.md) for instructions on building and contributing to opensearch-api-specification. ## Project Resources +* [Current Release](https://github.com/opensearch-project/opensearch-api-specification/releases/download/main-latest/opensearch-openapi.yaml) +* [Developer Guide](DEVELOPER_GUIDE.md). +* [Client Generator Guide](CLIENT_GENERATOR_GUIDE.md). +* [Spec Publishing Guide](PUBLISHING_GUIDE.md). * [Project Website](https://opensearch.org/) +* [API Playground](https://opensearch-project.github.io/opensearch-api-specification/) * [Downloads](https://opensearch.org/downloads.html) * [Documentation](https://opensearch.org/docs/) * Need help? Try [Forums](https://forum.opensearch.org/) @@ -41,21 +41,6 @@ on building and contributing to opensearch-api-specification. This project has adopted the [Amazon Open Source Code of Conduct](CODE_OF_CONDUCT.md). For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq), or contact [opensource-codeofconduct@amazon.com](mailto:opensource-codeofconduct@amazon.com) with any additional questions or comments. -## Developer Guide - -See [DEVELOPER_GUIDE](DEVELOPER_GUIDE.md). - -## Client Generator Guide - -See [CLIENT_GENERATOR_GUIDE](CLIENT_GENERATOR_GUIDE.md). - -## Published Spec - -OpenSearch API Specs are hosted at https://opensearch-project.github.io/opensearch-api-specification/. See [PUBLISHING_SPECS](PUBLISHING_SPECS.md) for more information. - -Click [here](https://github.com/opensearch-project/opensearch-api-specification/releases/download/main-latest/opensearch-openapi.yaml) to download the latest OpenSearch OpenAPI yaml file. - - ## Security If you discover a potential security issue in this project we ask that you notify OpenSearch Security directly via email to security@opensearch.org. Please do **not** create a public GitHub issue. diff --git a/SPECIFICATION_TESTING.md b/TESTING_GUIDE.md similarity index 98% rename from SPECIFICATION_TESTING.md rename to TESTING_GUIDE.md index fd583bc11..8afc147d2 100644 --- a/SPECIFICATION_TESTING.md +++ b/TESTING_GUIDE.md @@ -1,5 +1,5 @@ -- [Specification Testing](#specification-testing) +- [Spec Testing Guide](#spec-testing-guide) - [Running Spec Tests Locally](#running-spec-tests-locally) - [Writing Spec Tests](#writing-spec-tests) - [Simple Test Story](#simple-test-story) @@ -7,7 +7,7 @@ - [Managing Versions](#managing-versions) -# Specification Testing +# Spec Testing Guide We have devised our own test framework to test the spec against an OpenSearch cluster. We're still adding more features to the framework as the needs arise, and this document will be updated accordingly. This test framework has also been integrated into the repo's CI/CD pipeline. Checkout the [test-spec](.github/workflows/test-spec.yml) workflow for more details. diff --git a/spec/namespaces/indices.yaml b/spec/namespaces/indices.yaml index 1ba7e4a5c..f1865f021 100644 --- a/spec/namespaces/indices.yaml +++ b/spec/namespaces/indices.yaml @@ -20,6 +20,22 @@ paths: responses: '200': $ref: '#/components/responses/indices.get_alias@200' + put: + operationId: indices.put_alias.0 + x-operation-group: indices.put_alias + x-version-added: '1.0' + description: Creates or updates an alias. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/index-alias/#create-aliases + parameters: + - $ref: '#/components/parameters/indices.put_alias::query.cluster_manager_timeout' + - $ref: '#/components/parameters/indices.put_alias::query.master_timeout' + - $ref: '#/components/parameters/indices.put_alias::query.timeout' + requestBody: + $ref: '#/components/requestBodies/indices.put_alias' + responses: + '200': + $ref: '#/components/responses/indices.put_alias@200' /_alias/{name}: get: operationId: indices.get_alias.1 @@ -53,6 +69,40 @@ paths: responses: '200': $ref: '#/components/responses/indices.exists_alias@200' + post: + operationId: indices.put_alias.1 + x-operation-group: indices.put_alias + x-version-added: '1.0' + description: Creates or updates an alias. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/index-alias/#create-aliases + parameters: + - $ref: '#/components/parameters/indices.put_alias::path.name' + - $ref: '#/components/parameters/indices.put_alias::query.cluster_manager_timeout' + - $ref: '#/components/parameters/indices.put_alias::query.master_timeout' + - $ref: '#/components/parameters/indices.put_alias::query.timeout' + requestBody: + $ref: '#/components/requestBodies/indices.put_alias' + responses: + '200': + $ref: '#/components/responses/indices.put_alias@200' + put: + operationId: indices.put_alias.2 + x-operation-group: indices.put_alias + x-version-added: '1.0' + description: Creates or updates an alias. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/index-alias/#create-aliases + parameters: + - $ref: '#/components/parameters/indices.put_alias::path.name' + - $ref: '#/components/parameters/indices.put_alias::query.cluster_manager_timeout' + - $ref: '#/components/parameters/indices.put_alias::query.master_timeout' + - $ref: '#/components/parameters/indices.put_alias::query.timeout' + requestBody: + $ref: '#/components/requestBodies/indices.put_alias' + responses: + '200': + $ref: '#/components/responses/indices.put_alias@200' /_aliases: post: operationId: indices.update_aliases.0 @@ -70,6 +120,41 @@ paths: responses: '200': $ref: '#/components/responses/indices.update_aliases@200' + /_aliases/{name}: + post: + operationId: indices.put_alias.3 + x-operation-group: indices.put_alias + x-version-added: '1.0' + description: Creates or updates an alias. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/index-alias/#create-aliases + parameters: + - $ref: '#/components/parameters/indices.put_alias::path.name' + - $ref: '#/components/parameters/indices.put_alias::query.cluster_manager_timeout' + - $ref: '#/components/parameters/indices.put_alias::query.master_timeout' + - $ref: '#/components/parameters/indices.put_alias::query.timeout' + requestBody: + $ref: '#/components/requestBodies/indices.put_alias' + responses: + '200': + $ref: '#/components/responses/indices.put_alias@200' + put: + operationId: indices.put_alias.4 + x-operation-group: indices.put_alias + x-version-added: '1.0' + description: Creates or updates an alias. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/index-alias/#create-aliases + parameters: + - $ref: '#/components/parameters/indices.put_alias::path.name' + - $ref: '#/components/parameters/indices.put_alias::query.cluster_manager_timeout' + - $ref: '#/components/parameters/indices.put_alias::query.master_timeout' + - $ref: '#/components/parameters/indices.put_alias::query.timeout' + requestBody: + $ref: '#/components/requestBodies/indices.put_alias' + responses: + '200': + $ref: '#/components/responses/indices.put_alias@200' /_analyze: get: operationId: indices.analyze.0 @@ -894,6 +979,7 @@ paths: parameters: - $ref: '#/components/parameters/indices.exists::path.index' - $ref: '#/components/parameters/indices.exists::query.allow_no_indices' + - $ref: '#/components/parameters/indices.exists::query.cluster_manager_timeout' - $ref: '#/components/parameters/indices.exists::query.expand_wildcards' - $ref: '#/components/parameters/indices.exists::query.flat_settings' - $ref: '#/components/parameters/indices.exists::query.ignore_unavailable' @@ -957,6 +1043,23 @@ paths: responses: '200': $ref: '#/components/responses/indices.get_alias@200' + put: + operationId: indices.put_alias.5 + x-operation-group: indices.put_alias + x-version-added: '1.0' + description: Creates or updates an alias. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/index-alias/#create-aliases + parameters: + - $ref: '#/components/parameters/indices.put_alias::path.index' + - $ref: '#/components/parameters/indices.put_alias::query.cluster_manager_timeout' + - $ref: '#/components/parameters/indices.put_alias::query.master_timeout' + - $ref: '#/components/parameters/indices.put_alias::query.timeout' + requestBody: + $ref: '#/components/requestBodies/indices.put_alias' + responses: + '200': + $ref: '#/components/responses/indices.put_alias@200' /{index}/_alias/{name}: get: operationId: indices.get_alias.3 @@ -993,7 +1096,7 @@ paths: '200': $ref: '#/components/responses/indices.exists_alias@200' post: - operationId: indices.put_alias.0 + operationId: indices.put_alias.6 x-operation-group: indices.put_alias x-version-added: '1.0' description: Creates or updates an alias. @@ -1011,7 +1114,7 @@ paths: '200': $ref: '#/components/responses/indices.put_alias@200' put: - operationId: indices.put_alias.1 + operationId: indices.put_alias.7 x-operation-group: indices.put_alias x-version-added: '1.0' description: Creates or updates an alias. @@ -1044,9 +1147,27 @@ paths: responses: '200': $ref: '#/components/responses/indices.delete_alias@200' + /{index}/_aliases: + put: + operationId: indices.put_alias.8 + x-operation-group: indices.put_alias + x-version-added: '1.0' + description: Creates or updates an alias. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/index-alias/#create-aliases + parameters: + - $ref: '#/components/parameters/indices.put_alias::path.index' + - $ref: '#/components/parameters/indices.put_alias::query.cluster_manager_timeout' + - $ref: '#/components/parameters/indices.put_alias::query.master_timeout' + - $ref: '#/components/parameters/indices.put_alias::query.timeout' + requestBody: + $ref: '#/components/requestBodies/indices.put_alias' + responses: + '200': + $ref: '#/components/responses/indices.put_alias@200' /{index}/_aliases/{name}: post: - operationId: indices.put_alias.2 + operationId: indices.put_alias.9 x-operation-group: indices.put_alias x-version-added: '1.0' description: Creates or updates an alias. @@ -1064,7 +1185,7 @@ paths: '200': $ref: '#/components/responses/indices.put_alias@200' put: - operationId: indices.put_alias.3 + operationId: indices.put_alias.10 x-operation-group: indices.put_alias x-version-added: '1.0' description: Creates or updates an alias. @@ -1844,8 +1965,12 @@ components: schema: type: object properties: + alias: + type: string filter: $ref: '../schemas/_common.query_dsl.yaml#/components/schemas/QueryContainer' + index: + type: string index_routing: $ref: '../schemas/_common.yaml#/components/schemas/Routing' is_write_index: @@ -1859,6 +1984,12 @@ components: $ref: '../schemas/_common.yaml#/components/schemas/Routing' search_routing: $ref: '../schemas/_common.yaml#/components/schemas/Routing' + is_hidden: + x-version-added: '2.16' + description: |- + If `true`, the alias will be hidden`. + type: boolean + default: false description: The settings for the alias, such as `routing` or `filter` indices.put_index_template: content: @@ -3220,6 +3351,13 @@ components: schema: $ref: '../schemas/_common.yaml#/components/schemas/Indices' style: simple + indices.exists::query.cluster_manager_timeout: + name: cluster_manager_timeout + in: query + description: Operation timeout for connection to cluster-manager node. + schema: + $ref: '../schemas/_common.yaml#/components/schemas/Duration' + x-version-added: '2.0' indices.exists::query.allow_no_indices: in: query name: allow_no_indices diff --git a/spec/namespaces/nodes.yaml b/spec/namespaces/nodes.yaml index 4db9ebfee..e99653b12 100644 --- a/spec/namespaces/nodes.yaml +++ b/spec/namespaces/nodes.yaml @@ -253,7 +253,7 @@ paths: responses: '200': $ref: '#/components/responses/nodes.usage@200' - /_nodes/{metric}: + /_nodes/{node_id_or_metric}: get: operationId: nodes.info.1 x-operation-group: nodes.info @@ -262,22 +262,7 @@ paths: externalDocs: url: https://opensearch.org/docs/latest/api-reference/nodes-apis/nodes-info/ parameters: - - $ref: '#/components/parameters/nodes.info::path.metric' - - $ref: '#/components/parameters/nodes.info::query.flat_settings' - - $ref: '#/components/parameters/nodes.info::query.timeout' - responses: - '200': - $ref: '#/components/responses/nodes.info@200' - /_nodes/{node_id}: - get: - operationId: nodes.info.2 - x-operation-group: nodes.info - x-version-added: '1.0' - description: Returns information about nodes in the cluster. - externalDocs: - url: https://opensearch.org/docs/latest/api-reference/nodes-apis/nodes-info/ - parameters: - - $ref: '#/components/parameters/nodes.info::path.node_id' + - $ref: '#/components/parameters/nodes.info::path.node_id_or_metric' - $ref: '#/components/parameters/nodes.info::query.flat_settings' - $ref: '#/components/parameters/nodes.info::query.timeout' responses: @@ -545,15 +530,21 @@ components: description: The type to sample. schema: $ref: '../schemas/nodes._common.yaml#/components/schemas/SampleType' - nodes.info::path.metric: + nodes.info::path.node_id_or_metric: in: path - name: metric - description: Limits the information returned to the specific metrics. Supports a comma-separated list, such as http,ingest. + name: node_id_or_metric + description: | + Limits the information returned to a list of node IDs or specific metrics. + Supports a comma-separated list, such as node1,node2 or http,ingest. required: true schema: - type: array - items: - $ref: '../schemas/nodes.info.yaml#/components/schemas/Metric' + anyOf: + - title: node_id + $ref: '../schemas/_common.yaml#/components/schemas/NodeIds' + - title: metric + type: array + items: + $ref: '../schemas/nodes.info.yaml#/components/schemas/Metric' style: simple nodes.info::path.node_id: in: path @@ -563,6 +554,16 @@ components: schema: $ref: '../schemas/_common.yaml#/components/schemas/NodeIds' style: simple + nodes.info::path.metric: + in: path + name: metric + description: Limits the information returned to the specific metrics. Supports a comma-separated list, such as http,ingest. + required: true + schema: + type: array + items: + $ref: '../schemas/nodes.info.yaml#/components/schemas/Metric' + style: simple nodes.info::query.flat_settings: in: query name: flat_settings diff --git a/spec/schemas/_common.query_dsl.yaml b/spec/schemas/_common.query_dsl.yaml index 7ad1e78ff..3fab6cef8 100644 --- a/spec/schemas/_common.query_dsl.yaml +++ b/spec/schemas/_common.query_dsl.yaml @@ -625,8 +625,17 @@ components: $ref: '_common.yaml#/components/schemas/GeoDistanceType' validation_method: $ref: '#/components/schemas/GeoValidationMethod' + ignore_unmapped: + description: |- + Set to `true` to ignore an unmapped field and not match any documents for this query. + Set to `false` to throw an exception if the field is not mapped. + type: boolean + default: false + field: + type: object required: - distance + - field GeoPolygonQuery: allOf: - $ref: '#/components/schemas/QueryBase' diff --git a/spec/schemas/_common.yaml b/spec/schemas/_common.yaml index 858f1d60e..b080de313 100644 --- a/spec/schemas/_common.yaml +++ b/spec/schemas/_common.yaml @@ -6,6 +6,9 @@ info: paths: {} components: schemas: + Type: + type: string + x-version-removed: '2.0' Id: type: string AcknowledgedResponseBase: @@ -1315,6 +1318,8 @@ components: WriteResponseBase: type: object properties: + _type: + $ref: '#/components/schemas/Type' _id: $ref: '#/components/schemas/Id' _index: @@ -1732,6 +1737,11 @@ components: query_total: description: The total number of shard query operations. type: number + request: + type: object + description: Statistics about coordinator search operations for the node. + additionalProperties: + $ref: '#/components/schemas/RequestStats' search_idle_reactivate_count_total: type: number scroll_current: @@ -1800,6 +1810,15 @@ components: - size_in_bytes - uncommitted_operations - uncommitted_size_in_bytes + RequestStats: + type: object + properties: + time_in_millis: + $ref: '_common.yaml#/components/schemas/DurationValueUnitMillis' + current: + type: number + total: + type: number WarmerStats: type: object properties: diff --git a/spec/schemas/_core.bulk.yaml b/spec/schemas/_core.bulk.yaml index 90bac8a39..a4e03fd19 100644 --- a/spec/schemas/_core.bulk.yaml +++ b/spec/schemas/_core.bulk.yaml @@ -110,6 +110,10 @@ components: ResponseItem: type: object properties: + _type: + description: The document type. + type: string + x-version-removed: '2.0' _id: description: The document ID associated with the operation. anyOf: diff --git a/spec/schemas/_core.get.yaml b/spec/schemas/_core.get.yaml index 947aad4fc..42f70ce2a 100644 --- a/spec/schemas/_core.get.yaml +++ b/spec/schemas/_core.get.yaml @@ -9,6 +9,8 @@ components: GetResult: type: object properties: + _type: + $ref: '_common.yaml#/components/schemas/Type' _index: $ref: '_common.yaml#/components/schemas/IndexName' fields: diff --git a/spec/schemas/_core.search.yaml b/spec/schemas/_core.search.yaml index 5ec0b7813..c6e65d005 100644 --- a/spec/schemas/_core.search.yaml +++ b/spec/schemas/_core.search.yaml @@ -43,6 +43,8 @@ components: Hit: type: object properties: + _type: + $ref: '_common.yaml#/components/schemas/Type' _index: $ref: '_common.yaml#/components/schemas/IndexName' _id: @@ -787,6 +789,9 @@ components: description: Defines how to fetch a source. Fetching can be disabled entirely, or the source can be filtered. oneOf: - type: boolean + - type: array + items: + $ref: '_common.yaml#/components/schemas/Field' - $ref: '#/components/schemas/SourceFilter' SourceFilter: type: object diff --git a/spec/schemas/cat.health.yaml b/spec/schemas/cat.health.yaml index f6989038b..6e7afc949 100644 --- a/spec/schemas/cat.health.yaml +++ b/spec/schemas/cat.health.yaml @@ -52,3 +52,7 @@ components: discovered_cluster_manager: description: cluster manager is discovered or not type: string + discovered_master: + x-version-removed: '2.0' + description: cluster manager is discovered or not + type: string diff --git a/spec/schemas/nodes._common.yaml b/spec/schemas/nodes._common.yaml index 7119fc65c..ee172b93e 100644 --- a/spec/schemas/nodes._common.yaml +++ b/spec/schemas/nodes._common.yaml @@ -135,6 +135,11 @@ components: threads: description: Number of threads in the thread pool. type: number + total_wait_time_in_nanos: + description: | + The total amount of time that tasks spend waiting in the thread pool queue. + Currently, only `search`, `search_throttled`, and `index_searcher` thread pools support this metric. + type: number Scripting: type: object properties: @@ -246,6 +251,145 @@ components: $ref: '#/components/schemas/IndexingPressure' indices: $ref: 'indices.stats.yaml#/components/schemas/ShardStats' + shard_indexing_pressure: + $ref: '#/components/schemas/ShardIndexingPressureStats' + search_backpressure: + $ref: '#/components/schemas/ShardSearchBackpressureStats' + cluster_manager_throttling: + $ref: '#/components/schemas/ShardClusterManagerThrottlingStats' + weighted_routing: + $ref: '#/components/schemas/ShardWeightedRoutingStats' + task_cancellation: + $ref: '#/components/schemas/ShardTaskCancellationStats' + resource_usage_stats: + $ref: '#/components/schemas/ShardResourceUsageStats' + search_pipeline: + $ref: '#/components/schemas/ShardSearchPipelineStats' + segment_replication_backpressure: + $ref: '#/components/schemas/ShardSegmentReplicationBackpressureStats' + repositories: + $ref: '#/components/schemas/ShardRepositoriesStats' + admission_control: + $ref: '#/components/schemas/ShardAdmissionControlStats' + caches: + $ref: '#/components/schemas/ShardCachesStats' + ShardClusterManagerThrottlingStats: + type: object + properties: + stats: + $ref: '#/components/schemas/ShardClusterManagerThrottlingStatsDetail' + ShardClusterManagerThrottlingStatsDetail: + type: object + properties: + total_throttled_tasks: + type: number + throttled_tasks_per_task_type: + type: object # TODO: list of tasks + ShardWeightedRoutingStats: + type: object + properties: + stats: + $ref: '#/components/schemas/ShardWeightedRoutingStatsDetail' + ShardWeightedRoutingStatsDetail: + type: object + properties: + fail_open_count: + type: number + ShardTaskCancellationStats: + type: object + properties: + search_shard_task: + $ref: '#/components/schemas/ShardTaskCancellationStatsDetail' + ShardTaskCancellationStatsDetail: + type: object + properties: + current_count_post_cancel: + type: number + total_count_post_cancel: + type: number + ShardSearchPipelineStats: + type: object + properties: + total_request: + $ref: '#/components/schemas/ShardSearchPipelineTotalStats' + total_response: + $ref: '#/components/schemas/ShardSearchPipelineTotalStats' + pipelines: + type: object + ShardSearchPipelineTotalStats: + type: object + properties: + count: + type: number + time_in_millis: + $ref: '_common.yaml#/components/schemas/DurationValueUnitMillis' + current: + type: number + failed: + type: number + ShardResourceUsageStats: + type: object + additionalProperties: + $ref: '#/components/schemas/ShardResourceUsageStatsDetail' + ShardResourceUsageStatsDetail: + type: object + properties: + timestamp: + type: number + cpu_utilization_percent: + $ref: '_common.yaml#/components/schemas/Percentage' + memory_utilization_percent: + $ref: '_common.yaml#/components/schemas/Percentage' + io_usage_stats: + $ref: '#/components/schemas/ShardResourceUsageStatsIoUsageStats' + ShardResourceUsageStatsIoUsageStats: + type: object + properties: + max_io_utilization_percent: + $ref: '_common.yaml#/components/schemas/Percentage' + ShardSegmentReplicationBackpressureStats: + type: object + properties: + total_rejected_requests: + type: number + ShardRepositoriesStats: + type: array + ShardAdmissionControlStats: + type: object + properties: + global_io_usage: + $ref: '#/components/schemas/UsageStats' + global_cpu_usage: + $ref: '#/components/schemas/UsageStats' + UsageStats: + type: object + properties: + transport: + $ref: '#/components/schemas/TransportUsageStats' + TransportUsageStats: + type: object + properties: + rejection_count: + type: object + ShardCachesStats: + type: object + additionalProperties: + $ref: '#/components/schemas/ShardCacheStats' + ShardCacheStats: + type: object + properties: + size_in_bytes: + type: number + evictions: + type: number + hit_count: + type: number + miss_count: + type: number + item_count: + type: number + store_name: + type: string AdaptiveSelection: type: object properties: @@ -315,6 +459,10 @@ components: available_in_bytes: description: Total number of bytes available to this Java virtual machine on this file store. type: number + cache_reserved_in_bytes: + x-version-added: '2.7' + description: Total number of cache bytes reserved available to this Java virtual machine on this file store. + type: number disk_queue: type: string disk_reads: @@ -377,6 +525,10 @@ components: total_in_bytes: description: Total size of all file stores in bytes. type: number + cache_reserved_in_bytes: + x-version-added: '2.7' + description: Total size of cache bytes reserved in all file stores. + type: number IoStats: type: object properties: @@ -528,6 +680,18 @@ components: peak_max_in_bytes: description: Largest amount of memory, in bytes, historically used by the heap. type: number + last_gc_stats: + description: Most recent GC cycle stats for a particular memory pool. + $ref: '#/components/schemas/LastGcStats' + LastGcStats: + type: object + properties: + used_in_bytes: + type: number + max_in_bytes: + type: number + usage_percent: + type: number JvmThreads: type: object properties: @@ -761,6 +925,8 @@ components: properties: cluster_state_queue: $ref: '#/components/schemas/ClusterStateQueue' + cluster_state_stats: + $ref: '#/components/schemas/ClusterStateStats' published_cluster_states: $ref: '#/components/schemas/PublishedClusterStates' cluster_state_update: @@ -788,6 +954,20 @@ components: committed: description: Number of committed cluster states in queue. type: number + ClusterStateStats: + type: object + properties: + overall: + $ref: '#/components/schemas/ClusterStateOverallStats' + ClusterStateOverallStats: + type: object + properties: + update_count: + type: number + total_time_in_millis: + $ref: '_common.yaml#/components/schemas/DurationValueUnitMillis' + failed_count: + type: number PublishedClusterStates: type: object properties: @@ -879,6 +1059,93 @@ components: properties: memory: $ref: '#/components/schemas/IndexingPressureMemory' + ShardIndexingPressureStats: + type: object + properties: + stats: + type: object + enabled: + type: boolean + enforced: + type: boolean + total_rejections_breakup_shadow_mode: + $ref: '#/components/schemas/TotalRejectionsBreakupShadowMode' + ShardSearchBackpressureStats: + type: object + properties: + search_task: + $ref: '#/components/schemas/ShardSearchBackpressureTaskStats' + search_shard_task: + $ref: '#/components/schemas/ShardSearchBackpressureTaskStats' + mode: + $ref: '#/components/schemas/ShardSearchBackpressureMode' + ShardSearchBackpressureMode: + type: string + enum: + - disabled + - enforced + - monitor_only + ShardSearchBackpressureTaskStats: + type: object + properties: + resource_tracker_stats: + $ref: '#/components/schemas/ShardSearchBackpressureTaskResourceTrackerStats' + cancellation_stats: + $ref: '#/components/schemas/ShardSearchBackpressureTaskCancellationStats' + ShardSearchBackpressureTaskResourceTrackerStats: + type: object + properties: + heap_usage_tracker: + $ref: '#/components/schemas/ShardSearchBackpressureTaskResourceTrackerHeapUsageTrackerStats' + elapsed_time_tracker: + $ref: '#/components/schemas/ShardSearchBackpressureTaskResourceTrackerElapsedTimeTrackerStats' + cpu_usage_tracker: + $ref: '#/components/schemas/ShardSearchBackpressureTaskResourceTrackerCpuUsageTrackerStats' + ShardSearchBackpressureTaskResourceTrackerHeapUsageTrackerStats: + type: object + properties: + cancellation_count: + type: number + current_max_bytes: + type: number + current_avg_bytes: + type: number + rolling_avg_bytes: + type: number + ShardSearchBackpressureTaskResourceTrackerElapsedTimeTrackerStats: + type: object + properties: + cancellation_count: + type: number + current_max_millis: + $ref: '_common.yaml#/components/schemas/DurationValueUnitMillis' + current_avg_millis: + $ref: '_common.yaml#/components/schemas/DurationValueUnitMillis' + ShardSearchBackpressureTaskResourceTrackerCpuUsageTrackerStats: + type: object + properties: + cancellation_count: + type: number + current_max_millis: + $ref: '_common.yaml#/components/schemas/DurationValueUnitMillis' + current_avg_millis: + $ref: '_common.yaml#/components/schemas/DurationValueUnitMillis' + ShardSearchBackpressureTaskCancellationStats: + type: object + properties: + cancellation_count: + type: number + cancellation_limit_reached_count: + type: number + TotalRejectionsBreakupShadowMode: + type: object + properties: + node_limits: + type: number + no_successful_request_limits: + type: number + throughput_degradation_limits: + type: number IndexingPressureMemory: type: object properties: diff --git a/spec/schemas/nodes.stats.yaml b/spec/schemas/nodes.stats.yaml index 63d877d34..52dd278d0 100644 --- a/spec/schemas/nodes.stats.yaml +++ b/spec/schemas/nodes.stats.yaml @@ -10,18 +10,33 @@ components: type: string enum: - _all + - adaptive_selection + - admission_control - breaker + - caches + - cluster_manager_throttling - discovery + - file_cache - fs - http - indexing_pressure - indices + - ingest - jvm - os - process + - repositories + - resource_usage_stats + - script + - script_cache + - search_backpressure - search_pipeline + - segment_replication_backpressure + - shard_indexing_pressure + - task_cancellation - thread_pool - transport + - weighted_routing IndexMetric: type: string enum: diff --git a/tests/_core/search.yaml b/tests/_core/search/_source.yaml similarity index 61% rename from tests/_core/search.yaml rename to tests/_core/search/_source.yaml index a1760ee51..973eb3585 100644 --- a/tests/_core/search.yaml +++ b/tests/_core/search/_source.yaml @@ -1,6 +1,6 @@ -$schema: ../../json_schemas/test_story.schema.yaml +$schema: ../../../json_schemas/test_story.schema.yaml -description: Test search endpoint. +description: Test search endpoint (_source). prologues: - path: /movies/_doc method: POST @@ -17,14 +17,16 @@ epilogues: method: DELETE status: [200, 404] chapters: - - synopsis: Search with size=0. + - synopsis: Search (_source=true). path: /{index}/_search parameters: index: movies method: POST request_body: payload: - size: 0 + _source: true + query: + match_all: {} response: status: 200 payload: @@ -33,16 +35,22 @@ chapters: total: value: 1 relation: eq - max_score: null - hits: [] - - synopsis: Search with size=1. + max_score: 1 + hits: + - _index: movies + _score: 1 + _source: + director: Bennett Miller + title: Moneyball + year: 2011 + - synopsis: Search (_source=false). path: /{index}/_search parameters: index: movies method: POST request_body: payload: - size: 1 + _source: false query: match_all: {} response: @@ -57,45 +65,45 @@ chapters: hits: - _index: movies _score: 1 - _source: - director: Bennett Miller - title: Moneyball - year: 2011 - - synopsis: Search with a match query object. + - synopsis: Search (_source=[fields]). path: /{index}/_search parameters: index: movies method: POST request_body: payload: - size: 1 + _source: + - director + - year query: - match: - director: - query: Bennett Miller - - synopsis: Search with a match query field. - path: /{index}/_search - parameters: - index: movies - method: POST - request_body: + match_all: {} + response: + status: 200 payload: - size: 1 - query: - match: - director: Bennett Miller - - synopsis: Search with multi_match query. + timed_out: false + hits: + total: + value: 1 + relation: eq + max_score: 1 + hits: + - _index: movies + _score: 1 + _source: + director: Bennett Miller + year: 2011 + - synopsis: Search (_source=filter). path: /{index}/_search parameters: index: movies method: POST request_body: payload: - size: 1 + _source: + includes: director + excludes: year query: - multi_match: - query: miller - fields: [director, title^2] + match_all: {} response: status: 200 payload: @@ -104,35 +112,24 @@ chapters: total: value: 1 relation: eq + max_score: 1 hits: - _index: movies + _score: 1 _source: director: Bennett Miller - title: Moneyball - year: 2011 - - synopsis: Search with cancel_after_time_interval. + - synopsis: Search (_source=filter with wildcards). path: /{index}/_search parameters: index: movies - cancel_after_time_interval: 10s - method: POST - response: - status: 200 - - synopsis: Search with phase_took. - version: '>= 2.12' - path: /{index}/_search - parameters: - index: movies - phase_took: true - method: POST - response: - status: 200 - - synopsis: Search with seq_no_primary_term. - path: /{index}/_search - parameters: - index: movies - seq_no_primary_term: true method: POST + request_body: + payload: + _source: + includes: '*' + excludes: year + query: + match_all: {} response: status: 200 payload: @@ -141,11 +138,10 @@ chapters: total: value: 1 relation: eq + max_score: 1 hits: - _index: movies + _score: 1 _source: director: Bennett Miller title: Moneyball - year: 2011 - _seq_no: 0 - _primary_term: 1 diff --git a/tests/_core/search/cancel_after_time_interval.yaml b/tests/_core/search/cancel_after_time_interval.yaml new file mode 100644 index 000000000..012a7972e --- /dev/null +++ b/tests/_core/search/cancel_after_time_interval.yaml @@ -0,0 +1,28 @@ +$schema: ../../../json_schemas/test_story.schema.yaml + +description: Test search endpoint with cancel_after_time_interval. +prologues: + - path: /movies/_doc + method: POST + parameters: + refresh: true + request_body: + payload: + director: Bennett Miller + title: Moneyball + year: 2011 + status: [201] +epilogues: + - path: /movies + method: DELETE + status: [200, 404] +chapters: + - synopsis: Search with cancel_after_time_interval. + path: /{index}/_search + parameters: + index: movies + cancel_after_time_interval: 10s + method: POST + response: + status: 200 + diff --git a/tests/_core/search/geo_distance.yaml b/tests/_core/search/geo_distance.yaml new file mode 100644 index 000000000..8ce5712d0 --- /dev/null +++ b/tests/_core/search/geo_distance.yaml @@ -0,0 +1,60 @@ +$schema: ../../../json_schemas/test_story.schema.yaml + +description: Test search endpoint with geo_distance query. +prologues: + - path: /map + method: PUT + request_body: + payload: + mappings: + properties: + field: + type: geo_point + - path: /map/_doc/1 + method: POST + parameters: + refresh: true + request_body: + payload: + field: + lat: 74 + lon: 40.71 + status: [201] +epilogues: + - path: /map + method: DELETE + status: [200, 404] +chapters: + - synopsis: Search for documents whose point objects are within the specified distance from the specified point. + path: /{index}/_search + parameters: + index: map + method: GET + request_body: + payload: + query: + geo_distance: + distance: 50mi + distance_type: arc + validation_method: strict + ignore_unmapped: true + field: + lat: 73.5 + lon: 40.5 + response: + status: 200 + payload: + timed_out: false + hits: + total: + value: 1 + relation: eq + max_score: 1 + hits: + - _index: map + _score: 1 + _source: + field: + lat: 74 + lon: 40.71 + diff --git a/tests/_core/search/match.yaml b/tests/_core/search/match.yaml new file mode 100644 index 000000000..78afe3ddf --- /dev/null +++ b/tests/_core/search/match.yaml @@ -0,0 +1,56 @@ +$schema: ../../../json_schemas/test_story.schema.yaml + +description: Test search endpoint with match query. +prologues: + - path: /movies/_doc + method: POST + parameters: + refresh: true + request_body: + payload: + director: Bennett Miller + title: Moneyball + year: 2011 + status: [201] +epilogues: + - path: /movies + method: DELETE + status: [200, 404] +chapters: + - synopsis: Search with a match query object. + path: /{index}/_search + parameters: + index: movies + method: POST + request_body: + payload: + size: 1 + query: + match: + director: + query: Bennett Miller + - synopsis: Search with a match query field. + path: /{index}/_search + parameters: + index: movies + method: POST + request_body: + payload: + size: 1 + query: + match: + director: Bennett Miller + response: + status: 200 + payload: + timed_out: false + hits: + total: + value: 1 + relation: eq + hits: + - _index: movies + _source: + director: Bennett Miller + title: Moneyball + year: 2011 diff --git a/tests/_core/search/multi_match.yaml b/tests/_core/search/multi_match.yaml new file mode 100644 index 000000000..4ea41f74a --- /dev/null +++ b/tests/_core/search/multi_match.yaml @@ -0,0 +1,45 @@ +$schema: ../../../json_schemas/test_story.schema.yaml + +description: Test search endpoint with multi_match query. +prologues: + - path: /movies/_doc + method: POST + parameters: + refresh: true + request_body: + payload: + director: Bennett Miller + title: Moneyball + year: 2011 + status: [201] +epilogues: + - path: /movies + method: DELETE + status: [200, 404] +chapters: + - synopsis: Search with multi_match query. + path: /{index}/_search + parameters: + index: movies + method: POST + request_body: + payload: + size: 1 + query: + multi_match: + query: miller + fields: [director, title^2] + response: + status: 200 + payload: + timed_out: false + hits: + total: + value: 1 + relation: eq + hits: + - _index: movies + _source: + director: Bennett Miller + title: Moneyball + year: 2011 diff --git a/tests/_core/search/phase_took.yaml b/tests/_core/search/phase_took.yaml new file mode 100644 index 000000000..846d0fe86 --- /dev/null +++ b/tests/_core/search/phase_took.yaml @@ -0,0 +1,28 @@ +$schema: ../../../json_schemas/test_story.schema.yaml + +description: Test search endpoint with phase_took. +prologues: + - path: /movies/_doc + method: POST + parameters: + refresh: true + request_body: + payload: + director: Bennett Miller + title: Moneyball + year: 2011 + status: [201] +epilogues: + - path: /movies + method: DELETE + status: [200, 404] +chapters: + - synopsis: Search with phase_took. + version: '>= 2.12' + path: /{index}/_search + parameters: + index: movies + phase_took: true + method: POST + response: + status: 200 diff --git a/tests/_core/search/seq_no_primary_term.yaml b/tests/_core/search/seq_no_primary_term.yaml new file mode 100644 index 000000000..07b0d5834 --- /dev/null +++ b/tests/_core/search/seq_no_primary_term.yaml @@ -0,0 +1,41 @@ +$schema: ../../../json_schemas/test_story.schema.yaml + +description: Test search endpoint with seq_no_primary_term. +prologues: + - path: /movies/_doc + method: POST + parameters: + refresh: true + request_body: + payload: + director: Bennett Miller + title: Moneyball + year: 2011 + status: [201] +epilogues: + - path: /movies + method: DELETE + status: [200, 404] +chapters: + - synopsis: Search with seq_no_primary_term. + path: /{index}/_search + parameters: + index: movies + seq_no_primary_term: true + method: POST + response: + status: 200 + payload: + timed_out: false + hits: + total: + value: 1 + relation: eq + hits: + - _index: movies + _source: + director: Bennett Miller + title: Moneyball + year: 2011 + _seq_no: 0 + _primary_term: 1 diff --git a/tests/_core/search/size.yaml b/tests/_core/search/size.yaml new file mode 100644 index 000000000..154f34638 --- /dev/null +++ b/tests/_core/search/size.yaml @@ -0,0 +1,64 @@ +$schema: ../../../json_schemas/test_story.schema.yaml + +description: Test search endpoint with size. +prologues: + - path: /movies/_doc + method: POST + parameters: + refresh: true + request_body: + payload: + director: Bennett Miller + title: Moneyball + year: 2011 + status: [201] +epilogues: + - path: /movies + method: DELETE + status: [200, 404] +chapters: + - synopsis: Search with size=0. + path: /{index}/_search + parameters: + index: movies + method: POST + request_body: + payload: + size: 0 + response: + status: 200 + payload: + timed_out: false + hits: + total: + value: 1 + relation: eq + max_score: null + hits: [] + - synopsis: Search with size=1. + path: /{index}/_search + parameters: + index: movies + method: POST + request_body: + payload: + size: 1 + query: + match_all: {} + response: + status: 200 + payload: + timed_out: false + hits: + total: + value: 1 + relation: eq + max_score: 1 + hits: + - _index: movies + _score: 1 + _source: + director: Bennett Miller + title: Moneyball + year: 2011 + \ No newline at end of file diff --git a/tests/cat/cluster_manager.yaml b/tests/cat/cluster_manager.yaml index ab27df451..3f0686d32 100644 --- a/tests/cat/cluster_manager.yaml +++ b/tests/cat/cluster_manager.yaml @@ -3,6 +3,7 @@ $schema: ../../json_schemas/test_story.schema.yaml description: Test cat/cluster_manager endpoints. chapters: - synopsis: Cat with a json response. + version: '>= 2.0' path: /_cat/cluster_manager method: GET parameters: diff --git a/tests/cat/health.yaml b/tests/cat/health.yaml index 35d1713b6..cc18865be 100644 --- a/tests/cat/health.yaml +++ b/tests/cat/health.yaml @@ -46,6 +46,33 @@ chapters: - synopsis: Cat in different formats (format=json). method: GET path: /_cat/health + parameters: + format: json + response: + status: 200 + content_type: application/json + payload: + - node.total: '1' + status: yellow + node.data: '1' + - synopsis: Cat with master response (format=json). + method: GET + path: /_cat/health + version: < 2.0 + parameters: + format: json + response: + status: 200 + content_type: application/json + payload: + - node.total: '1' + status: yellow + node.data: '1' + discovered_master: 'true' + - synopsis: Cat with cluster_manager response (format=json). + method: GET + path: /_cat/health + version: '>= 2.0' parameters: format: json response: @@ -68,7 +95,6 @@ chapters: - node.total: '1' status: yellow node.data: '1' - discovered_cluster_manager: 'true' - synopsis: Cat in different formats (format=cbor). method: GET path: /_cat/health @@ -81,7 +107,6 @@ chapters: - node.total: '1' status: yellow node.data: '1' - discovered_cluster_manager: 'true' - synopsis: Cat in different formats (format=smile). method: GET path: /_cat/health @@ -94,4 +119,3 @@ chapters: - node.total: '1' status: yellow node.data: '1' - discovered_cluster_manager: 'true' \ No newline at end of file diff --git a/tests/cat/master.yaml b/tests/cat/master.yaml new file mode 100644 index 000000000..b1ed7985b --- /dev/null +++ b/tests/cat/master.yaml @@ -0,0 +1,12 @@ +$schema: ../../json_schemas/test_story.schema.yaml + +description: Test cat/master endpoints. +chapters: + - synopsis: Cat with a json response. + version: < 2.0 + path: /_cat/master + method: GET + parameters: + format: json + response: + status: 200 diff --git a/tests/cat/nodes.yaml b/tests/cat/nodes.yaml index ab484e295..919100791 100644 --- a/tests/cat/nodes.yaml +++ b/tests/cat/nodes.yaml @@ -5,6 +5,17 @@ chapters: - synopsis: Cat with a json response. path: /_cat/nodes method: GET + version: < 2.0 + parameters: + format: json + response: + status: 200 + payload: + - master: '*' + - synopsis: Cat with a json response. + path: /_cat/nodes + version: '>= 2.0' + method: GET parameters: format: json response: diff --git a/tests/cluster/component_template.yaml b/tests/cluster/component_template.yaml index 78ba7eea4..05838d5db 100644 --- a/tests/cluster/component_template.yaml +++ b/tests/cluster/component_template.yaml @@ -53,13 +53,29 @@ chapters: method: HEAD parameters: name: template1 - cluster_manager_timeout: 10s local: false response: status: 200 + - synopsis: Check if the component template exists (cluster_manager_timeout). + path: /_component_template/{name} + method: HEAD + version: '>= 2.0' + parameters: + name: template1 + cluster_manager_timeout: 10s + response: + status: 200 - synopsis: Get all component templates. path: /_component_template method: GET + parameters: + local: false + response: + status: 200 + - synopsis: Get all component templates (cluster_manager_timeout). + path: /_component_template + method: GET + version: '>= 2.0' parameters: cluster_manager_timeout: 10s local: false diff --git a/tests/indices/aliases.yaml b/tests/indices/aliases/aliases.yaml similarity index 65% rename from tests/indices/aliases.yaml rename to tests/indices/aliases/aliases.yaml index f9d7dc485..e68a6a4d6 100644 --- a/tests/indices/aliases.yaml +++ b/tests/indices/aliases/aliases.yaml @@ -1,4 +1,4 @@ -$schema: ../../json_schemas/test_story.schema.yaml +$schema: ../../../json_schemas/test_story.schema.yaml description: Test aliases endpoints. epilogues: @@ -73,3 +73,33 @@ chapters: parameters: index: games name: plays2 + - synopsis: Create an alias by Create or Update alias endpoint. + path: /{index}/_alias/{name} + method: PUT + parameters: + index: games + name: jeux + - synopsis: Create an alias with custom settings by Create or Update alias endpoint. + path: /{index}/_alias/{name} + method: PUT + parameters: + index: games + name: jeux + request_body: + payload: + index_routing: test1 + search_routing: test2 + routing: test + is_write_index: true + filter: + match_all: {} + - synopsis: Create an alias with is_hidden by Create or Update alias endpoint. + version: '>= 2.16' + path: /{index}/_alias/{name} + method: PUT + parameters: + index: games + name: jeux + request_body: + payload: + is_hidden: true diff --git a/tests/indices/aliases/put_alias.yaml b/tests/indices/aliases/put_alias.yaml new file mode 100644 index 000000000..7dd73fe9c --- /dev/null +++ b/tests/indices/aliases/put_alias.yaml @@ -0,0 +1,79 @@ +$schema: ../../../json_schemas/test_story.schema.yaml + +description: Test put_alias variants. +epilogues: + - path: /test_index/_alias/test_alias* + method: DELETE + status: [200, 404] + - path: /test_index + method: DELETE + status: [200, 404] +prologues: + - path: /{index} + method: PUT + parameters: + index: test_index +chapters: + - synopsis: Create an alias - specifying index & alias in path. + path: /{index}/_alias/{name} + method: PUT + parameters: + index: test_index + name: test_alias + response: + status: 200 + payload: + acknowledged: true + + - synopsis: Create an alias - specifying index in path & alias in body. + path: /{index}/_alias + method: PUT + parameters: + index: test_index + request_body: + payload: + alias: test_alias_1 + response: + status: 200 + payload: + acknowledged: true + + - synopsis: Create an alias - specifying index in body & alias in path. + path: /_alias/{name} + method: PUT + parameters: + name: test_alias_2 + request_body: + payload: + index: test_index + response: + status: 200 + payload: + acknowledged: true + + - synopsis: Create an alias - specifying index & alias in body. + path: /_alias + method: PUT + request_body: + payload: + index: test_index + alias: test_alias_3 + response: + status: 200 + payload: + acknowledged: true + + - synopsis: Retrieve aliases + path: /{index}/_alias + method: GET + parameters: + index: test_index + response: + status: 200 + payload: + test_index: + aliases: + test_alias: {} + test_alias_1: {} + test_alias_2: {} + test_alias_3: {} \ No newline at end of file diff --git a/tests/indices/clone.yaml b/tests/indices/clone.yaml index e1d88d74d..cf0e5fcfc 100644 --- a/tests/indices/clone.yaml +++ b/tests/indices/clone.yaml @@ -14,6 +14,9 @@ epilogues: - path: /games2 method: DELETE status: [200, 404] + - path: /games3 + method: DELETE + status: [200, 404] chapters: - synopsis: Block writes to the source index. path: /{index}/_settings @@ -31,7 +34,6 @@ chapters: index: movies target: games1 wait_for_active_shards: 1 - cluster_manager_timeout: 10s timeout: 10s response: status: 200 @@ -49,3 +51,13 @@ chapters: wait_for_completion: true response: status: 200 + - synopsis: Clone an index (cluster_manager_timeout). + version: '>= 2.0' + path: /{index}/_clone/{target} + method: POST + parameters: + index: movies + target: games3 + cluster_manager_timeout: 10s + response: + status: 200 diff --git a/tests/indices/close.yaml b/tests/indices/close.yaml index 0766f3085..ca0a517d9 100644 --- a/tests/indices/close.yaml +++ b/tests/indices/close.yaml @@ -5,10 +5,16 @@ prologues: - path: /movies method: PUT status: [200] + - path: /games + method: PUT + status: [200] epilogues: - path: /movies method: DELETE status: [200, 404] + - path: /games + method: DELETE + status: [200, 404] chapters: - synopsis: Close an index. path: /{index}/_close @@ -19,7 +25,6 @@ chapters: expand_wildcards: all ignore_unavailable: true wait_for_active_shards: 0 - cluster_manager_timeout: 30s timeout: 30s response: status: 200 @@ -27,6 +32,20 @@ chapters: indices: movies: closed: true + - synopsis: Close an index (cluster_manager_timeout). + path: /{index}/_close + method: POST + version: '>= 2.0' + parameters: + index: games + cluster_manager_timeout: 30s + timeout: 30s + response: + status: 200 + payload: + indices: + games: + closed: true - synopsis: Close an already closed index. path: /{index}/_close method: POST diff --git a/tests/indices/index.yaml b/tests/indices/index.yaml index e91becc8e..c9302a288 100644 --- a/tests/indices/index.yaml +++ b/tests/indices/index.yaml @@ -49,6 +49,15 @@ chapters: - synopsis: Check if the index `movies` exists. It should not. path: /{index} method: HEAD + parameters: + index: movies + response: + status: 404 + + - synopsis: Check if the index `movies` exists (cluster_manager_timeout). It should not. + path: /{index} + method: HEAD + version: '>= 2.0' parameters: index: movies cluster_manager_timeout: 10s @@ -77,6 +86,15 @@ chapters: - synopsis: Delete the `books` and `games` indices. path: /{index} method: DELETE + version: < 2.0 + parameters: + index: books,games + + - synopsis: Delete the `books` index (cluster_manager_timeout). + path: /{index} + method: DELETE + version: '>= 2.0' parameters: index: books,games cluster_manager_timeout: 10s + diff --git a/tests/indices/index_template.yaml b/tests/indices/index_template.yaml index 645312864..c61011894 100644 --- a/tests/indices/index_template.yaml +++ b/tests/indices/index_template.yaml @@ -65,6 +65,14 @@ chapters: - synopsis: Check that an index template exists. path: /_index_template/{name} method: HEAD + parameters: + name: daily_logs + response: + status: 200 + - synopsis: Check that an index template exists (cluster_manager_timeout). + path: /_index_template/{name} + method: HEAD + version: '>= 2.0' parameters: name: daily_logs cluster_manager_timeout: 10s diff --git a/tests/indices/mapping.yml b/tests/indices/mapping.yml index d91ed48b1..4d4860f05 100644 --- a/tests/indices/mapping.yml +++ b/tests/indices/mapping.yml @@ -66,7 +66,6 @@ chapters: allow_no_indices: true expand_wildcards: none ignore_unavailable: true - cluster_manager_timeout: 1s timeout: 10s write_index_only: true request_body: @@ -78,3 +77,19 @@ chapters: status: 200 payload: acknowledged: true + - synopsis: Update mapping for an index (cluster_manager_timeout). + path: /{index}/_mapping + method: PUT + version: '>= 2.0' + parameters: + index: movies + cluster_manager_timeout: 1s + request_body: + payload: + properties: + producer: + type: text + response: + status: 200 + payload: + acknowledged: true \ No newline at end of file diff --git a/tests/indices/open.yaml b/tests/indices/open.yaml index e69d9802a..61aa6fc4b 100644 --- a/tests/indices/open.yaml +++ b/tests/indices/open.yaml @@ -8,14 +8,20 @@ prologues: - path: /games method: PUT status: [200] + - path: /films + method: PUT + status: [200] - path: /movies/_close method: POST status: [200] - path: /games/_close method: POST status: [200] + - path: /films/_close + method: POST + status: [200] epilogues: - - path: /movies,games + - path: /movies,games,films method: DELETE status: [200, 404] chapters: @@ -28,7 +34,6 @@ chapters: expand_wildcards: all ignore_unavailable: true wait_for_active_shards: 0 - cluster_manager_timeout: 30s timeout: 30s response: status: 200 @@ -54,3 +59,15 @@ chapters: payload: shards_acknowledged: true acknowledged: true + - synopsis: Open a closed index (cluster_manager_timeout). + path: /{index}/_open + method: POST + version: '>= 2.0' + parameters: + index: films + cluster_manager_timeout: 30s + response: + status: 200 + payload: + shards_acknowledged: true + acknowledged: true \ No newline at end of file diff --git a/tests/indices/settings.yaml b/tests/indices/settings.yaml index e690fc253..dc5a85f7b 100644 --- a/tests/indices/settings.yaml +++ b/tests/indices/settings.yaml @@ -13,6 +13,19 @@ chapters: - synopsis: Get global settings. path: /_settings method: GET + parameters: + allow_no_indices: true + expand_wildcards: none + flat_settings: true + include_defaults: true + ignore_unavailable: true + local: true + response: + status: 200 + - synopsis: Get global settings (cluster_manager_timeout). + path: /_settings + method: GET + version: '>= 2.0' parameters: allow_no_indices: true expand_wildcards: none diff --git a/tests/indices/shrink.yaml b/tests/indices/shrink.yaml index db83a4954..bfa798487 100644 --- a/tests/indices/shrink.yaml +++ b/tests/indices/shrink.yaml @@ -21,6 +21,9 @@ epilogues: - path: /movies3 method: DELETE status: [200, 404] + - path: /movies4 + method: DELETE + status: [200, 404] chapters: - synopsis: Block writes to the source index. path: /{index}/_settings @@ -38,7 +41,6 @@ chapters: index: movies target: movies1 wait_for_active_shards: 1 - cluster_manager_timeout: 10s timeout: 10s response: status: 200 @@ -63,6 +65,21 @@ chapters: index: movies target: movies3 wait_for_active_shards: 1 + timeout: 10s + response: + status: 200 + payload: + shards_acknowledged: true + acknowledged: true + index: movies3 + - synopsis: Shrink an index (cluster_manager_timeout). + path: /{index}/_shrink/{target} + method: POST + version: '>= 2.0' + parameters: + index: movies + target: movies4 + wait_for_active_shards: 1 cluster_manager_timeout: 10s timeout: 10s response: @@ -70,4 +87,4 @@ chapters: payload: shards_acknowledged: true acknowledged: true - index: movies3 \ No newline at end of file + index: movies4 diff --git a/tests/indices/split.yaml b/tests/indices/split.yaml index 41ca8053c..626edd8ee 100644 --- a/tests/indices/split.yaml +++ b/tests/indices/split.yaml @@ -21,6 +21,9 @@ epilogues: - path: /movies3 method: DELETE status: [200, 404] + - path: /movies4 + method: DELETE + status: [200, 404] chapters: - synopsis: Block writes to the source index. path: /{index}/_settings @@ -38,7 +41,6 @@ chapters: index: movies target: movies1 wait_for_active_shards: 1 - cluster_manager_timeout: 10s timeout: 10s request_body: payload: @@ -73,6 +75,26 @@ chapters: index: movies target: movies3 wait_for_active_shards: 1 + timeout: 10s + request_body: + payload: + settings: + index: + number_of_shards: 6 + response: + status: 200 + payload: + shards_acknowledged: true + acknowledged: true + index: movies3 + - synopsis: Split an index (cluster_manager_timeout). + path: /{index}/_split/{target} + method: POST + version: '>= 2.0' + parameters: + index: movies + target: movies4 + wait_for_active_shards: 1 cluster_manager_timeout: 10s timeout: 10s request_body: @@ -85,4 +107,4 @@ chapters: payload: shards_acknowledged: true acknowledged: true - index: movies3 \ No newline at end of file + index: movies4 \ No newline at end of file diff --git a/tests/nodes/info.yaml b/tests/nodes/info.yaml index 608232cb3..362a04803 100644 --- a/tests/nodes/info.yaml +++ b/tests/nodes/info.yaml @@ -2,8 +2,15 @@ $schema: ../../json_schemas/test_story.schema.yaml description: Test nodes endpoints. chapters: - - synopsis: Nodes with a json response. + - synopsis: Get all nodes. path: /_nodes method: GET response: status: 200 + - synopsis: Get nodes. + path: /_nodes/{node_id_or_metric} + method: GET + parameters: + node_id_or_metric: indices + response: + status: 200 diff --git a/tests/nodes/stats.yaml b/tests/nodes/stats.yaml new file mode 100644 index 000000000..212a58c22 --- /dev/null +++ b/tests/nodes/stats.yaml @@ -0,0 +1,156 @@ +$schema: ../../json_schemas/test_story.schema.yaml + +description: Test nodes stats. +chapters: + - synopsis: Get stats for all nodes. + path: /_nodes/stats + method: GET + response: + status: 200 + - synopsis: Get stats for all nodes with parameters. + path: /_nodes/stats + method: GET + parameters: + completion_fields: '*' + fielddata_fields: '*' + fields: '*' + groups: + - '*' + timeout: 10s + include_segment_file_sizes: true + response: + status: 200 + - synopsis: Get _all node stats (node_id). + path: /_nodes/{node_id}/stats + method: GET + parameters: + node_id: _all + response: + status: 200 + - synopsis: Get fs metic node stats (metric). + path: /_nodes/stats/{metric} + method: GET + parameters: + metric: + - fs + response: + status: 200 + - synopsis: Get fs metric node stats (node_id_or_metric). + path: /_nodes/{node_id_or_metric} + method: GET + parameters: + node_id_or_metric: fs + response: + status: 200 + - synopsis: Get jvm and fs metric node stats from data nodes. + path: /_nodes/{node_id}/stats/{metric} + method: GET + parameters: + node_id: data:true + metric: + - fs + - jvm + response: + status: 200 + - synopsis: Get statistics for the request_cache. + path: /_nodes/stats/{metric}/{index_metric} + method: GET + parameters: + metric: + - adaptive_selection + - breaker + - discovery + - fs + - http + - indexing_pressure + - indices + - ingest + - jvm + - os + - process + - script + - script_cache + - shard_indexing_pressure + - thread_pool + - transport + index_metric: + - request_cache + response: + status: 200 + - synopsis: Get statistics for the request_cache (2.4). + path: /_nodes/stats/{metric}/{index_metric} + method: GET + version: '>= 2.4' + parameters: + metric: + - indices + - search_backpressure + index_metric: + - request_cache + response: + status: 200 + - synopsis: Get statistics for the request_cache (2.6). + path: /_nodes/stats/{metric}/{index_metric} + method: GET + version: '>= 2.6' + parameters: + metric: + - cluster_manager_throttling + - indices + - weighted_routing + index_metric: + - request_cache + response: + status: 200 + - synopsis: Get statistics for the request_cache (2.7). + path: /_nodes/stats/{metric}/{index_metric} + method: GET + version: '>= 2.7' + parameters: + metric: + - file_cache + - indices + index_metric: + - request_cache + response: + status: 200 + - synopsis: Get statistics for the request_cache (2.9). + path: /_nodes/stats/{metric}/{index_metric} + method: GET + version: '>= 2.9' + parameters: + metric: + - indices + - search_pipeline + - task_cancellation + index_metric: + - request_cache + response: + status: 200 + - synopsis: Get statistics for the request_cache (2.12). + path: /_nodes/stats/{metric}/{index_metric} + method: GET + version: '>= 2.12' + parameters: + metric: + - admission_control + - indices + - repositories + - resource_usage_stats + - segment_replication_backpressure + index_metric: + - request_cache + response: + status: 200 + - synopsis: Get statistics for the request_cache (2.14). + path: /_nodes/stats/{metric}/{index_metric} + method: GET + version: '>= 2.14' + parameters: + metric: + - caches + - indices + index_metric: + - request_cache + response: + status: 200 \ No newline at end of file diff --git a/tools/src/linter/components/NamespacesFolder.ts b/tools/src/linter/components/NamespacesFolder.ts index d7ebf4371..71507f7c1 100644 --- a/tools/src/linter/components/NamespacesFolder.ts +++ b/tools/src/linter/components/NamespacesFolder.ts @@ -10,6 +10,7 @@ import NamespaceFile from './NamespaceFile' import { type ValidationError } from 'types' import FolderValidator from './base/FolderValidator' +import _ from 'lodash' export default class NamespacesFolder extends FolderValidator { constructor (folder_path: string) { @@ -21,16 +22,28 @@ export default class NamespacesFolder extends FolderValidator { } validate_duplicate_paths (): ValidationError[] { - const paths: Record = {} + const paths: Record = {} for (const file of this.files) { if (file.spec().paths == null) continue Object.keys(file.spec().paths).sort().forEach((path) => { - if (paths[path] == null) paths[path] = [file.namespace] - else paths[path].push(file.namespace) + const normalized_path = path.replaceAll(/\{[^}]+}/g, '{}') + const path_entry = { + path, + namespace: file.namespace + } + if (paths[normalized_path] == null) { + paths[normalized_path] = [path_entry] + } else { + paths[normalized_path].push(path_entry) + } }) } - return Object.entries(paths).map(([path, namespaces]) => { - if (namespaces.length > 1) { return this.error(`Duplicate path '${path}' found in namespaces: ${namespaces.sort().join(', ')}.`) } + return Object.entries(paths).map(([_normalized_path, namespaces]) => { + if (namespaces.length > 1) { + const dup_paths = _.uniq(_.map(namespaces, (entry) => { return `'${entry.path}'` })) + const dup_namespaces = _.uniq(_.map(namespaces, (entry) => entry.namespace)) + return this.error(`Duplicate path${dup_paths.length > 1 ? 's' : ''} ${_.join(dup_paths, ', ')} found in namespace${dup_namespaces.length > 1 ? 's' : ''}: ${_.join(dup_namespaces, ', ')}.`) + } }).filter((e) => e) as ValidationError[] } } diff --git a/tools/tests/linter/NamespacesFolder.test.ts b/tools/tests/linter/NamespacesFolder.test.ts index 35b48babc..92f7dc94b 100644 --- a/tools/tests/linter/NamespacesFolder.test.ts +++ b/tools/tests/linter/NamespacesFolder.test.ts @@ -56,6 +56,16 @@ describe('validate()', () => { file: 'invalid_folder/', location: 'Folder', message: "Duplicate path '/{index}/_rollover' found in namespaces: dup_path_a, dup_path_b, dup_path_c." + }, + { + file: 'invalid_folder/', + location: 'Folder', + message: "Duplicate paths '/nodes/{metric}', '/nodes/{node_id}' found in namespace: dup_path_d." + }, + { + file: 'invalid_folder/', + location: 'Folder', + message: "Duplicate paths '/indices/{metric}', '/indices/{node_id}' found in namespaces: dup_path_namespace_a, dup_path_namespace_b." } ]) }) diff --git a/tools/tests/linter/fixtures/folder_validators/namespaces/invalid_folder/dup_path_d.yaml b/tools/tests/linter/fixtures/folder_validators/namespaces/invalid_folder/dup_path_d.yaml new file mode 100644 index 000000000..200678921 --- /dev/null +++ b/tools/tests/linter/fixtures/folder_validators/namespaces/invalid_folder/dup_path_d.yaml @@ -0,0 +1,3 @@ +paths: + '/nodes/{metric}': {} + '/nodes/{node_id}': {} diff --git a/tools/tests/linter/fixtures/folder_validators/namespaces/invalid_folder/dup_path_namespace_a.yaml b/tools/tests/linter/fixtures/folder_validators/namespaces/invalid_folder/dup_path_namespace_a.yaml new file mode 100644 index 000000000..88c1dc7c6 --- /dev/null +++ b/tools/tests/linter/fixtures/folder_validators/namespaces/invalid_folder/dup_path_namespace_a.yaml @@ -0,0 +1,6 @@ +openapi: 3.1.0 +info: + title: OpenSearch Indices API (Namespace 1) + version: 1.0.0 +paths: + '/indices/{metric}': {} diff --git a/tools/tests/linter/fixtures/folder_validators/namespaces/invalid_folder/dup_path_namespace_b.yaml b/tools/tests/linter/fixtures/folder_validators/namespaces/invalid_folder/dup_path_namespace_b.yaml new file mode 100644 index 000000000..6e8dcd79c --- /dev/null +++ b/tools/tests/linter/fixtures/folder_validators/namespaces/invalid_folder/dup_path_namespace_b.yaml @@ -0,0 +1,6 @@ +openapi: 3.1.0 +info: + title: OpenSearch Indices API (Namespace 2) + version: 1.0.0 +paths: + '/indices/{node_id}': {}