Adds a routing algorithm to a logical table.
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 | Yes | AddLogicTableRouteConfig |
The operation that you want to perform. Set the value to AddLogicTableRouteConfig. |
TableId | Long | Yes | 4**** |
The ID of the logical table. You can call the ListLogicTables operation to query the ID of the logical table. |
RouteKey | String | Yes | id-hash-mod16 |
The unique key of the routing algorithm. Note
|
RouteExpr | String | Yes | #id#%16 |
The routing algorithm expression. For more information about how to configure a routing algorithm expression, see Configure a routing algorithm. |
Tid | Long | No | 4*** |
The ID of the tenant. You can call the GetUserActiveTenant operation to query the tenant ID. |
RegionId | String | No | cn-hangzhou |
The region in which DMS is activated. For more information, see RegionID parameter. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | B43AD641-49C2-5299-9E06-1B37EC1B**** |
The ID of the request. |
ErrorCode | String | UnknownError |
The error code returned. |
ErrorMessage | String | can not find table, tableId : 11133 |
The error message returned. |
Success | Boolean | true |
Indicates whether the request was successful. Valid values:
|
Examples
Sample requests
http(s)://dms-enterprise.aliyuncs.com/?Action=AddLogicTableRouteConfig
&TableId=4****
&RouteKey=id-hash-mod16
&RouteExpr=#id#%16
&Tid=4***
&Common request parameters
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<AddLogicTableRouteConfigResponse>
<RequestId>B43AD641-49C2-5299-9E06-1B37EC1B****</RequestId>
<Success>true</Success>
</AddLogicTableRouteConfigResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "B43AD641-49C2-5299-9E06-1B37EC1B****",
"Success" : true
}
Error codes
For a list of error codes, visit the API Error Center.