You can call ModifyInstanceSSL to configure SSL encryption for an ApsaraDB for Redis instance.

For more information about how to perform the corresponding operation in the console, see Configure SSL encryption.

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 ModifyInstanceSSL

The operation that you want to perform. Set this parameter to ModifyInstanceSSL.

InstanceId String Yes r-bp1xxxxxxxxxxxxx

The ID of the instance.

SSLEnabled String Yes Enable

Modifies the SSL status. Valid values:

  • Disable: disables SSL encryption.
  • Enable: enables SSL encryption.
  • Update: updates the SSL certificate.

Response parameters

Prameter Type Sample response Description
RequestId String 52D901ED-E0A5-42FB-B9DB-39C295C37738

The ID of the request.

InstanceId String r-bp1xxxxxxxxxxxxx

The ID of the instance for which SSL encryption was configured.

TaskId String 1111111111

The ID of the replication task.

Examples

Sample requests

https://r-kvstore.aliyuncs.com/
?Action=ModifyInstanceSSL
&InstanceId=r-bp1xxxxxxxxxxxxx
&SSLEnabled=Enable
&<Common request parameter>

Sample success response

XML format

<ModifyInstanceSSLResponse>
      <InstanceId>r-xxxxxxxxxxxxxxx</InstanceId>
      <RequestId>52D901ED-E0A5-42FB-B9DB-39C295C37738</RequestId>
      <TaskId>1111111111</TaskId>
</ModifyInstanceSSLResponse>

JSON format

{
    "InstanceId": "r-xxxxxxxxxxxxxxx",
    "RequestId": "52D901ED-E0A5-42FB-B9DB-39C295C37738",
    "TaskId": "1111111111"
}

Error codes

Http status code Error code Error message Description
403 IncorrectDBInstanceState Current DB instance state does not support this operation. The error message returned because the status of the instance does not support this operation. This operation is supported only when the instance is in the running status.
403 IncorrectDBInstanceLockMode Current DB instance lock mode does not support this operation. The error message returned because the current lock mode of the instance does not support this operation.
400 InvalidParameters.Format Specified parameters are not valid. The error message returned because the specified parameters are invalid.

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