strip

arch

 

The Oracle GoldenGate REST API can be used to manage Oracle GoldenGate deployments and replication services.You can view a list of all REST Endpoints here

The API Gateway service enables you to publish APIs with private endpoints that are accessible from within your network, and which you can expose with public IP addresses if you want them to accept internet traffic.

An API gateway routes inbound traffic to back-end services including public, private, and partner HTTP APIs, including OCI GoldenGate. Each API gateway is a private endpoint that you can optionally expose over a public IP address as a public API gateway.Using the API Gateway service, you create one or more API gateways in a regional subnet to process traffic from API clients and route it to back-end services. You can use a single API gateway to link OCI Goldengate and multiple back-end services (such as load balancers, compute instances, and OCI Functions) into a single consolidated API endpoint.

APIs

In the API Gateway service, an API is a set of back-end resources, and the methods (for example, GET, PUT) that can be performed on each back-end resource in response to requests sent by an API client.To enable an API gateway to process OCI GoldenGate API requests, you must deploy the API on the API gateway by creating an API deployment.

Creating an API Gateway in OCI

You can create one or more API gateways to process traffic from API clients and route it to back-end services. An API Gateway can be created  either through Console, API or CLI. For the purpose of this blog, we would be creating an API Gateway for OCI GoldenGate through OCI Console.
Follow the steps outlined here to create an API Gateway in your OCI tenancy.

Once the API gateway has been created, API can be deployed on an API gateway by creating an API deployment. When you create an API deployment, you include an API deployment specification that defines the API. The API Gateway service inspects the API deployment specification to confirm that it is valid.You can use a single API gateway as the front end for multiple back-end services by:

  • Creating a single API deployment on the API gateway, with an API deployment specification that defines multiple back-end services.
  • Creating multiple API deployments on the same API gateway, each with an API deployment specification that defines one (or more) back-end services.

 

Using the Console to Create an API Deployment for OCI GoldenGate from Scratch

  1. In the OCI Console, open the navigation menu and click Developer Services. Under API Management, click Gateways.
     
  2. Choose a Compartment you want to create a deployment in.
     
  3. On the Gateways page, click the name of the API gateway on which you want to deploy the API to show the Gateway Details page.
     
  4. On the Gateway Details page, select Deployments from the Resources list, and then click Create Deployment.
     
  5. Click From Scratch and in the Basic Information section, specify:
                Name: The name of the new API deployment. Avoid entering confidential information.

Path Prefix: A path on which to deploy all routes contained in the API deployment specification.For example: GoldenGate deployment name

           Note that the deployment path prefix you specify:
                  must be preceded by a forward slash ( / )
                  can contain multiple forward slashes (provided they are not adjacent), but must not end with a forward slash
                  can include alphanumeric uppercase and lowercase characters
                  can include the special characters $ – _ . + ! * ‘ ( ) , % ; : @ & =
                  cannot include parameters and wildcards

create dep

 

 

      6. Leave the Optional parameters with default values. Click Next to display the Authentication page and enter details for an                                authentication request policy.
          For the scope of this blog we are going to select No Authentication: to give unauthenticated access to all routes in the API                                deployment.

auth

      7. Click Next to enter details of the routes in the API deployment.

          In the Route 1 section, specify the first route in the API deployment that maps a path and one or more methods to a back-end                         service:

  • Path: A path for API calls using the listed methods to the back-end service. For example, /extracts
     
  • Methods: One or more methods accepted by the back-end service, separated by commas. For example, GET, PUT.
     
  • Add a single backend or Add multiple backends: Whether to route all requests to the same back end, or to route requests to different back ends according to the context variable and rules you enter. These instructions assume you want to use a single back end, so select Add a single backend.
     
  • Backend Type: The type of the back-end service, select HTTP and enter the following details
  • URL: enter the OCI GoldenGate URL for extract in the below format

    <console-url>/services/adminsrvr/v2/extracts  

 

  • Leave the rest of the optional parameters with default values.
     
  • (Optional) Click Another Route to enter details of additional routes. You can configure an additional Route similarly for replicat.

ROUTE 1

 

route 2

     8. Click Next to review the details you entered for the new API deployment.

     9. Click Create to create the new API deployment.

 

Option 2: Using the Console to Create an API Deployment from a JSON File

  1. On the Gateways page, click the name of the API gateway on which you want to deploy the API to show the Gateway Details page.
     
  2. On the Gateway Details page, select Deployments from the Resources list, and then click Create Deployment.
     
  3. Click Upload from an exisiting API and in the Basic Information section, specify:
  • Name: The name of the new API deployment. Avoid entering confidential information.
  • Path Prefix: A path on which to deploy all routes contained in the API deployment specification. For example: GoldenGate deployment name
  • Specification: Upload the JSON file containing the API deployment specification, either by dragging and dropping the file, or by clicking select one. 
  • To create an API deployment specification in a JSON file:

Using your preferred JSON editor, create the API deployment specification in a JSON file in the format:

{  "routes": [

    {
      "path": "/GGORA",
      "methods": ["ANY"],
        "backend": {
        "type": "HTTP_BACKEND",
        "url": "https://h5yeq.deployment.goldengate.us-ashburn-1.oci.oraclecloud.com",
        "auth_type": "basic"
       }

       }

  ]

}

Click Next to review the details you entered for the new API deployment.
Click Create to create the new API deployment.
 

Option 3: You can also create a deployment using CLI, Open a command prompt and run oci api-gateway deployment create to create the deployment:

oci api-gateway deployment create –compartment-id <compartment-ocid> –display-name <api-name> –gateway-id <gateway-ocid> –path-prefix “/<deployment-path-prefix>” –specification file:///<filename>
 

 

Single API Deployment with multiple back-end API specifications

You can create a single API deployment on an API gateway, with an API deployment specification that defines multiple back-end services.

For example, the following API deployment specification defines a OCI GoldenGate – Oracle deployment as one back end, and the Big Data as a second back end.

{  "routes": [

  {

    "path": "/GGORA",

    "methods": ["GET"],

    "backend": {

      "type": "HTTP_BACKEND",

      "url": "https://hyeq.deployment.goldengate.us-ashburn-1.oci.oraclecloud.com/services/adminsrvr/v2/replicats"

 }

 },

{

    "path": "/GGBD",

    "methods": ["GET"],

    "backend": {

      "type": "HTTP_BACKEND",

      "url": "https://xfza.deployment.goldengate.us-ashburn-1.oci.oraclecloud.com/services/adminsrvr/v2/replicats"

}

}

]

}

 

Test GoldenGate API using the API Gateway Deployment Endpoint

When it has been created successfully, the new API deployment is shown with a state of Active.

We can test the above API Gateway configuration using GoldenGate REST API commands as below,

Using CuRL:

List all Replicat process

For example:
curl -X GET ‘<API Gateway deployment endpoint>’ –user “<username>”:“<password>” -H ‘Content-Type: application/json’ -H ‘cache-control: no-cache’ | python -mjson.tool

curl

Using Browser :

URL is the endpoint mentioned in API Gateway deployment page
** append path name if you have configured multiple routes within the same deployment.

browser