diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c684781b..13492c676 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -65,6 +65,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Fixed `/{index}/_open` can return a `task` ([#376](https://github.com/opensearch-project/opensearch-api-specification/pull/376)) - 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 `/_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 7ba82ea03..b922f48c0 100644 --- a/spec/schemas/_common.yaml +++ b/spec/schemas/_common.yaml @@ -749,6 +749,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 f2ace0b51..a576b86af 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: 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