Product Documentation

FairCom Replication JSON RPC API

Previous Topic

Next Topic

ctMemphisPersistReplPlan

int ctMemphisPersistReplPlan( pRCESJson request, ppRCESJson result )

Description:

Persist a Replication Plan into the Replication Manager Database. If it doesn't exist, create it, otherwise updated it. To create a new one, the ID must be -1 or not passed. And the update will be done by the ID.

HTTP URL: <baseURL>/ctMemphisPersistReplPlan/

HTTP Verb: POST

Constraints:

  • "name" is not NULL, not EMPTY and Unique.
  • "nodes": both sourceDBEngine and targetDBEngine must be existing DBEngine identification. We support having only one Replication Plan for two given DBEngines. If there already is a Replication Plan with nodes of 0 and 1, we can't create another Replication Plan with nodes of 1 and 0. The order doesn't matter.
  • "targetDBEngine" must accept external connections. Check acceptConn parameter and ctMemphisDBEngineSetAcceptConn() function. The only exception for this constraint is in case both source and target are on the same machine.
  • If "sourceDBEngine" doesn't accept external connections, the Replication Plan can't be "isPulling" true. As the source DBEngine doesn't accept external connection the replication must PUSH the changes to the target. Check acceptConn parameter and ctMemphisDBEngineSetAcceptConn() function. The only exception for this constraint is in case both source and target are on the same machine.

Parameters:

  • request [IN] - Persist Replication Plan request in JSON format. For example:

{

"replPlan": {

"id": 0, // optional, must be an existing

ID for update

"name": "PLAN2", // required

"sourceDBEngine": 0, // required, check constraints

nodes for details

"targetDBEngine": 1, // required, check constraints

nodes for details

"synchronous": false,

"description": "Plan 2 description", // optional

"batchSize": 8192, // optional

"debugMinLog": 0, // optional

"exceptionMode": 0, // optional

"lockRetryCount": 5, // optional

"lockRetrySleep": 1000, // optional

"logChangeDetails": "", // optional

"readTimeOut": 5000, // optional

"rememberLogPos": 1, // optional

"parallelApply": true, // optional

"checkDependencies": true, // optional

"syncLogWrites": false, // optional

"analyzerThreadsCount": 1, // optional

"applyThreadsCount": 8, // optional

"fileMask": "", // optional

"isBiDirectional": 1, // optional

"statusMsg": "", // optional

"statusActionID": 2427, // optional

"isDeployed": false, // optional

"isPulling": true, // optional

"rebuildOnDeploy": true, // optional

"sourceLogPos": "1 9383963 1 9383963", // optional

"targetLogPos": "1 9383963 1 9383963", // optional

"conflictDetection": true, // optional

"warningThreshold": 30, // optional

"errorThreshold": 300, // optional

"ignorePartition": false // optional, transform the partitioned

source file into non-partitioned in

the target, default is false

}

}

  • result [OUT] - Result in JSON format. For example:

{

"success": true,

"error":

{

"errorCode": 0,

"message": "Success"

},

"id": 0

}

Return:

Error code

TOCIndex