Retro Eye care Haitian Deep Dark Default

ALTER TRAFFIC RULE

Description

The ALTER TRAFFIC RULE syntax is used to alter dual routing rule.

Syntax

AlterTrafficRule ::=
  'ALTER' 'TRAFFIC' 'RULE'  '(' 'LABELS' '(' lableName ')' ',' trafficAlgorithmDefinition ',' loadBalancerDefinition ')'

lableName ::=
  identifier

trafficAlgorithmDefinition ::=
  'TRAFFIC_ALGORITHM' '(' 'TYPE' '(' 'NAME' '=' trafficAlgorithmTypeName (',' propertiesDefinition)? ')' ')'

loadBalancerDefinition ::=
  'LOAD_BALANCER' '(' 'TYPE' '(' 'NAME' '=' loadBalancerName (',' propertiesDefinition)? ')' ')'

propertiesDefinition ::=
  'PROPERTIES' '(' key '=' value (',' key '=' value)* ')'

trafficAlgorithmTypeName ::=
  string

loadBalancerTypeName ::=
  string

key ::= 
  string

value ::=
  literal

Supplement

  • TRAFFIC_ALGORITHM support SQL_MATCH and SQL_HINT two types;

  • LOAD_BALANCER support RANDOM and ROUND_ROBIN two types.

Example

  • Alter dual routing rule
 TRAFFIC RULE sql_match_traffic ( 
  LABELS (OLTP),
  TRAFFIC_ALGORITHM(TYPE(NAME="SQL_MATCH",PROPERTIES("sql" = "SELECT * FROM t_order WHERE order_id = 1; UPDATE t_order SET order_id = 5;"))),
  LOAD_BALANCER(TYPE(NAME="RANDOM")));

Reserved word

ALTER, TRAFFIC, RULE, LABELS, TYPE, NAME, PROPERTIES, TRAFFIC_ALGORITHM, LOAD_BALANCER