ListAlertMessages - 获取报警信息的列表

更新时间:
复制 MD 格式

调用ListAlertMessages获取报警信息的列表。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。

  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。

  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:

    • 对于必选的资源类型,用前面加 * 表示。

    • 对于不支持资源级授权的操作,用全部资源表示。

  • 条件关键字:是指云产品自身定义的条件关键字。

  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。

操作

访问级别

资源类型

条件关键字

关联操作

dataworks:*

list

*全部资源

*

无 无

请求参数

名称

类型

必填

描述

示例值

PageNumber

integer

是

分页的页数。默认值为 1、最小值为 1、最大值为 30。

1

PageSize

integer

是

每页显示的条数,默认为 10,最大 100 条。

10

BeginTime

string

是

起始报警时间,需要使用 yyyy-MM-dd'T'HH:mm:ssZ 的 UTC 格式。

2020-04-02T00:00:00+0800

EndTime

string

是

截止报警时间,需要使用 yyyy-MM-dd'T'HH:mm:ssZ 的 UTC 格式。

2020-04-04T00:00:00+0800

RemindId

integer

否

自定义规则的 ID,当 AlertRuleTypes 参数配置为 USER_DEFINE 自定义规则时生效。 该参数与 BaselineId 参数配置一个即可。

9527

AlertMethods

string

否

报警方式,取值如下:

  • MAIL:邮件。

  • SMS:短信。

  • PHONE:电话。仅 DataWorks 专业版及以上版本支持。

多个报警方式之间使用英文逗号(,)分隔。

SMS,MAIL,PHONE

AlertUser

string

否

报警接收人的阿里云 UID。

12345

AlertRuleTypes

string

否

规则类型,包括 GLOBAL(全局规则)、USER_DEFINE(自定义规则)和 OTHER(其它)。多个规则类型之间使用英文逗号(,)分隔。

GLOBAL,USER_DEFINE,OTHER

BaselineId

integer

否

基线 ID。当 AlertRuleTypes 参数配置为 GLOBAL 时生效。 该参数与 RemindId 参数配置一个即可。

1234

返回参数

名称

类型

描述

示例值

object

返回结果。

HttpStatusCode

integer

HTTP 返回码。

200

RequestId

string

本次调用的唯一 ID。出现错误后,您可以根据该 ID 排查问题。

0000-ABCD-EFG****

ErrorMessage

string

错误信息。

The specified parameters are invalid.

ErrorCode

string

错误码。

Invalid.Tenant.ConnectionNotExists

Success

boolean

调用是否成功。

true

Data

object

返回的报警信息列表。

PageNumber

string

当前的页数。

1

PageSize

string

每页的大小。

10

TotalCount

string

报警信息的总数。

100

AlertMessages

array<object>

报警信息列表。

array<object>

返回数据。

RemindId

integer

当 Source(报警来源)为 REMIND_ALERT(自定义报警)时,返回触发的自定义监控规则 ID。

1234

AlertMessageStatus

string

发送状态,包括 READY_TO_SEND(准备发送)、SEND_FAIL(发送失败)、SEND_SUCCESS(发送成功)和 SEND_OVERLIMIT(报警超限)。

READY_TO_SEND

AlertUser

string

接收人的阿里云 UID。

9527952795****

AlertTime

integer

报警的时间戳。

1553531401000

AlertMethod

string

报警方式,包括 MAIL(邮件)、SMS(短信)和 PHONE(电话,仅 DataWorks 专业版及以上版本支持)。

SMS

Source

string

报警来源,包括 REMIND_ALERT(自定义报警)、TOPIC_ALERT(事件告警)、SLA_ALERT(基线预警)、NODE_CYCLE_ALERT(节点成环报警)和 NODE_LONELY_ALERT(节点孤立报警)。

REMIND_ALERT

Content

string

报警的内容。

Node error

RemindName

string

当 Source(报警来源)为 REMIND_ALERT(自定义提醒)时,返回触发的自定义监控规则名称。

Custom monitoring rule name

AlertId

integer

报警 ID。

1234

Instances

array<object>

当 Source(报警来源)为 REMIND_ALERT(自定义提醒)时,返回触发自定义监控规则的实例列表。其它类型的报警来源返回为空。

object

实例信息。

Status

string

实例状态,包括 NOT_RUN (未运行)、WAIT_TIME(等待时间)、WAIT_RESOURCE(等待资源)、RUNNING(运行中)、CHECKING(校检中)、CHECKING_CONDITION(条件检测中)、FAILURE(运行失败)和 SUCCESS(运行成功)。

NOT_RUN

InstanceId

integer

实例的 ID。

12345

NodeName

string

节点的名称。

Node name

