From 316757763cec208e9c3b1d23de3bacc6e28e2816 Mon Sep 17 00:00:00 2001 From: "Daniel (dB.) Doubrovkine" Date: Wed, 6 Nov 2024 08:37:53 -0500 Subject: [PATCH 01/20] Document the high level status and goals of this repo. (#655) Signed-off-by: dblock --- README.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7b05be832..ca512a1e3 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,8 @@ - [OpenSearch API Specification](#opensearch-api-specification) - [Welcome!](#welcome) + - [OpenSearch API Source of Truth](#opensearch-api-source-of-truth) + - [Working in this Repo](#working-in-this-repo) - [Project Resources](#project-resources) - [Code of Conduct](#code-of-conduct) - [Security](#security) @@ -18,10 +20,15 @@ ## Welcome! -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). +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 release of the API specification [here](https://github.com/opensearch-project/opensearch-api-specification/releases). -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. +### OpenSearch API Source of Truth + +This repo aims to be the complete source of truth for OpenSearch and OpenSearch Dashboards REST APIs, including plugins. To be the source of truth, this repo [accurately represents APIs in YAML](spec/), and [publishes](https://github.com/opensearch-project/opensearch-api-specification/releases) a single-file OpenAPI 3.1.0 spec. The latter is used to [generate OpenSearch language clients](https://github.com/opensearch-project/opensearch-clients/issues/19), [generate mechanical parts of the OpenSearch documentation](https://github.com/opensearch-project/documentation-website/issues/7700), and will be used to [generate the OpenSearch server API itself](https://github.com/opensearch-project/OpenSearch/issues/3090). + +### Working in this Repo + +Because of our legacy, the specification is produced by reading the [OpenSearch documentation](https://opensearch.org/docs/latest/) and reverse-engineering code. Thus, a good place to start contributing to this repo is to [identify a missing API and to add it](https://github.com/opensearch-project/opensearch-api-specification/issues/168) by following the [developer guide](DEVELOPER_GUIDE.md). This repo also contains a set of [test tools](TESTING_GUIDE.md) that ensure the correctness of this API and infrastructure that evaluates the gap between the OpenSearch server and this API spec by comparing REST routes registered in a running OpenSearch to the list of the APIs in this repo. You can see the latest API and test coverage numbers in the comments automatically added to any [recently merged pull requests](https://github.com/opensearch-project/opensearch-api-specification/pulls?q=is%3Apr+is%3Aclosed). ## Project Resources From 2a39edde31abf8ae885366a6abb6c7a48c481ba7 Mon Sep 17 00:00:00 2001 From: "Daniel (dB.) Doubrovkine" Date: Wed, 6 Nov 2024 18:28:23 -0500 Subject: [PATCH 02/20] Ensure correct OpenAPI 3.1.0 spec. (#646) * Added Python and Ruby spec validators. Signed-off-by: dblock * Add empty descriptions where missing and remove descriptions next to refs. Signed-off-by: dblock * Replaced the validator compatible with OpenAPI 3.1. Signed-off-by: dblock * Fixed incorrect style. Signed-off-by: dblock * Added missing require. Signed-off-by: dblock * Fix: schema null is not supported. Signed-off-by: dblock * Removed unused required property. Signed-off-by: dblock * Fix: added missing schema. Signed-off-by: dblock * Fix: removed incorrect defaults. Signed-off-by: dblock * Fix: added missing required. Signed-off-by: dblock * Fix: removed incorrect required. Signed-off-by: dblock * Removed incorrect externalDocs. Signed-off-by: dblock * Document the ruby spec validator. Signed-off-by: dblock * Fix: removed redundant content types. Signed-off-by: dblock * Improve displaying of errors. Signed-off-by: dblock * Normalize keys to be compatible with OpenAPI 3.1. Signed-off-by: dblock * Removed superseeded operations that have unresolved parameters. Signed-off-by: dblock * Fix: don't reduce error payload, allows to verify schema. Signed-off-by: dblock * Fix: flow framework schema tests. Signed-off-by: dblock * Fix: if no decision is made there's no weight ranking. Signed-off-by: dblock * Fix: wrap indexing errors. Signed-off-by: dblock * Added verbose logging of the story being evaluated. Signed-off-by: dblock * Fix: security API test error responses. Signed-off-by: dblock * Fix: duration ref. Signed-off-by: dblock * Fix typo in property. Signed-off-by: dblock * Fix superseeded operation parameters. Signed-off-by: dblock * Fix: neural search error response. Signed-off-by: dblock * Normalize fields. .replaceAll('::', '___') .replaceAll('@', '__') .replaceAll(':', '_') Signed-off-by: dblock * Re-added default values into the schema. Signed-off-by: dblock * Disallowed characters are replaced with ___. Signed-off-by: dblock --------- Signed-off-by: dblock --- .cspell | 2 + ...lidate-spec.yml => validate-spec-lint.yml} | 0 .github/workflows/validate-spec-py.yml | 34 ++ .github/workflows/validate-spec-ruby.yml | 30 ++ CHANGELOG.md | 12 + DEVELOPER_GUIDE.md | 30 +- spec/_global_parameters.yaml | 6 +- spec/_superseded_operations.yaml | 30 +- spec/namespaces/asynchronous_search.yaml | 2 + spec/namespaces/cat.yaml | 69 ++- spec/namespaces/flow_framework.yaml | 148 +++--- spec/namespaces/indices.yaml | 4 +- spec/namespaces/ism.yaml | 6 +- spec/namespaces/observability.yaml | 3 +- spec/namespaces/ppl.yaml | 3 - spec/namespaces/search_pipeline.yaml | 1 + spec/namespaces/security.yaml | 141 ++++-- spec/namespaces/sql.yaml | 9 - spec/schemas/cluster.allocation_explain.yaml | 1 - spec/schemas/flow_framework.common.yaml | 35 +- spec/schemas/flow_framework.errors.yaml | 216 ++++----- spec/schemas/indices._common.yaml | 7 + spec/schemas/insights._common.yaml | 2 +- spec/schemas/observability._common.yaml | 10 +- spec/schemas/query._common.yaml | 8 + spec/schemas/security._common.yaml | 16 + tests/default/flow_framework/template.yaml | 2 + tests/default/security/api/nodesdn.yaml | 65 --- .../ml/ingest/pipeline/neural_search.yaml | 17 - .../ml/ingest/pipeline/search_by_image.yaml | 26 + tools/src/linter/SchemasValidator.ts | 12 +- tools/src/merger/OpenApiMerger.ts | 55 +++ tools/src/tester/ChapterReader.ts | 5 +- tools/src/tester/TestRunner.ts | 6 +- tools/src/tester/test.ts | 2 +- tools/src/validate-spec-py/Pipfile | 12 + tools/src/validate-spec-py/Pipfile.lock | 455 ++++++++++++++++++ tools/src/validate-spec-py/validate.py | 20 + tools/src/validate-spec-ruby/Gemfile | 3 + tools/src/validate-spec-ruby/Gemfile.lock | 22 + tools/src/validate-spec-ruby/validate.rb | 20 + .../extractor/opensearch/expected_1.3.yaml | 61 +-- .../extractor/opensearch/expected_2.0.yaml | 71 +-- .../fixtures/merger/animals/expected.yaml | 76 +-- tools/tests/tester/ChapterReader.test.ts | 29 ++ tools/tests/tester/MergedOpenApiSpec.test.ts | 10 +- tools/tests/tester/helpers.ts | 2 +- 47 files changed, 1295 insertions(+), 501 deletions(-) rename .github/workflows/{validate-spec.yml => validate-spec-lint.yml} (100%) create mode 100644 .github/workflows/validate-spec-py.yml create mode 100644 .github/workflows/validate-spec-ruby.yml delete mode 100644 tests/default/security/api/nodesdn.yaml create mode 100644 tests/plugins/ml/ingest/pipeline/search_by_image.yaml create mode 100644 tools/src/validate-spec-py/Pipfile create mode 100644 tools/src/validate-spec-py/Pipfile.lock create mode 100644 tools/src/validate-spec-py/validate.py create mode 100644 tools/src/validate-spec-ruby/Gemfile create mode 100644 tools/src/validate-spec-ruby/Gemfile.lock create mode 100644 tools/src/validate-spec-ruby/validate.rb diff --git a/.cspell b/.cspell index 274d2da09..eb1d955ba 100644 --- a/.cspell +++ b/.cspell @@ -63,6 +63,7 @@ geotile gsub Gsub haasephonetik +hashcode heteroscedastic hnsw homoscedastic @@ -134,6 +135,7 @@ Oversample performanceanalyzer permissionsinfo pipefail +pipenv preconfigure preconfigured prefilter diff --git a/.github/workflows/validate-spec.yml b/.github/workflows/validate-spec-lint.yml similarity index 100% rename from .github/workflows/validate-spec.yml rename to .github/workflows/validate-spec-lint.yml diff --git a/.github/workflows/validate-spec-py.yml b/.github/workflows/validate-spec-py.yml new file mode 100644 index 000000000..9e33a5aaf --- /dev/null +++ b/.github/workflows/validate-spec-py.yml @@ -0,0 +1,34 @@ +name: Validate Spec (Python) + +on: [pull_request,push] + +jobs: + validate-spec-py: + runs-on: ubuntu-latest + steps: + - name: Checkout the repo + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: '20' + + - name: Build + run: npm ci && npm run merge + + - name: Set Up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Install Dependencies + working-directory: tools/src/validate-spec-py + run: | + pip install --user pipenv + pipenv install + + - name: Validate Spec + working-directory: tools/src/validate-spec-py + run: | + pipenv run python validate.py ../../../build/opensearch-openapi.yaml diff --git a/.github/workflows/validate-spec-ruby.yml b/.github/workflows/validate-spec-ruby.yml new file mode 100644 index 000000000..de0e1e200 --- /dev/null +++ b/.github/workflows/validate-spec-ruby.yml @@ -0,0 +1,30 @@ +name: Validate Spec (Ruby) + +on: [pull_request, push] + +jobs: + validate-spec-ruby: + runs-on: ubuntu-latest + env: + BUNDLE_GEMFILE: ${{ github.workspace }}/tools/src/validate-spec-ruby/Gemfile + steps: + - name: Checkout the repo + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: '20' + + - name: Build + run: npm ci && npm run merge + + - uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.3' + bundler-cache: true + + - name: Validate Spec + working-directory: tools/src/validate-spec-ruby + run: | + bundle exec ruby validate.rb ../../../build/opensearch-openapi.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md index 5bc71eaeb..811c2cb21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,10 +6,22 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ### Added - Added API specs for query groups lifecycle APIs ([#649](https://github.com/opensearch-project/opensearch-api-specification/pull/649)) +- Added Python and Ruby spec validators ([#646](https://github.com/opensearch-project/opensearch-api-specification/pull/646)) +- Added verbose output of the story being evaluated ([#646](https://github.com/opensearch-project/opensearch-api-specification/pull/646)) ### Removed - Removed unsupported `_common.mapping:SourceField`'s `mode` field and associated `_common.mapping:SourceFieldMode` enum ([#652](https://github.com/opensearch-project/opensearch-api-specification/pull/652)) +### Fixed +- Spec passes OpenAPI 3.1.0 validations ([#646](https://github.com/opensearch-project/opensearch-api-specification/pull/646)) +- Disallowed characters (`::`, `@`, and `:`) in key names are replaced with `___` on merge ([#646](https://github.com/opensearch-project/opensearch-api-specification/pull/646)) +- Added missing `required` to `path` parameters ([#646](https://github.com/opensearch-project/opensearch-api-specification/pull/646)) +- Added missing `schema` parent to response types ([#646](https://github.com/opensearch-project/opensearch-api-specification/pull/646)) +- Removed invalid `externalDocs` from `flow_framework.create/update::query.use_case` ([#646](https://github.com/opensearch-project/opensearch-api-specification/pull/646)) +- Fixed incorrect `style` in `indices.get_mapping::query.index` ([#646](https://github.com/opensearch-project/opensearch-api-specification/pull/646)) +- Removed invalid `required` from `ppl` responses ([#646](https://github.com/opensearch-project/opensearch-api-specification/pull/646)) +- Added schema for security API error responses ([#646](https://github.com/opensearch-project/opensearch-api-specification/pull/646)) + ## [0.1.0] - 2024-10-25 ### Added diff --git a/DEVELOPER_GUIDE.md b/DEVELOPER_GUIDE.md index b46319eb6..7ff326560 100644 --- a/DEVELOPER_GUIDE.md +++ b/DEVELOPER_GUIDE.md @@ -26,7 +26,9 @@ - [Comment on PR](#comment-on-pr) - [Test Tools (Unit)](#test-tools-unit) - [Test Tools (Integration)](#test-tools-integration) - - [Validate Spec](#validate-spec) + - [Validate Spec (Lint)](#validate-spec-lint) + - [Validate Spec (Python)](#validate-spec-python) + - [Validate Spec (Ruby)](#validate-spec-ruby) # Developer Guide @@ -375,6 +377,30 @@ This workflow runs on PRs to invoke the [tools' unit tests](tools/tests), upload This workflow runs on PRs to invoke the [tools' integration tests](tools/tests) that require a running instance of OpenSearch to ensure there are no breakages in behavior. -### [Validate Spec](.github/workflows/validate-spec.yml) +### [Validate Spec (Lint)](.github/workflows/validate-spec-lint.yml) This workflow runs on PRs to invoke the [spec linter](#spec-linter) and ensure the multi-file spec is correct and follows the design guidelines. + +### [Validate Spec (Python)](.github/workflows/validate-spec-py.yml) + +This workflow runs on PRs to invoke the [Python openapi-spec-validator](https://pypi.org/project/openapi-spec-validator/) to ensure that the resulting spec can be loaded by Python tools. + +You can run the validator locally as follows after installing [pipenv](https://pipenv.pypa.io/en/latest/installation.html). + +``` +cd tools/src/validate-spec-py +pipenv install +npm run merge ; pipenv run python validate.py ../../../build/opensearch-openapi.yaml +``` + +### [Validate Spec (Ruby)](.github/workflows/validate-spec-ruby.yml) + +This workflow runs on PRs to invoke the Ruby [Json Schemer](https://github.com/davishmcclurg/json_schemer/) to ensure that the resulting spec can be loaded by Ruby tools. + +You can run the validator locally as follows. + +``` +cd tools/src/validate-spec-ruby +bundle install +npm run merge ; bundle exec ruby validate.rb ../../../build/opensearch-openapi.yaml +``` diff --git a/spec/_global_parameters.yaml b/spec/_global_parameters.yaml index 91ddbfe8f..160d1d241 100644 --- a/spec/_global_parameters.yaml +++ b/spec/_global_parameters.yaml @@ -10,21 +10,21 @@ components: description: Whether to pretty format the returned JSON response. schema: type: boolean - default: false + default: false human: name: human in: query description: Whether to return human readable values for statistics. schema: type: boolean - default: true + default: true error_trace: name: error_trace in: query description: Whether to include the stack trace of returned errors. schema: type: boolean - default: false + default: false source: name: source in: query diff --git a/spec/_superseded_operations.yaml b/spec/_superseded_operations.yaml index 80e556067..fbc54730f 100644 --- a/spec/_superseded_operations.yaml +++ b/spec/_superseded_operations.yaml @@ -201,7 +201,7 @@ $schema: ./json_schemas/_superseded_operations.schema.yaml - GET - PUT /_opendistro/_ism/policies/{policyID}: - superseded_by: /_plugins/_ism/policies/{policyID} + superseded_by: /_plugins/_ism/policies/{policy_id} operations: - GET - HEAD @@ -240,7 +240,7 @@ $schema: ./json_schemas/_superseded_operations.schema.yaml operations: - GET /_opendistro/_knn/{nodeId}/stats/{stat}: - superseded_by: /_plugins/_knn/{nodeId}/stats/{stat} + superseded_by: /_plugins/_knn/{node_id}/stats/{stat} operations: - GET /_opendistro/_performanceanalyzer/_agent/{redirectEndpoint}: @@ -354,22 +354,22 @@ $schema: ./json_schemas/_superseded_operations.schema.yaml - GET - PUT /_opendistro/_rollup/jobs/{rollupID}: - superseded_by: /_plugins/_rollup/jobs/{rollupID} + superseded_by: /_plugins/_rollup/jobs/{id} operations: - GET - HEAD - PUT - DELETE /_opendistro/_rollup/jobs/{rollupID}/_explain: - superseded_by: /_plugins/_rollup/jobs/{rollupID}/_explain + superseded_by: /_plugins/_rollup/jobs/{id}/_explain operations: - GET /_opendistro/_rollup/jobs/{rollupID}/_start: - superseded_by: /_plugins/_rollup/jobs/{rollupID}/_start + superseded_by: /_plugins/_rollup/jobs/{id}/_start operations: - POST /_opendistro/_rollup/jobs/{rollupID}/_stop: - superseded_by: /_plugins/_rollup/jobs/{rollupID}/_stop + superseded_by: /_plugins/_rollup/jobs/{id}/_stop operations: - POST /_opendistro/_security/api/_upgrade_check/: @@ -401,7 +401,7 @@ $schema: ./json_schemas/_superseded_operations.schema.yaml - GET - PATCH /_opendistro/_security/api/actiongroups/{name}: - superseded_by: /_plugins/_security/api/actiongroups/{name} + superseded_by: /_plugins/_security/api/actiongroups/{action_group} operations: - GET - PUT @@ -433,14 +433,14 @@ $schema: ./json_schemas/_superseded_operations.schema.yaml - GET - PATCH /_opendistro/_security/api/internalusers/{name}: - superseded_by: /_plugins/_security/api/internalusers/{name} + superseded_by: /_plugins/_security/api/internalusers/{username} operations: - GET - PUT - PATCH - DELETE /_opendistro/_security/api/internalusers/{name}/authtoken: - superseded_by: /_plugins/_security/api/internalusers/{name}/authtoken + superseded_by: /_plugins/_security/api/internalusers/{username}/authtoken operations: - POST /_opendistro/_security/api/migrate: @@ -457,7 +457,7 @@ $schema: ./json_schemas/_superseded_operations.schema.yaml - GET - PATCH /_opendistro/_security/api/roles/{name}: - superseded_by: /_plugins/_security/api/roles/{name} + superseded_by: /_plugins/_security/api/roles/{role} operations: - GET - PUT @@ -469,7 +469,7 @@ $schema: ./json_schemas/_superseded_operations.schema.yaml - GET - PATCH /_opendistro/_security/api/rolesmapping/{name}: - superseded_by: /_plugins/_security/api/rolesmapping/{name} + superseded_by: /_plugins/_security/api/rolesmapping/{role} operations: - GET - PUT @@ -519,7 +519,7 @@ $schema: ./json_schemas/_superseded_operations.schema.yaml - GET - PATCH /_opendistro/_security/api/tenants/{name}: - superseded_by: /_plugins/_security/api/tenants/{name} + superseded_by: /_plugins/_security/api/tenants/{tenant} operations: - GET - PUT @@ -529,14 +529,14 @@ $schema: ./json_schemas/_superseded_operations.schema.yaml superseded_by: /_plugins/_security/api/user operations: - GET -/_opendistro/_security/api/user/{name}: - superseded_by: /_plugins/_security/api/user/{name} +/_opendistro/_security/api/user/{username}: + superseded_by: /_plugins/_security/api/user/{username} operations: - GET - PUT - DELETE /_opendistro/_security/api/user/{name}/authtoken: - superseded_by: /_plugins/_security/api/user/{name}/authtoken + superseded_by: /_plugins/_security/api/user/{username}/authtoken operations: - POST /_opendistro/_security/api/validate: diff --git a/spec/namespaces/asynchronous_search.yaml b/spec/namespaces/asynchronous_search.yaml index 863cd33d6..9153257a9 100644 --- a/spec/namespaces/asynchronous_search.yaml +++ b/spec/namespaces/asynchronous_search.yaml @@ -90,11 +90,13 @@ components: in: path schema: type: string + required: true asynchronous_search.delete::path.id: name: id in: path schema: type: string + required: true requestBodies: asynchronous_search.search: content: diff --git a/spec/namespaces/cat.yaml b/spec/namespaces/cat.yaml index 9e6f27684..c89368e5b 100644 --- a/spec/namespaces/cat.yaml +++ b/spec/namespaces/cat.yaml @@ -792,7 +792,8 @@ components: cat.aliases@200: content: text/plain: - type: string + schema: + type: string application/json: schema: type: array @@ -801,7 +802,8 @@ components: cat.all_pit_segments@200: content: text/plain: - type: string + schema: + type: string application/json: schema: type: array @@ -810,7 +812,8 @@ components: cat.allocation@200: content: text/plain: - type: string + schema: + type: string application/json: schema: type: array @@ -819,7 +822,8 @@ components: cat.cluster_manager@200: content: text/plain: - type: string + schema: + type: string application/json: schema: type: array @@ -828,7 +832,8 @@ components: cat.count@200: content: text/plain: - type: string + schema: + type: string application/json: schema: type: array @@ -837,7 +842,8 @@ components: cat.fielddata@200: content: text/plain: - type: string + schema: + type: string application/json: schema: type: array @@ -846,7 +852,8 @@ components: cat.health@200: content: text/plain: - type: string + schema: + type: string application/json: schema: type: array @@ -875,7 +882,8 @@ components: cat.indices@200: content: text/plain: - type: string + schema: + type: string application/json: schema: type: array @@ -899,7 +907,8 @@ components: cat.master@200: content: text/plain: - type: string + schema: + type: string application/json: schema: type: array @@ -908,7 +917,8 @@ components: cat.nodeattrs@200: content: text/plain: - type: string + schema: + type: string application/json: schema: type: array @@ -917,7 +927,8 @@ components: cat.nodes@200: content: text/plain: - type: string + schema: + type: string application/json: schema: type: array @@ -926,7 +937,8 @@ components: cat.pending_tasks@200: content: text/plain: - type: string + schema: + type: string application/json: schema: type: array @@ -935,7 +947,8 @@ components: cat.pit_segments@200: content: text/plain: - type: string + schema: + type: string application/json: schema: type: array @@ -944,7 +957,8 @@ components: cat.plugins@200: content: text/plain: - type: string + schema: + type: string application/json: schema: type: array @@ -953,7 +967,8 @@ components: cat.recovery@200: content: text/plain: - type: string + schema: + type: string application/json: schema: type: array @@ -962,7 +977,8 @@ components: cat.repositories@200: content: text/plain: - type: string + schema: + type: string application/json: schema: type: array @@ -971,7 +987,8 @@ components: cat.segment_replication@200: content: text/plain: - type: string + schema: + type: string application/json: schema: type: array @@ -980,7 +997,8 @@ components: cat.segments@200: content: text/plain: - type: string + schema: + type: string application/json: schema: type: array @@ -989,7 +1007,8 @@ components: cat.shards@200: content: text/plain: - type: string + schema: + type: string application/json: schema: type: array @@ -998,7 +1017,8 @@ components: cat.snapshots@200: content: text/plain: - type: string + schema: + type: string application/json: schema: type: array @@ -1007,7 +1027,8 @@ components: cat.tasks@200: content: text/plain: - type: string + schema: + type: string application/json: schema: type: array @@ -1016,7 +1037,8 @@ components: cat.templates@200: content: text/plain: - type: string + schema: + type: string application/json: schema: type: array @@ -1025,7 +1047,8 @@ components: cat.thread_pool@200: content: text/plain: - type: string + schema: + type: string application/json: schema: type: array diff --git a/spec/namespaces/flow_framework.yaml b/spec/namespaces/flow_framework.yaml index feed463e6..7d3616220 100644 --- a/spec/namespaces/flow_framework.yaml +++ b/spec/namespaces/flow_framework.yaml @@ -302,8 +302,6 @@ components: $ref: '../schemas/flow_framework.common.yaml#/components/schemas/Reprovision' flow_framework.create::query.use_case: description: To use a workflow template, specify it in the use_case query parameter when creating a workflow. - externalDocs: - url: https://opensearch.org/docs/latest/automating-configurations/workflow-templates/#supported-workflow-templates in: query name: use_case schema: @@ -316,8 +314,6 @@ components: $ref: '../schemas/flow_framework.common.yaml#/components/schemas/All' flow_framework.update::query.use_case: description: To use a workflow template, specify it in the use_case query parameter when creating a workflow. - externalDocs: - url: https://opensearch.org/docs/latest/automating-configurations/workflow-templates/#supported-workflow-templates in: query name: use_case schema: @@ -400,36 +396,39 @@ components: flow_framework.create@403: content: application/json: - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/FlowFrameworkAPIDisabledError' + schema: + $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/FlowFrameworkAPIDisabledError' flow_framework.create@400: description: Bad Request - Multiple possible reasons content: application/json: - oneOf: - - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/InvalidParameterError' - - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/ConflictError' - - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/MissingParameterError' - - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/ParameterConflictError' - - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/MaxWorkflowsLimitError' - - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/WorkflowSaveError' - - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/WorkflowParsingError' - - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/UnsupportedFieldUpdateError' - - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/InvalidTemplateVersionError' - - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/TemplateNameRequiredError' + schema: + anyOf: + - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/InvalidParameterError' + - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/ConflictError' + - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/MissingParameterError' + - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/ParameterConflictError' + - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/MaxWorkflowsLimitError' + - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/WorkflowSaveError' + - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/WorkflowParsingError' + - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/UnsupportedFieldUpdateError' + - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/InvalidTemplateVersionError' + - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/TemplateNameRequiredError' flow_framework.update@400: description: Bad Request - Multiple possible reasons content: application/json: - oneOf: - - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/InvalidParameterError' - - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/ConflictError' - - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/MissingParameterError' - - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/ParameterConflictError' - - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/MaxWorkflowsLimitError' - - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/WorkflowSaveError' - - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/InvalidTemplateVersionError' - - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/UnsupportedFieldUpdateError' - - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/WorkflowParsingError' + schema: + anyOf: + - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/InvalidParameterError' + - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/ConflictError' + - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/MissingParameterError' + - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/ParameterConflictError' + - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/MaxWorkflowsLimitError' + - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/WorkflowSaveError' + - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/InvalidTemplateVersionError' + - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/UnsupportedFieldUpdateError' + - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/WorkflowParsingError' flow_framework.update@201: content: application/json: @@ -444,121 +443,148 @@ components: flow_framework.delete@200: content: application/json: - $ref: '../schemas/flow_framework.common.yaml#/components/schemas/FlowFrameworkDeleteResponse' + schema: + $ref: '../schemas/flow_framework.common.yaml#/components/schemas/FlowFrameworkDeleteResponse' flow_framework.get@200: content: application/json: - $ref: '../schemas/flow_framework.common.yaml#/components/schemas/FlowFrameworkGetResponse' + schema: + $ref: '../schemas/flow_framework.common.yaml#/components/schemas/FlowFrameworkGetResponse' flow_framework.update@404: description: Template Not Found Error content: application/json: - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/TemplateNotFoundError' + schema: + $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/TemplateNotFoundError' flow_framework.delete@400: description: Work Flow Id Null Error content: application/json: - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/WorkFlowIdNullError' + schema: + $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/WorkFlowIdNullError' flow_framework.delete@403: description: Flow Framework API Disabled Error content: application/json: - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/FlowFrameworkAPIDisabledError' + schema: + $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/FlowFrameworkAPIDisabledError' flow_framework.get@404: description: Template Not Found Error content: application/json: - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/TemplateNotFoundError' + schema: + $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/TemplateNotFoundError' flow_framework.get_steps@200: content: application/json: - $ref: '../schemas/flow_framework.common.yaml#/components/schemas/WorkflowStep' + schema: + $ref: '../schemas/flow_framework.common.yaml#/components/schemas/WorkflowSteps' flow_framework.get_steps@403: description: Flow Framework API Disabled Error content: application/json: - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/FlowFrameworkAPIDisabledError' + schema: + $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/FlowFrameworkAPIDisabledError' flow_framework.get_steps@400: content: application/json: - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/WorkflowStepsRetrieveError' + schema: + $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/WorkflowStepsRetrieveError' flow_framework.get_status@403: content: application/json: - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/FlowFrameworkAPIDisabledError' + schema: + $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/FlowFrameworkAPIDisabledError' flow_framework.get_status@404: content: application/json: - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/TemplateNotFoundError' + schema: + $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/TemplateNotFoundError' flow_framework.get_status@200: content: application/json: - oneOf: - - $ref: '../schemas/flow_framework.common.yaml#/components/schemas/WorkFlowStatusFullResponse' - - $ref: '../schemas/flow_framework.common.yaml#/components/schemas/WorkFlowStatusDefaultResponse' + schema: + anyOf: + - $ref: '../schemas/flow_framework.common.yaml#/components/schemas/WorkFlowStatusFullResponse' + - $ref: '../schemas/flow_framework.common.yaml#/components/schemas/WorkFlowStatusDefaultResponse' flow_framework.deprovision@200: content: application/json: - $ref: '../schemas/flow_framework.common.yaml#/components/schemas/WorkflowID' + schema: + $ref: '../schemas/flow_framework.common.yaml#/components/schemas/WorkflowIDResponse' flow_framework.provision@200: content: application/json: - $ref: '../schemas/flow_framework.common.yaml#/components/schemas/WorkflowID' + schema: + $ref: '../schemas/flow_framework.common.yaml#/components/schemas/WorkflowIDResponse' flow_framework.deprovision@202: content: application/json: - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/DeprovisioningError' + schema: + $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/DeprovisioningError' flow_framework.deprovision@403: content: application/json: - oneOf: - - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/FlowFrameworkAPIDisabledError' - - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/DeprovisioningForbiddenError' + schema: + oneOf: + - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/FlowFrameworkAPIDisabledError' + - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/DeprovisioningForbiddenError' flow_framework.deprovision@404: content: application/json: - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/TemplateNotFoundError' + schema: + $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/TemplateNotFoundError' flow_framework.provision@403: content: application/json: - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/FlowFrameworkAPIDisabledError' + schema: + $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/FlowFrameworkAPIDisabledError' flow_framework.provision@400: content: application/json: - oneOf: - - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/WorkFlowIdNullError' - - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/RequestBodyParsingFailedError' - - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/InvalidRequestBodyFieldError' - - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/DuplicateKeyError' + schema: + oneOf: + - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/WorkFlowIdNullError' + - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/RequestBodyParsingFailedError' + - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/InvalidRequestBodyFieldError' + - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/DuplicateKeyError' flow_framework.search@200: content: application/json: - $ref: '../schemas/flow_framework.common.yaml#/components/schemas/WorkflowSearchResponse' + schema: + $ref: '../schemas/flow_framework.common.yaml#/components/schemas/WorkflowSearchResponse' flow_framework.search@403: content: application/json: - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/FlowFrameworkAPIDisabledError' + schema: + $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/FlowFrameworkAPIDisabledError' flow_framework.search@408: content: application/json: - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/RequestTimeoutError' + schema: + $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/RequestTimeoutError' flow_framework.search@400: content: application/json: - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/BadRequestError' + schema: + $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/BadRequestError' flow_framework.search_state@200: content: application/json: - $ref: '../schemas/flow_framework.common.yaml#/components/schemas/WorkflowSearchStateResponse' + schema: + $ref: '../schemas/flow_framework.common.yaml#/components/schemas/WorkflowSearchStateResponse' flow_framework.search_state@403: content: application/json: - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/FlowFrameworkAPIDisabledError' + schema: + $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/FlowFrameworkAPIDisabledError' flow_framework.search_state@408: content: application/json: - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/RequestTimeoutError' + schema: + $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/RequestTimeoutError' flow_framework.search_state@400: content: application/json: - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/BadRequestError' \ No newline at end of file + schema: + $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/BadRequestError' \ No newline at end of file diff --git a/spec/namespaces/indices.yaml b/spec/namespaces/indices.yaml index cbe075a6d..fcf676adf 100644 --- a/spec/namespaces/indices.yaml +++ b/spec/namespaces/indices.yaml @@ -2404,7 +2404,7 @@ components: content: application/json: schema: - $ref: '../schemas/indices._common.yaml#/components/schemas/IndexErrorCause' + $ref: '../schemas/indices._common.yaml#/components/schemas/IndexError' indices.delete_alias@200: content: application/json: @@ -3965,7 +3965,7 @@ components: To target all data streams and indices, omit this parameter or use `*` or `_all`. schema: $ref: '../schemas/_common.yaml#/components/schemas/Indices' - style: simple + style: form indices.get_mapping::query.local: in: query name: local diff --git a/spec/namespaces/ism.yaml b/spec/namespaces/ism.yaml index 334bc69f7..9e91d84c7 100644 --- a/spec/namespaces/ism.yaml +++ b/spec/namespaces/ism.yaml @@ -178,7 +178,7 @@ paths: '200': $ref: '#/components/responses/ism.explain_policy@200' post: - operationId: ism.explain_policy.0 + operationId: ism.explain_policy.1 x-operation-group: ism.explain_policy description: Gets the currently applied policy on indices. externalDocs: @@ -190,7 +190,7 @@ paths: $ref: '#/components/responses/ism.explain_policy@200' /_plugins/_ism/explain/{index}: get: - operationId: ism.explain_policy.1 + operationId: ism.explain_policy.3 x-operation-group: ism.explain_policy description: Gets the currently applied policy on indices. externalDocs: @@ -203,7 +203,7 @@ paths: '200': $ref: '#/components/responses/ism.explain_policy@200' post: - operationId: ism.explain_policy.1 + operationId: ism.explain_policy.4 x-operation-group: ism.explain_policy description: Gets the currently applied policy on indices. externalDocs: diff --git a/spec/namespaces/observability.yaml b/spec/namespaces/observability.yaml index a8553dbe1..62cca3dfd 100644 --- a/spec/namespaces/observability.yaml +++ b/spec/namespaces/observability.yaml @@ -150,7 +150,6 @@ components: type: object additionalProperties: type: string - example: OK observability.delete_object@404: description: Not Found content: @@ -168,7 +167,7 @@ components: type: object additionalProperties: type: string - example: OK + # example: OK observability.delete_objects@404: description: Not Found content: diff --git a/spec/namespaces/ppl.yaml b/spec/namespaces/ppl.yaml index 0794fd32d..02ef9e2bb 100644 --- a/spec/namespaces/ppl.yaml +++ b/spec/namespaces/ppl.yaml @@ -150,16 +150,13 @@ components: application/json: schema: $ref: '../schemas/sql._common.yaml#/components/schemas/ExplainResponse' - required: true ppl.get_stats@200: content: text/plain: schema: type: string - required: true ppl.post_stats@200: content: text/plain: schema: type: string - required: true \ No newline at end of file diff --git a/spec/namespaces/search_pipeline.yaml b/spec/namespaces/search_pipeline.yaml index 05d16fbdd..a2b5bd5fd 100644 --- a/spec/namespaces/search_pipeline.yaml +++ b/spec/namespaces/search_pipeline.yaml @@ -106,6 +106,7 @@ components: description: Comma-separated list of search pipeline ids. Wildcards supported. schema: type: string + required: true search_pipeline.get::query.cluster_manager_timeout: name: cluster_manager_timeout in: query diff --git a/spec/namespaces/security.yaml b/spec/namespaces/security.yaml index 5900516f5..77dc0c6f6 100644 --- a/spec/namespaces/security.yaml +++ b/spec/namespaces/security.yaml @@ -1558,7 +1558,8 @@ components: security.cache@501: content: application/json: - schema: null + schema: + $ref: '../schemas/security._common.yaml#/components/schemas/Error' security.change_password@200: content: application/json: @@ -1567,7 +1568,8 @@ components: security.change_password@403: content: application/json: - schema: null + schema: + $ref: '../schemas/security._common.yaml#/components/schemas/Error' security.config_upgrade_check@200: content: application/json: @@ -1581,7 +1583,8 @@ components: security.config_upgrade_perform@400: content: application/json: - schema: null + schema: + $ref: '../schemas/security._common.yaml#/components/schemas/Error' security.create_action_group@200: content: application/json: @@ -1600,7 +1603,8 @@ components: security.create_allowlist@403: content: application/json: - schema: null + schema: + $ref: '../schemas/security._common.yaml#/components/schemas/Error' security.create_role@200: content: application/json: @@ -1634,7 +1638,8 @@ components: security.create_tenant@400: content: application/json: - schema: null + schema: + $ref: '../schemas/security._common.yaml#/components/schemas/Error' security.create_update_tenancy_config@200: content: application/json: @@ -1643,7 +1648,8 @@ components: security.create_update_tenancy_config@400: content: application/json: - schema: null + schema: + $ref: '../schemas/security._common.yaml#/components/schemas/Error' security.create_user@200: content: application/json: @@ -1672,11 +1678,13 @@ components: security.delete_distinguished_name@400: content: application/json: - schema: null + schema: + $ref: '../schemas/security._common.yaml#/components/schemas/Error' security.delete_distinguished_name@403: content: application/json: - schema: null + schema: + $ref: '../schemas/security._common.yaml#/components/schemas/Error' security.delete_role@200: content: application/json: @@ -1695,7 +1703,8 @@ components: security.delete_tenant@400: content: application/json: - schema: null + schema: + $ref: '../schemas/security._common.yaml#/components/schemas/Error' security.delete_user@200: content: application/json: @@ -1719,9 +1728,11 @@ components: security.generate_obo_token@400: content: text/plain: - type: string + schema: + type: string application/json: - schema: null + schema: + $ref: '../schemas/security._common.yaml#/components/schemas/Error' security.generate_user_token@200: content: application/json: @@ -1730,11 +1741,13 @@ components: security.generate_user_token@400: content: application/json: - schema: null + schema: + $ref: '../schemas/security._common.yaml#/components/schemas/Error' security.generate_user_token_legacy@501: content: application/json: - schema: null + schema: + $ref: '../schemas/security._common.yaml#/components/schemas/Error' security.get_account_details@200: content: application/json: @@ -1758,7 +1771,8 @@ components: security.get_allowlist@403: content: application/json: - schema: null + schema: + $ref: '../schemas/security._common.yaml#/components/schemas/Error' security.get_audit_configuration@200: content: application/json: @@ -1777,7 +1791,8 @@ components: security.get_all_certificates@403: content: application/json: - schema: null + schema: + $ref: '../schemas/security._common.yaml#/components/schemas/Error' security.get_all_certificates@500: content: application/json: @@ -1791,15 +1806,18 @@ components: security.get_node_certificates@403: content: application/json: - schema: null + schema: + $ref: '../schemas/security._common.yaml#/components/schemas/Error' security.get_certificates@400: content: application/json: - schema: null + schema: + $ref: '../schemas/security._common.yaml#/components/schemas/Error' security.get_certificates@403: content: application/json: - schema: null + schema: + $ref: '../schemas/security._common.yaml#/components/schemas/Error' security.get_node_certificates@500: content: application/json: @@ -1829,11 +1847,13 @@ components: security.get_distinguished_name@400: content: application/json: - schema: null + schema: + $ref: '../schemas/security._common.yaml#/components/schemas/Error' security.get_distinguished_name@403: content: application/json: - schema: null + schema: + $ref: '../schemas/security._common.yaml#/components/schemas/Error' security.get_distinguished_names@200: content: application/json: @@ -1843,11 +1863,13 @@ components: description: Show nodesDn setting for given cluster. content: application/json: - schema: null + schema: + $ref: '../schemas/security._common.yaml#/components/schemas/Error' security.get_distinguished_names@403: content: application/json: - schema: null + schema: + $ref: '../schemas/security._common.yaml#/components/schemas/Error' security.get_permissions_info@200: content: application/json: @@ -1901,7 +1923,8 @@ components: security.get_tenancy_config@400: content: application/json: - schema: null + schema: + $ref: '../schemas/security._common.yaml#/components/schemas/Error' security.get_tenants@200: content: application/json: @@ -1910,7 +1933,8 @@ components: security.get_tenants@400: content: application/json: - schema: null + schema: + $ref: '../schemas/security._common.yaml#/components/schemas/Error' security.get_user@200: content: application/json: @@ -1944,7 +1968,8 @@ components: security.migrate@400: content: application/json: - schema: null + schema: + $ref: '../schemas/security._common.yaml#/components/schemas/Error' security.patch_action_group@200: content: application/json: @@ -1963,7 +1988,8 @@ components: security.patch_allowlist@403: content: application/json: - schema: null + schema: + $ref: '../schemas/security._common.yaml#/components/schemas/Error' security.patch_audit_configuration@200: content: application/json: @@ -1977,7 +2003,8 @@ components: security.patch_configuration@403: content: application/json: - schema: null + schema: + $ref: '../schemas/security._common.yaml#/components/schemas/Error' security.patch_distinguished_name@200: content: application/json: @@ -1986,11 +2013,13 @@ components: security.patch_distinguished_name@400: content: application/json: - schema: null + schema: + $ref: '../schemas/security._common.yaml#/components/schemas/Error' security.patch_distinguished_name@403: content: application/json: - schema: null + schema: + $ref: '../schemas/security._common.yaml#/components/schemas/Error' security.patch_distinguished_names@200: content: application/json: @@ -1999,11 +2028,13 @@ components: security.patch_distinguished_names@400: content: application/json: - schema: null + schema: + $ref: '../schemas/security._common.yaml#/components/schemas/Error' security.patch_distinguished_names@403: content: application/json: - schema: null + schema: + $ref: '../schemas/security._common.yaml#/components/schemas/Error' security.patch_role@200: content: application/json: @@ -2012,7 +2043,8 @@ components: security.patch_role@400: content: application/json: - schema: null + schema: + $ref: '../schemas/security._common.yaml#/components/schemas/Error' security.patch_role_mapping@200: content: application/json: @@ -2021,7 +2053,8 @@ components: security.patch_role_mapping@400: content: application/json: - schema: null + schema: + $ref: '../schemas/security._common.yaml#/components/schemas/Error' security.patch_role_mappings@200: content: application/json: @@ -2030,7 +2063,8 @@ components: security.patch_role_mappings@400: content: application/json: - schema: null + schema: + $ref: '../schemas/security._common.yaml#/components/schemas/Error' security.patch_roles@200: content: application/json: @@ -2039,7 +2073,8 @@ components: security.patch_roles@400: content: application/json: - schema: null + schema: + $ref: '../schemas/security._common.yaml#/components/schemas/Error' security.patch_tenant@200: content: application/json: @@ -2048,7 +2083,8 @@ components: security.patch_tenant@400: content: application/json: - schema: null + schema: + $ref: '../schemas/security._common.yaml#/components/schemas/Error' security.patch_tenants@200: content: application/json: @@ -2057,7 +2093,8 @@ components: security.patch_tenants@400: content: application/json: - schema: null + schema: + $ref: '../schemas/security._common.yaml#/components/schemas/Error' security.patch_user@200: content: application/json: @@ -2086,11 +2123,13 @@ components: security.reload_http_certificates@400: content: application/json: - schema: null + schema: + $ref: '../schemas/security._common.yaml#/components/schemas/Error' security.reload_http_certificates@403: content: application/json: - schema: null + schema: + $ref: '../schemas/security._common.yaml#/components/schemas/Error' security.reload_transport_certificates@200: content: application/json: @@ -2099,11 +2138,13 @@ components: security.reload_transport_certificates@400: content: application/json: - schema: null + schema: + $ref: '../schemas/security._common.yaml#/components/schemas/Error' security.reload_transport_certificates@403: content: application/json: - schema: null + schema: + $ref: '../schemas/security._common.yaml#/components/schemas/Error' security.tenant_info@200: content: application/json: @@ -2112,9 +2153,11 @@ components: security.tenant_info@403: content: text/plain: - type: string + schema: + type: string application/json: - schema: null + schema: + $ref: '../schemas/security._common.yaml#/components/schemas/Error' security.tenant_info@500: content: application/json: @@ -2133,7 +2176,8 @@ components: security.update_configuration@403: content: application/json: - schema: null + schema: + $ref: '../schemas/security._common.yaml#/components/schemas/Error' security.update_distinguished_name@200: content: application/json: @@ -2142,11 +2186,13 @@ components: security.update_distinguished_name@400: content: application/json: - schema: null + schema: + $ref: '../schemas/security._common.yaml#/components/schemas/Error' security.update_distinguished_name@403: content: application/json: - schema: null + schema: + $ref: '../schemas/security._common.yaml#/components/schemas/Error' security.validate@200: content: application/json: @@ -2155,7 +2201,8 @@ components: security.validate@400: content: application/json: - schema: null + schema: + $ref: '../schemas/security._common.yaml#/components/schemas/Error' security.who_am_i@200: content: application/json: diff --git a/spec/namespaces/sql.yaml b/spec/namespaces/sql.yaml index a54c6cc39..053ebead0 100644 --- a/spec/namespaces/sql.yaml +++ b/spec/namespaces/sql.yaml @@ -177,31 +177,26 @@ components: anyOf: - $ref: '../schemas/sql._common.yaml#/components/schemas/SqlSettingsPlain' - $ref: '../schemas/sql._common.yaml#/components/schemas/SqlSettings' - required: true sql.query: content: application/json: schema: $ref: '../schemas/sql._common.yaml#/components/schemas/Query' - required: true sql.explain: content: application/json: schema: $ref: '../schemas/sql._common.yaml#/components/schemas/Explain' - required: true sql.close: content: application/json: schema: $ref: '../schemas/sql._common.yaml#/components/schemas/SqlClose' - required: true sql.post_stats: content: application/json: schema: $ref: '../schemas/sql._common.yaml#/components/schemas/Stats' - required: true responses: sql.settings@200: content: @@ -218,22 +213,18 @@ components: application/json: schema: $ref: '../schemas/sql._common.yaml#/components/schemas/ExplainResponse' - required: true sql.close@200: content: application/json: schema: $ref: '../schemas/sql._common.yaml#/components/schemas/SqlCloseResponse' - required: true sql.get_stats@200: content: text/plain: schema: type: string - required: true sql.post_stats@200: content: text/plain: schema: type: string - required: true \ No newline at end of file diff --git a/spec/schemas/cluster.allocation_explain.yaml b/spec/schemas/cluster.allocation_explain.yaml index f7141a328..97b36f6ef 100644 --- a/spec/schemas/cluster.allocation_explain.yaml +++ b/spec/schemas/cluster.allocation_explain.yaml @@ -177,7 +177,6 @@ components: - node_id - node_name - transport_address - - weight_ranking AllocationStore: type: object properties: diff --git a/spec/schemas/flow_framework.common.yaml b/spec/schemas/flow_framework.common.yaml index d3ab4ae9b..2c3678921 100644 --- a/spec/schemas/flow_framework.common.yaml +++ b/spec/schemas/flow_framework.common.yaml @@ -11,6 +11,12 @@ components: type: string WorkflowID: type: string + WorkflowIDResponse: + type: object + properties: + workflow_id: + type: string + description: The ID of the workflow WorkflowStepName: type: string Provision: @@ -99,6 +105,8 @@ components: properties: name: type: string + version: + $ref: '#/components/schemas/version' description: type: string use_case: @@ -111,6 +119,8 @@ components: type: integer last_updated_time: type: integer + last_provisioned_time: + type: number version: type: object description: A key-value map with two fields, template, which identifies the template version, and compatibility, which identifies a list of minimum required OpenSearch versions. @@ -135,6 +145,9 @@ components: failed: type: integer description: The number of shards where the deletion failed. + skipped: + type: integer + description: The number of shards where the deletion was skipped. query: type: object description: The search query to match workflows. Use `match_all` to retrieve all workflows, or `match` to search by specific fields like `use_case`. @@ -237,9 +250,11 @@ components: total: $ref: '#/components/schemas/total' max_score: - type: number - format: float - description: The maximum score of the search hits. + oneOf: + - type: 'null' + - type: number + format: float + description: The maximum score of the search hits. hits: type: array items: @@ -250,13 +265,19 @@ components: total: $ref: '#/components/schemas/total' max_score: - type: number - format: float - description: The maximum score of the search hits. + oneOf: + - type: 'null' + - type: number + format: float + description: The maximum score of the search hits. hits: type: array items: $ref: '#/components/schemas/StateItems' + WorkflowSteps: + type: object + additionalProperties: + $ref: '#/components/schemas/WorkflowStep' WorkflowStep: type: object properties: @@ -275,6 +296,8 @@ components: items: type: string description: The list of plugins required for the workflow step + timeout: + $ref: '_common.yaml#/components/schemas/Duration' WorkFlowStatusDefaultResponse: type: object properties: diff --git a/spec/schemas/flow_framework.errors.yaml b/spec/schemas/flow_framework.errors.yaml index 879cf7fe5..c91ed0e1d 100644 --- a/spec/schemas/flow_framework.errors.yaml +++ b/spec/schemas/flow_framework.errors.yaml @@ -7,65 +7,53 @@ paths: {} components: schemas: FlowFrameworkAPIDisabledError: - content: - application/json: - type: object - properties: - error: - type: string - example: This API is disabled. To enable it, set [flow_framework.enabled] to true. - status: - type: integer + type: object + properties: + error: + type: string + # example: This API is disabled. To enable it, set [flow_framework.enabled] to true. + status: + type: integer InvalidParameterError: - content: - application/json: - type: object - properties: - error: - type: string - example: Only the parameters [param1, param2] are permitted unless the provision parameter is set to true. - status: - type: integer + type: object + properties: + error: + type: string + # example: Only the parameters [param1, param2] are permitted unless the provision parameter is set to true. + status: + type: integer ConflictError: - content: - application/json: - type: object - properties: - error: - type: string - example: You cannot use both the 'provision_workflow' and 'update_workflow_fields' parameters in the same request. - status: - type: integer + type: object + properties: + error: + type: string + # example: You cannot use both the 'provision_workflow' and 'update_workflow_fields' parameters in the same request. + status: + type: integer MissingParameterError: - content: - application/json: - type: object - properties: - error: - type: string - example: You cannot use the 'reprovision_workflow' parameter to create a new template. - status: - type: integer + type: object + properties: + error: + type: string + # example: You cannot use the 'reprovision_workflow' parameter to create a new template. + status: + type: integer ParameterConflictError: - content: - application/json: - type: object - properties: - error: - type: string - example: You cannot use the 'reprovision_workflow' and 'use_case' parameters in the same request. - status: - type: integer + type: object + properties: + error: + type: string + # example: You cannot use the 'reprovision_workflow' and 'use_case' parameters in the same request. + status: + type: integer WorkFlowIdNullError: - content: - application/json: - type: object - properties: - error: - type: string - example: Workflow ID can not be null - status: - type: integer + type: object + properties: + error: + type: string + # example: Workflow ID can not be null + status: + type: integer DuplicateKeyError: type: object properties: @@ -75,7 +63,7 @@ components: status: type: integer description: HTTP status code for the error. - example: 400 + # example: 400 InvalidRequestBodyFieldError: type: object properties: @@ -94,27 +82,23 @@ components: status: type: integer description: HTTP status code for the error. - example: 400 + # example: 400 WorkflowSaveError: - content: - application/json: - type: object - properties: - error: - type: string - example: Failed to save workflow state - status: - type: integer + type: object + properties: + error: + type: string + # example: Failed to save workflow state + status: + type: integer MaxWorkflowsLimitError: - content: - application/json: - type: object - properties: - error: - type: string - example: Maximum workflows limit reached 50 - code: - type: integer + type: object + properties: + error: + type: string + # example: Maximum workflows limit reached 50 + code: + type: integer TemplateNameRequiredError: type: object properties: @@ -122,59 +106,49 @@ components: type: string description: Error message when the template name is missing. TemplateNotFoundError: - content: - application/json: - type: object - properties: - error: - type: string - example: Failed to retrieve template (12345) from global context. - code: - type: integer + type: object + properties: + error: + type: string + # example: Failed to retrieve template (12345) from global context. + code: + type: integer InvalidTemplateVersionError: - content: - application/json: - type: object - properties: - error: - type: string - description: Error message when the template version is invalid or missing. - example: Unable to parse field [version] in a version object. + type: object + properties: + error: + type: string + description: Error message when the template version is invalid or missing. + # example: Unable to parse field [version] in a version object. UnsupportedFieldUpdateError: - content: - application/json: - type: object - properties: - error: - type: string - description: Error message when trying to update an unsupported field in a template. - example: You can not update the field [fieldName] without updating the whole template. + type: object + properties: + error: + type: string + description: Error message when trying to update an unsupported field in a template. + # example: You can not update the field [fieldName] without updating the whole template. WorkflowParsingError: - content: - application/json: - type: object - properties: - error: - type: string - description: Error message when workflow parsing fails. - example: Unable to parse field [workflow] in a template object. + type: object + properties: + error: + type: string + description: Error message when workflow parsing fails. + # example: Unable to parse field [workflow] in a template object. WorkflowStepsRetrieveError: - content: - application/json: - type: object - properties: - error: - type: string - example: Failed to retrieve workflow step json. - code: - type: integer + type: object + properties: + error: + type: string + # example: Failed to retrieve workflow step json. + code: + type: integer DeprovisioningError: type: object properties: error: type: string description: Describes the deprovisioning error and identifies resources that were not deprovisioned - example: Failed to deprovision some resources [connector_id Lw7PX4wBfVtHp98y06wV]. + # example: Failed to deprovision some resources [connector_id Lw7PX4wBfVtHp98y06wV]. required: - error DeprovisioningForbiddenError: @@ -183,7 +157,7 @@ components: error: type: string description: Describes the resources that require the allow_delete parameter for deprovisioning - example: These resources require the allow_delete parameter to deprovision [index_name my-index]. + # example: These resources require the allow_delete parameter to deprovision [index_name my-index]. required: - error RequestTimeoutError: @@ -195,15 +169,15 @@ components: status: type: integer description: HTTP status code for the error. - example: 408 + # example: 408 BadRequestError: type: object properties: error: type: string description: Error message when the request body or parameters are invalid. - example: Invalid request body or query parameters. + # example: Invalid request body or query parameters. status: type: integer description: HTTP status code for the error. - example: 400 \ No newline at end of file + # example: 400 \ No newline at end of file diff --git a/spec/schemas/indices._common.yaml b/spec/schemas/indices._common.yaml index 2e3763cc4..10386d1ea 100644 --- a/spec/schemas/indices._common.yaml +++ b/spec/schemas/indices._common.yaml @@ -983,6 +983,13 @@ components: - mappings - order - settings + IndexError: + type: object + properties: + error: + $ref: '#/components/schemas/IndexErrorCause' + status: + type: number IndexErrorCause: type: object properties: diff --git a/spec/schemas/insights._common.yaml b/spec/schemas/insights._common.yaml index b4a700360..66b0bbe47 100644 --- a/spec/schemas/insights._common.yaml +++ b/spec/schemas/insights._common.yaml @@ -30,7 +30,7 @@ components: items: type: object $ref: '#/components/schemas/TaskResourceUsages' - # eslint-disable-next-line @cspell/spellchecker + query_hashcode: type: string description: The hash code of the query. diff --git a/spec/schemas/observability._common.yaml b/spec/schemas/observability._common.yaml index fc8018f55..08b7fbce6 100644 --- a/spec/schemas/observability._common.yaml +++ b/spec/schemas/observability._common.yaml @@ -218,7 +218,7 @@ components: $ref: '#/components/schemas/ErrorResponse' status: type: integer - example: 404 + # example: 404 required: - error - status @@ -232,10 +232,10 @@ components: $ref: '#/components/schemas/RootCause' type: type: string - example: status_exception + # example: status_exception reason: type: string - example: 'ObservabilityObject {objectId} not found' + # example: 'ObservabilityObject {objectId} not found' required: - reason - root_cause @@ -246,10 +246,10 @@ components: properties: type: type: string - example: status_exception + # example: status_exception reason: type: string - example: 'ObservabilityObject {objectId} not found' + # example: 'ObservabilityObject {objectId} not found' required: - reason - type diff --git a/spec/schemas/query._common.yaml b/spec/schemas/query._common.yaml index 40277b8b0..ef4e315f4 100644 --- a/spec/schemas/query._common.yaml +++ b/spec/schemas/query._common.yaml @@ -71,6 +71,14 @@ components: - error ErrorResponse: + type: object + properties: + error: + $ref: '#/components/schemas/Error' + status: + type: number + + Error: type: object properties: root_cause: diff --git a/spec/schemas/security._common.yaml b/spec/schemas/security._common.yaml index d98618758..fde8ffb39 100644 --- a/spec/schemas/security._common.yaml +++ b/spec/schemas/security._common.yaml @@ -454,6 +454,22 @@ components: items: type: string + Error: + type: object + properties: + status: + type: string + enum: + - BAD_REQUEST + - CONFLICT + - FORBIDDEN + - INTERNAL_SERVER_ERROR + - NOT_FOUND + - NOT_IMPLEMENTED + - UNAUTHORIZED + message: + type: string + InternalServerError: type: object properties: diff --git a/tests/default/flow_framework/template.yaml b/tests/default/flow_framework/template.yaml index c7ac780c9..84ecd8638 100644 --- a/tests/default/flow_framework/template.yaml +++ b/tests/default/flow_framework/template.yaml @@ -7,6 +7,8 @@ epilogues: status: [200, 404] parameters: workflow_id: ${create_flow_framework.test_workflow_id} +warnings: + multiple-paths-detected: false chapters: - synopsis: Create workflow with openAI model. id: create_flow_framework diff --git a/tests/default/security/api/nodesdn.yaml b/tests/default/security/api/nodesdn.yaml deleted file mode 100644 index 43b3991d4..000000000 --- a/tests/default/security/api/nodesdn.yaml +++ /dev/null @@ -1,65 +0,0 @@ -$schema: ../../../../json_schemas/test_story.schema.yaml - -description: Test nodesdn endpoints. -distributions: - excluded: - - amazon-managed - - amazon-serverless - -# ADMIN-CERT only. These tests require explicit rest api admin privileges. -# The setting `plugins. security. nodes_dn_dynamic_config_enabled` must be enabled. -chapters: - - synopsis: Get distinguished names. - path: /_plugins/_security/api/nodesdn - method: GET - parameters: - show_all: true - response: - status: 400 - - synopsis: Patch distinguished names. - path: /_plugins/_security/api/nodesdn - method: PATCH - request: - payload: - - op: replace - path: /cluster1/nodes_dn/0 - value: [''] - response: - status: 400 - - synopsis: Create distinguished name. - path: /_plugins/_security/api/nodesdn/{cluster_name} - method: PUT - parameters: - cluster_name: test - request: - payload: - nodes_dn: - - CN=cluster3.example.com - response: - status: 400 - - synopsis: Get distinguished name. - path: /_plugins/_security/api/nodesdn/{cluster_name} - method: GET - parameters: - cluster_name: test - response: - status: 400 - - synopsis: Patch distinguished name. - path: /_plugins/_security/api/nodesdn/{cluster_name} - method: PATCH - parameters: - cluster_name: test - request: - payload: - op: replace - path: /test/nodes_dn/0 - value: [CN=cluster2.example.com] - response: - status: 400 - - synopsis: Delete distinguished name. - path: /_plugins/_security/api/nodesdn/{cluster_name} - method: DELETE - parameters: - cluster_name: test - response: - status: 400 diff --git a/tests/plugins/ml/ingest/pipeline/neural_search.yaml b/tests/plugins/ml/ingest/pipeline/neural_search.yaml index ca2fdd60a..5e68f5995 100644 --- a/tests/plugins/ml/ingest/pipeline/neural_search.yaml +++ b/tests/plugins/ml/ingest/pipeline/neural_search.yaml @@ -183,23 +183,6 @@ chapters: title: Moneyball script: source: _score * 1.7 - - synopsis: Search by Image - Invalid Model. - path: /{index}/_search - method: POST - parameters: - index: movies - request: - payload: - _source: - excludes: [passage_embedding] - query: - neural: - passage_embedding: - query_image: iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII= - model_id: invalid # This makes the test fail with a 404 but will still validate the query_image. - k: 100 - response: - status: 404 - synopsis: Undeploy a model. path: /_plugins/_ml/models/{model_id}/_undeploy method: POST diff --git a/tests/plugins/ml/ingest/pipeline/search_by_image.yaml b/tests/plugins/ml/ingest/pipeline/search_by_image.yaml new file mode 100644 index 000000000..e4fc46e61 --- /dev/null +++ b/tests/plugins/ml/ingest/pipeline/search_by_image.yaml @@ -0,0 +1,26 @@ +$schema: ../../../../../json_schemas/test_story.schema.yaml + +description: Test search by image. +distributions: + excluded: + - amazon-managed + - amazon-serverless +version: '>= 2.11' +chapters: + - synopsis: Search by Image - Invalid Model. + path: /{index}/_search + method: POST + parameters: + index: movies + request: + payload: + _source: + excludes: [passage_embedding] + query: + neural: + passage_embedding: + query_image: iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII= + model_id: invalid # This makes the test fail with a 404 but will still validate the query_image. + k: 100 + response: + status: 404 diff --git a/tools/src/linter/SchemasValidator.ts b/tools/src/linter/SchemasValidator.ts index c463e49d9..9e8418688 100644 --- a/tools/src/linter/SchemasValidator.ts +++ b/tools/src/linter/SchemasValidator.ts @@ -50,8 +50,8 @@ export default class SchemasValidator { const message = this.json_validator.validate_schema(_schema) if (message == null) return - const file = `schemas/${key.split(':')[0]}.yaml` - const location = `#/components/schemas/${key.split(':')[1]}` + const file = `schemas/${key.split('___')[0]}.yaml` + const location = `#/components/schemas/${key.split('___')[1]}` return this.error(file, location, message) }).filter((error) => error != null) as ValidationError[] } @@ -61,9 +61,9 @@ export default class SchemasValidator { const message = this.json_validator.validate_schema(param.schema) if (message == null) return - const namespace = this.group_to_namespace(key.split('::')[0]) + const namespace = this.group_to_namespace(key.split('___')[0]) const file = namespace === '_global' ? '_global_parameters.yaml' : `namespaces/${namespace}.yaml` - const location = namespace === '_global' ? param.name as string : `#/components/parameters/${key}` + const location = namespace === '_global' ? param.name as string : `#/components/parameters/${key}`.replace('___', '::') return this.error(file, location, message) }).filter((error) => error != null) as ValidationError[] } @@ -78,9 +78,9 @@ export default class SchemasValidator { validate_response_schemas (): ValidationError[] { return Object.entries(this.spec.responses as Record).flatMap(([key, response]) => { - const namespace = this.group_to_namespace(key.split('@')[0]) + const namespace = this.group_to_namespace(key.split('___')[0]) const file = `namespaces/${namespace}.yaml` - const location = `#/components/responses/${key}` + const location = `#/components/responses/${key}`.replace('___', '@') const content = response.content as Record return this.validate_content_schemas(file, location, content) }) diff --git a/tools/src/merger/OpenApiMerger.ts b/tools/src/merger/OpenApiMerger.ts index ff8cd7d06..9ea66265d 100644 --- a/tools/src/merger/OpenApiMerger.ts +++ b/tools/src/merger/OpenApiMerger.ts @@ -53,8 +53,11 @@ export default class OpenApiMerger { this.#merge_schemas() this.#merge_namespaces() this.#sort_spec_keys() + this.#add_defaults() + this.#fix_refs() this.#generate_global_params() this.#generate_superseded_ops() + this.#normalize_fields() this._merged = true } @@ -134,6 +137,58 @@ export default class OpenApiMerger { }) } + #fix_refs(obj: any = this._spec.components): void { + if (obj?.$ref !== undefined) { + if (obj?.description !== undefined) { + delete obj?.description + } + } + + for (const key in obj) { + var item = obj[key] + if (_.isObject(item) || _.isArray(item)) { + this.#fix_refs(item) + } + } + } + + #normalize_key(key: string): string { + return key + .replaceAll('::', '___') + .replaceAll('@', '___') + .replaceAll(':', '___') + } + + #normalize_fields(obj: any = this._spec): void { + for (const key in obj) { + var item = obj[key] + + if (item?.$ref !== undefined) { + var renamed_ref = this.#normalize_key(item.$ref as string) + if (renamed_ref != item.$ref) { + item.$ref = renamed_ref + } + } + + var renamed_key = this.#normalize_key(key) + if (renamed_key != key) { + obj[renamed_key] = obj[key] + delete obj[key] + } + + if (_.isObject(item) || _.isArray(item)) { + this.#normalize_fields(item) + } + } + } + + #add_defaults(): void { + // Add default descriptions + Object.entries(this._spec.components.responses as Document).forEach(([_path, response_item]) => { + if (response_item.description === undefined) response_item.description = '' + }) + } + // Generate global parameters from _global_params.yaml file. #generate_global_params (): void { const gen = new GlobalParamsGenerator(this.root_folder) diff --git a/tools/src/tester/ChapterReader.ts b/tools/src/tester/ChapterReader.ts index f85e6fdc6..ad34d715b 100644 --- a/tools/src/tester/ChapterReader.ts +++ b/tools/src/tester/ChapterReader.ts @@ -61,9 +61,8 @@ export default class ChapterReader { } else { response.status = e.response.status response.content_type = e.response.headers['content-type']?.split(';')[0] - const payload = this.#deserialize_payload(e.response.data, response.content_type) - if (payload !== undefined) response.payload = payload.error ?? payload - response.message = payload.error?.reason ?? e.response.statusText + response.payload = this.#deserialize_payload(e.response.data, response.content_type) + response.message = response.payload.error?.reason ?? e.response.statusText this.logger.info(`<= ${response.status} (${response.content_type}) | ${response.payload !== undefined ? to_json(response.payload) : response.message}`) } }) diff --git a/tools/src/tester/TestRunner.ts b/tools/src/tester/TestRunner.ts index 6317ef392..77fe2df6d 100644 --- a/tools/src/tester/TestRunner.ts +++ b/tools/src/tester/TestRunner.ts @@ -19,6 +19,7 @@ import type StoryValidator from "./StoryValidator"; import { OpenSearchHttpClient } from 'OpenSearchHttpClient' import * as ansi from './Ansi' import _ from 'lodash' +import { Logger } from 'Logger' export default class TestRunner { private readonly _http_client: OpenSearchHttpClient @@ -26,12 +27,14 @@ export default class TestRunner { private readonly _story_evaluator: StoryEvaluator private readonly _result_logger: ResultLogger private readonly _story_files: Record = {} + private readonly _logger: Logger - constructor (http_client: OpenSearchHttpClient, story_validator: StoryValidator, story_evaluator: StoryEvaluator, result_logger: ResultLogger) { + constructor (http_client: OpenSearchHttpClient, story_validator: StoryValidator, story_evaluator: StoryEvaluator, result_logger: ResultLogger, logger: Logger) { this._http_client = http_client this._story_validator = story_validator this._story_evaluator = story_evaluator this._result_logger = result_logger + this._logger = logger } async run (story_path: string, version?: string, distribution?: string, dry_run: boolean = false): Promise<{ results: StoryEvaluations, failed: boolean }> { @@ -52,6 +55,7 @@ export default class TestRunner { } for (const story_file of story_files) { + this._logger.info(`Evaluating ${story_file.display_path} ...`) const evaluation = this._story_validator.validate(story_file) ?? await this._story_evaluator.evaluate(story_file, version, distribution, dry_run) results.evaluations.push(evaluation) this._result_logger.log(evaluation) diff --git a/tools/src/tester/test.ts b/tools/src/tester/test.ts index e781e343c..77351fe75 100644 --- a/tools/src/tester/test.ts +++ b/tools/src/tester/test.ts @@ -75,7 +75,7 @@ const supplemental_chapter_evaluator = new SupplementalChapterEvaluator(chapter_ const story_validator = new StoryValidator() const story_evaluator = new StoryEvaluator(chapter_evaluator, supplemental_chapter_evaluator) const result_logger = new ConsoleResultLogger(opts.tabWidth, opts.verbose) -const runner = new TestRunner(http_client, story_validator, story_evaluator, result_logger) +const runner = new TestRunner(http_client, story_validator, story_evaluator, result_logger, logger) runner.run(opts.testsPath, spec.api_version(), opts.opensearchDistribution, opts.dryRun) .then( diff --git a/tools/src/validate-spec-py/Pipfile b/tools/src/validate-spec-py/Pipfile new file mode 100644 index 000000000..fa5bb05f6 --- /dev/null +++ b/tools/src/validate-spec-py/Pipfile @@ -0,0 +1,12 @@ +[[source]] +url = "https://pypi.org/simple" +verify_ssl = true +name = "pypi" + +[packages] +openapi_spec_validator = "*" + +[dev-packages] + +[requires] +python_version = "3" \ No newline at end of file diff --git a/tools/src/validate-spec-py/Pipfile.lock b/tools/src/validate-spec-py/Pipfile.lock new file mode 100644 index 000000000..cbb761748 --- /dev/null +++ b/tools/src/validate-spec-py/Pipfile.lock @@ -0,0 +1,455 @@ +{ + "_meta": { + "hash": { + "sha256": "8b96bf24637f13e9b0dd9a291f35f43962b4918dd76e52d5e7459c5ac620cdc4" + }, + "pipfile-spec": 6, + "requires": { + "python_version": "3" + }, + "sources": [ + { + "name": "pypi", + "url": "https://pypi.org/simple", + "verify_ssl": true + } + ] + }, + "default": { + "attrs": { + "hashes": [ + "sha256:5cfb1b9148b5b086569baec03f20d7b6bf3bcacc9a42bebf87ffaaca362f6346", + "sha256:81921eb96de3191c8258c199618104dd27ac608d9366f5e35d011eae1867ede2" + ], + "markers": "python_version >= '3.7'", + "version": "==24.2.0" + }, + "certifi": { + "hashes": [ + "sha256:922820b53db7a7257ffbda3f597266d435245903d80737e34f8a45ff3e3230d8", + "sha256:bec941d2aa8195e248a60b31ff9f0558284cf01a52591ceda73ea9afffd69fd9" + ], + "markers": "python_version >= '3.6'", + "version": "==2024.8.30" + }, + "charset-normalizer": { + "hashes": [ + "sha256:0099d79bdfcf5c1f0c2c72f91516702ebf8b0b8ddd8905f97a8aecf49712c621", + "sha256:0713f3adb9d03d49d365b70b84775d0a0d18e4ab08d12bc46baa6132ba78aaf6", + "sha256:07afec21bbbbf8a5cc3651aa96b980afe2526e7f048fdfb7f1014d84acc8b6d8", + "sha256:0b309d1747110feb25d7ed6b01afdec269c647d382c857ef4663bbe6ad95a912", + "sha256:0d99dd8ff461990f12d6e42c7347fd9ab2532fb70e9621ba520f9e8637161d7c", + "sha256:0de7b687289d3c1b3e8660d0741874abe7888100efe14bd0f9fd7141bcbda92b", + "sha256:1110e22af8ca26b90bd6364fe4c763329b0ebf1ee213ba32b68c73de5752323d", + "sha256:130272c698667a982a5d0e626851ceff662565379baf0ff2cc58067b81d4f11d", + "sha256:136815f06a3ae311fae551c3df1f998a1ebd01ddd424aa5603a4336997629e95", + "sha256:14215b71a762336254351b00ec720a8e85cada43b987da5a042e4ce3e82bd68e", + "sha256:1db4e7fefefd0f548d73e2e2e041f9df5c59e178b4c72fbac4cc6f535cfb1565", + "sha256:1ffd9493de4c922f2a38c2bf62b831dcec90ac673ed1ca182fe11b4d8e9f2a64", + "sha256:2006769bd1640bdf4d5641c69a3d63b71b81445473cac5ded39740a226fa88ab", + "sha256:20587d20f557fe189b7947d8e7ec5afa110ccf72a3128d61a2a387c3313f46be", + "sha256:223217c3d4f82c3ac5e29032b3f1c2eb0fb591b72161f86d93f5719079dae93e", + "sha256:27623ba66c183eca01bf9ff833875b459cad267aeeb044477fedac35e19ba907", + "sha256:285e96d9d53422efc0d7a17c60e59f37fbf3dfa942073f666db4ac71e8d726d0", + "sha256:2de62e8801ddfff069cd5c504ce3bc9672b23266597d4e4f50eda28846c322f2", + "sha256:2f6c34da58ea9c1a9515621f4d9ac379871a8f21168ba1b5e09d74250de5ad62", + "sha256:309a7de0a0ff3040acaebb35ec45d18db4b28232f21998851cfa709eeff49d62", + "sha256:35c404d74c2926d0287fbd63ed5d27eb911eb9e4a3bb2c6d294f3cfd4a9e0c23", + "sha256:3710a9751938947e6327ea9f3ea6332a09bf0ba0c09cae9cb1f250bd1f1549bc", + "sha256:3d59d125ffbd6d552765510e3f31ed75ebac2c7470c7274195b9161a32350284", + "sha256:40d3ff7fc90b98c637bda91c89d51264a3dcf210cade3a2c6f838c7268d7a4ca", + "sha256:425c5f215d0eecee9a56cdb703203dda90423247421bf0d67125add85d0c4455", + "sha256:43193c5cda5d612f247172016c4bb71251c784d7a4d9314677186a838ad34858", + "sha256:44aeb140295a2f0659e113b31cfe92c9061622cadbc9e2a2f7b8ef6b1e29ef4b", + "sha256:47334db71978b23ebcf3c0f9f5ee98b8d65992b65c9c4f2d34c2eaf5bcaf0594", + "sha256:4796efc4faf6b53a18e3d46343535caed491776a22af773f366534056c4e1fbc", + "sha256:4a51b48f42d9358460b78725283f04bddaf44a9358197b889657deba38f329db", + "sha256:4b67fdab07fdd3c10bb21edab3cbfe8cf5696f453afce75d815d9d7223fbe88b", + "sha256:4ec9dd88a5b71abfc74e9df5ebe7921c35cbb3b641181a531ca65cdb5e8e4dea", + "sha256:4f9fc98dad6c2eaa32fc3af1417d95b5e3d08aff968df0cd320066def971f9a6", + "sha256:54b6a92d009cbe2fb11054ba694bc9e284dad30a26757b1e372a1fdddaf21920", + "sha256:55f56e2ebd4e3bc50442fbc0888c9d8c94e4e06a933804e2af3e89e2f9c1c749", + "sha256:5726cf76c982532c1863fb64d8c6dd0e4c90b6ece9feb06c9f202417a31f7dd7", + "sha256:5d447056e2ca60382d460a604b6302d8db69476fd2015c81e7c35417cfabe4cd", + "sha256:5ed2e36c3e9b4f21dd9422f6893dec0abf2cca553af509b10cd630f878d3eb99", + "sha256:5ff2ed8194587faf56555927b3aa10e6fb69d931e33953943bc4f837dfee2242", + "sha256:62f60aebecfc7f4b82e3f639a7d1433a20ec32824db2199a11ad4f5e146ef5ee", + "sha256:63bc5c4ae26e4bc6be6469943b8253c0fd4e4186c43ad46e713ea61a0ba49129", + "sha256:6b40e8d38afe634559e398cc32b1472f376a4099c75fe6299ae607e404c033b2", + "sha256:6b493a043635eb376e50eedf7818f2f322eabbaa974e948bd8bdd29eb7ef2a51", + "sha256:6dba5d19c4dfab08e58d5b36304b3f92f3bd5d42c1a3fa37b5ba5cdf6dfcbcee", + "sha256:6fd30dc99682dc2c603c2b315bded2799019cea829f8bf57dc6b61efde6611c8", + "sha256:707b82d19e65c9bd28b81dde95249b07bf9f5b90ebe1ef17d9b57473f8a64b7b", + "sha256:7706f5850360ac01d80c89bcef1640683cc12ed87f42579dab6c5d3ed6888613", + "sha256:7782afc9b6b42200f7362858f9e73b1f8316afb276d316336c0ec3bd73312742", + "sha256:79983512b108e4a164b9c8d34de3992f76d48cadc9554c9e60b43f308988aabe", + "sha256:7f683ddc7eedd742e2889d2bfb96d69573fde1d92fcb811979cdb7165bb9c7d3", + "sha256:82357d85de703176b5587dbe6ade8ff67f9f69a41c0733cf2425378b49954de5", + "sha256:84450ba661fb96e9fd67629b93d2941c871ca86fc38d835d19d4225ff946a631", + "sha256:86f4e8cca779080f66ff4f191a685ced73d2f72d50216f7112185dc02b90b9b7", + "sha256:8cda06946eac330cbe6598f77bb54e690b4ca93f593dee1568ad22b04f347c15", + "sha256:8ce7fd6767a1cc5a92a639b391891bf1c268b03ec7e021c7d6d902285259685c", + "sha256:8ff4e7cdfdb1ab5698e675ca622e72d58a6fa2a8aa58195de0c0061288e6e3ea", + "sha256:9289fd5dddcf57bab41d044f1756550f9e7cf0c8e373b8cdf0ce8773dc4bd417", + "sha256:92a7e36b000bf022ef3dbb9c46bfe2d52c047d5e3f3343f43204263c5addc250", + "sha256:92db3c28b5b2a273346bebb24857fda45601aef6ae1c011c0a997106581e8a88", + "sha256:95c3c157765b031331dd4db3c775e58deaee050a3042fcad72cbc4189d7c8dca", + "sha256:980b4f289d1d90ca5efcf07958d3eb38ed9c0b7676bf2831a54d4f66f9c27dfa", + "sha256:9ae4ef0b3f6b41bad6366fb0ea4fc1d7ed051528e113a60fa2a65a9abb5b1d99", + "sha256:9c98230f5042f4945f957d006edccc2af1e03ed5e37ce7c373f00a5a4daa6149", + "sha256:9fa2566ca27d67c86569e8c85297aaf413ffab85a8960500f12ea34ff98e4c41", + "sha256:a14969b8691f7998e74663b77b4c36c0337cb1df552da83d5c9004a93afdb574", + "sha256:a8aacce6e2e1edcb6ac625fb0f8c3a9570ccc7bfba1f63419b3769ccf6a00ed0", + "sha256:a8e538f46104c815be19c975572d74afb53f29650ea2025bbfaef359d2de2f7f", + "sha256:aa41e526a5d4a9dfcfbab0716c7e8a1b215abd3f3df5a45cf18a12721d31cb5d", + "sha256:aa693779a8b50cd97570e5a0f343538a8dbd3e496fa5dcb87e29406ad0299654", + "sha256:ab22fbd9765e6954bc0bcff24c25ff71dcbfdb185fcdaca49e81bac68fe724d3", + "sha256:ab2e5bef076f5a235c3774b4f4028a680432cded7cad37bba0fd90d64b187d19", + "sha256:ab973df98fc99ab39080bfb0eb3a925181454d7c3ac8a1e695fddfae696d9e90", + "sha256:af73657b7a68211996527dbfeffbb0864e043d270580c5aef06dc4b659a4b578", + "sha256:b197e7094f232959f8f20541ead1d9862ac5ebea1d58e9849c1bf979255dfac9", + "sha256:b295729485b06c1a0683af02a9e42d2caa9db04a373dc38a6a58cdd1e8abddf1", + "sha256:b8831399554b92b72af5932cdbbd4ddc55c55f631bb13ff8fe4e6536a06c5c51", + "sha256:b8dcd239c743aa2f9c22ce674a145e0a25cb1566c495928440a181ca1ccf6719", + "sha256:bcb4f8ea87d03bc51ad04add8ceaf9b0f085ac045ab4d74e73bbc2dc033f0236", + "sha256:bd7af3717683bea4c87acd8c0d3d5b44d56120b26fd3f8a692bdd2d5260c620a", + "sha256:bf4475b82be41b07cc5e5ff94810e6a01f276e37c2d55571e3fe175e467a1a1c", + "sha256:c3e446d253bd88f6377260d07c895816ebf33ffffd56c1c792b13bff9c3e1ade", + "sha256:c57516e58fd17d03ebe67e181a4e4e2ccab1168f8c2976c6a334d4f819fe5944", + "sha256:c94057af19bc953643a33581844649a7fdab902624d2eb739738a30e2b3e60fc", + "sha256:cab5d0b79d987c67f3b9e9c53f54a61360422a5a0bc075f43cab5621d530c3b6", + "sha256:ce031db0408e487fd2775d745ce30a7cd2923667cf3b69d48d219f1d8f5ddeb6", + "sha256:cee4373f4d3ad28f1ab6290684d8e2ebdb9e7a1b74fdc39e4c211995f77bec27", + "sha256:d5b054862739d276e09928de37c79ddeec42a6e1bfc55863be96a36ba22926f6", + "sha256:dbe03226baf438ac4fda9e2d0715022fd579cb641c4cf639fa40d53b2fe6f3e2", + "sha256:dc15e99b2d8a656f8e666854404f1ba54765871104e50c8e9813af8a7db07f12", + "sha256:dcaf7c1524c0542ee2fc82cc8ec337f7a9f7edee2532421ab200d2b920fc97cf", + "sha256:dd4eda173a9fcccb5f2e2bd2a9f423d180194b1bf17cf59e3269899235b2a114", + "sha256:dd9a8bd8900e65504a305bf8ae6fa9fbc66de94178c420791d0293702fce2df7", + "sha256:de7376c29d95d6719048c194a9cf1a1b0393fbe8488a22008610b0361d834ecf", + "sha256:e7fdd52961feb4c96507aa649550ec2a0d527c086d284749b2f582f2d40a2e0d", + "sha256:e91f541a85298cf35433bf66f3fab2a4a2cff05c127eeca4af174f6d497f0d4b", + "sha256:e9e3c4c9e1ed40ea53acf11e2a386383c3304212c965773704e4603d589343ed", + "sha256:ee803480535c44e7f5ad00788526da7d85525cfefaf8acf8ab9a310000be4b03", + "sha256:f09cb5a7bbe1ecae6e87901a2eb23e0256bb524a79ccc53eb0b7629fbe7677c4", + "sha256:f19c1585933c82098c2a520f8ec1227f20e339e33aca8fa6f956f6691b784e67", + "sha256:f1a2f519ae173b5b6a2c9d5fa3116ce16e48b3462c8b96dfdded11055e3d6365", + "sha256:f28f891ccd15c514a0981f3b9db9aa23d62fe1a99997512b0491d2ed323d229a", + "sha256:f3e73a4255342d4eb26ef6df01e3962e73aa29baa3124a8e824c5d3364a65748", + "sha256:f606a1881d2663630ea5b8ce2efe2111740df4b687bd78b34a8131baa007f79b", + "sha256:fe9f97feb71aa9896b81973a7bbada8c49501dc73e58a10fcef6663af95e5079", + "sha256:ffc519621dce0c767e96b9c53f09c5d215578e10b02c285809f76509a3931482" + ], + "markers": "python_full_version >= '3.7.0'", + "version": "==3.4.0" + }, + "idna": { + "hashes": [ + "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9", + "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3" + ], + "markers": "python_version >= '3.6'", + "version": "==3.10" + }, + "jsonschema": { + "hashes": [ + "sha256:d71497fef26351a33265337fa77ffeb82423f3ea21283cd9467bb03999266bc4", + "sha256:fbadb6f8b144a8f8cf9f0b89ba94501d143e50411a1278633f56a7acf7fd5566" + ], + "markers": "python_version >= '3.8'", + "version": "==4.23.0" + }, + "jsonschema-path": { + "hashes": [ + "sha256:203aff257f8038cd3c67be614fe6b2001043408cb1b4e36576bc4921e09d83c4", + "sha256:f02e5481a4288ec062f8e68c808569e427d905bedfecb7f2e4c69ef77957c382" + ], + "markers": "python_full_version >= '3.8.0' and python_full_version < '4.0.0'", + "version": "==0.3.3" + }, + "jsonschema-specifications": { + "hashes": [ + "sha256:48a76787b3e70f5ed53f1160d2b81f586e4ca6d1548c5de7085d1682674764cc", + "sha256:87e4fdf3a94858b8a2ba2778d9ba57d8a9cafca7c7489c46ba0d30a8bc6a9c3c" + ], + "markers": "python_version >= '3.8'", + "version": "==2023.12.1" + }, + "lazy-object-proxy": { + "hashes": [ + "sha256:009e6bb1f1935a62889ddc8541514b6a9e1fcf302667dcb049a0be5c8f613e56", + "sha256:02c83f957782cbbe8136bee26416686a6ae998c7b6191711a04da776dc9e47d4", + "sha256:0aefc7591920bbd360d57ea03c995cebc204b424524a5bd78406f6e1b8b2a5d8", + "sha256:127a789c75151db6af398b8972178afe6bda7d6f68730c057fbbc2e96b08d282", + "sha256:18dd842b49456aaa9a7cf535b04ca4571a302ff72ed8740d06b5adcd41fe0757", + "sha256:217138197c170a2a74ca0e05bddcd5f1796c735c37d0eee33e43259b192aa424", + "sha256:2297f08f08a2bb0d32a4265e98a006643cd7233fb7983032bd61ac7a02956b3b", + "sha256:2fc0a92c02fa1ca1e84fc60fa258458e5bf89d90a1ddaeb8ed9cc3147f417255", + "sha256:30b339b2a743c5288405aa79a69e706a06e02958eab31859f7f3c04980853b70", + "sha256:366c32fe5355ef5fc8a232c5436f4cc66e9d3e8967c01fb2e6302fd6627e3d94", + "sha256:3ad54b9ddbe20ae9f7c1b29e52f123120772b06dbb18ec6be9101369d63a4074", + "sha256:5ad9e6ed739285919aa9661a5bbed0aaf410aa60231373c5579c6b4801bd883c", + "sha256:5faf03a7d8942bb4476e3b62fd0f4cf94eaf4618e304a19865abf89a35c0bbee", + "sha256:75fc59fc450050b1b3c203c35020bc41bd2695ed692a392924c6ce180c6f1dc9", + "sha256:76a095cfe6045c7d0ca77db9934e8f7b71b14645f0094ffcd842349ada5c5fb9", + "sha256:78247b6d45f43a52ef35c25b5581459e85117225408a4128a3daf8bf9648ac69", + "sha256:782e2c9b2aab1708ffb07d4bf377d12901d7a1d99e5e410d648d892f8967ab1f", + "sha256:7ab7004cf2e59f7c2e4345604a3e6ea0d92ac44e1c2375527d56492014e690c3", + "sha256:80b39d3a151309efc8cc48675918891b865bdf742a8616a337cb0090791a0de9", + "sha256:80fa48bd89c8f2f456fc0765c11c23bf5af827febacd2f523ca5bc1893fcc09d", + "sha256:855e068b0358ab916454464a884779c7ffa312b8925c6f7401e952dcf3b89977", + "sha256:92f09ff65ecff3108e56526f9e2481b8116c0b9e1425325e13245abfd79bdb1b", + "sha256:952c81d415b9b80ea261d2372d2a4a2332a3890c2b83e0535f263ddfe43f0d43", + "sha256:9a3a87cf1e133e5b1994144c12ca4aa3d9698517fe1e2ca82977781b16955658", + "sha256:9e4ed0518a14dd26092614412936920ad081a424bdcb54cc13349a8e2c6d106a", + "sha256:a899b10e17743683b293a729d3a11f2f399e8a90c73b089e29f5d0fe3509f0dd", + "sha256:b1f711e2c6dcd4edd372cf5dec5c5a30d23bba06ee012093267b3376c079ec83", + "sha256:b4f87d4ed9064b2628da63830986c3d2dca7501e6018347798313fcf028e2fd4", + "sha256:cb73507defd385b7705c599a94474b1d5222a508e502553ef94114a143ec6696", + "sha256:dc0d2fc424e54c70c4bc06787e4072c4f3b1aa2f897dfdc34ce1013cf3ceef05", + "sha256:e221060b701e2aa2ea991542900dd13907a5c90fa80e199dbf5a03359019e7a3", + "sha256:e271058822765ad5e3bca7f05f2ace0de58a3f4e62045a8c90a0dfd2f8ad8cc6", + "sha256:e2adb09778797da09d2b5ebdbceebf7dd32e2c96f79da9052b2e87b6ea495895", + "sha256:e333e2324307a7b5d86adfa835bb500ee70bfcd1447384a822e96495796b0ca4", + "sha256:e98c8af98d5707dcdecc9ab0863c0ea6e88545d42ca7c3feffb6b4d1e370c7ba", + "sha256:edb45bb8278574710e68a6b021599a10ce730d156e5b254941754a9cc0b17d03", + "sha256:fec03caabbc6b59ea4a638bee5fce7117be8e99a4103d9d5ad77f15d6f81020c" + ], + "markers": "python_version >= '3.8'", + "version": "==1.10.0" + }, + "openapi-schema-validator": { + "hashes": [ + "sha256:11a95c9c9017912964e3e5f2545a5b11c3814880681fcacfb73b1759bb4f2804", + "sha256:c4887c1347c669eb7cded9090f4438b710845cd0f90d1fb9e1b3303fb37339f8" + ], + "markers": "python_full_version >= '3.8.0' and python_full_version < '4.0.0'", + "version": "==0.6.2" + }, + "openapi-spec-validator": { + "hashes": [ + "sha256:3c81825043f24ccbcd2f4b149b11e8231abce5ba84f37065e14ec947d8f4e959", + "sha256:8577b85a8268685da6f8aa30990b83b7960d4d1117e901d451b5d572605e5ec7" + ], + "markers": "python_full_version >= '3.8.0' and python_full_version < '4.0.0'", + "version": "==0.7.1" + }, + "pathable": { + "hashes": [ + "sha256:5c869d315be50776cc8a993f3af43e0c60dc01506b399643f919034ebf4cdcab", + "sha256:cdd7b1f9d7d5c8b8d3315dbf5a86b2596053ae845f056f57d97c0eefff84da14" + ], + "markers": "python_full_version >= '3.7.0' and python_full_version < '4.0.0'", + "version": "==0.4.3" + }, + "pyyaml": { + "hashes": [ + "sha256:01179a4a8559ab5de078078f37e5c1a30d76bb88519906844fd7bdea1b7729ff", + "sha256:0833f8694549e586547b576dcfaba4a6b55b9e96098b36cdc7ebefe667dfed48", + "sha256:0a9a2848a5b7feac301353437eb7d5957887edbf81d56e903999a75a3d743086", + "sha256:0b69e4ce7a131fe56b7e4d770c67429700908fc0752af059838b1cfb41960e4e", + "sha256:0ffe8360bab4910ef1b9e87fb812d8bc0a308b0d0eef8c8f44e0254ab3b07133", + "sha256:11d8f3dd2b9c1207dcaf2ee0bbbfd5991f571186ec9cc78427ba5bd32afae4b5", + "sha256:17e311b6c678207928d649faa7cb0d7b4c26a0ba73d41e99c4fff6b6c3276484", + "sha256:1e2120ef853f59c7419231f3bf4e7021f1b936f6ebd222406c3b60212205d2ee", + "sha256:1f71ea527786de97d1a0cc0eacd1defc0985dcf6b3f17bb77dcfc8c34bec4dc5", + "sha256:23502f431948090f597378482b4812b0caae32c22213aecf3b55325e049a6c68", + "sha256:24471b829b3bf607e04e88d79542a9d48bb037c2267d7927a874e6c205ca7e9a", + "sha256:29717114e51c84ddfba879543fb232a6ed60086602313ca38cce623c1d62cfbf", + "sha256:2e99c6826ffa974fe6e27cdb5ed0021786b03fc98e5ee3c5bfe1fd5015f42b99", + "sha256:39693e1f8320ae4f43943590b49779ffb98acb81f788220ea932a6b6c51004d8", + "sha256:3ad2a3decf9aaba3d29c8f537ac4b243e36bef957511b4766cb0057d32b0be85", + "sha256:3b1fdb9dc17f5a7677423d508ab4f243a726dea51fa5e70992e59a7411c89d19", + "sha256:41e4e3953a79407c794916fa277a82531dd93aad34e29c2a514c2c0c5fe971cc", + "sha256:43fa96a3ca0d6b1812e01ced1044a003533c47f6ee8aca31724f78e93ccc089a", + "sha256:50187695423ffe49e2deacb8cd10510bc361faac997de9efef88badc3bb9e2d1", + "sha256:5ac9328ec4831237bec75defaf839f7d4564be1e6b25ac710bd1a96321cc8317", + "sha256:5d225db5a45f21e78dd9358e58a98702a0302f2659a3c6cd320564b75b86f47c", + "sha256:6395c297d42274772abc367baaa79683958044e5d3835486c16da75d2a694631", + "sha256:688ba32a1cffef67fd2e9398a2efebaea461578b0923624778664cc1c914db5d", + "sha256:68ccc6023a3400877818152ad9a1033e3db8625d899c72eacb5a668902e4d652", + "sha256:70b189594dbe54f75ab3a1acec5f1e3faa7e8cf2f1e08d9b561cb41b845f69d5", + "sha256:797b4f722ffa07cc8d62053e4cff1486fa6dc094105d13fea7b1de7d8bf71c9e", + "sha256:7c36280e6fb8385e520936c3cb3b8042851904eba0e58d277dca80a5cfed590b", + "sha256:7e7401d0de89a9a855c839bc697c079a4af81cf878373abd7dc625847d25cbd8", + "sha256:80bab7bfc629882493af4aa31a4cfa43a4c57c83813253626916b8c7ada83476", + "sha256:82d09873e40955485746739bcb8b4586983670466c23382c19cffecbf1fd8706", + "sha256:8388ee1976c416731879ac16da0aff3f63b286ffdd57cdeb95f3f2e085687563", + "sha256:8824b5a04a04a047e72eea5cec3bc266db09e35de6bdfe34c9436ac5ee27d237", + "sha256:8b9c7197f7cb2738065c481a0461e50ad02f18c78cd75775628afb4d7137fb3b", + "sha256:9056c1ecd25795207ad294bcf39f2db3d845767be0ea6e6a34d856f006006083", + "sha256:936d68689298c36b53b29f23c6dbb74de12b4ac12ca6cfe0e047bedceea56180", + "sha256:9b22676e8097e9e22e36d6b7bda33190d0d400f345f23d4065d48f4ca7ae0425", + "sha256:a4d3091415f010369ae4ed1fc6b79def9416358877534caf6a0fdd2146c87a3e", + "sha256:a8786accb172bd8afb8be14490a16625cbc387036876ab6ba70912730faf8e1f", + "sha256:a9f8c2e67970f13b16084e04f134610fd1d374bf477b17ec1599185cf611d725", + "sha256:bc2fa7c6b47d6bc618dd7fb02ef6fdedb1090ec036abab80d4681424b84c1183", + "sha256:c70c95198c015b85feafc136515252a261a84561b7b1d51e3384e0655ddf25ab", + "sha256:cc1c1159b3d456576af7a3e4d1ba7e6924cb39de8f67111c735f6fc832082774", + "sha256:ce826d6ef20b1bc864f0a68340c8b3287705cae2f8b4b1d932177dcc76721725", + "sha256:d584d9ec91ad65861cc08d42e834324ef890a082e591037abe114850ff7bbc3e", + "sha256:d7fded462629cfa4b685c5416b949ebad6cec74af5e2d42905d41e257e0869f5", + "sha256:d84a1718ee396f54f3a086ea0a66d8e552b2ab2017ef8b420e92edbc841c352d", + "sha256:d8e03406cac8513435335dbab54c0d385e4a49e4945d2909a581c83647ca0290", + "sha256:e10ce637b18caea04431ce14fabcf5c64a1c61ec9c56b071a4b7ca131ca52d44", + "sha256:ec031d5d2feb36d1d1a24380e4db6d43695f3748343d99434e6f5f9156aaa2ed", + "sha256:ef6107725bd54b262d6dedcc2af448a266975032bc85ef0172c5f059da6325b4", + "sha256:efdca5630322a10774e8e98e1af481aad470dd62c3170801852d752aa7a783ba", + "sha256:f753120cb8181e736c57ef7636e83f31b9c0d1722c516f7e86cf15b7aa57ff12", + "sha256:ff3824dc5261f50c9b0dfb3be22b4567a6f938ccce4587b38952d85fd9e9afe4" + ], + "markers": "python_version >= '3.8'", + "version": "==6.0.2" + }, + "referencing": { + "hashes": [ + "sha256:25b42124a6c8b632a425174f24087783efb348a6f1e0008e63cd4466fedf703c", + "sha256:eda6d3234d62814d1c64e305c1331c9a3a6132da475ab6382eaa997b21ee75de" + ], + "markers": "python_version >= '3.8'", + "version": "==0.35.1" + }, + "requests": { + "hashes": [ + "sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760", + "sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6" + ], + "markers": "python_version >= '3.8'", + "version": "==2.32.3" + }, + "rfc3339-validator": { + "hashes": [ + "sha256:138a2abdf93304ad60530167e51d2dfb9549521a836871b88d7f4695d0022f6b", + "sha256:24f6ec1eda14ef823da9e36ec7113124b39c04d50a4d3d3a3c2859577e7791fa" + ], + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'", + "version": "==0.1.4" + }, + "rpds-py": { + "hashes": [ + "sha256:06db23d43f26478303e954c34c75182356ca9aa7797d22c5345b16871ab9c45c", + "sha256:0e13e6952ef264c40587d510ad676a988df19adea20444c2b295e536457bc585", + "sha256:11ef6ce74616342888b69878d45e9f779b95d4bd48b382a229fe624a409b72c5", + "sha256:1259c7b3705ac0a0bd38197565a5d603218591d3f6cee6e614e380b6ba61c6f6", + "sha256:18d7585c463087bddcfa74c2ba267339f14f2515158ac4db30b1f9cbdb62c8ef", + "sha256:1e0f80b739e5a8f54837be5d5c924483996b603d5502bfff79bf33da06164ee2", + "sha256:1e5f3cd7397c8f86c8cc72d5a791071431c108edd79872cdd96e00abd8497d29", + "sha256:220002c1b846db9afd83371d08d239fdc865e8f8c5795bbaec20916a76db3318", + "sha256:22e6c9976e38f4d8c4a63bd8a8edac5307dffd3ee7e6026d97f3cc3a2dc02a0b", + "sha256:238a2d5b1cad28cdc6ed15faf93a998336eb041c4e440dd7f902528b8891b399", + "sha256:2580b0c34583b85efec8c5c5ec9edf2dfe817330cc882ee972ae650e7b5ef739", + "sha256:28527c685f237c05445efec62426d285e47a58fb05ba0090a4340b73ecda6dee", + "sha256:2cf126d33a91ee6eedc7f3197b53e87a2acdac63602c0f03a02dd69e4b138174", + "sha256:338ca4539aad4ce70a656e5187a3a31c5204f261aef9f6ab50e50bcdffaf050a", + "sha256:39ed0d010457a78f54090fafb5d108501b5aa5604cc22408fc1c0c77eac14344", + "sha256:3ad0fda1635f8439cde85c700f964b23ed5fc2d28016b32b9ee5fe30da5c84e2", + "sha256:3d2b1ad682a3dfda2a4e8ad8572f3100f95fad98cb99faf37ff0ddfe9cbf9d03", + "sha256:3d61339e9f84a3f0767b1995adfb171a0d00a1185192718a17af6e124728e0f5", + "sha256:3fde368e9140312b6e8b6c09fb9f8c8c2f00999d1823403ae90cc00480221b22", + "sha256:40ce74fc86ee4645d0a225498d091d8bc61f39b709ebef8204cb8b5a464d3c0e", + "sha256:49a8063ea4296b3a7e81a5dfb8f7b2d73f0b1c20c2af401fb0cdf22e14711a96", + "sha256:4a1f1d51eccb7e6c32ae89243cb352389228ea62f89cd80823ea7dd1b98e0b91", + "sha256:4b16aa0107ecb512b568244ef461f27697164d9a68d8b35090e9b0c1c8b27752", + "sha256:4f1ed4749a08379555cebf4650453f14452eaa9c43d0a95c49db50c18b7da075", + "sha256:4fe84294c7019456e56d93e8ababdad5a329cd25975be749c3f5f558abb48253", + "sha256:50eccbf054e62a7b2209b28dc7a22d6254860209d6753e6b78cfaeb0075d7bee", + "sha256:514b3293b64187172bc77c8fb0cdae26981618021053b30d8371c3a902d4d5ad", + "sha256:54b43a2b07db18314669092bb2de584524d1ef414588780261e31e85846c26a5", + "sha256:55fea87029cded5df854ca7e192ec7bdb7ecd1d9a3f63d5c4eb09148acf4a7ce", + "sha256:569b3ea770c2717b730b61998b6c54996adee3cef69fc28d444f3e7920313cf7", + "sha256:56e27147a5a4c2c21633ff8475d185734c0e4befd1c989b5b95a5d0db699b21b", + "sha256:57eb94a8c16ab08fef6404301c38318e2c5a32216bf5de453e2714c964c125c8", + "sha256:5a35df9f5548fd79cb2f52d27182108c3e6641a4feb0f39067911bf2adaa3e57", + "sha256:5a8c94dad2e45324fc74dce25e1645d4d14df9a4e54a30fa0ae8bad9a63928e3", + "sha256:5b4f105deeffa28bbcdff6c49b34e74903139afa690e35d2d9e3c2c2fba18cec", + "sha256:5c1dc0f53856b9cc9a0ccca0a7cc61d3d20a7088201c0937f3f4048c1718a209", + "sha256:614fdafe9f5f19c63ea02817fa4861c606a59a604a77c8cdef5aa01d28b97921", + "sha256:617c7357272c67696fd052811e352ac54ed1d9b49ab370261a80d3b6ce385045", + "sha256:65794e4048ee837494aea3c21a28ad5fc080994dfba5b036cf84de37f7ad5074", + "sha256:6632f2d04f15d1bd6fe0eedd3b86d9061b836ddca4c03d5cf5c7e9e6b7c14580", + "sha256:6c8ef2ebf76df43f5750b46851ed1cdf8f109d7787ca40035fe19fbdc1acc5a7", + "sha256:758406267907b3781beee0f0edfe4a179fbd97c0be2e9b1154d7f0a1279cf8e5", + "sha256:7e60cb630f674a31f0368ed32b2a6b4331b8350d67de53c0359992444b116dd3", + "sha256:89c19a494bf3ad08c1da49445cc5d13d8fefc265f48ee7e7556839acdacf69d0", + "sha256:8a86a9b96070674fc88b6f9f71a97d2c1d3e5165574615d1f9168ecba4cecb24", + "sha256:8bc7690f7caee50b04a79bf017a8d020c1f48c2a1077ffe172abec59870f1139", + "sha256:8d7919548df3f25374a1f5d01fbcd38dacab338ef5f33e044744b5c36729c8db", + "sha256:9426133526f69fcaba6e42146b4e12d6bc6c839b8b555097020e2b78ce908dcc", + "sha256:9824fb430c9cf9af743cf7aaf6707bf14323fb51ee74425c380f4c846ea70789", + "sha256:9bb4a0d90fdb03437c109a17eade42dfbf6190408f29b2744114d11586611d6f", + "sha256:9bc2d153989e3216b0559251b0c260cfd168ec78b1fac33dd485750a228db5a2", + "sha256:9d35cef91e59ebbeaa45214861874bc6f19eb35de96db73e467a8358d701a96c", + "sha256:a1862d2d7ce1674cffa6d186d53ca95c6e17ed2b06b3f4c476173565c862d232", + "sha256:a84ab91cbe7aab97f7446652d0ed37d35b68a465aeef8fc41932a9d7eee2c1a6", + "sha256:aa7f429242aae2947246587d2964fad750b79e8c233a2367f71b554e9447949c", + "sha256:aa9a0521aeca7d4941499a73ad7d4f8ffa3d1affc50b9ea11d992cd7eff18a29", + "sha256:ac2f4f7a98934c2ed6505aead07b979e6f999389f16b714448fb39bbaa86a489", + "sha256:ae94bd0b2f02c28e199e9bc51485d0c5601f58780636185660f86bf80c89af94", + "sha256:af0fc424a5842a11e28956e69395fbbeab2c97c42253169d87e90aac2886d751", + "sha256:b2a5db5397d82fa847e4c624b0c98fe59d2d9b7cf0ce6de09e4d2e80f8f5b3f2", + "sha256:b4c29cbbba378759ac5786730d1c3cb4ec6f8ababf5c42a9ce303dc4b3d08cda", + "sha256:b74b25f024b421d5859d156750ea9a65651793d51b76a2e9238c05c9d5f203a9", + "sha256:b7f19250ceef892adf27f0399b9e5afad019288e9be756d6919cb58892129f51", + "sha256:b80d4a7900cf6b66bb9cee5c352b2d708e29e5a37fe9bf784fa97fc11504bf6c", + "sha256:b8c00a3b1e70c1d3891f0db1b05292747f0dbcfb49c43f9244d04c70fbc40eb8", + "sha256:bb273176be34a746bdac0b0d7e4e2c467323d13640b736c4c477881a3220a989", + "sha256:c3c20f0ddeb6e29126d45f89206b8291352b8c5b44384e78a6499d68b52ae511", + "sha256:c3e130fd0ec56cb76eb49ef52faead8ff09d13f4527e9b0c400307ff72b408e1", + "sha256:c52d3f2f82b763a24ef52f5d24358553e8403ce05f893b5347098014f2d9eff2", + "sha256:c6377e647bbfd0a0b159fe557f2c6c602c159fc752fa316572f012fc0bf67150", + "sha256:c638144ce971df84650d3ed0096e2ae7af8e62ecbbb7b201c8935c370df00a2c", + "sha256:ce9845054c13696f7af7f2b353e6b4f676dab1b4b215d7fe5e05c6f8bb06f965", + "sha256:cf258ede5bc22a45c8e726b29835b9303c285ab46fc7c3a4cc770736b5304c9f", + "sha256:d0a26ffe9d4dd35e4dfdd1e71f46401cff0181c75ac174711ccff0459135fa58", + "sha256:d0b67d87bb45ed1cd020e8fbf2307d449b68abc45402fe1a4ac9e46c3c8b192b", + "sha256:d20277fd62e1b992a50c43f13fbe13277a31f8c9f70d59759c88f644d66c619f", + "sha256:d454b8749b4bd70dd0a79f428731ee263fa6995f83ccb8bada706e8d1d3ff89d", + "sha256:d4c7d1a051eeb39f5c9547e82ea27cbcc28338482242e3e0b7768033cb083821", + "sha256:d72278a30111e5b5525c1dd96120d9e958464316f55adb030433ea905866f4de", + "sha256:d72a210824facfdaf8768cf2d7ca25a042c30320b3020de2fa04640920d4e121", + "sha256:d807dc2051abe041b6649681dce568f8e10668e3c1c6543ebae58f2d7e617855", + "sha256:dbe982f38565bb50cb7fb061ebf762c2f254ca3d8c20d4006878766e84266272", + "sha256:dcedf0b42bcb4cfff4101d7771a10532415a6106062f005ab97d1d0ab5681c60", + "sha256:deb62214c42a261cb3eb04d474f7155279c1a8a8c30ac89b7dcb1721d92c3c02", + "sha256:def7400461c3a3f26e49078302e1c1b38f6752342c77e3cf72ce91ca69fb1bc1", + "sha256:df3de6b7726b52966edf29663e57306b23ef775faf0ac01a3e9f4012a24a4140", + "sha256:e1940dae14e715e2e02dfd5b0f64a52e8374a517a1e531ad9412319dc3ac7879", + "sha256:e4df1e3b3bec320790f699890d41c59d250f6beda159ea3c44c3f5bac1976940", + "sha256:e6900ecdd50ce0facf703f7a00df12374b74bbc8ad9fe0f6559947fb20f82364", + "sha256:ea438162a9fcbee3ecf36c23e6c68237479f89f962f82dae83dc15feeceb37e4", + "sha256:eb851b7df9dda52dc1415ebee12362047ce771fc36914586b2e9fcbd7d293b3e", + "sha256:ec31a99ca63bf3cd7f1a5ac9fe95c5e2d060d3c768a09bc1d16e235840861420", + "sha256:f0475242f447cc6cb8a9dd486d68b2ef7fbee84427124c232bff5f63b1fe11e5", + "sha256:f2fbf7db2012d4876fb0d66b5b9ba6591197b0f165db8d99371d976546472a24", + "sha256:f60012a73aa396be721558caa3a6fd49b3dd0033d1675c6d59c4502e870fcf0c", + "sha256:f8e604fe73ba048c06085beaf51147eaec7df856824bfe7b98657cf436623daf", + "sha256:f90a4cd061914a60bd51c68bcb4357086991bd0bb93d8aa66a6da7701370708f", + "sha256:f918a1a130a6dfe1d7fe0f105064141342e7dd1611f2e6a21cd2f5c8cb1cfb3e", + "sha256:fa518bcd7600c584bf42e6617ee8132869e877db2f76bcdc281ec6a4113a53ab", + "sha256:faefcc78f53a88f3076b7f8be0a8f8d35133a3ecf7f3770895c25f8813460f08", + "sha256:fcaeb7b57f1a1e071ebd748984359fef83ecb026325b9d4ca847c95bc7311c92", + "sha256:fd2d84f40633bc475ef2d5490b9c19543fbf18596dcb1b291e3a12ea5d722f7a", + "sha256:fdfc3a892927458d98f3d55428ae46b921d1f7543b89382fdb483f5640daaec8" + ], + "markers": "python_version >= '3.8'", + "version": "==0.20.0" + }, + "six": { + "hashes": [ + "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926", + "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254" + ], + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2'", + "version": "==1.16.0" + }, + "urllib3": { + "hashes": [ + "sha256:ca899ca043dcb1bafa3e262d73aa25c465bfb49e0bd9dd5d59f1d0acba2f8fac", + "sha256:e7d814a81dad81e6caf2ec9fdedb284ecc9c73076b62654547cc64ccdcae26e9" + ], + "markers": "python_version >= '3.8'", + "version": "==2.2.3" + } + }, + "develop": {} +} diff --git a/tools/src/validate-spec-py/validate.py b/tools/src/validate-spec-py/validate.py new file mode 100644 index 000000000..9739c51f6 --- /dev/null +++ b/tools/src/validate-spec-py/validate.py @@ -0,0 +1,20 @@ +import sys + +from openapi_spec_validator import validate +from openapi_spec_validator.readers import read_from_filename +from openapi_spec_validator.validation.exceptions import OpenAPIValidationError + +if len(sys.argv) < 2: + print("syntax: validate.py [spec]") + exit(1) + +spec = sys.argv[1] +print(f'Validating {spec} ...') + +spec_dict, base_uri = read_from_filename(spec) + +try: + validate(spec_dict) +except OpenAPIValidationError as err: + print(err) + exit(2) diff --git a/tools/src/validate-spec-ruby/Gemfile b/tools/src/validate-spec-ruby/Gemfile new file mode 100644 index 000000000..a7a8f3b53 --- /dev/null +++ b/tools/src/validate-spec-ruby/Gemfile @@ -0,0 +1,3 @@ +source 'https://rubygems.org' + +gem 'json_schemer' diff --git a/tools/src/validate-spec-ruby/Gemfile.lock b/tools/src/validate-spec-ruby/Gemfile.lock new file mode 100644 index 000000000..f6926e79f --- /dev/null +++ b/tools/src/validate-spec-ruby/Gemfile.lock @@ -0,0 +1,22 @@ +GEM + remote: https://rubygems.org/ + specs: + bigdecimal (3.1.8) + hana (1.3.7) + json_schemer (2.3.0) + bigdecimal + hana (~> 1.3) + regexp_parser (~> 2.0) + simpleidn (~> 0.2) + regexp_parser (2.9.2) + simpleidn (0.2.3) + +PLATFORMS + arm64-darwin-21 + ruby + +DEPENDENCIES + json_schemer + +BUNDLED WITH + 2.5.2 diff --git a/tools/src/validate-spec-ruby/validate.rb b/tools/src/validate-spec-ruby/validate.rb new file mode 100644 index 000000000..261cfd360 --- /dev/null +++ b/tools/src/validate-spec-ruby/validate.rb @@ -0,0 +1,20 @@ +require 'json_schemer' +require 'yaml' + +raise 'syntax: validate [spec]' unless ARGV.length >= 1 + +spec = ARGV[0] +puts "Validating #{spec} ..." + +schemer = JSONSchemer.openapi(YAML.load_file(spec)) +schemer.validate + +total_errors = 0 +schemer.validate.each do |error| + puts "#{error['data']}: #{error['error']}" if total_errors < 10 + total_errors += 1 +end + +puts total_errors > 0 ? " .... #{total_errors} total." : "Done." + +exit total_errors == 0 ? 0 : 1 diff --git a/tools/tests/merger/fixtures/extractor/opensearch/expected_1.3.yaml b/tools/tests/merger/fixtures/extractor/opensearch/expected_1.3.yaml index 24d08aa4d..eafc740f0 100644 --- a/tools/tests/merger/fixtures/extractor/opensearch/expected_1.3.yaml +++ b/tools/tests/merger/fixtures/extractor/opensearch/expected_1.3.yaml @@ -12,33 +12,33 @@ paths: x-version-added: '1.0' description: Returns information about nodes in the cluster. parameters: - - $ref: '#/components/parameters/nodes.info::path.id' + - $ref: '#/components/parameters/nodes.info___path.id' responses: '200': - $ref: '#/components/responses/nodes.info@200' + $ref: '#/components/responses/nodes.info___200' /index: get: operationId: get.0 responses: '200': - $ref: '#/components/responses/info@200' + $ref: '#/components/responses/info___200' '201': - $ref: '#/components/responses/info@201' + $ref: '#/components/responses/info___201' '404': - $ref: '#/components/responses/info@404' + $ref: '#/components/responses/info___404' '500': - $ref: '#/components/responses/info@500' + $ref: '#/components/responses/info___500' '503': - $ref: '#/components/responses/info@503' + $ref: '#/components/responses/info___503' removed-2.0: - $ref: '#/components/responses/info@removed-2.0' + $ref: '#/components/responses/info___removed-2.0' x-version-removed: '2.0' removed-2.0-refs: - $ref: '#/components/responses/info@removed-2.0-refs' + $ref: '#/components/responses/info___removed-2.0-refs' added-1.3-removed-2.0: - $ref: '#/components/responses/info@added-1.3-removed-2.0' + $ref: '#/components/responses/info___added-1.3-removed-2.0' distributed-excluded-amazon-serverless: - $ref: '#/components/responses/info@distributed-all' + $ref: '#/components/responses/info___distributed-all' x-distributions-excluded: - amazon-serverless parameters: [] @@ -47,11 +47,11 @@ paths: operationId: nodes.0 responses: '200': - $ref: '#/components/responses/nodes.info@200' + $ref: '#/components/responses/nodes.info___200' parameters: [] components: parameters: - nodes.info::path.id: + nodes.info___path.id: in: path name: id description: Node ID. @@ -60,19 +60,20 @@ components: type: string requestBodies: {} responses: - info@200: + info___200: content: application/json: schema: type: object properties: _type: - $ref: '#/components/schemas/_common:Type' + $ref: '#/components/schemas/_common___Type' tagline: type: string required: - tagline - info@201: + description: '' + info___201: content: application/json: schema: @@ -83,7 +84,8 @@ components: required: - tagline unevaluatedProperties: true - info@404: + description: '' + info___404: content: application/json: schema: @@ -95,7 +97,8 @@ components: - tagline unevaluatedProperties: type: object - info@500: + description: '' + info___500: content: application/json: schema: @@ -103,34 +106,36 @@ components: properties: tagline: type: string - info@503: + description: '' + info___503: content: application/json: schema: type: object - info@added-1.3-removed-2.0: + description: '' + info___added-1.3-removed-2.0: description: Added in 1.3, removed in 2.0 via attribute in response body. x-version-added: '1.3' x-version-removed: '2.0' - info@distributed-all: + info___distributed-all: description: Distributed in opensearch.org, AOS and AOSS. - info@removed-2.0: + info___removed-2.0: description: Removed in 2.0 via attribute next to ref. - info@removed-2.0-refs: + info___removed-2.0-refs: description: One of the ref values removed in 2.0. schema: oneOf: - - $ref: '#/components/schemas/_common:Type' - - $ref: '#/components/schemas/_common:OldId' - nodes.info@200: + - $ref: '#/components/schemas/_common___Type' + - $ref: '#/components/schemas/_common___OldId' + nodes.info___200: description: All nodes. content: application/json: schema: type: object schemas: - _common:OldId: + _common___OldId: type: string - _common:Type: + _common___Type: type: string x-version-removed: '2.0' diff --git a/tools/tests/merger/fixtures/extractor/opensearch/expected_2.0.yaml b/tools/tests/merger/fixtures/extractor/opensearch/expected_2.0.yaml index a824f4787..b287d6982 100644 --- a/tools/tests/merger/fixtures/extractor/opensearch/expected_2.0.yaml +++ b/tools/tests/merger/fixtures/extractor/opensearch/expected_2.0.yaml @@ -12,25 +12,25 @@ paths: x-version-added: '1.0' description: Returns information about nodes in the cluster. parameters: - - $ref: '#/components/parameters/nodes.info::path.id' + - $ref: '#/components/parameters/nodes.info___path.id' responses: '200': - $ref: '#/components/responses/nodes.info@200' + $ref: '#/components/responses/nodes.info___200' post: operationId: nodes.info.1 x-operation-group: nodes.info x-version-added: '2.0' description: Returns information about nodes in the cluster. parameters: - - $ref: '#/components/parameters/nodes.info::path.id' - - $ref: '#/components/parameters/nodes.info::query.flag' + - $ref: '#/components/parameters/nodes.info___path.id' + - $ref: '#/components/parameters/nodes.info___query.flag' requestBody: $ref: '#/components/requestBodies/nodes.info' responses: '200': - $ref: '#/components/responses/nodes.info@200' + $ref: '#/components/responses/nodes.info___200' '201': - $ref: '#/components/responses/nodes.info@201' + $ref: '#/components/responses/nodes.info___201' /cluster_manager: get: operationId: cluster_manager.0 @@ -45,22 +45,22 @@ paths: operationId: get.0 responses: '200': - $ref: '#/components/responses/info@200' + $ref: '#/components/responses/info___200' '201': - $ref: '#/components/responses/info@201' + $ref: '#/components/responses/info___201' '404': - $ref: '#/components/responses/info@404' + $ref: '#/components/responses/info___404' '500': - $ref: '#/components/responses/info@500' + $ref: '#/components/responses/info___500' '503': - $ref: '#/components/responses/info@503' + $ref: '#/components/responses/info___503' added-2.0: - $ref: '#/components/responses/info@added-2.0' + $ref: '#/components/responses/info___added-2.0' x-version-added: '2.0' removed-2.0-refs: - $ref: '#/components/responses/info@removed-2.0-refs' + $ref: '#/components/responses/info___removed-2.0-refs' distributed-excluded-amazon-serverless: - $ref: '#/components/responses/info@distributed-all' + $ref: '#/components/responses/info___distributed-all' x-distributions-excluded: - amazon-serverless parameters: [] @@ -69,18 +69,18 @@ paths: operationId: nodes.0 responses: '200': - $ref: '#/components/responses/nodes.info@200' + $ref: '#/components/responses/nodes.info___200' parameters: [] components: parameters: - nodes.info::path.id: + nodes.info___path.id: in: path name: id description: Node ID. required: true schema: type: string - nodes.info::query.flag: + nodes.info___query.flag: in: query name: flag description: Flag. @@ -98,11 +98,11 @@ components: _all: type: boolean ids: - $ref: '#/components/schemas/_common:Ids' + $ref: '#/components/schemas/_common___Ids' x-version-added: '2.0' description: Nodes options. responses: - info@200: + info___200: content: application/json: schema: @@ -112,7 +112,8 @@ components: type: string required: - tagline - info@201: + description: '' + info___201: content: application/json: schema: @@ -123,7 +124,8 @@ components: required: - tagline unevaluatedProperties: true - info@404: + description: '' + info___404: content: application/json: schema: @@ -135,7 +137,8 @@ components: - tagline unevaluatedProperties: type: object - info@500: + description: '' + info___500: content: application/json: schema: @@ -143,38 +146,40 @@ components: properties: tagline: type: string - info@503: + description: '' + info___503: content: application/json: schema: type: object - info@added-2.0: + description: '' + info___added-2.0: description: Added in 2.0 via attribute next to ref. - info@distributed-all: + info___distributed-all: description: Distributed in opensearch.org, AOS and AOSS. - info@removed-2.0-refs: + info___removed-2.0-refs: description: One of the ref values removed in 2.0. schema: oneOf: - - $ref: '#/components/schemas/_common:OldId' - nodes.info@200: + - $ref: '#/components/schemas/_common___OldId' + nodes.info___200: description: All nodes. content: application/json: schema: type: object - nodes.info@201: + nodes.info___201: description: All nodes. content: application/json: schema: type: object schemas: - _common:Ids: + _common___Ids: oneOf: - - $ref: '#/components/schemas/_common:OldId' + - $ref: '#/components/schemas/_common___OldId' - type: array items: - $ref: '#/components/schemas/_common:Ids' - _common:OldId: + $ref: '#/components/schemas/_common___Ids' + _common___OldId: type: string diff --git a/tools/tests/merger/fixtures/merger/animals/expected.yaml b/tools/tests/merger/fixtures/merger/animals/expected.yaml index 789d1f203..a28b20af2 100644 --- a/tools/tests/merger/fixtures/merger/animals/expected.yaml +++ b/tools/tests/merger/fixtures/merger/animals/expected.yaml @@ -7,54 +7,54 @@ paths: /{index}: post: parameters: - - $ref: '#/components/parameters/indices.create::path.index' - - $ref: '#/components/parameters/indices.create::query.pretty' - - $ref: '#/components/parameters/indices.create::query.wait_for_active_shards' - - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/indices.create___path.index' + - $ref: '#/components/parameters/indices.create___query.pretty' + - $ref: '#/components/parameters/indices.create___query.wait_for_active_shards' + - $ref: '#/components/parameters/_global___query.human' requestBody: $ref: '#/components/requestBodies/indices.create' responses: '200': - $ref: '#/components/responses/indices.create@200' + $ref: '#/components/responses/indices.create___200' '201': - $ref: '#/components/responses/indices.create@201' + $ref: '#/components/responses/indices.create___201' x-version-added: '2.0' /adopt/{animal}/dockets/{docket}: get: operationId: adopt.0 parameters: - - $ref: '#/components/parameters/adopt::path.animal' - - $ref: '#/components/parameters/adopt::path.docket' - - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/adopt___path.animal' + - $ref: '#/components/parameters/adopt___path.docket' + - $ref: '#/components/parameters/_global___query.human' responses: '200': - $ref: '#/components/responses/adopt@200' + $ref: '#/components/responses/adopt___200' post: operationId: adopt.1 parameters: - - $ref: '#/components/parameters/adopt::path.animal' - - $ref: '#/components/parameters/adopt::path.docket' - - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/adopt___path.animal' + - $ref: '#/components/parameters/adopt___path.docket' + - $ref: '#/components/parameters/_global___query.human' requestBody: $ref: '#/components/requestBodies/adopt' responses: '200': - $ref: '#/components/responses/adopt@200' + $ref: '#/components/responses/adopt___200' /replaced/adopting/{animal}/something/{docket}: get: operationId: adopt.0_superseded parameters: - - $ref: '#/components/parameters/adopt::path.animal' - - $ref: '#/components/parameters/adopt::path.docket' - - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/adopt___path.animal' + - $ref: '#/components/parameters/adopt___path.docket' + - $ref: '#/components/parameters/_global___query.human' responses: '200': - $ref: '#/components/responses/adopt@200' + $ref: '#/components/responses/adopt___200' deprecated: true x-ignorable: true components: parameters: - _global::query.human: + _global___query.human: name: human in: query description: Whether to return human readable values for statistics. @@ -62,27 +62,27 @@ components: type: boolean default: true x-global: true - adopt::path.animal: + adopt___path.animal: name: animal in: path schema: - $ref: '#/components/schemas/animals:Animal' - adopt::path.docket: + $ref: '#/components/schemas/animals___Animal' + adopt___path.docket: name: docket in: path schema: type: number - indices.create::path.index: + indices.create___path.index: name: index in: path schema: type: string - indices.create::query.pretty: + indices.create___query.pretty: name: pretty in: query schema: type: boolean - indices.create::query.wait_for_active_shards: + indices.create___query.wait_for_active_shards: name: pretty in: query x-version-added: '2.0' @@ -94,35 +94,37 @@ components: name: type: string responses: - adopt@200: + adopt___200: application/json: schema: type: object - indices.create@200: + description: '' + indices.create___200: application/json: schema: type: object - indices.create@201: + description: '' + indices.create___201: description: Added in 2.0. application/json: schema: type: object schemas: - actions:Bark: + actions___Bark: type: string - actions:Meow: + actions___Meow: type: string - animals:Animal: + animals___Animal: oneOf: - - $ref: '#/components/schemas/animals:Dog' - - $ref: '#/components/schemas/animals:Cat' - animals:Cat: + - $ref: '#/components/schemas/animals___Dog' + - $ref: '#/components/schemas/animals___Cat' + animals___Cat: type: object properties: meow: - $ref: '#/components/schemas/actions:Meow' - animals:Dog: + $ref: '#/components/schemas/actions___Meow' + animals___Dog: type: object properties: bark: - $ref: '#/components/schemas/actions:Bark' + $ref: '#/components/schemas/actions___Bark' diff --git a/tools/tests/tester/ChapterReader.test.ts b/tools/tests/tester/ChapterReader.test.ts index 38a0b82fc..2b0c2eb42 100644 --- a/tools/tests/tester/ChapterReader.test.ts +++ b/tools/tests/tester/ChapterReader.test.ts @@ -248,6 +248,35 @@ describe('ChapterReader', () => { message: 'Not Found' }); }); + + it('sets payload to entire response when payload.error is present', async () => { + const mock_payload = { '_data': '1', 'result': 'updated', 'error': 'error' }; + const mock_error = { + response: { + status: 404, + headers: { + 'content-type': 'application/json' + }, + data: JSON.stringify(mock_payload), + statusText: 'Not Found' + } + }; + + mocked_axios.request.mockRejectedValue(mock_error); + + const result = await reader.read({ + id: 'id', + path: 'path', + method: 'POST' + }, new StoryOutputs()); + + expect(result).toStrictEqual({ + status: 404, + content_type: 'application/json', + payload: mock_payload, + message: 'Not Found' + }); + }); }) describe('deserialize_payload', () => { diff --git a/tools/tests/tester/MergedOpenApiSpec.test.ts b/tools/tests/tester/MergedOpenApiSpec.test.ts index 3857cae52..54d65b60e 100644 --- a/tools/tests/tester/MergedOpenApiSpec.test.ts +++ b/tools/tests/tester/MergedOpenApiSpec.test.ts @@ -40,27 +40,27 @@ describe('merged API spec', () => { const responses: any = spec.spec().components?.responses test('is added with required fields', () => { - const schema = responses['info@200'].content['application/json'].schema + const schema = responses.info___200.content['application/json'].schema expect(schema.unevaluatedProperties).toEqual({ not: true, errorMessage: 'property is not defined in the spec' }) }) test('is added when no required fields', () => { - const schema = responses['info@500'].content['application/json'].schema + const schema = responses.info___500.content['application/json'].schema expect(schema.unevaluatedProperties).toEqual({ not: true, errorMessage: 'property is not defined in the spec' }) }) test('is not added to empty object schema', () => { - const schema = responses['info@503'].content['application/json'].schema + const schema = responses.info___503.content['application/json'].schema expect(schema.unevaluatedProperties).toBeUndefined() }) test('is not added when true', () => { - const schema = responses['info@201'].content['application/json'].schema + const schema = responses.info___201.content['application/json'].schema expect(schema.unevaluatedProperties).toEqual(true) }) test('is not added when object', () => { - const schema = responses['info@404'].content['application/json'].schema + const schema = responses.info___404.content['application/json'].schema expect(schema.unevaluatedProperties).toEqual({ type: 'object' }) }) }) diff --git a/tools/tests/tester/helpers.ts b/tools/tests/tester/helpers.ts index 354fcabe4..399c1359e 100644 --- a/tools/tests/tester/helpers.ts +++ b/tools/tests/tester/helpers.ts @@ -54,7 +54,7 @@ export function construct_tester_components (spec_path: string): { const story_validator = new StoryValidator() const story_evaluator = new StoryEvaluator(chapter_evaluator, supplemental_chapter_evaluator) const result_logger = new NoOpResultLogger() - const test_runner = new TestRunner(opensearch_http_client, story_validator, story_evaluator, result_logger) + const test_runner = new TestRunner(opensearch_http_client, story_validator, story_evaluator, result_logger, logger) return { specification, operation_locator, From d17091672f410b4cc72cdff69c6b1d53b07add18 Mon Sep 17 00:00:00 2001 From: Ralph Ursprung <39383228+rursprung@users.noreply.github.com> Date: Thu, 7 Nov 2024 12:23:37 +0100 Subject: [PATCH 03/20] README: fix "validate spec" status badge (#657) the workflow got renamed in commit 2a39edd (#646), thus the link is no longer valid. this was not caught by the "check links" test as the link was still valid until the PR got merged. this currently blocks all other PRs. Signed-off-by: Ralph Ursprung --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ca512a1e3..a95f722b8 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![Test Tools (Unit)](https://github.com/opensearch-project/opensearch-api-specification/actions/workflows/test-tools-unit.yml/badge.svg)](https://github.com/opensearch-project/opensearch-api-specification/actions/workflows/test-tools-unit.yml) [![Test Tools (Integration)](https://github.com/opensearch-project/opensearch-api-specification/actions/workflows/test-tools-integ.yml/badge.svg)](https://github.com/opensearch-project/opensearch-api-specification/actions/workflows/test-tools-integ.yml) [![Test Spec](https://github.com/opensearch-project/opensearch-api-specification/actions/workflows/test-spec.yml/badge.svg)](https://github.com/opensearch-project/opensearch-api-specification/actions/workflows/test-spec.yml) -[![Validate Spec](https://github.com/opensearch-project/opensearch-api-specification/actions/workflows/validate-spec.yml/badge.svg)](https://github.com/opensearch-project/opensearch-api-specification/actions/workflows/validate-spec.yml) +[![Validate Spec](https://github.com/opensearch-project/opensearch-api-specification/actions/workflows/validate-spec-lint.yml/badge.svg)](https://github.com/opensearch-project/opensearch-api-specification/actions/workflows/validate-spec-lint.yml) - [OpenSearch API Specification](#opensearch-api-specification) - [Welcome!](#welcome) From e41257a2edc8497477fa486d644d06e2e9b1343c Mon Sep 17 00:00:00 2001 From: "Daniel (dB.) Doubrovkine" Date: Thu, 7 Nov 2024 15:36:38 -0500 Subject: [PATCH 04/20] Added `_search` with `sort: direction`. (#658) Signed-off-by: dblock --- CHANGELOG.md | 1 + spec/schemas/_common.yaml | 6 ++ tests/default/_core/search/search_after.yaml | 39 +++++++++ tests/default/_core/search/sort_by_field.yaml | 79 +++++++++++-------- 4 files changed, 90 insertions(+), 35 deletions(-) create mode 100644 tests/default/_core/search/search_after.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md index 811c2cb21..c34b38a77 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Added API specs for query groups lifecycle APIs ([#649](https://github.com/opensearch-project/opensearch-api-specification/pull/649)) - Added Python and Ruby spec validators ([#646](https://github.com/opensearch-project/opensearch-api-specification/pull/646)) - Added verbose output of the story being evaluated ([#646](https://github.com/opensearch-project/opensearch-api-specification/pull/646)) +- Added `_search` with `sort: direction` ([#658](https://github.com/opensearch-project/opensearch-api-specification/pull/658)) ### Removed - Removed unsupported `_common.mapping:SourceField`'s `mode` field and associated `_common.mapping:SourceFieldMode` enum ([#652](https://github.com/opensearch-project/opensearch-api-specification/pull/652)) diff --git a/spec/schemas/_common.yaml b/spec/schemas/_common.yaml index 6450e9c6d..883ac273a 100644 --- a/spec/schemas/_common.yaml +++ b/spec/schemas/_common.yaml @@ -558,10 +558,16 @@ components: oneOf: - title: field $ref: '#/components/schemas/Field' + - title: field_with_direction + $ref: '#/components/schemas/FieldWithDirection' - title: field_with_order $ref: '#/components/schemas/FieldWithOrder' - title: options $ref: '#/components/schemas/SortOptions' + FieldWithDirection: + type: object + additionalProperties: + $ref: '#/components/schemas/SortOrder' FieldWithOrder: type: object additionalProperties: diff --git a/tests/default/_core/search/search_after.yaml b/tests/default/_core/search/search_after.yaml new file mode 100644 index 000000000..0da17c906 --- /dev/null +++ b/tests/default/_core/search/search_after.yaml @@ -0,0 +1,39 @@ +$schema: ../../../../json_schemas/test_story.schema.yaml + +description: Test search endpoint with search_after. +epilogues: + - path: /movies + method: DELETE + status: [200, 404] +prologues: + - path: /_bulk + method: POST + parameters: + refresh: true + request: + content_type: application/x-ndjson + payload: + - {create: {_index: movies}} + - {title: The Cruise, year: 1998} + - {create: {_index: movies}} + - {title: Drive, year: 1960} +chapters: + - synopsis: Search with search_after. + path: /{index}/_search + parameters: + index: movies + request: + payload: + sort: + - year: asc + search_after: + - 1960 + method: POST + response: + status: 200 + payload: + hits: + hits: + - _source: + title: The Cruise + year: 1998 diff --git a/tests/default/_core/search/sort_by_field.yaml b/tests/default/_core/search/sort_by_field.yaml index 4256929ee..ff9329286 100644 --- a/tests/default/_core/search/sort_by_field.yaml +++ b/tests/default/_core/search/sort_by_field.yaml @@ -3,12 +3,12 @@ $schema: ../../../../json_schemas/test_story.schema.yaml description: Test different ways to sort by field. epilogues: - - path: /sorted_movies + - path: /movies method: DELETE status: [200] prologues: - - path: /sorted_movies + - path: /movies method: PUT request: payload: @@ -18,40 +18,25 @@ prologues: type: keyword year: type: integer - - - path: /sorted_movies/_doc - method: POST - parameters: - refresh: true - request: - payload: - title: The Lion King - year: 1994 - status: [201] - - path: /sorted_movies/_doc - method: POST - parameters: - refresh: true - request: - payload: - title: The Lion King - year: 2019 - status: [201] - - path: /sorted_movies/_doc + - path: /_bulk method: POST parameters: refresh: true request: + content_type: application/x-ndjson payload: - title: Frozen - year: 2013 - status: [201] + - {create: {_index: movies}} + - {title: The Lion King, year: 1994} + - {create: {_index: movies}} + - {title: The Lion King, year: 2019} + - {create: {_index: movies}} + - {title: Frozen, year: 2013} chapters: - - synopsis: QueryString Sort by year. + - synopsis: Sort by year. path: /{index}/_search parameters: - index: sorted_movies + index: movies sort: year method: GET response: @@ -69,10 +54,10 @@ chapters: title: The Lion King year: 2019 - - synopsis: QueryString Sort by title:desc. + - synopsis: Sort by title:desc. path: /{index}/_search parameters: - index: sorted_movies + index: movies sort: title:desc method: GET response: @@ -90,10 +75,10 @@ chapters: title: Frozen year: 2013 - - synopsis: QueryString Sort by title:desc,year:desc. + - synopsis: Sort by title:desc,year:desc. path: /{index}/_search parameters: - index: sorted_movies + index: movies sort: title:desc,year:desc method: GET response: @@ -111,10 +96,10 @@ chapters: title: Frozen year: 2013 - - synopsis: Body Sort by [title, year]. + - synopsis: Sort by [title, year]. path: /{index}/_search parameters: - index: sorted_movies + index: movies method: GET request: payload: @@ -136,10 +121,10 @@ chapters: title: The Lion King year: 2019 - - synopsis: Body Sort by year:asc,title:desc. + - synopsis: Sort by year:asc,title:desc. path: /{index}/_search parameters: - index: sorted_movies + index: movies method: GET request: payload: @@ -161,3 +146,27 @@ chapters: title: The Lion King year: 1994 + - synopsis: Sort with direction by year:asc,title:desc. + path: /{index}/_search + parameters: + index: movies + method: GET + request: + payload: + sort: + - title: asc + - year: desc + response: + status: 200 + payload: + hits: + hits: + - _source: + title: Frozen + year: 2013 + - _source: + title: The Lion King + year: 2019 + - _source: + title: The Lion King + year: 1994 From 62f1f5f7418f48ee8002f2833eb58043ab47d82e Mon Sep 17 00:00:00 2001 From: gargharsh3134 <51459091+gargharsh3134@users.noreply.github.com> Date: Mon, 11 Nov 2024 19:07:01 +0530 Subject: [PATCH 05/20] Adding specs for new _list/indices and _list/shards APIs (#613) * Adding specs for new _list/indices and _list/shards APIs Signed-off-by: Harsh Garg * Adding changeLog and fix lint Signed-off-by: Harsh Garg * Adding spec tests for list APIs Signed-off-by: Harsh Garg * Updating descriptions of specs Signed-off-by: Harsh Garg * Fixing description of list.indices Signed-off-by: Harsh Garg * Reverting SHA for 3.0.0 Signed-off-by: Harsh Garg * Fixing style errors Signed-off-by: Harsh Garg * Updating SHA for 3.0.0 Signed-off-by: Harsh Garg * Updating SHA for 3.0.0 Signed-off-by: Harsh Garg * Fixing SHA and content schema Signed-off-by: Harsh Garg * Loudly disabling new tests for 3.0 with ToDo Signed-off-by: Harsh Garg --------- Signed-off-by: Harsh Garg Co-authored-by: Harsh Garg --- CHANGELOG.md | 1 + spec/namespaces/list.yaml | 487 ++++++++++++++++++++++++++++++++ tests/default/list/indices.yaml | 141 +++++++++ tests/default/list/shards.yaml | 51 ++++ 4 files changed, 680 insertions(+) create mode 100644 spec/namespaces/list.yaml create mode 100644 tests/default/list/indices.yaml create mode 100644 tests/default/list/shards.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md index c34b38a77..e455a6d4f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -152,6 +152,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Changed `cluster.reroute`'s `metric` path param to use an enum of metrics ([#586](https://github.com/opensearch-project/opensearch-api-specification/pull/586)) - Changed `indices.stats`'s `metric` path param to use an enum of metrics ([#586](https://github.com/opensearch-project/opensearch-api-specification/pull/586)) - Changed `CleanupRepositoryResults`' properties to be `int64`s ([#587](https://github.com/opensearch-project/opensearch-api-specification/pull/587)) +- Added `/_list/indices` & `/_list/shards` api specs ([#613](https://github.com/opensearch-project/opensearch-api-specification/pull/613)) ### Deprecated diff --git a/spec/namespaces/list.yaml b/spec/namespaces/list.yaml new file mode 100644 index 000000000..b0dddcd86 --- /dev/null +++ b/spec/namespaces/list.yaml @@ -0,0 +1,487 @@ +openapi: 3.1.0 +info: + title: OpenSearch List API + description: OpenSearch List API. + version: 1.0.0 +paths: + /_list: + get: + operationId: list.help.0 + x-operation-group: list.help + x-version-added: '2.18' + description: Returns help for the List APIs. + externalDocs: + url: https://opensearch.org/docs/latest/api-reference/list/index/ + responses: + '200': + $ref: '#/components/responses/list.help@200' + /_list/indices: + get: + operationId: list.indices.0 + x-operation-group: list.indices + x-version-added: '2.18' + description: Returns paginated information about indexes including number of primaries and replicas, document counts, disk size. + externalDocs: + url: https://opensearch.org/docs/latest/api-reference/list/list-indices/ + parameters: + - $ref: '#/components/parameters/list.indices::query.bytes' + - $ref: '#/components/parameters/list.indices::query.cluster_manager_timeout' + - $ref: '#/components/parameters/list.indices::query.expand_wildcards' + - $ref: '#/components/parameters/list.indices::query.format' + - $ref: '#/components/parameters/list.indices::query.h' + - $ref: '#/components/parameters/list.indices::query.health' + - $ref: '#/components/parameters/list.indices::query.help' + - $ref: '#/components/parameters/list.indices::query.include_unloaded_segments' + - $ref: '#/components/parameters/list.indices::query.local' + - $ref: '#/components/parameters/list.indices::query.master_timeout' + - $ref: '#/components/parameters/list.indices::query.next_token' + - $ref: '#/components/parameters/list.indices::query.pri' + - $ref: '#/components/parameters/list.indices::query.s' + - $ref: '#/components/parameters/list.indices::query.size' + - $ref: '#/components/parameters/list.indices::query.sort' + - $ref: '#/components/parameters/list.indices::query.time' + - $ref: '#/components/parameters/list.indices::query.v' + responses: + '200': + $ref: '#/components/responses/list.indices@200' + /_list/indices/{index}: + get: + operationId: list.indices.1 + x-operation-group: list.indices + x-version-added: '2.18' + description: Returns paginated information about indexes including number of primaries and replicas, document counts, disk size. + externalDocs: + url: https://opensearch.org/docs/latest/api-reference/list/list-indices/ + parameters: + - $ref: '#/components/parameters/list.indices::path.index' + - $ref: '#/components/parameters/list.indices::query.bytes' + - $ref: '#/components/parameters/list.indices::query.cluster_manager_timeout' + - $ref: '#/components/parameters/list.indices::query.expand_wildcards' + - $ref: '#/components/parameters/list.indices::query.format' + - $ref: '#/components/parameters/list.indices::query.h' + - $ref: '#/components/parameters/list.indices::query.health' + - $ref: '#/components/parameters/list.indices::query.help' + - $ref: '#/components/parameters/list.indices::query.include_unloaded_segments' + - $ref: '#/components/parameters/list.indices::query.local' + - $ref: '#/components/parameters/list.indices::query.master_timeout' + - $ref: '#/components/parameters/list.indices::query.next_token' + - $ref: '#/components/parameters/list.indices::query.pri' + - $ref: '#/components/parameters/list.indices::query.s' + - $ref: '#/components/parameters/list.indices::query.size' + - $ref: '#/components/parameters/list.indices::query.sort' + - $ref: '#/components/parameters/list.indices::query.time' + - $ref: '#/components/parameters/list.indices::query.v' + responses: + '200': + $ref: '#/components/responses/list.indices@200' + /_list/shards: + get: + operationId: list.shards.0 + x-operation-group: list.shards + x-version-added: '2.18' + description: Returns paginated details of shard allocation on nodes. + externalDocs: + url: https://opensearch.org/docs/latest/api-reference/list/list-shards/ + parameters: + - $ref: '#/components/parameters/list.shards::query.bytes' + - $ref: '#/components/parameters/list.shards::query.cluster_manager_timeout' + - $ref: '#/components/parameters/list.shards::query.format' + - $ref: '#/components/parameters/list.shards::query.h' + - $ref: '#/components/parameters/list.shards::query.help' + - $ref: '#/components/parameters/list.shards::query.local' + - $ref: '#/components/parameters/list.shards::query.master_timeout' + - $ref: '#/components/parameters/list.shards::query.next_token' + - $ref: '#/components/parameters/list.shards::query.s' + - $ref: '#/components/parameters/list.shards::query.size' + - $ref: '#/components/parameters/list.shards::query.sort' + - $ref: '#/components/parameters/list.shards::query.time' + - $ref: '#/components/parameters/list.shards::query.v' + responses: + '200': + $ref: '#/components/responses/list.shards@200' + /_list/shards/{index}: + get: + operationId: list.shards.1 + x-operation-group: list.shards + x-version-added: '2.18' + description: Returns paginated details of shard allocation on nodes. + externalDocs: + url: https://opensearch.org/docs/latest/api-reference/list/list-shards/ + parameters: + - $ref: '#/components/parameters/list.shards::path.index' + - $ref: '#/components/parameters/list.shards::query.bytes' + - $ref: '#/components/parameters/list.shards::query.cluster_manager_timeout' + - $ref: '#/components/parameters/list.shards::query.format' + - $ref: '#/components/parameters/list.shards::query.h' + - $ref: '#/components/parameters/list.shards::query.help' + - $ref: '#/components/parameters/list.shards::query.local' + - $ref: '#/components/parameters/list.shards::query.master_timeout' + - $ref: '#/components/parameters/list.shards::query.next_token' + - $ref: '#/components/parameters/list.shards::query.s' + - $ref: '#/components/parameters/list.shards::query.size' + - $ref: '#/components/parameters/list.shards::query.sort' + - $ref: '#/components/parameters/list.shards::query.time' + - $ref: '#/components/parameters/list.shards::query.v' + responses: + '200': + $ref: '#/components/responses/list.shards@200' +components: + responses: + list.help@200: + content: + text/plain: + schema: + type: string + list.indices@200: + content: + text/plain: + schema: + type: string + application/json: + schema: + type: object + properties: + next_token: + type: ['null', string] + indices: + type: array + items: + $ref: '../schemas/cat.indices.yaml#/components/schemas/IndicesRecord' + application/yaml: + schema: + type: object + properties: + next_token: + type: ['null', string] + indices: + type: array + items: + $ref: '../schemas/cat.indices.yaml#/components/schemas/IndicesRecord' + application/cbor: + schema: + type: object + properties: + next_token: + type: ['null', string] + indices: + type: array + items: + $ref: '../schemas/cat.indices.yaml#/components/schemas/IndicesRecord' + application/smile: + schema: + type: object + properties: + next_token: + type: ['null', string] + indices: + type: array + items: + $ref: '../schemas/cat.indices.yaml#/components/schemas/IndicesRecord' + list.shards@200: + content: + text/plain: + schema: + type: string + application/json: + schema: + type: object + properties: + next_token: + type: ['null', string] + shards: + type: array + items: + $ref: '../schemas/cat.shards.yaml#/components/schemas/ShardsRecord' + application/yaml: + schema: + type: object + properties: + next_token: + type: ['null', string] + shards: + type: array + items: + $ref: '../schemas/cat.shards.yaml#/components/schemas/ShardsRecord' + application/cbor: + schema: + type: object + properties: + next_token: + type: ['null', string] + shards: + type: array + items: + $ref: '../schemas/cat.shards.yaml#/components/schemas/ShardsRecord' + application/smile: + schema: + type: object + properties: + next_token: + type: ['null', string] + shards: + type: array + items: + $ref: '../schemas/cat.shards.yaml#/components/schemas/ShardsRecord' + parameters: + list.indices::path.index: + in: path + name: index + description: |- + Comma-separated list of data streams, indexes, and aliases used to limit the request. + Supports wildcards (`*`). To target all data streams and indexes, omit this parameter or use `*` or `_all`. + required: true + schema: + $ref: '../schemas/_common.yaml#/components/schemas/Indices' + style: simple + list.indices::query.bytes: + in: query + name: bytes + description: The unit used to display byte values. + schema: + $ref: '../schemas/_common.yaml#/components/schemas/ByteUnit' + style: form + list.indices::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' + list.indices::query.expand_wildcards: + in: query + name: expand_wildcards + description: The type of index that wildcard patterns can match. + schema: + $ref: '../schemas/_common.yaml#/components/schemas/ExpandWildcards' + style: form + list.indices::query.format: + name: format + in: query + description: A short version of the Accept header, such as `JSON`, `YAML`. + schema: + type: string + description: A short version of the Accept header, such as `JSON`, `YAML`. + list.indices::query.h: + 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 + list.indices::query.health: + in: query + name: health + description: The health status used to limit returned indexes. By default, the response includes indexes of any health status. + schema: + $ref: '../schemas/_common.yaml#/components/schemas/HealthStatus' + style: form + list.indices::query.help: + name: help + in: query + description: Return help information. + schema: + type: boolean + default: false + description: Return help information. + list.indices::query.include_unloaded_segments: + in: query + name: include_unloaded_segments + description: If true, the response includes information from segments that are not loaded into memory. + schema: + type: boolean + default: false + style: form + list.indices::query.local: + 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. + list.indices::query.master_timeout: + name: master_timeout + in: query + description: Operation timeout for connection to cluster manager node. + schema: + $ref: '../schemas/_common.yaml#/components/schemas/Duration' + x-version-deprecated: '2.0' + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. + deprecated: true + list.indices::query.pri: + in: query + name: pri + description: If true, the response only includes information from primary shards. + schema: + type: boolean + default: false + style: form + list.indices::query.s: + 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 + list.indices::query.time: + in: query + name: time + description: The unit used to display time values. + schema: + $ref: '../schemas/_common.yaml#/components/schemas/TimeUnit' + style: form + list.indices::query.v: + name: v + in: query + description: Verbose mode. Display column headers. + schema: + type: boolean + default: false + description: Verbose mode. Display column headers. + list.indices::query.next_token: + name: next_token + in: query + description: Token to retrieve next page of indexes. + schema: + type: ['null', string] + description: Token to retrieve next page of indexes. + list.indices::query.size: + name: size + in: query + description: Maximum number of indexes to be displayed in a page. + schema: + type: integer + format: int32 + list.indices::query.sort: + name: sort + in: query + description: Defines order in which indexes will be displayed. Accepted values are `asc` and `desc`. If `desc`, most recently created indexes would be displayed first. + schema: + type: string + enum: + - asc + - desc + list.shards::path.index: + in: path + name: index + description: |- + A comma-separated list of data streams, indexes, and aliases used to limit the request. + Supports wildcards (`*`). + To target all data streams and indexes, omit this parameter or use `*` or `_all`. + required: true + schema: + $ref: '../schemas/_common.yaml#/components/schemas/Indices' + style: simple + list.shards::query.bytes: + in: query + name: bytes + description: The unit used to display byte values. + schema: + $ref: '../schemas/_common.yaml#/components/schemas/ByteUnit' + style: form + list.shards::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' + list.shards::query.format: + name: format + in: query + description: A short version of the Accept header, such as `JSON`, `YAML`. + schema: + type: string + description: A short version of the Accept header, such as `JSON`, `YAML`. + list.shards::query.h: + 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 + list.shards::query.help: + name: help + in: query + description: Return help information. + schema: + type: boolean + default: false + description: Return help information. + list.shards::query.local: + 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. + list.shards::query.master_timeout: + name: master_timeout + in: query + description: Operation timeout for connection to cluster manager node. + schema: + $ref: '../schemas/_common.yaml#/components/schemas/Duration' + x-version-deprecated: '2.0' + x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + deprecated: true + list.shards::query.s: + 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 + list.shards::query.time: + name: time + in: query + description: The unit in which to display time values. + schema: + $ref: '../schemas/_common.yaml#/components/schemas/TimeUnit' + list.shards::query.v: + name: v + in: query + description: Verbose mode. Display column headers. + schema: + type: boolean + default: false + description: Verbose mode. Display column headers. + list.shards::query.next_token: + name: next_token + in: query + description: Token to retrieve next page of shards. + schema: + type: ['null', string] + description: Token to retrieve next page of shards. + list.shards::query.size: + name: size + in: query + description: Maximum number of shards to be displayed in a page. + schema: + type: integer + format: int32 + list.shards::query.sort: + name: sort + in: query + description: Defines order in which shards will be displayed. Accepted values are `asc` and `desc`. If `desc`, most recently created shards would be displayed first. + schema: + type: string + enum: + - asc + - desc \ No newline at end of file diff --git a/tests/default/list/indices.yaml b/tests/default/list/indices.yaml new file mode 100644 index 000000000..a1407f211 --- /dev/null +++ b/tests/default/list/indices.yaml @@ -0,0 +1,141 @@ +$schema: ../../../json_schemas/test_story.schema.yaml + +description: Test _list/indices endpoints. +# TODO: Re-enable in 3.0, see https://github.com/opensearch-project/opensearch-api-specification/pull/613 +version: '>= 2.18 < 3' +prologues: + - path: /{index} + method: PUT + parameters: + index: books + request: + payload: {} + - path: /{index} + method: PUT + parameters: + index: unassigned + wait_for_active_shards: 0 + request: + payload: + settings: + routing: + allocation: + require: + test: test +epilogues: + - path: /books + method: DELETE + status: [200, 404] + - path: /unassigned + method: DELETE + status: [200, 404] +chapters: + - synopsis: List information related to indexes (text/plain). + method: GET + path: /_list/indices + response: + status: 200 + content_type: text/plain + - synopsis: List information related to one index (text/plain). + method: GET + path: /_list/indices/{index} + parameters: + index: books + response: + status: 200 + content_type: text/plain + - synopsis: List information related to indexes with verbose output (v=true). + method: GET + path: /_list/indices + parameters: + v: true + response: + status: 200 + content_type: text/plain + - synopsis: List information related to indexes with headers (h=header1,header2). + method: GET + path: /_list/indices + parameters: + h: + - health + - status + response: + status: 200 + content_type: text/plain + - synopsis: List information related to indexes displaying all available headers (help=true). + method: GET + path: /_list/indices + parameters: + help: true + response: + status: 200 + content_type: text/plain + - synopsis: List information related to indexes with sorted results. + method: GET + path: /_list/indices + parameters: + s: + - status + response: + status: 200 + content_type: text/plain + - synopsis: List information related to indexes with bytes, time and all fields. + method: GET + path: /_list/indices + parameters: + format: json + bytes: b + time: s + h: + - '*' + response: + status: 200 + content_type: application/json + - synopsis: List information related to indexes with all fields. + method: GET + path: /_list/indices + parameters: + format: json + response: + status: 200 + content_type: application/json + - synopsis: List information related to indexes in different formats (format=json). + method: GET + path: /_list/indices + parameters: + format: json + response: + status: 200 + content_type: application/json + - synopsis: List information related to indexes in different formats (format=yaml). + method: GET + path: /_list/indices + parameters: + format: yaml + response: + status: 200 + content_type: application/yaml + - synopsis: List information related to indexes in different formats (format=cbor). + distributions: + excluded: + - amazon-managed + - amazon-serverless + method: GET + path: /_list/indices + parameters: + format: cbor + response: + status: 200 + content_type: application/cbor + - synopsis: List information related to indexes in different formats (format=smile). + distributions: + excluded: + - amazon-managed + - amazon-serverless + method: GET + path: /_list/indices + parameters: + format: smile + response: + status: 200 + content_type: application/smile diff --git a/tests/default/list/shards.yaml b/tests/default/list/shards.yaml new file mode 100644 index 000000000..768804c8a --- /dev/null +++ b/tests/default/list/shards.yaml @@ -0,0 +1,51 @@ +$schema: ../../../json_schemas/test_story.schema.yaml + +description: Test list/shards endpoints. +# TODO: Re-enable in 3.0, see https://github.com/opensearch-project/opensearch-api-specification/pull/613 +version: '>= 2.18 < 3' +prologues: + - path: /{index} + method: PUT + parameters: + index: games + - path: /{index} + method: PUT + parameters: + index: unassigned + wait_for_active_shards: 0 + request: + payload: + settings: + routing: + allocation: + require: + test: test +epilogues: + - path: /games + method: DELETE + status: [200, 404] + - path: /unassigned + method: DELETE + status: [200, 404] +chapters: + - synopsis: List the state of all primary and replica shards and how they are distributed. + path: /_list/shards + method: GET + parameters: + format: json + h: + - '*' + - synopsis: List the state of all primary and replica shards and how they are distributed for an index. + path: /_list/shards/{index} + method: GET + parameters: + format: json + index: + - games + bytes: kb + local: true + time: s + h: + - '*' + response: + status: 200 From a3b18042c6c1554f3713b42a2cec38bcd2e63040 Mon Sep 17 00:00:00 2001 From: "Daniel (dB.) Doubrovkine" Date: Mon, 11 Nov 2024 16:29:50 -0500 Subject: [PATCH 06/20] Fix: include .yml files when preparing for Vale. (#660) Signed-off-by: dblock --- tools/src/prepare-for-vale/KeepDescriptions.ts | 2 +- .../tests/prepare-for-vale/KeepDescriptions.test.ts | 2 +- .../prepare-for-vale/fixtures/docker-compose.txt | 11 +++++++++++ .../prepare-for-vale/fixtures/docker-compose.yaml | 12 ++++++++++++ 4 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 tools/tests/prepare-for-vale/fixtures/docker-compose.txt create mode 100644 tools/tests/prepare-for-vale/fixtures/docker-compose.yaml diff --git a/tools/src/prepare-for-vale/KeepDescriptions.ts b/tools/src/prepare-for-vale/KeepDescriptions.ts index 6d6da3ae2..8995f8df5 100644 --- a/tools/src/prepare-for-vale/KeepDescriptions.ts +++ b/tools/src/prepare-for-vale/KeepDescriptions.ts @@ -25,7 +25,7 @@ export default class KeepDescriptions { process(): void { this.root_folder - const files = fg.globSync([`${this.root_folder}/**/*.yaml`]) + const files = fg.globSync([`${this.root_folder}/**/*.{yaml,yml}`]) files.forEach((path) => { this.logger.log(path) this.process_file(path) diff --git a/tools/tests/prepare-for-vale/KeepDescriptions.test.ts b/tools/tests/prepare-for-vale/KeepDescriptions.test.ts index 0c595299b..52f2a9790 100644 --- a/tools/tests/prepare-for-vale/KeepDescriptions.test.ts +++ b/tools/tests/prepare-for-vale/KeepDescriptions.test.ts @@ -15,7 +15,7 @@ import tmp from 'tmp' describe('KeepDescriptions', () => { var temp: tmp.DirResult var fixture_path: string = './tools/tests/prepare-for-vale/fixtures' - var fixtures = fg.globSync(`${fixture_path}/**/*.yaml`) + var fixtures = fg.globSync(`${fixture_path}/**/*.{yaml,yml}`) describe('defaults', () => { beforeAll(() => { diff --git a/tools/tests/prepare-for-vale/fixtures/docker-compose.txt b/tools/tests/prepare-for-vale/fixtures/docker-compose.txt new file mode 100644 index 000000000..1dac6def4 --- /dev/null +++ b/tools/tests/prepare-for-vale/fixtures/docker-compose.txt @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/tools/tests/prepare-for-vale/fixtures/docker-compose.yaml b/tools/tests/prepare-for-vale/fixtures/docker-compose.yaml new file mode 100644 index 000000000..04c267ec5 --- /dev/null +++ b/tools/tests/prepare-for-vale/fixtures/docker-compose.yaml @@ -0,0 +1,12 @@ +version: '3' + +services: + opensearch-cluster: + image: ${OPENSEARCH_DOCKER_HUB_PROJECT:-opensearchproject}/opensearch:${OPENSEARCH_VERSION:-latest}${OPENSEARCH_DOCKER_REF} + ports: + - 9200:9200 + - 9600:9600 + environment: + - OPENSEARCH_INITIAL_ADMIN_PASSWORD=${OPENSEARCH_PASSWORD:-myStrongPassword123!} + - OPENSEARCH_JAVA_OPTS=${OPENSEARCH_JAVA_OPTS} + - discovery.type=single-node From 0d5f7126d6d08f5c4f562fe256dd810445f293a3 Mon Sep 17 00:00:00 2001 From: "Daniel (dB.) Doubrovkine" Date: Mon, 11 Nov 2024 16:44:38 -0500 Subject: [PATCH 07/20] Fix: merging coverage includes plugin tests. (#662) * Fix: merging coverage includes plugin tests. Signed-off-by: dblock * Display missing test paths. Signed-off-by: dblock --------- Signed-off-by: dblock --- .github/workflows/test-spec.yml | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-spec.yml b/.github/workflows/test-spec.yml index 3729b66cb..015fd79dc 100644 --- a/.github/workflows/test-spec.yml +++ b/.github/workflows/test-spec.yml @@ -77,12 +77,16 @@ jobs: working-directory: tests/${{ matrix.entry.tests || 'default' }} run: docker compose up -d + - name: Generate Test Files Hash + id: tests + run: echo "hash=${{ matrix.entry.version }}-${{ hashFiles(format('tests/{0}', matrix.entry.tests || 'default')) }}" >> $GITHUB_OUTPUT + - name: Run Tests run: | npm run test:spec -- \ --opensearch-insecure \ --opensearch-version=${{ matrix.entry.version }} \ - --coverage coverage/test-spec-coverage-${{ matrix.entry.version }}-${{ matrix.entry.tests || 'default' }}.json \ + --coverage coverage/test-spec-coverage-${{ steps.tests.outputs.hash }}.json \ --tests=tests/${{ matrix.entry.tests || 'default' }} - name: Get Container Logs @@ -96,8 +100,8 @@ jobs: - name: Upload Test Coverage Results uses: actions/upload-artifact@v4 with: - name: coverage-${{ matrix.entry.version }}-${{ hashFiles(format('tests/{0}', matrix.entry.tests || 'default')) }} - path: coverage/test-spec-coverage-${{ matrix.entry.version }}-${{ matrix.entry.tests || 'default' }}.json + name: coverage-${{ matrix.entry.version }}-${{ steps.tests.outputs.hash }} + path: coverage/test-spec-coverage-${{ steps.tests.outputs.hash }}.json merge-coverage: runs-on: ubuntu-latest @@ -111,6 +115,17 @@ jobs: with: path: coverage + - name: Display Missing Test Paths + run: | + jq -sc ' + (map(.operations) | add | unique) as $all | + (map(.evaluated_operations) | add | unique) as $evaluated | + $all-$evaluated | + sort_by(.path) | + .[] | + "\(.method) \(.path)" + ' $(find ./ -name "test-spec-coverage-*.json") + - name: Combine Test Coverage Data shell: bash -eo pipefail {0} run: | From 9aa52da61ea021baa2ed148043477b9f83462b74 Mon Sep 17 00:00:00 2001 From: "Daniel (dB.) Doubrovkine" Date: Mon, 11 Nov 2024 23:09:37 -0500 Subject: [PATCH 08/20] Added FlatObjectProperty. (#661) Signed-off-by: dblock --- CHANGELOG.md | 1 + spec/schemas/_common.mapping.yaml | 16 +++++++++++ tests/default/_core/mapping.yaml | 47 +------------------------------ 3 files changed, 18 insertions(+), 46 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e455a6d4f..47df345f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Added Python and Ruby spec validators ([#646](https://github.com/opensearch-project/opensearch-api-specification/pull/646)) - Added verbose output of the story being evaluated ([#646](https://github.com/opensearch-project/opensearch-api-specification/pull/646)) - Added `_search` with `sort: direction` ([#658](https://github.com/opensearch-project/opensearch-api-specification/pull/658)) +- Added `_common.mapping:FlatObjectProperty` ([#661](https://github.com/opensearch-project/opensearch-api-specification/pull/661)) ### Removed - Removed unsupported `_common.mapping:SourceField`'s `mode` field and associated `_common.mapping:SourceFieldMode` enum ([#652](https://github.com/opensearch-project/opensearch-api-specification/pull/652)) diff --git a/spec/schemas/_common.mapping.yaml b/spec/schemas/_common.mapping.yaml index 6523b2143..9e2bc2c5f 100644 --- a/spec/schemas/_common.mapping.yaml +++ b/spec/schemas/_common.mapping.yaml @@ -128,6 +128,7 @@ components: - $ref: '#/components/schemas/DenseVectorProperty' - $ref: '#/components/schemas/SparseVectorProperty' - $ref: '#/components/schemas/FlattenedProperty' + - $ref: '#/components/schemas/FlatObjectProperty' - $ref: '#/components/schemas/NestedProperty' - $ref: '#/components/schemas/ObjectProperty' - $ref: '#/components/schemas/CompletionProperty' @@ -614,6 +615,21 @@ components: - flattened required: - type + FlatObjectProperty: + allOf: + - $ref: '#/components/schemas/PropertyBase' + - type: object + properties: + searchable: + type: boolean + aggregatable: + type: boolean + type: + type: string + enum: + - flat_object + required: + - type NestedProperty: allOf: - $ref: '#/components/schemas/CorePropertyBase' diff --git a/tests/default/_core/mapping.yaml b/tests/default/_core/mapping.yaml index 29c2c335d..586e3a569 100644 --- a/tests/default/_core/mapping.yaml +++ b/tests/default/_core/mapping.yaml @@ -1,54 +1,9 @@ $schema: ../../../json_schemas/test_story.schema.yaml description: Test mappings endpoints. -prologues: - - path: /{index} - method: PUT - parameters: - index: movies - request: - payload: - mappings: - properties: - director: - type: text - year: - type: integer - location: - type: ip - ignore_malformed: true -epilogues: - - path: /movies - method: DELETE - status: [200, 404] chapters: - - synopsis: Get mappings for an index (index in query). + - synopsis: Get all mappings. path: /_mapping method: GET - parameters: - index: movies response: status: 200 - payload: - movies: - mappings: - properties: - director: - type: text - year: - type: integer - - synopsis: Get mappings for an index (index in path). - path: /{index}/_mapping - method: GET - parameters: - index: movies - response: - status: 200 - payload: - movies: - mappings: - properties: - director: - type: text - year: - type: integer \ No newline at end of file From ed5e83c5b54158c2564e9ebe18e162eec1ec53ca Mon Sep 17 00:00:00 2001 From: "Daniel (dB.) Doubrovkine" Date: Tue, 12 Nov 2024 15:05:29 -0500 Subject: [PATCH 09/20] Upgrade to 2.18.0 GA. (#665) Signed-off-by: dblock --- .github/workflows/test-spec.yml | 22 +++++++++---------- tests/default/cat/fielddata.yaml | 4 ++-- .../streaming/indices/bulk/stream.yaml | 4 +--- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/.github/workflows/test-spec.yml b/.github/workflows/test-spec.yml index 015fd79dc..1207af832 100644 --- a/.github/workflows/test-spec.yml +++ b/.github/workflows/test-spec.yml @@ -27,26 +27,26 @@ jobs: admin_password: admin - version: 2.0.0 admin_password: admin - - version: 2.16.0 - - version: 2.16.0 + - version: 2.18.0 + - version: 2.18.0 tests: plugins/index_state_management - - version: 2.16.0 + - version: 2.18.0 tests: plugins/ml - - version: 2.16.0 + - version: 2.18.0 tests: routing - - version: 2.16.0 + - version: 2.18.0 tests: snapshot - - version: 2.17.0 + - version: 2.18.0 tests: plugins/streaming - - version: 2.17.0 + - version: 2.18.0 tests: plugins/notifications - - version: 2.17.0 + - version: 2.18.0 tests: plugins/query_insights - - version: 2.17.0 - tests: plugins/workload-management - version: 2.18.0 + tests: plugins/workload-management + - version: 2.19.0 hub: opensearchstaging - ref: '@sha256:57a1cd1142d68c203e2e4aa0666d9a691e1e409a5d14aa4a8f5044036f05cf06' + ref: '@sha256:4da23e0137b2b67206d23b36fcf0914cc39b3bf19310c782f536e4934b86f6cc' - version: 3.0.0 hub: opensearchstaging ref: '@sha256:727643acdfebed77bfdb26362dbcff536b7ea02a0cc4ae2da2521729171333de' diff --git a/tests/default/cat/fielddata.yaml b/tests/default/cat/fielddata.yaml index b5b27a84f..164b78950 100644 --- a/tests/default/cat/fielddata.yaml +++ b/tests/default/cat/fielddata.yaml @@ -10,7 +10,7 @@ chapters: response: status: 200 - synopsis: List the memory size used by each field per node with data from security-analytics. - version: '>= 2.4' + version: '>= 2.4 < 2.19' path: /_cat/fielddata method: GET parameters: @@ -21,7 +21,7 @@ chapters: payload: - field: log_types - synopsis: List the memory size used by each field per node with data from security-analytics. - version: '>= 2.4' + version: '>= 2.4 < 2.19' path: /_cat/fielddata/{fields} method: GET parameters: diff --git a/tests/plugins/streaming/indices/bulk/stream.yaml b/tests/plugins/streaming/indices/bulk/stream.yaml index 546d77b63..6ad5cc603 100644 --- a/tests/plugins/streaming/indices/bulk/stream.yaml +++ b/tests/plugins/streaming/indices/bulk/stream.yaml @@ -1,13 +1,13 @@ $schema: ../../../../../json_schemas/test_story.schema.yaml description: Test bulk streaming index endpoint. +version: '>= 2.17' epilogues: - path: /books,movies method: DELETE status: [200, 404] chapters: - synopsis: Create an index. - version: '2.17' path: /{index}/_bulk/stream method: POST parameters: @@ -18,7 +18,6 @@ chapters: - {create: {}} - {director: Bennett Miller, title: Moneyball, year: 2011} - synopsis: Delete document in an index. - version: '>= 2.17' path: /{index}/_bulk/stream method: PUT parameters: @@ -38,7 +37,6 @@ chapters: result: not_found status: 404 - synopsis: Bulk index document CRUD. - version: '>= 2.17' method: POST path: /{index}/_bulk/stream parameters: From fce5721d72c946a7bf642a507ad1394984048039 Mon Sep 17 00:00:00 2001 From: "Daniel (dB.) Doubrovkine" Date: Tue, 12 Nov 2024 17:01:44 -0500 Subject: [PATCH 10/20] Added tests for missing alias/aliases combinations. (#664) Signed-off-by: dblock --- tests/default/indices/alias/alias.yaml | 27 +++++++++++++++++++++- tests/default/indices/aliases/aliases.yaml | 11 ++++++++- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/tests/default/indices/alias/alias.yaml b/tests/default/indices/alias/alias.yaml index 4000dbb13..4be447727 100644 --- a/tests/default/indices/alias/alias.yaml +++ b/tests/default/indices/alias/alias.yaml @@ -12,11 +12,28 @@ prologues: index: games chapters: - synopsis: Create an alias. + path: /{index}/_alias/{name} + method: POST + parameters: + index: games + name: jeux + - synopsis: Update an alias. path: /{index}/_alias/{name} method: PUT parameters: index: games name: jeux + - synopsis: Get all aliases from an index. + method: GET + path: /{index}/_alias + parameters: + index: games + response: + status: 200 + payload: + games: + aliases: + jeux: {} - synopsis: Get an alias from index. method: GET path: /{index}/_alias/{name} @@ -25,7 +42,6 @@ chapters: name: jeux response: status: 200 - content_type: application/json payload: games: aliases: @@ -42,6 +58,15 @@ chapters: parameters: index: games name: jeux + - synopsis: Update an alias. + path: /{index}/_alias + method: PUT + parameters: + index: games + request: + payload: + alias: jeux + is_write_index: false - synopsis: Check if alias exists. path: /{index}/_alias/{name} method: HEAD diff --git a/tests/default/indices/aliases/aliases.yaml b/tests/default/indices/aliases/aliases.yaml index 75a1918c1..503188143 100644 --- a/tests/default/indices/aliases/aliases.yaml +++ b/tests/default/indices/aliases/aliases.yaml @@ -9,12 +9,21 @@ prologues: - path: games method: PUT chapters: - - synopsis: Create an alias. + - synopsis: Create an alias by name. path: /{index}/_aliases/{name} method: PUT parameters: index: games name: jeux + - synopsis: Update an alias. + path: /{index}/_aliases + method: PUT + parameters: + index: games + request: + payload: + alias: jeux + is_write_index: false - synopsis: Delete an alias. path: /{index}/_aliases/{name} method: DELETE From 52f8e2ce2c79dab6b2b210bb0c4c88019724c980 Mon Sep 17 00:00:00 2001 From: "Daniel (dB.) Doubrovkine" Date: Wed, 13 Nov 2024 14:51:38 -0500 Subject: [PATCH 11/20] Run merge coverage on push. (#668) Signed-off-by: dblock --- .github/workflows/test-spec.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-spec.yml b/.github/workflows/test-spec.yml index 1207af832..03e9b9cb6 100644 --- a/.github/workflows/test-spec.yml +++ b/.github/workflows/test-spec.yml @@ -105,7 +105,6 @@ jobs: merge-coverage: runs-on: ubuntu-latest - if: github.event_name == 'pull_request' needs: test-opensearch-spec steps: - uses: actions/checkout@v4 @@ -141,6 +140,7 @@ jobs: cat ./coverage/coverage.json - name: Construct Comment Data Payload + if: github.event_name == 'pull_request' shell: bash -eo pipefail {0} run: | jq \ @@ -161,6 +161,7 @@ jobs: - name: Upload PR Comment Payload uses: actions/upload-artifact@v4 + if: github.event_name == 'pull_request' with: name: pr-comment path: pr-comment.json From 2cdd46a18f5c52e5e11765e1939f6214d71aa1fa Mon Sep 17 00:00:00 2001 From: "Daniel (dB.) Doubrovkine" Date: Wed, 13 Nov 2024 14:53:04 -0500 Subject: [PATCH 12/20] Corrected /{index}/_create/{id} 201 response. (#669) Signed-off-by: dblock --- CHANGELOG.md | 1 + spec/namespaces/_core.yaml | 10 +++++----- tests/default/indices/create.yaml | 32 +++++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 5 deletions(-) create mode 100644 tests/default/indices/create.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md index 47df345f2..d24b75f3f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Fixed incorrect `style` in `indices.get_mapping::query.index` ([#646](https://github.com/opensearch-project/opensearch-api-specification/pull/646)) - Removed invalid `required` from `ppl` responses ([#646](https://github.com/opensearch-project/opensearch-api-specification/pull/646)) - Added schema for security API error responses ([#646](https://github.com/opensearch-project/opensearch-api-specification/pull/646)) +- Fixed `/{index}/_create/{id}` returning `201` ([#669](https://github.com/opensearch-project/opensearch-api-specification/pull/669)) ## [0.1.0] - 2024-10-25 diff --git a/spec/namespaces/_core.yaml b/spec/namespaces/_core.yaml index af76fa7e3..fafc809b3 100644 --- a/spec/namespaces/_core.yaml +++ b/spec/namespaces/_core.yaml @@ -1241,8 +1241,8 @@ paths: requestBody: $ref: '#/components/requestBodies/create' responses: - '200': - $ref: '#/components/responses/create@200' + '201': + $ref: '#/components/responses/create@201' put: operationId: create.1 x-operation-group: create @@ -1266,8 +1266,8 @@ paths: requestBody: $ref: '#/components/requestBodies/create' responses: - '200': - $ref: '#/components/responses/create@200' + '201': + $ref: '#/components/responses/create@201' /{index}/_delete_by_query: post: operationId: delete_by_query.0 @@ -2834,7 +2834,7 @@ components: required: - _shards - count - create@200: + create@201: content: application/json: schema: diff --git a/tests/default/indices/create.yaml b/tests/default/indices/create.yaml new file mode 100644 index 000000000..b002fadfe --- /dev/null +++ b/tests/default/indices/create.yaml @@ -0,0 +1,32 @@ +$schema: ../../../json_schemas/test_story.schema.yaml + +description: Test inserting and retrieving a doc. +epilogues: + - path: /movies + method: DELETE + status: [200, 404] +chapters: + - synopsis: Create a document it doesn't already exist (POST). + path: /{index}/_create/{id} + method: POST + parameters: + index: movies + id: '1' + request: + payload: + title: Beauty and the Beast + year: 1991 + response: + status: 201 + - synopsis: Create a document it doesn't already exist (PUT). + path: /{index}/_create/{id} + method: PUT + parameters: + index: movies + id: '2' + request: + payload: + title: To Kill a Mockingbird + year: 1960 + response: + status: 201 From a84cb99e68effa87f382881ec5372b4da9d9c174 Mon Sep 17 00:00:00 2001 From: "Daniel (dB.) Doubrovkine" Date: Wed, 13 Nov 2024 14:54:05 -0500 Subject: [PATCH 13/20] Added HEAD /{index}/_doc/{id} 404 response. (#670) Signed-off-by: dblock --- CHANGELOG.md | 1 + spec/namespaces/_core.yaml | 5 +++++ tests/default/indices/doc.yaml | 16 ++++++++++++++++ 3 files changed, 22 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d24b75f3f..886986786 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Added verbose output of the story being evaluated ([#646](https://github.com/opensearch-project/opensearch-api-specification/pull/646)) - Added `_search` with `sort: direction` ([#658](https://github.com/opensearch-project/opensearch-api-specification/pull/658)) - Added `_common.mapping:FlatObjectProperty` ([#661](https://github.com/opensearch-project/opensearch-api-specification/pull/661)) +- Added `HEAD /{index}/_doc/{id}` returning `404` ([#670](https://github.com/opensearch-project/opensearch-api-specification/pull/670)) ### Removed - Removed unsupported `_common.mapping:SourceField`'s `mode` field and associated `_common.mapping:SourceFieldMode` enum ([#652](https://github.com/opensearch-project/opensearch-api-specification/pull/652)) diff --git a/spec/namespaces/_core.yaml b/spec/namespaces/_core.yaml index fafc809b3..542d55bf2 100644 --- a/spec/namespaces/_core.yaml +++ b/spec/namespaces/_core.yaml @@ -1393,6 +1393,8 @@ paths: responses: '200': $ref: '#/components/responses/exists@200' + '404': + $ref: '#/components/responses/exists@404' post: operationId: index.1 x-operation-group: index @@ -2905,6 +2907,9 @@ components: exists@200: content: application/json: {} + exists@404: + content: + application/json: {} exists_source@200: content: application/json: {} diff --git a/tests/default/indices/doc.yaml b/tests/default/indices/doc.yaml index 5396a52bf..714c773d4 100644 --- a/tests/default/indices/doc.yaml +++ b/tests/default/indices/doc.yaml @@ -49,6 +49,14 @@ chapters: id: '1' response: status: 200 + - synopsis: Check whether a document exists. + path: /{index}/_doc/{id} + method: HEAD + parameters: + index: movies + id: '1' + response: + status: 200 - synopsis: Delete a document. path: /{index}/_doc/{id} method: DELETE @@ -65,6 +73,14 @@ chapters: id: '1' response: status: 404 + - synopsis: Check whether a nonexistent document exists. + path: /{index}/_doc/{id} + method: HEAD + parameters: + index: movies + id: '1' + response: + status: 404 - synopsis: Delete a nonexistent document. path: /{index}/_doc/{id} method: DELETE From 0871d02d7490f9d55ec459d38c0250b12ff3aff7 Mon Sep 17 00:00:00 2001 From: "Daniel (dB.) Doubrovkine" Date: Wed, 13 Nov 2024 14:55:07 -0500 Subject: [PATCH 14/20] Remaining alias-related tests. (#667) * Added test for POST /{index}/_aliases/{name}. Signed-off-by: dblock * Added tests for POST /{alias}/_rollover/{new_index}. Signed-off-by: dblock --------- Signed-off-by: dblock --- tests/default/indices/alias/rollover.yaml | 29 +++++++++++++++++++ tests/default/indices/aliases/aliases.yaml | 11 ++++++- .../default/indices/data_stream/rollover.yaml | 2 -- 3 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 tests/default/indices/alias/rollover.yaml diff --git a/tests/default/indices/alias/rollover.yaml b/tests/default/indices/alias/rollover.yaml new file mode 100644 index 000000000..740a06357 --- /dev/null +++ b/tests/default/indices/alias/rollover.yaml @@ -0,0 +1,29 @@ +$schema: ../../../../json_schemas/test_story.schema.yaml + +description: Test rolling over aliases. +epilogues: + - path: /games + method: DELETE + status: [200, 404] + - path: /rollover + method: DELETE + status: [200, 404] +prologues: + - path: games + method: PUT + - path: /games/_alias/jeux + method: POST +chapters: + - synopsis: Manually roll over an index. + path: /{alias}/_rollover/{new_index} + method: POST + parameters: + alias: jeux + new_index: rollover + response: + status: 200 + payload: + acknowledged: true + old_index: games + new_index: rollover + rolled_over: true diff --git a/tests/default/indices/aliases/aliases.yaml b/tests/default/indices/aliases/aliases.yaml index 503188143..6f9850a84 100644 --- a/tests/default/indices/aliases/aliases.yaml +++ b/tests/default/indices/aliases/aliases.yaml @@ -10,12 +10,21 @@ prologues: method: PUT chapters: - synopsis: Create an alias by name. + path: /{index}/_aliases/{name} + method: POST + parameters: + index: games + name: jeux + - synopsis: Update an alias by name (query). path: /{index}/_aliases/{name} method: PUT parameters: index: games name: jeux - - synopsis: Update an alias. + request: + payload: + is_write_index: true + - synopsis: Update an alias by name (payload). path: /{index}/_aliases method: PUT parameters: diff --git a/tests/default/indices/data_stream/rollover.yaml b/tests/default/indices/data_stream/rollover.yaml index 5e0c637be..853a9ea14 100644 --- a/tests/default/indices/data_stream/rollover.yaml +++ b/tests/default/indices/data_stream/rollover.yaml @@ -30,8 +30,6 @@ epilogues: status: [200, 404] chapters: - synopsis: Manually roll over a data stream. - warnings: - multiple-paths-detected: false path: /{alias}/_rollover method: POST parameters: From 6065144facfe421434aaf2d5801623a06786bb43 Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Thu, 14 Nov 2024 10:33:17 +1300 Subject: [PATCH 15/20] Correct index mapping types (#666) * Correct index mapping types Signed-off-by: Thomas Farr * Add PR number Signed-off-by: Thomas Farr * Correct numeric types Signed-off-by: Thomas Farr * Specify default Property variant Signed-off-by: Thomas Farr * Add test for icu_collation_keyword Signed-off-by: Thomas Farr * Rename test folder Signed-off-by: Thomas Farr --------- Signed-off-by: Thomas Farr --- .github/workflows/test-spec.yml | 2 + CHANGELOG.md | 4 + spec/namespaces/indices.yaml | 4 +- spec/schemas/_common.mapping.yaml | 158 +++++------------- spec/schemas/_core.field_caps.yaml | 19 --- spec/schemas/indices._common.yaml | 12 +- tests/plugins/analysis/Dockerfile | 6 + tests/plugins/analysis/docker-compose.yml | 17 ++ .../mapping/icu_collation_keyword.yaml | 86 ++++++++++ 9 files changed, 163 insertions(+), 145 deletions(-) create mode 100644 tests/plugins/analysis/Dockerfile create mode 100644 tests/plugins/analysis/docker-compose.yml create mode 100644 tests/plugins/analysis/indices/mapping/icu_collation_keyword.yaml diff --git a/.github/workflows/test-spec.yml b/.github/workflows/test-spec.yml index 03e9b9cb6..a6c1e78ec 100644 --- a/.github/workflows/test-spec.yml +++ b/.github/workflows/test-spec.yml @@ -44,6 +44,8 @@ jobs: tests: plugins/query_insights - version: 2.18.0 tests: plugins/workload-management + - version: 2.18.0 + tests: plugins/analysis - version: 2.19.0 hub: opensearchstaging ref: '@sha256:4da23e0137b2b67206d23b36fcf0914cc39b3bf19310c782f536e4934b86f6cc' diff --git a/CHANGELOG.md b/CHANGELOG.md index 886986786..05f3ba6b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,9 +11,13 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Added `_search` with `sort: direction` ([#658](https://github.com/opensearch-project/opensearch-api-specification/pull/658)) - Added `_common.mapping:FlatObjectProperty` ([#661](https://github.com/opensearch-project/opensearch-api-specification/pull/661)) - Added `HEAD /{index}/_doc/{id}` returning `404` ([#670](https://github.com/opensearch-project/opensearch-api-specification/pull/670)) +- Added `_common.mapping:IcuCollationKeywordProperty` ([#666](https://github.com/opensearch-project/opensearch-api-specification/pull/666)) ### Removed - Removed unsupported `_common.mapping:SourceField`'s `mode` field and associated `_common.mapping:SourceFieldMode` enum ([#652](https://github.com/opensearch-project/opensearch-api-specification/pull/652)) +- Removed unsupported `_common.mapping:DenseVectorProperty`, `_common.mapping:SparseVectorProperty`, and `_common.mapping:FlattenedProperty` ([#666](https://github.com/opensearch-project/opensearch-api-specification/pull/666)) +- Removed unsupported time series dimension properties and types ([#666](https://github.com/opensearch-project/opensearch-api-specification/pull/666)) +- Removed unsupported runtime field properties (`script`/`on_script_error`) on `NumberPropertyBase` ([#666](https://github.com/opensearch-project/opensearch-api-specification/pull/666)) ### Fixed - Spec passes OpenAPI 3.1.0 validations ([#646](https://github.com/opensearch-project/opensearch-api-specification/pull/646)) diff --git a/spec/namespaces/indices.yaml b/spec/namespaces/indices.yaml index fcf676adf..cae77c601 100644 --- a/spec/namespaces/indices.yaml +++ b/spec/namespaces/indices.yaml @@ -2045,7 +2045,7 @@ components: The index template with the highest priority is chosen. If no priority is specified the template is treated as though it is of priority 0 (lowest priority). This number is not automatically generated by OpenSearch. - type: number + type: integer version: $ref: '../schemas/_common.yaml#/components/schemas/VersionNumber' _meta: @@ -2225,7 +2225,7 @@ components: The index template with the highest priority is chosen. If no priority is specified the template is treated as though it is of priority 0 (lowest priority). This number is not automatically generated by OpenSearch. - type: number + type: integer version: $ref: '../schemas/_common.yaml#/components/schemas/VersionNumber' _meta: diff --git a/spec/schemas/_common.mapping.yaml b/spec/schemas/_common.mapping.yaml index 9e2bc2c5f..12087d9ed 100644 --- a/spec/schemas/_common.mapping.yaml +++ b/spec/schemas/_common.mapping.yaml @@ -109,6 +109,7 @@ components: type: object discriminator: propertyName: type + x-default: object oneOf: - $ref: '#/components/schemas/BinaryProperty' - $ref: '#/components/schemas/BooleanProperty' @@ -125,9 +126,6 @@ components: - $ref: '#/components/schemas/DateNanosProperty' - $ref: '#/components/schemas/DateProperty' - $ref: '#/components/schemas/AggregateMetricDoubleProperty' - - $ref: '#/components/schemas/DenseVectorProperty' - - $ref: '#/components/schemas/SparseVectorProperty' - - $ref: '#/components/schemas/FlattenedProperty' - $ref: '#/components/schemas/FlatObjectProperty' - $ref: '#/components/schemas/NestedProperty' - $ref: '#/components/schemas/ObjectProperty' @@ -158,6 +156,7 @@ components: - $ref: '#/components/schemas/IpRangeProperty' - $ref: '#/components/schemas/LongRangeProperty' - $ref: '#/components/schemas/KnnVectorProperty' + - $ref: '#/components/schemas/IcuCollationKeywordProperty' BinaryProperty: allOf: - $ref: '#/components/schemas/DocValuesPropertyBase' @@ -227,19 +226,6 @@ components: - boolean required: - type - OnScriptError: - type: string - enum: - - continue - - fail - TimeSeriesMetricType: - type: string - enum: - - counter - - gauge - - histogram - - position - - summary IndexOptions: type: string enum: @@ -310,9 +296,6 @@ components: type: string split_queries_on_whitespace: type: boolean - time_series_dimension: - description: For internal use by OpenSearch only. Marks the field as a time series dimension. Defaults to false. - type: boolean type: type: string enum: @@ -535,86 +518,10 @@ components: type: array items: type: string - time_series_metric: - $ref: '#/components/schemas/TimeSeriesMetricType' required: - default_metric - metrics - type - DenseVectorProperty: - allOf: - - $ref: '#/components/schemas/PropertyBase' - - type: object - properties: - type: - type: string - enum: - - dense_vector - dims: - type: number - similarity: - type: string - index: - type: boolean - index_options: - $ref: '#/components/schemas/DenseVectorIndexOptions' - required: - - dims - - type - DenseVectorIndexOptions: - type: object - properties: - type: - type: string - m: - type: number - ef_construction: - type: number - required: - - ef_construction - - m - - type - SparseVectorProperty: - allOf: - - $ref: '#/components/schemas/PropertyBase' - - type: object - properties: - type: - type: string - enum: - - sparse_vector - required: - - type - FlattenedProperty: - allOf: - - $ref: '#/components/schemas/PropertyBase' - - type: object - properties: - boost: - type: number - format: double - depth_limit: - type: number - doc_values: - type: boolean - eager_global_ordinals: - type: boolean - index: - type: boolean - index_options: - $ref: '#/components/schemas/IndexOptions' - null_value: - type: string - similarity: - type: string - split_queries_on_whitespace: - type: boolean - type: - type: string - enum: - - flattened - required: - - type FlatObjectProperty: allOf: - $ref: '#/components/schemas/PropertyBase' @@ -751,13 +658,6 @@ components: type: boolean null_value: type: string - on_script_error: - $ref: '#/components/schemas/OnScriptError' - script: - $ref: '_common.yaml#/components/schemas/Script' - time_series_dimension: - description: For internal use by OpenSearch only. Marks the field as a time series dimension. Defaults to false. - type: boolean type: type: string enum: @@ -843,20 +743,22 @@ components: - type GeoOrientation: oneOf: + # eslint-disable yml/sort-sequence-values - title: left type: string enum: + - left - LEFT - clockwise - cw - - left - title: right type: string enum: + - right - RIGHT - - ccw - counterclockwise - - right + - ccw + # eslint-enable yml/sort-sequence-values GeoStrategy: type: string enum: @@ -927,15 +829,6 @@ components: type: boolean index: type: boolean - on_script_error: - $ref: '#/components/schemas/OnScriptError' - script: - $ref: '_common.yaml#/components/schemas/Script' - time_series_metric: - $ref: '#/components/schemas/TimeSeriesMetricType' - time_series_dimension: - description: For internal use by OpenSearch only. Marks the field as a time series dimension. Defaults to false. - type: boolean DoubleNumberProperty: allOf: - $ref: '#/components/schemas/NumberPropertyBase' @@ -1168,6 +1061,43 @@ components: required: - dimension - type + IcuCollationKeywordProperty: + allOf: + - $ref: '#/components/schemas/DocValuesPropertyBase' + - type: object + properties: + type: + type: string + enum: + - icu_collation_keyword + index: + type: boolean + null_value: + type: string + alternate: + $ref: '_common.analysis.yaml#/components/schemas/IcuCollationAlternate' + case_level: + type: boolean + case_first: + $ref: '_common.analysis.yaml#/components/schemas/IcuCollationCaseFirst' + decomposition: + $ref: '_common.analysis.yaml#/components/schemas/IcuCollationDecomposition' + hiragana_quaternary_mode: + type: boolean + numeric: + type: boolean + strength: + $ref: '_common.analysis.yaml#/components/schemas/IcuCollationStrength' + variable_top: + type: string + country: + type: string + language: + type: string + variant: + type: string + required: + - type MatchType: type: string enum: diff --git a/spec/schemas/_core.field_caps.yaml b/spec/schemas/_core.field_caps.yaml index 70b93d6d5..67d8b308c 100644 --- a/spec/schemas/_core.field_caps.yaml +++ b/spec/schemas/_core.field_caps.yaml @@ -28,25 +28,6 @@ components: metadata_field: description: Whether this field is registered as a metadata field. type: boolean - time_series_dimension: - description: Whether this field is used as a time series dimension. - type: boolean - time_series_metric: - $ref: '_common.mapping.yaml#/components/schemas/TimeSeriesMetricType' - non_dimension_indices: - description: |- - If this list is present in the response, then indexes not contained in the list have the - field marked as a dimension. Any indexes contained in the list are not marked as a dimension. - type: array - items: - $ref: '_common.yaml#/components/schemas/IndexName' - metric_conflicts_indices: - description: |- - The list of indexes in which this field is present if the indexes - don't have the same `time_series_metric` value for the field. - type: array - items: - $ref: '_common.yaml#/components/schemas/IndexName' required: - aggregatable - searchable diff --git a/spec/schemas/indices._common.yaml b/spec/schemas/indices._common.yaml index 10386d1ea..6135bd368 100644 --- a/spec/schemas/indices._common.yaml +++ b/spec/schemas/indices._common.yaml @@ -148,8 +148,6 @@ components: $ref: '#/components/schemas/IndexSettingsAnalysis' settings: $ref: '#/components/schemas/IndexSettings' - time_series: - $ref: '#/components/schemas/IndexSettingsTimeSeries' queries: $ref: '#/components/schemas/IndexSettingsQueries' similarity: @@ -457,13 +455,6 @@ components: type: object additionalProperties: $ref: '_common.analysis.yaml#/components/schemas/Tokenizer' - IndexSettingsTimeSeries: - type: object - properties: - end_time: - $ref: '_common.yaml#/components/schemas/DateTime' - start_time: - $ref: '_common.yaml#/components/schemas/DateTime' IndexSettingsQueries: type: object properties: @@ -919,7 +910,8 @@ components: The index template with the highest priority is chosen. If no priority is specified the template is treated as though it is of priority 0 (lowest priority). This number is not automatically generated by OpenSearch. - type: number + type: integer + format: int64 _meta: $ref: '_common.yaml#/components/schemas/Metadata' allow_auto_create: diff --git a/tests/plugins/analysis/Dockerfile b/tests/plugins/analysis/Dockerfile new file mode 100644 index 000000000..aa43b705b --- /dev/null +++ b/tests/plugins/analysis/Dockerfile @@ -0,0 +1,6 @@ +ARG OPENSEARCH_DOCKER_HUB_PROJECT +ARG OPENSEARCH_VERSION +ARG OPENSEARCH_DOCKER_REF + +FROM ${OPENSEARCH_DOCKER_HUB_PROJECT}/opensearch:${OPENSEARCH_VERSION}${OPENSEARCH_DOCKER_REF} +RUN ./bin/opensearch-plugin install -b analysis-icu diff --git a/tests/plugins/analysis/docker-compose.yml b/tests/plugins/analysis/docker-compose.yml new file mode 100644 index 000000000..0f4c7da5d --- /dev/null +++ b/tests/plugins/analysis/docker-compose.yml @@ -0,0 +1,17 @@ +version: '3' + +services: + opensearch-cluster: + build: + context: . + args: + - OPENSEARCH_DOCKER_HUB_PROJECT=${OPENSEARCH_DOCKER_HUB_PROJECT:-opensearchproject} + - OPENSEARCH_DOCKER_REF=${OPENSEARCH_DOCKER_REF} + - OPENSEARCH_VERSION=${OPENSEARCH_VERSION:-latest} + ports: + - 9200:9200 + - 9600:9600 + environment: + - OPENSEARCH_INITIAL_ADMIN_PASSWORD=${OPENSEARCH_PASSWORD:-myStrongPassword123!} + - OPENSEARCH_JAVA_OPTS=${OPENSEARCH_JAVA_OPTS} + - discovery.type=single-node diff --git a/tests/plugins/analysis/indices/mapping/icu_collation_keyword.yaml b/tests/plugins/analysis/indices/mapping/icu_collation_keyword.yaml new file mode 100644 index 000000000..1b4d78dda --- /dev/null +++ b/tests/plugins/analysis/indices/mapping/icu_collation_keyword.yaml @@ -0,0 +1,86 @@ +$schema: ../../../../../json_schemas/test_story.schema.yaml + +description: Test mappings endpoints. +warnings: + multiple-paths-detected: false +prologues: [] +epilogues: + - path: /collated + method: DELETE + status: [200, 404] +chapters: + - synopsis: Create an index with a mapping that uses ICU collation. + path: /{index} + method: PUT + parameters: + index: collated + request: + payload: + mappings: + properties: + phrase: + type: icu_collation_keyword + language: tr + strength: primary + + - synopsis: Get mappings for index. + path: /{index}/_mapping + method: GET + parameters: + index: collated + response: + status: 200 + payload: + collated: + mappings: + properties: + phrase: + type: icu_collation_keyword + language: tr + strength: primary + + - synopsis: Index values with ICU collation. + path: /{index}/_bulk + method: POST + parameters: + index: collated + refresh: wait_for + request: + content_type: application/x-ndjson + payload: + - {create: {_id: '1'}} + # eslint-disable-next-line @cspell/spellchecker + - {phrase: I WİLL USE TURKİSH CASING} + - {create: {_id: '2'}} + # eslint-disable-next-line @cspell/spellchecker + - {phrase: ı will use turkish casıng} + + - synopsis: Search for values with ICU collation. + path: /{index}/_search + method: POST + parameters: + index: collated + request: + payload: + query: + term: + # eslint-disable-next-line @cspell/spellchecker + phrase: I WİLL USE TURKİSH CASING + sort: + - phrase + - {_id: desc} + response: + status: 200 + payload: + hits: + total: + value: 2 + hits: + - _id: '2' + _source: + # eslint-disable-next-line @cspell/spellchecker + phrase: ı will use turkish casıng + - _id: '1' + _source: + # eslint-disable-next-line @cspell/spellchecker + phrase: I WİLL USE TURKİSH CASING From 6bb1fed0a2c7cf094a5ecfdb01f0306a4b9f8eba Mon Sep 17 00:00:00 2001 From: SwethaGuptha <156877431+SwethaGuptha@users.noreply.github.com> Date: Thu, 14 Nov 2024 03:04:06 +0530 Subject: [PATCH 16/20] Add spec for cluster stats metric and index_metric filter path. (#639) Signed-off-by: Swetha Guptha Co-authored-by: Swetha Guptha --- CHANGELOG.md | 1 + spec/namespaces/cluster.yaml | 54 +++++++++++++++++++ spec/schemas/cluster.stats.yaml | 52 +++++++++--------- tests/default/cluster/stats/index_metric.yaml | 18 +++++++ tests/default/cluster/stats/metric.yaml | 17 ++++++ 5 files changed, 117 insertions(+), 25 deletions(-) create mode 100644 tests/default/cluster/stats/index_metric.yaml create mode 100644 tests/default/cluster/stats/metric.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md index 05f3ba6b2..5b912b2fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -135,6 +135,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Added API spec for `adjust_pure_negative` for bool queries ([#641](https://github.com/opensearch-project/opensearch-api-specification/pull/641)) - Added a spec style checker [#620](https://github.com/opensearch-project/opensearch-api-specification/pull/620). - Added `remote_store` to node `Stats` ([#643](https://github.com/opensearch-project/opensearch-api-specification/pull/643)) +- Added `/_cluster/stats/{metric}/nodes/{node_id}` and `/_cluster/stats/{metric}/{index_metric}/nodes/{node_id}` ([#639](https://github.com/opensearch-project/opensearch-api-specification/pull/639)) ### Changed diff --git a/spec/namespaces/cluster.yaml b/spec/namespaces/cluster.yaml index 8820d2eda..d8bc97d90 100644 --- a/spec/namespaces/cluster.yaml +++ b/spec/namespaces/cluster.yaml @@ -331,6 +331,39 @@ paths: responses: '200': $ref: '#/components/responses/cluster.stats@200' + /_cluster/stats/{metric}/nodes/{node_id}: + get: + operationId: cluster.stats.2 + x-operation-group: cluster.stats + x-version-added: '2.18' + description: Returns high-level overview of cluster statistics. + externalDocs: + url: https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-stats/ + parameters: + - $ref: '#/components/parameters/cluster.stats::path.metric' + - $ref: '#/components/parameters/cluster.stats::path.node_id' + - $ref: '#/components/parameters/cluster.stats::query.flat_settings' + - $ref: '#/components/parameters/cluster.stats::query.timeout' + responses: + '200': + $ref: '#/components/responses/cluster.stats@200' + /_cluster/stats/{metric}/{index_metric}/nodes/{node_id}: + get: + operationId: cluster.stats.3 + x-operation-group: cluster.stats + x-version-added: '2.18' + description: Returns high-level overview of cluster statistics. + externalDocs: + url: https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-stats/ + parameters: + - $ref: '#/components/parameters/cluster.stats::path.index_metric' + - $ref: '#/components/parameters/cluster.stats::path.metric' + - $ref: '#/components/parameters/cluster.stats::path.node_id' + - $ref: '#/components/parameters/cluster.stats::query.flat_settings' + - $ref: '#/components/parameters/cluster.stats::query.timeout' + responses: + '200': + $ref: '#/components/responses/cluster.stats@200' /_cluster/voting_config_exclusions: post: operationId: cluster.post_voting_config_exclusions.0 @@ -1380,6 +1413,27 @@ components: schema: $ref: '../schemas/_common.yaml#/components/schemas/Duration' style: form + cluster.stats::path.index_metric: + in: path + name: index_metric + description: Limit the information returned for indexes metric to the specific index metrics. It can be used only if indexes (or all) metric is specified. + required: true + schema: + type: array + items: + $ref: '../schemas/cluster.stats.yaml#/components/schemas/IndexMetric' + style: simple + cluster.stats::path.metric: + in: path + name: metric + description: Limit the information returned to the specified metrics + required: true + schema: + type: array + items: + $ref: '../schemas/cluster.stats.yaml#/components/schemas/Metric' + style: + simple cluster.stats::path.node_id: in: path name: node_id diff --git a/spec/schemas/cluster.stats.yaml b/spec/schemas/cluster.stats.yaml index 55a95cd61..3e8cb8987 100644 --- a/spec/schemas/cluster.stats.yaml +++ b/spec/schemas/cluster.stats.yaml @@ -27,8 +27,6 @@ components: required: - cluster_name - cluster_uuid - - indices - - nodes - status - timestamp ClusterIndices: @@ -60,17 +58,6 @@ components: type: array items: $ref: '#/components/schemas/IndicesVersions' - required: - - analysis - - completion - - count - - docs - - fielddata - - mappings - - query_cache - - segments - - shards - - store CharFilterTypes: type: object properties: @@ -271,18 +258,6 @@ components: type: array items: $ref: '_common.yaml#/components/schemas/VersionString' - required: - - count - - discovery_types - - fs - - ingest - - jvm - - network_types - - os - - packaging_types - - plugins - - process - - versions ClusterNodeCount: type: object properties: @@ -689,3 +664,30 @@ components: - avg - max - min + Metric: + type: string + enum: + - _all + - discovery_type + - fs + - indices + - ingest + - jvm + - network_types + - os + - packaging_types + - plugins + - process + IndexMetric: + type: string + enum: + - _all + - analysis + - completion + - docs + - fielddata + - mappings + - query_cache + - segments + - shards + - store diff --git a/tests/default/cluster/stats/index_metric.yaml b/tests/default/cluster/stats/index_metric.yaml new file mode 100644 index 000000000..6b353913e --- /dev/null +++ b/tests/default/cluster/stats/index_metric.yaml @@ -0,0 +1,18 @@ +$schema: ../../../../json_schemas/test_story.schema.yaml + +description: Test cluster manager stats. +# TODO: Re-enable in 3.0, see https://github.com/opensearch-project/opensearch-api-specification/pull/613 +version: '>= 2.18 < 3' +chapters: + - synopsis: Get mapping and analysis indices stats. + path: /_cluster/stats/{metric}/{index_metric}/nodes/{node_id} + method: GET + parameters: + node_id: _all + metric: + - indices + index_metric: + - analysis + - mappings + response: + status: 200 diff --git a/tests/default/cluster/stats/metric.yaml b/tests/default/cluster/stats/metric.yaml new file mode 100644 index 000000000..2af5022f7 --- /dev/null +++ b/tests/default/cluster/stats/metric.yaml @@ -0,0 +1,17 @@ +$schema: ../../../../json_schemas/test_story.schema.yaml + +description: Test cluster manager stats. +# TODO: Re-enable in 3.0, see https://github.com/opensearch-project/opensearch-api-specification/pull/613 +version: '>= 2.18 < 3' +chapters: + - synopsis: Get nodes fs and jvm stats. + path: /_cluster/stats/{metric}/nodes/{node_id} + method: GET + parameters: + node_id: _all + metric: + - fs + - jvm + response: + status: 200 + From 1c46b692a8bf573010d7c154659ee3e56752a9bb Mon Sep 17 00:00:00 2001 From: Ralph Ursprung <39383228+rursprung@users.noreply.github.com> Date: Thu, 14 Nov 2024 17:34:34 +0100 Subject: [PATCH 17/20] add phone number analysis plugin (#609) this is part of opensearch-project/OpenSearch#11326. the actual implementation was done opensearch-project/OpenSearch#15915. see the commit message on the PR for further details. the new test group `analysis` has been added so that it can later be extended with all other optional language analyzers (which are currently also not covered). Signed-off-by: Ralph Ursprung --- CHANGELOG.md | 1 + spec/schemas/_common.analysis.yaml | 12 ++++++ tests/plugins/analysis/Dockerfile | 1 + .../indices/analyze/analyzer/phone.yaml | 38 +++++++++++++++++++ 4 files changed, 52 insertions(+) create mode 100644 tests/plugins/analysis/indices/analyze/analyzer/phone.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b912b2fe..5edd85dcf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -136,6 +136,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Added a spec style checker [#620](https://github.com/opensearch-project/opensearch-api-specification/pull/620). - Added `remote_store` to node `Stats` ([#643](https://github.com/opensearch-project/opensearch-api-specification/pull/643)) - Added `/_cluster/stats/{metric}/nodes/{node_id}` and `/_cluster/stats/{metric}/{index_metric}/nodes/{node_id}` ([#639](https://github.com/opensearch-project/opensearch-api-specification/pull/639)) +- Added `PhoneAnalyzer` from `analysis-phonenumber` plugin ([#609](https://github.com/opensearch-project/opensearch-api-specification/pull/609)) ### Changed diff --git a/spec/schemas/_common.analysis.yaml b/spec/schemas/_common.analysis.yaml index 9cae913b6..07be175e7 100644 --- a/spec/schemas/_common.analysis.yaml +++ b/spec/schemas/_common.analysis.yaml @@ -27,6 +27,7 @@ components: - $ref: '#/components/schemas/DutchAnalyzer' - $ref: '#/components/schemas/SmartcnAnalyzer' - $ref: '#/components/schemas/CjkAnalyzer' + - $ref: '#/components/schemas/PhoneAnalyzer' CustomAnalyzer: type: object properties: @@ -367,6 +368,17 @@ components: $ref: '#/components/schemas/StopWords' stopwords_path: type: string + PhoneAnalyzer: + type: object + properties: + type: + type: string + enum: + - phone + - phone-search + phone-region: + type: string + description: Optional ISO 3166 country code, defaults to "ZZ" (unknown region). CharFilter: oneOf: - title: name diff --git a/tests/plugins/analysis/Dockerfile b/tests/plugins/analysis/Dockerfile index aa43b705b..b45c0aef9 100644 --- a/tests/plugins/analysis/Dockerfile +++ b/tests/plugins/analysis/Dockerfile @@ -4,3 +4,4 @@ ARG OPENSEARCH_DOCKER_REF FROM ${OPENSEARCH_DOCKER_HUB_PROJECT}/opensearch:${OPENSEARCH_VERSION}${OPENSEARCH_DOCKER_REF} RUN ./bin/opensearch-plugin install -b analysis-icu +RUN ./bin/opensearch-plugin install -b analysis-phonenumber diff --git a/tests/plugins/analysis/indices/analyze/analyzer/phone.yaml b/tests/plugins/analysis/indices/analyze/analyzer/phone.yaml new file mode 100644 index 000000000..528fb6ea9 --- /dev/null +++ b/tests/plugins/analysis/indices/analyze/analyzer/phone.yaml @@ -0,0 +1,38 @@ +$schema: ../../../../../../json_schemas/test_story.schema.yaml + +description: Test /{index}/_analyze for the phone and phone-search analyzers. +prologues: + - path: /example-phone + method: PUT + request: + payload: + settings: + index: + analysis: + analyzer: + phone-ch: + type: phone + phone-region: CH + phone-search-ch: + type: phone-search + phone-region: CH +epilogues: + - path: /example-phone + method: DELETE + status: [200, 404] +chapters: + - synopsis: Analyze phone number. + path: /{index}/_analyze + method: POST + parameters: + index: example-phone + request: + payload: + analyzer: phone-ch + text: '+41 60 555 12 34' + response: + status: 200 + payload: + tokens: + - token: '+41 60 555 12 34' + - token: '6055512' From 0f40a0ee1b3c3ba6273fd5d2c20f2e6652f9dc09 Mon Sep 17 00:00:00 2001 From: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com> Date: Thu, 14 Nov 2024 14:11:42 -0600 Subject: [PATCH 18/20] Update Query Group API descriptions (#674) * Update Query Group API descriptions Will have @natebower review before merging. Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com> * Add parameter descriptions Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com> * Apply suggestions from code review Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Nathan Bower Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com> --------- Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com> Co-authored-by: Nathan Bower --- spec/namespaces/wlm.yaml | 18 +++++++++--------- spec/schemas/wlm._common.yaml | 5 +++++ 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/spec/namespaces/wlm.yaml b/spec/namespaces/wlm.yaml index 083f8ed9e..d9179f33e 100644 --- a/spec/namespaces/wlm.yaml +++ b/spec/namespaces/wlm.yaml @@ -1,7 +1,7 @@ openapi: 3.1.0 info: - title: OpenSearch Workload Management Query Group API - description: Query group lifecycle APIs for the workload management plugin. + title: Workload Management Query Group API + description: The Query Group Lifecycle APIs create, update, and delete workload management query groups. version: 1.0.0 paths: /_wlm/query_group: @@ -9,7 +9,7 @@ paths: operationId: wlm.get_query_group.0 x-operation-group: wlm.get_query_group x-version-added: '2.17' - description: Gets the specified QueryGroup or get all if no name is provided. + description: Retrieves the specified query group. If no query group is specified, all query groups in the cluster are retrieved. responses: '200': $ref: '#/components/responses/wlm.get_query_group@200' @@ -17,7 +17,7 @@ paths: operationId: wlm.create_query_group.0 x-operation-group: wlm.create_query_group x-version-added: '2.17' - description: Creates the specified query group. + description: Creates a new query group and sets the resource limits for the new query group. requestBody: $ref: '#/components/requestBodies/wlm.create_query_group' responses: @@ -28,7 +28,7 @@ paths: operationId: wlm.get_query_group.1 x-operation-group: wlm.get_query_group x-version-added: '2.17' - description: Gets the specified QueryGroup or get all if no name is provided. + description: Retrieves the specified query group. If no query group is specified, all query groups in the cluster are retrieved. parameters: - $ref: '#/components/parameters/wlm.get_query_group::path.name' responses: @@ -50,7 +50,7 @@ paths: operationId: wlm.delete_query_group.0 x-operation-group: wlm.delete_query_group x-version-added: '2.17' - description: Deletes the specified QueryGroup. + description: Deletes the specified query group. parameters: - $ref: '#/components/parameters/wlm.delete_query_group::path.name' responses: @@ -107,21 +107,21 @@ components: wlm.update_query_group::path.name: name: name in: path - description: QueryGroup name. + description: The name of the query group. schema: type: string required: true wlm.delete_query_group::path.name: name: name in: path - description: QueryGroup name. + description: The name of the query group. schema: type: string required: true wlm.get_query_group::path.name: name: name in: path - description: QueryGroup name. + description: The name of the query group. schema: type: string required: true diff --git a/spec/schemas/wlm._common.yaml b/spec/schemas/wlm._common.yaml index ca2c1ae7a..ab6f8816a 100644 --- a/spec/schemas/wlm._common.yaml +++ b/spec/schemas/wlm._common.yaml @@ -10,16 +10,21 @@ components: type: object properties: _id: + description: The ID of the query group, which can be used to associate query requests with the group and enforce the group's resource limits. type: string name: + description: The name of the query group. type: string resiliency_mode: + description: The resiliency mode of the query group. type: string enum: [enforced, monitor,soft] updated_at: + description: The time at which the query group was last updated. type: integer format: int64 resource_limits: + description: The resource limits for query requests in the query group. anyOf: - type: object properties: From 398481e5bd1cc590d947c35379c47096f2114f00 Mon Sep 17 00:00:00 2001 From: "Daniel (dB.) Doubrovkine" Date: Thu, 14 Nov 2024 15:57:58 -0500 Subject: [PATCH 19/20] Replaced all indices with indexes. (#671) * Replaced all indices with indexes. Signed-off-by: dblock * Fixed CHANGELOG entries under the 0.1.0 release. Signed-off-by: dblock --------- Signed-off-by: dblock --- CHANGELOG.md | 6 +- TESTING_GUIDE.md | 2 +- spec/namespaces/_core.yaml | 112 ++++---- spec/namespaces/cat.yaml | 50 ++-- spec/namespaces/cluster.yaml | 20 +- spec/namespaces/dangling_indices.yaml | 2 +- spec/namespaces/indices.yaml | 256 +++++++++--------- spec/namespaces/ism.yaml | 20 +- spec/namespaces/knn.yaml | 18 +- spec/namespaces/nodes.yaml | 2 +- spec/namespaces/security.yaml | 2 +- spec/namespaces/snapshot.yaml | 10 +- spec/schemas/_common.query_dsl.yaml | 2 +- spec/schemas/_common.yaml | 6 +- spec/schemas/asynchronous_search._common.yaml | 6 +- spec/schemas/cat.snapshots.yaml | 2 +- spec/schemas/cluster.stats.yaml | 6 +- spec/schemas/indices._common.yaml | 10 +- spec/schemas/indices.data_streams_stats.yaml | 2 +- spec/schemas/insights._common.yaml | 8 +- tests/default/_core/refresh.yaml | 2 +- tests/default/cat/segments.yaml | 2 +- tests/default/indices/mapping.yaml | 2 +- tests/default/ism/explain.yaml | 4 +- .../security/api/internalusers/authtoken.yaml | 2 +- .../security/api/securityconfig/config.yaml | 2 +- .../default/security/api/user/authtoken.yaml | 2 +- tests/default/security/authinfo.yaml | 2 +- tests/default/security/dashboardsinfo.yaml | 2 +- tests/default/security/health.yaml | 2 +- tests/default/security/tenantinfo.yaml | 2 +- tests/default/security/whoami.yaml | 2 +- .../extractor/opensearch/expected_1.3.yaml | 4 +- .../extractor/opensearch/expected_2.0.yaml | 2 +- .../specs/opensearch/namespaces/index.yaml | 8 +- .../specs/complete/namespaces/index.yaml | 8 +- .../tests/tester/fixtures/specs/excerpt.yaml | 10 +- 37 files changed, 300 insertions(+), 300 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5edd85dcf..2f24a2b46 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,9 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Added `_common.mapping:FlatObjectProperty` ([#661](https://github.com/opensearch-project/opensearch-api-specification/pull/661)) - Added `HEAD /{index}/_doc/{id}` returning `404` ([#670](https://github.com/opensearch-project/opensearch-api-specification/pull/670)) - Added `_common.mapping:IcuCollationKeywordProperty` ([#666](https://github.com/opensearch-project/opensearch-api-specification/pull/666)) +- Added `/_cluster/stats/{metric}/nodes/{node_id}` and `/_cluster/stats/{metric}/{index_metric}/nodes/{node_id}` ([#639](https://github.com/opensearch-project/opensearch-api-specification/pull/639)) +- Added `PhoneAnalyzer` from `analysis-phonenumber` plugin ([#609](https://github.com/opensearch-project/opensearch-api-specification/pull/609)) +- Added `/_list/indices` & `/_list/shards` api specs ([#613](https://github.com/opensearch-project/opensearch-api-specification/pull/613)) ### Removed - Removed unsupported `_common.mapping:SourceField`'s `mode` field and associated `_common.mapping:SourceFieldMode` enum ([#652](https://github.com/opensearch-project/opensearch-api-specification/pull/652)) @@ -135,8 +138,6 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Added API spec for `adjust_pure_negative` for bool queries ([#641](https://github.com/opensearch-project/opensearch-api-specification/pull/641)) - Added a spec style checker [#620](https://github.com/opensearch-project/opensearch-api-specification/pull/620). - Added `remote_store` to node `Stats` ([#643](https://github.com/opensearch-project/opensearch-api-specification/pull/643)) -- Added `/_cluster/stats/{metric}/nodes/{node_id}` and `/_cluster/stats/{metric}/{index_metric}/nodes/{node_id}` ([#639](https://github.com/opensearch-project/opensearch-api-specification/pull/639)) -- Added `PhoneAnalyzer` from `analysis-phonenumber` plugin ([#609](https://github.com/opensearch-project/opensearch-api-specification/pull/609)) ### Changed @@ -161,7 +162,6 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Changed `cluster.reroute`'s `metric` path param to use an enum of metrics ([#586](https://github.com/opensearch-project/opensearch-api-specification/pull/586)) - Changed `indices.stats`'s `metric` path param to use an enum of metrics ([#586](https://github.com/opensearch-project/opensearch-api-specification/pull/586)) - Changed `CleanupRepositoryResults`' properties to be `int64`s ([#587](https://github.com/opensearch-project/opensearch-api-specification/pull/587)) -- Added `/_list/indices` & `/_list/shards` api specs ([#613](https://github.com/opensearch-project/opensearch-api-specification/pull/613)) ### Deprecated diff --git a/TESTING_GUIDE.md b/TESTING_GUIDE.md index ea3867c1a..9e59bd2f6 100644 --- a/TESTING_GUIDE.md +++ b/TESTING_GUIDE.md @@ -97,7 +97,7 @@ Remember to set the `OPENSEARCH_PASSWORD` or `AWS_ACCESS_KEY_ID` and `AWS_SECRET #### FORBIDDEN/10/cluster create-index blocked (api) -The cluster is most likely hitting a disk watermark threshold. This example sets the disk watermark thresholds to 1500MB low, 100MB high, and 500MB flood stage, allowing the cluster to create indices even if the disk is almost full. +The cluster is most likely hitting a disk watermark threshold. This example sets the disk watermark thresholds to 1500MB low, 100MB high, and 500MB flood stage, allowing the cluster to create indexes even if the disk is almost full. ```bash curl -k -X PUT --user "admin:${OPENSEARCH_PASSWORD}" https://localhost:9200/_cluster/settings -H 'Content-Type: application/json' -d' diff --git a/spec/namespaces/_core.yaml b/spec/namespaces/_core.yaml index 542d55bf2..0b9a6f138 100644 --- a/spec/namespaces/_core.yaml +++ b/spec/namespaces/_core.yaml @@ -201,7 +201,7 @@ paths: operationId: field_caps.0 x-operation-group: field_caps x-version-added: '1.0' - description: Returns the information about the capabilities of fields among multiple indices. + description: Returns the information about the capabilities of fields among multiple indexes. externalDocs: url: https://opensearch.org/docs/latest/field-types/supported-field-types/alias/#using-aliases-in-field-capabilities-api-operations parameters: @@ -219,7 +219,7 @@ paths: operationId: field_caps.1 x-operation-group: field_caps x-version-added: '1.0' - description: Returns the information about the capabilities of fields among multiple indices. + description: Returns the information about the capabilities of fields among multiple indexes. externalDocs: url: https://opensearch.org/docs/latest/field-types/supported-field-types/alias/#using-aliases-in-field-capabilities-api-operations parameters: @@ -1014,7 +1014,7 @@ paths: operationId: search_shards.0 x-operation-group: search_shards x-version-added: '1.0' - description: Returns information about the indices and shards that a search request would be executed against. + description: Returns information about the indexes and shards that a search request would be executed against. externalDocs: url: https://opensearch.org/docs/latest parameters: @@ -1031,7 +1031,7 @@ paths: operationId: search_shards.1 x-operation-group: search_shards x-version-added: '1.0' - description: Returns information about the indices and shards that a search request would be executed against. + description: Returns information about the indexes and shards that a search request would be executed against. externalDocs: url: https://opensearch.org/docs/latest parameters: @@ -1534,7 +1534,7 @@ paths: operationId: field_caps.2 x-operation-group: field_caps x-version-added: '1.0' - description: Returns the information about the capabilities of fields among multiple indices. + description: Returns the information about the capabilities of fields among multiple indexes. externalDocs: url: https://opensearch.org/docs/latest/field-types/supported-field-types/alias/#using-aliases-in-field-capabilities-api-operations parameters: @@ -1553,7 +1553,7 @@ paths: operationId: field_caps.3 x-operation-group: field_caps x-version-added: '1.0' - description: Returns the information about the capabilities of fields among multiple indices. + description: Returns the information about the capabilities of fields among multiple indexes. externalDocs: url: https://opensearch.org/docs/latest/field-types/supported-field-types/alias/#using-aliases-in-field-capabilities-api-operations parameters: @@ -1992,7 +1992,7 @@ paths: operationId: search_shards.2 x-operation-group: search_shards x-version-added: '1.0' - description: Returns information about the indices and shards that a search request would be executed against. + description: Returns information about the indexes and shards that a search request would be executed against. externalDocs: url: https://opensearch.org/docs/latest parameters: @@ -2010,7 +2010,7 @@ paths: operationId: search_shards.3 x-operation-group: search_shards x-version-added: '1.0' - description: Returns information about the indices and shards that a search request would be executed against. + description: Returns information about the indexes and shards that a search request would be executed against. externalDocs: url: https://opensearch.org/docs/latest parameters: @@ -2286,7 +2286,7 @@ components: properties: scroll_id: $ref: '../schemas/_common.yaml#/components/schemas/ScrollIds' - description: Comma-separated list of scroll IDs to clear if none was specified via the scroll_id parameter + description: Comma-separated list of scroll IDs to clear if none was specified using the `scroll_id` parameter count: content: application/json: @@ -2549,7 +2549,7 @@ components: track_total_hits: $ref: '../schemas/_core.search.yaml#/components/schemas/TrackHits' indices_boost: - description: Boosts the _score of documents from specified indices. + description: Boosts the `_score` of documents from specified indexes. type: array items: type: object @@ -2624,7 +2624,7 @@ components: Use with caution. OpenSearch applies this parameter to each shard handling the request. When possible, let OpenSearch perform early termination automatically. - Avoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers. + Avoid specifying this parameter for requests that target data streams with backing indexes across multiple data tiers. If set to `0` (default), the query does not terminate early. type: integer format: int32 @@ -2651,7 +2651,7 @@ components: description: |- Stats groups to associate with the search. Each group maintains a statistics aggregation for its associated searches. - You can retrieve these stats using the indices stats API. + You can retrieve these stats using the indexes stats API. type: array items: type: string @@ -3515,9 +3515,9 @@ components: in: path name: index description: |- - Comma-separated list of data streams, indices, and aliases to search. + Comma-separated list of data streams, indexes, and aliases to search. Supports wildcards (`*`). - To search all data streams and indices, omit this parameter or use `*` or `_all`. + To search all data streams and indexes, omit this parameter or use `*` or `_all`. required: true schema: $ref: '../schemas/_common.yaml#/components/schemas/Indices' @@ -3526,8 +3526,8 @@ components: in: query name: allow_no_indices description: |- - If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. - This behavior applies even if the request targets other open indices. + If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indexes. + This behavior applies even if the request targets other open indexes. schema: type: boolean style: form @@ -3581,7 +3581,7 @@ components: count::query.ignore_throttled: in: query name: ignore_throttled - description: If `true`, concrete, expanded or aliased indices are ignored when frozen. + description: If `true`, concrete, expanded or aliased indexes are ignored when frozen. schema: type: boolean style: form @@ -3723,10 +3723,10 @@ components: create_pit::path.index: 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 indexes; use `_all` or empty string to perform the operation on all indexes. schema: type: array - description: Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices. + description: Comma-separated list of indexes; use `_all` or empty string to perform the operation on all indexes. items: type: string required: true @@ -3740,7 +3740,7 @@ components: create_pit::query.expand_wildcards: name: expand_wildcards in: query - description: Whether to expand wildcard expression to concrete indices that are open, closed or both. + description: Whether to expand wildcard expression to concrete indexes that are open, closed or both. schema: $ref: '../schemas/_common.yaml#/components/schemas/ExpandWildcards' create_pit::query.keep_alive: @@ -3849,9 +3849,9 @@ components: in: path name: index description: |- - Comma-separated list of data streams, indices, and aliases to search. + Comma-separated list of data streams, indexes, and aliases to search. Supports wildcards (`*`). - To search all data streams or indices, omit this parameter or use `*` or `_all`. + To search all data streams or indexes, omit this parameter or use `*` or `_all`. required: true schema: $ref: '../schemas/_common.yaml#/components/schemas/Indices' @@ -3893,8 +3893,8 @@ components: in: query name: allow_no_indices description: |- - If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. - This behavior applies even if the request targets other open indices. + If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indexes. + This behavior applies even if the request targets other open indexes. For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`. schema: type: boolean @@ -4105,7 +4105,7 @@ components: Use with caution. OpenSearch applies this parameter to each shard handling the request. When possible, let OpenSearch perform early termination automatically. - Avoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers. + Avoid specifying this parameter for requests that target data streams with backing indexes across multiple data tiers. schema: type: integer format: int32 @@ -4207,7 +4207,7 @@ components: in: path name: index description: |- - Comma-separated list of data streams, indices, and aliases. + Comma-separated list of data streams, indexes, and aliases. Supports wildcards (`*`). required: true schema: @@ -4303,7 +4303,7 @@ components: in: path name: index description: |- - Comma-separated list of data streams, indices, and aliases. + Comma-separated list of data streams, indexes, and aliases. Supports wildcards (`*`). required: true schema: @@ -4489,7 +4489,7 @@ components: field_caps::path.index: in: path name: index - description: Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (*). To target all data streams and indices, omit this parameter or use * or _all. + description: Comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (*). To target all data streams and indexes, omit this parameter or use * or _all. required: true schema: $ref: '../schemas/_common.yaml#/components/schemas/Indices' @@ -4499,7 +4499,7 @@ components: name: allow_no_indices description: |- If false, the request returns an error if any wildcard expression, index alias, - or `_all` value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request + or `_all` value targets only missing or closed indexes. This behavior applies even if the request targets other open indexes. For example, a request targeting `foo*,bar*` returns an error if an index starts with foo but no index starts with bar. schema: type: boolean @@ -4521,7 +4521,7 @@ components: field_caps::query.ignore_unavailable: in: query name: ignore_unavailable - description: If `true`, missing or closed indices are not included in the response. + description: If `true`, missing or closed indexes are not included in the response. schema: type: boolean style: form @@ -4912,7 +4912,7 @@ components: msearch::path.index: in: path name: index - description: Comma-separated list of data streams, indices, and index aliases to search. + description: Comma-separated list of data streams, indexes, and index aliases to search. required: true schema: $ref: '../schemas/_common.yaml#/components/schemas/Indices' @@ -4976,9 +4976,9 @@ components: in: path name: index description: |- - Comma-separated list of data streams, indices, and aliases to search. + Comma-separated list of data streams, indexes, and aliases to search. Supports wildcards (`*`). - To search all data streams and indices, omit this parameter or use `*`. + To search all data streams and indexes, omit this parameter or use `*`. required: true schema: $ref: '../schemas/_common.yaml#/components/schemas/Indices' @@ -5190,8 +5190,8 @@ components: in: path name: index description: |- - Comma-separated list of data streams, indices, and index aliases used to limit the request. Wildcard (`*`) expressions are supported. - To target all data streams and indices in a cluster, omit this parameter or use `_all` or `*`. + Comma-separated list of data streams, indexes, and index aliases used to limit the request. Wildcard (`*`) expressions are supported. + To target all data streams and indexes in a cluster, omit this parameter or use `_all` or `*`. required: true schema: $ref: '../schemas/_common.yaml#/components/schemas/Indices' @@ -5199,21 +5199,21 @@ components: rank_eval::query.allow_no_indices: in: query name: allow_no_indices - description: If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`. + description: If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indexes. This behavior applies even if the request targets other open indexes. For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`. schema: type: boolean style: form rank_eval::query.expand_wildcards: in: query name: expand_wildcards - description: Whether to expand wildcard expression to concrete indices that are open, closed or both. + description: Whether to expand wildcard expression to concrete indexes that are open, closed or both. schema: $ref: '../schemas/_common.yaml#/components/schemas/ExpandWildcards' style: form rank_eval::query.ignore_unavailable: in: query name: ignore_unavailable - description: If `true`, missing or closed indices are not included in the response. + description: If `true`, missing or closed indexes are not included in the response. schema: type: boolean style: form @@ -5355,9 +5355,9 @@ components: in: path name: index description: |- - Comma-separated list of data streams, indices, and aliases to search. + Comma-separated list of data streams, indexes, and aliases to search. Supports wildcards (`*`). - To search all data streams and indices, omit this parameter or use `*` or `_all`. + To search all data streams and indexes, omit this parameter or use `*` or `_all`. required: true schema: $ref: '../schemas/_common.yaml#/components/schemas/Indices' @@ -5400,8 +5400,8 @@ components: in: query name: allow_no_indices description: |- - If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. - This behavior applies even if the request targets other open indices. + If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indexes. + This behavior applies even if the request targets other open indexes. For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`. schema: type: boolean @@ -5510,7 +5510,7 @@ components: search::query.ignore_throttled: in: query name: ignore_throttled - description: If `true`, concrete, expanded or aliased indices will be ignored when frozen. + description: If `true`, concrete, expanded or aliased indexes will be ignored when frozen. schema: type: boolean style: form @@ -5740,7 +5740,7 @@ components: Use with caution. OpenSearch applies this parameter to each shard handling the request. When possible, let OpenSearch perform early termination automatically. - Avoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers. + Avoid specifying this parameter for requests that target data streams with backing indexes across multiple data tiers. If set to `0` (default), the query does not terminate early. schema: type: integer @@ -5797,7 +5797,7 @@ components: search_shards::path.index: in: path name: index - description: Returns the indices and shards that a search request would be executed against. + description: Returns the indexes and shards that a search request would be executed against. required: true schema: $ref: '../schemas/_common.yaml#/components/schemas/Indices' @@ -5806,8 +5806,8 @@ components: in: query name: allow_no_indices description: |- - If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. - This behavior applies even if the request targets other open indices. + If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indexes. + This behavior applies even if the request targets other open indexes. For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`. schema: type: boolean @@ -5859,7 +5859,7 @@ components: in: path name: index description: |- - Comma-separated list of data streams, indices, + Comma-separated list of data streams, indexes, and aliases to search. Supports wildcards (*). required: true schema: @@ -5869,8 +5869,8 @@ components: in: query name: allow_no_indices description: |- - If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. - This behavior applies even if the request targets other open indices. + If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indexes. + This behavior applies even if the request targets other open indexes. For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`. schema: type: boolean @@ -5904,7 +5904,7 @@ components: search_template::query.ignore_throttled: in: query name: ignore_throttled - description: If `true`, specified concrete, expanded, or aliased indices are not included in the response when throttled. + description: If `true`, specified concrete, expanded, or aliased indexes are not included in the response when throttled. schema: type: boolean style: form @@ -6195,9 +6195,9 @@ components: in: path name: index description: |- - Comma-separated list of data streams, indices, and aliases to search. + Comma-separated list of data streams, indexes, and aliases to search. Supports wildcards (`*`). - To search all data streams or indices, omit this parameter or use `*` or `_all`. + To search all data streams or indexes, omit this parameter or use `*` or `_all`. required: true schema: $ref: '../schemas/_common.yaml#/components/schemas/Indices' @@ -6239,8 +6239,8 @@ components: in: query name: allow_no_indices description: |- - If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. - This behavior applies even if the request targets other open indices. + If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indexes. + This behavior applies even if the request targets other open indexes. For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`. schema: type: boolean @@ -6456,7 +6456,7 @@ components: Use with caution. OpenSearch applies this parameter to each shard handling the request. When possible, let OpenSearch perform early termination automatically. - Avoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers. + Avoid specifying this parameter for requests that target data streams with backing indexes across multiple data tiers. schema: type: integer format: int32 diff --git a/spec/namespaces/cat.yaml b/spec/namespaces/cat.yaml index c89368e5b..7e05cdea5 100644 --- a/spec/namespaces/cat.yaml +++ b/spec/namespaces/cat.yaml @@ -20,7 +20,7 @@ paths: operationId: cat.aliases.0 x-operation-group: cat.aliases x-version-added: '1.0' - description: Shows information about currently configured aliases to indices including filter and routing infos. + description: Shows information about currently configured aliases to indexes including filter and routing info. externalDocs: url: https://opensearch.org/docs/latest/api-reference/cat/cat-aliases/ parameters: @@ -39,7 +39,7 @@ paths: operationId: cat.aliases.1 x-operation-group: cat.aliases x-version-added: '1.0' - description: Shows information about currently configured aliases to indices including filter and routing infos. + description: Shows information about currently configured aliases to indexes including filter and routing info. externalDocs: url: https://opensearch.org/docs/latest/api-reference/cat/cat-aliases/ parameters: @@ -122,7 +122,7 @@ paths: operationId: cat.count.0 x-operation-group: cat.count x-version-added: '1.0' - description: Provides quick access to the document count of the entire cluster, or individual indices. + description: Provides quick access to the document count of the entire cluster, or individual indexes. externalDocs: url: https://opensearch.org/docs/latest/api-reference/cat/cat-count/ parameters: @@ -139,7 +139,7 @@ paths: operationId: cat.count.1 x-operation-group: cat.count x-version-added: '1.0' - description: Provides quick access to the document count of the entire cluster, or individual indices. + description: Provides quick access to the document count of the entire cluster, or individual indexes. externalDocs: url: https://opensearch.org/docs/latest/api-reference/cat/cat-count/ parameters: @@ -215,7 +215,7 @@ paths: operationId: cat.indices.0 x-operation-group: cat.indices x-version-added: '1.0' - description: 'Returns information about indices: number of primaries and replicas, document counts, disk size, ...' + description: 'Returns information about indexes: number of primaries and replicas, document counts, disk size, ...' externalDocs: url: https://opensearch.org/docs/latest/api-reference/cat/cat-indices/ parameters: @@ -241,7 +241,7 @@ paths: operationId: cat.indices.1 x-operation-group: cat.indices x-version-added: '1.0' - description: 'Returns information about indices: number of primaries and replicas, document counts, disk size, ...' + description: 'Returns information about indexes: number of primaries and replicas, document counts, disk size, ...' externalDocs: url: https://opensearch.org/docs/latest/api-reference/cat/cat-indices/ parameters: @@ -1066,7 +1066,7 @@ components: cat.aliases::query.expand_wildcards: in: query name: expand_wildcards - description: Whether to expand wildcard expression to concrete indices that are open, closed or both. + description: Whether to expand wildcard expression to concrete indexes that are open, closed or both. schema: $ref: '../schemas/_common.yaml#/components/schemas/ExpandWildcards' style: form @@ -1331,8 +1331,8 @@ components: in: path name: index description: |- - Comma-separated list of data streams, indices, and aliases used to limit the request. - Supports wildcards (`*`). To target all data streams and indices, omit this parameter or use `*` or `_all`. + Comma-separated list of data streams, indexes, and aliases used to limit the request. + Supports wildcards (`*`). To target all data streams and indexes, omit this parameter or use `*` or `_all`. required: true schema: $ref: '../schemas/_common.yaml#/components/schemas/Indices' @@ -1515,8 +1515,8 @@ components: in: path name: index description: |- - Comma-separated list of data streams, indices, and aliases used to limit the request. - Supports wildcards (`*`). To target all data streams and indices, omit this parameter or use `*` or `_all`. + Comma-separated list of data streams, indexes, and aliases used to limit the request. + Supports wildcards (`*`). To target all data streams and indexes, omit this parameter or use `*` or `_all`. required: true schema: $ref: '../schemas/_common.yaml#/components/schemas/Indices' @@ -1563,7 +1563,7 @@ components: cat.indices::query.health: in: query name: health - description: The health status used to limit returned indices. By default, the response includes indices of any health status. + description: The health status used to limit returned indexes. By default, the response includes indexes of any health status. schema: $ref: '../schemas/_common.yaml#/components/schemas/HealthStatus' style: form @@ -2066,8 +2066,8 @@ components: in: path name: index description: |- - A comma-separated list of data streams, indices, and aliases used to limit the request. - Supports wildcards (`*`). To target all data streams and indices, omit this parameter or use `*` or `_all`. + A comma-separated list of data streams, indexes, and aliases used to limit the request. + Supports wildcards (`*`). To target all data streams and indexes, omit this parameter or use `*` or `_all`. required: true schema: $ref: '../schemas/_common.yaml#/components/schemas/Indices' @@ -2247,10 +2247,10 @@ components: cat.segment_replication::query.allow_no_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). + description: Whether to ignore if a wildcard indexes expression resolves into no concrete indexes. (This includes `_all` string or when no indexes 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). + description: Whether to ignore if a wildcard indexes expression resolves into no concrete indexes. (This includes `_all` string or when no indexes have been specified). cat.segment_replication::query.bytes: name: bytes in: query @@ -2276,7 +2276,7 @@ components: cat.segment_replication::query.expand_wildcards: name: expand_wildcards in: query - description: Whether to expand wildcard expression to concrete indices that are open, closed or both. + description: Whether to expand wildcard expression to concrete indexes that are open, closed or both. schema: $ref: '../schemas/_common.yaml#/components/schemas/ExpandWildcards' cat.segment_replication::query.format: @@ -2308,17 +2308,17 @@ components: cat.segment_replication::query.ignore_throttled: name: ignore_throttled in: query - description: Whether specified concrete, expanded or aliased indices should be ignored when throttled. + description: Whether specified concrete, expanded or aliased indexes should be ignored when throttled. schema: type: boolean - description: Whether specified concrete, expanded or aliased indices should be ignored when throttled. + description: Whether specified concrete, expanded or aliased indexes should be ignored when throttled. cat.segment_replication::query.ignore_unavailable: name: ignore_unavailable in: query - description: Whether specified concrete indices should be ignored when unavailable (missing or closed). + description: Whether specified concrete indexes should be ignored when unavailable (missing or closed). schema: type: boolean - description: Whether specified concrete indices should be ignored when unavailable (missing or closed). + description: Whether specified concrete indexes should be ignored when unavailable (missing or closed). cat.segment_replication::query.index: name: index in: query @@ -2376,9 +2376,9 @@ components: in: path name: index description: |- - A comma-separated list of data streams, indices, and aliases used to limit the request. + A comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). - To target all data streams and indices, omit this parameter or use `*` or `_all`. + To target all data streams and indexes, omit this parameter or use `*` or `_all`. required: true schema: $ref: '../schemas/_common.yaml#/components/schemas/Indices' @@ -2455,9 +2455,9 @@ components: in: path name: index description: |- - A comma-separated list of data streams, indices, and aliases used to limit the request. + A comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). - To target all data streams and indices, omit this parameter or use `*` or `_all`. + To target all data streams and indexes, omit this parameter or use `*` or `_all`. required: true schema: $ref: '../schemas/_common.yaml#/components/schemas/Indices' diff --git a/spec/namespaces/cluster.yaml b/spec/namespaces/cluster.yaml index d8bc97d90..30ac38284 100644 --- a/spec/namespaces/cluster.yaml +++ b/spec/namespaces/cluster.yaml @@ -539,8 +539,8 @@ components: allow_auto_create: description: |- This setting overrides the value of the `action.auto_create_index` cluster setting. - If set to `true` in a template, then indices can be automatically created using that - template even if auto-creation of indices is disabled via `actions.auto_create_index`. + If set to `true` in a template, then indexes can be automatically created using that + template even if auto-creation of indexes is disabled using `actions.auto_create_index`. If set to `false` then data streams matching the template must always be explicitly created. type: boolean template: @@ -1009,7 +1009,7 @@ components: cluster.health::path.index: in: path name: index - description: Comma-separated list of data streams, indices, and index aliases used to limit the request. Wildcard expressions (*) are supported. To target all data streams and indices in a cluster, omit this parameter or use `_all` or `*`. + description: Comma-separated list of data streams, indexes, and index aliases used to limit the request. Wildcard expressions (*) are supported. To target all data streams and indexes in a cluster, omit this parameter or use `_all` or `*`. required: true schema: $ref: '../schemas/_common.yaml#/components/schemas/Indices' @@ -1031,14 +1031,14 @@ components: cluster.health::query.expand_wildcards: in: query name: expand_wildcards - description: Whether to expand wildcard expression to concrete indices that are open, closed or both. + description: Whether to expand wildcard expression to concrete indexes that are open, closed or both. schema: $ref: '../schemas/_common.yaml#/components/schemas/ExpandWildcards' style: form cluster.health::query.level: in: query name: level - description: Can be one of cluster, indices or shards. Controls the details level of the health information returned. + description: Can be one of cluster, indexes or shards. Controls the details level of the health information returned. schema: $ref: '../schemas/cluster.health.yaml#/components/schemas/Level' style: form @@ -1175,7 +1175,7 @@ components: description: |- Name of the component template to create. OpenSearch includes the following built-in component templates: `logs-mappings`; 'logs-settings`; `metrics-mappings`; `metrics-settings`;`synthetics-mapping`; `synthetics-settings`. - OpenSearch Agent uses these templates to configure backing indices for its data streams. + OpenSearch Agent uses these templates to configure backing indexes for its data streams. If you use OpenSearch Agent and want to overwrite one of these templates, set the `version` for your replacement template higher than the current version. If you don't use OpenSearch Agent and want to disable all built-in component and index templates, set `stack.templates.enabled` to `false` using the cluster update settings API. required: true @@ -1330,7 +1330,7 @@ components: cluster.state::path.index: in: path name: index - description: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + description: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indexes required: true schema: $ref: '../schemas/_common.yaml#/components/schemas/Indices' @@ -1348,7 +1348,7 @@ components: cluster.state::query.allow_no_indices: in: query name: allow_no_indices - description: 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 ignore if a wildcard indexes expression resolves into no concrete indexes. (This includes `_all` string or when no indexes have been specified) schema: type: boolean style: form @@ -1362,7 +1362,7 @@ components: cluster.state::query.expand_wildcards: in: query name: expand_wildcards - description: Whether to expand wildcard expression to concrete indices that are open, closed or both. + description: Whether to expand wildcard expression to concrete indexes that are open, closed or both. schema: $ref: '../schemas/_common.yaml#/components/schemas/ExpandWildcards' style: form @@ -1377,7 +1377,7 @@ components: cluster.state::query.ignore_unavailable: in: query name: ignore_unavailable - description: Whether specified concrete indices should be ignored when unavailable (missing or closed) + description: Whether specified concrete indexes should be ignored when unavailable (missing or closed) schema: type: boolean style: form diff --git a/spec/namespaces/dangling_indices.yaml b/spec/namespaces/dangling_indices.yaml index d4ba7438b..c81970e84 100644 --- a/spec/namespaces/dangling_indices.yaml +++ b/spec/namespaces/dangling_indices.yaml @@ -9,7 +9,7 @@ paths: operationId: dangling_indices.list_dangling_indices.0 x-operation-group: dangling_indices.list_dangling_indices x-version-added: '1.0' - description: Returns all dangling indices. + description: Returns all dangling indexes. externalDocs: url: https://opensearch.org/docs/latest/api-reference/index-apis/dangling-index/ parameters: [] diff --git a/spec/namespaces/indices.yaml b/spec/namespaces/indices.yaml index cae77c601..a820e2621 100644 --- a/spec/namespaces/indices.yaml +++ b/spec/namespaces/indices.yaml @@ -198,7 +198,7 @@ paths: x-distributions-excluded: - amazon-managed - amazon-serverless - description: Clears all or specific caches for one or more indices. + description: Clears all or specific caches for one or more indexes. externalDocs: url: https://opensearch.org/docs/latest/api-reference/index-apis/clear-index-cache/ parameters: @@ -295,7 +295,7 @@ paths: operationId: indices.flush.0 x-operation-group: indices.flush x-version-added: '1.0' - description: Performs the flush operation on one or more indices. + description: Performs the flush operation on one or more indexes. externalDocs: url: https://opensearch.org/docs/latest parameters: @@ -311,7 +311,7 @@ paths: operationId: indices.flush.1 x-operation-group: indices.flush x-version-added: '1.0' - description: Performs the flush operation on one or more indices. + description: Performs the flush operation on one or more indexes. externalDocs: url: https://opensearch.org/docs/latest parameters: @@ -331,7 +331,7 @@ paths: x-distributions-excluded: - amazon-managed - amazon-serverless - description: Performs the force merge operation on one or more indices. + description: Performs the force merge operation on one or more indexes. externalDocs: url: https://opensearch.org/docs/latest parameters: @@ -507,7 +507,7 @@ paths: operationId: indices.get_mapping.0 x-operation-group: indices.get_mapping x-version-added: '1.0' - description: Returns mappings for one or more indices. + description: Returns mappings for one or more indexes. externalDocs: url: https://opensearch.org/docs/latest/field-types/index/#get-a-mapping parameters: @@ -558,7 +558,7 @@ paths: operationId: indices.refresh.0 x-operation-group: indices.refresh x-version-added: '1.0' - description: Performs the refresh operation in one or more indices. + description: Performs the refresh operation in one or more indexes. externalDocs: url: https://opensearch.org/docs/latest/tuning-your-cluster/availability-and-recovery/remote-store/index/#refresh-level-and-request-level-durability parameters: @@ -572,7 +572,7 @@ paths: operationId: indices.refresh.1 x-operation-group: indices.refresh x-version-added: '1.0' - description: Performs the refresh operation in one or more indices. + description: Performs the refresh operation in one or more indexes. externalDocs: url: https://opensearch.org/docs/latest/tuning-your-cluster/availability-and-recovery/remote-store/index/#refresh-level-and-request-level-durability parameters: @@ -587,7 +587,7 @@ paths: operationId: indices.resolve_index.0 x-operation-group: indices.resolve_index x-version-added: '1.0' - description: Returns information about any matching indices, aliases, and data streams. + description: Returns information about any matching indexes, aliases, and data streams. externalDocs: url: https://opensearch.org/docs/latest parameters: @@ -623,7 +623,7 @@ paths: x-distributions-excluded: - amazon-managed - amazon-serverless - description: Returns settings for one or more indices. + description: Returns settings for one or more indexes. externalDocs: url: https://opensearch.org/docs/latest/api-reference/index-apis/get-settings/ parameters: @@ -664,7 +664,7 @@ paths: operationId: indices.get_settings.1 x-operation-group: indices.get_settings x-version-added: '1.0' - description: Returns settings for one or more indices. + description: Returns settings for one or more indexes. externalDocs: url: https://opensearch.org/docs/latest/api-reference/index-apis/get-settings/ parameters: @@ -685,7 +685,7 @@ paths: operationId: indices.shard_stores.0 x-operation-group: indices.shard_stores x-version-added: '1.0' - description: Provides store information for shard copies of indices. + description: Provides store information for shard copies of indexes. externalDocs: url: https://opensearch.org/docs/latest parameters: @@ -971,7 +971,7 @@ paths: operationId: indices.get.0 x-operation-group: indices.get x-version-added: '1.0' - description: Returns information about one or more indices. + description: Returns information about one or more indexes. externalDocs: url: https://opensearch.org/docs/latest/api-reference/index-apis/get-index/ parameters: @@ -1300,7 +1300,7 @@ paths: operationId: indices.clear_cache.1 x-operation-group: indices.clear_cache x-version-added: '1.0' - description: Clears all or specific caches for one or more indices. + description: Clears all or specific caches for one or more indexes. externalDocs: url: https://opensearch.org/docs/latest/api-reference/index-apis/clear-index-cache/ parameters: @@ -1385,7 +1385,7 @@ paths: operationId: indices.flush.2 x-operation-group: indices.flush x-version-added: '1.0' - description: Performs the flush operation on one or more indices. + description: Performs the flush operation on one or more indexes. externalDocs: url: https://opensearch.org/docs/latest parameters: @@ -1402,7 +1402,7 @@ paths: operationId: indices.flush.3 x-operation-group: indices.flush x-version-added: '1.0' - description: Performs the flush operation on one or more indices. + description: Performs the flush operation on one or more indexes. externalDocs: url: https://opensearch.org/docs/latest parameters: @@ -1420,7 +1420,7 @@ paths: operationId: indices.forcemerge.1 x-operation-group: indices.forcemerge x-version-added: '1.0' - description: Performs the force merge operation on one or more indices. + description: Performs the force merge operation on one or more indexes. externalDocs: url: https://opensearch.org/docs/latest parameters: @@ -1441,7 +1441,7 @@ paths: operationId: indices.get_mapping.1 x-operation-group: indices.get_mapping x-version-added: '1.0' - description: Returns mappings for one or more indices. + description: Returns mappings for one or more indexes. externalDocs: url: https://opensearch.org/docs/latest/field-types/index/#get-a-mapping parameters: @@ -1559,7 +1559,7 @@ paths: operationId: indices.refresh.2 x-operation-group: indices.refresh x-version-added: '1.0' - description: Performs the refresh operation in one or more indices. + description: Performs the refresh operation in one or more indexes. externalDocs: url: https://opensearch.org/docs/latest/tuning-your-cluster/availability-and-recovery/remote-store/index/#refresh-level-and-request-level-durability parameters: @@ -1574,7 +1574,7 @@ paths: operationId: indices.refresh.3 x-operation-group: indices.refresh x-version-added: '1.0' - description: Performs the refresh operation in one or more indices. + description: Performs the refresh operation in one or more indexes. externalDocs: url: https://opensearch.org/docs/latest/tuning-your-cluster/availability-and-recovery/remote-store/index/#refresh-level-and-request-level-durability parameters: @@ -1610,7 +1610,7 @@ paths: operationId: indices.get_settings.2 x-operation-group: indices.get_settings x-version-added: '1.0' - description: Returns settings for one or more indices. + description: Returns settings for one or more indexes. externalDocs: url: https://opensearch.org/docs/latest/api-reference/index-apis/get-settings/ parameters: @@ -1653,7 +1653,7 @@ paths: operationId: indices.get_settings.3 x-operation-group: indices.get_settings x-version-added: '1.0' - description: Returns settings for one or more indices. + description: Returns settings for one or more indexes. externalDocs: url: https://opensearch.org/docs/latest/api-reference/index-apis/get-settings/ parameters: @@ -1675,7 +1675,7 @@ paths: operationId: indices.shard_stores.1 x-operation-group: indices.shard_stores x-version-added: '1.0' - description: Provides store information for shard copies of indices. + description: Provides store information for shard copies of indexes. externalDocs: url: https://opensearch.org/docs/latest parameters: @@ -2005,7 +2005,7 @@ components: is_write_index: description: |- If `true`, sets the write index or data stream for the alias. - If an alias points to multiple indices or data streams and `is_write_index` isn't set, the alias rejects write requests. + If an alias points to multiple indexes or data streams and `is_write_index` isn't set, the alias rejects write requests. If an index alias points to one index and `is_write_index` isn't set, the index automatically acts as the write index. Data stream aliases don't automatically set a write data stream, even if the alias points to one data stream. type: boolean @@ -2125,7 +2125,7 @@ components: index_patterns: description: |- Array of wildcard expressions used to match the names - of indices during creation. + of indexes during creation. oneOf: - type: string - type: array @@ -2203,8 +2203,8 @@ components: allow_auto_create: description: |- This setting overrides the value of the `action.auto_create_index` cluster setting. - If set to `true` in a template, then indices can be automatically created using that template even if auto-creation of indices is disabled via `actions.auto_create_index`. - If set to `false`, then indices or data streams matching the template must always be explicitly created, and may never be automatically created. + If set to `true` in a template, then indexes can be automatically created using that template even if auto-creation of indexes is disabled using `actions.auto_create_index`. + If set to `false`, then indexes or data streams matching the template must always be explicitly created, and may never be automatically created. type: boolean index_patterns: $ref: '../schemas/_common.yaml#/components/schemas/Indices' @@ -2374,7 +2374,7 @@ components: _shards: $ref: '../schemas/_common.yaml#/components/schemas/ShardStatistics' backing_indices: - description: Total number of backing indices for the selected data streams. + description: Total number of backing indexes for the selected data streams. type: number data_stream_count: description: Total number of selected data streams. @@ -2771,7 +2771,7 @@ components: indices.add_block::path.index: in: path name: index - description: A comma separated list of indices to add a block to + description: A comma separated list of indexes to add a block to required: true schema: $ref: '../schemas/_common.yaml#/components/schemas/Indices' @@ -2779,7 +2779,7 @@ components: indices.add_block::query.allow_no_indices: in: query name: allow_no_indices - description: 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 ignore if a wildcard indexes expression resolves into no concrete indexes. (This includes `_all` string or when no indexes have been specified) schema: type: boolean style: form @@ -2793,14 +2793,14 @@ components: indices.add_block::query.expand_wildcards: in: query name: expand_wildcards - description: Whether to expand wildcard expression to concrete indices that are open, closed or both. + description: Whether to expand wildcard expression to concrete indexes that are open, closed or both. schema: $ref: '../schemas/_common.yaml#/components/schemas/ExpandWildcards' style: form indices.add_block::query.ignore_unavailable: in: query name: ignore_unavailable - description: Whether specified concrete indices should be ignored when unavailable (missing or closed) + description: Whether specified concrete indexes should be ignored when unavailable (missing or closed) schema: type: boolean style: form @@ -2843,9 +2843,9 @@ components: in: path name: index description: |- - Comma-separated list of data streams, indices, and aliases used to limit the request. + Comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). - To target all data streams and indices, omit this parameter or use `*` or `_all`. + To target all data streams and indexes, omit this parameter or use `*` or `_all`. required: true schema: $ref: '../schemas/_common.yaml#/components/schemas/Indices' @@ -2854,8 +2854,8 @@ components: in: query name: allow_no_indices description: |- - If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. - This behavior applies even if the request targets other open indices. + If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indexes. + This behavior applies even if the request targets other open indexes. schema: type: boolean style: form @@ -2905,13 +2905,13 @@ components: indices.clear_cache::query.index: name: index in: query - description: Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices. + description: Comma-separated list of indexes; use `_all` or empty string to perform the operation on all indexes. 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. + description: Comma-separated list of indexes; use `_all` or empty string to perform the operation on all indexes. explode: true indices.clear_cache::query.query: in: query @@ -3007,8 +3007,8 @@ components: in: query name: allow_no_indices description: |- - If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. - This behavior applies even if the request targets other open indices. + If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indexes. + This behavior applies even if the request targets other open indexes. schema: type: boolean style: form @@ -3141,7 +3141,7 @@ components: in: path name: index description: |- - Comma-separated list of indices to delete. + Comma-separated list of indexes to delete. You cannot specify index aliases. By default, this parameter does not support wildcards (`*`) or `_all`. To use wildcards or `_all`, set the `action.destructive_requires_name` cluster setting to `false`. @@ -3153,8 +3153,8 @@ components: in: query name: allow_no_indices description: |- - If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. - This behavior applies even if the request targets other open indices. + If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indexes. + This behavior applies even if the request targets other open indexes. schema: type: boolean default: false @@ -3210,7 +3210,7 @@ components: in: path name: index description: |- - Comma-separated list of data streams or indices used to limit the request. + Comma-separated list of data streams or indexes used to limit the request. Supports wildcards (`*`). required: true schema: @@ -3335,7 +3335,7 @@ components: indices.exists::path.index: in: path name: index - description: Comma-separated list of data streams, indices, and aliases. Supports wildcards (`*`). + description: Comma-separated list of data streams, indexes, and aliases. Supports wildcards (`*`). required: true schema: $ref: '../schemas/_common.yaml#/components/schemas/Indices' @@ -3351,8 +3351,8 @@ components: in: query name: allow_no_indices description: |- - If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. - This behavior applies even if the request targets other open indices. + If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indexes. + This behavior applies even if the request targets other open indexes. schema: type: boolean default: false @@ -3404,8 +3404,8 @@ components: in: path name: index description: |- - Comma-separated list of data streams or indices used to limit the request. Supports wildcards (`*`). - To target all data streams and indices, omit this parameter or use `*` or `_all`. + Comma-separated list of data streams or indexes used to limit the request. Supports wildcards (`*`). + To target all data streams and indexes, omit this parameter or use `*` or `_all`. required: true schema: $ref: '../schemas/_common.yaml#/components/schemas/Indices' @@ -3422,8 +3422,8 @@ components: in: query name: allow_no_indices description: |- - If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. - This behavior applies even if the request targets other open indices. + If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indexes. + This behavior applies even if the request targets other open indexes. schema: type: boolean style: form @@ -3441,7 +3441,7 @@ components: indices.exists_alias::query.ignore_unavailable: in: query name: ignore_unavailable - description: If `false`, requests that include a missing data stream or index in the target indices or data streams return an error. + description: If `false`, requests that include a missing data stream or index in the target indexes or data streams return an error. schema: type: boolean style: form @@ -3539,9 +3539,9 @@ components: in: path name: index description: |- - Comma-separated list of data streams, indices, and aliases to flush. + Comma-separated list of data streams, indexes, and aliases to flush. Supports wildcards (`*`). - To flush all data streams and indices, omit this parameter or use `*` or `_all`. + To flush all data streams and indexes, omit this parameter or use `*` or `_all`. required: true schema: $ref: '../schemas/_common.yaml#/components/schemas/Indices' @@ -3550,8 +3550,8 @@ components: in: query name: allow_no_indices description: |- - If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. - This behavior applies even if the request targets other open indices. + If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indexes. + This behavior applies even if the request targets other open indexes. schema: type: boolean style: form @@ -3593,7 +3593,7 @@ components: indices.forcemerge::path.index: in: path name: index - description: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + description: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indexes required: true schema: $ref: '../schemas/_common.yaml#/components/schemas/Indices' @@ -3601,14 +3601,14 @@ components: indices.forcemerge::query.allow_no_indices: in: query name: allow_no_indices - description: 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 ignore if a wildcard indexes expression resolves into no concrete indexes. (This includes `_all` string or when no indexes have been specified) schema: type: boolean style: form indices.forcemerge::query.expand_wildcards: in: query name: expand_wildcards - description: Whether to expand wildcard expression to concrete indices that are open, closed or both. + description: Whether to expand wildcard expression to concrete indexes that are open, closed or both. schema: $ref: '../schemas/_common.yaml#/components/schemas/ExpandWildcards' style: form @@ -3623,7 +3623,7 @@ components: indices.forcemerge::query.ignore_unavailable: in: query name: ignore_unavailable - description: Whether specified concrete indices should be ignored when unavailable (missing or closed) + description: Whether specified concrete indexes should be ignored when unavailable (missing or closed) schema: type: boolean style: form @@ -3666,7 +3666,7 @@ components: in: path name: index description: |- - Comma-separated list of data streams, indices, and index aliases used to limit the request. + Comma-separated list of data streams, indexes, and index aliases used to limit the request. Wildcard expressions (*) are supported. required: true schema: @@ -3677,7 +3677,7 @@ components: name: allow_no_indices description: |- If false, the request returns an error if any wildcard expression, index alias, or _all value targets only - missing or closed indices. This behavior applies even if the request targets other open indices. For example, + missing or closed indexes. This behavior applies even if the request targets other open indexes. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar. schema: type: boolean @@ -3746,9 +3746,9 @@ components: in: path name: index description: |- - Comma-separated list of data streams or indices used to limit the request. + Comma-separated list of data streams or indexes used to limit the request. Supports wildcards (`*`). - To target all data streams and indices, omit this parameter or use `*` or `_all`. + To target all data streams and indexes, omit this parameter or use `*` or `_all`. required: true schema: $ref: '../schemas/_common.yaml#/components/schemas/Indices' @@ -3768,8 +3768,8 @@ components: in: query name: allow_no_indices description: |- - If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. - This behavior applies even if the request targets other open indices. + If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indexes. + This behavior applies even if the request targets other open indexes. schema: type: boolean style: form @@ -3821,9 +3821,9 @@ components: in: path name: index description: |- - Comma-separated list of data streams, indices, and aliases used to limit the request. + Comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). - To target all data streams and indices, omit this parameter or use `*` or `_all`. + To target all data streams and indexes, omit this parameter or use `*` or `_all`. required: true schema: $ref: '../schemas/_common.yaml#/components/schemas/Indices' @@ -3832,8 +3832,8 @@ components: in: query name: allow_no_indices description: |- - If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. - This behavior applies even if the request targets other open indices. + If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indexes. + This behavior applies even if the request targets other open indexes. schema: type: boolean style: form @@ -3915,9 +3915,9 @@ components: in: path name: index description: |- - Comma-separated list of data streams, indices, and aliases used to limit the request. + Comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). - To target all data streams and indices, omit this parameter or use `*` or `_all`. + To target all data streams and indexes, omit this parameter or use `*` or `_all`. required: true schema: $ref: '../schemas/_common.yaml#/components/schemas/Indices' @@ -3926,8 +3926,8 @@ components: in: query name: allow_no_indices description: |- - If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. - This behavior applies even if the request targets other open indices. + If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indexes. + This behavior applies even if the request targets other open indexes. schema: type: boolean style: form @@ -3960,9 +3960,9 @@ components: in: query name: index description: |- - Comma-separated list of data streams, indices, and aliases used to limit the request. + Comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). - To target all data streams and indices, omit this parameter or use `*` or `_all`. + To target all data streams and indexes, omit this parameter or use `*` or `_all`. schema: $ref: '../schemas/_common.yaml#/components/schemas/Indices' style: form @@ -3990,9 +3990,9 @@ components: in: path name: index description: |- - Comma-separated list of data streams, indices, and aliases used to limit + Comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and - indices, omit this parameter or use `*` or `_all`. + indexes, omit this parameter or use `*` or `_all`. required: true schema: $ref: '../schemas/_common.yaml#/components/schemas/Indices' @@ -4010,8 +4010,8 @@ components: name: allow_no_indices description: |- If `false`, the request returns an error if any wildcard expression, index - alias, or `_all` value targets only missing or closed indices. This - behavior applies even if the request targets other open indices. For + alias, or `_all` value targets only missing or closed indexes. This + behavior applies even if the request targets other open indexes. For example, a request targeting `foo*,bar*` returns an error if an index starts with foo but no index starts with `bar`. schema: @@ -4129,40 +4129,40 @@ components: indices.get_upgrade::path.index: 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 indexes; use `_all` or empty string to perform the operation on all indexes. schema: type: array - description: Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices. + description: Comma-separated list of indexes; use `_all` or empty string to perform the operation on all indexes. items: type: string required: true indices.get_upgrade::query.allow_no_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). + description: Whether to ignore if a wildcard indexes expression resolves into no concrete indexes. (This includes `_all` string or when no indexes 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). + description: Whether to ignore if a wildcard indexes expression resolves into no concrete indexes. (This includes `_all` string or when no indexes have been specified). indices.get_upgrade::query.expand_wildcards: name: expand_wildcards in: query - description: Whether to expand wildcard expression to concrete indices that are open, closed or both. + description: Whether to expand wildcard expression to concrete indexes that are open, closed or both. schema: $ref: '../schemas/_common.yaml#/components/schemas/ExpandWildcards' indices.get_upgrade::query.ignore_unavailable: name: ignore_unavailable in: query - description: Whether specified concrete indices should be ignored when unavailable (missing or closed). + description: Whether specified concrete indexes should be ignored when unavailable (missing or closed). schema: type: boolean - description: Whether specified concrete indices should be ignored when unavailable (missing or closed). + description: Whether specified concrete indexes should be ignored when unavailable (missing or closed). indices.open::path.index: in: path name: index description: |- - Comma-separated list of data streams, indices, and aliases used to limit the request. + Comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). - By default, you must explicitly name the indices you using to limit the request. + By default, you must explicitly name the indexes you using to limit the request. To limit a request using `_all`, `*`, or other wildcard expressions, change the `action.destructive_requires_name` setting to false. You can update this setting in the `opensearch.yml` file or using the cluster update settings API. required: true @@ -4173,8 +4173,8 @@ components: in: query name: allow_no_indices description: |- - If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. - This behavior applies even if the request targets other open indices. + If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indexes. + This behavior applies even if the request targets other open indexes. schema: type: boolean style: form @@ -4252,9 +4252,9 @@ components: in: path name: index description: |- - Comma-separated list of data streams or indices to add. + Comma-separated list of data streams or indexes to add. Supports wildcards (`*`). - Wildcard patterns that match both data streams and indices return an error. + Wildcard patterns that match both data streams and indexes return an error. required: true schema: $ref: '../schemas/_common.yaml#/components/schemas/Indices' @@ -4341,7 +4341,7 @@ components: indices.put_mapping::path.index: in: path name: index - 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. + 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 indexes. required: true schema: $ref: '../schemas/_common.yaml#/components/schemas/Indices' @@ -4350,8 +4350,8 @@ components: in: query name: allow_no_indices description: |- - If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. - This behavior applies even if the request targets other open indices. + If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indexes. + This behavior applies even if the request targets other open indexes. schema: type: boolean style: form @@ -4413,9 +4413,9 @@ components: in: path name: index description: |- - Comma-separated list of data streams, indices, and aliases used to limit + Comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and - indices, omit this parameter or use `*` or `_all`. + indexes, omit this parameter or use `*` or `_all`. required: true schema: $ref: '../schemas/_common.yaml#/components/schemas/Indices' @@ -4425,8 +4425,8 @@ components: name: allow_no_indices description: |- If `false`, the request returns an error if any wildcard expression, index - alias, or `_all` value targets only missing or closed indices. This - behavior applies even if the request targets other open indices. For + alias, or `_all` value targets only missing or closed indexes. This + behavior applies even if the request targets other open indexes. For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`. schema: @@ -4461,7 +4461,7 @@ components: indices.put_settings::query.ignore_unavailable: in: query name: ignore_unavailable - description: Whether specified concrete indices should be ignored when unavailable (missing or closed). + description: Whether specified concrete indexes should be ignored when unavailable (missing or closed). schema: type: boolean style: form @@ -4546,9 +4546,9 @@ components: in: path name: index description: |- - Comma-separated list of data streams, indices, and aliases used to limit the request. + Comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). - To target all data streams and indices, omit this parameter or use `*` or `_all`. + To target all data streams and indexes, omit this parameter or use `*` or `_all`. required: true schema: $ref: '../schemas/_common.yaml#/components/schemas/Indices' @@ -4573,9 +4573,9 @@ components: in: path name: index description: |- - Comma-separated list of data streams, indices, and aliases used to limit the request. + Comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). - To target all data streams and indices, omit this parameter or use `*` or `_all`. + To target all data streams and indexes, omit this parameter or use `*` or `_all`. required: true schema: $ref: '../schemas/_common.yaml#/components/schemas/Indices' @@ -4584,8 +4584,8 @@ components: in: query name: allow_no_indices description: |- - If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. - This behavior applies even if the request targets other open indices. + If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indexes. + This behavior applies even if the request targets other open indexes. schema: type: boolean style: form @@ -4611,7 +4611,7 @@ components: in: path name: name description: |- - Comma-separated name(s) or index pattern(s) of the indices, aliases, and data streams to resolve. + Comma-separated name(s) or index pattern(s) of the indexes, aliases, and data streams to resolve. Resources on remote clusters can be specified using the ``:`` syntax. required: true schema: @@ -4696,9 +4696,9 @@ components: in: path name: index description: |- - Comma-separated list of data streams, indices, and aliases used to limit the request. + Comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). - To target all data streams and indices, omit this parameter or use `*` or `_all`. + To target all data streams and indexes, omit this parameter or use `*` or `_all`. required: true schema: $ref: '../schemas/_common.yaml#/components/schemas/Indices' @@ -4707,8 +4707,8 @@ components: in: query name: allow_no_indices description: |- - If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. - This behavior applies even if the request targets other open indices. + If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indexes. + This behavior applies even if the request targets other open indexes. schema: type: boolean style: form @@ -4741,7 +4741,7 @@ components: indices.shard_stores::path.index: in: path name: index - description: List of data streams, indices, and aliases used to limit the request. + description: List of data streams, indexes, and aliases used to limit the request. required: true schema: $ref: '../schemas/_common.yaml#/components/schemas/Indices' @@ -4751,8 +4751,8 @@ components: name: allow_no_indices description: |- If false, the request returns an error if any wildcard expression, index alias, or _all - value targets only missing or closed indices. This behavior applies even if the request - targets other open indices. + value targets only missing or closed indexes. This behavior applies even if the request + targets other open indexes. schema: type: boolean style: form @@ -4768,7 +4768,7 @@ components: indices.shard_stores::query.ignore_unavailable: in: query name: ignore_unavailable - description: If true, missing or closed indices are not included in the response. + description: If true, missing or closed indexes are not included in the response. schema: type: boolean style: form @@ -5029,7 +5029,7 @@ components: indices.stats::path.index: in: path name: index - description: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + description: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indexes required: true schema: $ref: '../schemas/_common.yaml#/components/schemas/Indices' @@ -5080,7 +5080,7 @@ components: indices.stats::query.forbid_closed_indices: in: query name: forbid_closed_indices - description: If true, statistics are not collected from closed indices. + description: If true, statistics are not collected from closed indexes. schema: type: boolean default: true @@ -5150,33 +5150,33 @@ components: indices.upgrade::path.index: 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 indexes; use `_all` or empty string to perform the operation on all indexes. schema: type: array - description: Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices. + description: Comma-separated list of indexes; use `_all` or empty string to perform the operation on all indexes. items: type: string required: true indices.upgrade::query.allow_no_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). + description: Whether to ignore if a wildcard indexes expression resolves into no concrete indexes. (This includes `_all` string or when no indexes 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). + description: Whether to ignore if a wildcard indexes expression resolves into no concrete indexes. (This includes `_all` string or when no indexes have been specified). indices.upgrade::query.expand_wildcards: name: expand_wildcards in: query - description: Whether to expand wildcard expression to concrete indices that are open, closed or both. + description: Whether to expand wildcard expression to concrete indexes that are open, closed or both. schema: $ref: '../schemas/_common.yaml#/components/schemas/ExpandWildcards' indices.upgrade::query.ignore_unavailable: name: ignore_unavailable in: query - description: Whether specified concrete indices should be ignored when unavailable (missing or closed). + description: Whether specified concrete indexes should be ignored when unavailable (missing or closed). schema: type: boolean - description: Whether specified concrete indices should be ignored when unavailable (missing or closed). + description: Whether specified concrete indexes should be ignored when unavailable (missing or closed). indices.upgrade::query.only_ancient_segments: name: only_ancient_segments in: query @@ -5197,9 +5197,9 @@ components: in: path name: index description: |- - Comma-separated list of data streams, indices, and aliases to search. + Comma-separated list of data streams, indexes, and aliases to search. Supports wildcards (`*`). - To search all data streams or indices, omit this parameter or use `*` or `_all`. + To search all data streams or indexes, omit this parameter or use `*` or `_all`. required: true schema: $ref: '../schemas/_common.yaml#/components/schemas/Indices' @@ -5215,8 +5215,8 @@ components: in: query name: allow_no_indices description: |- - If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. - This behavior applies even if the request targets other open indices. + If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indexes. + This behavior applies even if the request targets other open indexes. schema: type: boolean style: form diff --git a/spec/namespaces/ism.yaml b/spec/namespaces/ism.yaml index 9e91d84c7..f2102c4e0 100644 --- a/spec/namespaces/ism.yaml +++ b/spec/namespaces/ism.yaml @@ -399,7 +399,7 @@ components: name: index in: query description: |- - Comma-separated list of data streams, indices, and aliases. + Comma-separated list of data streams, indexes, and aliases. Supports wildcards (`*`). required: true schema: @@ -408,7 +408,7 @@ components: name: index in: path description: |- - Comma-separated list of data streams, indices, and aliases. + Comma-separated list of data streams, indexes, and aliases. Supports wildcards (`*`). required: true schema: @@ -418,7 +418,7 @@ components: name: index in: query description: |- - Comma-separated list of data streams, indices, and aliases. + Comma-separated list of data streams, indexes, and aliases. Supports wildcards (`*`). required: true schema: @@ -427,7 +427,7 @@ components: name: index in: query description: |- - Comma-separated list of data streams, indices, and aliases. + Comma-separated list of data streams, indexes, and aliases. Supports wildcards (`*`). required: true schema: @@ -436,7 +436,7 @@ components: name: index in: path description: |- - Comma-separated list of data streams, indices, and aliases. + Comma-separated list of data streams, indexes, and aliases. Supports wildcards (`*`). required: true schema: @@ -446,7 +446,7 @@ components: name: index in: path description: |- - Comma-separated list of data streams, indices, and aliases. + Comma-separated list of data streams, indexes, and aliases. Supports wildcards (`*`). required: true schema: @@ -456,7 +456,7 @@ components: name: index in: path description: |- - Comma-separated list of data streams, indices, and aliases. + Comma-separated list of data streams, indexes, and aliases. Supports wildcards (`*`). required: true schema: @@ -466,7 +466,7 @@ components: name: index in: query description: |- - Comma-separated list of data streams, indices, and aliases. + Comma-separated list of data streams, indexes, and aliases. Supports wildcards (`*`). required: true schema: @@ -475,7 +475,7 @@ components: name: index in: path description: |- - Comma-separated list of data streams, indices, and aliases. + Comma-separated list of data streams, indexes, and aliases. Supports wildcards (`*`). required: true schema: @@ -485,7 +485,7 @@ components: name: index in: path description: |- - Comma-separated list of data streams, indices, and aliases. + Comma-separated list of data streams, indexes, and aliases. Supports wildcards (`*`). required: true schema: diff --git a/spec/namespaces/knn.yaml b/spec/namespaces/knn.yaml index 77b6a34cb..1a25c1a5d 100644 --- a/spec/namespaces/knn.yaml +++ b/spec/namespaces/knn.yaml @@ -354,10 +354,10 @@ components: knn.search_models::query.allow_no_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). + description: Whether to ignore if a wildcard indexes expression resolves into no concrete indexes. (This includes `_all` string or when no indexes 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). + description: Whether to ignore if a wildcard indexes expression resolves into no concrete indexes. (This includes `_all` string or when no indexes have been specified). knn.search_models::query.allow_partial_search_results: name: allow_partial_search_results in: query @@ -425,7 +425,7 @@ components: knn.search_models::query.expand_wildcards: name: expand_wildcards in: query - description: Whether to expand wildcard expression to concrete indices that are open, closed or both. + description: Whether to expand wildcard expression to concrete indexes that are open, closed or both. schema: $ref: '../schemas/_common.yaml#/components/schemas/ExpandWildcards' knn.search_models::query.explain: @@ -447,17 +447,17 @@ components: knn.search_models::query.ignore_throttled: name: ignore_throttled in: query - description: Whether specified concrete, expanded or aliased indices should be ignored when throttled. + description: Whether specified concrete, expanded or aliased indexes should be ignored when throttled. schema: type: boolean - description: Whether specified concrete, expanded or aliased indices should be ignored when throttled. + description: Whether specified concrete, expanded or aliased indexes should be ignored when throttled. knn.search_models::query.ignore_unavailable: name: ignore_unavailable in: query - description: Whether specified concrete indices should be ignored when unavailable (missing or closed). + description: Whether specified concrete indexes should be ignored when unavailable (missing or closed). schema: type: boolean - description: Whether specified concrete indices should be ignored when unavailable (missing or closed). + description: Whether specified concrete indexes should be ignored when unavailable (missing or closed). knn.search_models::query.lenient: name: lenient in: query @@ -724,10 +724,10 @@ components: knn.warmup::path.index: 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 indexes; use `_all` or empty string to perform the operation on all indexes. schema: type: array - description: Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices. + description: Comma-separated list of indexes; use `_all` or empty string to perform the operation on all indexes. items: type: string required: true diff --git a/spec/namespaces/nodes.yaml b/spec/namespaces/nodes.yaml index 236a2a8ec..37b49cf1b 100644 --- a/spec/namespaces/nodes.yaml +++ b/spec/namespaces/nodes.yaml @@ -506,7 +506,7 @@ components: nodes.stats::path.index_metric: in: path name: index_metric - description: Limit the information returned for indices metric to the specific index metrics. It can be used only if indices (or all) metric is specified. + description: Limit the information returned for indexes metric to the specific index metrics. It can be used only if indexes (or all) metric is specified. required: true schema: type: array diff --git a/spec/namespaces/security.yaml b/spec/namespaces/security.yaml index 77dc0c6f6..173344688 100644 --- a/spec/namespaces/security.yaml +++ b/spec/namespaces/security.yaml @@ -362,7 +362,7 @@ paths: x-distributions-excluded: - amazon-managed - amazon-serverless - description: Creates or replaces the allowlisted APIs. Accessible via Super Admin certificate or REST API permission. + description: Creates or replaces the permitted APIs. Accessible using Super Admin certificate or REST API permission. externalDocs: url: https://opensearch.org/docs/latest/security/access-control/api/#access-control-for-the-api requestBody: diff --git a/spec/namespaces/snapshot.yaml b/spec/namespaces/snapshot.yaml index d81a5b173..b24c49466 100644 --- a/spec/namespaces/snapshot.yaml +++ b/spec/namespaces/snapshot.yaml @@ -223,7 +223,7 @@ paths: operationId: snapshot.clone.0 x-operation-group: snapshot.clone x-version-added: '1.0' - description: Clones indices from one snapshot into another snapshot in the same repository. + description: Clones indexes from one snapshot into another snapshot in the same repository. externalDocs: url: https://opensearch.org/docs/latest parameters: @@ -294,22 +294,22 @@ components: type: object properties: ignore_unavailable: - description: If `true`, the request ignores data streams and indices in `indices` that are missing or closed. If `false`, the request returns an error for any data stream or index that is missing or closed. + description: If `true`, the request ignores data streams and indexes in `indices` that are missing or closed. If `false`, the request returns an error for any data stream or index that is missing or closed. type: boolean include_global_state: - description: If `true`, the current cluster state is included in the snapshot. The cluster state includes persistent cluster settings, composable index templates, legacy index templates, ingest pipelines, and ILM policies. It also includes data stored in system indices, such as Watches and task records (configurable via `feature_states`). + description: If `true`, the current cluster state is included in the snapshot. The cluster state includes persistent cluster settings, composable index templates, legacy index templates, ingest pipelines, and ILM policies. It also includes data stored in system indexes, such as Watches and task records (configurable with `feature_states`). type: boolean indices: $ref: '../schemas/_common.yaml#/components/schemas/Indices' feature_states: - description: Feature states to include in the snapshot. Each feature state includes one or more system indices containing related data. You can view a list of eligible features using the get features API. If `include_global_state` is `true`, all current feature states are included by default. If `include_global_state` is `false`, no feature states are included by default. + description: Feature states to include in the snapshot. Each feature state includes one or more system indexes containing related data. You can view a list of eligible features using the get features API. If `include_global_state` is `true`, all current feature states are included by default. If `include_global_state` is `false`, no feature states are included by default. type: array items: type: string metadata: $ref: '../schemas/_common.yaml#/components/schemas/Metadata' partial: - description: If `true`, allows restoring a partial snapshot of indices with unavailable shards. Only shards that were successfully included in the snapshot will be restored. All missing shards will be recreated as empty. If `false`, the entire restore operation will fail if one or more indices included in the snapshot do not have all primary shards available. + description: If `true`, allows restoring a partial snapshot of indexes with unavailable shards. Only shards that were successfully included in the snapshot will be restored. All missing shards will be recreated as empty. If `false`, the entire restore operation will fail if one or more indexes included in the snapshot do not have all primary shards available. type: boolean description: The snapshot definition snapshot.create_repository: diff --git a/spec/schemas/_common.query_dsl.yaml b/spec/schemas/_common.query_dsl.yaml index b8e43a867..e1e05cb42 100644 --- a/spec/schemas/_common.query_dsl.yaml +++ b/spec/schemas/_common.query_dsl.yaml @@ -760,7 +760,7 @@ components: $ref: '#/components/schemas/IgnoreUnmapped' description: |- Indicates whether to ignore an unmapped `parent_type` and not return any documents instead of an error. - You can use this parameter to query multiple indices that may not contain the `parent_type`. + You can use this parameter to query multiple indexes that may not contain the `parent_type`. inner_hits: $ref: '_core.search.yaml#/components/schemas/InnerHits' parent_type: diff --git a/spec/schemas/_common.yaml b/spec/schemas/_common.yaml index 883ac273a..5ef209d8a 100644 --- a/spec/schemas/_common.yaml +++ b/spec/schemas/_common.yaml @@ -429,16 +429,16 @@ components: description: Match any index, including hidden ones. - type: string const: closed - description: Match closed, non-hidden indices. + description: Match closed, non-hidden indexes. - type: string const: hidden - description: Match hidden indices. Must be combined with open, closed, or both. + description: Match hidden indexes. Must be combined with open, closed, or both. - type: string const: none description: Wildcard expressions are not accepted. - type: string const: open - description: Match open, non-hidden indices. + description: Match open, non-hidden indexes. VersionString: type: string SearchType: diff --git a/spec/schemas/asynchronous_search._common.yaml b/spec/schemas/asynchronous_search._common.yaml index ce677af0a..f103db5bd 100644 --- a/spec/schemas/asynchronous_search._common.yaml +++ b/spec/schemas/asynchronous_search._common.yaml @@ -67,7 +67,7 @@ components: track_total_hits: $ref: '_core.search.yaml#/components/schemas/TrackHits' indices_boost: - description: Boosts the _score of documents from specified indices. + description: Boosts the `_score` of documents from specified indexes. type: array items: type: object @@ -132,7 +132,7 @@ components: Use with caution. OpenSearch applies this parameter to each shard handling the request. When possible, let OpenSearch perform early termination automatically. - Avoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers. + Avoid specifying this parameter for requests that target data streams with backing indexes across multiple data tiers. If set to `0` (default), the query does not terminate early. type: integer format: int32 @@ -159,7 +159,7 @@ components: description: |- Stats groups to associate with the search. Each group maintains a statistics aggregation for its associated searches. - You can retrieve these stats using the indices stats API. + You can retrieve these stats using the indexes stats API. type: array items: type: string diff --git a/spec/schemas/cat.snapshots.yaml b/spec/schemas/cat.snapshots.yaml index af46e1ba2..df5b3acd9 100644 --- a/spec/schemas/cat.snapshots.yaml +++ b/spec/schemas/cat.snapshots.yaml @@ -36,7 +36,7 @@ components: duration: $ref: '_common.yaml#/components/schemas/Duration' indices: - description: The number of indices in the snapshot. + description: The number of indexes in the snapshot. type: string successful_shards: description: The number of successful shards in the snapshot. diff --git a/spec/schemas/cluster.stats.yaml b/spec/schemas/cluster.stats.yaml index 3e8cb8987..34f983c14 100644 --- a/spec/schemas/cluster.stats.yaml +++ b/spec/schemas/cluster.stats.yaml @@ -37,7 +37,7 @@ components: completion: $ref: '_common.yaml#/components/schemas/CompletionStats' count: - description: Total number of indices with shards assigned to selected nodes. + description: Total number of indexes with shards assigned to selected nodes. type: number docs: $ref: '_common.yaml#/components/schemas/DocStats' @@ -119,7 +119,7 @@ components: description: The number of occurrences of the field type in selected nodes. type: number index_count: - description: The number of indices containing the field type in selected nodes. + description: The number of indexes containing the field type in selected nodes. type: number indexed_vector_count: description: For dense_vector field types, number of indexed vector types in selected nodes. @@ -192,7 +192,7 @@ components: description: Total number of fields in all non-system indices. type: number total_deduplicated_field_count: - description: Total number of fields in all non-system indices, accounting for mapping deduplication. + description: Total number of fields in all non-system indexes, accounting for mapping deduplication. type: number total_deduplicated_mapping_size: $ref: '_common.yaml#/components/schemas/HumanReadableByteCount' diff --git a/spec/schemas/indices._common.yaml b/spec/schemas/indices._common.yaml index 6135bd368..0041d7d7f 100644 --- a/spec/schemas/indices._common.yaml +++ b/spec/schemas/indices._common.yaml @@ -386,7 +386,7 @@ components: description: |- The index alias to update when the index rolls over. Specify when using a policy that contains a rollover action. When the index rolls over, the alias is updated to reflect that the index is no longer the write index. For more - information about rolling indices, see Rollover. + information about rolling indexes, see Rollover. type: string required: - name @@ -708,7 +708,7 @@ components: $ref: '#/components/schemas/StorageType' allow_mmap: description: |- - You can restrict the use of the mmapfs and the related hybridfs store type via the setting node.store.allow_mmap. + You can restrict the use of the `mmapfs` and the related `hybridfs` store types with the setting `node.store.allow_mmap`. This is a boolean setting indicating whether or not memory-mapping is allowed. The default is to allow it. This setting is useful, for example, if you are in an environment where you can not control the ability to create a lot of memory maps so you need disable the ability to use memory-mapping. @@ -773,7 +773,7 @@ components: is_hidden: description: |- If `true`, the alias is hidden. - All indices for the alias must have the same `is_hidden` value. + All indexes for the alias must have the same `is_hidden` value. type: boolean IndexState: type: object @@ -800,7 +800,7 @@ components: is_hidden: description: |- If `true`, the alias is hidden. - All indices for the alias must have the same `is_hidden` value. + All indexes for the alias must have the same `is_hidden` value. type: boolean is_write_index: description: If `true`, the index is the write index for the alias. @@ -832,7 +832,7 @@ components: type: boolean indices: description: |- - Array of objects containing information about the data stream's backing indices. + Array of objects containing information about the data stream's backing indexes. The last item in this array contains information about the stream's current write index. type: array items: diff --git a/spec/schemas/indices.data_streams_stats.yaml b/spec/schemas/indices.data_streams_stats.yaml index f8309bb2e..db7a59a39 100644 --- a/spec/schemas/indices.data_streams_stats.yaml +++ b/spec/schemas/indices.data_streams_stats.yaml @@ -10,7 +10,7 @@ components: type: object properties: backing_indices: - description: Current number of backing indices for the data stream. + description: Current number of backing indexes for the data stream. type: number data_stream: $ref: '_common.yaml#/components/schemas/Name' diff --git a/spec/schemas/insights._common.yaml b/spec/schemas/insights._common.yaml index 66b0bbe47..f7180c7b4 100644 --- a/spec/schemas/insights._common.yaml +++ b/spec/schemas/insights._common.yaml @@ -50,7 +50,7 @@ components: type: array items: type: string - description: The indices involved in the query. + description: The indexes involved in the query. phase_latency_map: type: object measurements: @@ -111,7 +111,7 @@ components: track_total_hits: $ref: '_core.search.yaml#/components/schemas/TrackHits' indices_boost: - description: Boosts the _score of documents from specified indices. + description: Boosts the `_score` of documents from specified indexes. type: array items: type: object @@ -174,7 +174,7 @@ components: Use with caution. OpenSearch applies this parameter to each shard handling the request. When possible, let OpenSearch perform early termination automatically. - Avoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers. + Avoid specifying this parameter for requests that target data streams with backing indexes across multiple data tiers. If set to `0` (default), the query does not terminate early. type: integer format: int32 @@ -201,7 +201,7 @@ components: description: |- Stats groups to associate with the search. Each group maintains a statistics aggregation for its associated searches. - You can retrieve these stats using the indices stats API. + You can retrieve these stats using the indexes stats API. type: array items: type: string diff --git a/tests/default/_core/refresh.yaml b/tests/default/_core/refresh.yaml index 5a4a42f74..986411755 100644 --- a/tests/default/_core/refresh.yaml +++ b/tests/default/_core/refresh.yaml @@ -3,7 +3,7 @@ $schema: ../../../json_schemas/test_story.schema.yaml description: Test _refresh. chapters: - - synopsis: Refresh all indices in the cluster. + - synopsis: Refresh all indexes in the cluster. path: /_refresh method: GET response: diff --git a/tests/default/cat/segments.yaml b/tests/default/cat/segments.yaml index c01bbdbbe..626eb82f0 100644 --- a/tests/default/cat/segments.yaml +++ b/tests/default/cat/segments.yaml @@ -11,7 +11,7 @@ epilogues: method: DELETE status: [200, 404] chapters: - - synopsis: List Lucene segment-level information for all indices. + - synopsis: List Lucene segment-level information for all indexes. path: /_cat/segments method: GET parameters: diff --git a/tests/default/indices/mapping.yaml b/tests/default/indices/mapping.yaml index 635ffe5cc..ea0fce71b 100644 --- a/tests/default/indices/mapping.yaml +++ b/tests/default/indices/mapping.yaml @@ -41,7 +41,7 @@ chapters: type: text year: type: integer - - synopsis: Get mappings for multiple indices. + - synopsis: Get mappings for multiple indexes. path: /{index}/_mapping method: GET parameters: diff --git a/tests/default/ism/explain.yaml b/tests/default/ism/explain.yaml index f3cf7654d..143feb25d 100644 --- a/tests/default/ism/explain.yaml +++ b/tests/default/ism/explain.yaml @@ -26,10 +26,10 @@ prologues: payload: policy_id: ${policy.id} chapters: - - synopsis: Get the total managed indices count (GET). + - synopsis: Get the total managed indexes count (GET). path: /_plugins/_ism/explain method: GET - - synopsis: Get the total managed indices count (POST). + - synopsis: Get the total managed indexes count (POST). version: '>= 2.12' path: /_plugins/_ism/explain method: POST diff --git a/tests/default/security/api/internalusers/authtoken.yaml b/tests/default/security/api/internalusers/authtoken.yaml index 08f7a40d8..b2150f8a9 100644 --- a/tests/default/security/api/internalusers/authtoken.yaml +++ b/tests/default/security/api/internalusers/authtoken.yaml @@ -1,7 +1,7 @@ $schema: ../../../../../json_schemas/test_story.schema.yaml description: Test internalusers/authtoken endpoint. -version: '> 2.16' # Fixed via https://github.com/opensearch-project/security/pull/4628 +version: '> 2.16' # Fixed in https://github.com/opensearch-project/security/pull/4628 distributions: excluded: - amazon-managed diff --git a/tests/default/security/api/securityconfig/config.yaml b/tests/default/security/api/securityconfig/config.yaml index 050fff9a9..8b888f277 100644 --- a/tests/default/security/api/securityconfig/config.yaml +++ b/tests/default/security/api/securityconfig/config.yaml @@ -37,7 +37,7 @@ chapters: authentication_backend: type: intern config: {} - description: Authenticate via HTTP Basic against internal users database + description: Authenticate using HTTP Basic against internal users database. auth_failure_listeners: {} do_not_fail_on_forbidden: false multi_rolespan_enabled: true diff --git a/tests/default/security/api/user/authtoken.yaml b/tests/default/security/api/user/authtoken.yaml index 8df0c3574..8d6176d54 100644 --- a/tests/default/security/api/user/authtoken.yaml +++ b/tests/default/security/api/user/authtoken.yaml @@ -1,7 +1,7 @@ $schema: ../../../../../json_schemas/test_story.schema.yaml description: Test authtoken endpoints for user. -version: '> 2.16' # Fixed via https://github.com/opensearch-project/security/pull/4628 +version: '> 2.16' # Fixed in https://github.com/opensearch-project/security/pull/4628 distributions: excluded: - amazon-managed diff --git a/tests/default/security/authinfo.yaml b/tests/default/security/authinfo.yaml index 5243a3f6a..b2997ea13 100644 --- a/tests/default/security/authinfo.yaml +++ b/tests/default/security/authinfo.yaml @@ -12,7 +12,7 @@ chapters: version: < 2.13 response: status: 200 - - synopsis: Get auth info via POST. + - synopsis: Get auth info using POST. path: /_plugins/_security/authinfo method: POST version: < 2.13 diff --git a/tests/default/security/dashboardsinfo.yaml b/tests/default/security/dashboardsinfo.yaml index 6bcfd4b44..e611a8e46 100644 --- a/tests/default/security/dashboardsinfo.yaml +++ b/tests/default/security/dashboardsinfo.yaml @@ -11,7 +11,7 @@ chapters: method: GET response: status: 200 - - synopsis: Get dashboards info via POST. + - synopsis: Get dashboards info using POST. path: /_plugins/_security/dashboardsinfo method: POST response: diff --git a/tests/default/security/health.yaml b/tests/default/security/health.yaml index cbd8e9c5a..8c9481bf7 100644 --- a/tests/default/security/health.yaml +++ b/tests/default/security/health.yaml @@ -17,7 +17,7 @@ chapters: message: null mode: strict status: UP - - synopsis: Get security health info via POST. + - synopsis: Get security health info using POST. path: /_plugins/_security/health method: POST parameters: diff --git a/tests/default/security/tenantinfo.yaml b/tests/default/security/tenantinfo.yaml index c113a1de7..f1dd7b2a7 100644 --- a/tests/default/security/tenantinfo.yaml +++ b/tests/default/security/tenantinfo.yaml @@ -12,7 +12,7 @@ chapters: response: status: 403 # only allowed for super-admin or dashboards-server role mapping content_type: text/plain - - synopsis: Get tenant info via POST. + - synopsis: Get tenant info using POST. path: /_plugins/_security/tenantinfo method: POST response: diff --git a/tests/default/security/whoami.yaml b/tests/default/security/whoami.yaml index dc6c42c37..2ea1f643b 100644 --- a/tests/default/security/whoami.yaml +++ b/tests/default/security/whoami.yaml @@ -16,7 +16,7 @@ chapters: dn: null is_admin: false is_node_certificate_request: false - - synopsis: Get current user info via POST. + - synopsis: Get current user info using POST. path: /_plugins/_security/whoami method: POST response: diff --git a/tools/tests/merger/fixtures/extractor/opensearch/expected_1.3.yaml b/tools/tests/merger/fixtures/extractor/opensearch/expected_1.3.yaml index eafc740f0..cd228a3c3 100644 --- a/tools/tests/merger/fixtures/extractor/opensearch/expected_1.3.yaml +++ b/tools/tests/merger/fixtures/extractor/opensearch/expected_1.3.yaml @@ -114,13 +114,13 @@ components: type: object description: '' info___added-1.3-removed-2.0: - description: Added in 1.3, removed in 2.0 via attribute in response body. + description: Added in 1.3, removed in 2.0 using an attribute in response body. x-version-added: '1.3' x-version-removed: '2.0' info___distributed-all: description: Distributed in opensearch.org, AOS and AOSS. info___removed-2.0: - description: Removed in 2.0 via attribute next to ref. + description: Removed in 2.0 using an attribute next to ref. info___removed-2.0-refs: description: One of the ref values removed in 2.0. schema: diff --git a/tools/tests/merger/fixtures/extractor/opensearch/expected_2.0.yaml b/tools/tests/merger/fixtures/extractor/opensearch/expected_2.0.yaml index b287d6982..85878c3ae 100644 --- a/tools/tests/merger/fixtures/extractor/opensearch/expected_2.0.yaml +++ b/tools/tests/merger/fixtures/extractor/opensearch/expected_2.0.yaml @@ -154,7 +154,7 @@ components: type: object description: '' info___added-2.0: - description: Added in 2.0 via attribute next to ref. + description: Added in 2.0 using an attribute next to ref. info___distributed-all: description: Distributed in opensearch.org, AOS and AOSS. info___removed-2.0-refs: diff --git a/tools/tests/merger/fixtures/specs/opensearch/namespaces/index.yaml b/tools/tests/merger/fixtures/specs/opensearch/namespaces/index.yaml index f03058350..80a2e0c6d 100644 --- a/tools/tests/merger/fixtures/specs/opensearch/namespaces/index.yaml +++ b/tools/tests/merger/fixtures/specs/opensearch/namespaces/index.yaml @@ -82,9 +82,9 @@ components: unevaluatedProperties: type: object info@added-2.0: - description: Added in 2.0 via attribute next to ref. + description: Added in 2.0 using an attribute next to ref. info@removed-2.0: - description: Removed in 2.0 via attribute next to ref. + description: Removed in 2.0 using an attribute next to ref. info@removed-2.0-refs: description: One of the ref values removed in 2.0. schema: @@ -92,11 +92,11 @@ components: - $ref: '../schemas/_common.yaml#/components/schemas/Type' - $ref: '../schemas/_common.yaml#/components/schemas/OldId' info@added-1.3-removed-2.0: - description: Added in 1.3, removed in 2.0 via attribute in response body. + description: Added in 1.3, removed in 2.0 using an attribute in response body. x-version-added: '1.3' x-version-removed: '2.0' info@added-2.1: - description: Added in 2.1 via attribute in response body. + description: Added in 2.1 using an attribute in response body. x-version-added: '2.1' info@distributed-amazon-managed: description: Distributed only in AOS. diff --git a/tools/tests/tester/fixtures/specs/complete/namespaces/index.yaml b/tools/tests/tester/fixtures/specs/complete/namespaces/index.yaml index 0c0a09234..111c6d772 100644 --- a/tools/tests/tester/fixtures/specs/complete/namespaces/index.yaml +++ b/tools/tests/tester/fixtures/specs/complete/namespaces/index.yaml @@ -80,15 +80,15 @@ components: unevaluatedProperties: type: object info@added-2.0: - description: Added in 2.0 via attribute next to ref. + description: Added in 2.0 using an attribute next to ref. info@removed-2.0: - description: Removed in 2.0 via attribute next to ref. + description: Removed in 2.0 using an attribute next to ref. info@added-1.3-removed-2.0: - description: Added in 1.3, removed in 2.0 via attribute in response body. + description: Added in 1.3, removed in 2.0 using an attribute in response body. x-version-added: '1.3' x-version-removed: '2.0' info@added-2.1: - description: Added in 2.1 via attribute in response body. + description: Added in 2.1 using an attribute in response body. x-version-added: '2.1' info@distributed-amazon-managed: description: Distributed only in AOS. diff --git a/tools/tests/tester/fixtures/specs/excerpt.yaml b/tools/tests/tester/fixtures/specs/excerpt.yaml index 5ff3c005e..6b28883ab 100644 --- a/tools/tests/tester/fixtures/specs/excerpt.yaml +++ b/tools/tests/tester/fixtures/specs/excerpt.yaml @@ -31,7 +31,7 @@ paths: operationId: cat.indices.1 x-operation-group: cat.indices x-version-added: '1.0' - description: 'Returns information about indices: number of primaries and replicas, document counts, disk size, ...' + description: 'Returns information about indexes: number of primaries and replicas, document counts, disk size, ...' externalDocs: url: https://opensearch.org/docs/latest/api-reference/cat/cat-indices/ parameters: @@ -201,8 +201,8 @@ components: in: path name: index description: |- - Comma-separated list of data streams, indices, and aliases used to limit the request. - Supports wildcards (`*`). To target all data streams and indices, omit this parameter or use `*` or `_all`. + Comma-separated list of data streams, indexes, and aliases used to limit the request. + Supports wildcards (`*`). To target all data streams and indexes, omit this parameter or use `*` or `_all`. required: true schema: $ref: '#/components/schemas/_common:Indices' @@ -216,7 +216,7 @@ components: in: path name: index description: |- - Comma-separated list of indices to delete. + Comma-separated list of indexes to delete. You cannot specify index aliases. By default, this parameter does not support wildcards (`*`) or `_all`. To use wildcards or `_all`, set the `action.destructive_requires_name` cluster setting to `false`. @@ -235,7 +235,7 @@ components: indices.exists::path.index: in: path name: index - description: Comma-separated list of data streams, indices, and aliases. Supports wildcards (`*`). + description: Comma-separated list of data streams, indexes, and aliases. Supports wildcards (`*`). required: true schema: $ref: '#/components/schemas/_common:Indices' From bf356019ed3450d97fb4f9f68be4db86d1ed2195 Mon Sep 17 00:00:00 2001 From: nathaliellenaa <143617992+nathaliellenaa@users.noreply.github.com> Date: Sat, 16 Nov 2024 05:27:30 -0800 Subject: [PATCH 20/20] Add missing tests for ML APIs (search and delete) (#672) * Add missing tests for ML APIs (search and delete) Signed-off-by: Nathalie Jonathan * Update schema and CHANGELOG Signed-off-by: Nathalie Jonathan * Removed comments Signed-off-by: Nathalie Jonathan * Added missing model states Signed-off-by: Nathalie Jonathan * Fixed lint errors and modified distributions Signed-off-by: Nathalie Jonathan * Added refresh and updated response schema Signed-off-by: Nathalie Jonathan * Modified refresh Signed-off-by: Nathalie Jonathan * Updated CHANGELOG and modified search model Signed-off-by: Nathalie Jonathan * Added more missing fields Signed-off-by: Nathalie Jonathan --------- Signed-off-by: Nathalie Jonathan Signed-off-by: Daniel (dB.) Doubrovkine Co-authored-by: Daniel (dB.) Doubrovkine --- CHANGELOG.md | 1 + spec/schemas/ml._common.yaml | 149 ++++++++++++++++++++++++++++++-- tests/plugins/ml/ml/models.yaml | 14 +++ tests/plugins/ml/ml/tasks.yaml | 28 ++++++ 4 files changed, 185 insertions(+), 7 deletions(-) create mode 100644 tests/plugins/ml/ml/tasks.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f24a2b46..045729721 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Removed invalid `required` from `ppl` responses ([#646](https://github.com/opensearch-project/opensearch-api-specification/pull/646)) - Added schema for security API error responses ([#646](https://github.com/opensearch-project/opensearch-api-specification/pull/646)) - Fixed `/{index}/_create/{id}` returning `201` ([#669](https://github.com/opensearch-project/opensearch-api-specification/pull/669)) +- Fixed `ml._common.yaml#SearchModelsResponse` and `SearchModelsHitsHit` ([#672](https://github.com/opensearch-project/opensearch-api-specification/pull/672)) ## [0.1.0] - 2024-10-25 diff --git a/spec/schemas/ml._common.yaml b/spec/schemas/ml._common.yaml index 46cffc9f3..36f6c4954 100644 --- a/spec/schemas/ml._common.yaml +++ b/spec/schemas/ml._common.yaml @@ -22,6 +22,14 @@ components: SearchModelsResponse: type: object properties: + took: + type: integer + description: The time taken to execute the search. + timed_out: + type: boolean + description: Whether the search timed out. + _shards: + $ref: '_common.yaml#/components/schemas/ShardStatistics' hits: $ref: '#/components/schemas/SearchModelsHits' required: @@ -35,6 +43,10 @@ components: type: array items: $ref: '#/components/schemas/SearchModelsHitsHit' + max_score: + type: number + format: float + description: The maximum score. required: - hits - total @@ -43,6 +55,7 @@ components: properties: value: type: integer + format: int64 description: The total number of hits. relation: type: string @@ -53,18 +66,140 @@ components: SearchModelsHitsHit: type: object properties: + _version: + $ref: '_common.yaml#/components/schemas/VersionNumber' + _seq_no: + $ref: '_common.yaml#/components/schemas/SequenceNumber' + _primary_term: + type: integer + description: The primary term. _index: - type: string - description: The index. + $ref: '_common.yaml#/components/schemas/IndexName' _id: + $ref: '_common.yaml#/components/schemas/Id' + _score: + type: number + format: float + description: The score. + _source: + $ref: '#/components/schemas/Source' + model_id: + $ref: '_common.yaml#/components/schemas/Name' + required: + - _score + Source: + type: object + properties: + last_deployed_time: + type: integer + format: int64 + description: The last deployed time. + model_version: type: string - description: The hit ID. + description: The model version. + version: + $ref: '_common.yaml#/components/schemas/VersionString' + created_time: + type: integer + format: int64 + description: The created time. + chunk_number: + type: integer + format: int64 + description: The chunk number. + deploy_to_all_nodes: + type: boolean + description: Whether to deploy to all nodes. + is_hidden: + type: boolean + description: Whether the model is hidden. model_id: + $ref: '_common.yaml#/components/schemas/Name' + description: type: string - description: The model ID. - required: - - _id - - model_id + description: The model description. + model_state: + type: string + description: The model state. + enum: + - DEPLOYED + - DEPLOYING + - DEPLOY_FAILED + - PARTIALLY_DEPLOYED + - REGISTERED + - REGISTERING + model_content_size_in_bytes: + type: integer + format: int64 + description: The model content size in bytes. + model_content_hash_value: + type: string + description: The model content hash value. + planning_worker_node_count: + type: number + description: The planning worker node count. + model_config: + $ref: '#/components/schemas/ModelConfig' + model_format: + type: string + description: The model format. + model_task_type: + type: string + description: The model task type. + last_updated_time: + type: integer + format: int64 + description: The last updated time. + last_registered_time: + type: integer + format: int64 + description: The last registered time. + auto_redeploy_retry_times: + type: integer + format: int64 + description: The auto redeploy retry times. + name: + type: string + description: The model name. + connector_id: + type: string + description: The connector ID. + current_worker_node_count: + type: number + description: The current worker node count. + model_group_id: + type: string + description: The model group ID. + planning_worker_nodes: + type: array + items: + $ref: '_common.yaml#/components/schemas/NodeIds' + total_chunks: + type: integer + format: int64 + description: The total chunks. + algorithm: + type: string + description: The algorithm. + url: + type: string + description: The model URL. + ModelConfig: + type: object + properties: + all_config: + type: string + description: The all config. + model_type: + type: string + description: The model type. + embedding_dimension: + type: integer + format: int64 + description: The embedding dimension. + framework_type: + type: string + description: The framework type. ModelGroupRegistration: type: object properties: diff --git a/tests/plugins/ml/ml/models.yaml b/tests/plugins/ml/ml/models.yaml index ce087654f..92cac3ca3 100644 --- a/tests/plugins/ml/ml/models.yaml +++ b/tests/plugins/ml/ml/models.yaml @@ -37,6 +37,20 @@ chapters: retry: count: 5 wait: 30000 + - synopsis: Search model. + path: /_plugins/_ml/models/_search + method: GET + request: + payload: + query: + match_all: {} + size: 1000 + response: + status: 200 + payload: + hits: + hits: + - _score: 1 - synopsis: Delete model. path: /_plugins/_ml/models/{model_id} parameters: diff --git a/tests/plugins/ml/ml/tasks.yaml b/tests/plugins/ml/ml/tasks.yaml new file mode 100644 index 000000000..542ea3468 --- /dev/null +++ b/tests/plugins/ml/ml/tasks.yaml @@ -0,0 +1,28 @@ +$schema: ../../../../json_schemas/test_story.schema.yaml + +description: Test the creation of tasks. +version: '>= 2.11' +warnings: + multiple-paths-detected: false +chapters: + - synopsis: Register model. + id: register_model + path: /_plugins/_ml/models/_register + method: POST + request: + payload: + name: huggingface/sentence-transformers/msmarco-distilbert-base-tas-b + version: 1.0.1 + model_format: TORCH_SCRIPT + response: + status: 200 + output: + task_id: payload.task_id + - synopsis: Delete task. + id: delete_task + path: /_plugins/_ml/tasks/{task_id} + method: DELETE + parameters: + task_id: ${register_model.task_id} + response: + status: 200 \ No newline at end of file