You need to enable JavaScript to run this app.
导航

GetAppAlarmRuleList

最近更新时间2023.12.26 16:39:07

首次发布时间2022.11.18 17:53:52

调用GetAppAlarmRuleList接口获取App报警任务列表。

使用说明

  • 接口名称:GetAppAlarmRuleList
  • 请求方式:POST
  • 接口地址:/?Action=GetAppAlarmRuleList&Version=2022-10-12

请求参数

Query

参数

类型

是否必选

示例值

描述

Action

String

GetAppAlarmRuleList

请求名称。

Version

String

2022-10-12

请求版本。

ServiceName : apmplus_openapi
Region : cn-beijing 
X-App-Ids : xxx
Content-Type : application/json

Body

参数

类型

是否必选

示例值

描述

aid

i64

123456

应用ID。

rule_id

i64

1

报警任务ID。

monitor_types

array of string

["crash"]

监控类型。

  • crash:崩溃
  • crash_defend:崩溃防护
  • lag:卡顿
  • flutter_crash:flutter监控
  • app_page_js_err:页面监控/js错误
  • app_page_ajax_err:页面监控/请求错误
  • app_page_perf:页面监控/性能
  • app_event:事件报警
  • net_err:网络错误
  • custom_exception:自定义错误
  • traffic_exception:流量
  • disk_exception:磁盘
  • battery_trace:电量
  • cpu_exception:CPU

status

array of string

1

任务状态。

  • 1:启用
  • 2:关闭

query_key

string

test

搜索关键字,可按配置,接收组关键字搜索。

page_size

i64

2

分页条数 ,不传默认10。

page_no

i64

1

起始页码为1。

self

i8

0

是否只查看自己创建的规则。

  • 1:只查看自己
  • 0:查看全部

返回参数

参数

类型

示例值

描述

data

object of data

-

报警任务列表。

error_msg

string

-

错误信息,成功为空。

error_no

i32

0

错误码,成功为0。

data

参数

类型

示例值

描述

data

array of Data

-

报警任务。

total_cnt

i64

1

总条数

total_page

i64

1

总页数。

curr_page

i64

1

当前页码。

Data

参数

类型

示例值

描述

id

i64

12345

报警规则ID。如果是新建的可以不传。

name

string

测试报警001

规则名称。

description

string

alarm for xxx

规则描述。

monitor_type

string

crash

监控类型。

  • crash:崩溃
  • crash_defend:崩溃防护
  • lag:卡顿
  • flutter_crash:flutter监控
  • app_page_js_err:页面监控/js错误
  • app_page_ajax_err:页面监控/请求错误
  • app_page_perf:页面监控/性能
  • app_event:事件报警
  • net_err:网络错误
  • custom_exception:自定义异常异常类型。

alarm_level

string

fatal

报警级别。

  • warning
  • fatal

check_cycle

i64

5

监测周期,单位为分钟,瞬时报警请填0。

activation_start

string

08:00

全天生效时间起点,24h制,精确到分。
例如,早上9点为"09:00"。

activation_end

string

23:00

全天生效时间终点,24h制,精确到分。
例如,晚上9点为"21:00"。

activations

array of Activation

-

多个时间段。

status

i8

1

报警状态。

  • 1:启用
  • 2:停用
  • 0:删除

filter

object of Filter

-

报警指标筛选条件。

group_bys

array of GroupBy

-

报警分组条件。

hit_rule

object of HitRule

-

报警触发条件。

notice_conf

object of NoticeConf

-

通知配置信息。

brief

string

任务间隔:5分钟\n筛选条件:\n报警分组:操作系统名称\n最近180分钟内,崩溃次数 阈值>=1

概述信息。

count

i64

76267

报警次数。

update_at

string

2023-02-06 15:59:38

更新事件的时间,格式为“yyyy-MM-dd HH:mm:ss”。

recently_occur_time

string

2023-02-13 10:46:48

最近发生时间,没有为空字符串。

ack_time

string

2022-04-28 17:57:13

ACK时间。

ack_status

i8

0

ACK状态。

  • 0:未ACK
  • 1:ACK

Activation

参数

类型

示例值

描述

activation_start

string

08:00

生效时间起点。

activation_end

string

23:00

生效时间终点。

Filter

参数

类型

示例值

描述

type

string

and

条件类型。

  • expression:表达式
  • and:且条件
  • or:或条件

dimension

string

aid

条件的名称。

op

string

in

操作符。

  • in:包含

value

string

123456

筛选值。

values

array of string

[123456]

筛选值,支持多个。

sub_conditions

array of Filter

-

子条件。

GroupBy

参数

类型

示例值

描述

dimension

string

path

分组名称。

HitRule

参数

