更新时间:2023-11-29 GMT+08:00
分享

查询流控策略列表

功能介绍

查询所有流控策略的信息。

调试

您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。

URI

GET /v2/{project_id}/apic/instances/{instance_id}/throttles

表1 路径参数

参数

是否必选

参数类型

描述

project_id

String

项目ID,获取方式请参见API参考的“附录 > 获取项目ID”章节。

instance_id

String

实例ID

表2 Query参数

参数

是否必选

参数类型

描述

offset

Long

偏移量,表示从此偏移量开始查询,偏移量小于0时,自动转换为0

缺省值:0

limit

Integer

每页显示的条目数量

最小值:1

最大值:500

缺省值:20

id

String

流控策略编号

name

String

流控策略名称

precise_search

String

指定需要精确匹配查找的参数名称,多个参数需要支持精确匹配时参数之间使用“,”隔开。

目前仅支持name。

请求参数

表3 请求Header参数

参数

是否必选

参数类型

描述

X-Auth-Token

String

用户Token。通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。

响应参数

状态码: 200

表4 响应Body参数

参数

参数类型

描述

size

Integer

本次返回的列表长度

total

Long

满足条件的记录数

throttles

Array of ThrottlesInfo objects

本次查询到的流控策略列表

表5 ThrottlesInfo

参数

参数类型

描述

app_call_limits

Integer

APP流量限制是指一个API在时长之内被每个APP访问的次数上限,该数值不超过用户流量限制值。输入的值不超过2147483647。正整数。

name

String

流控策略名称。支持汉字,英文,数字,下划线,且只能以英文和汉字开头,3 ~ 64字符。

说明:

中文字符必须为UTF-8或者unicode编码。

time_unit

String

流控的时间单位

remark

String

流控策略描述字符长度不超过255。

说明:

中文字符必须为UTF-8或者unicode编码。

api_call_limits

Integer

API流量限制是指时长内一个API能够被访问的次数上限。该值不超过系统默认配额限制,系统默认配额为200tps,用户可根据实际情况修改该系统默认配额。输入的值不超过2147483647。正整数。

type

Integer

流控策略的类型

  • 1:基础,表示绑定到流控策略的单个API流控时间内能够被调用多少次。

  • 2:共享,表示绑定到流控策略的所有API流控时间内能够被调用多少次。

enable_adaptive_control

String

是否开启动态流控:

  • TRUE

  • FALSE

暂不支持

user_call_limits

Integer

用户流量限制是指一个API在时长之内每一个用户能访问的次数上限,该数值不超过API流量限制值。输入的值不超过2147483647。正整数。

time_interval

Integer

流量控制的时长单位。与“流量限制次数”配合使用,表示单位时间内的API请求次数上限。输入的值不超过2147483647。正整数。

ip_call_limits

Integer

源IP流量限制是指一个API在时长之内被每个IP访问的次数上限,该数值不超过API流量限制值。输入的值不超过2147483647。正整数。

id

String

流控策略的ID

bind_num

Integer

流控绑定的API数量

is_inclu_special_throttle

Integer

是否包含特殊流控配置

  • 1:包含

  • 2:不包含

create_time

String

创建时间

状态码: 400

表6 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误描述

状态码: 401

表7 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误描述

状态码: 403

表8 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误描述

状态码: 404

表9 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误描述

状态码: 500

表10 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误描述

请求示例

响应示例

状态码: 200

OK

{
  "total" : 1,
  "size" : 1,
  "throttles" : [ {
    "name" : "throttle_demo",
    "create_time" : "2020-07-31T08:44:02.205366118Z",
    "remark" : "Throttling Policy 1",
    "type" : 1,
    "time_interval" : 1,
    "ip_call_limits" : 600,
    "app_call_limits" : 300,
    "time_unit" : "SECOND",
    "api_call_limits" : 800,
    "id" : "3437448ad06f4e0c91a224183116e965",
    "user_call_limits" : 0,
    "enable_adaptive_control" : "FALSE",
    "bind_num" : 0,
    "is_inclu_special_throttle" : 2
  } ]
}

状态码: 400

Bad Request

{
  "error_code" : "APIG.2012",
  "error_msg" : "Invalid parameter value,parameterName:name. Please refer to the support documentation"
}

状态码: 401

Unauthorized

{
  "error_code" : "APIG.1002",
  "error_msg" : "Incorrect token or token resolution failed"
}

状态码: 403

Forbidden

{
  "error_code" : "APIG.1005",
  "error_msg" : "No permissions to request this method"
}

状态码: 404

Not Found

{
  "error_code" : "APIG.3030",
  "error_msg" : "The instance does not exist;id:f0fa1789-3b76-433b-a787-9892951c620ec"
}

状态码: 500

Internal Server Error

{
  "error_code" : "APIG.9999",
  "error_msg" : "System error"
}

状态码

状态码

描述

200

OK

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

500

Internal Server Error

错误码

请参见错误码

分享:

    相关文档

    相关产品