Adds a database instance to Data Management (DMS) and enable security hosting for the instance.
Operation description
You must be a database administrator (DBA) or a DMS administrator. For more information, see View system roles.
Debugging
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:
- For mandatory resource types, indicate with a prefix of * .
- If the permissions cannot be granted at the resource level,
All Resourcesis 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.
| Operation | Access level | Resource type | Condition key | Associated operation |
|---|---|---|---|---|
| dms:AddInstance | create | *All Resources * |
| none |
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| Tid | long | No | The ID of the tenant. Note
You can move the pointer over the profile picture in the upper-right corner of the DMS console to obtain the tenant ID.
| 23**** |
| InstanceType | string | Yes | The type of the database instance. For more information about the valid values of this parameter, see DbType parameter. | MySQL |
| InstanceSource | string | Yes | The source of the database instance. Valid values:
| RDS |
| NetworkType | string | Yes | The network type. Valid values:
| VPC |
| EnvType | string | Yes | The type of the environment to which the database instance belongs. Valid values:
| product |
| EcsInstanceId | string | No | The ID of the instance. If your instance is a database instance connected by using a database gateway, specify the gateway ID for this parameter. Note
This parameter is required if InstanceSource is set to ECS_OWN or GATEWAY.
| i-2zei9gs1t7h8l7ac**** |
| VpcId | string | No | The ID of the instance connected over a VPC. Note
This parameter is required if InstanceSource is set to VPC_IDC.
| vpc-2zef4o1hu7ljd**** |
| EcsRegion | string | No | The region in which the ECS 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 endpoint that is used to connect to the database. | 172.XX.XXX.254 |
| Port | integer | Yes | The port that is used to connect to the database. | 3306 |
| Sid | string | No | The system ID (SID) of the database instance. Note
This parameter is required if InstanceType is set to ORACLE.
| testSid |
| DatabaseUser | string | Yes | The name of the database account. | testsdb |
| DatabasePassword | string | Yes | The password of the database account. | test*** |
| InstanceAlias | string | Yes | The alias of the database instance. Specify an alias that can help you identify the database instance in DMS. | |
| DbaId | long | Yes | The ID of the user who assumes the database administrator (DBA) role. You can call the ListUsers or GetInstance operation to obtain the value of this parameter. | 27**** |
| QueryTimeout | integer | Yes | The timeout period for querying data from the database instance. Unit: seconds. | 7200 |
| ExportTimeout | integer | Yes | The timeout period for exporting data from the database instance. Unit: seconds. | 86400 |
| EnableSellTrust | string | Yes | Specifies whether to enable the security hosting feature for the database instance. Valid values:
| Y |
| EnableSellStable | string | No | Specifies whether to enable Stable Change for the database instance. Valid values:
| NULL |
| EnableSellCommon | string | No | Specifies whether to enable Security Collaboration for the database instance. Valid values:
| Y |
| SafeRule | string | Yes | The name of the security rule set for the database instance. This parameter is required if Security Collaboration is enabled. You can call the ListStandardGroups or GetInstance operation to obtain the name of the security rule set from GroupName. | |
| EnableSellSitd | string | No | Specifies whether to enable sensitive data protection. Valid values:
| Y |
| DataLinkName | string | No | The name of the database link for cross-database queries. Note
| dblink_test |
| DdlOnline | integer | No | Specifies whether to enable Lock-free Schema Change. Valid values:
Note
Supported databases include ApsaraDB RDS for MySQL, PolarDB for MySQL, ApsaraDB MyBase for MySQL, and third-party MySQL databases.
| 2 |
| UseDsql | integer | No | Specifies whether to enable cross-database query for the database instance. Valid values:
Note
Supported databases include MySQL, SQL Server, PostgreSQL, PolarDB for Oracle, and Redis.
| 1 |
| SkipTest | boolean | No | Specifies whether to skip the connectivity test. Valid values:
| false |
| TemplateId | long | No | The ID of the classification and grading template. You can call the ListClassificationTemplates operation to query the template ID. | 31*** |
| TemplateType | string | No | The type of the classification and grading template. You can call the ListClassificationTemplates operation to query the template type. | INNER |
| UseSsl | integer | No | Specifies whether to allow Data Management Service (DMS) to connect to the database instance by using SSL connections. Before you use SSL connections, make sure that the SSL encryption feature is enabled for the database instance. Valid values:
Note
| 0 |
Response parameters
Examples
Sample success responses
JSONformat
{
"RequestId": "0C1CB646-1DE4-4AD0-B4A4-7D47DD52E931",
"ErrorCode": "UnknownError",
"ErrorMessage": "UnknownError",
"Success": true
}Error codes
For a list of error codes, visit the Service error codes.
Change history
| Change time | Summary of changes | Operation |
|---|---|---|
| 2024-03-20 | The request parameters of the API has changed | View Change Details |
