All Products
Search
Document Center

Data Management:AddInstance

Last Updated:Jul 15, 2026

Registers a database instance in Data Management Service (DMS) and enables security hosting for the instance.

Operation description

Your system role must be DBA or administrator. To view your system role, see View my system 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:AddInstance

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

Tid

integer

No

The tenant ID.

Note

You can find the tenant ID by hovering over the profile icon in the upper-right corner of the DMS console.

23****

InstanceType

string

Yes

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

MySQL

InstanceSource

string

Yes

The source of the instance. Valid values:

  • PUBLIC_OWN: a self-managed instance connected over the Internet.

  • RDS: an ApsaraDB RDS instance.

  • ECS_OWN: a self-managed instance on an ECS instance.

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

  • GATEWAY: a Database Gateway instance.

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: pre-release environment

  • test: test environment

  • sit: SIT environment

  • uat: UAT environment

  • pet: stress testing environment

  • stag: STAG environment

product

EcsInstanceId

string

No

The instance ID. For example, if the instance is a Database Gateway instance, specify the gateway ID.

Note

This parameter is required if InstanceSource is set to ECS_OWN or GATEWAY.

i-2zei9gs1t7h8l7ac****

VpcId

string

No

The instance ID of the VPC.

Note

This parameter is required if InstanceSource is set to VPC_IDC.

vpc-2zef4o1hu7ljd****

EcsRegion

string

No

The region in which the instance resides.

Note

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

cn-hangzhou

Host

string

Yes

The database connection address.

rm-bp1g3tf90******.sqlserver.rds.aliyuncs.com

Port

integer

Yes

The database connection port.

3306

Sid

string

No

The SID of the instance.

Note

This parameter is required if InstanceType is set to ORACLE.

testSid

DatabaseUser

string

Yes

The database account.

testsdb

DatabasePassword

string

Yes

The database password.

test***

InstanceAlias

string

Yes

The alias of the instance, which helps you quickly identify the instance.

Test instance

DbaId

integer

Yes

The user ID of the DBA for the instance. You can call the ListUsers or GetInstance operation to obtain this value.

27****

QueryTimeout

integer

Yes

The query timeout period. Unit: seconds.

7200

ExportTimeout

integer

Yes

The export timeout period. Unit: seconds.

86400

EnableSellTrust

string

Yes

Specifies whether to enable security hosting for the instance. Valid values:

  • Y: Enable security hosting mode.

  • N: Do not enable security hosting mode.

Y

EnableSellStable

string

No

Specifies whether to enable the stable change feature for the instance. Valid values:

  • Y: Enable.

  • N: Do not enable.

N

EnableSellCommon

string

No

Specifies whether to enable the security collaboration feature for the instance. Valid values:

  • Y: Enable.

  • N: Do not enable.

Y

SafeRule

string

No

If you want to enable the security collaboration feature, you must specify the security rule set (GroupName) for the instance. You can call the ListStandardGroups or GetInstance operation to obtain this value.

Finance-production

EnableSellSitd

string

No

Specifies whether to enable the sensitive data protection feature for the instance. Valid values:

  • Y: Enable.

  • N: Do not enable.

Y

DataLinkName

string

No

The name of the cross-database query datalink.

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

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

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

dblink_test

DdlOnline

integer

No

Specifies whether to enable DMS-prioritized structure change. Valid values:

  • 0: Do not use.

  • 1: Native Online DDL takes priority.

  • 2: DMS locked table-free structure change takes priority.

Note

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

2

UseDsql

integer

No

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

  • 0: Disable.

  • 1: Enable.

Note

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

1

SkipTest

boolean

No

Specifies whether to skip the connectivity test for the instance. Valid values:

  • true: Skip.

  • false: Do not skip.

false

TemplateId

integer

No

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

31***

TemplateType

string

No

The categorization templatetype. You can call the ListClassificationTemplates operation to obtain this value.

INNER

UseSsl

integer

No

Specifies whether to enable SSL for database connections. After SSL is enabled, DMS connects to the database over SSL. The database must have SSL enabled before you use this parameter. Valid values:

  • 0: Default value (DMS and the database service automatically negotiate whether to enable SSL). The system automatically identifies whether the target database has SSL enabled. If SSL is enabled on the database, DMS connects over SSL. Otherwise, DMS connects without SSL.

  • 1: Enable SSL connections. If the database does not have SSL enabled, this parameter does not take effect.

  • -1: Disable SSL connections.

Note
  • This configuration item is available only when the database type is MySQL or Redis.

  • SSL (Secure Sockets Layer) encrypts network connections at the transport layer, improving the security and integrity of communication data, but increases network connection response time.

0

RoleArn

string

No

The ARN of the authorized role in the target account, used for cross-tenant instance registration.

acs:ram::1760865*********:role/dms-role-arn

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID. You can use this ID to locate logs and troubleshoot issues.

0C1CB646-1DE4-4AD0-B4A4-7D47DD52E931

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 failed.

true

Examples

Success response

JSON format

{
  "RequestId": "0C1CB646-1DE4-4AD0-B4A4-7D47DD52E931",
  "ErrorCode": "UnknownError",
  "ErrorMessage": "UnknownError",
  "Success": true
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.