Imports database assets into a bastion host. Supported database types include MySQL, SQL Server, and PostgreSQL for ApsaraDB RDS instances, MySQL, PostgreSQL, and PostgreSQL (Compatible with Oracle) for PolarDB clusters, and MySQL, SQL Server, PostgreSQL, and Oracle for self-managed databases.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
yundun-bastionhost:CreateDatabase |
create |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| InstanceId |
string |
Yes |
The ID of the bastion host instance. Note
You can call the DescribeInstances operation to obtain this parameter. |
bastionhost-cn-7mz2g5hu20e |
| RegionId |
string |
No |
The region ID of the bastion host. Note
For the mapping between region IDs and region names, see Regions and zones. |
cn-shanghai |
| NetworkDomainId |
string |
No |
The ID of the network domain to which the new database belongs. Note
You can call the ListNetworkDomains operation to obtain this parameter. |
1 |
| DatabaseType |
string |
Yes |
The database type. Valid values:
|
MySQL |
| ActiveAddressType |
string |
Yes |
The address type of the new database. Valid values:
|
Public |
| DatabasePrivateAddress |
string |
No |
The private network address. IPv4 addresses and domain name formats are supported. Note
This parameter is required when ActiveAddressType is set to Private. |
192.168.XX.XX |
| DatabasePublicAddress |
string |
No |
The public address. IPv4 addresses and domain name formats are supported. Note
This parameter is required when ActiveAddressType is set to Public. |
www.example.com |
| DatabasePort |
integer |
No |
The port used to access the database. This parameter is required when the database source is Local. |
5433 |
| DatabaseName |
string |
No |
The name of the new database instance. This parameter is required when the database source is Local. |
Test01 |
| SourceInstanceId |
string |
No |
The instance ID of the new database. Note
This parameter is required when Source is set to Rds or PolarDB. |
i-bp19ienyt0yax748**** |
| Source |
string |
Yes |
The source of the new database. Valid values:
|
Local |
| Comment |
string |
No |
The remarks of the new database. The value can be up to 500 characters in length. |
cpp |
| SourceInstanceRegionId |
string |
No |
The region ID of the new database instance. Note
This parameter is required when Source is set to Rds or PolarDB. |
cn-shanghai |
| PolarDBEndpointType |
string |
No |
The endpoint type of the PolarDB cluster. This parameter is required when Source is set to PolarDB. Valid values:
|
Cluster |
| InstanceMemberId |
integer |
No |
The ID of the Alibaba Cloud account to which the new ApsaraDB RDS or PolarDB database instance belongs. |
1605494xxxx |
|
No |
The project ID. |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| DatabaseId |
string |
The instance ID of the database. |
334 |
| RequestId |
string |
The request ID. |
98EDD923-236C-5A88-88E7-4979A91B9325 |
Examples
Success response
JSON format
{
"DatabaseId": "334",
"RequestId": "98EDD923-236C-5A88-88E7-4979A91B9325"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidParameter | The argument is invalid. | The argument is invalid. |
| 400 | LicenseOutOfLimit | The maximum number of hosts exceeds the license limit. | The maximum number of hosts exceeds the license limit. |
| 400 | DatabaseAlreadyExists | The database already exists. | The database already exists. |
| 500 | InternalError | An unknown error occurred. | An unknown error occurred. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.