Page tree

Release 6.0.2


Contents:

   

For the latest updates on available API endpoints and documentation, see api.trifacta.com.

This is the latest version of the APIs.

Contents:


Create the specified connection.

NOTE: In this release, you cannot create Redshift or SQL DW connections via the API. Please create these connections through the application. This known issue will be fixed in a future release.

For more information on connections, see Connection Types.

Version:  v4

Required Permissions

NOTE: Each request to the Designer Cloud Powered by Trifacta® platform must include authentication credentials. See https://api.trifacta.com/ee/6.0/index.html#section/Authentication.

Request

Request Type: POST

Endpoint:

/v4/connections/

Request Body - Relational Connection:

For relational connections, the request body should look like the following. All properties are required unless noted.

NOTE: Relational connections require the creation and installation of an encryption key file on the Alteryx node. This file must be present before the connection is created. See Create Encryption Key File.

This example creates a SQL Server connection of basic credentials type. A valid username/password combination must be specified in the credentials property.

{
    "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>"
        }
    ]
}
PropertyDescription
nameDisplay name of the connection
description(Optional) Display description for the connection
vendorNameSet this value to sqlserver.
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.
hostHost name of the relational server to which to connect.
portPort 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 sqlserver.

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 ConnecStrOpts parameter. For more information, see CLI for Connections.
ssl

(Optional) If set to true, the connection is made over SSL. The default is false.

 

NOTE: If you connect over SSL, you must modify the hostname value to use HTTPS.

NOTE: SSL connections to SQL Server are not supported.

credentialType

Set this value to one of the following:

  • basic - Simple username/password to be provided in the credentials property.
  • conf - Use the connection credentials stored in trifacta-conf.json.

  • kerberos delegate - Connection uses the Kerberos-delegated principal to connect to the database. No credentials are submitted as part of the connection definition. This method requires additional configuration. See Enable SSO for Relational Connections.

  • custom - Connection credentials are specified in the params property, such as using key-value parameters to specify access credentials.
credentialsSharedIf 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 Designer Cloud Powered by Trifacta platform attempts to infer types when data is imported. For schematized sources, you may prefer to disable type inference, instead using the types provided by the source.

When this setting is true, initial type inference by the platform is disabled for all data read through this connection.

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.

{
    "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.

PropertyDescription
host

Set this value to hadoop to integrate with the Hive instance for the Hadoop cluster to which the Designer Cloud Powered by Trifacta platform is connected.

portBy default, this value should be 10000.
params

Connection parameters for the Hive instance.

NOTE: The following parameter entry is required for Hive:

      "jdbc": "hive2",

Others are optional.

typeSet this value to jdbc.
isGlobal

NOTE: For Hive connections, this value must be set to true.

credentialTypeSet this value to conf.

For more information, see Configure for Hive.

Request Body - Redshift Connection:

{
    "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.

PropertyDescription
connectParams

A default database value is required.

The extraLoadParams value is used when you publish results to Redshift. For more information on these values, see http://docs.aws.amazon.com/redshift/latest/dg/copy-parameters-data-conversion.html.

typeSet this value to jdbc.
credentialTypeSet this value to custom. Credentials are specified below.
credentials

username and password must be specified in this key-value format, although the value for either can be an empty string.

NOTE: iamRoleArn is optional. For more information, see Configure for EC2 Role-Based Authentication.

For more information on parameters and credentials, see Create Redshift Connections.

Response

Response Status Code - Success:  201 - Created

Response Body Example:

{
    "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.

 

This page has no comments.