-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding ppl namespace api specs (#460)
* adding ppl namespace api specs Signed-off-by: Tokesh <[email protected]> * fix lint and adding changelog Signed-off-by: Tokesh <[email protected]> * reusing already defined structures Signed-off-by: Tokesh <[email protected]> * edit of test descriptions Signed-off-by: Tokesh <[email protected]> * fixing descriptions, file structure and deleting semicolons from requestbody Signed-off-by: Tokesh <[email protected]> --------- Signed-off-by: Tokesh <[email protected]> Signed-off-by: Niyazbek Torekeldi <[email protected]>
- Loading branch information
Showing
7 changed files
with
249 additions
and
26 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,165 @@ | ||
openapi: 3.1.0 | ||
info: | ||
title: OpenSearch PPL API | ||
description: OpenSearch PPL API | ||
version: 1.0.0 | ||
paths: | ||
/_plugins/_ppl: | ||
post: | ||
operationId: ppl.query.0 | ||
x-operation-group: ppl.query | ||
x-version-added: '1.0' | ||
description: Send a PPL query to the PPL plugin. | ||
externalDocs: | ||
url: https://opensearch.org/docs/latest/search-plugins/sql/sql-ppl-api/ | ||
parameters: | ||
- $ref: '#/components/parameters/ppl.query::query.format' | ||
- $ref: '#/components/parameters/ppl.query::query.sanitize' | ||
requestBody: | ||
$ref: '#/components/requestBodies/ppl.query' | ||
responses: | ||
'200': | ||
$ref: '#/components/responses/ppl.query@200' | ||
/_plugins/_ppl/_explain: | ||
post: | ||
operationId: ppl.explain.0 | ||
x-operation-group: ppl.explain | ||
x-version-added: '1.0' | ||
description: Shows how a query is executed against OpenSearch. | ||
externalDocs: | ||
url: https://opensearch.org/docs/latest/search-plugins/sql/sql-ppl-api/ | ||
parameters: | ||
- $ref: '#/components/parameters/ppl.explain::query.format' | ||
- $ref: '#/components/parameters/ppl.explain::query.sanitize' | ||
requestBody: | ||
$ref: '#/components/requestBodies/ppl.explain' | ||
responses: | ||
'200': | ||
$ref: '#/components/responses/ppl.explain@200' | ||
/_plugins/_ppl/stats: | ||
get: | ||
operationId: ppl.get_stats.0 | ||
x-operation-group: ppl.get_stats | ||
x-version-added: '1.0' | ||
description: Collect metrics for the plugin within the interval. | ||
externalDocs: | ||
url: https://opensearch.org/docs/latest/search-plugins/sql/monitoring/ | ||
parameters: | ||
- $ref: '#/components/parameters/ppl.get_stats::query.format' | ||
- $ref: '#/components/parameters/ppl.get_stats::query.sanitize' | ||
responses: | ||
'200': | ||
$ref: '#/components/responses/ppl.get_stats@200' | ||
post: | ||
operationId: ppl.post_stats.1 | ||
x-operation-group: ppl.post_stats | ||
x-version-added: '1.0' | ||
description: By a stats endpoint, you are able to collect metrics for the plugin within the interval. | ||
externalDocs: | ||
url: https://opensearch.org/docs/latest/search-plugins/sql/monitoring/ | ||
parameters: | ||
- $ref: '#/components/parameters/ppl.post_stats::query.format' | ||
- $ref: '#/components/parameters/ppl.post_stats::query.sanitize' | ||
requestBody: | ||
$ref: '#/components/requestBodies/ppl.post_stats' | ||
responses: | ||
'200': | ||
$ref: '#/components/responses/ppl.post_stats@200' | ||
components: | ||
parameters: | ||
ppl.query::query.format: | ||
name: format | ||
in: query | ||
description: A short version of the Accept header, e.g. json, yaml. | ||
schema: | ||
type: string | ||
ppl.query::query.sanitize: | ||
name: sanitize | ||
in: query | ||
description: Specifies whether to escape special characters in the results. | ||
schema: | ||
type: boolean | ||
default: true | ||
ppl.explain::query.format: | ||
name: format | ||
in: query | ||
description: A short version of the Accept header, e.g. json, yaml. | ||
schema: | ||
type: string | ||
ppl.explain::query.sanitize: | ||
name: sanitize | ||
in: query | ||
description: Specifies whether to escape special characters in the results. | ||
schema: | ||
type: boolean | ||
default: true | ||
ppl.get_stats::query.format: | ||
name: format | ||
in: query | ||
description: A short version of the Accept header, e.g. json, yaml. | ||
schema: | ||
type: string | ||
ppl.get_stats::query.sanitize: | ||
name: sanitize | ||
in: query | ||
description: Specifies whether to escape special characters in the results. | ||
schema: | ||
type: boolean | ||
default: true | ||
ppl.post_stats::query.format: | ||
name: format | ||
in: query | ||
description: A short version of the Accept header, e.g. json, yaml. | ||
schema: | ||
type: string | ||
ppl.post_stats::query.sanitize: | ||
name: sanitize | ||
in: query | ||
description: Specifies whether to escape special characters in the results. | ||
schema: | ||
type: boolean | ||
default: true | ||
requestBodies: | ||
ppl.query: | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../schemas/sql._common.yaml#/components/schemas/Query' | ||
required: true | ||
ppl.explain: | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../schemas/sql._common.yaml#/components/schemas/Explain' | ||
required: true | ||
ppl.post_stats: | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../schemas/sql._common.yaml#/components/schemas/Stats' | ||
required: true | ||
responses: | ||
ppl.query@200: | ||
description: '' | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../schemas/sql._common.yaml#/components/schemas/QueryResponse' | ||
ppl.explain@200: | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../schemas/sql._common.yaml#/components/schemas/ExplainResponse' | ||
required: true | ||
ppl.get_stats@200: | ||
content: | ||
text/plain: | ||
schema: | ||
type: string | ||
required: true | ||
ppl.post_stats@200: | ||
content: | ||
text/plain: | ||
schema: | ||
type: string | ||
required: true |
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,22 @@ | ||
$schema: ../../json_schemas/test_story.schema.yaml | ||
|
||
description: Test how a query is executed against OpenSearch. | ||
|
||
prologues: | ||
- path: /books | ||
method: PUT | ||
request_body: | ||
payload: {} | ||
epilogues: | ||
- path: /books | ||
method: DELETE | ||
status: [200, 404] | ||
chapters: | ||
- synopsis: Get explain of SQL Query | ||
path: /_plugins/_ppl/_explain | ||
method: POST | ||
request_body: | ||
payload: | ||
query: search source=books | ||
response: | ||
status: 200 |
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,24 @@ | ||
$schema: ../../json_schemas/test_story.schema.yaml | ||
|
||
description: Test send PPL query to index. | ||
|
||
prologues: | ||
- path: /{index} | ||
method: PUT | ||
parameters: | ||
index: books | ||
request_body: | ||
payload: {} | ||
epilogues: | ||
- path: /books | ||
method: DELETE | ||
status: [200, 404] | ||
chapters: | ||
- synopsis: Get PPL query | ||
path: /_plugins/_ppl | ||
method: POST | ||
request_body: | ||
payload: | ||
query: search source=books | ||
response: | ||
status: 200 |
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,11 @@ | ||
$schema: ../../json_schemas/test_story.schema.yaml | ||
|
||
description: Test get SQL Queries stats. | ||
|
||
chapters: | ||
- synopsis: Get stats from PPL Query. | ||
path: /_plugins/_ppl/stats | ||
method: POST | ||
response: | ||
status: 200 | ||
content_type: text/plain |