Start/Stop Extract/Replicat with REST API/JSON

Oracle GoldenGate Microservices Architecture is designed to allow the user to have three different ways of interacting with replication from anywhere. One of these approaches is to use the RESTful APIs that come bundled with release. By using RESTful APIs, an organization can orgistrate how they want GoldenGate to work within their environment.

In this post, you will take a look at how to start a pre-existing extract/replicat by using the RESTful API end points. To find more information on the APIs that are avaliable, please refere to the Oracle docs located here.

If you have an existing extract/replicat in a down or pending status, then you can start it using a JSON file and the associated RESTful API end point.

Now the image above shows you that the extract is stopped. To start the extract using RESTful API, you will need a JSON file that contains the following:


{ 
"$schema":"ogg:command",    
"name":"start",    
"processName":"IEXTSOE",    
"processType":"extract"
}

Then from the command line, you can use cURL or some other method that accepts RESTful API calls to start the extract.

curl -u oggadmin:******** -H "Content-Type: application/json" -H "Accept: application/json" -X POST http://http://localhost:16001/services/v2/commands/execute" -d @start_extracts.json | python -mjson.tool

Upon execution of the cURL command, you receive a status response on the command line in JSON output. This response shows you that the extract is starting and started.

{
"$schema": "api:standardResponse",
"links": [
{
"href": "http://localhost:16001/services/v2/commands/execute",
"mediaType": "application/json",
"rel": "canonical"
},
{
"href": "http://localhost:16001/services/v2/commands/execute",
"mediaType": "application/json",
"rel": "self"
}
],
"messages": [
{
"$schema": "ogg:message",
"code": "OGG-00975",
"issued": "2018-02-05T03:27:17Z",
"severity": "INFO",
"title": "EXTRACT IEXTSOE starting",
"type": "http://docs.oracle.com/goldengate/c1230/gg-winux/GMESG/oggus.htm#OGG-00975"
},
{
"$schema": "ogg:message",
"code": "OGG-15426",
"issued": "2018-02-05T03:27:17Z",
"severity": "INFO",
"title": "EXTRACT IEXTSOE started",
"type": "http://docs.oracle.com/goldengate/c1230/gg-winux/GMESG/oggus.htm#OGG-15426"
}
]
}

When you go back to the web page for the Administration Service, you see that the extract has been started.

 

This same process can be used when you want to start/stop an replicat.

Enjoy!!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

%d bloggers like this: