Creates a canary release rule for a Spring Cloud or Dubbo application.
Operation description
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 |
---|---|---|---|---|
sae:CreateGreyTagRoute | create |
|
| none |
Request syntax
POST /pop/v1/sam/tagroute/greyTagRoute HTTP/1.1
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
AppId | string | Yes | dubbo-echo | 7802c49a-67bc-4167-8369-9a9c003c**** |
Name | string | Yes | Canary Release - Regions | dubbo-echo |
Description | string | No | [{"condition":"OR","items":[{"cond":"==","name":"grey","operator":"rawvalue","type":"param","value":"true"},{"cond":"==","name":"grey","operator":"rawvalue","type":"cookie","value":"true"},{"cond":"==","name":"grey","operator":"rawvalue","type":"header","value":"true"}],"path":"/post-echo/hi"}] | |
ScRules | string | No | [{"condition":"OR","group":"DUBBO","items":[{"cond":"==","expr":".key1","index":0,"operator":"rawvalue","value":"value1"},{"cond":"==","expr":".key2","index":0,"operator":"rawvalue","value":"value2"}],"methodName":"echo","serviceName":"com.alibaba.edas.boot.EchoService","version":"1.0.0"}] | [{"condition":"OR","items":[{"cond":"==","name":"grey","operator":"rawvalue","type":"param","value":"true"},{"cond":"==","name":"grey","operator":"rawvalue","type":"cookie","value":"true"},{"cond":"==","name":"grey","operator":"rawvalue","type":"header","value":"true"}],"path":"/post-echo/hi"}] |
DubboRules | string | No | The ID of the request. | [{"condition":"OR","group":"DUBBO","items":[{"cond":"==","expr":".key1","index":0,"operator":"rawvalue","value":"value1"},{"cond":"==","expr":".key2","index":0,"operator":"rawvalue","value":"value2"}],"methodName":"echo","serviceName":"com.alibaba.edas.boot.EchoService","version":"1.0.0"}] |
- Parameters in the ScRules parameter
Parameter | Type | Example | Description |
---|---|---|---|
condition | String | OR | The relationship between the conditions in the canary release rule. Valid values: |
-
AND: The conditions are in the logical AND relation. All conditions must be met at the same time.
-
OR: The conditions are in the logical OR relation. At least one of the conditions must be met. | | path | String | /path | The path of the canary release rule of the Spring Cloud application. | | items | Array of items | | The conditions. | Parameters in the items parameter | Parameter | Type | Example | Description | | --------- | ---- | ------- | ----------- | | name | String | test | The name of the parameter. | | cond | String | == | The comparison operator. Valid values: >, <, >=, <=, ==, and ! =. | | type | String | cookie | The type of the comparison. Valid values:
-
param: parameter
-
cookie: cookie
-
header: header | | value | String | test | The value of the parameter. This value is compared with the value that is obtained based on the type and name parameters. | | operator | String | rawvalue | The operator. Valid values:
-
rawvalue: direct comparison.
-
list: whitelist.
-
mod: mods 100.
-
deterministic_proportional_steaming_division: percentage. |
-
Parameters in the DubboRules parameter
Parameter | Type | Example | Description |
---|---|---|---|
condition | String | OR | The relationship between the conditions in the canary release rule. Valid values: |
-
AND: The conditions are in the logical AND relation. All conditions must be met at the same time.
-
OR: The conditions are in the logical OR relation. At least one of the conditions must be met. | | methodName | String | echo | The method name of the Dubbo service. | | serviceName | String | com.alibaba.edas.boot.EchoService | The name of the Dubbo service. | | version | String | 1.0.0 | The version of the Dubbo service. | | items | Array of items | | The conditions. | | group | String | DUBBO | The group of the Dubbo service that corresponds to the canary release rule. | Parameters in the items parameter | Parameter | Type | Example | Description | | --------- | ---- | ------- | ----------- | | index | Integer | 0 | The index of the parameter. The value 0 indicates the first parameter. | | expr | String | .name | The expression that is used to obtain the value of the parameter. Valid values:
-
Empty: obtains the value of the parameter.
-
.name: obtains the name property of the parameter. This expression works the same way as args0.getName().
-
.isEnabled(): obtains the enabled property of the parameter. This expression works the same way as args0.isEnabled().
-
[0]: indicates that the value of the parameter is an array and obtains the first value of the array. This expression works the same way as args0[0]. This expression does not start with a period (.).
-
.get(0): indicates that the value of the parameter is a list and obtains the first value of the list. This expression works the same way as args0.get(0).
-
.get("key"): indicates that the value of the parameter is a map and obtains the value of the key in the map. This expression works the same way as args0.get("key"). | | cond | String | == | The comparison operator. Valid values: >, <, >=, <=, ==, and ! =. | | value | String | test | The value of the parameter. This value is compared with the value that is obtained based on the expr and index parameters. | | operator | String | rawvalue | The operator. Valid values:
-
rawvalue: direct comparison.
-
list: whitelist.
-
mod: mods 100.
-
deterministic_proportional_steaming_division: percentage. |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "9D29CBD0-45D3-410B-9826-52F86F90****",
"Message": "success",
"TraceId": "0a98a02315955564772843261e****",
"Data": {
"GreyTagRouteId": 16
},
"ErrorCode": "",
"Code": "200",
"Success": true
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | InvalidParameter.NotEmpty | You must specify the parameter %s. | - |
400 | InvalidParameter.Obviously | The specified parameter is invalid {%s}. | - |
400 | InvalidParameter.WithMessage | The parameter is invalid {%s}: %s | - |
400 | Application.ChangerOrderRunning | An application change process is in progress. Please try again later. | An application change process is in progress. Please try again later. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2021-11-16 | The Error code has changed | View Change Details |