Create a connection
/api/20210901/catalog/connections
Request
There are no request parameters for this operation.
- application/json
object
Response
- application/json
200 Response
object
-
connectionId(required): string
The ID of the connection with Base64 encoding. To be used as a parameter when retrieving details, verifying, modifying or deleting this connection.
400 Response
object
-
code(required): string
Short error code that defines the error, meant for programmatic parsing.
-
message(required): string
Human-readable error string.
401 Response
object
-
code(required): string
Short error code that defines the error, meant for programmatic parsing.
-
message(required): string
Human-readable error string.
403 Response
object
-
code(required): string
Short error code that defines the error, meant for programmatic parsing.
-
message(required): string
Human-readable error string.
409 Response
object
-
code(required): string
Short error code that defines the error, meant for programmatic parsing.
-
message(required): string
Human-readable error string.
500 Response
object
-
code(required): string
Short error code that defines the error, meant for programmatic parsing.
-
message(required): string
Human-readable error string.
Examples
These examples show you how to create a connection to Oracle Autonomous Data Warehouse (ADW) from your Oracle Analytics instance.
- Example 1 - Create a wallet-less (TLS) connection to Oracle ADW
- Example 2 - Create a connection to Oracle ADW that uses a credentials wallet file
cwallet.sso
(Mutual TLS)
Note:
The JSON payload described in this topic is specific to Oracle ADW. The JSON payload format is different for other data sources. See Sample JSON Payloads for Supported Data Sources.
Example 1 Create a wallet-less (TLS) connection to ADW
In this example, you create a connection named oracle_adw_walletless
. The
request includes a simple JSON body (application/json
).
cURL Example
create_adw_walletless_connection.json
that contains a payload that looks
like
this.{ "version": "2.0.0", "type": "connection", "name": "oracle_adw_walletless", "description": "Sample Oracle ADW connection without a wallet created using Connections API", "content": { "connectionParams": { "connectionType": "oracle-autonomous-data-warehouse", "connectionString": "(description= (retry_count=20)(retry_delay=3)(address=(protocol=tcps)(port=1521)(host=adb.us-ashburn-1.oraclecloud.com))(connect_data=(service_name=abcdefg1hijkl2m_adwwalletless_high.adb.oraclecloud.com))(security=(ssl_server_dn_match=yes)))", "username": "ADMIN", "password": "<<password>>", "systemConnection": false, "remoteData": false, "sslType": "ServerSideSSL" } } }
Then run the cURL command calling the JSON file (for example, create_adw_walletless_connection.json
):
curl -i \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --request POST 'https://<hostname>/api/20210901/catalog/connections' \ --data @create_adw_walletless_connection.json
Example of Response Header
Not applicable.
Example of Response Body
Make a note of the Base64 encoded connectionId
in the response body. Later
on, you can use this value to update or delete this connection.
{"connectionID":"J0FkbWluJy4nb3JhY2xlX2Fkd193YWxsZXRsZXNzJw=="}
Example 2 Create a connection to ADW that uses a wallet file (Mutual TLS)
In this example, you create a connection named oracle_adw_with_wallet
.
The request body includes multipart/form-data
, that is, requires both a
wallet file cwallet.sso
and ADW connection parameters.
cURL Example
Obtain the credentials wallet file from Oracle Autonomous Data Warehouse. See Download Client Credentials (Wallets).
{ "version": "2.0.0", "type": "connection", "name": "oracle_adw_with_wallet", "description": "Sample Oracle ADW connection with a wallet created using Connections API", "content": { "connectionParams": { "connectionType": "oracle-autonomous-data-warehouse", "connectionString": "(description= (retry_count=20)(retry_delay=3)(address=(protocol=tcps) (port=1522)(host=adb.us-ashburn-1.oraclecloud.com))(connect_data=(service_name=abcdefg1hijkl2m_walletadw_high.adwc.oraclecloud.com/))(security=(ssl_server_dn_match=yes)))", "username": "ADMIN", "password": "<<password>>", "remoteData": "false", "systemConnection": false, "sslType": "ClientSideSSL" } } }
Run the cURL command including the wallet file (cwallet.sso
) and the
connection properties.
curl -i \ --header 'Authorization: Bearer <token>' \ --request POST 'https://<hostname>/api/20210901/catalog/connections' \ --form 'cert=@"/Users/scott/Downloads/Wallet_adw/cwallet.sso"' \ --form 'connectionParams= "{ \ "version": "2.0.0", \ "type": "connection", \ "name": "oracle_adw_with_wallet", \ "description": \ "Sample Oracle ADW connection with a wallet created using Connections API", \ "content": { \ "connectionParams": { \ "connectionType": "oracle-autonomous-data-warehouse",\ "connectionString": "(description= (retry_count=20)(retry_delay=3)(address=(protocol=tcps) (port=1522)(host=adb.us-ashburn-1.oraclecloud.com))(connect_data=(service_name=abcdefg1hijkl2m_walletadw_high.adwc.oraclecloud.com/))(security=(ssl_server_dn_match=yes)))", \ "username": "ADMIN", \ "password": "<<password>>", \ "remoteData": "false", \ "systemConnection": false, \ "sslType": "ClientSideSSL" \ } } }'
Example of Response Header
Not applicable.
Example of Response Body
Make a note of the Base64 encoded connectionId
in the response body. Later
on, you can use this value to update or delete this connection.
{"connectionID":"J2FkbWluJy4nb3JhY2xlX2Fkd193aXRoX3dhbGxldCc="}