Applies for a private endpoint for an ApsaraDB for Redis cluster instance.

This topic describes how to connect to a cluster instance of ApsaraDB for Redis through a direct connection. By default, cluster instances can be connected only through a proxy server. If you want to bypass the proxy server, you can apply for a private endpoint to enable direct connections to a cluster instance. This reduces the number of connections and improves service performance. For more information, see Enable a direct connection.

The instance must meet the following conditions:

  • An ApsaraDB for Redis cluster instance is used.
  • The engine version of the cluster instance is Redis 4.0 (Community Edition) or Redis 5.0 (Community Edition or Enterprise Edition).
  • The instance runs in a Virtual Private Cloud (VPC) network. If the instance is deployed in the classic network, you can call the SwitchNetwork operation to change the network type to VPC.
  • Secure Sockets Layer (SSL) encryption of the instance is disabled. If SSL encryption is enabled, you can call the ModifyInstanceSSL operation to disable it.
  • The VSwitch to which the instance belongs has sufficient IP addresses that can be allocated. For more information, see Obtain the number of available IP addresses in the VSwitch.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String No AllocateDirectConnection

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

InstanceId String Yes r-bp********

The ID of the instance.

RegionId String No cn-hangzhou

The ID of the region to which the instance belongs.

ConnectionString String No redisdirect123

The prefix of the public endpoint. The prefix can be 8 to 64 characters in length, and can contain lowercase letters and digits. It must start with a lowercase letter.

Port String No 6379

The port number. Valid values:1024 to 65535. Default value: 6379.

Response parameters

Parameter Type Example Description
RequestId String FC77D4E1-2A7C-4F0B-A4CC-CE0B9C314B9B

The ID of the request.

Examples

Sample requests

https://r-kvstore.aliyuncs.com/?Action=AllocateDirectConnection
&InstanceId=r-bp********
&<Common request parameters>

Sample success responses

XML format

<RequestId>FC77D4E1-2A7C-4F0B-A4CC-CE0B9C314B9B</RequestId>

JSON format

{"RequestId":"FC77D4E1-2A7C-4F0B-A4CC-CE0B9C314B9B"}

Error codes

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