Skip to content

Commit 639fd57

Browse files
Add ML search task and get tools API. (#797)
Signed-off-by: Nathalie Jonathan <[email protected]>
1 parent 1422af3 commit 639fd57

File tree

5 files changed

+291
-46
lines changed

5 files changed

+291
-46
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
5151
- Added `GET`, `POST`, `PUT`, `DELETE /_plugins/_ml/controllers/{model_id}` ([#779](https://github.com/opensearch-project/opensearch-api-specification/pull/779))
5252
- Added `GET /_plugins/_ml/profile`, `GET /_plugins/_ml/profile/models`, `models/{model_id}`, `tasks`, `tasks/{task_id}` ([#787](https://github.com/opensearch-project/opensearch-api-specification/pull/787))
5353
- Added `GET /_plugins/_ml/stats/`, `stats/{stat}`, `{nodeId}/stats/`, `{nodeId}/stats/{stat}` ([#794](https://github.com/opensearch-project/opensearch-api-specification/pull/794))
54+
- Added `GET`, `POST /_plugins/_ml/tasks/_search`, `GET /_plugins/_ml/tools`, `tools/{tool_name}` ([#797](https://github.com/opensearch-project/opensearch-api-specification/pull/797))
5455

5556
### Removed
5657
- 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))

spec/namespaces/ml.yaml

+99-1
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ paths:
270270
get:
271271
operationId: ml.get_task.0
272272
x-operation-group: ml.get_task
273+
x-version-added: '1.3'
273274
description: Retrieves a task.
274275
parameters:
275276
- $ref: '#/components/parameters/ml.get_task::path.task_id'
@@ -279,12 +280,34 @@ paths:
279280
delete:
280281
operationId: ml.delete_task.0
281282
x-operation-group: ml.delete_task
283+
x-version-added: '1.3'
282284
description: Deletes a task.
283285
parameters:
284286
- $ref: '#/components/parameters/ml.delete_task::path.task_id'
285287
responses:
286288
'200':
287289
$ref: '#/components/responses/ml.delete_task@200'
290+
/_plugins/_ml/tasks/_search:
291+
get:
292+
operationId: ml.search_tasks.0
293+
x-operation-group: ml.search_tasks
294+
x-version-added: '1.3'
295+
description: Searches for tasks.
296+
requestBody:
297+
$ref: '#/components/requestBodies/ml.search_tasks'
298+
responses:
299+
'200':
300+
$ref: '#/components/responses/ml.search_tasks@200'
301+
post:
302+
operationId: ml.search_tasks.1
303+
x-operation-group: ml.search_tasks
304+
x-version-added: '1.3'
305+
description: Searches for tasks.
306+
requestBody:
307+
$ref: '#/components/requestBodies/ml.search_tasks'
308+
responses:
309+
'200':
310+
$ref: '#/components/responses/ml.search_tasks@200'
288311
/_plugins/_ml/models/_search:
289312
get:
290313
operationId: ml.search_models.0
@@ -735,6 +758,26 @@ paths:
735758
responses:
736759
'200':
737760
$ref: '#/components/responses/ml.get_stats@200'
761+
/_plugins/_ml/tools:
762+
get:
763+
operationId: ml.get_tools.0
764+
x-operation-group: ml.get_tools
765+
x-version-added: '2.12'
766+
description: Get tools.
767+
responses:
768+
'200':
769+
$ref: '#/components/responses/ml.get_tools@200'
770+
/_plugins/_ml/tools/{tool_name}:
771+
get:
772+
operationId: ml.get_tools.1
773+
x-operation-group: ml.get_tools
774+
x-version-added: '2.12'
775+
description: Get tools.
776+
parameters:
777+
- $ref: '#/components/parameters/ml.get_tools::path.tool_name'
778+
responses:
779+
'200':
780+
$ref: '#/components/responses/ml.get_tools@200'
738781
components:
739782
requestBodies:
740783
ml.register_model_group:
@@ -1038,6 +1081,23 @@ components:
10381081
description: The text documents.
10391082
required:
10401083
- text_docs
1084+
ml.search_tasks:
1085+
content:
1086+
application/json:
1087+
schema:
1088+
type: object
1089+
properties:
1090+
query:
1091+
$ref: '../schemas/ml._common.yaml#/components/schemas/Query'
1092+
size:
1093+
type: integer
1094+
format: int64
1095+
description: The number of tasks to return.
1096+
sort:
1097+
type: array
1098+
items:
1099+
$ref: '../schemas/ml._common.yaml#/components/schemas/Sort'
1100+
description: The sort order.
10411101
ml.predict:
10421102
content:
10431103
application/json:
@@ -1520,6 +1580,11 @@ components:
15201580
application/json:
15211581
schema:
15221582
$ref: '../schemas/ml._common.yaml#/components/schemas/Task'
1583+
ml.search_tasks@200:
1584+
content:
1585+
application/json:
1586+
schema:
1587+
$ref: '../schemas/ml._common.yaml#/components/schemas/SearchTasksResponse'
15231588
ml.search_models@200:
15241589
content:
15251590
application/json:
@@ -1741,6 +1806,15 @@ components:
17411806
application/json:
17421807
schema:
17431808
$ref: '../schemas/ml._common.yaml#/components/schemas/GetStatsResponse'
1809+
ml.get_tools@200:
1810+
content:
1811+
application/json:
1812+
schema:
1813+
oneOf:
1814+
- type: array
1815+
items:
1816+
$ref: '../schemas/ml._common.yaml#/components/schemas/GetToolsResponse'
1817+
- $ref: '../schemas/ml._common.yaml#/components/schemas/GetToolsResponse'
17441818
parameters:
17451819
ml.get_all_memories::query.max_results:
17461820
name: max_results
@@ -2047,4 +2121,28 @@ components:
20472121
in: path
20482122
required: true
20492123
schema:
2050-
type: string
2124+
type: string
2125+
ml.get_tools::path.tool_name:
2126+
name: tool_name
2127+
in: path
2128+
required: true
2129+
schema:
2130+
type: string
2131+
enum:
2132+
- AgentTool
2133+
- CatIndexTool
2134+
- ConnectorTool
2135+
- CreateAnomalyDetectorTool
2136+
- IndexMappingTool
2137+
- LogPatternTool
2138+
- MLModelTool
2139+
- NeuralSparseSearchTool
2140+
- PPLTool
2141+
- RAGTool
2142+
- SearchAlertsTool
2143+
- SearchAnomalyDetectorsTool
2144+
- SearchAnomalyResultsTool
2145+
- SearchIndexTool
2146+
- SearchMonitorsTool
2147+
- VectorDBTool
2148+
- VisualizationTool

0 commit comments

Comments
 (0)