Create a canary release rule for a Spring Cloud or Dubbo application.
Operation description
You can currently configure only one canary rule per 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 name of the canary rule. The name can be up to 64 characters long and can contain only lowercase letters, digits, hyphens (-), and Chinese characters. It must start with a lowercase letter and end with a lowercase letter or a digit. |
dubbo-echo |
| Description |
string |
No |
The description of the canary rule. The description can be up to 64 characters long. |
Canary Release - Regions |
| ScRules |
string |
No |
The canary rules for a Spring Cloud application. This parameter is required for Spring Cloud applications and cannot be used with 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 rules for a Dubbo application. This parameter is required for Dubbo applications and cannot be used with 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 rules for an application that uses an ALB gateway route. |
[{"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 parameters
| Parameter | Type | Example | Description |
| condition | String | OR | The condition mode for the canary rule. Valid values: - AND: All conditions in the condition list must be met. - OR: At least one of the conditions in the condition list must be met. |
| path | String | /path | The request path for the Spring Cloud canary rule. |
| items | Array of items | The list of conditions. |
items parameters
| Parameter | Type | Example | Description |
| name | String | test | Parameter name. |
| cond | String | == | The comparison operator. Valid values include: >, <, >=, <=, ==, and !=. |
| type | String | cookie | Comparison type. Valid values: - param: Parameter. - cookie: Cookie. - header: Header. |
| value | String | test | The value to compare with the actual value retrieved based on the specified type and name. |
| operator | String | rawvalue | The operator used for the comparison. Valid values: - rawvalue: Direct comparison. - list: Allowlist match. - mod: Modulo 100. - deterministic_proportional_steaming_division: Percentage. |
DubboRules parameters
| Parameter | Type | Example | Description |
| condition | String | OR | The condition mode for the canary rule. Valid values: - AND: All conditions in the condition list must be met. - OR: At least one of the conditions 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 Dubbo service version. |
| items | Array of items | The list of conditions. | |
| group | String | DUBBO | The Dubbo service group that the canary rule applies to. |
items parameters
| Parameter | Type | Example | Description |
| index | Integer | 0 | The parameter index. 0 indicates the first parameter. |
| expr | String | .name | The parameter value expression. Valid values: - If left blank, retrieves the value of the current parameter. - .name: Retrieves the name property of the parameter, equivalent to args0.getName().- .isEnabled(): Retrieves the enabled property of the parameter, equivalent to args0.isEnabled().- [0]: If the parameter is an array, this expression retrieves the first element of the array, equivalent to args0[0]. Note that this expression does not start with a period (.).- .get(0): If the parameter is a List, this expression retrieves the first element of the list, equivalent to args0.get(0).- .get("key"): If the parameter is a Map, this expression retrieves the value for the specified key, equivalent to args0.get("key"). |
| cond | String | == | The comparison operator. Valid values include: >, <, >=, <=, ==, and !=. |
| value | String | test | The value to compare with the actual value retrieved based on the specified expr and index. |
| operator | String | rawvalue | The operator used for the comparison. Valid values: - rawvalue: Direct comparison. - list: Allowlist match. - mod: Modulo 100. - deterministic_proportional_steaming_division: Percentage. |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The data returned. |
||
| RequestId |
string |
The request ID. |
9D29CBD0-45D3-410B-9826-52F86F90**** |
| Message |
string |
The response message. |
success |
| TraceId |
string |
The trace ID. You can use this ID to query the call details. |
0a98a02315955564772843261e**** |
| Data |
object |
The details of the canary release rule. |
|
| GreyTagRouteId |
integer |
The globally unique ID of the canary release rule. |
16 |
| ErrorCode |
string |
The error code.
|
|
| Code |
string |
The HTTP status code. Valid values:
|
200 |
| Success |
boolean |
Indicates whether the request was successful. Valid values:
|
true |
Examples
Success response
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. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.