NodeId

integer

节点的 ID。

1234

ProjectId

integer

节点所在工作空间的 ID。

1234

Topics

array<object>

当 Source(报警来源)为 TOPIC_ALERT(全局事件告警)时,返回触发报警的事件列表。当报警来源为其它类型时,返回结果为空。

object

事件信息。

TopicName

string

事件的名称。

9527 error

InstanceId

integer

事件关联的实例 ID。

12345

TopicId

integer

事件的 ID。

1234

TopicOwner

string

事件责任人的阿里云 UID。

9527952795****

NodeId

integer

事件关联的节点 ID。

1234

TopicStatus

string

事件状态,包括 IGNORE(已忽略),NEW(新发现)、 FIXING(处理中)和 RECOVER(已恢复)。

FIXING

Nodes

array<object>

不同的报警来源返回不同的节点列表:

  • 当 Source(报警来源)为 NODE_ CYCLE_ALERT(节点成环报警)时,返回成环的节点类型。

  • 当 Source(报警来源)为 NODE_LONELY_ALERT(节点孤立报警)时,返回孤立的节点类型。

object

节点信息。

Owner

string

节点责任人的阿里云 UID。

95279527952****

NodeName

string

节点的名称。

Node name

NodeId

integer

节点的 ID。

1234

ProjectId

integer

节点所在工作空间的 ID。

1234

SlaAlert

object

当 Source(报警来源)为 SLA_ALERT(基线报警)时,返回触发基线预警的基本实例信息。当报警来源为其它类型时,返回为空。

Status

string

基线状态,包括 ERROR(异常)、SAFE(安全)、DANGROUS(预警)和 OVER(破线)。

SAFE

BaselineOwner

string

基线责任人的阿里云 UID,多个 UID 之间使用英文逗号(,)分隔。

952795279****

BaselineId

integer

基线的 ID。

1234

BaselineName

string

基线的名称。

Baseline name

Bizdate

integer

基线实例的业务日期时间戳。

1553443200000

ProjectId

integer

基线所在工作空间的 ID。

1234

InGroupId

integer

基线实例的周期号:天基线为 1,小时基线范围为[1,24]。

1

示例

正常返回示例

JSON格式

{
  "HttpStatusCode": 200,
  "RequestId": "0000-ABCD-EFG****",
  "ErrorMessage": "The specified parameters are invalid.",
  "ErrorCode": "Invalid.Tenant.ConnectionNotExists",
  "Success": true,
  "Data": {
    "PageNumber": "1",
    "PageSize": "10",
    "TotalCount": "100",
    "AlertMessages": [
      {
        "RemindId": 1234,
        "AlertMessageStatus": "READY_TO_SEND",
        "AlertUser": "9527952795****",
        "AlertTime": 1553531401000,
        "AlertMethod": "SMS",
        "Source": "REMIND_ALERT",
        "Content": "Node error",
        "RemindName": "Custom monitoring rule name",
        "AlertId": 1234,
        "Instances": [
          {
            "Status": "NOT_RUN",
            "InstanceId": 12345,
            "NodeName": "Node name",
            "NodeId": 1234,
            "ProjectId": 1234
          }
        ],
        "Topics": [
          {
            "TopicName": "9527 error",
            "InstanceId": 12345,
            "TopicId": 1234,
            "TopicOwner": "9527952795****",
            "NodeId": 1234,
            "TopicStatus": "FIXING"
          }
        ],
        "Nodes": [
          {
            "Owner": "95279527952****",
            "NodeName": "Node name",
            "NodeId": 1234,
            "ProjectId": 1234
          }
        ],
        "SlaAlert": {
          "Status": "SAFE",
          "BaselineOwner": "952795279****",
          "BaselineId": 1234,
          "BaselineName": "Baseline name",
          "Bizdate": 1553443200000,
          "ProjectId": 1234,
          "InGroupId": 1
        }
      }
    ]
  }
}

错误码

HTTP status code

错误码

错误信息

描述

500 Forbidden.Not.Server The dataworksAPI service is not available in this area. Please try it in another area.
500 InternalError.System An internal system error occurred. Try again later.
500 InternalError.UserId.Missing An internal system error occurred. Try again later.
403 Forbidden.Access Access is forbidden. Please first activate DataWorks Enterprise Edition or Flagship Edition.
429 Throttling.Api The request for this resource has exceeded your available limit.
429 Throttling.Api.Risk The request for this resource has exceeded your daily available limit.
429 Throttling.Resource You have reached the limit for the resource. Please contact us by submitting a ticket.
429 Throttling.System The DataWorks system is busy. Try again later.
429 Throttling.User Your request is too frequent. Try again later.

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情。