You can call the GetDBInstanceTopology operation to obtain the topology of an 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 GetDBInstanceTopology

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

DBInstanceId String Yes rm-uf6wjk5*******

The ID of the instance. You can call the DescribeDBInstances operation to query the ID of the instance.

Response parameters

Parameter Type Example Description
Code String None

An internal parameter. You can ignore this parameter.

Message String None

An internal parameter. You can ignore this parameter.

RequestId String 7430AB1A-6D49-5B6D-B9E5-920250076074

The ID of the request.

Data Object

Details about the topology.

DBInstanceName String rm-m5ezban**********

The ID of the instance.

Connections Array of Connection

The network connection of the instance.

ZoneId String cn-qingdao-c

The ID of the zone.

DBInstanceName String rm-m5ezban**********

The ID of the instance.

ConnectionString String rm-m5ezban**********.mysql.rds.aliyuncs.com

The endpoint that is used to connect to the instance.

NetType String vpc

The network type of the endpoint. Valid values:

  • vpc
  • public
Nodes Array of Node

The node information.

DBInstanceName String rm-m5ezban**********

The ID of the instance.

ZoneId String cn-qingdao-c

The ID of the zone.

DedicatedHostId String i-bpxxxxxxx

The ID of the host on which the instance resides in the dedicated cluster.

Note If the instance does not reside in the dedicated cluster, no value is returned.
Role String master

The type of the node. Valid values:

  • Master: a primary node
  • Slave: a secondary node
NodeId String 349054

The ID of the instance.

Note The value -1 is returned for an instance that does not reside in a dedicated cluster.
DedicatedHostGroupId String dhg-4n*****

The ID of the dedicated cluster.

Note If the instance does not reside in the specified dedicated cluster, no value is returned.

Examples

Sample requests

http(s)://rds.aliyuncs.com/?Action=GetDBInstanceTopology
&DBInstanceId=rm-uf6wjk5*******
&Common request parameters

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<GetDBInstanceTopologyResponse>
    <RequestId>CF5A551A-80EF-1D3D-8F43-6B52C1E2EF71</RequestId>
    <Data>
    </Data>
</GetDBInstanceTopologyResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "CF5A551A-80EF-1D3D-8F43-6B52C1E2EF71",
  "Data" : {
    "Connections" : [ ],
    "Nodes" : [ ]
  }
}

Error codes

HTTP status code Error code Error message Description
400 InvalidAction Specified action is not valid. The error message returned because the operation is not supported.
403 DBInstanceStatusNotActive The status of the current instance is not active. The error message returned because the status of the instance does not support the operation.
403 DBTypeNotSupported The database type is not supported. The error message returned because the database type is not supported.
404 InvalidDBInstance.NotFound The specified instance does not exist or is not supported. The error message returned because the specified instance is not found. Check the ID of the instance.

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