不同调用应用请求的指标统计值TopN - ListAppUsagesTopN
功能介绍
查询统计时长内所有、某个集成应用或者某个API被不同调用应用请求的指标统计值TopN。
受限使用,如有疑问请联系技术工程师。
接口约束
调用超时或返回“request statistics error”报错时,请切换其他mode或缩短统计时长。
授权信息
账号具备所有API的调用权限,如果使用账号下的IAM用户调用当前API,该IAM用户需具备调用API所需的权限,具体权限要求请参见权限和授权项。
URI
GET /v2/{project_id}/apic/instances/{instance_id}/statistics/app-usages
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
project_id | 是 | String | 项目ID,获取方式请参见API参考的“附录 > 获取项目ID”章节。 |
instance_id | 是 | String | 实例ID |
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
mode | 是 | String | 查询模式
|
roma_app_id | 否 | String | 集成应用编号, 查询模式为APP时必填 |
api_id | 否 | String | API编号, 查询模式为API时必填 |
cycle | 否 | String | 查询统计周期
cycle=minute时,支持查询最近3小时的数据 cycle=hour时,支持查询最近3天的数据 cycle=day时,支持查询最近90天的数据 |
start_time | 否 | String | 开始时间,格式:2020-06-18 10:00:01 |
end_time | 否 | String | 结束时间,格式:2020-06-18 23:00:00 |
duration | 否 | String | 统计时长格式:整数+单位(m、h),m:分钟,h:小时,可支持小时与分钟的组合。例如:1h或2h45m
|
top_app_num | 否 | Integer | 调用应用的topN |
请求参数
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
X-Auth-Token | 是 | String | 用户Token。通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 |
响应参数
状态码:200
参数 | 参数类型 | 描述 |
|---|---|---|
code | String | 响应码 |
start_time | Long | 统计起始时间UTC的时间戳 |
end_time | Long | 统计结束时间UTC的时间戳 |
app_req_count | Array of AppRequestStatisticInfo objects | API被应用请求次数TOP_n统计信息列表 |
app_input_throughput | Array of AppInputStatisticInfo objects | API被应用请求上行吞吐量TOP_n统计信息列表 |
app_output_throughput | Array of AppOutputStatisticInfo objects | API被应用请求下行吞吐量TOP_n统计信息列表 |
状态码:400
参数 | 参数类型 | 描述 |
|---|---|---|
error_code | String | 错误码 |
error_msg | String | 错误描述 |
状态码:401
参数 | 参数类型 | 描述 |
|---|---|---|
error_code | String | 错误码 |
error_msg | String | 错误描述 |
状态码:403
参数 | 参数类型 | 描述 |
|---|---|---|
error_code | String | 错误码 |
error_msg | String | 错误描述 |
状态码:404
参数 | 参数类型 | 描述 |
|---|---|---|
error_code | String | 错误码 |
error_msg | String | 错误描述 |
状态码:500
参数 | 参数类型 | 描述 |
|---|---|---|
error_code | String | 错误码 |
error_msg | String | 错误描述 |
请求示例
无
响应示例
状态码:200
OK
{
"code" : "APIG.0000",
"start_time" : 1599400492,
"end_time" : 1599616492,
"app_req_count" : [ {
"app_id" : "c38f75b5-b28a-41e9-afba-b6329b959d07",
"app_name" : "ycs-app",
"req_count" : 5
} ],
"app_input_throughput" : [ {
"app_id" : "c38f75b5-b28a-41e9-afba-b6329b959d07",
"app_name" : "ycs-app",
"input_throughput" : 2990
} ],
"app_output_throughput" : [ {
"app_id" : "c38f75b5-b28a-41e9-afba-b6329b959d07",
"app_name" : "ycs-app",
"output_throughput" : 1695
} ]
} 状态码:400
Bad Request
{
"error_code" : "APIG.2012",
"error_msg" : "Invalid parameter value,parameterName:api_id. 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.3002",
"error_msg" : "API 39bce6d25a3f470e8cf7b2c97174f7d9 does not exist"
} 状态码: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 |
错误码
请参见错误码。

