Oracle Database

REST API oracle goldengate 26ai read&learn gg

Photo by Sid Leigh on Unsplash

REST stands for Representational State Transfer . It allows different software programs and servers to talk to each other over the internet (usually via HTTP). In Oracle GoldenGate’s microservices architecture, various components communicate over Rest API calls internally . Externally DBAs and Developers can leverage these rest calls to manage and monitor these services. This blog discusses on how to leverage rest api calls to manage goldengate.

How to Begin ?

Best place to know the api’s is the oracle documentation on the Endpoints. Alternatively one can download the swagger file and visualize it in postman or swagger.
I have uploaded the swagger.json to my git repo here -> https://github.com/MrJ1ggy/oracle-goldengate-26ai-apis/tree/main
If you work with swagger.io use below link
Swagger link -> https://app.swaggerhub.com/apis/student-369/ogg-oracle-goldengate-26ai/1.0.0-oas3

Choosing your API

Login to your goldengate adminclient and run “set debug on” . It reveals all the apis called by goldengate behind the scene. Lets see an example below where you wish to get api to show all the distribution paths of the goldengate deployment

OGG > info distpath all
 dsrc1      running
 dsrc2      running
  
# Two distribution paths are running

dscr1 and dsrc2 are running in our ogg deployment , lets see the apis behind the scene

OGG > set debug on
Command 1 succeeded: 'set debug on'

OGG > info distpath all
> GET /services/v2/sources
< Status 200
{
    "$schema": "api:standardResponse",
    "links": [
...
...
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
> GET /services/v2/sources/dsrc1
< Status 200
{
    "$schema": "api:standardResponse",
    "links": [
...
...
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
> GET /services/v2/sources/dscr2
< Status 200
{
    "$schema": "api:standardResponse",
    "links": [
...
...
--------------------------------------------------------------------------------
 dsrc1      running
 dsrc2      running

From the above o/p we see that 3 apis were called to get results of command “info distpath all”
1) -> GET /services/v2/sources
2 -> GET /services/v2/sources/dsrc1
3) -> GET /services/v2/sources/dscr2
The output of the API is in json format. The 1st api will list all the distribution paths in the deployment while the 2nd and 3rd will list the details of each distribution path . In final output only the “status” is displayed shown as “running”

Running API from Remote

From a remote host you can run api and parse its output for display

## API to pull all the distribution paths
$curl -u 'oggadmin:pass123' \
-H 'Content-Type: application/json' -H 'Accept: application/json' \
-X GET http://myhost.expample.com:9102/services/v2/sources \
| jq -r '.response.items[].name'

## API to pull status of dsrc1
$curl -u 'oggadmin:pass123' \
-H 'Content-Type: application/json' -H 'Accept: application/json' \
-X GET http://myhost.expample.com:9102/services/v2/sources/dsrc1 \
| jq -r '.response.status'

## API to pull status of dsrc2
$curl -u 'oggadmin:pass123' \
-H 'Content-Type: application/json' -H 'Accept: application/json' \
-X GET http://myhost.expample.com:9102/services/v2/sources/dscr2 \
| jq -r '.response.status'

It is important to note the port number “9102” which is the port of the distribution service.

Another way to check the api is the resapi.log file , it logs all the apis run by the deployment
Location : $DEPLOY_HOME/var/log/restapi.log

In the future blogs we will discuss more use cases to leverage APIs in installation and monitoring

Ref:
https://alexlima.com/2025/11/10/how-to-discover-and-build-your-goldengate-rest-api-calls/
https://docs.oracle.com/goldengate/c1230/gg-winux/OGGRA/rest-endpoints.html


Leave a Reply