curl --request POST \
--url https://{organization}.admin.credibledata.com/api/v0/organizations/{organizationName}/environments/{environmentName}/connections \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"resource": "<string>",
"name": "<string>",
"fingerprint": "<string>",
"attributes": {
"dialectName": "<string>",
"isPool": true,
"canPersist": true,
"canStream": true
},
"proxy": {
"type": "ssh",
"ssh": {
"host": "<string>",
"port": 22,
"username": "<string>",
"privateKey": "<string>",
"privateKeyPass": "<string>",
"hostKey": "<string>"
}
},
"postgresConnection": {
"host": "<string>",
"port": 123,
"databaseName": "<string>",
"userName": "<string>",
"password": "<string>",
"connectionString": "<string>"
},
"bigqueryConnection": {
"defaultProjectId": "<string>",
"billingProjectId": "<string>",
"location": "<string>",
"serviceAccountKeyJson": "<string>",
"maximumBytesBilled": "<string>",
"queryTimeoutMilliseconds": "<string>"
},
"snowflakeConnection": {
"account": "<string>",
"username": "<string>",
"password": "<string>",
"privateKey": "<string>",
"privateKeyPass": "<string>",
"warehouse": "<string>",
"database": "<string>",
"schema": "<string>",
"role": "<string>",
"responseTimeoutMilliseconds": 123
},
"trinoConnection": {
"server": "<string>",
"port": 123,
"catalog": "<string>",
"schema": "<string>",
"user": "<string>",
"password": "<string>",
"peakaKey": "<string>"
},
"databricksConnection": {
"host": "<string>",
"path": "<string>",
"token": "<string>",
"oauthClientId": "<string>",
"oauthClientSecret": "<string>",
"defaultCatalog": "<string>",
"defaultSchema": "<string>",
"setupSQL": "<string>"
},
"mysqlConnection": {
"host": "<string>",
"port": 123,
"database": "<string>",
"user": "<string>",
"password": "<string>"
},
"duckdbConnection": {
"attachedDatabases": [
{
"name": "test_connection, _connection, test_connection_1",
"attributes": {
"dialectName": "<string>",
"isPool": true,
"canPersist": true,
"canStream": true
},
"bigqueryConnection": {
"defaultProjectId": "<string>",
"billingProjectId": "<string>",
"location": "<string>",
"serviceAccountKeyJson": "<string>",
"maximumBytesBilled": "<string>",
"queryTimeoutMilliseconds": "<string>"
},
"snowflakeConnection": {
"account": "<string>",
"username": "<string>",
"password": "<string>",
"privateKey": "<string>",
"privateKeyPass": "<string>",
"warehouse": "<string>",
"database": "<string>",
"schema": "<string>",
"role": "<string>",
"responseTimeoutMilliseconds": 123
},
"postgresConnection": {
"host": "<string>",
"port": 123,
"databaseName": "<string>",
"userName": "<string>",
"password": "<string>",
"connectionString": "<string>"
}
}
]
},
"motherduckConnection": {
"accessToken": "<string>",
"database": "<string>"
},
"template": "bq_demo",
"includeTables": [
"sales.orders",
"finance.*"
],
"excludeAllTables": false,
"excludeTables": [
"backup.records",
"temp_data.*"
],
"indexingStatusLastUpdated": "2023-11-07T05:31:56Z",
"indexingProgress": {
"schemaProgress": {
"tablesTotal": 123,
"tablesProcessing": 123,
"tablesCompleted": 123,
"tablesFailed": 123,
"columnsTotal": 123,
"columnsCompleted": 123
},
"modelSuggestionsProgress": {
"tablesTotal": 123,
"tablesProcessing": 123,
"tablesCompleted": 123,
"tablesFailed": 123,
"joinWorkTotal": 123,
"joinWorkCompleted": 123,
"joinsGenerated": 123,
"dimensionsGenerated": 123,
"measuresGenerated": 123
}
}
}
'import requests
url = "https://{organization}.admin.credibledata.com/api/v0/organizations/{organizationName}/environments/{environmentName}/connections"
payload = {
"resource": "<string>",
"name": "<string>",
"fingerprint": "<string>",
"attributes": {
"dialectName": "<string>",
"isPool": True,
"canPersist": True,
"canStream": True
},
"proxy": {
"type": "ssh",
"ssh": {
"host": "<string>",
"port": 22,
"username": "<string>",
"privateKey": "<string>",
"privateKeyPass": "<string>",
"hostKey": "<string>"
}
},
"postgresConnection": {
"host": "<string>",
"port": 123,
"databaseName": "<string>",
"userName": "<string>",
"password": "<string>",
"connectionString": "<string>"
},
"bigqueryConnection": {
"defaultProjectId": "<string>",
"billingProjectId": "<string>",
"location": "<string>",
"serviceAccountKeyJson": "<string>",
"maximumBytesBilled": "<string>",
"queryTimeoutMilliseconds": "<string>"
},
"snowflakeConnection": {
"account": "<string>",
"username": "<string>",
"password": "<string>",
"privateKey": "<string>",
"privateKeyPass": "<string>",
"warehouse": "<string>",
"database": "<string>",
"schema": "<string>",
"role": "<string>",
"responseTimeoutMilliseconds": 123
},
"trinoConnection": {
"server": "<string>",
"port": 123,
"catalog": "<string>",
"schema": "<string>",
"user": "<string>",
"password": "<string>",
"peakaKey": "<string>"
},
"databricksConnection": {
"host": "<string>",
"path": "<string>",
"token": "<string>",
"oauthClientId": "<string>",
"oauthClientSecret": "<string>",
"defaultCatalog": "<string>",
"defaultSchema": "<string>",
"setupSQL": "<string>"
},
"mysqlConnection": {
"host": "<string>",
"port": 123,
"database": "<string>",
"user": "<string>",
"password": "<string>"
},
"duckdbConnection": { "attachedDatabases": [
{
"name": "test_connection, _connection, test_connection_1",
"attributes": {
"dialectName": "<string>",
"isPool": True,
"canPersist": True,
"canStream": True
},
"bigqueryConnection": {
"defaultProjectId": "<string>",
"billingProjectId": "<string>",
"location": "<string>",
"serviceAccountKeyJson": "<string>",
"maximumBytesBilled": "<string>",
"queryTimeoutMilliseconds": "<string>"
},
"snowflakeConnection": {
"account": "<string>",
"username": "<string>",
"password": "<string>",
"privateKey": "<string>",
"privateKeyPass": "<string>",
"warehouse": "<string>",
"database": "<string>",
"schema": "<string>",
"role": "<string>",
"responseTimeoutMilliseconds": 123
},
"postgresConnection": {
"host": "<string>",
"port": 123,
"databaseName": "<string>",
"userName": "<string>",
"password": "<string>",
"connectionString": "<string>"
}
}
] },
"motherduckConnection": {
"accessToken": "<string>",
"database": "<string>"
},
"template": "bq_demo",
"includeTables": ["sales.orders", "finance.*"],
"excludeAllTables": False,
"excludeTables": ["backup.records", "temp_data.*"],
"indexingStatusLastUpdated": "2023-11-07T05:31:56Z",
"indexingProgress": {
"schemaProgress": {
"tablesTotal": 123,
"tablesProcessing": 123,
"tablesCompleted": 123,
"tablesFailed": 123,
"columnsTotal": 123,
"columnsCompleted": 123
},
"modelSuggestionsProgress": {
"tablesTotal": 123,
"tablesProcessing": 123,
"tablesCompleted": 123,
"tablesFailed": 123,
"joinWorkTotal": 123,
"joinWorkCompleted": 123,
"joinsGenerated": 123,
"dimensionsGenerated": 123,
"measuresGenerated": 123
}
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
resource: '<string>',
name: '<string>',
fingerprint: '<string>',
attributes: {dialectName: '<string>', isPool: true, canPersist: true, canStream: true},
proxy: {
type: 'ssh',
ssh: {
host: '<string>',
port: 22,
username: '<string>',
privateKey: '<string>',
privateKeyPass: '<string>',
hostKey: '<string>'
}
},
postgresConnection: {
host: '<string>',
port: 123,
databaseName: '<string>',
userName: '<string>',
password: '<string>',
connectionString: '<string>'
},
bigqueryConnection: {
defaultProjectId: '<string>',
billingProjectId: '<string>',
location: '<string>',
serviceAccountKeyJson: '<string>',
maximumBytesBilled: '<string>',
queryTimeoutMilliseconds: '<string>'
},
snowflakeConnection: {
account: '<string>',
username: '<string>',
password: '<string>',
privateKey: '<string>',
privateKeyPass: '<string>',
warehouse: '<string>',
database: '<string>',
schema: '<string>',
role: '<string>',
responseTimeoutMilliseconds: 123
},
trinoConnection: {
server: '<string>',
port: 123,
catalog: '<string>',
schema: '<string>',
user: '<string>',
password: '<string>',
peakaKey: '<string>'
},
databricksConnection: {
host: '<string>',
path: '<string>',
token: '<string>',
oauthClientId: '<string>',
oauthClientSecret: '<string>',
defaultCatalog: '<string>',
defaultSchema: '<string>',
setupSQL: '<string>'
},
mysqlConnection: {
host: '<string>',
port: 123,
database: '<string>',
user: '<string>',
password: '<string>'
},
duckdbConnection: {
attachedDatabases: [
{
name: 'test_connection, _connection, test_connection_1',
attributes: {dialectName: '<string>', isPool: true, canPersist: true, canStream: true},
bigqueryConnection: {
defaultProjectId: '<string>',
billingProjectId: '<string>',
location: '<string>',
serviceAccountKeyJson: '<string>',
maximumBytesBilled: '<string>',
queryTimeoutMilliseconds: '<string>'
},
snowflakeConnection: {
account: '<string>',
username: '<string>',
password: '<string>',
privateKey: '<string>',
privateKeyPass: '<string>',
warehouse: '<string>',
database: '<string>',
schema: '<string>',
role: '<string>',
responseTimeoutMilliseconds: 123
},
postgresConnection: {
host: '<string>',
port: 123,
databaseName: '<string>',
userName: '<string>',
password: '<string>',
connectionString: '<string>'
}
}
]
},
motherduckConnection: {accessToken: '<string>', database: '<string>'},
template: 'bq_demo',
includeTables: ['sales.orders', 'finance.*'],
excludeAllTables: false,
excludeTables: ['backup.records', 'temp_data.*'],
indexingStatusLastUpdated: '2023-11-07T05:31:56Z',
indexingProgress: {
schemaProgress: {
tablesTotal: 123,
tablesProcessing: 123,
tablesCompleted: 123,
tablesFailed: 123,
columnsTotal: 123,
columnsCompleted: 123
},
modelSuggestionsProgress: {
tablesTotal: 123,
tablesProcessing: 123,
tablesCompleted: 123,
tablesFailed: 123,
joinWorkTotal: 123,
joinWorkCompleted: 123,
joinsGenerated: 123,
dimensionsGenerated: 123,
measuresGenerated: 123
}
}
})
};
fetch('https://{organization}.admin.credibledata.com/api/v0/organizations/{organizationName}/environments/{environmentName}/connections', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{organization}.admin.credibledata.com/api/v0/organizations/{organizationName}/environments/{environmentName}/connections",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'resource' => '<string>',
'name' => '<string>',
'fingerprint' => '<string>',
'attributes' => [
'dialectName' => '<string>',
'isPool' => true,
'canPersist' => true,
'canStream' => true
],
'proxy' => [
'type' => 'ssh',
'ssh' => [
'host' => '<string>',
'port' => 22,
'username' => '<string>',
'privateKey' => '<string>',
'privateKeyPass' => '<string>',
'hostKey' => '<string>'
]
],
'postgresConnection' => [
'host' => '<string>',
'port' => 123,
'databaseName' => '<string>',
'userName' => '<string>',
'password' => '<string>',
'connectionString' => '<string>'
],
'bigqueryConnection' => [
'defaultProjectId' => '<string>',
'billingProjectId' => '<string>',
'location' => '<string>',
'serviceAccountKeyJson' => '<string>',
'maximumBytesBilled' => '<string>',
'queryTimeoutMilliseconds' => '<string>'
],
'snowflakeConnection' => [
'account' => '<string>',
'username' => '<string>',
'password' => '<string>',
'privateKey' => '<string>',
'privateKeyPass' => '<string>',
'warehouse' => '<string>',
'database' => '<string>',
'schema' => '<string>',
'role' => '<string>',
'responseTimeoutMilliseconds' => 123
],
'trinoConnection' => [
'server' => '<string>',
'port' => 123,
'catalog' => '<string>',
'schema' => '<string>',
'user' => '<string>',
'password' => '<string>',
'peakaKey' => '<string>'
],
'databricksConnection' => [
'host' => '<string>',
'path' => '<string>',
'token' => '<string>',
'oauthClientId' => '<string>',
'oauthClientSecret' => '<string>',
'defaultCatalog' => '<string>',
'defaultSchema' => '<string>',
'setupSQL' => '<string>'
],
'mysqlConnection' => [
'host' => '<string>',
'port' => 123,
'database' => '<string>',
'user' => '<string>',
'password' => '<string>'
],
'duckdbConnection' => [
'attachedDatabases' => [
[
'name' => 'test_connection, _connection, test_connection_1',
'attributes' => [
'dialectName' => '<string>',
'isPool' => true,
'canPersist' => true,
'canStream' => true
],
'bigqueryConnection' => [
'defaultProjectId' => '<string>',
'billingProjectId' => '<string>',
'location' => '<string>',
'serviceAccountKeyJson' => '<string>',
'maximumBytesBilled' => '<string>',
'queryTimeoutMilliseconds' => '<string>'
],
'snowflakeConnection' => [
'account' => '<string>',
'username' => '<string>',
'password' => '<string>',
'privateKey' => '<string>',
'privateKeyPass' => '<string>',
'warehouse' => '<string>',
'database' => '<string>',
'schema' => '<string>',
'role' => '<string>',
'responseTimeoutMilliseconds' => 123
],
'postgresConnection' => [
'host' => '<string>',
'port' => 123,
'databaseName' => '<string>',
'userName' => '<string>',
'password' => '<string>',
'connectionString' => '<string>'
]
]
]
],
'motherduckConnection' => [
'accessToken' => '<string>',
'database' => '<string>'
],
'template' => 'bq_demo',
'includeTables' => [
'sales.orders',
'finance.*'
],
'excludeAllTables' => false,
'excludeTables' => [
'backup.records',
'temp_data.*'
],
'indexingStatusLastUpdated' => '2023-11-07T05:31:56Z',
'indexingProgress' => [
'schemaProgress' => [
'tablesTotal' => 123,
'tablesProcessing' => 123,
'tablesCompleted' => 123,
'tablesFailed' => 123,
'columnsTotal' => 123,
'columnsCompleted' => 123
],
'modelSuggestionsProgress' => [
'tablesTotal' => 123,
'tablesProcessing' => 123,
'tablesCompleted' => 123,
'tablesFailed' => 123,
'joinWorkTotal' => 123,
'joinWorkCompleted' => 123,
'joinsGenerated' => 123,
'dimensionsGenerated' => 123,
'measuresGenerated' => 123
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{organization}.admin.credibledata.com/api/v0/organizations/{organizationName}/environments/{environmentName}/connections"
payload := strings.NewReader("{\n \"resource\": \"<string>\",\n \"name\": \"<string>\",\n \"fingerprint\": \"<string>\",\n \"attributes\": {\n \"dialectName\": \"<string>\",\n \"isPool\": true,\n \"canPersist\": true,\n \"canStream\": true\n },\n \"proxy\": {\n \"type\": \"ssh\",\n \"ssh\": {\n \"host\": \"<string>\",\n \"port\": 22,\n \"username\": \"<string>\",\n \"privateKey\": \"<string>\",\n \"privateKeyPass\": \"<string>\",\n \"hostKey\": \"<string>\"\n }\n },\n \"postgresConnection\": {\n \"host\": \"<string>\",\n \"port\": 123,\n \"databaseName\": \"<string>\",\n \"userName\": \"<string>\",\n \"password\": \"<string>\",\n \"connectionString\": \"<string>\"\n },\n \"bigqueryConnection\": {\n \"defaultProjectId\": \"<string>\",\n \"billingProjectId\": \"<string>\",\n \"location\": \"<string>\",\n \"serviceAccountKeyJson\": \"<string>\",\n \"maximumBytesBilled\": \"<string>\",\n \"queryTimeoutMilliseconds\": \"<string>\"\n },\n \"snowflakeConnection\": {\n \"account\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"privateKey\": \"<string>\",\n \"privateKeyPass\": \"<string>\",\n \"warehouse\": \"<string>\",\n \"database\": \"<string>\",\n \"schema\": \"<string>\",\n \"role\": \"<string>\",\n \"responseTimeoutMilliseconds\": 123\n },\n \"trinoConnection\": {\n \"server\": \"<string>\",\n \"port\": 123,\n \"catalog\": \"<string>\",\n \"schema\": \"<string>\",\n \"user\": \"<string>\",\n \"password\": \"<string>\",\n \"peakaKey\": \"<string>\"\n },\n \"databricksConnection\": {\n \"host\": \"<string>\",\n \"path\": \"<string>\",\n \"token\": \"<string>\",\n \"oauthClientId\": \"<string>\",\n \"oauthClientSecret\": \"<string>\",\n \"defaultCatalog\": \"<string>\",\n \"defaultSchema\": \"<string>\",\n \"setupSQL\": \"<string>\"\n },\n \"mysqlConnection\": {\n \"host\": \"<string>\",\n \"port\": 123,\n \"database\": \"<string>\",\n \"user\": \"<string>\",\n \"password\": \"<string>\"\n },\n \"duckdbConnection\": {\n \"attachedDatabases\": [\n {\n \"name\": \"test_connection, _connection, test_connection_1\",\n \"attributes\": {\n \"dialectName\": \"<string>\",\n \"isPool\": true,\n \"canPersist\": true,\n \"canStream\": true\n },\n \"bigqueryConnection\": {\n \"defaultProjectId\": \"<string>\",\n \"billingProjectId\": \"<string>\",\n \"location\": \"<string>\",\n \"serviceAccountKeyJson\": \"<string>\",\n \"maximumBytesBilled\": \"<string>\",\n \"queryTimeoutMilliseconds\": \"<string>\"\n },\n \"snowflakeConnection\": {\n \"account\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"privateKey\": \"<string>\",\n \"privateKeyPass\": \"<string>\",\n \"warehouse\": \"<string>\",\n \"database\": \"<string>\",\n \"schema\": \"<string>\",\n \"role\": \"<string>\",\n \"responseTimeoutMilliseconds\": 123\n },\n \"postgresConnection\": {\n \"host\": \"<string>\",\n \"port\": 123,\n \"databaseName\": \"<string>\",\n \"userName\": \"<string>\",\n \"password\": \"<string>\",\n \"connectionString\": \"<string>\"\n }\n }\n ]\n },\n \"motherduckConnection\": {\n \"accessToken\": \"<string>\",\n \"database\": \"<string>\"\n },\n \"template\": \"bq_demo\",\n \"includeTables\": [\n \"sales.orders\",\n \"finance.*\"\n ],\n \"excludeAllTables\": false,\n \"excludeTables\": [\n \"backup.records\",\n \"temp_data.*\"\n ],\n \"indexingStatusLastUpdated\": \"2023-11-07T05:31:56Z\",\n \"indexingProgress\": {\n \"schemaProgress\": {\n \"tablesTotal\": 123,\n \"tablesProcessing\": 123,\n \"tablesCompleted\": 123,\n \"tablesFailed\": 123,\n \"columnsTotal\": 123,\n \"columnsCompleted\": 123\n },\n \"modelSuggestionsProgress\": {\n \"tablesTotal\": 123,\n \"tablesProcessing\": 123,\n \"tablesCompleted\": 123,\n \"tablesFailed\": 123,\n \"joinWorkTotal\": 123,\n \"joinWorkCompleted\": 123,\n \"joinsGenerated\": 123,\n \"dimensionsGenerated\": 123,\n \"measuresGenerated\": 123\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{organization}.admin.credibledata.com/api/v0/organizations/{organizationName}/environments/{environmentName}/connections")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"resource\": \"<string>\",\n \"name\": \"<string>\",\n \"fingerprint\": \"<string>\",\n \"attributes\": {\n \"dialectName\": \"<string>\",\n \"isPool\": true,\n \"canPersist\": true,\n \"canStream\": true\n },\n \"proxy\": {\n \"type\": \"ssh\",\n \"ssh\": {\n \"host\": \"<string>\",\n \"port\": 22,\n \"username\": \"<string>\",\n \"privateKey\": \"<string>\",\n \"privateKeyPass\": \"<string>\",\n \"hostKey\": \"<string>\"\n }\n },\n \"postgresConnection\": {\n \"host\": \"<string>\",\n \"port\": 123,\n \"databaseName\": \"<string>\",\n \"userName\": \"<string>\",\n \"password\": \"<string>\",\n \"connectionString\": \"<string>\"\n },\n \"bigqueryConnection\": {\n \"defaultProjectId\": \"<string>\",\n \"billingProjectId\": \"<string>\",\n \"location\": \"<string>\",\n \"serviceAccountKeyJson\": \"<string>\",\n \"maximumBytesBilled\": \"<string>\",\n \"queryTimeoutMilliseconds\": \"<string>\"\n },\n \"snowflakeConnection\": {\n \"account\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"privateKey\": \"<string>\",\n \"privateKeyPass\": \"<string>\",\n \"warehouse\": \"<string>\",\n \"database\": \"<string>\",\n \"schema\": \"<string>\",\n \"role\": \"<string>\",\n \"responseTimeoutMilliseconds\": 123\n },\n \"trinoConnection\": {\n \"server\": \"<string>\",\n \"port\": 123,\n \"catalog\": \"<string>\",\n \"schema\": \"<string>\",\n \"user\": \"<string>\",\n \"password\": \"<string>\",\n \"peakaKey\": \"<string>\"\n },\n \"databricksConnection\": {\n \"host\": \"<string>\",\n \"path\": \"<string>\",\n \"token\": \"<string>\",\n \"oauthClientId\": \"<string>\",\n \"oauthClientSecret\": \"<string>\",\n \"defaultCatalog\": \"<string>\",\n \"defaultSchema\": \"<string>\",\n \"setupSQL\": \"<string>\"\n },\n \"mysqlConnection\": {\n \"host\": \"<string>\",\n \"port\": 123,\n \"database\": \"<string>\",\n \"user\": \"<string>\",\n \"password\": \"<string>\"\n },\n \"duckdbConnection\": {\n \"attachedDatabases\": [\n {\n \"name\": \"test_connection, _connection, test_connection_1\",\n \"attributes\": {\n \"dialectName\": \"<string>\",\n \"isPool\": true,\n \"canPersist\": true,\n \"canStream\": true\n },\n \"bigqueryConnection\": {\n \"defaultProjectId\": \"<string>\",\n \"billingProjectId\": \"<string>\",\n \"location\": \"<string>\",\n \"serviceAccountKeyJson\": \"<string>\",\n \"maximumBytesBilled\": \"<string>\",\n \"queryTimeoutMilliseconds\": \"<string>\"\n },\n \"snowflakeConnection\": {\n \"account\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"privateKey\": \"<string>\",\n \"privateKeyPass\": \"<string>\",\n \"warehouse\": \"<string>\",\n \"database\": \"<string>\",\n \"schema\": \"<string>\",\n \"role\": \"<string>\",\n \"responseTimeoutMilliseconds\": 123\n },\n \"postgresConnection\": {\n \"host\": \"<string>\",\n \"port\": 123,\n \"databaseName\": \"<string>\",\n \"userName\": \"<string>\",\n \"password\": \"<string>\",\n \"connectionString\": \"<string>\"\n }\n }\n ]\n },\n \"motherduckConnection\": {\n \"accessToken\": \"<string>\",\n \"database\": \"<string>\"\n },\n \"template\": \"bq_demo\",\n \"includeTables\": [\n \"sales.orders\",\n \"finance.*\"\n ],\n \"excludeAllTables\": false,\n \"excludeTables\": [\n \"backup.records\",\n \"temp_data.*\"\n ],\n \"indexingStatusLastUpdated\": \"2023-11-07T05:31:56Z\",\n \"indexingProgress\": {\n \"schemaProgress\": {\n \"tablesTotal\": 123,\n \"tablesProcessing\": 123,\n \"tablesCompleted\": 123,\n \"tablesFailed\": 123,\n \"columnsTotal\": 123,\n \"columnsCompleted\": 123\n },\n \"modelSuggestionsProgress\": {\n \"tablesTotal\": 123,\n \"tablesProcessing\": 123,\n \"tablesCompleted\": 123,\n \"tablesFailed\": 123,\n \"joinWorkTotal\": 123,\n \"joinWorkCompleted\": 123,\n \"joinsGenerated\": 123,\n \"dimensionsGenerated\": 123,\n \"measuresGenerated\": 123\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{organization}.admin.credibledata.com/api/v0/organizations/{organizationName}/environments/{environmentName}/connections")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"resource\": \"<string>\",\n \"name\": \"<string>\",\n \"fingerprint\": \"<string>\",\n \"attributes\": {\n \"dialectName\": \"<string>\",\n \"isPool\": true,\n \"canPersist\": true,\n \"canStream\": true\n },\n \"proxy\": {\n \"type\": \"ssh\",\n \"ssh\": {\n \"host\": \"<string>\",\n \"port\": 22,\n \"username\": \"<string>\",\n \"privateKey\": \"<string>\",\n \"privateKeyPass\": \"<string>\",\n \"hostKey\": \"<string>\"\n }\n },\n \"postgresConnection\": {\n \"host\": \"<string>\",\n \"port\": 123,\n \"databaseName\": \"<string>\",\n \"userName\": \"<string>\",\n \"password\": \"<string>\",\n \"connectionString\": \"<string>\"\n },\n \"bigqueryConnection\": {\n \"defaultProjectId\": \"<string>\",\n \"billingProjectId\": \"<string>\",\n \"location\": \"<string>\",\n \"serviceAccountKeyJson\": \"<string>\",\n \"maximumBytesBilled\": \"<string>\",\n \"queryTimeoutMilliseconds\": \"<string>\"\n },\n \"snowflakeConnection\": {\n \"account\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"privateKey\": \"<string>\",\n \"privateKeyPass\": \"<string>\",\n \"warehouse\": \"<string>\",\n \"database\": \"<string>\",\n \"schema\": \"<string>\",\n \"role\": \"<string>\",\n \"responseTimeoutMilliseconds\": 123\n },\n \"trinoConnection\": {\n \"server\": \"<string>\",\n \"port\": 123,\n \"catalog\": \"<string>\",\n \"schema\": \"<string>\",\n \"user\": \"<string>\",\n \"password\": \"<string>\",\n \"peakaKey\": \"<string>\"\n },\n \"databricksConnection\": {\n \"host\": \"<string>\",\n \"path\": \"<string>\",\n \"token\": \"<string>\",\n \"oauthClientId\": \"<string>\",\n \"oauthClientSecret\": \"<string>\",\n \"defaultCatalog\": \"<string>\",\n \"defaultSchema\": \"<string>\",\n \"setupSQL\": \"<string>\"\n },\n \"mysqlConnection\": {\n \"host\": \"<string>\",\n \"port\": 123,\n \"database\": \"<string>\",\n \"user\": \"<string>\",\n \"password\": \"<string>\"\n },\n \"duckdbConnection\": {\n \"attachedDatabases\": [\n {\n \"name\": \"test_connection, _connection, test_connection_1\",\n \"attributes\": {\n \"dialectName\": \"<string>\",\n \"isPool\": true,\n \"canPersist\": true,\n \"canStream\": true\n },\n \"bigqueryConnection\": {\n \"defaultProjectId\": \"<string>\",\n \"billingProjectId\": \"<string>\",\n \"location\": \"<string>\",\n \"serviceAccountKeyJson\": \"<string>\",\n \"maximumBytesBilled\": \"<string>\",\n \"queryTimeoutMilliseconds\": \"<string>\"\n },\n \"snowflakeConnection\": {\n \"account\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"privateKey\": \"<string>\",\n \"privateKeyPass\": \"<string>\",\n \"warehouse\": \"<string>\",\n \"database\": \"<string>\",\n \"schema\": \"<string>\",\n \"role\": \"<string>\",\n \"responseTimeoutMilliseconds\": 123\n },\n \"postgresConnection\": {\n \"host\": \"<string>\",\n \"port\": 123,\n \"databaseName\": \"<string>\",\n \"userName\": \"<string>\",\n \"password\": \"<string>\",\n \"connectionString\": \"<string>\"\n }\n }\n ]\n },\n \"motherduckConnection\": {\n \"accessToken\": \"<string>\",\n \"database\": \"<string>\"\n },\n \"template\": \"bq_demo\",\n \"includeTables\": [\n \"sales.orders\",\n \"finance.*\"\n ],\n \"excludeAllTables\": false,\n \"excludeTables\": [\n \"backup.records\",\n \"temp_data.*\"\n ],\n \"indexingStatusLastUpdated\": \"2023-11-07T05:31:56Z\",\n \"indexingProgress\": {\n \"schemaProgress\": {\n \"tablesTotal\": 123,\n \"tablesProcessing\": 123,\n \"tablesCompleted\": 123,\n \"tablesFailed\": 123,\n \"columnsTotal\": 123,\n \"columnsCompleted\": 123\n },\n \"modelSuggestionsProgress\": {\n \"tablesTotal\": 123,\n \"tablesProcessing\": 123,\n \"tablesCompleted\": 123,\n \"tablesFailed\": 123,\n \"joinWorkTotal\": 123,\n \"joinWorkCompleted\": 123,\n \"joinsGenerated\": 123,\n \"dimensionsGenerated\": 123,\n \"measuresGenerated\": 123\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"resource": "<string>",
"name": "<string>",
"type": "postgres",
"fingerprint": "<string>",
"attributes": {
"dialectName": "<string>",
"isPool": true,
"canPersist": true,
"canStream": true
},
"proxy": {
"type": "ssh",
"ssh": {
"host": "<string>",
"port": 22,
"username": "<string>",
"privateKey": "<string>",
"privateKeyPass": "<string>",
"hostKey": "<string>"
}
},
"postgresConnection": {
"host": "<string>",
"port": 123,
"databaseName": "<string>",
"userName": "<string>",
"password": "<string>",
"connectionString": "<string>",
"sslmode": "disable"
},
"bigqueryConnection": {
"defaultProjectId": "<string>",
"billingProjectId": "<string>",
"location": "<string>",
"serviceAccountKeyJson": "<string>",
"maximumBytesBilled": "<string>",
"queryTimeoutMilliseconds": "<string>"
},
"snowflakeConnection": {
"account": "<string>",
"username": "<string>",
"password": "<string>",
"privateKey": "<string>",
"privateKeyPass": "<string>",
"warehouse": "<string>",
"database": "<string>",
"schema": "<string>",
"role": "<string>",
"responseTimeoutMilliseconds": 123
},
"trinoConnection": {
"server": "<string>",
"port": 123,
"catalog": "<string>",
"schema": "<string>",
"user": "<string>",
"password": "<string>",
"peakaKey": "<string>"
},
"databricksConnection": {
"host": "<string>",
"path": "<string>",
"token": "<string>",
"oauthClientId": "<string>",
"oauthClientSecret": "<string>",
"defaultCatalog": "<string>",
"defaultSchema": "<string>",
"setupSQL": "<string>"
},
"mysqlConnection": {
"host": "<string>",
"port": 123,
"database": "<string>",
"user": "<string>",
"password": "<string>"
},
"duckdbConnection": {
"attachedDatabases": [
{
"name": "test_connection, _connection, test_connection_1",
"type": "bigquery",
"attributes": {
"dialectName": "<string>",
"isPool": true,
"canPersist": true,
"canStream": true
},
"bigqueryConnection": {
"defaultProjectId": "<string>",
"billingProjectId": "<string>",
"location": "<string>",
"serviceAccountKeyJson": "<string>",
"maximumBytesBilled": "<string>",
"queryTimeoutMilliseconds": "<string>"
},
"snowflakeConnection": {
"account": "<string>",
"username": "<string>",
"password": "<string>",
"privateKey": "<string>",
"privateKeyPass": "<string>",
"warehouse": "<string>",
"database": "<string>",
"schema": "<string>",
"role": "<string>",
"responseTimeoutMilliseconds": 123
},
"postgresConnection": {
"host": "<string>",
"port": 123,
"databaseName": "<string>",
"userName": "<string>",
"password": "<string>",
"connectionString": "<string>",
"sslmode": "disable"
},
"gcsConnection": {
"keyId": "<string>",
"secret": "<string>"
},
"s3Connection": {
"accessKeyId": "<string>",
"secretAccessKey": "<string>",
"region": "us-east-1",
"endpoint": "<string>",
"sessionToken": "<string>"
},
"azureConnection": {
"authType": "service_principal",
"sasUrl": "<string>",
"tenantId": "<string>",
"clientId": "<string>",
"clientSecret": "<string>",
"accountName": "<string>",
"fileUrl": "<string>"
}
}
]
},
"motherduckConnection": {
"accessToken": "<string>",
"database": "<string>"
},
"ducklakeConnection": {
"storage": {
"bucketUrl": "<string>",
"s3Connection": {
"accessKeyId": "<string>",
"secretAccessKey": "<string>",
"region": "us-east-1",
"endpoint": "<string>",
"sessionToken": "<string>"
},
"gcsConnection": {
"keyId": "<string>",
"secret": "<string>"
}
},
"catalog": {
"postgresConnection": {
"host": "<string>",
"port": 123,
"databaseName": "<string>",
"userName": "<string>",
"password": "<string>",
"connectionString": "<string>",
"sslmode": "disable"
}
}
},
"publisherConnection": {
"connectionUri": "<string>",
"accessToken": "<string>"
},
"includeTables": [
"sales.orders",
"finance.*"
],
"excludeAllTables": false,
"excludeTables": [
"backup.records",
"temp_data.*"
],
"indexingStatus": "UNKNOWN",
"indexingStatusLastUpdated": "2023-11-07T05:31:56Z",
"indexingProgress": {
"schemaProgress": {
"tablesTotal": 123,
"tablesProcessing": 123,
"tablesCompleted": 123,
"tablesFailed": 123,
"columnsTotal": 123,
"columnsCompleted": 123
},
"modelSuggestionsProgress": {
"tablesTotal": 123,
"tablesProcessing": 123,
"tablesCompleted": 123,
"tablesFailed": 123,
"joinWorkTotal": 123,
"joinWorkCompleted": 123,
"joinsGenerated": 123,
"dimensionsGenerated": 123,
"measuresGenerated": 123
}
}
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}Create database connection
Creates a new database connection for the specified environment with secure credential storage and connection validation.
Authorization: Requires environment admin permissions. Validation: Tests connection before saving if dryRun is false. Security: Credentials are encrypted and stored securely.
curl --request POST \
--url https://{organization}.admin.credibledata.com/api/v0/organizations/{organizationName}/environments/{environmentName}/connections \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"resource": "<string>",
"name": "<string>",
"fingerprint": "<string>",
"attributes": {
"dialectName": "<string>",
"isPool": true,
"canPersist": true,
"canStream": true
},
"proxy": {
"type": "ssh",
"ssh": {
"host": "<string>",
"port": 22,
"username": "<string>",
"privateKey": "<string>",
"privateKeyPass": "<string>",
"hostKey": "<string>"
}
},
"postgresConnection": {
"host": "<string>",
"port": 123,
"databaseName": "<string>",
"userName": "<string>",
"password": "<string>",
"connectionString": "<string>"
},
"bigqueryConnection": {
"defaultProjectId": "<string>",
"billingProjectId": "<string>",
"location": "<string>",
"serviceAccountKeyJson": "<string>",
"maximumBytesBilled": "<string>",
"queryTimeoutMilliseconds": "<string>"
},
"snowflakeConnection": {
"account": "<string>",
"username": "<string>",
"password": "<string>",
"privateKey": "<string>",
"privateKeyPass": "<string>",
"warehouse": "<string>",
"database": "<string>",
"schema": "<string>",
"role": "<string>",
"responseTimeoutMilliseconds": 123
},
"trinoConnection": {
"server": "<string>",
"port": 123,
"catalog": "<string>",
"schema": "<string>",
"user": "<string>",
"password": "<string>",
"peakaKey": "<string>"
},
"databricksConnection": {
"host": "<string>",
"path": "<string>",
"token": "<string>",
"oauthClientId": "<string>",
"oauthClientSecret": "<string>",
"defaultCatalog": "<string>",
"defaultSchema": "<string>",
"setupSQL": "<string>"
},
"mysqlConnection": {
"host": "<string>",
"port": 123,
"database": "<string>",
"user": "<string>",
"password": "<string>"
},
"duckdbConnection": {
"attachedDatabases": [
{
"name": "test_connection, _connection, test_connection_1",
"attributes": {
"dialectName": "<string>",
"isPool": true,
"canPersist": true,
"canStream": true
},
"bigqueryConnection": {
"defaultProjectId": "<string>",
"billingProjectId": "<string>",
"location": "<string>",
"serviceAccountKeyJson": "<string>",
"maximumBytesBilled": "<string>",
"queryTimeoutMilliseconds": "<string>"
},
"snowflakeConnection": {
"account": "<string>",
"username": "<string>",
"password": "<string>",
"privateKey": "<string>",
"privateKeyPass": "<string>",
"warehouse": "<string>",
"database": "<string>",
"schema": "<string>",
"role": "<string>",
"responseTimeoutMilliseconds": 123
},
"postgresConnection": {
"host": "<string>",
"port": 123,
"databaseName": "<string>",
"userName": "<string>",
"password": "<string>",
"connectionString": "<string>"
}
}
]
},
"motherduckConnection": {
"accessToken": "<string>",
"database": "<string>"
},
"template": "bq_demo",
"includeTables": [
"sales.orders",
"finance.*"
],
"excludeAllTables": false,
"excludeTables": [
"backup.records",
"temp_data.*"
],
"indexingStatusLastUpdated": "2023-11-07T05:31:56Z",
"indexingProgress": {
"schemaProgress": {
"tablesTotal": 123,
"tablesProcessing": 123,
"tablesCompleted": 123,
"tablesFailed": 123,
"columnsTotal": 123,
"columnsCompleted": 123
},
"modelSuggestionsProgress": {
"tablesTotal": 123,
"tablesProcessing": 123,
"tablesCompleted": 123,
"tablesFailed": 123,
"joinWorkTotal": 123,
"joinWorkCompleted": 123,
"joinsGenerated": 123,
"dimensionsGenerated": 123,
"measuresGenerated": 123
}
}
}
'import requests
url = "https://{organization}.admin.credibledata.com/api/v0/organizations/{organizationName}/environments/{environmentName}/connections"
payload = {
"resource": "<string>",
"name": "<string>",
"fingerprint": "<string>",
"attributes": {
"dialectName": "<string>",
"isPool": True,
"canPersist": True,
"canStream": True
},
"proxy": {
"type": "ssh",
"ssh": {
"host": "<string>",
"port": 22,
"username": "<string>",
"privateKey": "<string>",
"privateKeyPass": "<string>",
"hostKey": "<string>"
}
},
"postgresConnection": {
"host": "<string>",
"port": 123,
"databaseName": "<string>",
"userName": "<string>",
"password": "<string>",
"connectionString": "<string>"
},
"bigqueryConnection": {
"defaultProjectId": "<string>",
"billingProjectId": "<string>",
"location": "<string>",
"serviceAccountKeyJson": "<string>",
"maximumBytesBilled": "<string>",
"queryTimeoutMilliseconds": "<string>"
},
"snowflakeConnection": {
"account": "<string>",
"username": "<string>",
"password": "<string>",
"privateKey": "<string>",
"privateKeyPass": "<string>",
"warehouse": "<string>",
"database": "<string>",
"schema": "<string>",
"role": "<string>",
"responseTimeoutMilliseconds": 123
},
"trinoConnection": {
"server": "<string>",
"port": 123,
"catalog": "<string>",
"schema": "<string>",
"user": "<string>",
"password": "<string>",
"peakaKey": "<string>"
},
"databricksConnection": {
"host": "<string>",
"path": "<string>",
"token": "<string>",
"oauthClientId": "<string>",
"oauthClientSecret": "<string>",
"defaultCatalog": "<string>",
"defaultSchema": "<string>",
"setupSQL": "<string>"
},
"mysqlConnection": {
"host": "<string>",
"port": 123,
"database": "<string>",
"user": "<string>",
"password": "<string>"
},
"duckdbConnection": { "attachedDatabases": [
{
"name": "test_connection, _connection, test_connection_1",
"attributes": {
"dialectName": "<string>",
"isPool": True,
"canPersist": True,
"canStream": True
},
"bigqueryConnection": {
"defaultProjectId": "<string>",
"billingProjectId": "<string>",
"location": "<string>",
"serviceAccountKeyJson": "<string>",
"maximumBytesBilled": "<string>",
"queryTimeoutMilliseconds": "<string>"
},
"snowflakeConnection": {
"account": "<string>",
"username": "<string>",
"password": "<string>",
"privateKey": "<string>",
"privateKeyPass": "<string>",
"warehouse": "<string>",
"database": "<string>",
"schema": "<string>",
"role": "<string>",
"responseTimeoutMilliseconds": 123
},
"postgresConnection": {
"host": "<string>",
"port": 123,
"databaseName": "<string>",
"userName": "<string>",
"password": "<string>",
"connectionString": "<string>"
}
}
] },
"motherduckConnection": {
"accessToken": "<string>",
"database": "<string>"
},
"template": "bq_demo",
"includeTables": ["sales.orders", "finance.*"],
"excludeAllTables": False,
"excludeTables": ["backup.records", "temp_data.*"],
"indexingStatusLastUpdated": "2023-11-07T05:31:56Z",
"indexingProgress": {
"schemaProgress": {
"tablesTotal": 123,
"tablesProcessing": 123,
"tablesCompleted": 123,
"tablesFailed": 123,
"columnsTotal": 123,
"columnsCompleted": 123
},
"modelSuggestionsProgress": {
"tablesTotal": 123,
"tablesProcessing": 123,
"tablesCompleted": 123,
"tablesFailed": 123,
"joinWorkTotal": 123,
"joinWorkCompleted": 123,
"joinsGenerated": 123,
"dimensionsGenerated": 123,
"measuresGenerated": 123
}
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
resource: '<string>',
name: '<string>',
fingerprint: '<string>',
attributes: {dialectName: '<string>', isPool: true, canPersist: true, canStream: true},
proxy: {
type: 'ssh',
ssh: {
host: '<string>',
port: 22,
username: '<string>',
privateKey: '<string>',
privateKeyPass: '<string>',
hostKey: '<string>'
}
},
postgresConnection: {
host: '<string>',
port: 123,
databaseName: '<string>',
userName: '<string>',
password: '<string>',
connectionString: '<string>'
},
bigqueryConnection: {
defaultProjectId: '<string>',
billingProjectId: '<string>',
location: '<string>',
serviceAccountKeyJson: '<string>',
maximumBytesBilled: '<string>',
queryTimeoutMilliseconds: '<string>'
},
snowflakeConnection: {
account: '<string>',
username: '<string>',
password: '<string>',
privateKey: '<string>',
privateKeyPass: '<string>',
warehouse: '<string>',
database: '<string>',
schema: '<string>',
role: '<string>',
responseTimeoutMilliseconds: 123
},
trinoConnection: {
server: '<string>',
port: 123,
catalog: '<string>',
schema: '<string>',
user: '<string>',
password: '<string>',
peakaKey: '<string>'
},
databricksConnection: {
host: '<string>',
path: '<string>',
token: '<string>',
oauthClientId: '<string>',
oauthClientSecret: '<string>',
defaultCatalog: '<string>',
defaultSchema: '<string>',
setupSQL: '<string>'
},
mysqlConnection: {
host: '<string>',
port: 123,
database: '<string>',
user: '<string>',
password: '<string>'
},
duckdbConnection: {
attachedDatabases: [
{
name: 'test_connection, _connection, test_connection_1',
attributes: {dialectName: '<string>', isPool: true, canPersist: true, canStream: true},
bigqueryConnection: {
defaultProjectId: '<string>',
billingProjectId: '<string>',
location: '<string>',
serviceAccountKeyJson: '<string>',
maximumBytesBilled: '<string>',
queryTimeoutMilliseconds: '<string>'
},
snowflakeConnection: {
account: '<string>',
username: '<string>',
password: '<string>',
privateKey: '<string>',
privateKeyPass: '<string>',
warehouse: '<string>',
database: '<string>',
schema: '<string>',
role: '<string>',
responseTimeoutMilliseconds: 123
},
postgresConnection: {
host: '<string>',
port: 123,
databaseName: '<string>',
userName: '<string>',
password: '<string>',
connectionString: '<string>'
}
}
]
},
motherduckConnection: {accessToken: '<string>', database: '<string>'},
template: 'bq_demo',
includeTables: ['sales.orders', 'finance.*'],
excludeAllTables: false,
excludeTables: ['backup.records', 'temp_data.*'],
indexingStatusLastUpdated: '2023-11-07T05:31:56Z',
indexingProgress: {
schemaProgress: {
tablesTotal: 123,
tablesProcessing: 123,
tablesCompleted: 123,
tablesFailed: 123,
columnsTotal: 123,
columnsCompleted: 123
},
modelSuggestionsProgress: {
tablesTotal: 123,
tablesProcessing: 123,
tablesCompleted: 123,
tablesFailed: 123,
joinWorkTotal: 123,
joinWorkCompleted: 123,
joinsGenerated: 123,
dimensionsGenerated: 123,
measuresGenerated: 123
}
}
})
};
fetch('https://{organization}.admin.credibledata.com/api/v0/organizations/{organizationName}/environments/{environmentName}/connections', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{organization}.admin.credibledata.com/api/v0/organizations/{organizationName}/environments/{environmentName}/connections",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'resource' => '<string>',
'name' => '<string>',
'fingerprint' => '<string>',
'attributes' => [
'dialectName' => '<string>',
'isPool' => true,
'canPersist' => true,
'canStream' => true
],
'proxy' => [
'type' => 'ssh',
'ssh' => [
'host' => '<string>',
'port' => 22,
'username' => '<string>',
'privateKey' => '<string>',
'privateKeyPass' => '<string>',
'hostKey' => '<string>'
]
],
'postgresConnection' => [
'host' => '<string>',
'port' => 123,
'databaseName' => '<string>',
'userName' => '<string>',
'password' => '<string>',
'connectionString' => '<string>'
],
'bigqueryConnection' => [
'defaultProjectId' => '<string>',
'billingProjectId' => '<string>',
'location' => '<string>',
'serviceAccountKeyJson' => '<string>',
'maximumBytesBilled' => '<string>',
'queryTimeoutMilliseconds' => '<string>'
],
'snowflakeConnection' => [
'account' => '<string>',
'username' => '<string>',
'password' => '<string>',
'privateKey' => '<string>',
'privateKeyPass' => '<string>',
'warehouse' => '<string>',
'database' => '<string>',
'schema' => '<string>',
'role' => '<string>',
'responseTimeoutMilliseconds' => 123
],
'trinoConnection' => [
'server' => '<string>',
'port' => 123,
'catalog' => '<string>',
'schema' => '<string>',
'user' => '<string>',
'password' => '<string>',
'peakaKey' => '<string>'
],
'databricksConnection' => [
'host' => '<string>',
'path' => '<string>',
'token' => '<string>',
'oauthClientId' => '<string>',
'oauthClientSecret' => '<string>',
'defaultCatalog' => '<string>',
'defaultSchema' => '<string>',
'setupSQL' => '<string>'
],
'mysqlConnection' => [
'host' => '<string>',
'port' => 123,
'database' => '<string>',
'user' => '<string>',
'password' => '<string>'
],
'duckdbConnection' => [
'attachedDatabases' => [
[
'name' => 'test_connection, _connection, test_connection_1',
'attributes' => [
'dialectName' => '<string>',
'isPool' => true,
'canPersist' => true,
'canStream' => true
],
'bigqueryConnection' => [
'defaultProjectId' => '<string>',
'billingProjectId' => '<string>',
'location' => '<string>',
'serviceAccountKeyJson' => '<string>',
'maximumBytesBilled' => '<string>',
'queryTimeoutMilliseconds' => '<string>'
],
'snowflakeConnection' => [
'account' => '<string>',
'username' => '<string>',
'password' => '<string>',
'privateKey' => '<string>',
'privateKeyPass' => '<string>',
'warehouse' => '<string>',
'database' => '<string>',
'schema' => '<string>',
'role' => '<string>',
'responseTimeoutMilliseconds' => 123
],
'postgresConnection' => [
'host' => '<string>',
'port' => 123,
'databaseName' => '<string>',
'userName' => '<string>',
'password' => '<string>',
'connectionString' => '<string>'
]
]
]
],
'motherduckConnection' => [
'accessToken' => '<string>',
'database' => '<string>'
],
'template' => 'bq_demo',
'includeTables' => [
'sales.orders',
'finance.*'
],
'excludeAllTables' => false,
'excludeTables' => [
'backup.records',
'temp_data.*'
],
'indexingStatusLastUpdated' => '2023-11-07T05:31:56Z',
'indexingProgress' => [
'schemaProgress' => [
'tablesTotal' => 123,
'tablesProcessing' => 123,
'tablesCompleted' => 123,
'tablesFailed' => 123,
'columnsTotal' => 123,
'columnsCompleted' => 123
],
'modelSuggestionsProgress' => [
'tablesTotal' => 123,
'tablesProcessing' => 123,
'tablesCompleted' => 123,
'tablesFailed' => 123,
'joinWorkTotal' => 123,
'joinWorkCompleted' => 123,
'joinsGenerated' => 123,
'dimensionsGenerated' => 123,
'measuresGenerated' => 123
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{organization}.admin.credibledata.com/api/v0/organizations/{organizationName}/environments/{environmentName}/connections"
payload := strings.NewReader("{\n \"resource\": \"<string>\",\n \"name\": \"<string>\",\n \"fingerprint\": \"<string>\",\n \"attributes\": {\n \"dialectName\": \"<string>\",\n \"isPool\": true,\n \"canPersist\": true,\n \"canStream\": true\n },\n \"proxy\": {\n \"type\": \"ssh\",\n \"ssh\": {\n \"host\": \"<string>\",\n \"port\": 22,\n \"username\": \"<string>\",\n \"privateKey\": \"<string>\",\n \"privateKeyPass\": \"<string>\",\n \"hostKey\": \"<string>\"\n }\n },\n \"postgresConnection\": {\n \"host\": \"<string>\",\n \"port\": 123,\n \"databaseName\": \"<string>\",\n \"userName\": \"<string>\",\n \"password\": \"<string>\",\n \"connectionString\": \"<string>\"\n },\n \"bigqueryConnection\": {\n \"defaultProjectId\": \"<string>\",\n \"billingProjectId\": \"<string>\",\n \"location\": \"<string>\",\n \"serviceAccountKeyJson\": \"<string>\",\n \"maximumBytesBilled\": \"<string>\",\n \"queryTimeoutMilliseconds\": \"<string>\"\n },\n \"snowflakeConnection\": {\n \"account\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"privateKey\": \"<string>\",\n \"privateKeyPass\": \"<string>\",\n \"warehouse\": \"<string>\",\n \"database\": \"<string>\",\n \"schema\": \"<string>\",\n \"role\": \"<string>\",\n \"responseTimeoutMilliseconds\": 123\n },\n \"trinoConnection\": {\n \"server\": \"<string>\",\n \"port\": 123,\n \"catalog\": \"<string>\",\n \"schema\": \"<string>\",\n \"user\": \"<string>\",\n \"password\": \"<string>\",\n \"peakaKey\": \"<string>\"\n },\n \"databricksConnection\": {\n \"host\": \"<string>\",\n \"path\": \"<string>\",\n \"token\": \"<string>\",\n \"oauthClientId\": \"<string>\",\n \"oauthClientSecret\": \"<string>\",\n \"defaultCatalog\": \"<string>\",\n \"defaultSchema\": \"<string>\",\n \"setupSQL\": \"<string>\"\n },\n \"mysqlConnection\": {\n \"host\": \"<string>\",\n \"port\": 123,\n \"database\": \"<string>\",\n \"user\": \"<string>\",\n \"password\": \"<string>\"\n },\n \"duckdbConnection\": {\n \"attachedDatabases\": [\n {\n \"name\": \"test_connection, _connection, test_connection_1\",\n \"attributes\": {\n \"dialectName\": \"<string>\",\n \"isPool\": true,\n \"canPersist\": true,\n \"canStream\": true\n },\n \"bigqueryConnection\": {\n \"defaultProjectId\": \"<string>\",\n \"billingProjectId\": \"<string>\",\n \"location\": \"<string>\",\n \"serviceAccountKeyJson\": \"<string>\",\n \"maximumBytesBilled\": \"<string>\",\n \"queryTimeoutMilliseconds\": \"<string>\"\n },\n \"snowflakeConnection\": {\n \"account\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"privateKey\": \"<string>\",\n \"privateKeyPass\": \"<string>\",\n \"warehouse\": \"<string>\",\n \"database\": \"<string>\",\n \"schema\": \"<string>\",\n \"role\": \"<string>\",\n \"responseTimeoutMilliseconds\": 123\n },\n \"postgresConnection\": {\n \"host\": \"<string>\",\n \"port\": 123,\n \"databaseName\": \"<string>\",\n \"userName\": \"<string>\",\n \"password\": \"<string>\",\n \"connectionString\": \"<string>\"\n }\n }\n ]\n },\n \"motherduckConnection\": {\n \"accessToken\": \"<string>\",\n \"database\": \"<string>\"\n },\n \"template\": \"bq_demo\",\n \"includeTables\": [\n \"sales.orders\",\n \"finance.*\"\n ],\n \"excludeAllTables\": false,\n \"excludeTables\": [\n \"backup.records\",\n \"temp_data.*\"\n ],\n \"indexingStatusLastUpdated\": \"2023-11-07T05:31:56Z\",\n \"indexingProgress\": {\n \"schemaProgress\": {\n \"tablesTotal\": 123,\n \"tablesProcessing\": 123,\n \"tablesCompleted\": 123,\n \"tablesFailed\": 123,\n \"columnsTotal\": 123,\n \"columnsCompleted\": 123\n },\n \"modelSuggestionsProgress\": {\n \"tablesTotal\": 123,\n \"tablesProcessing\": 123,\n \"tablesCompleted\": 123,\n \"tablesFailed\": 123,\n \"joinWorkTotal\": 123,\n \"joinWorkCompleted\": 123,\n \"joinsGenerated\": 123,\n \"dimensionsGenerated\": 123,\n \"measuresGenerated\": 123\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{organization}.admin.credibledata.com/api/v0/organizations/{organizationName}/environments/{environmentName}/connections")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"resource\": \"<string>\",\n \"name\": \"<string>\",\n \"fingerprint\": \"<string>\",\n \"attributes\": {\n \"dialectName\": \"<string>\",\n \"isPool\": true,\n \"canPersist\": true,\n \"canStream\": true\n },\n \"proxy\": {\n \"type\": \"ssh\",\n \"ssh\": {\n \"host\": \"<string>\",\n \"port\": 22,\n \"username\": \"<string>\",\n \"privateKey\": \"<string>\",\n \"privateKeyPass\": \"<string>\",\n \"hostKey\": \"<string>\"\n }\n },\n \"postgresConnection\": {\n \"host\": \"<string>\",\n \"port\": 123,\n \"databaseName\": \"<string>\",\n \"userName\": \"<string>\",\n \"password\": \"<string>\",\n \"connectionString\": \"<string>\"\n },\n \"bigqueryConnection\": {\n \"defaultProjectId\": \"<string>\",\n \"billingProjectId\": \"<string>\",\n \"location\": \"<string>\",\n \"serviceAccountKeyJson\": \"<string>\",\n \"maximumBytesBilled\": \"<string>\",\n \"queryTimeoutMilliseconds\": \"<string>\"\n },\n \"snowflakeConnection\": {\n \"account\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"privateKey\": \"<string>\",\n \"privateKeyPass\": \"<string>\",\n \"warehouse\": \"<string>\",\n \"database\": \"<string>\",\n \"schema\": \"<string>\",\n \"role\": \"<string>\",\n \"responseTimeoutMilliseconds\": 123\n },\n \"trinoConnection\": {\n \"server\": \"<string>\",\n \"port\": 123,\n \"catalog\": \"<string>\",\n \"schema\": \"<string>\",\n \"user\": \"<string>\",\n \"password\": \"<string>\",\n \"peakaKey\": \"<string>\"\n },\n \"databricksConnection\": {\n \"host\": \"<string>\",\n \"path\": \"<string>\",\n \"token\": \"<string>\",\n \"oauthClientId\": \"<string>\",\n \"oauthClientSecret\": \"<string>\",\n \"defaultCatalog\": \"<string>\",\n \"defaultSchema\": \"<string>\",\n \"setupSQL\": \"<string>\"\n },\n \"mysqlConnection\": {\n \"host\": \"<string>\",\n \"port\": 123,\n \"database\": \"<string>\",\n \"user\": \"<string>\",\n \"password\": \"<string>\"\n },\n \"duckdbConnection\": {\n \"attachedDatabases\": [\n {\n \"name\": \"test_connection, _connection, test_connection_1\",\n \"attributes\": {\n \"dialectName\": \"<string>\",\n \"isPool\": true,\n \"canPersist\": true,\n \"canStream\": true\n },\n \"bigqueryConnection\": {\n \"defaultProjectId\": \"<string>\",\n \"billingProjectId\": \"<string>\",\n \"location\": \"<string>\",\n \"serviceAccountKeyJson\": \"<string>\",\n \"maximumBytesBilled\": \"<string>\",\n \"queryTimeoutMilliseconds\": \"<string>\"\n },\n \"snowflakeConnection\": {\n \"account\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"privateKey\": \"<string>\",\n \"privateKeyPass\": \"<string>\",\n \"warehouse\": \"<string>\",\n \"database\": \"<string>\",\n \"schema\": \"<string>\",\n \"role\": \"<string>\",\n \"responseTimeoutMilliseconds\": 123\n },\n \"postgresConnection\": {\n \"host\": \"<string>\",\n \"port\": 123,\n \"databaseName\": \"<string>\",\n \"userName\": \"<string>\",\n \"password\": \"<string>\",\n \"connectionString\": \"<string>\"\n }\n }\n ]\n },\n \"motherduckConnection\": {\n \"accessToken\": \"<string>\",\n \"database\": \"<string>\"\n },\n \"template\": \"bq_demo\",\n \"includeTables\": [\n \"sales.orders\",\n \"finance.*\"\n ],\n \"excludeAllTables\": false,\n \"excludeTables\": [\n \"backup.records\",\n \"temp_data.*\"\n ],\n \"indexingStatusLastUpdated\": \"2023-11-07T05:31:56Z\",\n \"indexingProgress\": {\n \"schemaProgress\": {\n \"tablesTotal\": 123,\n \"tablesProcessing\": 123,\n \"tablesCompleted\": 123,\n \"tablesFailed\": 123,\n \"columnsTotal\": 123,\n \"columnsCompleted\": 123\n },\n \"modelSuggestionsProgress\": {\n \"tablesTotal\": 123,\n \"tablesProcessing\": 123,\n \"tablesCompleted\": 123,\n \"tablesFailed\": 123,\n \"joinWorkTotal\": 123,\n \"joinWorkCompleted\": 123,\n \"joinsGenerated\": 123,\n \"dimensionsGenerated\": 123,\n \"measuresGenerated\": 123\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{organization}.admin.credibledata.com/api/v0/organizations/{organizationName}/environments/{environmentName}/connections")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"resource\": \"<string>\",\n \"name\": \"<string>\",\n \"fingerprint\": \"<string>\",\n \"attributes\": {\n \"dialectName\": \"<string>\",\n \"isPool\": true,\n \"canPersist\": true,\n \"canStream\": true\n },\n \"proxy\": {\n \"type\": \"ssh\",\n \"ssh\": {\n \"host\": \"<string>\",\n \"port\": 22,\n \"username\": \"<string>\",\n \"privateKey\": \"<string>\",\n \"privateKeyPass\": \"<string>\",\n \"hostKey\": \"<string>\"\n }\n },\n \"postgresConnection\": {\n \"host\": \"<string>\",\n \"port\": 123,\n \"databaseName\": \"<string>\",\n \"userName\": \"<string>\",\n \"password\": \"<string>\",\n \"connectionString\": \"<string>\"\n },\n \"bigqueryConnection\": {\n \"defaultProjectId\": \"<string>\",\n \"billingProjectId\": \"<string>\",\n \"location\": \"<string>\",\n \"serviceAccountKeyJson\": \"<string>\",\n \"maximumBytesBilled\": \"<string>\",\n \"queryTimeoutMilliseconds\": \"<string>\"\n },\n \"snowflakeConnection\": {\n \"account\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"privateKey\": \"<string>\",\n \"privateKeyPass\": \"<string>\",\n \"warehouse\": \"<string>\",\n \"database\": \"<string>\",\n \"schema\": \"<string>\",\n \"role\": \"<string>\",\n \"responseTimeoutMilliseconds\": 123\n },\n \"trinoConnection\": {\n \"server\": \"<string>\",\n \"port\": 123,\n \"catalog\": \"<string>\",\n \"schema\": \"<string>\",\n \"user\": \"<string>\",\n \"password\": \"<string>\",\n \"peakaKey\": \"<string>\"\n },\n \"databricksConnection\": {\n \"host\": \"<string>\",\n \"path\": \"<string>\",\n \"token\": \"<string>\",\n \"oauthClientId\": \"<string>\",\n \"oauthClientSecret\": \"<string>\",\n \"defaultCatalog\": \"<string>\",\n \"defaultSchema\": \"<string>\",\n \"setupSQL\": \"<string>\"\n },\n \"mysqlConnection\": {\n \"host\": \"<string>\",\n \"port\": 123,\n \"database\": \"<string>\",\n \"user\": \"<string>\",\n \"password\": \"<string>\"\n },\n \"duckdbConnection\": {\n \"attachedDatabases\": [\n {\n \"name\": \"test_connection, _connection, test_connection_1\",\n \"attributes\": {\n \"dialectName\": \"<string>\",\n \"isPool\": true,\n \"canPersist\": true,\n \"canStream\": true\n },\n \"bigqueryConnection\": {\n \"defaultProjectId\": \"<string>\",\n \"billingProjectId\": \"<string>\",\n \"location\": \"<string>\",\n \"serviceAccountKeyJson\": \"<string>\",\n \"maximumBytesBilled\": \"<string>\",\n \"queryTimeoutMilliseconds\": \"<string>\"\n },\n \"snowflakeConnection\": {\n \"account\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"privateKey\": \"<string>\",\n \"privateKeyPass\": \"<string>\",\n \"warehouse\": \"<string>\",\n \"database\": \"<string>\",\n \"schema\": \"<string>\",\n \"role\": \"<string>\",\n \"responseTimeoutMilliseconds\": 123\n },\n \"postgresConnection\": {\n \"host\": \"<string>\",\n \"port\": 123,\n \"databaseName\": \"<string>\",\n \"userName\": \"<string>\",\n \"password\": \"<string>\",\n \"connectionString\": \"<string>\"\n }\n }\n ]\n },\n \"motherduckConnection\": {\n \"accessToken\": \"<string>\",\n \"database\": \"<string>\"\n },\n \"template\": \"bq_demo\",\n \"includeTables\": [\n \"sales.orders\",\n \"finance.*\"\n ],\n \"excludeAllTables\": false,\n \"excludeTables\": [\n \"backup.records\",\n \"temp_data.*\"\n ],\n \"indexingStatusLastUpdated\": \"2023-11-07T05:31:56Z\",\n \"indexingProgress\": {\n \"schemaProgress\": {\n \"tablesTotal\": 123,\n \"tablesProcessing\": 123,\n \"tablesCompleted\": 123,\n \"tablesFailed\": 123,\n \"columnsTotal\": 123,\n \"columnsCompleted\": 123\n },\n \"modelSuggestionsProgress\": {\n \"tablesTotal\": 123,\n \"tablesProcessing\": 123,\n \"tablesCompleted\": 123,\n \"tablesFailed\": 123,\n \"joinWorkTotal\": 123,\n \"joinWorkCompleted\": 123,\n \"joinsGenerated\": 123,\n \"dimensionsGenerated\": 123,\n \"measuresGenerated\": 123\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"resource": "<string>",
"name": "<string>",
"type": "postgres",
"fingerprint": "<string>",
"attributes": {
"dialectName": "<string>",
"isPool": true,
"canPersist": true,
"canStream": true
},
"proxy": {
"type": "ssh",
"ssh": {
"host": "<string>",
"port": 22,
"username": "<string>",
"privateKey": "<string>",
"privateKeyPass": "<string>",
"hostKey": "<string>"
}
},
"postgresConnection": {
"host": "<string>",
"port": 123,
"databaseName": "<string>",
"userName": "<string>",
"password": "<string>",
"connectionString": "<string>",
"sslmode": "disable"
},
"bigqueryConnection": {
"defaultProjectId": "<string>",
"billingProjectId": "<string>",
"location": "<string>",
"serviceAccountKeyJson": "<string>",
"maximumBytesBilled": "<string>",
"queryTimeoutMilliseconds": "<string>"
},
"snowflakeConnection": {
"account": "<string>",
"username": "<string>",
"password": "<string>",
"privateKey": "<string>",
"privateKeyPass": "<string>",
"warehouse": "<string>",
"database": "<string>",
"schema": "<string>",
"role": "<string>",
"responseTimeoutMilliseconds": 123
},
"trinoConnection": {
"server": "<string>",
"port": 123,
"catalog": "<string>",
"schema": "<string>",
"user": "<string>",
"password": "<string>",
"peakaKey": "<string>"
},
"databricksConnection": {
"host": "<string>",
"path": "<string>",
"token": "<string>",
"oauthClientId": "<string>",
"oauthClientSecret": "<string>",
"defaultCatalog": "<string>",
"defaultSchema": "<string>",
"setupSQL": "<string>"
},
"mysqlConnection": {
"host": "<string>",
"port": 123,
"database": "<string>",
"user": "<string>",
"password": "<string>"
},
"duckdbConnection": {
"attachedDatabases": [
{
"name": "test_connection, _connection, test_connection_1",
"type": "bigquery",
"attributes": {
"dialectName": "<string>",
"isPool": true,
"canPersist": true,
"canStream": true
},
"bigqueryConnection": {
"defaultProjectId": "<string>",
"billingProjectId": "<string>",
"location": "<string>",
"serviceAccountKeyJson": "<string>",
"maximumBytesBilled": "<string>",
"queryTimeoutMilliseconds": "<string>"
},
"snowflakeConnection": {
"account": "<string>",
"username": "<string>",
"password": "<string>",
"privateKey": "<string>",
"privateKeyPass": "<string>",
"warehouse": "<string>",
"database": "<string>",
"schema": "<string>",
"role": "<string>",
"responseTimeoutMilliseconds": 123
},
"postgresConnection": {
"host": "<string>",
"port": 123,
"databaseName": "<string>",
"userName": "<string>",
"password": "<string>",
"connectionString": "<string>",
"sslmode": "disable"
},
"gcsConnection": {
"keyId": "<string>",
"secret": "<string>"
},
"s3Connection": {
"accessKeyId": "<string>",
"secretAccessKey": "<string>",
"region": "us-east-1",
"endpoint": "<string>",
"sessionToken": "<string>"
},
"azureConnection": {
"authType": "service_principal",
"sasUrl": "<string>",
"tenantId": "<string>",
"clientId": "<string>",
"clientSecret": "<string>",
"accountName": "<string>",
"fileUrl": "<string>"
}
}
]
},
"motherduckConnection": {
"accessToken": "<string>",
"database": "<string>"
},
"ducklakeConnection": {
"storage": {
"bucketUrl": "<string>",
"s3Connection": {
"accessKeyId": "<string>",
"secretAccessKey": "<string>",
"region": "us-east-1",
"endpoint": "<string>",
"sessionToken": "<string>"
},
"gcsConnection": {
"keyId": "<string>",
"secret": "<string>"
}
},
"catalog": {
"postgresConnection": {
"host": "<string>",
"port": 123,
"databaseName": "<string>",
"userName": "<string>",
"password": "<string>",
"connectionString": "<string>",
"sslmode": "disable"
}
}
},
"publisherConnection": {
"connectionUri": "<string>",
"accessToken": "<string>"
},
"includeTables": [
"sales.orders",
"finance.*"
],
"excludeAllTables": false,
"excludeTables": [
"backup.records",
"temp_data.*"
],
"indexingStatus": "UNKNOWN",
"indexingStatusLastUpdated": "2023-11-07T05:31:56Z",
"indexingProgress": {
"schemaProgress": {
"tablesTotal": 123,
"tablesProcessing": 123,
"tablesCompleted": 123,
"tablesFailed": 123,
"columnsTotal": 123,
"columnsCompleted": 123
},
"modelSuggestionsProgress": {
"tablesTotal": 123,
"tablesProcessing": 123,
"tablesCompleted": 123,
"tablesFailed": 123,
"joinWorkTotal": 123,
"joinWorkCompleted": 123,
"joinsGenerated": 123,
"dimensionsGenerated": 123,
"measuresGenerated": 123
}
}
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The unique identifier of the organization Standard identifier pattern for resource names
^[a-zA-Z0-9_ -]+$The unique identifier of the environment Standard identifier pattern for resource names
^[a-zA-Z0-9_ -]+$Query Parameters
Whether to test the connection without saving it
Body
Database connection configuration and metadata
Resource path to the connection
Name of the connection
Type of database connection
postgres, bigquery, snowflake, trino, databricks, mysql, duckdb, motherduck, ducklake, publisher Optional, opaque, stable fingerprint of this connection's data identity. It is a hash of the configuration that determines which data the connection reaches (its data-locating settings), and deliberately excludes credentials and other secret values, so it stays constant across credential rotation and changes only when the connection is pointed at different data. When present, it is used as this connection's contribution to content-addressed build identifiers so that builds re-address only when the underlying data identity actually changes; consumers should treat it as an opaque token and use the supplied value verbatim rather than deriving their own. This field is optional — when omitted, a connection identity is derived locally instead.
Connection capabilities and configuration attributes
Show child attributes
Show child attributes
Optional network proxy through which the connection is reached. Applies to any connection type whose database is not directly reachable (e.g. behind a bastion). The proxy is established below the driver, so the driver connects to a local endpoint transparently. Modeled as a discriminated union on type so additional proxy mechanisms can be added later.
Show child attributes
Show child attributes
PostgreSQL database connection configuration
Show child attributes
Show child attributes
Google BigQuery database connection configuration
Show child attributes
Show child attributes
Snowflake database connection configuration
Show child attributes
Show child attributes
Trino database connection configuration
Show child attributes
Show child attributes
Databricks SQL warehouse connection configuration
Show child attributes
Show child attributes
MySQL database connection configuration
Show child attributes
Show child attributes
DuckDB database connection configuration. Publisher intentionally exposes only data-source intent here. Database files, working directories, filesystem/network policy, extension loading, setup SQL, temp directories, and resource knobs are owned by Publisher so environment configs cannot widen deployment policy through low-level DuckDB settings.
Show child attributes
Show child attributes
MotherDuck database connection configuration
Show child attributes
Show child attributes
DuckLake lakehouse connection configuration
Show child attributes
Show child attributes
Malloy Publisher proxy connection. Proxies SQL to a remote Publisher dataplane instead of connecting to a warehouse directly. The remote dataplane owns authentication, access control, and read-only enforcement.
Show child attributes
Show child attributes
Create this connection from a managed sample template instead of supplying credentials. The server fills the connection type, configuration, and credentials from the named template (currently only bq_demo, our sample BigQuery dataset); any credential or table fields in the request are ignored and the connection name defaults to the template name when omitted. Create-only: never stored or returned.
bq_demo The list of tables to include, in the format {dataset/schema}.{table}. The first part represents the dataset or schema, and the second part is the table name. The second part can be a literal * to include all tables.
Table name pattern matching {schema}.{table}, {schema}., {catalog}.{schema}.{table}, or {catalog}.{schema}.
^(?:[a-zA-Z0-9_-]+\.)?[a-zA-Z0-9_-]+\.(?:[a-zA-Z0-9_-]+|\*)$["sales.orders", "finance.*"]
Whether to exclude all tables.
The list of tables to exclude, in the format {dataset/schema}.{table}. The first part represents the dataset or schema, and the second part is the table name. The second part can be a literal * to exclude all tables.
Table name pattern matching {schema}.{table}, {schema}., {catalog}.{schema}.{table}, or {catalog}.{schema}.
^(?:[a-zA-Z0-9_-]+\.)?[a-zA-Z0-9_-]+\.(?:[a-zA-Z0-9_-]+|\*)$["backup.records", "temp_data.*"]
Current indexing status of the connection. UNKNOWN means indexing is queued and starts automatically on creation (no manual action; "Start indexing" is an optional re-trigger). SCHEMA_INDEXING means schema indexing is in progress, MODEL_SUGGESTION_INDEXING means schema indexing finished (schema search is usable) and the model-suggestions pipeline is generating dimensions/measures/joins, INDEXED means both pipelines finished, SKIPPED means the connection is excluded from indexing, FAILED means schema indexing failed, RETRY means the connection was updated while indexing was in progress and will be re-indexed when the current job finishes.
UNKNOWN, SCHEMA_INDEXING, INDEXED, SKIPPED, FAILED, RETRY, MODEL_SUGGESTION_INDEXING ISO 8601 timestamp of when the indexing status was last updated
Aggregate per-pipeline indexing progress for a connection, polled from the entity-indexing service while the connection is being indexed. Populated on the single-connection read while indexing is in progress (SCHEMA_INDEXING / MODEL_SUGGESTION_INDEXING); null once INDEXED or when progress is unavailable.
Show child attributes
Show child attributes
Response
Connection created successfully
Database connection configuration and metadata
Resource path to the connection
Name of the connection
Type of database connection
postgres, bigquery, snowflake, trino, databricks, mysql, duckdb, motherduck, ducklake, publisher Optional, opaque, stable fingerprint of this connection's data identity. It is a hash of the configuration that determines which data the connection reaches (its data-locating settings), and deliberately excludes credentials and other secret values, so it stays constant across credential rotation and changes only when the connection is pointed at different data. When present, it is used as this connection's contribution to content-addressed build identifiers so that builds re-address only when the underlying data identity actually changes; consumers should treat it as an opaque token and use the supplied value verbatim rather than deriving their own. This field is optional — when omitted, a connection identity is derived locally instead.
Connection capabilities and configuration attributes
Show child attributes
Show child attributes
Optional network proxy through which the connection is reached. Applies to any connection type whose database is not directly reachable (e.g. behind a bastion). The proxy is established below the driver, so the driver connects to a local endpoint transparently. Modeled as a discriminated union on type so additional proxy mechanisms can be added later.
Show child attributes
Show child attributes
PostgreSQL database connection configuration
Show child attributes
Show child attributes
Google BigQuery database connection configuration
Show child attributes
Show child attributes
Snowflake database connection configuration
Show child attributes
Show child attributes
Trino database connection configuration
Show child attributes
Show child attributes
Databricks SQL warehouse connection configuration
Show child attributes
Show child attributes
MySQL database connection configuration
Show child attributes
Show child attributes
DuckDB database connection configuration. Publisher intentionally exposes only data-source intent here. Database files, working directories, filesystem/network policy, extension loading, setup SQL, temp directories, and resource knobs are owned by Publisher so environment configs cannot widen deployment policy through low-level DuckDB settings.
Show child attributes
Show child attributes
MotherDuck database connection configuration
Show child attributes
Show child attributes
DuckLake lakehouse connection configuration
Show child attributes
Show child attributes
Malloy Publisher proxy connection. Proxies SQL to a remote Publisher dataplane instead of connecting to a warehouse directly. The remote dataplane owns authentication, access control, and read-only enforcement.
Show child attributes
Show child attributes
The list of tables to include, in the format {dataset/schema}.{table}. The first part represents the dataset or schema, and the second part is the table name. The second part can be a literal * to include all tables.
Table name pattern matching {schema}.{table}, {schema}., {catalog}.{schema}.{table}, or {catalog}.{schema}.
^(?:[a-zA-Z0-9_-]+\.)?[a-zA-Z0-9_-]+\.(?:[a-zA-Z0-9_-]+|\*)$["sales.orders", "finance.*"]
Whether to exclude all tables.
The list of tables to exclude, in the format {dataset/schema}.{table}. The first part represents the dataset or schema, and the second part is the table name. The second part can be a literal * to exclude all tables.
Table name pattern matching {schema}.{table}, {schema}., {catalog}.{schema}.{table}, or {catalog}.{schema}.
^(?:[a-zA-Z0-9_-]+\.)?[a-zA-Z0-9_-]+\.(?:[a-zA-Z0-9_-]+|\*)$["backup.records", "temp_data.*"]
Current indexing status of the connection. UNKNOWN means indexing is queued and starts automatically on creation (no manual action; "Start indexing" is an optional re-trigger). SCHEMA_INDEXING means schema indexing is in progress, MODEL_SUGGESTION_INDEXING means schema indexing finished (schema search is usable) and the model-suggestions pipeline is generating dimensions/measures/joins, INDEXED means both pipelines finished, SKIPPED means the connection is excluded from indexing, FAILED means schema indexing failed, RETRY means the connection was updated while indexing was in progress and will be re-indexed when the current job finishes.
UNKNOWN, SCHEMA_INDEXING, INDEXED, SKIPPED, FAILED, RETRY, MODEL_SUGGESTION_INDEXING ISO 8601 timestamp of when the indexing status was last updated
Aggregate per-pipeline indexing progress for a connection, polled from the entity-indexing service while the connection is being indexed. Populated on the single-connection read while indexing is in progress (SCHEMA_INDEXING / MODEL_SUGGESTION_INDEXING); null once INDEXED or when progress is unavailable.
Show child attributes
Show child attributes
Was this page helpful?