All Products
Search
Document Center

ApsaraDB RDS:GetDBInstanceTopology

Last Updated:May 11, 2024

Queries the topology of an instance.

Operation description

Supported database engines

  • RDS MySQL
  • RDS PostgreSQL
  • RDS SQL Server
  • RDS MariaDB

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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
  • DBInstance
    acs:rds:{#regionId}:{#accountId}:dbinstance/{#dbinstanceId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
DBInstanceIdstringYes

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

rm-uf6wjk5*******

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

Codestring

An internal parameter. You can ignore this parameter.

None
Messagestring

An internal parameter. You can ignore this parameter.

None
RequestIdstring

The ID of the request.

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

The details about the topology.

DBInstanceNamestring

The instance ID.

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

The network connection information of the instance.

ZoneIdstring

The zone ID of the instance.

cn-qingdao-c
DBInstanceNamestring

The instance ID.

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

The endpoint that is used to connect to the database instance.

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

The network type of the endpoint. Valid values:

  • vpc
  • public
vpc
Nodesobject []

The queried nodes.

DBInstanceNamestring

The ID of the instance.

rm-m5ezban**********
ZoneIdstring

The zone ID of the instance.

cn-qingdao-c
DedicatedHostIdstring

The host ID of the instance in the dedicated cluster.

Note : If the instance does not reside in the specified dedicated cluster, no value is returned.
i-bpxxxxxxx
Rolestring

The type of the node. The following result is returned:

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

The ID of the instance.

Note : The value **-1** is returned for an instance that does not reside in a dedicated cluster.
349054
DedicatedHostGroupIdstring

The ID of the dedicated cluster.

Note : If the instance does not reside in the specified dedicated cluster, no value is returned.
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 code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    Error Codes 403 change
    delete Error Codes: 400
    delete Error Codes: 404
2022-06-13Add Operationsee changesets