All Products
Search
Document Center

ApsaraDB RDS:GetDBInstanceTopology

Last Updated:May 29, 2023

Queries the topology of an instance.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
rds:GetDBInstanceTopologyRead
  • RDS
    acs:rds:{#regionId}:{#accountId}:dbinstance/{#dbinstanceId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
DBInstanceIdstringYes

The ID of the instance.

rm-uf6wjk5*******

Response parameters

ParameterTypeDescriptionExample
object
Codestring

The network type of the endpoint. Valid values:

  • vpc
  • public
None
Messagestring

The ID of the instance.

NoteThe value -1 is returned for an instance that does not reside in a dedicated cluster.
None
RequestIdstring

The ID of the zone.

7430AB1A-6D49-5B6D-B9E5-920250076074
Dataobject

The endpoint that is used to connect to the instance.

DBInstanceNamestring

The network connection of the instance.

rm-m5ezban**********
Connectionsobject []

An internal parameter. You can ignore this parameter.

ZoneIdstring

The ID of the instance.

cn-qingdao-c
DBInstanceNamestring

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

rm-m5ezban**********
ConnectionStringstring

The node information.

rm-m5ezban**********.mysql.rds.aliyuncs.com
NetTypestring

An internal parameter. You can ignore this parameter.

vpc
Nodesobject []

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

DBInstanceNamestring

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

NoteIf the instance does not reside in the dedicated cluster, no value is returned.
rm-m5ezban**********
ZoneIdstring

The ID of the dedicated cluster.

NoteIf the instance does not reside in the specified dedicated cluster, no value is returned.
cn-qingdao-c
DedicatedHostIdstring

The ID of the zone.

i-bpxxxxxxx
Rolestring

The type of the node. Valid values:

  • Master: a primary node
  • Slave: a secondary node
master
NodeIdstring

The ID of the instance.

349054
DedicatedHostGroupIdstring

Details about the topology.

dhg-4n*****

Examples

Sample success responses

JSONformat

{
  "Code": "None",
  "Message": "None",
  "RequestId": "7430AB1A-6D49-5B6D-B9E5-920250076074",
  "Data": {
    "DBInstanceName": "rm-m5ezban**********",
    "Connections": [
      {
        "ZoneId": "cn-qingdao-c",
        "DBInstanceName": "rm-m5ezban**********",
        "ConnectionString": "rm-m5ezban**********.mysql.rds.aliyuncs.com",
        "NetType": "vpc"
      }
    ],
    "Nodes": [
      {
        "DBInstanceName": "rm-m5ezban**********",
        "ZoneId": "cn-qingdao-c",
        "DedicatedHostId": "i-bpxxxxxxx",
        "Role": "master",
        "NodeId": "349054",
        "DedicatedHostGroupId": "dhg-4n*****"
      }
    ]
  }
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidActionSpecified action is not valid.-
403DBInstanceStatusNotActiveThe status of the current instance is not active.The operation failed. Check the status of the RDS instance.
403DBTypeNotSupportedThe database type is not supported.The database engine is not supported.
403IncorrectDBInstanceTypeCurrent DB instance type does not support this operation.The operation failed. The RDS instance is not in a ready state.
404InvalidDBInstance.NotFoundThe specified instance does not exist or is not supported.The RDS instance cannot be found. Check the ID or name of the RDS instance.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2022-10-28The error codes of the API operation change.
Change itemChange content
Error CodesThe error codes of the API operation change.
    Error Codes 403 change
    delete Error Codes: 400
    delete Error Codes: 404
2022-06-13Add Operation