You can call this operation to add a database.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | AddDatabase |
The operation that you want to perform. Set the value to AddDatabase. |
DbPassword | String | Yes | password |
The password used to access the database. Note It is used only to verify whether the database can be connected.
|
DbType | String | Yes | MySQL |
The type of the database. Note Only MySQL databases are supported.
|
DbUserName | String | Yes | dg_test |
The username used to access the database. |
GatewayId | String | Yes | dg-yhss6sdlaff**** |
The ID of the gateway. |
Host | String | Yes | 11.*.*.109 |
The address of the database accessed by using the host where the gateway resides. |
Port | Integer | Yes | 3440 |
The port of the database accessed by using the host where the gateway resides. |
DbDescription | String | No | Database in a development environment |
The database description. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
Code | String | OK |
The status code. |
Data | String | xxx |
The database instance ID returned by the service side. |
ErrorMsg | String | None |
The error message. |
RequestId | String | EAF2AA07-860D-43DA-BEE8-1E43AAE024CD |
The ID of the request. |
Success | Boolean | true |
Indicates whether the call is successful. |
Examples
Sample requests
http(s)://dg.[regionId].aliyuncs.com/?Action=AddDatabase
&DbPassword=password
&DbType=MySQL
&DbUserName=dg_test
&GatewayId=dg-yhss6sdlaffaq68
&Host=11.163.23.109
&Port=3440
&<Common request parameters>
Sample success responses
XML
format
<AddDatabaseResponse>
<RequestId>EAF2AA07-860D-43DA-BEE8-1E43AAE024CD</RequestId>
</AddDatabaseResponse>
JSON
format
{
"RequestId":"EAF2AA07-860D-43DA-BEE8-1E43AAE024CD"
}
Error codes
For a list of error codes, visit the API Error Center.