Skip to content

Commit

Permalink
Add ml.delete_task and tweak ml schemas (#530)
Browse files Browse the repository at this point in the history
* Fix WriteResponseBase field types

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

* Add ml.delete_task

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

* Adjust ml.undeploy_model schemas

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

* changelog

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

* lint fix

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

---------

Signed-off-by: Thomas Farr <[email protected]>
  • Loading branch information
Xtansia authored Aug 26, 2024
1 parent 6f9c1c1 commit 5d2b36c
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Added detailed test coverage report ([#513](https://github.com/opensearch-project/opensearch-api-specification/pull/513))
- Added 404 responses to `/_alias/{name}` and `/{index}/_alias/{name}` ([#519](https://github.com/opensearch-project/opensearch-api-specification/pull/519))
- Added `asynchronous_search` ([#525](https://github.com/opensearch-project/opensearch-api-specification/pull/525))
- Added `DELETE /_plugins/_ml/tasks/{task_id}` ([#530](https://github.com/opensearch-project/opensearch-api-specification/pull/530))

### Changed

Expand All @@ -93,6 +94,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Lock testing for next release of OpenSearch to a specific SHA ([#431](https://github.com/opensearch-project/opensearch-api-specification/pull/431))
- Replace nullable with null type ([#436](https://github.com/opensearch-project/opensearch-api-specification/pull/436))
- Split test suite ([#472])(https://github.com/opensearch-project/opensearch-api-specification/pull/472)
- Changed `WriteResponseBase`'s `_primary_term`, `_seq_no` & `_version` to have `int64` format ([#530](https://github.com/opensearch-project/opensearch-api-specification/pull/530))

### Deprecated

Expand Down
20 changes: 20 additions & 0 deletions spec/namespaces/ml.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,15 @@ paths:
responses:
'200':
$ref: '#/components/responses/ml.get_task@200'
delete:
operationId: ml.delete_task.0
x-operation-group: ml.delete_task
description: Deletes a task.
parameters:
- $ref: '#/components/parameters/ml.delete_task::path.task_id'
responses:
'200':
$ref: '#/components/responses/ml.delete_task@200'
/_plugins/_ml/models/_search:
get:
operationId: ml.search_models.0
Expand Down Expand Up @@ -206,6 +215,11 @@ components:
application/json:
schema:
$ref: '../schemas/_common.yaml#/components/schemas/WriteResponseBase'
ml.delete_task@200:
content:
application/json:
schema:
$ref: '../schemas/_common.yaml#/components/schemas/WriteResponseBase'
ml.get_task@200:
content:
application/json:
Expand Down Expand Up @@ -247,6 +261,12 @@ components:
required: true
schema:
type: string
ml.delete_task::path.task_id:
name: task_id
in: path
required: true
schema:
type: string
ml.get_task::path.task_id:
name: task_id
in: path
Expand Down
3 changes: 3 additions & 0 deletions spec/schemas/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,10 @@ components:
type: string
SequenceNumber:
type: number
format: int64
VersionNumber:
type: number
format: int64
SortResults:
type: array
items:
Expand Down Expand Up @@ -1318,6 +1320,7 @@ components:
$ref: '#/components/schemas/IndexName'
_primary_term:
type: number
format: int64
result:
$ref: '#/components/schemas/Result'
_seq_no:
Expand Down
9 changes: 5 additions & 4 deletions spec/schemas/ml._common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,13 @@ components:
UndeployModelResponse:
type: object
additionalProperties:
$ref: '#/components/schemas/UndeployModelResponseModels'
UndeployModelResponseModels:
title: nodes
$ref: '#/components/schemas/UndeployModelNode'
UndeployModelNode:
type: object
properties:
stats:
$ref: '#/components/schemas/UndeployModelResponseStats'
UndeployModelResponseStats:
$ref: '#/components/schemas/UndeployModelNodeStats'
UndeployModelNodeStats:
type: object
additionalProperties: true

0 comments on commit 5d2b36c

Please sign in to comment.