Update apiDefinition.swagger.json (#1575)

Adapted to Snowflake API V2
This commit is contained in:
rekodus 2022-05-05 02:52:46 +02:00 коммит произвёл GitHub
Родитель 935e280a0e
Коммит 6673c52b0b
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 350 добавлений и 328 удалений

Просмотреть файл

@ -2,11 +2,11 @@
"swagger": "2.0",
"info": {
"title": "Snowflake REST",
"description": "Snowflake connector based on Snowflake REST API (private preview)",
"description": "Snowflake connector based on Snowflake REST API (private preview) for Snowflake API V2",
"version": "1.0"
},
"host": "YourInstance.snowflakecomputing.com",
"basePath": "/api/statements",
"host": "uniper.west-europe.azure.snowflakecomputing.com",
"basePath": "/api/v2/statements",
"schemes": [
"https"
],
@ -27,199 +27,146 @@
],
"responses": {
"200": {
"description": "Success operation",
"description": "The statement was executed successfully, and the response includes any data requested.",
"x-ms-summary": "Message",
"schema": {
"type": "object",
"properties": {
"resultSetMetaData": {
"type": "object",
"properties": {
"page": {
"type": "integer",
"format": "int32",
"description": "page"
},
"pageSize": {
"type": "integer",
"format": "int32",
"description": "pageSize"
},
"numPages": {
"type": "integer",
"format": "int32",
"description": "numPages"
},
"numRows": {
"type": "integer",
"format": "int32",
"description": "numRows"
},
"format": {
"type": "string",
"description": "format"
},
"rowType": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
},
"description": "rowType"
}
},
"description": "resultSetMetaData"
},
"data": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
},
"description": "data"
},
"code": {
"type": "string",
"description": "code"
},
"statementStatusUrl": {
"type": "string",
"description": "statementStatusUrl"
"example": "000123"
},
"sqlState": {
"type": "string",
"description": "sqlState"
},
"statementHandle": {
"type": "string",
"description": "statementHandle"
"example": "42601"
},
"message": {
"type": "string",
"description": "message"
"example": "successfully executed"
},
"statementHandle": {
"type": "string",
"example": "536fad38-b564-4dc5-9892-a4543504df6c"
},
"createdOn": {
"type": "integer",
"format": "int32",
"description": "createdOn"
}
}
}
},
"202": {
"description": "Asynchronous execution in progress. Use provided query id to perform query monitoring and management.",
"x-ms-summary": "Message",
"schema": {
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "code"
},
"message": {
"type": "string",
"description": "message"
},
"statementHandle": {
"type": "string",
"description": "statementHandle"
"description": "Timestamp that specifies when the statement execution started. The timestamp is expressed in milliseconds since the epoch",
"example": 1597090533987
},
"statementStatusUrl": {
"type": "string",
"description": "statementStatusUrl"
}
}
}
"example": "/api/v2/statements/536fad38-b564-4dc5-9892-a4543504df6c"
},
"400": {
"description": "Incoming request does not contain a valid payload.",
"x-ms-summary": "Message",
"schema": {
"resultSetMetaData": {
"type": "object",
"properties": {
"code": {
"format": {
"type": "string",
"description": "code"
"enum": [
"jsonv2"
],
"description": "For v2 endpoints the only possible value for this field is jsonv2.",
"example": "jsonv2"
},
"message": {
"type": "string",
"description": "message"
}
}
}
},
"401": {
"description": "Invalid OAuth access token",
"x-ms-summary": "Message",
"schema": {
"rowType": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "code"
"name": {
"type": "string"
},
"message": {
"type": "string",
"description": "message"
"type": {
"type": "string"
},
"nullable": {
"type": "boolean"
}
},
"additionalProperties": true
}
}
}
},
"405": {
"description": "Unsupported HTTP method.",
"x-ms-summary": "Message",
"schema": {
"partitionInfo": {
"description": "Partition information",
"type": "array",
"minItems": 0,
"items": {
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "code"
"rowCount": {
"type": "integer",
"format": "int64",
"description": "Number of rows in the partition.",
"minimum": 0,
"example": 1324
},
"message": {
"type": "string",
"description": "message"
"compressedSize": {
"type": "integer",
"format": "int64",
"description": "the partition size before the decompression. This may or may not be present in the partitionInfo. Uncompressed size would always be there.",
"minimum": 0,
"example": 37436824
},
"uncompressedSize": {
"type": "integer",
"format": "int64",
"description": "the partition size after the decompression",
"minimum": 0,
"example": 1343787384
}
}
}
},
"422": {
"description": "SQL compilation error.",
"x-ms-summary": "Message",
"schema": {
"nullable": {
"description": "false if null is replaced with a string 'null' otherwise false",
"type": "boolean"
},
"data": {
"description": "Result set data.",
"type": "array",
"minItems": 0,
"items": {
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "code"
},
"message": {
"type": "string",
"description": "message"
},
"sqlState": {
"type": "string",
"description": "sqlState"
},
"statementHandle": {
"type": "string",
"description": "statementHandle"
}
}
"additionalProperties": true
}
},
"429": {
"description": "Too many concurrent requests.",
"x-ms-summary": "Message",
"schema": {
"stats": {
"type": "object",
"description": "these stats might not be available for each request.",
"properties": {
"code": {
"type": "string",
"description": "code"
"numRowsInserted": {
"type": "integer",
"format": "int64",
"description": "Number of rows that were inserted.",
"minimum": 0,
"example": 12
},
"message": {
"type": "string",
"description": "message"
"numRowsUpdated": {
"type": "integer",
"format": "int64",
"description": "Number of rows that were updated.",
"minimum": 0,
"example": 9
},
"numRowsDeleted": {
"type": "integer",
"format": "int64",
"description": "Number of rows that were deleted.",
"minimum": 0,
"example": 8
},
"numDuplicateRowsUpdated": {
"type": "integer",
"format": "int64",
"description": "Number of duplicate rows that were updated.",
"minimum": 0,
"example": 20
}
}
}
}
}
@ -279,20 +226,41 @@
"required": true,
"x-ms-visibility": "internal"
},
{
"name": "requestId",
"in": "query",
"type": "string",
"required": false,
"x-ms-visibility": "advanced"
},
{
"name": "async",
"in": "query",
"type": "boolean",
"default": false,
"x-ms-visibility": "advanced"
},
{
"name": "nullable",
"in": "query",
"type": "boolean",
"default": false,
"x-ms-visibility": "advanced"
},
{
"name": "body",
"in": "body",
"required": false,
"required": true,
"schema": {
"type": "object",
"properties": {
"statement": {
"type": "string",
"description": "statement"
"description": "The SQL statement to be executed - batches of statements not yet supported"
},
"timeout": {
"type": "integer",
"format": "int32",
"default": 60,
"description": "timeout",
"x-ms-visibility": "advanced"
},
@ -311,33 +279,75 @@
"role": {
"type": "string",
"description": "role"
}
}
}
},
{
"name": "async",
"in": "query",
"type": "boolean",
"default": false,
"bindings": {
"description": "Values of bind variables in the SQL statement. When executing the statement, Snowflake replaces placeholders ('?' and ':name') in the statement with these specified values.",
"type": "object",
"properties": {},
"x-ms-visibility": "advanced"
},
{
"name": "requestId",
"in": "query",
"parameters": {
"description": "Session parameters that should be set before executing the statement.",
"type": "object",
"properties": {
"timezone": {
"description": "Time zone to use when executing the statement.",
"type": "string",
"required": false,
"x-ms-visibility": "advanced"
"example": "america/los_angeles"
},
{
"name": "pageSize",
"in": "query",
"query_tag": {
"description": "Query tag that you want to associate with the SQL statement.",
"type": "string",
"required": false,
"example": "tag-1234"
},
"binary_output_format": {
"description": "Output format for binary values.",
"type": "string",
"example": "HEX"
},
"date_output_format": {
"description": "Output format for DATE values.",
"type": "string",
"example": "YYYY-MM-DD"
},
"time_output_format": {
"description": "Output format for TIME values.",
"type": "string",
"example": "HH24:MI:SS.FF6"
},
"timestamp_output_format": {
"description": "Output format for TIMESTAMP values.",
"type": "string",
"example": "YYYY-MM-DDTHH24:MI:SS.FF6"
},
"timestamp_ltz_output_format": {
"description": "Output format for TIMESTAMP_LTZ values.",
"type": "string",
"example": "YYYY-MM-DDTHH24:MI:SS.FF6"
},
"timestamp_ntz_output_format": {
"description": "Output format for TIMESTAMP_NTZ values.",
"type": "string",
"example": "YYYY-MM-DDTHH24:MI:SS.FF6"
},
"timestamp_tz_output_format": {
"description": "Output format for TIMESTAMP_TZ values.",
"type": "string",
"example": "YYYY-MM-DDTHH24:MI:SS.FF6 TZHTZM"
},
"multi_statement_count": {
"description": "Number of statements to execute when using multi-statement capability. 0 implies variable number of statements. Negative numbers are not allowed.",
"type": "integer",
"example": 4,
"default": 1
}
},
"x-ms-visibility": "advanced"
}
],
"x-ms-visibility": "important"
}
}
}
]
}
},
"/{statementHandle}": {
@ -349,114 +359,151 @@
"schema": {
"type": "object",
"properties": {
"resultSetMetaData": {
"type": "object",
"properties": {
"page": {
"type": "integer",
"format": "int32",
"description": "page"
},
"numPages": {
"type": "integer",
"format": "int32",
"description": "numPages"
},
"numRows": {
"type": "integer",
"format": "int32",
"description": "numRows"
},
"format": {
"code": {
"type": "string",
"description": "format"
},
"rowType": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
},
"description": "rowType"
}
},
"description": "resultSetMetaData"
},
"data": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
},
"description": "data"
"example": "000123"
},
"sqlState": {
"type": "string",
"description": "sqlState"
},
"statementHandle": {
"type": "string",
"description": "statementHandle"
},
"statementStatusUrl": {
"type": "string"
"example": "42601"
},
"message": {
"type": "string",
"description": "message"
"example": "successfully executed"
},
"code": {
"statementHandle": {
"type": "string",
"description": "code"
"example": "536fad38-b564-4dc5-9892-a4543504df6c"
},
"createdOn": {
"type": "integer",
"format": "int32",
"description": "createdOn"
"description": "Timestamp that specifies when the statement execution started. The timestamp is expressed in milliseconds since the epoch",
"example": 1597090533987
},
"statementStatusUrl": {
"type": "string",
"example": "/api/v2/statements/536fad38-b564-4dc5-9892-a4543504df6c"
},
"resultSetMetaData": {
"type": "object",
"properties": {
"format": {
"type": "string",
"enum": [
"jsonv2"
],
"description": "For v2 endpoints the only possible value for this field is jsonv2.",
"example": "jsonv2"
},
"rowType": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"type": {
"type": "string"
},
"nullable": {
"type": "boolean"
}
},
"additionalProperties": true
}
}
}
},
"202": {
"partitionInfo": {
"description": "Partition information",
"type": "array",
"minItems": 0,
"items": {
"type": "object",
"properties": {
"rowCount": {
"type": "integer",
"format": "int64",
"description": "Number of rows in the partition.",
"minimum": 0,
"example": 1324
},
"compressedSize": {
"type": "integer",
"format": "int64",
"description": "the partition size before the decompression. This may or may not be present in the partitionInfo. Uncompressed size would always be there.",
"minimum": 0,
"example": 37436824
},
"uncompressedSize": {
"type": "integer",
"format": "int64",
"description": "the partition size after the decompression",
"minimum": 0,
"example": 1343787384
}
}
}
},
"nullable": {
"description": "false if null is replaced with a string 'null' otherwise false",
"type": "boolean"
},
"data": {
"description": "Result set data.",
"type": "array",
"minItems": 0,
"items": {
"type": "object",
"additionalProperties": true
}
},
"stats": {
"type": "object",
"description": "these stats might not be available for each request.",
"properties": {
"numRowsInserted": {
"type": "integer",
"format": "int64",
"description": "Number of rows that were inserted.",
"minimum": 0,
"example": 12
},
"numRowsUpdated": {
"type": "integer",
"format": "int64",
"description": "Number of rows that were updated.",
"minimum": 0,
"example": 9
},
"numRowsDeleted": {
"type": "integer",
"format": "int64",
"description": "Number of rows that were deleted.",
"minimum": 0,
"example": 8
},
"numDuplicateRowsUpdated": {
"type": "integer",
"format": "int64",
"description": "Number of duplicate rows that were updated.",
"minimum": 0,
"example": 20
}
}
}
}
}
},
"default": {
"description": "Asynchronous execution in progress. Use provided query id to perform query monitoring and management.",
"x-ms-summary": "Message",
"schema": {
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "code"
},
"message": {
"type": "string",
"description": "message"
},
"statementHandle": {
"type": "string",
"description": "statementHandle"
},
"statementStatusUrl": {
"type": "string",
"description": "statementStatusUrl"
}
}
}
},
"429": {
"description": "Too many concurrent requests.",
"x-ms-summary": "Message",
"schema": {
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "code"
},
"message": {
"type": "string",
"description": "message"
}
}
"additionalProperties": true
}
}
},
@ -488,11 +535,20 @@
"type": "string"
},
{
"name": "page",
"name": "requestId",
"in": "query",
"required": true,
"type": "integer",
"default": 0
"type": "string",
"x-ms-visibility": "advanced"
},
{
"name": "partition",
"in": "query",
"type": "integer"
},
{
"name": "resultSetMetaData",
"in": "header",
"type": "string"
}
]
}
@ -529,46 +585,12 @@
}
}
},
"422": {
"description": "Statement not found.",
"default": {
"description": "Asynchronous execution in progress. Use provided query id to perform query monitoring and management.",
"x-ms-summary": "Message",
"schema": {
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "code"
},
"message": {
"type": "string",
"description": "message"
},
"sqlState": {
"type": "string",
"description": "sqlState"
},
"statementHandle": {
"type": "string",
"description": "statementHandle"
}
}
}
},
"429": {
"description": "Too many concurrent requests.",
"x-ms-summary": "Message",
"schema": {
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "code"
},
"message": {
"type": "string",
"description": "message"
}
}
"additionalProperties": true
}
}
},
@ -615,7 +637,7 @@
"type": "oauth2",
"flow": "accessCode",
"authorizationUrl": "https://login.windows.net/common/oauth2/authorize",
"tokenUrl": "https://yourinstance.snowflakecomputing.com/oauth/token-request",
"tokenUrl": "https://uniper.west-europe.azure.snowflakecomputing.com/oauth/token-request",
"scopes": {}
}
},