Product Documentation

FairCom Replication JSON RPC API

Previous Topic

Next Topic

ctMemphisCheckAvailStatus

int ctMemphisCheckAvailStatus( pRCESJson request, ppRCESJson result )

Description:

Retrieve the current Availability Group status. If "checkConnection" is set, make some validations in order to update its status and return its information.

HTTP URL: <baseURL>/ctMemphisCheckAvailStatus/

HTTP Verb: POST

Notes:

  • Status values can be: "inactive", "active", "stopping", "starting", "checking", "warning" or "error"
  • StatusCd values can be: 0 = "inactive", 1 = "active", 2 = "stopping", 3 = "starting", 4 = "checking", 5 = "warning" and 6 = "error"
  • ReplicaStatus values can be: "inactive", "active", "stopping", "starting", "deploying" and "paused"
  • ReplicaStatusCd values can be: 0 = "inactive", 1 = "active", 2 = "stopping", 3 = "starting", 4 = "deploying" and 5 = "paused"
  • recoverOrder show that the replica was a primary and has been switched
  • transactionID log position where the failover occurred to be used as an option for a primary node restore later
  • EngineStatus values: -1 = invalid status, 0 = inactive, 1 = active, 2 = stopping, 3 = starting, 4 = checking, 5 = active with warning, 6 = unavailable, 7 = switching AvailGroup to new primary, 8 = unmanaged

Parameters:

  • request [IN] - Check Availability Group Status request in JSON format. For example:

{

"id": 2, // optional, if it is not passed or if it is -1,

returns status for all Availability Groups

"checkConnection": true // optional, default is false. If true, the

Replication Manager Database will try to execute agent

validations to check if current status is ok or not.

}

  • result [OUT] - Result in JSON format. For example in case "checkConnection" is FALSE or the ID is provided:

