Modifies a tag-based routing rule.
Debugging
Authorization information
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 Resources
is 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.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
mse:ApplyTagPolicies | update |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
Region | string | Yes | The region ID. | cn-hangzhou |
Namespace | string | No | The Microservices Engine (MSE) namespace to which the application belongs. | default |
AppName | string | No | The name of the application. | example-app |
AppIddeprecated | string | Yes | The ID of the application. | h5pohqu3gd@xxx |
Rules | string | No | The details of the routing rule. | { "blue": { # Tag key. "rate": 20, # Rate. A value of 20 indicates that 20% of the traffic is routed to the node identified by the tag. "name": "luoye-route-test", # Routing rule name. "carryData": false, # Specifies whether to enable pass-through. This parameter is applicable to end-to-end canary release. "rules": { # Rule information. "dubbo": \[{ # Dubbo rule. The system also supports Spring Cloud and Istio rule. "serviceName": "com.taobao.hsf.common.DemoService", # Service name (operation name). "group": "", # Group name. "version": "", # Service version. "methodName": "sayHello", # Method name. "condition": "AND", # Logical operator used by the following items. Valid values: AND and OR. "argumentItems": \[{ # Array of rule details. "index": 0, # Index field. "expr": "", # Expression. Its details is described below. "operator": "rawvalue", # The comparison mode. A value of rawvalue indicates direct comparison. A value of mode indicates the modulo operation. A value of list indicates using a whitelist. "value": "jim", # Base value. The value obtained by the expression will be compared with this value. If operator is set to list, separate the items specified for this parameter with commas (,). Example: 1,2,3. "cond": "==" # Comparison operator. Valid values: >=, <=, >, <, and ==. }] }] } }, "\_base": { # Another tag key. "rate": 80 # Rate. A value of 20 indicates that 20% of the traffic is routed to the node identified by the tag. } } |
NamespaceId | string | No | Optional. The ID of the namespace. | 12233**** |
Enable | boolean | No | Specifies whether to enable the routing rule. | true |
AcceptLanguage | string | No | The language of the response. Valid values:
| zh |
Response parameters
Examples
Sample success responses
JSON
format
{
"Message": "success",
"RequestId": "316F5F64-F73D-42DC-8632-01E308B6****",
"Data": [
{
"Status": 1,
"InstanceNum": 1,
"Remove": true,
"CarryData": true,
"Tag": "gray",
"Name": "test",
"Rules": "{\\\"_base\\\": {\\\"rate\\\": 100, \\\"remove\\\": true}, \\\"blue\\\": {\\\"rate\\\": 0}}",
"Id": 12,
"Rate": 10,
"Enable": true
}
],
"Success": true
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | IllegalRequest | Invalid request:%s | Invalid request: %s |
400 | InvalidParameter | Parameter error:%s | Request parameter error: %s |
403 | NoPermission | You are not authorized to perform this operation:%s | You do not have the permission to use this interface:%s |
404 | NotFound | Not found:%s | The resource does not exist:%s |
500 | InternalError | Console error. Try again later:%s | Console error. Try again later: %s |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2023-09-06 | The internal configuration of the API is changed, but the call is not affected | View Change Details |
2023-09-06 | The internal configuration of the API is changed, but the call is not affected | View Change Details |
2023-08-16 | The internal configuration of the API is changed, but the call is not affected | View Change Details |
2023-07-07 | The internal configuration of the API is changed, but the call is not affected | View Change Details |
2023-07-06 | The request parameters of the API has changed. The response structure of the API has changed | View Change Details |
2023-03-24 | API Description Update. The request parameters of the API has changed | View Change Details |