SHOW TRAFFIC RULE

Description

The SHOW TRAFFIC RULE syntax is used to query specified dual routing rule.

Syntax

Grammar Railroad diagram

  1. ShowTrafficRule ::=
  2. 'SHOW' 'TRAFFIC' ('RULES' | 'RULE' ruleName)?
  3. ruleName ::=
  4. identifier

Supplement

  • When ruleName not specified, the default is show all traffic rules

Return Value Description

ColumnDescription
nametraffic rule name
labelscompute node labels
algorithm_typetraffic algorithm type
algorithm_propstraffic algorithn properties
load_balancer_typeload balancer type
load_balancer_propsload balancer properties

Example

  • Query specified traffic rule
  1. SHOW TRAFFIC RULE sql_match_traffic;
  1. mysql> SHOW TRAFFIC RULE sql_match_traffic;
  2. +-------------------+--------+----------------+--------------------------------------------------------------------------------+--------------------+---------------------+
  3. | name | labels | algorithm_type | algorithm_props | load_balancer_type | load_balancer_props |
  4. +-------------------+--------+----------------+--------------------------------------------------------------------------------+--------------------+---------------------+
  5. | sql_match_traffic | OLTP | SQL_MATCH | sql=SELECT * FROM t_order WHERE order_id = 1; UPDATE t_order SET order_id = 5; | RANDOM | |
  6. +-------------------+--------+----------------+--------------------------------------------------------------------------------+--------------------+---------------------+
  7. 1 row in set (0.00 sec)
  • Query all traffic rules
  1. SHOW TRAFFIC RULES;
  1. mysql> SHOW TRAFFIC RULES;
  2. +-------------------+--------+----------------+--------------------------------------------------------------------------------+--------------------+---------------------+
  3. | name | labels | algorithm_type | algorithm_props | load_balancer_type | load_balancer_props |
  4. +-------------------+--------+----------------+--------------------------------------------------------------------------------+--------------------+---------------------+
  5. | sql_match_traffic | OLTP | SQL_MATCH | sql=SELECT * FROM t_order WHERE order_id = 1; UPDATE t_order SET order_id = 5; | RANDOM | |
  6. +-------------------+--------+----------------+--------------------------------------------------------------------------------+--------------------+---------------------+
  7. 1 row in set (0.04 sec)

Reserved word

SHOW, TRAFFIC, RULE, RULES