Product Documentation

FairCom Replication JSON RPC API

Previous Topic

Next Topic

ctMemphisSetDBEngineReadOnly

int ctMemphisSetDBEngineReadOnly( pRCESJson request, ppRCESJson result )

Description:

Set or remove read-only status for the DBEngine.

The Replication Manager uses ctSETCFG() to set the READONLY_SERVER keyword for the DBEngine being changed.

Keyword

The read-only status set by the API has higher precedence than the READONLY_SERVER keyword in ctsrvr.cfg. This means that, when the <FC_PROD_RPL> is starting, it will rely on the ctsrvr_readonly global variable to decide its status and will not consider the keyword in ctsrvr.cfg. The only exception is when <FC_PROD_RPL> is not running embedded, it still on the ctsrvr.cfg keyword, assuming that later the server will start with an embedded agent and will have it fixed.

Never

The ReadOnly property inReplication Manager is an enum type supporting the following values: "false", "true", and "never". Before initializing the <FC_PROD_RPL>, the status is checked and, if it is "never", ctMemphisSetDBEngineReadOnly() will return this error:

RCES_NEVERRONLY_ERR = 9073, /* DBEngine doesn't support readonly mode */

The following high-level web APIs can return the "never" status: ctMemphisGetDBEngines, ctMemphisCheckDBEngineStatus, ctMemphisGetReplPlansDetails, ctMemphisGetArchivedReplPlansDetails, and ctMemphisGetDBEnginesByGroup.

Compatibility Notes:

  • This feature adds a new field to the Replication Manager Database, so any pre-V12 databases should be recreated.
  • This feature adds a new property to the Replication Manager Database agent structure, so both server and ctAgent must be updated.

HTTP URL: <baseURL>/ctMemphisSetDBEngineReadOnly/

HTTP Verb: POST

Parameters:

  • request [IN] - Set DBEngine readOnly status request in JSON format. For example:

{

"id": 2,

"readOnly": true // Required, accepted values: true or false.

If it is already set to "never", this call will fail.

}

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

{

"success": true,

"error":

{

"errorCode": 0,

"message": "Success"

}

}

Return:

Error code

TOCIndex