云数据库 GAUSSDB-创建SQL限流任务:请求示例

时间:2024-11-05 09:15:23

请求示例

  • 创建限流范围是SQL级别,限流类型是SQL_ID的限流任务。
    https://gaussdb-opengauss.cn-north-1.myhuaweicloud.com/v3/0611f1bd8b00d5d32f17c017f15b599f/instances/3d39c18788b54a919bab633874c159dfin14/limit-task
    {
       "task_scope" : "SQL",
       "start_time" : "2023-06-06T01:47:20+0800",
       "end_time" : "2023-06-07T01:47:20+0800",
       "limit_type" : "SQL_ID",
       "limit_type_value" : "39b6a1a",
       "task_name" : "test1",
       "sql_model" : "select * from a where b = ?",
       "parallel_size" : 100,
       "node_infos" : [ {
          "node_id" : "46d996fdda594f58b17fe509061e0893no14",
         "sql_id" : "39b6a1a"
       } ]
    }
  • 创建限流范围是SQL级别,限流类型是SQL_TYPE的限流任务。
    https://gaussdb-opengauss.cn-north-1.myhuaweicloud.com/v3/0611f1bd8b00d5d32f17c017f15b599f/instances/3d39c18788b54a919bab633874c159dfin14/limit-task
    {
       "task_scope" : "SQL",
       "start_time" : "2023-06-06T01:47:20+0800",
       "end_time" : "2023-06-07T01:47:20+0800",
       "limit_type" : "SQL_TYPE",
       "limit_type_value" : "select",
       "task_name" : "test1",
       "key_words" : "table1,id",
       "parallel_size" : 100,
       "databases" : "test1"
    }
  • 创建限流范围是SESSION级别,限流类型是SESSION_ACTIVE_MAX_COUNT的限流任务。
    https://gaussdb-opengauss.cn-north-1.myhuaweicloud.com/v3/0611f1bd8b00d5d32f17c017f15b599f/instances/3d39c18788b54a919bab633874c159dfin14/limit-task
    {
       "task_name" : "test",
       "task_scope" : "SESSION",
       "limit_type" : "SESSION_ACTIVE_MAX_COUNT",
       "limit_type_value" : "CPU_OR_MEMORY",
       "cpu_utilization" : 80,
       "memory_utilization" : 80,
       "parallel_size" : 100
    }
support.huaweicloud.com/api-gaussdb/gaussdb_api_290.html