Create a DbTap

POST /api/v1.2/db_taps/

Use this API to create a data store (formerly known as DbTap). Adding a Data Store describes how to add a data store in the Explore UI page.

Resource URI db_taps/
Request Type POST
Supporting Versions v2.0
Return Value Json object representing the newly created DbTap.

Required Role

The following users can make this API call:

  • Users who belong to the system-admin group.
  • Users who belong to a group associated with a role that allows creating a DbTap. See Managing Groups and Managing Roles for more information.

Parameters

Note

Parameters marked in bold below are mandatory. Others are optional and have default values. Presto is not currently supported on all Cloud platforms; see QDS Components: Supported Versions and Cloud Platforms.

Parameter Description
catalog_name

This parameter is mandatory to make the data stores accessible through Presto and Spark clusters. The catalog_name can contain lower-case alphabets or numerals. Its value can be NULL if you do not want to export data source to Presto or Spark clusters. This parameter is supported for MySQL, Postgres, Snowflake, and Redshift type of data stores only through Presto/Spark.

Note

Apart from adding the catalog name, create a ticket with Qubole Support to enable this feature.

name Use this parameter to add a name to the data store. If you do not add a name, then Qubole adds the name as a combination of db_host and db_name.
db_name Database Name. This is the data store name that is created in the QDS.
db_host IP address or hostname of the data store.
db_user User name to login to the data store.
db_passwd Password to login to the data store.
port TCP Port to connect on. If not specified, the default port for the datastore type is used.
db_type Type of database. Valid values are mysql, vertica, mongo, postgresql, and redshift. The default value is mysql.
db_location Location of database. Valid values are us-east-1, us-west-2, ap-southeast-1, eu-west-1, and on-premise.
gateway_ip IP address or hostname of the gateway machine.
gateway_port The default port is 22. Specify a non-default port to connect to the gateway machine.
gateway_username User name to login to the gateway machine.
gateway_private_key Private key for the aforementioned user to login to the gateway machine. If you add the private key, you must add the associated public key to the bastion node as described in clusters-in-vpc.
skip_validation Set it to true to skip the data store validation when you create or edit a data store. It is set to false by default.

Note

  • Gateway parameters (gateway_ip, gateway_username, gateway_private_key) can be specified only if db_location is ‘on-premise’.
  • If you do not want to use a gateway machine to access your data store, you need not specify any of the gateway parameters.
  • Though the gateway parameters are optional, if any one of the gateway parameters is specified then all three must be specified.
  • Port 22 must be open on the gateway machine and it must have access to the data store.

Example

payload:
{
  "db_name":"doc_example",
  "db_host":"localhost",
  "db_user":"doc_writer",
  "db_passwd":"",
  "db_type":"mysql",
  "db_location":"us-east-1"
}
curl -i -X POST -H "Content-Type: application/json" -H "Accept: application/json" -H "X-AUTH-TOKEN: $AUTH_TOKEN"
-d @payload https://gcp.qubole.com/api/v1.2/db_taps/
{
  "account_id": 10,
  "active": true,
  "db_user": "doc_writer",
  "user_id": 1,
  "db_passwd": "",
  "db_name": "doc_example",
  "created_at": "2013-03-15T10:02:42Z",
  "db_host": "localhost",
  "db_location":"us-east-1",
  "db_type":"mysql"
  "id": 3,
  "port": null
}

Take a note of the DbTap id (in this case 3). It is used in later examples.

export DBTAPID=3