diff --git a/CHANGELOG.md b/CHANGELOG.md index 191d344d7..fed654bec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -74,6 +74,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Fixed `_source` in `bulk` responses ([#375](https://github.com/opensearch-project/opensearch-api-specification/pull/375)) - Fixed `/{index}/_dangling` that can return `nodes` and `cluster_name` ([#391](https://github.com/opensearch-project/opensearch-api-specification/pull/391)) - Fixed `Metadata` schema ([#399](https://github.com/opensearch-project/opensearch-api-specification/pull/399)) +- Fixed `/_data_stream` health status and required fields ([#401](https://github.com/opensearch-project/opensearch-api-specification/pull/401)) ### Security diff --git a/spec/schemas/_common.yaml b/spec/schemas/_common.yaml index 96298c15b..739eb855a 100644 --- a/spec/schemas/_common.yaml +++ b/spec/schemas/_common.yaml @@ -763,6 +763,12 @@ components: - green - yellow - red + HealthStatusCapitalized: + type: string + enum: + - GREEN + - YELLOW + - RED ScheduleTimeOfDay: description: A time of day, expressed either as `hh:mm`, `noon`, `midnight`, or an hour/minutes structure. oneOf: diff --git a/spec/schemas/indices._common.yaml b/spec/schemas/indices._common.yaml index 801f5333e..5c425e7ee 100644 --- a/spec/schemas/indices._common.yaml +++ b/spec/schemas/indices._common.yaml @@ -876,7 +876,7 @@ components: description: If `true`, the data stream is created and managed by cross-cluster replication and the local cluster can not write into this data stream or change its mappings. type: boolean status: - $ref: '_common.yaml#/components/schemas/HealthStatus' + $ref: '_common.yaml#/components/schemas/HealthStatusCapitalized' system: description: If `true`, the data stream is created and managed by an OpenSearch stack component and cannot be modified through normal user interaction. type: boolean @@ -886,9 +886,6 @@ components: $ref: '#/components/schemas/DataStreamTimestampField' required: - generation - - hidden - - next_generation_managed_by - - prefer_ilm - indices - name - status @@ -917,8 +914,6 @@ components: required: - index_name - index_uuid - - managed_by - - prefer_ilm DataStreamTimestampField: type: object properties: @@ -957,7 +952,6 @@ components: $ref: '#/components/schemas/IndexTemplateDataStreamConfiguration' required: - index_patterns - - composed_of description: New index template definition to be simulated, if no index template name is specified IndexTemplateSummary: type: object diff --git a/tests/cat/templates.yaml b/tests/cat/templates.yaml index 44c128fba..8456ea9aa 100644 --- a/tests/cat/templates.yaml +++ b/tests/cat/templates.yaml @@ -25,8 +25,6 @@ chapters: format: json response: status: 200 - payload: - - name: daily_logs - synopsis: Cat a specific template with a json response. path: /_cat/templates/{name} method: GET diff --git a/tests/indices/data_stream.yaml b/tests/indices/data_stream.yaml new file mode 100644 index 000000000..11cf2db82 --- /dev/null +++ b/tests/indices/data_stream.yaml @@ -0,0 +1,64 @@ +$schema: ../../json_schemas/test_story.schema.yaml + +description: Test data streams. +epilogues: + - path: /_data_stream/logs-nginx + method: DELETE + status: [200, 404] + - path: /_index_template/logs-template + method: DELETE + status: [200, 404] +chapters: + - synopsis: Create an index template. + path: /_index_template/{name} + method: PUT + parameters: + name: logs-template-nginx + request_body: + payload: + index_patterns: + - my-data-stream + - logs-* + data_stream: + timestamp_field: + name: request_time + priority: 100 + - synopsis: Create a data stream. + path: /_data_stream/{name} + method: PUT + parameters: + name: logs-nginx + - synopsis: Ingest data. + path: /{index}/_doc + method: POST + parameters: + index: logs-nginx + request_body: + payload: + message: login attempt failed + request_time: '2013-03-01T00:00:00' + response: + status: 201 + - synopsis: Get a data stream. + path: /_data_stream/{name} + method: GET + parameters: + name: logs-nginx + - synopsis: Get data stream stats. + path: /_data_stream/{name}/_stats + method: GET + parameters: + name: logs-nginx + - synopsis: Manually roll over a data stream. + path: /{alias}/_rollover + method: POST + parameters: + alias: logs-nginx + - synopsis: Get all data streams. + path: /_data_stream + method: GET + - synopsis: Delete a data stream. + path: /_data_stream/{name} + method: DELETE + parameters: + name: logs-nginx