Using REST API
Use the OCI GoldenGate REST API to communicate with your data replication deployments. Discover how to use the REST API in various configurations, invoking commands using curl and Cloud Shell.
Connect to a public deployment
To connect to an OCI GoldenGate deployment with a public endpoint in Cloud Shell, you only need the deployment URL. You can find the deployment URL (Console URL) on the deployment's details page.
Connect to a private deployment
If the deployment has a private endpoint, you can connect Cloud Shell to a network with access to the deployment using Cloud Shell Networking, or create a bastion, bastion session, and SSH tunnel.
By default, Cloud Shell limits network access to OCI internal resources in your tenancy home region unless you have enabled the Cloud Shell managed Public Network. Your administrator must configure an Identity policy to enable Cloud Shell Public Network. For more information, see Cloud Shell Networking.
Example REST API calls
Optionally, you can store your deployment username and password into a
.netrc
file. The
following examples assume you're using a .netrc file.
curl -n -H "Content-Type: application/json" -H "Accept: application/json" -X GET https://<deployment URL>/services/v2/config/health
List Trail files
curl -n -H "Content-Type: application/json" -H "Accept: application/json" -X GET https://<deployment URL>/services/v2/exttrails
List Extracts or Replicats
curl -n -H "Content-Type: application/json" -H "Accept: application/json" -X GET https://<deployment URL>/v2/extracts
curl -n -H "Content-Type: application/json" -H "Accept: application/json" -X GET https://<deployment URL>/v2/replicats
Retrieve Extract or Replicat details
curl -n -H "Content-Type: application/json" -H "Accept: application/json" -X GET https://<deployment URL>/v2/extracts/<extract name>
curl -n -H "Content-Type: application/json" -H "Accept: application/json" -X GET https://<deployment URL>/v2/replicats/<replicat name>
Create an Extract
{
"config":[
"Extract EATP",
"ExtTrail E1",
"UseridAlias BLOGSRCATP",
"Table SRC_OCIGGLL.*;"
],
"source":{"tranlogs":"integrated"},
"credentials":{"alias":"BLOGSRCATP"},
"registration":{"optimized":false},
"begin":"now",
"targets":[{"name":"E1"}]
}
curl -n -H "Content-Type: application/json" -H "Accept: application/json" -X POST https://<deployment URL>/services/v2/extracts/<Extract name> -d @<JSON file>.json
Create a Replicat
{
"config":[
"REPLICAT RADW",
"UseridAlias BLOGTRGADW",
"MAP SRC_OCIGGLL.*, TARGET SRCMIRROR_OCIGGLL.*;"
],
"source":{"name": "E1"},
"credentials":{"alias":"BLOGTRGADW"},
"checkpoint":{"table":"SRCMIRROR_OCIGGLL.CHECKTABLE"},
"mode":{
"type":"nonintegrated",
"parallel": false
},
"registration":"none",
"begin":"now",
"status":"stopped"
}
curl -n -H "Content-Type: application/json" -H "Accept: application/json" -X POST https://<deployment URL>/services/v2/replicats/<Replicat name> -d @<JSON file>.json
Start an Extract or Replicat
curl -n -H "Content-Type: application/json" -H "Accept: application/json" -X POST https://<deployment URL>/services/v2/commands/execute -d '{ "name":"start", "processName":"<Extract or Replicat name>"}'
Get the status and statistics for a given Extract
curl -n -H "Content-Type: application/json" -H "Accept: application/json" -X POST https://<deployment URL>:<port>/services/v2/extracts/<extract name>/command -d '{"command":"STATUS"}'
curl -n -H "Content-Type: application/json" -H "Accept: application/json" -X POST https://<deployment URL>:<port>/services/v2/extracts/<extract name>/command -d '{"command":"STATUS"}'
Get the status and statistics for a given Replicat
curl -n -H "Content-Type: application/json" -H "Accept: application/json" -X POST https://<deployment URL>:<port>/services/v2/replicats/<replicat name>/command -d '{"command":"STATUS"}'
curl -n -H "Content-Type: application/json" -H "Accept: application/json" -X POST https://<deployment URL>:<port>/services/v2/replicats/<replicat name>/command -d '{"command":"STATS"}'