You can call the DescribeDBInstanceHAConfig operation to query the high availability mode and data replication mode of an ApsaraDB RDS instance.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes DescribeDBInstanceHAConfig

The operation that you want to perform. Set the value to DescribeDBInstanceHAConfig.

DBInstanceId String Yes rm-uf6wjk5xxxxxx

The ID of the instance.

Response parameters

Parameter Type Example Description
DBInstanceId String rm-uf6wjk5xxxxxx

The ID of the instance.

HAMode String RPO

The high availability mode of the instance. Valid values:

  • RPO: Data consistency is preferred. The instance ensures data reliability to minimize data losses. If you have high requirements on data consistency, select this mode.
  • RTO: Service availability is preferred. The instance restores the database service at the earliest opportunity to ensure service availability. If you have high requirements on service availability, select this mode.
Note This parameter is returned only for instances that run MySQL.
SyncMode String Sync

The data replication mode of the instance. For more information, see Change the data replication mode of an ApsaraDB RDS for MySQL instance. Valid values:

  • Sync: the synchronous mode
  • Semi-sync: the semi-synchronous mode
  • Async: the asynchronous mode
Note This parameter is returned only for instances that run MySQL.
HostInstanceInfos Array of NodeInfo

An array that consists of the information about the primary and secondary instances.

NodeInfo
NodeId String 3397027

The ID of the instance.

NodeType String Master

The role of the instance. Valid values:

  • Master: the primary instance role
  • Slave: the secondary instance role
RegionId String cn-hangzhou

The region ID of the instance.

ZoneId String cn-hangzhou-b

The zone ID of the instance.

SyncStatus String NotAvailable

The synchronization status of the instance. Valid values:

  • NotAvailable: The synchronization fails. This means that faults occur.
  • Syncing: The synchronization is in process. In this case, a primary/secondary switchover may cause data losses.
  • Synchronized: The synchronization is completed.
  • NotSupport: The database engine or version does not involve the synchronization between the primary and secondary instances.
LogSyncTime String 2018-05-05T15:15:00Z

The time when the secondary instance received logs from the primary instance. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

DataSyncTime String 2018-05-05T15:15:00Z

The time when the secondary instance finished the synchronization of data from the primary instance. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

RequestId String 1AD222E9-E606-4A42-BF6D-8A4442913CEF

The ID of the request.

Examples

Sample requests

http(s)://rds.aliyuncs.com/? Action=DescribeDBInstanceHAConfig
&DBInstanceId=rm-uf6wjk5xxxxxx
&<Common request parameters>

Sample success responses

XML format

<DescribeDBInstanceHAConfigResponse>
  <RequestId>103D4ACC-F2F9-4A7E-9ACC-14B0A25613E0</RequestId>
  <DBInstanceId>rm-uf6wjk5xxxxxx</DBInstanceId>
  <HAMode>RPO</HAMode>
  <HostInstanceInfos>
        <NodeInfo>
              <DataSyncTime></DataSyncTime>
              <ZoneId>cn-hangzhou-h</ZoneId>
              <LogSyncTime></LogSyncTime>
              <NodeType>Slave</NodeType>
              <NodeId>13567431</NodeId>
              <SyncStatus>NotSupport</SyncStatus>
              <RegionId>cn-hangzhou</RegionId>
        </NodeInfo>
        <NodeInfo>
              <DataSyncTime></DataSyncTime>
              <ZoneId>cn-hangzhou-h</ZoneId>
              <LogSyncTime></LogSyncTime>
              <NodeType>Master</NodeType>
              <NodeId>14565107</NodeId>
              <SyncStatus>NotSupport</SyncStatus>
              <RegionId>cn-hangzhou</RegionId>
        </NodeInfo>
  </HostInstanceInfos>
  <SyncMode>Semi-sync</SyncMode>
</DescribeDBInstanceHAConfigResponse>

JSON format

{
	"RequestId": "103D4ACC-F2F9-4A7E-9ACC-14B0A25613E0",
	"DBInstanceId": "rm-uf6wjk5xxxxxx",
	"HAMode": "RPO",
	"HostInstanceInfos": {
		"NodeInfo": [
			{
				"DataSyncTime": "",
				"ZoneId": "cn-hangzhou-h",
				"LogSyncTime": "",
				"NodeType": "Slave",
				"NodeId": "13567431",
				"SyncStatus": "NotSupport",
				"RegionId": "cn-hangzhou"
			},
			{
				"DataSyncTime": "",
				"ZoneId": "cn-hangzhou-h",
				"LogSyncTime": "",
				"NodeType": "Master",
				"NodeId": "14565107",
				"SyncStatus": "NotSupport",
				"RegionId": "cn-hangzhou"
			}
		]
	},
	"SyncMode": "Semi-sync"
}

Error codes

For a list of error codes, visit the API Error Center.