文档

ListAlertMessages - 获取报警信息的列表

更新时间:

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

调试

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

授权信息

当前API暂无授权信息透出。

请求参数

名称类型必填描述示例值
PageNumberinteger

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

1
PageSizeinteger

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

10
BeginTimestring

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

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

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

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

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

9527
AlertMethodsstring

报警方式,取值如下:

  • MAIL:邮件。

  • SMS:短信。

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

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

SMS,MAIL,PHONE
AlertUserstring

报警接收人的阿里云 UID。

123456
AlertRuleTypesstring

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

GLOBAL,USER_DEFINE,OTHER
BaselineIdlong

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

1234

返回参数

名称类型描述示例值
object

返回结果。

HttpStatusCodeinteger

HTTP 返回码。

200
RequestIdstring

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

0000-ABCD-EFG****
ErrorMessagestring

错误信息。

The specified parameters are invalid.
ErrorCodestring

错误码。

Invalid.Tenant.ConnectionNotExists
Successboolean

调用是否成功。

true
Dataobject

返回的报警信息列表。

PageNumberstring

当前的页数。

1
PageSizestring

每页的大小。

10
TotalCountstring

报警信息的总数。

100
AlertMessagesarray<object>

报警信息列表。

object

返回数据。

RemindIdlong

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

1234
AlertMessageStatusstring

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

READY_TO_SEND
AlertUserstring

接收人的阿里云 UID。

9527952795****
AlertTimelong

报警的时间戳。

1553531401000
AlertMethodstring

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

SMS
Sourcestring

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

REMIND_ALERT
Contentstring

报警的内容。

节点出错
RemindNamestring

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

自定义监控规则名称
AlertIdlong

报警 ID。

1234
Instancesarray<object>

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

object

实例信息。

Statusstring

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

NOT_RUN
InstanceIdlong

实例的 ID。

12345
NodeNamestring

节点的名称。

节点名称
NodeIdlong

节点的 ID。

1234
ProjectIdlong

节点所在工作空间的 ID。

1234
Topicsarray<object>

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

object

事件信息。

TopicNamestring

事件的名称。

9527出错
InstanceIdlong

事件关联的实例 ID。

12345
TopicIdlong

事件的 ID。

1234
TopicOwnerstring

事件责任人的阿里云 UID。

9527952795****
NodeIdlong

事件关联的节点 ID。

1234
TopicStatusstring

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

FIXING
Nodesarray<object>

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

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

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

object

节点信息。

Ownerstring

节点责任人的阿里云 UID。

95279527952****
NodeNamestring

节点的名称。

节点名称
NodeIdlong

节点的 ID。

1234
ProjectIdlong

节点所在工作空间的 ID。

1234
SlaAlertobject

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

Statusstring

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

SAFE
BaselineOwnerstring

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

952795279****
BaselineIdlong

基线的 ID。

1234
BaselineNamestring

基线的名称。

基线名称
Bizdatelong

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

1553443200000
ProjectIdlong

基线所在工作空间的 ID。

1234
InGroupIdinteger

基线实例的周期号:天基线为 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": "节点出错",
        "RemindName": "自定义监控规则名称",
        "AlertId": 1234,
        "Instances": [
          {
            "Status": "NOT_RUN",
            "InstanceId": 12345,
            "NodeName": "节点名称",
            "NodeId": 1234,
            "ProjectId": 1234
          }
        ],
        "Topics": [
          {
            "TopicName": "9527出错",
            "InstanceId": 12345,
            "TopicId": 1234,
            "TopicOwner": "9527952795****",
            "NodeId": 1234,
            "TopicStatus": "FIXING"
          }
        ],
        "Nodes": [
          {
            "Owner": "95279527952****",
            "NodeName": "节点名称",
            "NodeId": 1234,
            "ProjectId": 1234
          }
        ],
        "SlaAlert": {
          "Status": "SAFE",
          "BaselineOwner": "952795279****",
          "BaselineId": 1234,
          "BaselineName": "基线名称",
          "Bizdate": 1553443200000,
          "ProjectId": 1234,
          "InGroupId": 1
        }
      }
    ]
  }
}

错误码

HTTP status code错误码错误信息描述
403Forbidden.AccessAccess is forbidden. Please first activate DataWorks Enterprise Edition or Flagship Edition.没有权限,请授权
429Throttling.ApiThe request for this resource has exceeded your available limit.对该资源的请求已超过您的可用上限。
429Throttling.Api.RiskThe request for this resource has exceeded your daily available limit.对该资源的请求已超过您的每日可用上限。
429Throttling.ResourceYou have reached the limit for the resource. Please contact us by submitting a ticket.-
429Throttling.SystemThe DataWorks system is busy. Try again later.DataWorks系统繁忙,请稍后再试。
429Throttling.UserYour request is too frequent. Try again later.您的请求过于频繁,请尝试放缓请求速度。
500Forbidden.Not.ServerThe dataworksAPI service is not available in this area. Please try it in another area.该地域还未开放DataWorks的API服务,请尝试其它地域。
500InternalError.SystemAn internal system error occurred. Try again later.系统内部错误,请稍后再试。
500InternalError.UserId.MissingAn internal system error occurred. Try again later.系统内部错误,请稍后再试。

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

变更历史

变更时间变更内容概要操作
暂无变更历史