All Products
Search
Document Center

Data Management:GetDBTopology

Last Updated:Aug 28, 2026

Queries the topologies of a logical database and its physical database shards.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

dms:GetDBTopology

get

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

LogicDbId

integer

Yes

The ID of the logical database. You can call the ListLogicDatabases or SearchDatabase operation to obtain the logical database ID.

134325

Tid

integer

No

The ID of the tenant.

Note

To view the tenant ID, move the pointer over the profile picture in the upper-right corner of the Data Management (DMS) console. For more information, see Manage DMS tenants.

43215

Response elements

Element

Type

Description

Example

object

Schema of Response

RequestId

string

The ID of the request.

C5B8E84B-42B6-4374-AD5A-6264E1753378

Success

boolean

Indicates whether the request is successful. Valid values:

  • true: The request is successful.

  • false: The request fails.

true

ErrorMessage

string

The error message returned if the request failed.

UnknownError

ErrorCode

string

The error code.

UnknownError

DBTopology

object

The topology of the data table.

LogicDbId

integer

The ID of the logical database.

1234

LogicDbName

string

The name of the logical database.

logic_db_test

SearchName

string

The name of the saved search.

logic_db_test

Alias

string

The alias of the access point.

logic_db_test

DbType

string

The type of the database engine.

polardb

EnvType

string

The type of the environment in which the database instance is deployed. Valid values:

  • product: production environment

  • dev: development environment

  • pre: pre-release environment

  • test: test environment

  • sit: system integration testing (SIT) environment

  • uat: user acceptance testing (UAT) environment

  • pet: stress testing environment

  • stag: staging environment

dev

DBTopologyInfoList

array<object>

The topology information about the physical database shards.

object

DbId

integer

The ID of the database for which the schema design is executed.

423532

SchemaName

string

The name of the logical database.

Note

If the database is a PostgreSQL database, the value of this parameter is the name of the database schema.

db_test@rm-xxx:3306

CatalogName

string

The name of the catalog to which the database belongs.

Note

If the database is a PostgreSQL database, the value of this parameter is the name of the database.

def

SearchName

string

The name of the saved search.

db_test

DbType

string

The type of the database engine.

polardb

EnvType

string

The type of the environment to which the database belongs. Valid values:

  • product: production environment

  • dev: development environment

  • pre: staging environment

  • test: test environment

  • sit: SIT environment

  • uat: user acceptance testing (UAT) environment

  • pet: stress testing environment

  • stag: STAG environment

dev

InstanceId

integer

The ID of the instance. You can call the ListInstances operation to query this value. This is the DMS instance ID, not the RDS instance ID.

4325325

RegionId

string

The ID of the region in which the instance resides.

cn-hangzhou

InstanceResourceId

string

The resource ID of the instance.

rm-xxx

InstanceSource

string

The source of the database instance. Valid values:

  • PUBLIC_OWN: a self-managed database instance that is deployed on the Internet

  • RDS: an ApsaraDB RDS instance

  • ECS_OWN: a self-managed database that is deployed on an Elastic Compute Service (ECS) instance

  • VPC_IDC: a self-managed database instance that is deployed in a data center connected over a virtual private cloud (VPC)

RDS

Examples

Success response

JSON format

{
  "RequestId": "C5B8E84B-42B6-4374-AD5A-6264E1753378",
  "Success": true,
  "ErrorMessage": "UnknownError",
  "ErrorCode": "UnknownError",
  "DBTopology": {
    "LogicDbId": 1234,
    "LogicDbName": "logic_db_test",
    "SearchName": "logic_db_test",
    "Alias": "logic_db_test",
    "DbType": "polardb",
    "EnvType": "dev",
    "DBTopologyInfoList": [
      {
        "DbId": 423532,
        "SchemaName": "db_test@rm-xxx:3306",
        "CatalogName": "def",
        "SearchName": "db_test",
        "DbType": "polardb",
        "EnvType": "dev",
        "InstanceId": 4325325,
        "RegionId": "cn-hangzhou",
        "InstanceResourceId": "rm-xxx",
        "InstanceSource": "RDS"
      }
    ]
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.