云数据库 TAURUSDB-设置SQL限流规则:请求示例

时间:2024-12-11 17:00:06

请求示例

设置SQL限流规则,限流类型为SELECT、UPDATE、DELETE。

PUT https://{endpoint}/v3/054e292c9880d4992f02c0196d3ea468/instances/af315b8e6aaa41799bd9a31f2de15abcin07/sql-filter/rules

{
  "sql_filter_rules" : [ {
    "node_id" : "c01a5645eb2c4fb6a9373542f5366e50no07",
    "rules" : [ {
      "sql_type" : "SELECT",
      "patterns" : [ {
        "pattern" : "select~from~t1",
        "max_concurrency" : 0
      }, {
        "pattern" : "select~from~t3~where~id",
        "max_concurrency" : 10
      } ]
    }, {
      "sql_type" : "UPDATE",
      "patterns" : [ {
        "pattern" : "update~t3~where~id",
        "max_concurrency" : 10
      } ]
    } ]
  }, {
    "node_id" : "b234a5645eb2c4ji3b9372342f5362397no07",
    "rules" : [ {
      "sql_type" : "SELECT",
      "patterns" : [ {
        "pattern" : "select~from~t3~where~id",
        "max_concurrency" : 10
      } ]
    }, {
      "sql_type" : "DELETE",
      "patterns" : [ {
        "pattern" : "delete~t3~where~id",
        "max_concurrency" : 10
      } ]
    } ]
  } ]
}
support.huaweicloud.com/api-gaussdbformysql/SetSqlFilterRule.html