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 persistence is preferred. The instance preferentially ensures data reliability to minimize data loss. Use this mode if you have high requirements on data consistency.
  • RTO: Instance availability is preferred. The instance restores your database service at the earliest opportunity to ensure availability. Use this mode if you have high requirements on service availability.
Note This parameter is returned only for instances that run MySQL.
SyncMode String Sync

The data replication mode of the instance. Valid values:

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

An array that consists of the information of 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: primary
  • Slave: secondary
RegionId String cn-hangzhou

The ID of the region to which the instance belongs.

ZoneId String cn-hangzhou-b

The ID of the zone to which the instance belongs.

SyncStatus String NotAvailable

The status of synchronization on the instance. Valid values:

  • NotAvailable: Synchronization fails. This means faults occur.
  • Syncing: Synchronization is in process. In this case, if you perform a primary/secondary switchover, data may be lost.
  • Synchronized: Synchronization is complete.
  • NotSupport: The engine type or version does not support synchronization between the primary and secondary instances.
LogSyncTime String 2018-05-05T15:15:00Z

The time when the secondary instance received the 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 data synchronization. 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>
	  <dBInstanceId>rm-uf6wjk5xxxxxx</dBInstanceId>
	  <hAMode>RPO</hAMode>
	  <hostInstanceInfos>
		    <logSyncTime>2018-01-19T12:33:06Z</logSyncTime>
		    <nodeId>3397027</nodeId>
		    <nodeType>Slave</nodeType>
		    <regionId>cn-shenzhen</regionId>
		    <syncStatus>Syncing</syncStatus>
		    <zoneId>cn-shenzhen-b</zoneId>
	  </hostInstanceInfos>
	  <hostInstanceInfos>
		    <logSyncTime>2018-01-19T12:33:06Z</logSyncTime>
		    <nodeId>3397029</nodeId>
		    <nodeType>Master</nodeType>
		    <regionId>cn-shenzhen</regionId>
		    <syncStatus>Syncing</syncStatus>
		    <zoneId>cn-shenzhen-a</zoneId>
	  </hostInstanceInfos>
	  <requestId>F051AEB2-7655-4F0A-BC46-7E0C18A7910C</requestId>
	  <syncMode>Semi-sync</syncMode>
</DescribeDBInstanceHAConfigResponse>

JSON format

{
    "dBInstanceId": "rm-uf6wjk5xxxxxx",
    "hAMode": "RPO",
    "hostInstanceInfos": [
        {
            "logSyncTime": "2018-01-19T12:33:06Z",
            "nodeId": "3397027",
            "nodeType": "Slave",
            "regionId": "cn-shenzhen",
            "syncStatus": "Syncing",
            "zoneId": "cn-shenzhen-b"
        },
        {
            "logSyncTime": "2018-01-19T12:33:06Z",
            "nodeId": "3397029",
            "nodeType": "Master",
            "regionId": "cn-shenzhen",
            "syncStatus": "Syncing",
            "zoneId": "cn-shenzhen-a"
        }
    ],
    "requestId": "F051AEB2-7655-4F0A-BC46-7E0C18A7910C",
    "syncMode": "Semi-sync"
}

Error codes

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