Skip to content

Commit

Permalink
Fix data stream schemas (#725)
Browse files Browse the repository at this point in the history
* Inline ml request bodies

Signed-off-by: Thomas Farr <[email protected]>

* Remove HealthStatusCapatilized

Signed-off-by: Thomas Farr <[email protected]>

* Fix data streams

Signed-off-by: Thomas Farr <[email protected]>

---------

Signed-off-by: Thomas Farr <[email protected]>
  • Loading branch information
Xtansia authored Dec 11, 2024
1 parent 3ecdb0c commit 25c1c67
Show file tree
Hide file tree
Showing 8 changed files with 125 additions and 116 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Removed invalid `externalDocs` from `flow_framework.create/update::query.use_case` ([#646](https://github.com/opensearch-project/opensearch-api-specification/pull/646))
- Removed unsupported `cause` and `create` from `/_index_template/_simulate_index/{name}` ([#691](https://github.com/opensearch-project/opensearch-api-specification/pull/691))
- Removed `mappings` from `required` in `indices.simulate_template#Template` ([#691](https://github.com/opensearch-project/opensearch-api-specification/pull/691))
- Removed `HealthStatusCapatilized` and merged it with `HealthStatus` ([#725](https://github.com/opensearch-project/opensearch-api-specification/pull/725))

### Fixed
- Spec passes OpenAPI 3.1.0 validations ([#646](https://github.com/opensearch-project/opensearch-api-specification/pull/646))
Expand All @@ -66,9 +67,12 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Fixed `tenant` in `ObservabilityObject` request body to not be required ([#711](https://github.com/opensearch-project/opensearch-api-specification/pull/711))
- Fixed response code in `PUT /_plugins/_rollup/jobs/{id}` ([#716](https://github.com/opensearch-project/opensearch-api-specification/pull/716))
- Fixed response schema for `/_render/template` and `/_render/template/{id}` ([#724](https://github.com/opensearch-project/opensearch-api-specification/pull/724))
- Fixed data stream schema numeric property types ([#725](https://github.com/opensearch-project/opensearch-api-specification/pull/725))

### Changed
- Changed `tasks._common:TaskInfo` and `tasks._common:TaskGroup` to be composed of a `tasks._common:TaskInfoBase` ([#683](https://github.com/opensearch-project/opensearch-api-specification/pull/683))
- Changed `SearchModelsQuery`, `CreateConnectorRequest` & `RegisterAgentsRequest` to be defined inline of request bodies ([#725](https://github.com/opensearch-project/opensearch-api-specification/pull/725))
- Changed `indices.data_streams_stats:DataStreamsStatsItem` to instead be `indices._common:DataStreamStats` ([#725](https://github.com/opensearch-project/opensearch-api-specification/pull/725))

## [0.1.0] - 2024-10-25

Expand Down
15 changes: 10 additions & 5 deletions spec/namespaces/indices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2115,6 +2115,7 @@ components:
content:
application/json:
schema:
title: settings
$ref: '../schemas/indices._common.yaml#/components/schemas/IndexSettings'
required: true
indices.put_template:
Expand Down Expand Up @@ -2241,6 +2242,7 @@ components:
content:
application/json:
schema:
title: template
$ref: '../schemas/indices._common.yaml#/components/schemas/IndexTemplate'
indices.split:
content:
Expand Down Expand Up @@ -2386,16 +2388,18 @@ components:
$ref: '../schemas/_common.yaml#/components/schemas/ShardStatistics'
backing_indices:
description: Total number of backing indexes for the selected data streams.
type: number
type: integer
format: int32
data_stream_count:
description: Total number of selected data streams.
type: number
type: integer
format: int32
data_streams:
description: Contains statistics for the selected data streams.
type: array
items:
$ref: '../schemas/indices.data_streams_stats.yaml#/components/schemas/DataStreamsStatsItem'
total_store_sizes:
$ref: '../schemas/indices._common.yaml#/components/schemas/DataStreamStats'
total_store_size:
$ref: '../schemas/_common.yaml#/components/schemas/HumanReadableByteCount'
total_store_size_bytes:
description: Total size, in bytes, of all shards for the selected data streams.
Expand Down Expand Up @@ -4559,7 +4563,8 @@ components:
Templates with lower 'order' values are merged first. Templates with higher
'order' values are merged later, overriding templates with lower values.
schema:
type: number
type: integer
format: int32
style: form
indices.recovery::path.index:
in: path
Expand Down
66 changes: 63 additions & 3 deletions spec/namespaces/ml.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -200,17 +200,77 @@ components:
content:
application/json:
schema:
$ref: '../schemas/ml._common.yaml#/components/schemas/SearchModelsQuery'
type: object
properties:
query:
type: object
# TODO: Define the query schema
description: The query.
size:
type: integer
description: The number of models to return.
required:
- query
- size
ml.create_connector:
content:
application/json:
schema:
$ref: '../schemas/ml._common.yaml#/components/schemas/CreateConnectorRequest'
type: object
properties:
name:
type: string
description:
type: string
version:
type: integer
protocol:
type: string
credential:
$ref: '../schemas/ml._common.yaml#/components/schemas/Credential'
parameters:
$ref: '../schemas/ml._common.yaml#/components/schemas/Parameters'
client_config:
$ref: '../schemas/ml._common.yaml#/components/schemas/ClientConfig'
actions:
type: array
items:
$ref: '../schemas/ml._common.yaml#/components/schemas/Action'
required:
- actions
- credential
- description
- name
- parameters
- protocol
- version
ml.register_agents:
content:
application/json:
schema:
$ref: '../schemas/ml._common.yaml#/components/schemas/RegisterAgentsRequest'
type: object
properties:
name:
type: string
type:
type: string
description:
type: string
tools:
type: array
items:
$ref: '../schemas/ml._common.yaml#/components/schemas/ToolItems'
parameters:
$ref: '../schemas/ml._common.yaml#/components/schemas/Parameters'
app_type:
type: string
memory:
$ref: '../schemas/ml._common.yaml#/components/schemas/Memory'
llm:
$ref: '../schemas/ml._common.yaml#/components/schemas/LLM'
required:
- name
- type
responses:
ml.register_model_group@200:
content:
Expand Down
34 changes: 23 additions & 11 deletions spec/schemas/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -873,17 +873,29 @@ components:
- nanos
- s
HealthStatus:
type: string
enum:
- green
- red
- yellow
HealthStatusCapitalized:
type: string
enum:
- GREEN
- RED
- YELLOW
# eslint-disable yml/sort-sequence-values
oneOf:
- description: All shards are assigned.
type: string
enum:
- green
- GREEN
- description: |
All primary shards are assigned, but one or more replica shards are
unassigned. If a node in the cluster fails, some data could be unavailable
until that node is repaired.
type: string
enum:
- yellow
- YELLOW
- description: |
One or more primary shards are unassigned, so some data is unavailable. This
can occur briefly during cluster startup as primary shards are assigned.
type: string
enum:
- red
- RED
# eslint-enable yml/sort-sequence-values
ScheduleTimeOfDay:
description: A time of day, expressed either as `hh:mm`, `noon`, `midnight`, or an hour/minutes structure.
oneOf:
Expand Down
26 changes: 24 additions & 2 deletions spec/schemas/indices._common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -988,7 +988,8 @@ components:
type: boolean
generation:
description: Current generation for the data stream. This number acts as a cumulative count of the stream's rollovers, starting at 1.
type: number
type: integer
format: int64
hidden:
description: If `true`, the data stream is hidden.
type: boolean
Expand All @@ -1012,7 +1013,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/HealthStatusCapitalized'
$ref: '_common.yaml#/components/schemas/HealthStatus'
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 Down Expand Up @@ -1231,3 +1232,24 @@ components:
additionalProperties:
title: metadata
description: Additional details about the error.
DataStreamStats:
type: object
properties:
backing_indices:
description: Current number of backing indexes for the data stream.
type: integer
format: int32
data_stream:
$ref: '_common.yaml#/components/schemas/Name'
maximum_timestamp:
$ref: '_common.yaml#/components/schemas/EpochTimeUnitMillis'
store_size:
$ref: '_common.yaml#/components/schemas/HumanReadableByteCount'
store_size_bytes:
description: Total size, in bytes, of all shards for the data stream's backing indexes.
$ref: '_common.yaml#/components/schemas/ByteCount'
required:
- backing_indices
- data_stream
- maximum_timestamp
- store_size_bytes
28 changes: 0 additions & 28 deletions spec/schemas/indices.data_streams_stats.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion spec/schemas/knn._common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ components:
type: boolean
model_index_status:
oneOf:
- $ref: '_common.yaml#/components/schemas/HealthStatusCapitalized'
- $ref: '_common.yaml#/components/schemas/HealthStatus'
- type: 'null'
nodes:
type: object
Expand Down
66 changes: 0 additions & 66 deletions spec/schemas/ml._common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,6 @@ info:
paths: {}
components:
schemas:
SearchModelsQuery:
type: object
properties:
query:
type: object
# TODO: Define the query schema
description: The query.
size:
type: integer
description: The number of models to return.
required:
- query
- size
SearchModelsResponse:
type: object
properties:
Expand Down Expand Up @@ -291,35 +278,6 @@ components:
UndeployModelNodeStats:
type: object
additionalProperties: true
CreateConnectorRequest:
type: object
properties:
name:
type: string
description:
type: string
version:
type: integer
protocol:
type: string
credential:
$ref: '#/components/schemas/Credential'
parameters:
$ref: '#/components/schemas/Parameters'
client_config:
$ref: '#/components/schemas/ClientConfig'
actions:
type: array
items:
$ref: '#/components/schemas/Action'
required:
- actions
- credential
- description
- name
- parameters
- protocol
- version
Credential:
type: object
properties:
Expand Down Expand Up @@ -367,30 +325,6 @@ components:
type: string
post_process_function:
type: string
RegisterAgentsRequest:
type: object
properties:
name:
type: string
type:
type: string
description:
type: string
tools:
type: array
items:
$ref: '#/components/schemas/ToolItems'
parameters:
$ref: '#/components/schemas/Parameters'
app_type:
type: string
memory:
$ref: '#/components/schemas/Memory'
llm:
$ref: '#/components/schemas/LLM'
required:
- name
- type
LLM:
type: object
properties:
Expand Down

0 comments on commit 25c1c67

Please sign in to comment.