
# 按照集成应用维度查询调用应用指标统计值 - ListStatisticsConsumerAppForSplitRomaApps
#### 功能介绍
根据传入的当前时间和查询维度类型，查询统计时长内的某个应用请求不同API产品的指标统计值。
受限使用，如有疑问请联系技术工程师。
#### 调试
您可以在[API Explorer](https://console.huaweicloud.com/apiexplorer/#/openapi/ROMA/doc?api=ListStatisticsConsumerAppForSplitRomaApps)中调试该接口，支持自动认证鉴权。API Explorer可以自动生成SDK代码示例，并提供SDK代码示例调试功能。
#### 授权信息
账号具备所有API的调用权限，如果使用账号下的IAM用户调用当前API，该IAM用户需具备调用API所需的权限，具体权限要求请参见[权限和授权项](https://support.huaweicloud.com/api-roma/roma_06_0018.html)。
#### URI
GET /v2/{project_id}/apic/instances/{instance_id}/statistics/apps/{consumer_app_id}/roma-apps
表1路径参数 
| 参数              | 是否必选 | 参数类型   | 描述                                  |
|:---|:---|:---|:---|
| project_id      | 是    | String | 项目ID，获取方式请参见API参考的"附录 \> 获取项目ID"章节。 |
| instance_id     | 是    | String | 实例ID                                |
| consumer_app_id | 是    | String | 调用应用编号                              |
表2Query参数 
| 参数           | 是否必选 | 参数类型   | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
|:---|:---|:---|:---|
| roma_app_ids | 是    | String | 集成应用编号字符串，最多每次查询5个集成应用，以英文逗号分隔                                                                                                                                                                                                                                                                                                                                                                                                                         |
| cycle        | 否    | String | 查询统计周期 - minute：分钟 - hour：小时 - day：天 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 - 同时给定start_time和end_time优先查询\[start_time, end_time\] - start_time不存在，end_time和duration存在且合法，则查询区间为\[end_time - duration, end_time\] - start_time和end_time不存在，duration存在且合法，令end_time=now，则查询区间为\[end_time - duration, end_time\] - end_time不存在，start_time和duration存在且合法，令end_time=now，则查询区间为\[end_time - duration, end_time\] - start_time，end_time和duration都不存在，报错missing time range parameters。 |
#### 请求参数
表3请求Header参数 
| 参数           | 是否必选 | 参数类型   | 描述                                                       |
|:---|:---|:---|:---|
| X-Auth-Token | 是    | String | 用户Token。通过调用IAM服务获取用户Token接口获取（响应消息头中X-Subject-Token的值）。 |
   
#### 响应参数
**状态码：200**
表4响应Body参数 
| 参数         | 参数类型                                                                                                 | 描述            |
|:---|:---|:---|
| code       | String                                                                                               | 响应码           |
| start_time | Long                                                                                                 | 统计起始时间UTC的时间戳 |
| end_time   | Long                                                                                                 | 统计结束时间UTC的时间戳 |
| roma_apps  | Array of [RomaAppDetail] objects | 集成应用维度统计信息列表  |
   
 表5RomaAppDetail 
| 参数            | 参数类型                                                                                           | 描述              |
|:---|:---|:---|
| roma_app_id   | String                                                                                         | 集成应用编号          |
| roma_app_name | String                                                                                         | 集成应用名称          |
| list          | Array of [Statistics] objects | 集成应用维度下不同周期指标列表 |
   
 表6Statistics 
| 参数                  | 参数类型    | 描述             |
|:---|:---|:---|
| max_latency         | Integer | 最大延时           |
| avg_latency         | Float   | 平均延时           |
| req_count           | Integer | 请求总次数          |
| req_count2xx        | Integer | 2xx响应码总次数      |
| req_count4xx        | Integer | 4xx响应码总次数      |
| req_count5xx        | Integer | 5xx响应码总次数      |
| req_count_error     | Integer | 错误次数           |
| max_inner_latency   | Integer | 最大网关内部延时       |
| avg_inner_latency   | Float   | 平均网关内部延时       |
| max_backend_latency | Integer | 最大后端延时         |
| avg_backend_latency | Float   | 平均后端延时         |
| output_throughput   | Long    | 下行吞吐量（byte）    |
| input_throughput    | Long    | 上行吞吐量（byte）    |
| current_minute      | Long    | 当前时间的UTC格式的时间戳 |
| req_time            | String  | 请求时间 预留字段，暂不支持 |
| register_time       | String  | 注册时间 预留字段，暂不支持 |
   
**状态码：400**
表7响应Body参数 
| 参数         | 参数类型   | 描述   |
|:---|:---|:---|
| error_code | String | 错误码  |
| error_msg  | String | 错误描述 |
   
**状态码：401**
表8响应Body参数 
| 参数         | 参数类型   | 描述   |
|:---|:---|:---|
| error_code | String | 错误码  |
| error_msg  | String | 错误描述 |
   
**状态码：403**
表9响应Body参数 
| 参数         | 参数类型   | 描述   |
|:---|:---|:---|
| error_code | String | 错误码  |
| error_msg  | String | 错误描述 |
   
**状态码：404**
表10响应Body参数 
| 参数         | 参数类型   | 描述   |
|:---|:---|:---|
| error_code | String | 错误码  |
| error_msg  | String | 错误描述 |
   
**状态码：500**
表11响应Body参数 
| 参数         | 参数类型   | 描述   |
|:---|:---|:---|
| error_code | String | 错误码  |
| error_msg  | String | 错误描述 |
   
#### 请求示例
无
#### 响应示例
**状态码：200**
OK
```
{
  "code" : "APIG.0000",
  "start_time" : 1599508511,
  "end_time" : 1599616511,
  "roma_apps" : [ {
    "roma_app_id" : "1a7b421c-6103-4fcb-a0d7-3e322e863cb0",
    "roma_app_name" : "ycs-product",
    "list" : [ {
      "max_latency" : 0,
      "avg_latency" : 0,
      "max_inner_latency" : 0,
      "avg_inner_latency" : 0,
      "max_backend_latency" : 0,
      "avg_backend_latency" : 0,
      "req_count" : 0,
      "req_count2xx" : 0,
      "req_count4xx" : 0,
      "req_count5xx" : 0,
      "req_count_error" : 0,
      "output_throughput" : 0,
      "input_throughput" : 0,
      "current_minute" : 0
    } ]
  } ]
}
```
**状态码：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 |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-roma/ErrorCode.html)。
