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

Add ML Model Group APIs #760

Merged
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 @@ -41,6 +41,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Added 404 response to `/_search/scroll` ([#749](https://github.com/opensearch-project/opensearch-api-specification/pull/749))
- Added `node_failures` to `DELETE /_search/scroll` and `DELETE /_search/scroll/{scroll_id}` ([#749](https://github.com/opensearch-project/opensearch-api-specification/pull/749))
- Added `POST /_plugins/_ml/_train/{algorithm_name}`, `_predict/{algorithm_name}/{model_id}`, and `_train_predict/{algorithm_name}` ([#755](https://github.com/opensearch-project/opensearch-api-specification/pull/755))
- Added `PUT /_plugins/_ml/model_groups/{model_group_id}`, `GET /_plugins/_ml/model_groups/_search`, and `POST /_plugins/_ml/model_groups/_search` ([#760](https://github.com/opensearch-project/opensearch-api-specification/pull/760))

### Removed
- Removed unsupported `_common.mapping:SourceField`'s `mode` field and associated `_common.mapping:SourceFieldMode` enum ([#652](https://github.com/opensearch-project/opensearch-api-specification/pull/652))
Expand Down
106 changes: 101 additions & 5 deletions spec/namespaces/ml.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,18 @@ paths:
responses:
'200':
$ref: '#/components/responses/ml.get_model_group@200'
put:
operationId: ml.update_model_group.0
x-operation-group: ml.update_model_group
x-version-added: '2.9'
description: Updates a model group.
parameters:
- $ref: '#/components/parameters/ml.update_model_group::path.model_group_id'
requestBody:
$ref: '#/components/requestBodies/ml.update_model_group'
responses:
'200':
$ref: '#/components/responses/ml.update_model_group@200'
delete:
operationId: ml.delete_model_group.0
x-operation-group: ml.delete_model_group
Expand All @@ -33,6 +45,27 @@ paths:
responses:
'200':
$ref: '#/components/responses/ml.delete_model_group@200'
/_plugins/_ml/model_groups/_search:
get:
operationId: ml.search_model_group.0
x-operation-group: ml.search_model_group
x-version-added: '2.9'
description: Searches for model groups.
requestBody:
$ref: '#/components/requestBodies/ml.search_model_group'
responses:
'200':
$ref: '#/components/responses/ml.search_model_group@200'
post:
operationId: ml.search_model_group.1
x-operation-group: ml.search_model_group
x-version-added: '2.9'
description: Searches for model groups.
requestBody:
$ref: '#/components/requestBodies/ml.search_model_group'
responses:
'200':
$ref: '#/components/responses/ml.search_model_group@200'
/_plugins/_ml/models/_register:
post:
operationId: ml.register_model.0
Expand Down Expand Up @@ -207,6 +240,51 @@ components:
description: The add all backend roles.
required:
- name
ml.update_model_group:
content:
application/json:
schema:
type: object
properties:
name:
type: string
description: The model group name.
description:
type: string
description: The model group description.
add_all_backend_roles:
type: boolean
description: Whether to include all backend roles.
model_access_name:
type: string
description: The model access name
backend_roles:
type: array
items:
type: string
description: The backend roles.
add_backend_roles:
type: array
items:
type: string
description: The backend roles to add.
ml.search_model_group:
content:
application/json:
schema:
type: object
properties:
query:
$ref: '../schemas/ml._common.yaml#/components/schemas/Query'
size:
type: integer
format: int64
description: The number of model groups to return.
sort:
type: array
items:
$ref: '../schemas/ml._common.yaml#/components/schemas/Sort'
description: The sort order.
ml.register_model:
content:
application/json:
Expand Down Expand Up @@ -241,14 +319,16 @@ components:
properties:
query:
type: object
# TODO: Define the query schema
description: The query.
$ref: '../schemas/ml._common.yaml#/components/schemas/Query'
size:
type: integer
format: int64
description: The number of models to return.
required:
- query
- size
sort:
type: array
items:
$ref: '../schemas/ml._common.yaml#/components/schemas/Sort'
description: The sort order.
ml.predict:
content:
application/json:
Expand Down Expand Up @@ -377,6 +457,16 @@ components:
application/json:
schema:
$ref: '../schemas/ml._common.yaml#/components/schemas/ModelGroup'
ml.update_model_group@200:
content:
application/json:
schema:
$ref: '../schemas/ml._common.yaml#/components/schemas/UpdateModelGroupResponse'
ml.search_model_group@200:
content:
application/json:
schema:
$ref: '../schemas/ml._common.yaml#/components/schemas/SearchModelGroupsResponse'
ml.delete_model_group@200:
content:
application/json:
Expand Down Expand Up @@ -483,6 +573,12 @@ components:
required: true
schema:
type: string
ml.update_model_group::path.model_group_id:
name: model_group_id
in: path
required: true
schema:
type: string
ml.delete_model_group::path.model_group_id:
name: model_group_id
in: path
Expand Down
Loading
Loading