This page describes how to manage Goldengate connection assignments
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.goldenGateConnectionAssignmentAdmin`
  - `roles/oracledatabase.goldenGateConnectionAssignmentViewer`

  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 assignment details

To view connection assignment information about your connection assignments, do the
following:

### Console

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

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

   The **Deployment** section shows you the list of deployments.
3. Click the name of the deployment whose connection assignments you want to
   view.

4. On the **Deployment details** page, go to the **Assigned connections**
   section.

   The **Assigned connections** section shows you the details of
   the connection assignments of the deployment.

### gcloud

- **List connection assignments**

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

      gcloud oracle-database goldengate-connection-assignments 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 connection assignments.
- **View connection assignment details**

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

      gcloud oracle-database goldengate-connection-assignments describe ASSIGNMENT_ID \
          --project=PROJECT_ID \
          --location=REGION

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

### API

- **List connection assignments**

  To list connection assignments, 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/goldengateConnectionAssignments"
  ```

  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 connection assignments.
- **View connection assignment details**

  To view details of a connection assignment, 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/goldengateConnectionAssignments/ASSIGNMENT_ID"
  ```

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

## Delete a connection assignment

To delete a connection assignment, do the following:

### gcloud

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

    gcloud oracle-database goldengate-connection-assignments delete ASSIGNMENT_ID \
        --project=PROJECT_ID \
        --location=REGION

Replace the following:

- <var translate="no">ASSIGNMENT_ID</var>: the ID of the connection assignment.
- <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 assignment is located.

### API

To delete a connection assignment, 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/goldengateConnectionAssignments/ASSIGNMENT_ID"
```

Replace the following:

- <var translate="no">PROJECT_ID</var>: the ID of your Google Cloud project which contains the connection assignment 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 assignment is located.
- <var translate="no">CONNECTION_ID</var>: the ID of your connection assignment.