Overview
In this tutorial, you'll create an integration with an API trigger that receives API requests for retrieving customer information. Depending on the API request location, the integration retrieves the customer details from either a MySQL database or an Oracle database.
Objectives
This tutorial shows you how to complete the following tasks in your integration:
- Add an API trigger.
- Add and configure Connectors tasks for MySQL and Oracle connections.
- Add and configure data mapping tasks to extract and map API payload.
Costs
In this tutorial, you use the following billable components of Google Cloud:
The instructions in this tutorial are designed to keep your resource usage within the limits of Google Cloud's Always Free tier.
When you finish the tasks that are described in this document, you can avoid continued billing by deleting the resources that you created. For more information, see Clean up.
Before you begin
- Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
-
Create a service account:
-
Ensure that you have the Create Service Accounts IAM role
(
roles/iam.serviceAccountCreator) and the Project IAM Admin role (roles/resourcemanager.projectIamAdmin). Learn how to grant roles. -
In the Google Cloud console, go to the Create service account page.
Go to Create service account - Select your project.
-
In the Service account name field, enter a name. The Google Cloud console fills in the Service account ID field based on this name.
In the Service account description field, enter a description. For example,
Service account for quickstart. - Click Create and continue.
-
Grant the following roles to the service account: Secret Manager Viewer (
roles/secretmanager.viewer), Secret Manager Secret Accessor (roles/secretmanager).To grant a role, find the Select a role list, then select the role.
To grant additional roles, click Add another role and add each additional role.
- Click Continue.
-
Click Done to finish creating the service account.
-
Ensure that you have the Create Service Accounts IAM role
(
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
-
Create a service account:
-
Ensure that you have the Create Service Accounts IAM role
(
roles/iam.serviceAccountCreator) and the Project IAM Admin role (roles/resourcemanager.projectIamAdmin). Learn how to grant roles. -
In the Google Cloud console, go to the Create service account page.
Go to Create service account - Select your project.
-
In the Service account name field, enter a name. The Google Cloud console fills in the Service account ID field based on this name.
In the Service account description field, enter a description. For example,
Service account for quickstart. - Click Create and continue.
-
Grant the following roles to the service account: Secret Manager Viewer (
roles/secretmanager.viewer), Secret Manager Secret Accessor (roles/secretmanager).To grant a role, find the Select a role list, then select the role.
To grant additional roles, click Add another role and add each additional role.
- Click Continue.
-
Click Done to finish creating the service account.
-
Ensure that you have the Create Service Accounts IAM role
(
Prepare your environment
Set up a MySQL database
Connect to your MySQL server and create a database and a table to use in this tutorial. This tutorial uses a database that contains a table named Customers with the following rows:
+-------------+---------------+--------------------+------------------+ | customer_id | customer_name | customer_emailID | customer_city | +-------------+---------------+--------------------+------------------+ | 1 | Alex | test-01@test.com | New York | | 2 | Dana | test-02@test.com | Seattle | +-------------+---------------+--------------------+------------------+
For information about creating and using a MySQL database, see the MySQL documentation.
Set up an Oracle database
Connect to your Oracle database and create a table to use in this tutorial. This tutorial uses a database that contains a SQL table named Customers with the following rows:
+-------------+---------------+--------------------+------------------+ | customer_id | customer_name | customer_emailID | customer_city | +-------------+---------------+--------------------+------------------+ | 1 | Amal | test-01@test.com | Delhi | | 2 | Hao | test-02@test.com | Beijing | +-------------+---------------+--------------------+------------------+
For information about creating and using a Oracle database, see the Oracle documentation.
Configure connections
For this tutorial, you must configure the following connections in Integration Connectors:
- MySQL connection
- Configure a MySQL connection in Integration Connectors to get the
Customertables entities. For information on configuring a MySQL connector, see MySQL connector. - Oracle DB connection
- Configure a Oracle DB connection in Integration Connectors to get the
Customertables entities. For information on configuring a MySQL connector, see Oracle DB connector.
Create integration
To create a new integration, perform the following steps:
- In the Google Cloud console, go to the Application Integration page.
- Click Integrations from the left navigation menu to open the Integrations page.
- Click