Adds a database instance.

Before you call this operation, make sure that the following requirements are met:

  • If you use an Alibaba Cloud SDK, the version of aliyun-sdk-core must be later than V4.3.3. We recommend that you use the latest version.
  • The version of Database Autonomy Service (DAS) SDK that you use must be V1.0.2 or later.
  • When you use an SDK to call DAS API operations, you must set the Region parameter to cn-shanghai.

Request parameters

Parameter Type Required Example Description
Action String Yes AddHDMInstance

The operation that you want to perform. Set the value to AddHDMInstance.

Uid String No hdm_df02bbfd3bd64c7bb1982e5323a6

The ID of your Alibaba Cloud account. You can obtain the ID of your Alibaba Cloud account on the Security Settings page in the Alibaba Cloud account management center.

accessKey String No None

A hidden parameter.

signature String No None

A hidden parameter.

timestamp String No None

A hidden parameter.

__context String No None

A hidden parameter.

skipAuth String No None

A hidden parameter.

UserId String No None

A hidden parameter.

InstanceArea String No ECS

The type of the database instance. Valid values:

  • RDS: an Alibaba Cloud database instance
  • ECS: a self-managed database instance that is deployed on an Elastic Compute Service (ECS) instance
  • IDC: a self-managed database instance that is not deployed on Alibaba Cloud
Note IDC refers to your data center. If this value is used, the database instance is deployed in your data center.
InstanceId String No rm-2ze1jdv45i7l6****

The ID of the database instance that you want to add. You can call the DescribeDBInstances operation to query the ID of the database instance.

Ip String No rm-2ze1jdv45i7l6****.mysql.rds.aliyuncs.com

The private endpoint of the database instance that you want to add. You can call the DescribeDBInstances operation to query the endpoint of the database instance.

Port String No 3306

The port that is used to connect to the database instance over an internal network. You can call the DescribeDBInstances operation to query the port of the database instance.

Engine String No MySQL

The database engine that the database instance runs or the Alibaba Cloud database service in which the database instance is created. Valid values:

  • MySQL
  • PostgreSQL
  • PolarDB MySQL
  • PolarDB PostgreSQL
  • Redis
  • MongoDB
  • PolarDB O
  • PolarDB X
Username String No test****

The username that is used to log on to the database instance.

Password String No 122****

The password that is used to log on to the database instance.

InstanceAlias String No yuecq--test****

The name of the database instance.

NetworkType String No VPC

The network type of the database instance.

VpcId String No vpc-m5e666n89m2bx8jar****

The ID of the virtual private cloud (VPC) in which the database instance is deployed.

Region String No cn-hangzhou

The ID of the region in which the database instance is deployed.

FlushAccount String No None

A hidden parameter.

Response parameters

Parameter Type Example Description
Message String Successful

The returned message for the request.

Note If the request is successful, Successful is returned. If the request fails, an error message that includes an error code is returned.
RequestId String B6D17591-B48B-4D31-9CD6-9B9796B2****

The ID of the request.

Synchro String None

A hidden parameter.

Data Object

The details of the response, such as the HTTP status code and the number of returned entries.

VpcId String vpc-m5e666n89m2bx8jar****

The ID of the VPC in which the database instance is deployed.

Token String 1111111

The client token that is generated by your client. A client token is a unique random string.

Ip String rm-de21209****.mysql.rds.aliyuncs.com

The endpoint of the database instance.

CallerUid String 11111111111

The user ID of the current API caller.

InstanceId String rm-2ze1jdv45i7l6****

The ID of the database instance.

Port Integer 3306

The number of the port that is used to connect to the database instance.

OwnerId String 325352345

The ID of the database instance owner.

Uuid String hdm_3063db6792965c080a4bcb6e6304****

The unique identifier of the database instance.

Error String InvalidRequestURL

The error message.

Code Integer 200

The HTTP status code.

Role String ECSAdmin

The role of the current API caller.

TenantId String L0EPfLS****=SCE00000*****

The ID of the tenant.

Code String 200

The HTTP status code.

Success String true

The result of the request. The value indicates whether the request is successful. Valid values:

  • true: The request is successful.
  • false: The request failed.

Examples

Sample requests

http(s)://das.cn-shanghai.aliyuncs.com/?Action=AddHDMInstance
&Uid=hdm_df02bbfd3bd64c7bb1982e5323a6
&accessKey=None
&signature=None
&timestamp=None
&__context=None
&skipAuth=None
&UserId=None
&InstanceArea=ECS
&InstanceId=rm-2ze1jdv45i7l6****
&Ip=rm-2ze1jdv45i7l6****.mysql.rds.aliyuncs.com
&Port=3306
&Engine=MySQL
&Username=test****
&Password=122****
&InstanceAlias=yuecq--test****
&NetworkType=VPC
&VpcId=vpc-m5e666n89m2bx8jar****
&Region=cn-hangzhou
&FlushAccount=None
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<AddHDMInstanceResponse>
    <Message>Successful</Message>
    <RequestId>B6D17591-B48B-4D31-9CD6-9B9796B2****</RequestId>
    <Synchro>None</Synchro>
    <Data>
        <VpcId>vpc-m5e666n89m2bx8jar****</VpcId>
        <Token>1111111</Token>
        <Ip>rm-de21209****.mysql.rds.aliyuncs.com</Ip>
        <CallerUid>11111111111</CallerUid>
        <InstanceId>rm-2ze1jdv45i7l6****</InstanceId>
        <Port>3306</Port>
        <OwnerId>325352345</OwnerId>
        <Uuid>hdm_3063db6792965c080a4bcb6e6304****</Uuid>
        <Error>InvalidRequestURL</Error>
        <Code>200</Code>
        <Role>ECSAdmin</Role>
        <TenantId>L0EPfLS****=SCE00000*****</TenantId>
    </Data>
    <Code>200</Code>
    <Success>true</Success>
</AddHDMInstanceResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "Message" : "Successful",
  "RequestId" : "B6D17591-B48B-4D31-9CD6-9B9796B2****",
  "Synchro" : "None",
  "Data" : {
    "VpcId" : "vpc-m5e666n89m2bx8jar****",
    "Token" : "1111111",
    "Ip" : "rm-de21209****.mysql.rds.aliyuncs.com",
    "CallerUid" : "11111111111",
    "InstanceId" : "rm-2ze1jdv45i7l6****",
    "Port" : 3306,
    "OwnerId" : "325352345",
    "Uuid" : "hdm_3063db6792965c080a4bcb6e6304****",
    "Error" : "InvalidRequestURL",
    "Code" : 200,
    "Role" : "ECSAdmin",
    "TenantId" : "L0EPfLS****=SCE00000*****"
  },
  "Code" : "200",
  "Success" : "true"
}

Error codes

HttpCode Error code Error message Description
400 InvalidParams The request parameters are invalid. The error message returned because the specified request parameters are invalid.

For a list of error codes, visit the API Error Center.