All Products
Search
Document Center

Function Compute:PolicyItem

Last Updated:Sep 19, 2024
ParameterTypeDescriptionExample
object

The policy details.

typestring

The parameter types. You can use values in HTTP requests.

Header
keystring

key specifies the name of the field that controls traffic of a canary release policy. For example, if you set key to x-test-uid, the value of the x-test-uid field in a request determines whether the request is routed to the canary release version.

x-test-uid
valuestring

value specifies the value of the field that controls traffic of canary releases. The actual value of the field specified by the key parameter in a request is compared with the value of the value parameter based on the specified operator to determine whether a request is routed to the canary release version.

11111
operatorstring

operator specifies the operator, which is used to compare the actual value of the field specified by key and the value specified by value in a request. Valid values:

  • >, <, >=, <=, =, and !=: follows the lexicographic order of comparison.
  • in: string inclusion relationship.
  • percentage: the percentage value. Valid values: (0,100]. The value must be an integer. The system routes traffic of specified proportion based on actual values of key in requests. The field is specified by the key parameter, and the percentage is specified by the value parameter. For example, { type=Header, key=uid, value=20, operator=percent } indicates that 20% of the requests are routed to the canary release version based on the distribution of values of the uid field in the request header.
=