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

This topic describes how to connect to an ApsaraDB for Redis cluster instance 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 requirements:

  • 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). 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.


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 Yes AllocateDirectConnection

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

InstanceId String Yes r-bp1zxszhcgatnx****

The ID of the instance.

RegionId String No cn-hangzhou

The ID of the region where the instance is deployed.

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 5D622714-AEDD-4609-9167-F5DDD3D1****

The ID of the request.


Sample requests
&<Common request parameters>

Sample success responses

XML format


JSON format

    "RequestId": "5D622714-AEDD-4609-9167-F5DDD3D1****"

Error codes

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