Modifies the latency threshold of the read/write splitting link and the read weights of a primary instance and its read-only instances.
- SQL Server
Before you call this operation, make sure that the following requirements are met:
The shared proxy feature is enabled for your ApsaraDB RDS for MySQL instance.
The read/write splitting feature is enabled for your ApsaraDB RDS for MySQL instance.
The instance must run one of the following database engine versions and RDS editions:
- MySQL 5.7 on RDS High-availability Edition with local disks
- MySQL 5.6
- SQL Server on RDS Cluster Edition
The following table shows the authorization information corresponding to the API. The authorization information can be used in the
Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resourcesis used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
The ID of the primary instance. You can call the DescribeDBInstances operation to query the instance ID.
The prefix of the read/write splitting endpoint. The prefix must be unique. It can be up to 30 characters in length and can contain lowercase letters and hyphens (-). It must start with a lowercase letter.
Note The default prefix consists of the name of the primary instance followed by the letters rw.
The port that is associated with the read/write splitting endpoint.
The latency threshold that is allowed by the read/write splitting link. Unit: seconds. If the latency on a read-only instance exceeds the specified threshold, the system no longer routes read requests to the read-only instance. If you do not specify this parameter, the default value of this parameter is retained.
The method that is used to assign read weights. Valid values:
Note You must specify at least one of MaxDelayTime and DistributionType.
The read weights of the primary instance and its read-only instances. A read weight must be a multiple of 100 and cannot exceed 10,000.
Sample success responses
|HTTP status code
|The specified uniform read only network type does not exist.
|The operation failed. The unified network type that you specify for the read-only RDS instances cannot be found.
|The Current DB Instance has not read-only instance.
|The database instance does not have any read-only instance.
|The current database instance does not contain any read only instance.
|The current database instance does not have a read-only instance.
For a list of error codes, visit the Service error codes.