All Products
Search
Document Center

Data Management:AddInstance

Last Updated:Jan 23, 2026

This operation adds a database instance to Data Management (DMS) and lets you enable security hosting for the instance.

Operation description

You must have the Database Administrator (DBA) or administrator role. For more information about how 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

To obtain the tenant ID, move the pointer over your profile picture in the upper-right corner of the DMS console.

23****

InstanceType

string

Yes

The database type. For more information, see DbType parameter.

MySQL

InstanceSource

string

Yes

The source of the instance. Valid values:

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

  • RDS: an ApsaraDB RDS instance.

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

  • VPC_IDC: a self-managed database in a data center that is connected to Alibaba Cloud through a Virtual Private Cloud (VPC).

  • GATEWAY: a database instance that is connected through a database gateway.

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 instance ID. For example, if your instance is a database gateway instance, enter the gateway ID.

Note

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

i-2zei9gs1t7h8l7ac****

VpcId

string

No

The ID of the VPC.

Note

This parameter is required if you set InstanceSource to VPC_IDC.

vpc-2zef4o1hu7ljd****

EcsRegion

string

No

The region where the instance resides.

Note

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

cn-hangzhou

Host

string

Yes

The database endpoint.

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

Port

integer

Yes

The port used to connect to the database.

3306

Sid

string

No

The system ID (SID) of the instance.

Note

This parameter is required if you set InstanceType to ORACLE.

testSid

DatabaseUser

string

Yes

The database account.

testsdb

DatabasePassword

string

Yes

The password for the database account.

test***

InstanceAlias

string

Yes

The alias of the instance. The alias helps you identify the instance.

测试实例

DbaId

integer

Yes

The ID of the user who has the DBA role for the instance. To obtain the user ID, call the ListUsers or GetInstance operation.

27****

QueryTimeout

integer

Yes

The timeout period for queries. Unit: seconds.

7200

ExportTimeout

integer

Yes

The timeout period for exports. Unit: seconds.

86400

EnableSellTrust

string

Yes

Specifies whether to enable security hosting for the instance.

  • Y: Enable security hosting.

  • N: Do not enable security hosting.

Y

EnableSellStable

string

No

Specifies whether to enable the Stable Change feature for the instance.

  • Y: Enable the feature.

  • N: Do not enable the feature.

N

EnableSellCommon

string

No

Specifies whether to enable the Security Collaboration feature for the instance.

  • Y: Enable the feature.

  • N: Do not enable the feature.

Y

SafeRule

string

No

The security rule set (GroupName) for the instance. This parameter is required if you enable the Security Collaboration feature. To obtain the value of this parameter, call the ListStandardGroups or GetInstance operation.

金融线-生产

EnableSellSitd

string

No

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

  • Y: Enable the feature.

  • N: Do not enable the feature.

Y

DataLinkName

string

No

The name of the cross-database query DBLink.

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

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

  • The DBLink name must be unique within the tenant.

dblink_test

DdlOnline

integer

No

Specifies whether to prioritize DMS for schema evolution. Valid values:

  • 0: Do not prioritize DMS.

  • 1: Prioritize native online DDL.

  • 2: Prioritize DMS lock-free schema evolution.

Note

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

2

UseDsql

integer

No

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

  • 0: Do not enable.

  • 1: Enable.

Note

Supported database types: MySQL, SQL Server, PostgreSQL, PolarDB for Oracle, and Redis.

1

SkipTest

boolean

No

Specifies whether to skip the connectivity test. Valid values:

  • true: Skip the test.

  • false: Do not skip the test.

false

TemplateId

integer

No

The ID of the data classification template. To obtain the template ID, call the ListClassificationTemplates operation.

31***

TemplateType

string

No

The type of the data classification template. To obtain the template type, call the ListClassificationTemplates operation.

INNER

UseSsl

integer

No

Specifies whether to enable SSL encryption. If you enable this feature, DMS connects to the database over an SSL-encrypted connection. This parameter is valid only if the database supports SSL encryption. Valid values:

  • 0: Default value. DMS automatically negotiates with the database to determine whether to use an SSL connection. If the database supports SSL, DMS connects to the database over an SSL-encrypted connection. If the database does not support SSL, DMS connects to the database over a regular connection.

  • 1: Enable SSL encryption. This value is invalid if the database does not support SSL.

  • -1: Disable SSL encryption.

Note
  • This parameter is available only for MySQL and Redis databases.

  • Secure Sockets Layer (SSL) encrypts network connections at the transport layer to improve the security and integrity of data in transit. However, it may increase the response time of network connections.

0

Response elements

Element

Type

Description

Example

object

RequestId

string

The ID of the request. You can use the ID to query 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 was successful. Valid values:

  • true: The request was 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.