D s api version |
---|
D toc |
---|
Create the specified connection. For more information on connections, see Connection Types.
Version: v4
Required Permissions
D s api auth |
---|
Request
Request Type: POST
Endpoint:
Code Block |
---|
/v4/connections/ |
Request Body - Relational Connection:
For relational connections, the request body should look like the following. All properties are required unless noted.
Info | |
---|---|
NOTE: Relational connections require the creation and installation of an encryption key file on the
|
This example creates a SQL Server connection of basic
credentials type. A valid username/password combination must be specified in the credentials
property.
Code Block |
---|
{ "connectParams": { "vendor": "sqlserver", "vendorName": "sqlserver", "host": "sqlserver.example.com", "port": "1433" }, "host": "sqlserver.example.com", "port": 1433, "vendor": "sqlserver", "params": { "connectStrOpts": "" }, "ssl": false, "vendorName": "sqlserver", "name": "sqlserver_test2", "description": "", "type": "jdbc", "isGlobal": false, "credentialType": "basic", "credentialsShared": true, "disableTypeInference": false, "credentials": [ { "username": "<username>", "password": "<password>" } ] } |
Property | Description | ||||
---|---|---|---|---|---|
name | Display name of the connection | ||||
description | (Optional) Display description for the connection | ||||
vendorName | Set this value to the name of the vendor. For more information, see Connection Types. | ||||
type | For more information on the value to insert for the connection, see Connection Types. | ||||
isGlobal | (Optional) If true , the connection is available to all users. The default is false . | ||||
host | Host name of the relational server to which to connect. | ||||
port | Port number for the relational server. The default value varies between database vendors. For more information, please see the documentation provided with your database distribution. | ||||
vendor | Set this value to the vendor value. For more information, see Connection Types. | ||||
params | (Optional) Set of JSON parameters that are passed to the database when initializing the connection. Depending on the database vendor, you may be required to submit via this parameter the name of the default database. You can also pass in optional parameters through the | ||||
ssl | (Optional) If set to
| ||||
credentialType | Set this value to one of the following:
| ||||
credentialsShared | If the connection is a global connection, the credentials to connect can be shared with other users when this property is true . Otherwise, other users must provide their own credentials. | ||||
disableTypeInference | By default, the
When this setting is | ||||
credentials | (Optional) If credentialType=basic , this property must contain the username and password to use to connect to the relational source. |
Request Body - Hive Connection:
You can create create only one public connection to Hive.
Code Block |
---|
{ "connectParams": { "vendor": "hive", "vendorName": "hive", "host": "hadoop", "port": "10000", "jdbc": "hive2", "defaultDatabase": "default" }, "id": 1, "host": "hadoop", "port": 10000, "vendor": "hive", "params": { "jdbc": "hive2", "connectStringOptions": "", "defaultDatabase": "default" }, "ssl": false, "vendorName": "hive", "name": "hive", "description": "Hive connection", "type": "jdbc", "isGlobal": true, "credentialType": "conf", "credentialsShared": true, "disableTypeInference": false, "credentials": [] } |
The following property values are specific to Hive connections.
Property | Description | ||||
---|---|---|---|---|---|
host | Set this value to
| ||||
port | By default, this value should be 10000 . | ||||
params | Connection parameters for the Hive instance.
| ||||
type | Set this value to jdbc . | ||||
isGlobal |
| ||||
credentialType | Set this value to conf . |
For more information, see Configure for Hive.
Request Body - Redshift Connection:
Code Block |
---|
{ "connectParams": { "vendor": "redshift", "vendorName": "redshift", "host": "redshift.example.com", "port": "5439", "defaultDatabase": "dev", "extraLoadParams": "BLANKSASNULL EMPTYASNULL TRIMBLANKS TRUNCATECOLUMNS" }, "host": "redshift.example.com", "port": 5439, "vendor": "redshift", "params": { "connectStrOpts": "", "defaultDatabase": "dev", "extraLoadParams": "BLANKSASNULL EMPTYASNULL TRIMBLANKS TRUNCATECOLUMNS" }, "ssl": false, "vendorName": "redshift", "name": "redshift2", "description": "Redshift connection", "type": "jdbc", "isGlobal": true, "credentialType": "custom", "credentialsShared": true, "disableTypeInference": false, "credentials": [ {"key":"user","value":"<username>"}, {"key":"password","value":"<password>"}, {"key":"iamRoleArn","value":"<IAM_role_ARN>"} ] } |
The following property values are specific to Redshift connections.
Property | Description | ||
---|---|---|---|
connectParams | A default database value is required. The | ||
type | Set this value to jdbc . | ||
credentialType | Set this value to custom . Credentials are specified below. | ||
credentials |
|
For more information on parameters and credentials, see Create Redshift Connections.
Request Body - Snowflake Connection:
Code Block |
---|
{ "vendor": "snowflake", "vendorName": "snowflake", "credentialType": "custom", "description": "", "host": "mysnowflakehost", "name": "snowflake", "type": "jdbc", "params": { "connectStrOpts": "", "warehouse": "LOAD_WH", "stage": "PUBLIC.MY_STAGE", "database": "DEFAULT_DB" }, "credentials": [ { "key": "username", "value": "myuser" }, { "key": "password", "value": "<my_pwd>" } ] } |
The following property values are specific to Snowflake connections.
Info |
---|
NOTE: In Snowflake connections, property values are case-sensitive. Snowflake-related locations are typically specified in capital letters. |
Property | Description |
---|---|
vendor | Set this value to |
vendorName | Set this value to snowflake . |
type | Set this value to jdbc . |
params.warehouse | Set this value to the Snowflake warehouse to use for this connection. |
params.stage | If you are using a Snowflake stage, specify the value in the form of SCHEMA.NAME of the S3 bucket that is used for staging. |
params.database | Set this value to the default Snowflake database to use for this connection. |
credentials |
|
For more information on parameters and credentials, see Create Snowflake Connections.
Response
Response Status Code - Success: 201 - Created
Response Body Example:
Code Block |
---|
{ "connectParams": { "vendor": "sqlserver", "vendorName": "sqlserver", "host": "sqlserver.example.com", "port": "1433" }, "id": 26, "host": "sqlserver.example.com", "port": 1433, "vendor": "sqlserver", "params": { "connectStrOpts": "" }, "ssl": false, "vendorName": "sqlserver", "name": "sqlserver_test2", "description": "", "type": "jdbc", "isGlobal": false, "credentialType": "basic", "credentialsShared": true, "uuid": "fa7e06c0-0143-11e8-8faf-27c0392328c5", "disableTypeInference": false, "createdAt": "2018-01-24T20:20:11.181Z", "updatedAt": "2018-01-24T20:20:11.181Z", "credentials": [ { "username": "<username>" } ], "creator": { "id": 1 }, "updater": { "id": 1 } } |
Reference
For more information on the response body properties, see API Connections Get v4.