云服务器内容精选

  • 响应示例 状态码: 200 OK { "total" : 1, "size" : 1, "throttle_specials" : [ { "call_limits" : 200, "app_name" : "app_demo", "object_name" : "app_demo", "object_id" : "356de8eb7a8742168586e5daf5339965", "throttle_id" : "3437448ad06f4e0c91a224183116e965", "apply_time" : "2020-08-04T02:40:56Z", "id" : "a3e9ff8db55544ed9db91d8b048770c0", "app_id" : "356de8eb7a8742168586e5daf5339965", "object_type" : "APP" } ] } 状态码: 400 Bad Request { "error_code" : "APIG.2012", "error_msg" : "Invalid parameter value,parameterName:app_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.3005", "error_msg" : "Request throttling policy 3437448ad06f4e0c91a224183116e965 does not exist" } 状态码: 500 Internal Server Error { "error_code" : "APIG.9999", "error_msg" : "System error" }
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 size Integer 本次返回的列表长度 total Long 满足条件的记录数 throttle_specials Array of ThrottleSpecialInfo objects 本次查询返回的特殊配置列表 表5 ThrottleSpecialInfo 参数 参数类型 描述 id String 特殊配置的编号 call_limits Integer 特殊对象在流控时间内能够访问API的最大次数限制 apply_time String 设置时间 app_name String 作用的APP名称 app_id String 作用的APP编号 object_id String 特殊对象的身份标识 object_type String 特殊对象类型:APP、USER object_name String 作用的APP或租户的名称 throttle_id 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 错误描述
  • URI GET /v2/{project_id}/apigw/instances/{instance_id}/throttles/{throttle_id}/throttle-specials 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 项目ID,获取方式请参见获取项目ID。 instance_id 是 String 实例ID,在API网关控制台的“实例信息”中获取。 throttle_id 是 String 流控策略的编号 表2 Query参数 参数 是否必选 参数类型 描述 offset 否 Long 偏移量,表示从此偏移量开始查询,偏移量小于0时,自动转换为0 缺省值:0 limit 否 Integer 每页显示的条目数量,条目数量小于等于0时,自动转换为20,条目数量大于500时,自动转换为500 最小值:1 最大值:500 缺省值:20 object_type 否 String 特殊流控类型:APP,USER app_name 否 String 筛选的特殊应用名称 user 否 String 筛选的特殊用户名称
  • 响应示例 状态码: 200 OK { "total" : 1, "size" : 1, "throttle_specials" : [ { "call_limits" : 200, "app_name" : "app_demo", "object_name" : "app_demo", "object_id" : "356de8eb7a8742168586e5daf5339965", "throttle_id" : "3437448ad06f4e0c91a224183116e965", "apply_time" : "2020-08-04T02:40:56Z", "id" : "a3e9ff8db55544ed9db91d8b048770c0", "app_id" : "356de8eb7a8742168586e5daf5339965", "object_type" : "APP" } ] } 状态码: 400 Bad Request { "error_code" : "APIG.2012", "error_msg" : "Invalid parameter value,parameterName:app_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.3005", "error_msg" : "Request throttling policy 3437448ad06f4e0c91a224183116e965 does not exist" } 状态码: 500 Internal Server Error { "error_code" : "APIG.9999", "error_msg" : "System error" }
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 size Integer 本次返回的列表长度 total Long 满足条件的记录数 throttle_specials Array of ThrottleSpecialInfo objects 本次查询返回的特殊配置列表 表5 ThrottleSpecialInfo 参数 参数类型 描述 id String 特殊配置的编号 call_limits Integer 特殊对象在流控时间内能够访问API的最大次数限制 apply_time String 设置时间 app_name String 作用的APP名称 app_id String 作用的APP编号 object_id String 特殊对象的身份标识 object_type String 特殊对象类型:APP、USER object_name String 作用的APP或租户的名称 throttle_id 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 错误描述
  • 响应参数 状态码: 201 表4 响应Body参数 参数 参数类型 描述 id String 特殊配置的编号 call_limits Integer 特殊对象在流控时间内能够访问API的最大次数限制 apply_time String 设置时间 app_name String 作用的APP名称 app_id String 作用的APP编号 object_id String 特殊对象的身份标识 object_type String 特殊对象类型:APP、USER object_name String 作用的APP或租户的名称 throttle_id String 流控策略编号 状态码: 400 表5 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 401 表6 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 403 表7 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 404 表8 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述 状态码: 500 表9 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误描述
  • 响应示例 状态码: 201 Created { "call_limits" : 150, "app_name" : "app_demo", "object_name" : "app_demo", "object_id" : "356de8eb7a8742168586e5daf5339965", "throttle_id" : "3437448ad06f4e0c91a224183116e965", "apply_time" : "2020-08-04T02:40:56.717710961Z", "id" : "a3e9ff8db55544ed9db91d8b048770c0", "app_id" : "356de8eb7a8742168586e5daf5339965", "object_type" : "APP" } 状态码: 400 Bad Request { "error_code" : "APIG.2003", "error_msg" : "The parameter value is too large,parameterName:call_limits. 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.3004", "error_msg" : "App 356de8eb7a8742168586e5daf5339965 does not exist" } 状态码: 500 Internal Server Error { "error_code" : "APIG.9999", "error_msg" : "System error" }
  • 请求参数 表2 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String 用户Token。通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 表3 请求Body参数 参数 是否必选 参数类型 描述 call_limits 是 Integer 流控时间内特殊对象能够访问API的最大次数限制 最小值:1 object_id 是 String 特殊APP的编号或特殊租户的账号ID 最小长度:1 最大长度:65 object_type 是 String 特殊对象类型
  • URI HTTP/HTTPS请求方法以及URI如下表所示。 表1 HTTP/HTTPS请求方法以及URI 请求方法 URI GET /v1/{project_id}/apigw/instances/{instance_id}/throttle-specials/{strategy_id}[?page_size, page_no, instance_type, app_name, user] 可以在URI后面用‘?’和‘&’添加不同的查询条件组合。 查询条件可为以下字段以及对应的值:strategy_id、app_name、user、 page_size、page_no。 URI中的参数说明如下表所示。 表2 参数说明 名称 是否必选 类型 说明 project_id 是 String 项目ID。可从控制台“我的凭证”中获取region下项目ID,管理员权限可查询。 instance_id 是 String 实例ID,可从API网关控制台的专享版实例信息中获取。 strategy_id 是 String 流控策略的编号 page_size 否 Integer 每页显示的条数,默认值:20 page_no 否 Integer 页码,默认值:1 instance_type 否 String 特殊流控类型: APP, USER app_name 否 String 筛选的特殊应用名称 user 否 String 筛选的特殊租户的账号ID
  • 响应消息 表3 参数说明 名称 类型 说明 throttle_specials 字典数据类型 本次查询返回的特殊配置列表 total Integer 符合条件的特殊设置总数 size Integer 本次查询返回的列表长度 表4 throttle_specials参数说明 参数 类型 说明 id String 特殊配置的编号 strategy_id String 流控策略编号 instance_id Integer 特殊对象的身份标识 instance_name String 作用的APP或租户的名称 instance_type Integer 特殊对象的类型 call_limits Integer 特殊对象在流控时间内能够访问API的最大次数限制 apply_time Timestamp 设置时间 app_id String 作用的APP编号 app_name String 作用的APP名称 响应消息样例: { "total": 1, "size": 1, "throttle_specials": [{ "id": "778879b8-df10-495b-a087-874859fdea6d", "strategy_id": "a3106cfe-801f-4919-b0d7-d785dc5b47f9", "instance_id": "98efd77d-10b5-4eca-8170-ed30a4a286a4", "instance_name": "app_002", "instance_type": "APP", "call_limits": 180, "apply_time": "2017-12-29T03:11:18Z", "app_id": "98efd77d-10b5-4eca-8170-ed30a4a286a4", "app_name": "app_002" }] }
  • 响应消息 表3 参数说明 参数 类型 说明 id String 特殊配置的编号 strategy_id String 流控策略编号 instance_id Integer 特殊对象的身份标识 instance_name String 作用的APP或租户的名称 instance_type Integer 特殊对象的类型 call_limits Integer 特殊对象在流控时间内能够访问API的最大次数限制 apply_time Timestamp 设置时间 app_id String 作用的APP编号 app_name String 作用的APP名称 响应消息样例: { "id": "778879b8-df10-495b-a087-874859fdea6d", "strategy_id": "a3106cfe-801f-4919-b0d7-d785dc5b47f9", "instance_id": "98efd77d-10b5-4eca-8170-ed30a4a286a4", "instance_name": "app_002", "instance_type": "APP", "call_limits": 150, "apply_time": "2017-12-29T03: 11: 18.2698381Z", "app_id": "98efd77d-10b5-4eca-8170-ed30a4a286a4", "app_name": "app_002" }
  • 请求消息 表2 参数说明 参数 是否必选 类型 说明 call_limits 是 Integer 流控时间内特殊对象能够访问API的最大次数限制 instance_id 是 String 特殊APP的编号或特殊租户的账号ID instance_type 是 String 对象类型:APP/USER strategy_id 是 String 流控策略编号 请求消息样例: { "call_limits": 150, "instance_id": "98efd77d-10b5-4eca-8170-ed30a4a286a4", "instance_type": "APP", "strategy_id": "a3106cfe-801f-4919-b0d7-d785dc5b47f9" }
  • 对象模型 本节介绍特殊流控的对象模型,如下表所示: “操作类型”用于描述字段的属性,表示对应字段的值可进行的操作: C:创建;U:更新;R:读取。 “是否必选”列表示对于“操作类型”为“C”的创建操作,对应字段是否为必选字段。 表1 特殊流控对象模型 参数 类型 说明 操作类型 是否必选 id String 特殊配置的编号 R - strategy_id String 流控策略编号 CR 是 instance_id String 生效的特殊对象的编号 CR 是 instance_type String 对象类型APP/USER CR 是 call_limits Integer 特殊对象在流控时间内能够访问API的最大次数限制 CRU 是 apply_time Timestamp 设置的时间 R - 父主题: 设置特殊流控
  • 对象模型 本节介绍特殊流控的对象模型,如下表所示: “操作类型”用于描述字段的属性,表示对应字段的值可进行的操作: C:创建;U:更新;R:读取。 “是否必选”列表示对于“操作类型”为“C”的创建操作,对应字段是否为必选字段。 表1 特殊流控对象模型 参数 类型 说明 操作类型 是否必选 id String 特殊配置的编号 R - strategy_id String 流控策略编号 CR 是 instance_id String 生效的特殊对象的编号 CR 是 instance_type String 对象类型APP/USER CR 是 call_limits Integer 特殊对象在流控时间内能够访问API的最大次数限制 CRU 是 apply_time Timestamp 设置的时间 R - 父主题: 设置特殊流控(待下线)