All Products
Search
Document Center

Data Management:RegisterInstance

Last Updated:Oct 19, 2026

Registers a new database instance in DMS.

Operation description

Before you begin: Your user role must be Administrator or DBA. You can call the ListUsers or GetUser operation to obtain the RoleIdList of the user role.

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:RegisterInstance

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

Tid

integer

No

The tenant ID. You can call the GetUserActiveTenant operation to obtain the value of this parameter.

3***

InstanceType

string

Yes

The database type. For valid values, see DbType parameter description.

MySQL

InstanceSource

string

Yes

The source of the database instance. Valid values:

  • PUBLIC_OWN: self-managed instance connected over the Internet

  • RDS: ApsaraDB RDS instance

  • ECS_OWN: self-managed instance hosted on an ECS instance

  • VPC_IDC: self-managed instance in a VPC-connected IDC

RDS

NetworkType

string

Yes

The network type. Valid values:

  • CLASSIC: classic network

  • VPC: VPC

VPC

EnvType

string

Yes

The environment type. Valid values:

  • product: production environment

  • dev: development environment

  • pre: staging environment

  • test: test environment

  • sit: SIT environment

  • uat: UAT environment

  • pet: stress testing environment

  • stag: STAG environment

product

EcsInstanceId

string

No

The ECS instance ID.

Note

This parameter is required if InstanceSource is set to ECS_OWN.

i-2zei9gs1t7h8l7ac****

VpcId

string

No

The VPC ID.

Note

This parameter is required if InstanceSource is set to VPC_IDC.

vpc-xxxxxxxxxxxxxxxxxxxxx

EcsRegion

string

No

The region where the instance resides.

Note

This parameter is required if InstanceSource is set to RDS, ECS_OWN, or VPC_IDC.

cn-hangzhou

Host

string

Yes

The host address of the destination database.

172.XX.XXX.254

Port

integer

Yes

The access port of the destination database.

3306

Sid

string

No

The SID of the database.

Note

This parameter is required if InstanceType is set to ORACLE.

test_sid

DatabaseUser

string

Yes

The username used to access the database.

dmstest

DatabasePassword

string

Yes

The password used to access the database.

Example_passw0rd

InstanceAlias

string

Yes

The alias of the instance. This alias helps you quickly identify and locate the instance.

test_instance

DbaUid

integer

Yes

The UID of the user who assumes the DBA role for the instance. You can call the ListUsers or GetInstance operation to obtain the value of this parameter.

22275482072787****

SafeRule

string

Yes

The security rule set (GroupName) of the instance. You can call the ListStandardGroups or GetInstance operation to obtain the value of this parameter.

test_rule

QueryTimeout

integer

Yes

The query timeout period. Unit: seconds.

60

ExportTimeout

integer

Yes

The export timeout period. Unit: seconds.

600

DataLinkName

string

No

The name of the datalink for cross-database query.

Note
  • This parameter is required if UseDsql is set to 1.

  • The datalink name can only contain lowercase letters and underscores (_).

  • The datalink name must be globally unique within the tenant.

dblink_test

DdlOnline

integer

No

Specifies whether schema evolution is prioritized. Valid values:

  • 0: not used

  • 1: native lock-free takes priority, falling back to execute in DMS if failed

  • 2: execute via DMS lock-free

Note

Supported database types: ApsaraDB RDS for MySQL, PolarDB for MySQL engine, ApsaraDB MyBase for MySQL, and MySQL databases from other sources.

2

UseDsql

integer

No

Specifies whether to enable cross-instance query. Valid values:

  • 0: disabled

  • 1: enabled

Note

Supported database types: MySQL, SQL Server, PostgreSQL, PolarDB for PostgreSQL (Compatible with Oracle), and Redis.

1

SkipTest

boolean

No

Specifies whether the instance ignores the connectivity test. Valid values:

  • true: ignored

  • false: not ignored

true

EnableSellSitd

string

No

Specifies whether to enable sensitive data protection. Valid values:

  • Y: enables sensitive data protection

  • NULL or other values: disables sensitive data protection

Y

TemplateId

integer

No

The ID of the classification template. You can call the ListClassificationTemplates operation to obtain the value of this parameter.

31***

TemplateType

string

No

The classification template type. You can call the ListClassificationTemplates operation to obtain the value of this parameter.

INNER

DbaUidByString

string

No

The string used to replace the DbaUid field. You can enter a non-numeric DBA UID, such as a role account.

22275482072787****

ResourceGroup

string

No

The name of the resource group to which the instance belongs.

group1

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

F4E2A94B-604F-43FF-93E7-F4EE3DCF412E

ErrorCode

string

The error code.

UnknownError

ErrorMessage

string

The error message.

UnknownError

Success

boolean

Indicates whether the request is successful. Valid values:

  • true: The request is successful.

  • false: The request fails.

true

Examples

Success response

JSON format

{
  "RequestId": "F4E2A94B-604F-43FF-93E7-F4EE3DCF412E",
  "ErrorCode": "UnknownError",
  "ErrorMessage": "UnknownError",
  "Success": true
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.