int ctMemphisGetAvailGroups( pRCESJson request, ppRCESJson result )
Description:
Retrieve all the Availability Groups from the Replication Manager Database.
HTTP URL: <baseURL>/ctMemphisGetAvailGroups/
HTTP Verb: POST
Parameters:
{
"name": "availabilityGroup1", // optional, if provided, search
Availability Group by name
"partial": true, // optional, if provided with "name",
the search by name will look for
like "<name>%"
"id": 1, // optional, if provided, search
Availability Group by ID
"detail": 1, // optional, if not provided, assumes
detail as true
"paging": true, // optional, see Note 1
"limit": 100, // optional, see Note 1
"start": 200 // optional, see Note 1
}
Notes:
If "detail" is 1:
{
"availGroupList": [
{
"id": 1,
"name": "availGroup1",
"description": "Availability Group for ABC purposes",
"status": "active", // see "Status" note for possible values.
A status of "warning" means that there is at
least one DBEngine active, but some replicas
are missing. A status of "error" means
availability group unavailable.
"statusCode": 1, // see "EngineStatus" note for possible values
"statusTime": "2015-11-05T10:00:00",
"statusMsg": "",
"statusActionID": 132,
"isDeployed": true,
"canFailoverToAsyncReplica": true, // flag indicating to failover to an
asynchronous replica in case there
isn't a synchronous available.
Or it should fail in this scenario
"replicaStatus": "active", // see "ReplicaStatus" for possible values.
"replicaStatusCode": 1, // see "ReplicaStatus" for possible values.
"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 possible values
"statusCode": 1, // see "EngineStatus" note for values
"statusTime": "2015-11-05T10:00:00", // when this status
has been set
"lastCheckTime": "2015-11-17T11:35:00", // last time that the
DBEngine connection
has been really tested
"acceptConn": 1, // Flag indicating that the server
accepts external connections
"readOnly": false, // Flag indicating that the server is in
ReadOnly status. It can be true, false
or never (in case it cannot be changed).
"isMemphis": 0,
"replNodeID": "1.1.1.2", // Unique Replication Node ID
"configFilePath": "C:/temp/ctsrvr_temp.cfg",
"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
},
"replPlan": {
"id": 0,
"name": "PLAN1",
"description": "Plan 1 description",
"sourceDBEngine": 2,
"targetDBEngine": 3,
"direction": "normal", // see "Direction" for values
"status": "active",
"statusCode": 1, // see "ReplicationStatus" for values
"statusTime": "Thu Aug 23 14:55:02 2001",
"statusMsg": "",
"isDeployed": false,
"latency": 22, // how many seconds behind the
Replication Plan is at the 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
}
},
{
"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
},
"replPlan": {
"id": 1,
"name": "PLAN2",
"description": "Plan 2 description",
"sourceDBEngine": 2,
"targetDBEngine": 4,
"synchronous": false,
"direction": "normal",
"status": "active",
"statusCode": 1,
"statusTime": "Thu Aug 23 14:55:02 2001",
"statusMsg": "",
"isDeployed": false,
"latency": 22,
"latencyTime": "Thu Aug 23 14:55:02 2001",
"latencyRev": 22,
"latencyRevTime": "Thu Aug 23 14:55:02 2001"
}
}
]
},
{
"id": 2,
"name": "availGroup2",
"description": "Availability Group for XYZ purposes",
"status": "active",
"statusCode": 1,
"statusTime": "2015-11-05T10:00:00",
"statusMsg": "",
"statusActionID": 132,
"isDeployed": false,
"canFailoverToAsyncReplica": false,
"replicaStatus": "inactive",
"replicaStatusCode": 0,
"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 "detail" is 0:
{
"availGroupList": [
{
"id": 1,
"name": "availGroup1",
"description": "Availability Group for ABC purposes",
"status": "active", // see "Status" note for values
"statusCode": 1, // see "EngineStatus" note for values
"statusTime": "2015-11-05T10:00:00",
"statusMsg": "",
"statusActionID": 132,
"isDeployed": true,
"canFailoverToAsyncReplica": true, // flag indicating to failover to an
asynchronous replica if there isn't
a synchronous available. Or it should
fail in this scenario
"replicaStatus": "active",
"replicaStatusCode": 1,
"replicaList": [
{
"availGroup": 1,
"isPrimary": true, // indicates if the replica is the
primary or secondary
"dbEngine": 2, // dbEngine ID
"publication": 0 // publication ID
},
{
"availGroup": 1,
"isPrimary": false,
"isSync": true,
"dbEngine": 3,
"publication": 1,
"replPlan": 0
},
{
"availGroup": 1,
"isPrimary": false,
"isSync": false,
"dbEngine": 4,
"publication": 2,
"replPlan": 1,
"recoverOrder": 0,
"transactionID": 132135
}
]
},
{
"id": 2,
"name": "availGroup2",
"description": "Availability Group for XYZ purposes",
"status": "active",
"statusCode": 1,
"statusTime": "2015-11-05T10:00:00",
"statusMsg": "",
"statusActionID": 132,
"isDeployed": false,
"canFailoverToAsyncReplica": false,
"replicaStatus": "inactive",
"replicaStatusCode": 0,
"replicaList": [
{
"availGroup": 2,
"isPrimary": true,
"dbEngine": 2
}
]
}
]
"success": true,
"error":
{
"errorCode": 0,
"message": "Success"
},
"total": 2 // total number of Availability Groups for the query - see Note 1
}
Return:
Error code