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

调试

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

请求参数

名称 类型 是否必选 示例值 描述
Action String ListAlertMessages

系统规定参数。取值:ListAlertMessages

PageNumber Integer 1

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

PageSize Integer 10

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

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

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

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

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

RemindId Long 9527

自定义规则的ID,当AlertRuleTypes参数配置为USER_DEFINE自定义规则时生效。

该参数与BaselineId参数配置一个即可。

AlertMethods String SMS,MAIL,PHONE

报警方式,取值如下:

  • MAIL:邮件。
  • SMS:短信。

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

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

AlertUser String 123456

报警接收人的阿里云UID。

AlertRuleTypes String GLOBAL,USER_DEFINE,OTHER

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

BaselineId Long 1234

基线ID。当AlertRuleTypes参数配置为GLOBAL时生效。

该参数与RemindId参数配置一个即可。

返回数据

名称 类型 示例值 描述
HttpStatusCode Integer 200

HTTP返回码。

RequestId String 0000-ABCD-EFG****

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

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 of AlertMessages

报警信息列表。

RemindId Long 1234

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

AlertMessageStatus String READY_TO_SEND

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

AlertUser String 9527952795****

接收人的阿里云UID。

AlertTime Long 1553531401000

报警的时间戳。

AlertMethod String SMS

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

Source String REMIND_ALERT

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

Content String 节点出错

报警的内容。

RemindName String 自定义监控规则名称

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

AlertId Long 1234

报警ID。

Instances Array of Instances

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

Status String NOT_RUN

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

InstanceId Long 12345

实例的ID。

NodeName String 节点名称

节点的名称。

NodeId Long 1234

节点的ID。

ProjectId Long 1234

节点所在工作空间的ID。

Topics Array of Topics

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

TopicName String 9527出错

事件的名称。

InstanceId Long 12345

事件关联的实例ID。

TopicId Long 1234

事件的ID。

TopicOwner String 9527952795****

事件责任人的阿里云UID。

NodeId Long 1234

事件关联的节点ID。

TopicStatus String FIXING

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

Nodes Array of Nodes

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

  • 当Source(报警来源)为NODE_ CYCLE_ALERT(节点成环报警)时,返回成环的节点类型。
  • 当Source(报警来源)为NODE_LONELY_ALERT(节点孤立报警)时,返回孤立的节点类型。
Owner String 95279527952****

节点责任人的阿里云UID。

NodeName String 节点名称

节点的名称。

NodeId Long 1234

节点的ID。

ProjectId Long 1234

节点所在工作空间的ID。

SlaAlert Object

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

Status String SAFE

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

BaselineOwner String 952795279****

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

BaselineId Long 1234

基线的ID。

BaselineName String 基线名称

基线的名称。

Bizdate Long 1553443200000

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

ProjectId Long 1234

基线所在工作空间的ID。

InGroupId Integer 1

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

示例

请求示例

http(s)://[Endpoint]/?Action=ListAlertMessages
&PageNumber=1
&PageSize=10
&BeginTime=2020-04-02T00:00:00+0800
&EndTime=2020-04-04T00:00:00+0800
&RemindId=9527
&AlertMethods=SMS,MAIL,PHONE
&AlertUser=123456
&AlertRuleTypes=GLOBAL,USER_DEFINE,OTHER
&BaselineId=1234
&公共请求参数

正常返回示例

XML格式

HTTP/1.1 200 OK
Content-Type:application/xml

<ListAlertMessagesResponse>
    <HttpStatusCode>200</HttpStatusCode>
    <RequestId>0000-ABCD-EFG****</RequestId>
    <ErrorMessage>The specified parameters are invalid.</ErrorMessage>
    <ErrorCode>Invalid.Tenant.ConnectionNotExists</ErrorCode>
    <Success>true</Success>
    <Data>
        <PageNumber>1</PageNumber>
        <PageSize>10</PageSize>
        <TotalCount>100</TotalCount>
        <AlertMessages>
            <RemindId>1234</RemindId>
            <AlertMessageStatus>READY_TO_SEND</AlertMessageStatus>
            <AlertUser>9527952795****</AlertUser>
            <AlertTime>1553531401000</AlertTime>
            <AlertMethod>SMS</AlertMethod>
            <Source>REMIND_ALERT</Source>
            <Content>节点出错</Content>
            <RemindName>自定义监控规则名称</RemindName>
            <AlertId>1234</AlertId>
            <Instances>
                <Status>NOT_RUN</Status>
                <InstanceId>12345</InstanceId>
                <NodeName>节点名称</NodeName>
                <NodeId>1234</NodeId>
                <ProjectId>1234</ProjectId>
            </Instances>
            <Topics>
                <TopicName>9527出错</TopicName>
                <InstanceId>12345</InstanceId>
                <TopicId>1234</TopicId>
                <TopicOwner>9527952795****</TopicOwner>
                <NodeId>1234</NodeId>
                <TopicStatus>FIXING</TopicStatus>
            </Topics>
            <Nodes>
                <Owner>95279527952****</Owner>
                <NodeName>节点名称</NodeName>
                <NodeId>1234</NodeId>
                <ProjectId>1234</ProjectId>
            </Nodes>
            <SlaAlert>
                <Status>SAFE</Status>
                <BaselineOwner>952795279****</BaselineOwner>
                <BaselineId>1234</BaselineId>
                <BaselineName>基线名称</BaselineName>
                <Bizdate>1553443200000</Bizdate>
                <ProjectId>1234</ProjectId>
                <InGroupId>1</InGroupId>
            </SlaAlert>
        </AlertMessages>
    </Data>
</ListAlertMessagesResponse>

JSON格式

HTTP/1.1 200 OK
Content-Type:application/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
      }
    }
  }
}

错误码

HttpCode 错误码 错误信息 描述
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.System The DataWorks system is busy. Try again later. DataWorks系统繁忙,请稍后再试。
429 Throttling.User Your request is too frequent. Try again later. 您的请求过于频繁,请尝试放缓请求速度。
500 Forbidden.Not.Server The dataworksAPI service is not available in this area. Please try it in another area. 该地域还未开放DataWorks的API服务,请尝试其它地域。
500 InternalError.System An internal system error occurred. Try again later. 系统内部错误,请稍后再试。
500 InternalError.UserId.Missing An internal system error occurred. Try again later. 系统内部错误,请稍后再试。

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