forked from prestodb/presto
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add presto-openapi module and QueryResource definition
Edited query.yaml and created cluster.yaml edited the cluster.yml created queuestatement.yaml Add detailed OpenAPI schema for BasicQueryInfo and other updates Update queued_statement.yaml Updated query.yaml and added _full_spec.yaml Split and add missing components (#1) Also: - re-adds full_spec.yaml to gitignore, - Adds execution to generate a single openAPI JSON. The output is a single JSON that can be used with the swagger editor.
- Loading branch information
Showing
7 changed files
with
1,416 additions
and
0 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 @@ | ||
src/main/resources/_full_spec.yaml |
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,76 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>com.facebook.presto</groupId> | ||
<artifactId>presto-root</artifactId> | ||
<version>0.289-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>presto-openapi</artifactId> | ||
<name>presto-openapi</name> | ||
|
||
<properties> | ||
<air.main.basedir>${project.parent.basedir}</air.main.basedir> | ||
</properties> | ||
|
||
<build> | ||
<pluginManagement> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.openapitools</groupId> | ||
<artifactId>openapi-generator-maven-plugin</artifactId> | ||
<!-- last version with Java 8 support --> | ||
<version>6.6.0</version> | ||
</plugin> | ||
</plugins> | ||
</pluginManagement> | ||
|
||
<plugins> | ||
<plugin> | ||
<groupId>org.openapitools</groupId> | ||
<artifactId>openapi-generator-maven-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>generate openapi HTML documentation</id> | ||
<goals> | ||
<goal>generate</goal> | ||
</goals> | ||
<configuration> | ||
<!-- required to be set, even though it isn't used--> | ||
<inputSpec>${project.basedir}/src/main/resources</inputSpec> | ||
<inputSpecRootDirectory>${project.basedir}/src/main/resources</inputSpecRootDirectory> | ||
<mergedFileName>_full_spec</mergedFileName> | ||
<generatorName>html</generatorName> | ||
<groupId>com.facebook.presto</groupId> | ||
<artifactId>presto-openapi</artifactId> | ||
<additionalProperties> | ||
<property>appName=presto</property> | ||
<property>appDescription="Presto - SQL on Anything"</property> | ||
<property>infoUrl=https://prestodb.io/docs/</property> | ||
<property>infoEmail=https://prestodb.slack.com/</property> | ||
<property>version=${project.version}</property> | ||
</additionalProperties> | ||
</configuration> | ||
</execution> | ||
<execution> | ||
<id>generate openapi spec file</id> | ||
<goals> | ||
<goal>generate</goal> | ||
</goals> | ||
<configuration> | ||
<!-- required to be set, even though it isn't used--> | ||
<inputSpec>${project.basedir}/src/main/resources</inputSpec> | ||
<inputSpecRootDirectory>${project.basedir}/src/main/resources</inputSpecRootDirectory> | ||
<mergedFileName>_full_spec</mergedFileName> | ||
<generatorName>openapi</generatorName> | ||
<groupId>com.facebook.presto</groupId> | ||
<artifactId>presto-openapi</artifactId> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
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,66 @@ | ||
openapi: 3.0.0 | ||
info: | ||
title: Presto Cluster Stats API | ||
description: API for retrieving cluster statistics in Presto. | ||
version: "1" | ||
servers: | ||
- url: http://localhost:8080 | ||
description: Presto endpoint when running locally | ||
paths: | ||
/v1/cluster: | ||
get: | ||
summary: Retrieve cluster statistics | ||
description: Retrieves statistics about the Presto cluster, such as running queries, blocked queries, and memory usage. | ||
parameters: | ||
- name: includeLocalInfoOnly | ||
in: query | ||
required: false | ||
schema: | ||
type: boolean | ||
default: false | ||
description: Include only local information | ||
responses: | ||
'200': | ||
description: Cluster statistics | ||
content: | ||
application/json: | ||
schema: | ||
$ref: './schemas.yaml/#/components/schemas/ClusterStats' | ||
/v1/cluster/memory: | ||
get: | ||
summary: Retrieve cluster memory pool information | ||
description: Retrieves information about the memory pools in the Presto cluster. | ||
responses: | ||
'200': | ||
description: Cluster memory pool information | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
additionalProperties: | ||
$ref: './schemas.yaml/#/components/schemas/MemoryPoolInfo' | ||
/v1/cluster/workerMemory: | ||
get: | ||
summary: Retrieve worker memory information | ||
description: Retrieves information about the memory usage of workers in the Presto cluster. | ||
responses: | ||
'200': | ||
description: Worker memory information | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
|
||
additionalProperties: | ||
$ref: './schemas.yaml/#/components/schemas/MemoryInfo' | ||
/v1/cluster/ttl: | ||
get: | ||
summary: Retrieve cluster TTL information | ||
description: Retrieves time-to-live (TTL) information for the Presto cluster. | ||
responses: | ||
'200': | ||
description: Cluster TTL information | ||
content: | ||
application/json: | ||
schema: | ||
$ref: './schemas.yaml/#/components/schemas/ConfidenceBasedTtlInfo' |
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,94 @@ | ||
openapi: 3.0.0 | ||
info: | ||
title: Presto Query Info | ||
description: Optional multiline or single-line description in [CommonMark](http://commonmark.org/help/) or HTML. | ||
version: "1" | ||
servers: | ||
- url: http://localhost:8080 | ||
description: Presto endpoint when running locally | ||
paths: | ||
/v1/query/{queryId}: | ||
delete: | ||
summary: Cancel a specific query | ||
description: Cancels the query identified by queryId | ||
parameters: | ||
- name: queryId | ||
in: path | ||
required: true | ||
schema: | ||
type: string | ||
description: The ID of the query to cancel | ||
responses: | ||
'204': | ||
description: Query canceled successfully | ||
get: | ||
summary: Retrieve information about a specific query | ||
description: Retrieves detailed information about the query identified by queryId | ||
parameters: | ||
- name: queryId | ||
in: path | ||
required: true | ||
schema: | ||
type: string | ||
description: The ID of the query to retrieve | ||
responses: | ||
'200': | ||
description: Detailed query information | ||
content: | ||
application/json: | ||
schema: | ||
title: 'QueryInfoResponse' | ||
type: object | ||
oneOf: | ||
- $ref: './schemas.yaml/#/components/schemas/BasicQueryInfo' | ||
- $ref: './schemas.yaml/#/components/schemas/QueryInfo' | ||
|
||
'404': | ||
description: Query not found | ||
/v1/query/{queryId}/killed: | ||
put: | ||
summary: Kill a specific query | ||
description: Kills the query identified by queryId with a provided message | ||
parameters: | ||
- name: queryId | ||
in: path | ||
required: true | ||
schema: | ||
type: string | ||
description: The ID of the query to kill | ||
requestBody: | ||
required: true | ||
content: | ||
text/plain: | ||
schema: | ||
type: string | ||
description: Message explaining why the query is being killed | ||
responses: | ||
'200': | ||
description: Query killed successfully | ||
/v1/query: | ||
get: | ||
summary: Returns a list of query resource information | ||
description: Retrieves information about all queries with the ability to filter and limit the result list using optional parameters | ||
parameters: | ||
- name: state | ||
in: query | ||
required: false | ||
schema: | ||
type: string | ||
description: Filter queries by state | ||
- name: limit | ||
in: query | ||
required: false | ||
schema: | ||
type: integer | ||
description: Limit the number of queries returned | ||
responses: | ||
'200': | ||
description: A list of queries | ||
content: | ||
application/json: | ||
schema: | ||
type: array | ||
items: | ||
$ref: './schemas.yaml/#/components/schemas/BasicQueryInfo' |
Oops, something went wrong.