Last active
May 19, 2016 15:00
-
-
Save kaveenr/266a2e5b49a8f4216cf9c7d1e14f3113 to your computer and use it in GitHub Desktop.
AsterixDB swagger IO
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
swagger: '2.0' | |
info: | |
title: New HTTP API for AsterixDB | |
description: more info https://cwiki.apache.org/confluence/display/ASTERIXDB/New+HTTP+API+Design | |
version: "1.0.0" | |
schemes: | |
- http | |
paths: | |
/query/service: | |
post: | |
produces: | |
- application/json | |
summary: query the database | |
description: "" | |
parameters: | |
- name: statement | |
in: query | |
description: Any valid AQL statement | |
required: true | |
type: string | |
- name: format | |
in: query | |
description: Desired format for the query results | |
required: false | |
type: string | |
default : ADM | |
enum : [ "ADM", "JSON", "CSV"] | |
- name : mode | |
in: query | |
description: Result delivery mode. | |
required: false | |
type: string | |
format: string | |
default : synchronous | |
enum : ["asynchronous","asynchronous-deferred","synchronous"] | |
- name: lossless | |
in: query | |
description: Defines whether to use lossless-JSON output for JSON-encoded output or keep clean-JSON instead. | |
required: false | |
default : false | |
type: boolean | |
- name: include-results | |
in: query | |
description: Defines whether to include results right into the response, or return a handle to retrieve them | |
required: false | |
default : true | |
type: boolean | |
- name: wrapper-array | |
in: query | |
description: Defines whether to wrap ADM-encoded output into array-brackets. Used only when format=ADM and include-results=false. | |
required: false | |
default : false | |
type: boolean | |
- name: expr-tree | |
in: query | |
description: Defines whether to include an query expression AST into the result | |
required: false | |
default : false | |
type: boolean | |
- name: rewritten-expr-tree | |
in: query | |
description: Defines whether to include an rewritten query expression AST into the result | |
required: false | |
default : false | |
type: boolean | |
- name: logical-plan | |
in: query | |
description: Defines whether to include a logical plan into the result | |
required: false | |
default : false | |
type: boolean | |
- name: optimized-plan | |
in: query | |
description: Defines whether to include a optimized logical plan into the result | |
required: false | |
default : false | |
type: boolean | |
- name: hyracks-job | |
in: query | |
description: Defines whether to include a Hyracks job into the result | |
required: false | |
default : false | |
type: boolean | |
- name: execute-statement | |
in: query | |
description: Defines whether to execute a statement | |
required: false | |
default : true | |
type: boolean | |
responses: | |
200: | |
description: result | |
schema: | |
$ref: '#/definitions/ResultObject' | |
500: | |
description: result | |
schema: | |
$ref: '#/definitions/ResultObject' | |
/query/status/{id}: | |
get: | |
summary: get status | |
produces: | |
- application/json | |
description: | | |
This endpoint is supposed to be used only in the case when results are delivered asynchronously. The endpoint purpose is solely to inform about status of submitted query, and possibly include results of its execution | |
parameters: | |
- name: id | |
in: path | |
description: UUID generated and returned by /query endpoint. | |
required: true | |
type: number | |
responses: | |
200: | |
description: Status | |
schema: | |
$ref: '#/definitions/StatusObject' | |
500: | |
description: Status | |
schema: | |
$ref: '#/definitions/StatusObject' | |
/query/result/{id}: | |
get: | |
summary: results | |
produces: | |
- application/json | |
- application/x-adm | |
description: This endpoint is used to retrieve results of asynchronous query execution or synchronous results, when the client opted out from having results included into /query request (include-results=false). | |
parameters: | |
- name: id | |
in: path | |
description: Where ID is a UUID generated and returned by /query endpoint (include-results=false) or by /status endpoint when the asynchronous result is computed. | |
type : number | |
required : true | |
responses: | |
200: | |
description: Asynchronous query results | |
schema: | |
type: array | |
items: | |
type: object | |
definitions: | |
ResultObject: | |
type : object | |
properties: | |
status : | |
type : string | |
results : | |
type: array | |
items : | |
type : string | |
handle: | |
type: string | |
signature: | |
type: object | |
error : | |
type : object | |
properties: | |
code : | |
type : string | |
msg : | |
type : string | |
stacktrace : | |
type : string | |
metrics : | |
type : object | |
properties : | |
executionTime : | |
type: string | |
resultCount : | |
type: number | |
plans : | |
type: object | |
properties : | |
expr_tree : | |
type: string | |
rewritten_expr_tree : | |
type: string | |
logical_plan : | |
type: string | |
optimized_plan : | |
type: string | |
hyracks_job : | |
type: string | |
StatusObject: | |
type : object | |
properties: | |
status : | |
type : string | |
handle: | |
type: string | |
error : | |
type : object | |
properties: | |
code : | |
type : string | |
msg : | |
type : string | |
stacktrace : | |
type : string | |
metrics : | |
type : object | |
properties : | |
executionTime : | |
type: string | |
resultCount : | |
type: number | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment