You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/09/11 11:54:12 UTC
[GitHub] [superset] WingCode opened a new pull request #16672: Update OpenAPI definition /database/available
WingCode opened a new pull request #16672:
URL: https://github.com/apache/superset/pull/16672
### SUMMARY
Update OpenAPI definition for the latest API response for database available. In previous spec, it is list of object expected but from the API response it is dict that is the key "databases" followed by a list of objects. Example:
```json
{
"databases": [
{
"available_drivers": [
"psycopg2"
],
"default_driver": "psycopg2",
"engine": "postgresql",
"name": "PostgreSQL",
"parameters": {
"properties": {
"database": {
"description": "Database name",
"type": "string"
},
"encryption": {
"description": "Use an encrypted connection to the database",
"type": "boolean"
},
"host": {
"description": "Hostname or IP address",
"type": "string"
},
"password": {
"description": "Password",
"nullable": true,
"type": "string"
},
"port": {
"description": "Database port",
"format": "int32",
"maximum": 65536,
"minimum": 0,
"type": "integer"
},
"query": {
"additionalProperties": {},
"description": "Additional parameters",
"type": "object"
},
"username": {
"description": "Username",
"nullable": true,
"type": "string"
}
},
"required": [
"database",
"host",
"port",
"username"
],
"type": "object"
},
"preferred": true,
"sqlalchemy_uri_placeholder": "postgresql://user:password@host:port/dbname[?key=value&key=value...]"
},
{
"available_drivers": [
"rest"
],
"engine": "presto",
"name": "Presto",
"preferred": true
},
{
"available_drivers": [
"mysqldb"
],
"default_driver": "mysqldb",
"engine": "mysql",
"name": "MySQL",
"parameters": {
"properties": {
"database": {
"description": "Database name",
"type": "string"
},
"encryption": {
"description": "Use an encrypted connection to the database",
"type": "boolean"
},
"host": {
"description": "Hostname or IP address",
"type": "string"
},
"password": {
"description": "Password",
"nullable": true,
"type": "string"
},
"port": {
"description": "Database port",
"format": "int32",
"maximum": 65536,
"minimum": 0,
"type": "integer"
},
"query": {
"additionalProperties": {},
"description": "Additional parameters",
"type": "object"
},
"username": {
"description": "Username",
"nullable": true,
"type": "string"
}
},
"required": [
"database",
"host",
"port",
"username"
],
"type": "object"
},
"preferred": true,
"sqlalchemy_uri_placeholder": "mysql://user:password@host:port/dbname[?key=value&key=value...]"
},
{
"available_drivers": [
"pysqlite"
],
"engine": "sqlite",
"name": "SQLite",
"preferred": true
},
{
"available_drivers": [
"rest"
],
"engine": "druid",
"name": "Apache Druid",
"preferred": false
},
{
"available_drivers": [
"thrift"
],
"engine": "hive",
"name": "Apache Hive",
"preferred": false
},
{
"available_drivers": [
"thrift"
],
"engine": "hive",
"name": "Apache Spark SQL",
"preferred": false
}
]
}
```
### TESTING INSTRUCTIONS
Download the OpenAPI spec from http://localhost:8088/api/v1/_openapi
Generate client
```shell
java -jar openapi-generator-cli.jar generate -i ./openapi.json -g python -o ./superset_py/ --skip-validate-spec
```
Test code
```python
import openapi_client
from openapi_client.api.dashboards_api import DashboardsApi
from openapi_client.api.database_api import DatabaseApi
configuration = openapi_client.Configuration(
host= "http://localhost:8088/api/v1",
username="admin",
password="admin")
api_client = openapi_client.ApiClient(configuration)
database_api = DatabaseApi(api_client)
databases = database_api.database_available_get()
print(databases)
```
### ADDITIONAL INFORMATION
The response expected from API
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] villebro commented on pull request #16672: chore: Update OpenAPI definition /database/available
Posted by GitBox <gi...@apache.org>.
villebro commented on pull request #16672:
URL: https://github.com/apache/superset/pull/16672#issuecomment-925489675
LGTM, thanks for fixing!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] villebro merged pull request #16672: chore: Update OpenAPI definition /database/available
Posted by GitBox <gi...@apache.org>.
villebro merged pull request #16672:
URL: https://github.com/apache/superset/pull/16672
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org