Creates a canary release rule for a Spring Cloud or Dubbo application.
Operation description
Currently, you can configure only one canary release rule for an application.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
sae:CreateGreyTagRoute |
create |
*All Resource
|
None | None |
Request syntax
POST /pop/v1/sam/tagroute/greyTagRoute HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| AppId |
string |
Yes |
The application ID. |
7802c49a-67bc-4167-8369-9a9c003c**** |
| Name |
string |
Yes |
The rule name. It must start with a lowercase letter, end with a digit or a lowercase letter, and can contain only lowercase letters, Chinese characters, digits, and hyphens (-). It can be up to 64 characters in length. |
dubbo-echo |
| Description |
string |
No |
The rule description. It can be up to 64 characters in length. |
Canary Release - Regions |
| ScRules |
string |
No |
The canary release rules created for a Spring Cloud application. This parameter is required when your application uses the Spring Cloud framework. You do not need to specify the DubboRules parameter. |
[{"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 canary release rules created for a Dubbo application. This parameter is required when your application uses the Dubbo framework. You do not need to specify the ScRules parameter. |
[{"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"}] |
| AlbRules |
string |
No |
The canary release rules created for an application that has ALB gateway routing configured. |
[{"condition":"AND","items":[{"cond":"==","name":"grey","operator":"rawvalue","type":"sourceIp","value":"127.0.0.1"},{"cond":"==","name":"grey","operator":"rawvalue","type":"cookie","value":"true"},{"cond":"==","name":"grey","operator":"rawvalue","type":"header","value":"true"}],"path":"/post-echo/hi"}] |
ScRules parameter description
| Parameter | Type | Example | Description |
| condition | String | OR | The condition mode of the canary release rule. Valid values: - AND: indicates the AND operator, which means all conditions in the condition list must be met. - OR: indicates the OR operator, which means any condition in the condition list must be met. |
| path | String | /path | The path that corresponds to the canary release rule for the Spring Cloud application. |
| items | Array of items | The condition list. |
items parameter description
| Parameter | Type | Example | Description |
| name | String | test | The parameter name. |
| cond | String | == | The comparison operator. Valid values: >, <, >=, <=, ==, and !=. |
| type | String | cookie | The comparison type. Valid values: - param: Parameter. - cookie: Cookie. - header: Header. |
| value | String | test | The parameter value. The value obtained based on type and name is compared with this value. |
| operator | String | rawvalue | The operator. Valid values: - rawvalue: direct comparison. - list: whitelist. - mod: modulo 100. - deterministic_proportional_steaming_division: percentage. |
DubboRules parameter description
| Parameter | Type | Example | Description |
| condition | String | OR | The condition mode of the canary release rule. Valid values: - AND: indicates the AND operator, which means all conditions in the condition list must be met. - OR: indicates the OR operator, which means any condition in the condition list must be met. |
| methodName | String | echo | The method name of the Dubbo service. |
| serviceName | String | com.alibaba.edas.boot.EchoService | The Dubbo service name. |
| version | String | 1.0.0 | The version of the Dubbo service. |
| items | Array of items | The condition list. | |
| group | String | DUBBO | The group of the Dubbo service that corresponds to the canary release rule. |
items parameter description
| Parameter | Type | Example | Description |
| index | Integer | 0 | The parameter index. 0 indicates the first parameter. |
| expr | String | .name | The expression used to obtain the parameter value. Valid values: - Empty: directly uses the value of the current parameter. - .name: obtains the name property of the parameter, which is equivalent to args0.getName(). - .isEnabled(): obtains the enabled property of the parameter, which is equivalent to args0.isEnabled(). - [0]: specifies that the current parameter is an array and obtains the first value of the array, which is equivalent to args0[0]. Note that there is no period (.) at the beginning. - .get(0): specifies that the current parameter is a list and obtains the first value of the list, which is equivalent to args0.get(0). - .get("key"): specifies that the current parameter is a map and obtains the value corresponding to the key, which is equivalent to args0.get("key"). |
| cond | String | == | The comparison operator. Valid values: >, <, >=, <=, ==, and !=. |
| value | String | test | The parameter value. The value obtained based on expr and index is compared with this value. |
| operator | String | rawvalue | The operator. Valid values: - rawvalue: direct comparison. - list: whitelist. - mod: modulo 100. - deterministic_proportional_steaming_division: percentage. |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The returned data. |
||
| RequestId |
string |
The request ID. |
9D29CBD0-45D3-410B-9826-52F86F90**** |
| Message |
string |
The additional information about the call result. |
success |
| TraceId |
string |
The trace ID, which is used to accurately query call information. |
0a98a02315955564772843261e**** |
| Data |
object |
The canary release rule information. |
|
| GreyTagRouteId |
integer |
The canary release rule ID, which is globally unique. |
16 |
| ErrorCode |
string |
The error code. Valid values:
|
InvalidParameter.NotEmpty |
| Code |
string |
The API status code or POP error code. Valid values:
|
200 |
| Success |
boolean |
Indicates whether the change order information was queried successfully. Valid values:
|
true |
Examples
Success response
JSON format
{
"RequestId": "9D29CBD0-45D3-410B-9826-52F86F90****",
"Message": "success",
"TraceId": "0a98a02315955564772843261e****",
"Data": {
"GreyTagRouteId": 16
},
"ErrorCode": "InvalidParameter.NotEmpty",
"Code": "200",
"Success": true
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidParameter.NotEmpty | You must specify the parameter %s. | Invalid parameter: %s cannot be empty. |
| 400 | InvalidParameter.Obviously | The specified parameter is invalid {%s}. | Invalid parameter {%s}. |
| 400 | InvalidParameter.WithMessage | The parameter is invalid {%s}: %s | Invalid parameter {%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. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.