Connects to a database instance.

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

  • If you use 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 Database Autonomy Service (DAS) SDK must be V1.0.2 or later.
  • If you use an SDK to call the DAS service, you must set the region to cn-shanghai.

Request parameters

Parameter Type Required Example Description
Action String No AccessHDMInstance

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

Uid String No hdm_df02bbfd3bd64c7bb1982e5323a6****

The ID of the account. On the Security Settings page in the Alibaba Cloud account management center, you can obtain the ID of the logon account.

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 RDS

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 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 IP address 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. Valid values:

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

The username.

Password String No 122****

The password.

InstanceAlias String No yuecq--test****

The name of the database instance.

NetworkType String No VPC

The network type of the database instance. Valid values:

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.

CallerBid String No 26842

The business ID of the caller.

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

The ID of the tenant.

OwnerIdSignature String No 119059297981****

The owner ID that is used as the signature.

CallerType String No sub

The type of the account. Valid values:

  • sub: a RAM user
  • parent: an Alibaba Cloud account
CallerUid String No 111111111111

The user ID of the caller.

Target String No rm-2ze1jdv45i7l6****

The ID of the database instance that you want to connect to DAS.

Product String No DAS

The name of the database service.

External String No Null

Other information.

Response parameters

Parameter Type Example Description
RequestId String B6D17591-B48B-4D31-9CD6-9B9796B2****

The ID of the request.

Message String Successful

The message returned for the request.

Note If the request is successful, Successful is returned. If the request fails, an error message and an error code are returned.
Synchro String None

A hidden parameter.

Data String "Data": { "total": 1, "list":[...] }, "Code": 200, "Success": true }

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

Code String 200

The returned status code.

Success String true

Indicates whether the request is successful. Valid values:

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

Examples

Sample requests

http(s)://das.cn-shanghai.aliyuncs.com/?Action=AccessHDMInstance
&Uid=hdm_df02bbfd3bd64c7bb1982e5323a6****
&accessKey=None
&signature=None
&timestamp=None
&__context=None
&skipAuth=None
&UserId=None
&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
&CallerBid=26842
&TenantId=L0EPfLS****=SCE00000*****
&OwnerIdSignature=119059297981****
&CallerType=sub
&CallerUid=111111111111
&Target=rm-2ze1jdv45i7l6****
&Product=DAS
&External=Null
&<Common request parameters>

Sample success responses

XML format

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

<AccessHDMInstanceResponse>
    <RequestId>B6D17591-B48B-4D31-9CD6-9B9796B2****</RequestId>
    <Message>Successful</Message>
    <Synchro>None</Synchro>
    <Data>"Data": { "total": 1, "list":[...] }, "Code": 200, "Success": true }</Data>
    <Code>200</Code>
    <Success>true</Success>
</AccessHDMInstanceResponse>

JSON format

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

{
  "RequestId" : "B6D17591-B48B-4D31-9CD6-9B9796B2****",
  "Message" : "Successful",
  "Synchro" : "None",
  "Data" : "\"Data\": { \"total\": 1, \"list\":[...] }, \"Code\": 200, \"Success\": true }",
  "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.