Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: correct DataStream fields. #401

Merged
merged 2 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 6 additions & 0 deletions spec/schemas/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 1 addition & 7 deletions spec/schemas/indices._common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -886,9 +886,6 @@ components:
$ref: '#/components/schemas/DataStreamTimestampField'
required:
- generation
- hidden
- next_generation_managed_by
- prefer_ilm
- indices
- name
- status
Expand Down Expand Up @@ -917,8 +914,6 @@ components:
required:
- index_name
- index_uuid
- managed_by
- prefer_ilm
DataStreamTimestampField:
type: object
properties:
Expand Down Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions tests/cat/templates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
64 changes: 64 additions & 0 deletions tests/indices/data_stream.yaml
Original file line number Diff line number Diff line change
@@ -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
Loading