Adds a database instance to Database Autonomy Service (DAS).

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

  • If you use an Alibaba Cloud SDK, make sure that the aliyun-sdk-core version is later than V4.3.3. We recommend that you use the latest version.
  • The version of your DAS SDK must be V1.0.2 or later.
  • If you use an SDK to call DAS, you must set the region 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.

__context String No None

A reserved parameter.

InstanceArea String No ECS

The type of the instance on which the database is deployed. Valid values:

  • RDS: an Alibaba Cloud database instance
  • ECS: an Elastic Compute Service (ECS) instance on which a self-managed database is deployed
  • 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 instance ID.

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

The endpoint used to access the database instance over internal networks.

Port String No 3306

The port used to access the database instance over internal networks.

Engine String No MySQL

The database engine. Valid values:

  • MySQL
  • PostgreSQL
  • SQLServer
  • PolarDBMySQL
  • PolarDBPostgreSQL
  • Redis
  • MongoDB
  • PolarDBOracle
  • PolarDBX
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).

Region String No cn-hangzhou

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

FlushAccount String No None

A reserved parameter.

Response parameters

Parameter Type Example Description
Message String Successful

The message that is returned for the request.

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

The ID of the request.

Synchro String None

A reserved parameter.

Data Object

The detailed information, including the error codes and the number of error messages.

VpcId String vpc-m5e666n89m2bx8jar****

The ID of the VPC.

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 caller.

InstanceId String rm-2ze1jdv45i7l6****

The ID of the database instance.

Port Integer 3306

The port number of the database instance that you want to access.

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 that is returned.

Code Integer 200

The returned HTTP status code.

Role String master

The role of the current API caller.

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

The ID of the tenant.

Code String 200

The returned HTTP status code.

Success String true

Indicates whether the request is successful. Valid values:

  • true
  • false

Examples

Sample requests

http(s)://cn-shanghai.aliyuncs.com/?Action=AddHDMInstance
&InstanceArea=RDS
&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
&<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>master</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" : "master",
    "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.