Creating a connection
Use the Connectivity interface to define, test, and manage IBM® Optim Data Privacy connections to supported databases.
- Who can complete this task?
-
Administrators or users can create connections. Standard users can see and work only with the connections that they created. Administrators can see and work with all connections in the system, regardless of who created them.
Before you begin
Ensure that the following prerequisites are met:
- You have valid credentials for the target data source.
- Network access to the data source is configured.
- SSL certificates are available and Base64-encoded if secure connections are required.
Creating a connection from the user interface
You can create and configure a new database connection from the Connectivity interface.
To create a connection:
- From the navigation menu, click
Connections, then click New connection.
- Select the database type from the list of available databases. To see technical preview connections, enable the Tech preview option on the new connection page. Click Next.
- Enter the connection information in the sections Connection overview, Connection details, and Credentials. Under the Certificates section, enable SSL and upload the certificate if a secure connection is required.
- Click Test connection to validate credentials and connectivity.
- Click Create to save the connection after a successful test.
- To edit a connection, open the Options menu for the connection and select Edit. Update any fields that can be updated, re-enter the password, and click Save to apply the changes.
- To delete a connection, open the Options menu for the connection and select Delete. Click Delete to confirm.
Creating a connection by using the API
You can also create a database connection by using the IBM Optim API.
- For API usage, ensure that the following prerequisites are in place:
- You have a valid access token (
<accessToken>). For more information, see Retrieving access tokens for API usage. - You understand which connection properties are required for your database type. The following
fields are mandatory for all connections:
database,host,username,password, andtype.
- You have a valid access token (
To use the API to set up a connection:
- To create a new connection profile, send a
POSTrequest tohttps://VM_HOSTNAME:PORT/optim/v1/connprofilesusing the required headers and a JSON payload with connection details.- Headers
-
Authorization: Bearer <accessToken> Content-Type: application/json
- Request body
-
{ "connection": { "name": "<connectionName>", "properties": { "type": "postgres", "host": "db.example.com", "port": "5432", "database": "mydb", "username": "dbuser", "password": "your_password", "ssl": "true", "ssl_certificate": "<base64EncodedCert>", "ssl_certificate_validation": "true" } } }
This sample demonstrates a PostgreSQL connection. For examples of connection profiles for other supported databases, see Connection profile samples for supported databases.
- To validate credentials and connectivity, send a
POSTrequest tohttps://VM_HOSTNAME:PORT/optim/v1/connprofiles/testConnectionusing the same headers and payload. - To update an existing connection profile, send a
PUTrequest tohttps://VM_HOSTNAME:PORT/optim/v1/connprofiles/{name}by replacing{name}with the profile name and including updated connection details in the request body. - To delete a connection profile, send a
DELETErequest tohttps://VM_HOSTNAME:PORT/optim/v1/connprofiles/{name}by replacing{name}with the profile name and ensuring that the user has permission to delete it.
Results
A new connection is created and validated. It is ready for use in workflows and data operations. You can also update or delete the connection as needed.