All Products
Search
Document Center

Serverless App Engine:CreateGreyTagRoute

Last Updated:Mar 21, 2025

Creates a canary release rule for a Spring Cloud or Dubbo application.

Operation description

Note You can configure only one canary release rule for each application.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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:
    • For mandatory resource types, indicate with a prefix of * .
    • 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.
OperationAccess levelResource typeCondition keyAssociated operation
sae:CreateGreyTagRoutecreate
*All Resources
*
    none
none

Request syntax

POST /pop/v1/sam/tagroute/greyTagRoute HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
AppIdstringYes

The application ID.

7802c49a-67bc-4167-8369-9a9c003c****
NamestringYes

The name of the canary release rule. The name must start with a lowercase letter and end with a digit or a lowercase letter. The name can contain only lowercase letters, Chinese characters, digits, and hyphens (-). The name must be 1 to 64 characters in length.

dubbo-echo
DescriptionstringNo

The description of the canary release rule. The name must be 1 to 64 characters in length.

ScRulesstringNo

The canary release rule that you created for Spring Cloud application. If your application uses the Spring Cloud framework, you must configure this parameter. You do not need to configure 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"}]
DubboRulesstringNo

The canary release rule that you created for Dubbo applications. If your application uses the Dubbo framework, you must configure this parameter. You do not need to configure 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"}]
AlbRulesstringNo

The canary release rule of the application for which Application Load Balancer (ALB) gateway routing is 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"}]
  • Parameters in the ScRules parameter
ParameterData typeExampleDescription
conditionStringORThe 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.
pathString/pathThe path of the canary release rule of the Spring Cloud application.
itemsArray of itemsThe list of conditions.

Parameters in the items parameter

ParameterData typeExampleDescription
nameStringtestThe name of the parameter.
condString==The comparison operator. Valid values: >, <, >=, <=, ==, and !=.
typeStringcookieThe type of the comparison. Valid values:- param: Parameter.-cookie: Cookie.-header: Header.
valueStringtestThe value of the parameter. This value is compared with the value that is obtained based on the type and name parameters.
operatorStringrawvalueThe operator. Valid values:rawvalue: direct comparison.list: whitelist.- mod: 100 。deterministic_proportional_steaming_division: percentage.
  • Parameters in the DubboRules parameter
ParameterData typeExampleDescription
conditionStringORThe 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.
methodNameStringechoThe method name of the Dubbo service.
serviceNameStringcom.alibaba.edas.boot.EchoServiceThe name of the Dubbo service.
versionString1.0.0The version of the Dubbo service.
itemsArray of itemsThe list of conditions.
groupStringDUBBOThe group of the Dubbo service that corresponds to the canary release rule.

Parameters in the items parameter

ParameterData typeExampleDescription
indexInteger0The index of the parameter. The value 0 indicates the first parameter.
exprString.nameThe 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 is equivalent to args0.getName().- .isEnabled(): obtains the enabled property of the parameter. This expression is equivalent to 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 is equivalent to 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 is equivalent to args0.get("key").
condString==The comparison operator. Valid values: >, <, >=, <=, ==, and !=.
valueStringtestThe value of the parameter. This value is compared with the value that is obtained based on the expr and index parameters.
operatorStringrawvalueThe operator. Valid values:rawvalue: direct comparison.list: whitelist.- mod: mods 100.- deterministic_proportional_steaming_division: percentage.

Response parameters

ParameterTypeDescriptionExample
object

The data returned.

RequestIdstring

The ID of the request.

9D29CBD0-45D3-410B-9826-52F86F90****
Messagestring

The message returned for the operation.

success
TraceIdstring

The ID of the trace. The ID is used to query the details of a request.

0a98a02315955564772843261e****
Dataobject

The information about the canary release rule.

GreyTagRouteIdlong

The ID of the canary release rule. The ID is globally unique.

16
ErrorCodestring

The error code. Valid values:

  • ErrorCode is not returned if a request is successful.
  • ErrorCode is returned if a request failed. For more information, see Error code section of this topic.
Codestring

The HTTP status code. Valid values:

  • 2xx: The request was successful.
  • 3xx: The request was redirected.
  • 4xx: The request failed.
  • 5xx: A server error occurred.
200
Successboolean

Indicates whether the information of the change order was queried. Valid values:

  • true: The information was queried.
  • false: The information failed to be queried.
true

Examples

Sample success responses

JSONformat

{
  "RequestId": "9D29CBD0-45D3-410B-9826-52F86F90****",
  "Message": "success",
  "TraceId": "0a98a02315955564772843261e****",
  "Data": {
    "GreyTagRouteId": 16
  },
  "ErrorCode": "",
  "Code": "200",
  "Success": true
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidParameter.NotEmptyYou must specify the parameter %s.-
400InvalidParameter.ObviouslyThe specified parameter is invalid {%s}.-
400InvalidParameter.WithMessageThe parameter is invalid {%s}: %s-
400Application.ChangerOrderRunningAn 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 timeSummary of changesOperation
2021-11-16The Error code has changedView Change Details