You need to enable JavaScript to run this app.
导航
GetAppExceptionalBatteryTrend
最近更新时间:2024.07.15 16:31:29首次发布时间:2024.04.25 17:57:49

获取App电量异常的趋势。

请求说明

  • 请求方式:POST
  • 请求地址:https://open.volcengineapi.com?Action=GetAppExceptionalBatteryTrend&Version=2024-04-09
ServiceName: apmplus_openapi
Region: cn-beijing
X-App-Ids: xxx
Content-Type: application/json

请求参数

Query

参数类型是否必选示例值描述
ActionStringGetAppExceptionalBatteryTrend接口名称。当前 API 的名称为 GetAppExceptionalBatteryTrend
VersionString2024-04-09接口版本。当前 API 的版本为 2024-04-09

Body

参数类型是否必选示例值描述
start_timeInteger1617225600查询开始时间(Unix时间戳)。
end_timeInteger1617312000查询结束时间(Unix时间戳)。
filtersObject of Condition-筛选条件,可以指定多个键值对来筛选数据。
granularityInteger5聚合粒度,单位是分钟。
metricsStringbattery_trace_cnt指标名。
issue_idStringxx_xxissue ID。

is_new

Integer

0

是否新版本。

  • 1:是新版本
  • 0:不是新版本

status

Array of String

processing

处理状态。

  • pending:未修复
  • processing:修复中
  • ignored:已忽略
  • solved:已修复
  • reopen:重复出现
managersArray of Long[223421]按责任人筛选,传用户ID列表。
tagsArray of Long[1,221]标签。
tokenStringxxx搜索关键词。

Condition

参数类型是否必选示例值描述

op

String

in

操作符。

  • gt:大于
  • gte:大于等于
  • lt:小于
  • lte:小于等于
  • eq:等于
  • neq:不等于
  • in:包含
  • not_in:不包含
  • lk:模糊匹配特定模式的数据
  • nlk:排除模糊匹配的数据

type

String

expression

筛选条件类型。

  • expression:当前condition是一个表达式。
  • and:当前condition是一个复合表达式,多个sub_condition的逻辑关系是and。
  • or:当前condition是一个复合表达式,多个sub_condition的逻辑关系是or。
  • map:当前condition是map类型。
valueStringAndroid筛选值。
valuesArray of String["Android"]筛选值,支持多个。
map_keyStringkey_1map类型key,当type为map时必填。
dimensionStringaid条件的名称。
sub_conditionsArray of Condition-子条件。

返回参数

参数类型示例值描述
dataArray of TrendLine-不分组的请求下,list只有一个元素,分组情况下会有多个元素,每个元素代表一条线。
error_msgStringsuccess错误信息。
error_noInteger0错误码。

TrendLine

参数类型示例值描述
nameStringtest123线的名称,在分组的情况下,name应该是分组维度的取值,比如用来显示曲线的图标。
pointsArray of TrendPoint-曲线上的点。
totalDouble总数

TrendPoint

参数类型示例值描述
alertObject of AlertPoint-提示信息。
valueDouble123指标值。
timestampLong1665417600指标发生时间(Unix时间戳)。
readable_timestampString2022-10-11指标发生时间(自然时间)。

AlertPoint

参数类型示例值描述
msgStringNo error提示信息。
alertBooleantrue是否需要提示。

请求示例

POST https://open.volcengineapi.com?Action=GetAppExceptionalBatteryTrend&Version=2024-04-09
{
    "start_time": 1617225600,
    "end_time": 1617312000,
    "filters": {
        "type": "and",
        "sub_conditions": [
            {
                "dimension": "apm_version",
                "type": "expression",
                "op": "in",
                "values": [
                    "1.4.5"
                ]
            },
            {
                "dimension": "device_model",
                "type": "expression",
                "op": "in",
                "values": [
                    "MI 5X"
                ]
            }
        ]
    },
    "granularity": 5,
    "metrics": "battery_trace_cnt",
    "issue_id": "xx_xx",
    "is_new": 0,
    "status": [
        "pleasant"
    ],
    "managers": 223421,
    "tags": [
        1,
        221
    ],
    "token": "xxx"
}

返回示例

{
    "data": [
        {
            "name": "test123",
            "points": [
                {
                    "alert": "-",
                    "value": 123,
                    "timestamp": 1665417600,
                    "readable_timestamp": "2022-10-11"
                }
            ]
        }
    ],
    "error_msg": "",
    "error_no": 0
}

错误码

本接口无特有的错误码。更多信息请参见错误码