This page describes how to manage Goldengate connections in Google Cloud.

## Before you begin

- Make sure that you have the required Identity and Access Management (IAM) roles and
  permissions to perform the tasks described in this page:

  - `roles/oracledatabase.goldenGateConnectionAdmin`
  - `roles/oracledatabase.goldenGateConnectionViewer`

  For more information about how to assign roles, see
  [Apply IAM roles](https://docs.cloud.google.com/oracle/database/docs/iam-roles.md.txt).

## View connection details

To view information about your connections, do the following:

### Console

1. Go to the **Goldengate** page.

   [Go to Goldengate](https://console.cloud.google.com/oracle/golden-gate/)
2. Select the **Connections** tab.

   The **Connections** section shows you the list of connections.
3. To view details of a specific connection, click the name of the connection.

### gcloud

- **List connections**

  Use the `gcloud oracle-database goldengate-connections list` command to
  list connections.

      gcloud oracle-database goldengate-connections list \
          --project=PROJECT_ID \
          --location=REGION

  Replace the following:
  - <var translate="no">PROJECT_ID</var>: the ID of your Google Cloud project. If you're using a Shared VPC, then this is the ID of your host project.
  - <var translate="no">REGION</var>: the region where you want to view the connections.
- **View connection details**

  Use the `gcloud oracle-database goldengate-connections describe` command to
  view details of a connection.

      gcloud oracle-database goldengate-connections describe CONNECTION_ID \
          --project=PROJECT_ID \
          --location=REGION

  Replace <var translate="no">CONNECTION_ID</var> with the ID of your connection.

### API

- **List connections**

  To list connections, run the following `curl` command:

  ```
  curl -X GET \
  -H "Authorization: Bearer $(gcloud auth print-access-token)" \
  -H "Content-Type: application/json" \
  "https://oracledatabase.googleapis.com/v1/projects/PROJECT_ID/locations/REGION/goldengateConnections"
  ```

  Replace the following:
  - <var translate="no">PROJECT_ID</var>: the ID of your Google Cloud project. If you're using a Shared VPC, then this project ID is the ID of your host project.
  - <var translate="no">REGION</var>: the region where you want to view the connections.
- **View connection details**

  To view details of a connection, run the following `curl` command:

  ```
  curl -X GET \
  -H "Authorization: Bearer $(gcloud auth print-access-token)" \
  -H "Content-Type: application/json" \
  "https://oracledatabase.googleapis.com/v1/projects/PROJECT_ID/locations/REGION/goldengateConnections/CONNECTION_ID"
  ```

  Replace <var translate="no">CONNECTION_ID</var> with the ID of your connection.

## Modify a connection

You can modify your connections in the OCI console. To view your connections in
the OCI console, do the following:

1. Go to the **Goldengate** page.

   [Go to Goldengate](https://console.cloud.google.com/oracle/golden-gate/)
2. Select the **Connections** tab.

   The **Connections** section shows you the list of connections.
3. For a connection that you want to modify, click
   **View actions** ,
   and then **Manage in OCI**.

You're redirected to the OCI page to modify your connection.

## Delete a connection

You can delete a connection even if it's assigned to a deployment. Deleting a
connection also deletes its connection assignment.

### Console

1. Go to the **Goldengate** page.

   [Go to Goldengate](https://console.cloud.google.com/oracle/golden-gate/)
2. Select the **Connections** tab.

3. For the connection which you want to delete,
   click **View actions** ,
   and then click **Delete**.

4. In the **Delete connection?** dialog, type the connection
   ID to confirm the deletion of your connection.

5. Click **Confirm**.

### gcloud

Use the `gcloud oracle-database goldengate-connections delete` command to
delete a connection.

    gcloud oracle-database goldengate-connections delete CONNECTION_ID \
        --project=PROJECT_ID \
        --location=REGION

Replace the following:

- <var translate="no">CONNECTION_ID</var>: the ID of the connection.
- <var translate="no">PROJECT_ID</var>: the ID of your Google Cloud project. If you're using a Shared VPC, then this is the ID of your host project.
- <var translate="no">REGION</var>: the region where your connection is located.

### API

To delete a connection, run the following `curl` command:

```
curl -X DELETE \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
"https://oracledatabase.googleapis.com/v1/projects/PROJECT_ID/locations/REGION/goldengateConnections/CONNECTION_ID"
```

Replace the following:

- <var translate="no">PROJECT_ID</var>: the ID of your Google Cloud project which contains the connection to be deleted. If you're using a Shared VPC, then this is the ID of your host project.
- <var translate="no">REGION</var>: the region where your connection is located.
- <var translate="no">CONNECTION_ID</var>: the ID of your connection.