-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Support outputs in tests Signed-off-by: miguel-vila <miguelvilag@gmail.com>
- Loading branch information
1 parent
ba3f5b2
commit 53bdbd9
Showing
20 changed files
with
1,040 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,270 @@ | ||
openapi: 3.1.0 | ||
info: | ||
title: OpenSearch ML API | ||
description: OpenSearch ML API | ||
version: 1.0.0 | ||
paths: | ||
/_plugins/_ml/model_groups/_register: | ||
post: | ||
operationId: ml.register_model_group.0 | ||
x-operation-group: ml.register_model_group | ||
description: Registers a model group. | ||
requestBody: | ||
$ref: '#/components/requestBodies/ml.register_model_group' | ||
responses: | ||
'200': | ||
$ref: '#/components/responses/ml.register_model_group@200' | ||
/_plugins/_ml/model_groups/{model_group_id}: | ||
get: | ||
operationId: ml.get_model_group.0 | ||
x-operation-group: ml.get_model_group | ||
description: Retrieves a model group. | ||
parameters: | ||
- $ref: '#/components/parameters/ml.get_model_group::path.model_group_id' | ||
responses: | ||
'200': | ||
$ref: '#/components/responses/ml.get_model_group@200' | ||
delete: | ||
operationId: ml.delete_model_group.0 | ||
x-operation-group: ml.delete_model_group | ||
description: Deletes a model group. | ||
parameters: | ||
- $ref: '#/components/parameters/ml.delete_model_group::path.model_group_id' | ||
responses: | ||
'200': | ||
$ref: '#/components/responses/ml.delete_model_group@200' | ||
/_plugins/_ml/models/_register: | ||
post: | ||
operationId: ml.register_model.0 | ||
x-operation-group: ml.register_model | ||
description: Registers a model. | ||
requestBody: | ||
$ref: '#/components/requestBodies/ml.register_model' | ||
responses: | ||
'200': | ||
$ref: '#/components/responses/ml.register_model@200' | ||
/_plugins/_ml/models/{model_id}: | ||
delete: | ||
operationId: ml.delete_model.0 | ||
x-operation-group: ml.delete_model | ||
description: Deletes a model. | ||
parameters: | ||
- $ref: '#/components/parameters/ml.delete_model::path.model_id' | ||
responses: | ||
'200': | ||
$ref: '#/components/responses/ml.delete_model@200' | ||
/_plugins/_ml/tasks/{task_id}: | ||
get: | ||
operationId: ml.get_task.0 | ||
x-operation-group: ml.get_task | ||
description: Retrieves a task. | ||
parameters: | ||
- $ref: '#/components/parameters/ml.get_task::path.task_id' | ||
responses: | ||
'200': | ||
$ref: '#/components/responses/ml.get_task@200' | ||
/_plugins/_ml/models/_search: | ||
get: | ||
operationId: ml.search_models.0 | ||
x-operation-group: ml.search_models | ||
description: Searches for models. | ||
requestBody: | ||
$ref: '#/components/requestBodies/ml.search_models' | ||
responses: | ||
'200': | ||
$ref: '#/components/responses/ml.search_models@200' | ||
components: | ||
requestBodies: | ||
ml.register_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. | ||
access_mode: | ||
type: string | ||
description: The model group access mode. | ||
enum: [private, public, restricted] | ||
backend_roles: | ||
type: array | ||
items: | ||
type: string | ||
description: The backend roles. | ||
add_all_backend_roles: | ||
type: boolean | ||
description: The add all backend roles. | ||
required: | ||
- name | ||
ml.register_model: | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
name: | ||
type: string | ||
description: The model name. | ||
version: | ||
type: string | ||
description: The model version. | ||
model_format: | ||
type: string | ||
description: The portable format of the model file. | ||
enum: [TORCH_SCRIPT, ONNX] | ||
description: | ||
type: string | ||
description: The model description. | ||
model_group_id: | ||
type: string | ||
description: The ID of the model group to which to register the model. | ||
required: | ||
- name | ||
- version | ||
- model_format | ||
ml.search_models: | ||
content: | ||
application/json: | ||
schema: | ||
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 | ||
responses: | ||
ml.register_model_group@200: | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
model_group_id: | ||
type: string | ||
description: The model group ID. | ||
status: | ||
type: string | ||
description: The status. | ||
required: | ||
- model_group_id | ||
- status | ||
ml.get_model_group@200: | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
name: | ||
type: string | ||
description: The model group name. | ||
latest_version: | ||
type: number | ||
description: The latest version. | ||
description: | ||
type: string | ||
description: The model group description. | ||
access: | ||
type: string | ||
description: The model group access. | ||
required: | ||
- name | ||
- latest_version | ||
- description | ||
- access | ||
ml.delete_model_group@200: | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
ml.register_model@200: | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
task_id: | ||
type: string | ||
description: The task ID. | ||
model_id: | ||
type: string | ||
description: The model ID. | ||
status: | ||
type: string | ||
description: The status. | ||
required: | ||
# model_id doesn't seem to be required in the response | ||
# it can be eventually retrieved through the task_id | ||
- task_id | ||
- status | ||
ml.delete_model@200: | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
ml.get_task@200: | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
model_id: | ||
type: string | ||
description: The model ID. | ||
state: | ||
type: string | ||
description: The state. | ||
enum: | ||
- CREATED | ||
- RUNNING | ||
- COMPLETED | ||
- FAILED | ||
- CANCELLED | ||
- COMPLETED_WITH_ERROR | ||
required: | ||
- state | ||
ml.search_models@200: | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
hits: | ||
$ref: '../schemas/ml._common.yaml#/components/schemas/SearchModelHits' | ||
required: | ||
- hits | ||
parameters: | ||
ml.get_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 | ||
required: true | ||
schema: | ||
type: string | ||
ml.delete_model::path.model_id: | ||
name: model_id | ||
in: path | ||
required: true | ||
schema: | ||
type: string | ||
ml.get_task::path.task_id: | ||
name: task_id | ||
in: path | ||
required: true | ||
schema: | ||
type: string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
openapi: 3.1.0 | ||
info: | ||
title: Schemas of ml category | ||
description: Schemas of ml category | ||
version: 1.0.0 | ||
paths: {} | ||
components: | ||
schemas: | ||
SearchModelHits: | ||
type: object | ||
properties: | ||
total: | ||
$ref: '#/components/schemas/HitsTotal' | ||
hits: | ||
type: array | ||
items: | ||
$ref: '#/components/schemas/SearchModelHitsHit' | ||
required: | ||
- total | ||
- hits | ||
HitsTotal: | ||
type: object | ||
properties: | ||
value: | ||
type: integer | ||
description: The total number of hits. | ||
relation: | ||
type: string | ||
description: The relation. | ||
required: | ||
- value | ||
- relation | ||
SearchModelHitsHit: | ||
type: object | ||
properties: | ||
_index: | ||
type: string | ||
description: The index. | ||
_id: | ||
type: string | ||
description: The hit ID. | ||
model_id: | ||
type: string | ||
description: The model ID. | ||
required: | ||
- _id | ||
- model_id |
Oops, something went wrong.