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

Fixed search_pipeline spec #253

Merged
merged 1 commit into from
Apr 18, 2024
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
77 changes: 70 additions & 7 deletions spec/namespaces/search_pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ info:
description: OpenSearch Search_pipeline API
version: 1.0.0
paths:
/_search/pipeline/{pipeline}:
/_search/pipeline/{id}:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nhtruong Do you think we should replace path param name from pipeline to id?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both make sense to me. If the endpoints using this paths haven't made it to any clients then we're free to rename without introducing breaking changes. I know that Ruby and JS clients haven't implemented these yet. @Xtansia what about Java, Net, and Rust?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hasn't been added into any of those clients

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@saimedhi Then this name change is fine!

get:
operationId: search_pipeline.get.0
x-operation-group: search_pipeline.get
x-version-added: '2.9'
description: Retrieves information about a specified search pipeline.
parameters:
- $ref: '#/components/parameters/search_pipeline.get::path.pipeline'
- $ref: '#/components/parameters/search_pipeline.get::query.cluster_manager_timeout'
- $ref: '#/components/parameters/search_pipeline.get::path.id'
responses:
'200':
$ref: '#/components/responses/search_pipeline.get@200'
Expand All @@ -23,12 +24,26 @@ paths:
externalDocs:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nhtruong @Xtansia PUT /_search/pipeline/my_pipeline endpoint creates and updates search_pipeline.
So, should we name it search_pipeline.put instead of search_pipeline.create?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I think so, it makes more sense semantically. Especially when things such as the _doc APIs set the precedent that "create" means fail if the item already exists.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree with @Xtansia

url: https://opensearch.org/docs/latest/search-plugins/search-pipelines/creating-search-pipeline/
parameters:
- $ref: '#/components/parameters/search_pipeline.create::path.pipeline'
- $ref: '#/components/parameters/search_pipeline.create::query.cluster_manager_timeout'
- $ref: '#/components/parameters/search_pipeline.create::query.timeout'
- $ref: '#/components/parameters/search_pipeline.create::path.id'
requestBody:
$ref: '#/components/requestBodies/search_pipeline.create'
responses:
'200':
$ref: '#/components/responses/search_pipeline.create@200'
delete:
operationId: search_pipeline.delete.0
x-operation-group: search_pipeline.delete
x-version-added: '2.9'
description: Deletes the specified search pipeline.
parameters:
- $ref: '#/components/parameters/search_pipeline.delete::query.cluster_manager_timeout'
- $ref: '#/components/parameters/search_pipeline.delete::query.timeout'
- $ref: '#/components/parameters/search_pipeline.delete::path.id'
responses:
'200':
$ref: '#/components/responses/search_pipeline.delete@200'
components:
requestBodies:
search_pipeline.create:
Expand All @@ -47,22 +62,70 @@ components:
properties:
acknowledged:
type: boolean
search_pipeline.delete@200:
description: ''
content:
application/json:
schema:
type: object
properties:
acknowledged:
type: boolean
search_pipeline.get@200:
description: ''
content:
application/json:
schema:
$ref: '../schemas/search_pipeline._common.yaml#/components/schemas/SearchPipelineMap'
parameters:
search_pipeline.create::path.pipeline:
name: pipeline
search_pipeline.create::path.id:
name: id
in: path
schema:
type: string
required: true
search_pipeline.get::path.pipeline:
name: pipeline
search_pipeline.delete::path.id:
name: id
in: path
schema:
type: string
required: true
search_pipeline.get::path.id:
name: id
in: path
description: Comma-separated list of search pipeline ids. Wildcards supported.
schema:
type: string
search_pipeline.get::query.cluster_manager_timeout:
name: cluster_manager_timeout
in: query
description: operation timeout for connection to cluster-manager node.
schema:
$ref: '../schemas/_common.yaml#/components/schemas/Duration'
x-version-added: 2.0.0
search_pipeline.create::query.cluster_manager_timeout:
name: cluster_manager_timeout
in: query
description: operation timeout for connection to cluster-manager node.
schema:
$ref: '../schemas/_common.yaml#/components/schemas/Duration'
x-version-added: 2.0.0
search_pipeline.delete::query.cluster_manager_timeout:
name: cluster_manager_timeout
in: query
description: Operation timeout for connection to cluster-manager node.
schema:
$ref: '../schemas/_common.yaml#/components/schemas/Duration'
x-version-added: 2.0.0
search_pipeline.create::query.timeout:
name: timeout
in: query
description: Operation timeout.
schema:
$ref: '../schemas/_common.yaml#/components/schemas/Duration'
search_pipeline.delete::query.timeout:
name: timeout
in: query
description: Operation timeout.
schema:
$ref: '../schemas/_common.yaml#/components/schemas/Duration'
4 changes: 2 additions & 2 deletions spec/opensearch-openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -468,8 +468,8 @@ paths:
$ref: 'namespaces/security.yaml#/paths/~1_plugins~1_security~1health'
/_remotestore/_restore:
$ref: 'namespaces/remote_store.yaml#/paths/~1_remotestore~1_restore'
/_search/pipeline/{pipeline}:
$ref: 'namespaces/search_pipeline.yaml#/paths/~1_search~1pipeline~1{pipeline}'
/_search/pipeline/{id}:
$ref: 'namespaces/search_pipeline.yaml#/paths/~1_search~1pipeline~1{id}'
/_snapshot:
$ref: 'namespaces/snapshot.yaml#/paths/~1_snapshot'
/_snapshot/_status:
Expand Down
Loading