{

"availGroupList": [

{

"id": 1,

"name": "availGroup1",

"description": "Availability Group for ABC purposes",

"status": "active", // see "Status" note for values.

"warning" means at least one DBEngine is

active,but some replicas are missing.

"error" means availability group unavailable.

"statusCode": 1, // see "EngineStatus" note for possible values

"statusTime": "2015-11-05T10:00:00",

"statusMsg": "",

"statusActionID": 132,

"heartbeatFrequency": 2, // heartbeat frequency in seconds for

checking the replicas

"heartbeatTimeout": 5, // number of seconds to wait with no answer

before assuming it is down

"replicaList": [

{

"availGroup": 1,

"isPrimary": true, // indicates if replica is primary or secondary

"dbEngine": 2, // dbEngine identification

"dbEngineStatus": {

"id": 2,

"status": "active", // see "Status" note for values

"statusCode": 1, // see "EngineStatus" note for values

"statusTime": "2015-11-05T10:00:00", // when status was set

"lastCheckTime": "2015-11-17T11:35:00", // last time DBEngine

connection was tested

"acceptConn": 1, // Flag indicating server accepts

external connections

"readOnly": false, // Flag indicating server is ReadOnly.

It can be true, false, or never

(never means it cannot be changed).

"isMemphis": 0,

"replNodeID": "1.1.1.2", // Unique Replication Node ID

"actionExecs": [

{

"type": "BASIC", // Supported types:

BASIC, FILE_SYSTEM, REPLICATION,

REPL_CTREE

"status": "active",

"threadCount": 1,

"statusTime": "2015-11-05T10:00:00"

},

{

"type": "FILE_SYSTEM",

"status": "active",

"threadCount": 4,

"statusTime": "2015-11-05T10:00:00"

},

{

"type": "REPLICATION",

"status": "active",

"threadCount": 4,

"statusTime": "2015-11-05T10:00:00"

}

]

},

"publication": {

"id": 0,

"name": "publication1",

"description": "Publication for ABC purposes",

"dbEngine": 2

},

},

{

"availGroup": 1,

"isPrimary": false,

"isSync": true,

"dbEngine": 3,

"dbEngineStatus": {

"id": 3,

"status": "active",

"statusCode": 1,

"statusTime": "2015-11-05T10:00:00",

"lastCheckTime": "2015-11-17T11:35:00",

"acceptConn": 1,

"readOnly": false,

"isMemphis": 0,

"replNodeID": "1.1.1.2",

"actionExecs": [

{

"type": "BASIC",

"status": "active",

"threadCount": 1,

"statusTime": "2015-11-05T10:00:00"

}

]

},

"publication": {

"id": 1,

"name": "publication1",

"description": "Publication for ABC purposes",

"dbEngine": 3

},

"replPlanStatus": {

"id": 2,

"status": "active", // see "Status" for values

"statusCode": 1, // see "ReplicationStatus" for values

"isDeployed": true,

"statusTime": "2015-11-05T10:00:001",

"statusMsg": "",

"statusActionID": 132,

"latency": 22, // how many seconds behind the Replication

Plan is at this moment

"latencyTime": "Thu Aug 23 14:55:02 2001", // when latency

was last checked

"latencyRev": 22, // how many seconds behind the

Replication Plan reverse direction is

"latencyRevTime": "Thu Aug 23 14:55:02 2001", // when reverse

direction

latency was

last checked

"isMonitorActive": true,

"monitorTime": "Thu Aug 23 14:55:02 2001", // Time when monitor

was active or not

"refreshRate": 5,

"isExcepLogActive": true,

"excepLogTime": "Thu Aug 23 14:55:02 2001", // Time when

exception logging

was active or not

"isFuncTimingActive": true,

"funcTimingTime": "Thu Aug 23 14:55:02 2001", // Time when

function timing

was active

or not

"hasNonAckException": true // Flag indicating Plan has at least

one not acknowledge exception

}

},

{

"availGroup": 1,

"isPrimary": false,

"isSync": false,

"dbEngine": 4,

"recoverOrder": 0,

"transactionID": 132135,

"dbEngineStatus": {

"id": 4,

"status": "inactive",

"statusCode": 1,

"statusTime": "2015-11-05T10:00:00",

"lastCheckTime": "2015-11-17T11:35:00",

"acceptConn": 1,

"readOnly": false,

"isMemphis": 0,

"replNodeID": "1.1.1.2",

"actionExecs": [

{

"type": "BASIC",

"status": "active",

"threadCount": 1,

"statusTime": "2015-11-05T10:00:00"

}

]

},

"publication": {

"id": 2,

"name": "publication2",

"description": "Publication for ABC purposes",

"dbEngine": 0

},

"replPlanStatus": {

"id": 2,

"status": "active", // see observation "Status"

for possible values

"statusCode": 1, // see "ReplicationStatus"

for possible values

"isDeployed": true,

"statusTime": "2015-11-05T10:00:001",

"statusMsg": "",

"statusActionID": 132,

"latency": 22, // how many seconds behind

the Replication Plan is

"latencyTime": "Thu Aug 23 14:55:02 2001", // when latency

was last checked

"latencyRev": 22, // how many seconds behind the

Replication Plan reverse

direction is at this moment

"latencyRevTime": "Thu Aug 23 14:55:02 2001", // when reverse

direction

latency was

last checked

"isMonitorActive": true,

"monitorTime": "Thu Aug 23 14:55:02 2001", // Time monitor was

active or not

"refreshRate": 5,

"isExcepLogActive": true,

"excepLogTime": "Thu Aug 23 14:55:02 2001", // Time exception

logging was

active or not

"isFuncTimingActive": true,

"funcTimingTime": "Thu Aug 23 14:55:02 2001", // Time exception

logging was

active or not

"hasNonAckException": true // Flag indicating Plan has at least

one not acknowledge exception

}

}

]

},

{

"id": 2,

"name": "availGroup2",

"description": "Availability Group for XYZ purposes",

"status": "active",

"statusCode": 1,

"statusTime": "2015-11-05T10:00:00",

"statusMsg": "",

"statusActionID": 132,

"replicaList": [

{

"availGroup": 2,

"isPrimary": true,

"dbEngine": 2,

"dbEngineStatus": {

"id": 2,

"status": "active",

"statusCode": 1,

"statusTime": "2015-11-05T10:00:00",

"lastCheckTime": "2015-11-17T11:35:00",

"acceptConn": 1,

"readOnly": false,

"isMemphis": 0,

"replNodeID": "1.1.1.2",

"actionExecs": [

{

"type": "BASIC",

"status": "active",

"threadCount": 1,

"statusTime": "2015-11-05T10:00:00"

},

{

"type": "FILE_SYSTEM",

"status": "active",

"threadCount": 4,

"statusTime": "2015-11-05T10:00:00"

},

{

"type": "REPLICATION",

"status": "active",

"threadCount": 4,

"statusTime": "2015-11-05T10:00:00"

}

]

}

}

]

}

]

"success": true,

"error":

{

"errorCode": 0,

"message": "Success"

},

"total": 2 // total number of Availability Groups for the query - see Note 1

}

If checkConnection is TRUE and we are checking all the Availability Groups, we execute it asynchronously, by returning the action ID to be checked (ctMemphisCheckAction) as background execute:

{

"actionID":44135,

"success": true,

"error":

{

"errorCode": 0,

"message": "Success"

}

}

Return:

Error code

TOCIndex