类型

示例值

描述

type

string

and

条件类型。

  • expression:表达式
  • and:且条件
  • or:或条件

hit_rule_type

string

threshold

规则类型。

  • threshold:阈值
  • compare:同环比

threshold_calculate_type

string

-

阈值计算方式,是纯做加减还是做百分比。

threshold_value

double

10000

报警阈值。

op

string

gt

比较符。

  • gt:>
  • gte:≥
  • lt:<
  • lte:≤
  • eq:=

indicator

object of Indicator

-

阈值类型参数配置。

indicators

array of Indicator

-

同环比类型参数配置。

sub_hit_rules

array of HitRule

-

子规则。

NoticeConf

参数

类型

示例值

描述

type

array of string

mail

通知类型。

  • lark:飞书
  • mail:邮箱
  • dingding:钉钉
  • wechat:企业微信

lark_web_hooks

array of string

-

增加飞书的webhook链接配置项。

dingding_web_hooks

array of string

-

钉钉webhook。

wechat_web_hooks

array of string

-

微信webhook。

alarm_receives

array of AlarmReceive

-

接收组。

Indicator

参数

类型

示例值

描述

name

string

crash_count

指标定义名称,由GetAppAlarmMetricsConf接口获取。

value

double

10

指标值。

recently

i64

180

指标查询时间范围,比如180min。

compare_time

i64

0

比较时间。

  • 5:前五分钟
  • 0:当前

start_time

i64

-

统计起止时间。

end_time

i64

-

统计起止时间。

AlarmReceive

参数

类型

示例值

描述

is_group

boolean

true

是否接收组。

user_name

string

-

单个用户。

email

string

-

群组。

group_name

string

-

群组名。

group_id

i32

123

接收组ID。

请求示例

POST https://open.volcengineapi.com/?Action=GetAppAlarmRuleList&Version=2022-10-12 

{
    "monitor_types":[
        "crash"
    ],
    "query_key":"测试报警",
    "status":[

    ],
    "page_no":1,
    "page_size":1
}

返回示例

正常返回示例

{
    "err_detail": "",
    "data": {
        "data": [
            {
                "id": 717,
                "name": "测试报警0401",
                "monitor_type": "crash",
                "alarm_level": "fatal",
                "check_cycle": 5,
                "activations": [
                    {
                        "activation_start": "00:00",
                        "activation_end": "23:59",
                        "activation_start_stamp": 1541174400,
                        "activation_end_stamp": 1541260740
                    }
                ],
                "activation_start": "08:00",
                "activation_end": "08:00",
                "status": 1,
                "callback_url": "",
                "filter": {
                    "type": "and",
                    "dimension": "",
                    "op": "",
                    "sub_conditions": [
                        {
                            "type": "expression",
                            "dimension": "aid",
                            "op": "in",
                            "values": [
                                "187277"
                            ]
                        }
                    ]
                },
                "group_bys": [
                    {
                        "dimension": "os"
                    }
                ],
                "hit_rule": {
                    "type": "and",
                    "hit_rule_type": "",
                    "threshold_calculate_type": "",
                    "threshold_value": 0,
                    "op": "",
                    "sub_hit_rules": [
                        {
                            "type": "expression",
                            "hit_rule_type": "threshold",
                            "indicator": {
                                "name": "crash_count",
                                "recently": 180,
                                "compare_time": 0
                            },
                            "threshold_calculate_type": "",
                            "threshold_value": 1,
                            "op": "gte",
                            "hit_metric": []
                        }
                    ],
                    "hit_metric": []
                },
                "notice_conf": {
                    "type": [
                        "lark"
                    ],
                    "lark_web_hooks": [
                        "https://open.feishu.cn/open-apis/bot/v2/hook/2a****"
                    ],
                    "dingding_web_hooks": [],
                    "wechat_web_hooks": []
                },
                "brief": "任务间隔:5分钟\n筛选条件:\n报警分组:操作系统名称\n最近180分钟内,崩溃次数 阈值>=1",
                "count": 84947,
                "update_at": "2023-03-09 13:11:40",
                "recently_occur_time": "2023-03-20 10:28:53",
                "ack_status": 0,
                "ack_time": "2023-03-02 09:43:21"
            }
        ],
        "total_cnt": 10,
        "total_page": 10,
        "curr_page": 1
    },
    "error_msg": "",
    "error_no": 0
}

异常返回示例

{
    "ResponseMetadata": {
        "RequestId": "201806*****2D30",
        "Action": "GetAppAlarmRuleList",
        "Version": "2022-10-12",
        "Service": "***",
        "Region": "cn-north-1",
        "Error": {
            "Code": "200000",
            "Message": "参数异常"
        }
    }
}