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

GetAlarmTrend

最近更新时间2023.04.11 16:29:02

首次发布时间2022.11.01 11:26:01

调用GetAlarmTrend接口获取报警趋势。

使用说明

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

请求参数

Query

参数

类型

是否必选

示例值

描述

Action

String

GetAlarmTrend

请求名称。

Version

String

2022-10-12

请求版本。

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

Body

参数

类型

是否必填

示例值

说明

common

object of common

-

通用参数。

id

int64

302

报警任务ID。

time_filter

object of time_filter

-

时间区间。

common

参数

类型

是否必填

示例值

说明

aid

int64

12345

应用ID。

os

string

webpro

服务类型。

time_filter

参数

类型

是否必填

示例值

说明

start_time

int32

1665849600

起始时间。

end_time

int32

1666011403

终止时间。

granularity

int32

60

聚合时间粒度。

返回参数

参数

类型

示例值

说明

err_detail

string

-

错误详情。

data

object of data

-

返回内容。

error_msg

string

-

错误信息。

error_no

int

0

错误码。0为成功。

data

参数

类型

示例值

说明

alarm_trend

object of alarm_trend

-

报警趋势。

alarm_trend

参数

类型

示例值

说明

fields

object of fields

-

指标字段。

source

object

[ "2022-10-11 08:00:00", "0" ]

与field对应的值。

fields

参数

类型

示例值

说明

id

string

date

报警时间,为source[i][0]值的含义。

dataType

string

string

数据类型。

name

string

date

字段名称。

请求示例

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

{
    "common":{
        "aid":12345,
        "os":"webpro"
    },
    "id":302,
    "time_filter":{
        "start_time":1665849600,
        "end_time":1666011403,
        "granularity":3600
    }
}

返回示例

{
    "err_detail":"",
    "data":{
        "alarm_trend":{
            "fields":[
                {
                    "id":"date",
                    "dataType":"string",
                    "name":"date"
                },
                {
                    "id":"alarm_count",
                    "dataType":"number",
                    "name":"报警总数"
                }
            ],
            "source":[
                [
                    "2022-10-11 08:00:00",
                    "0"
                ],
                [
                    "2022-10-17 08:00:00",
                    "156"
                ]
            ]
        }
    },
    "error_msg":"",
    "error_no":0
}