All Products
Search
Document Center

DataWorks:GetAlertRule

Last Updated:Dec 05, 2024

Queries a list of custom alert monitoring rules.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
IdstringNo

The rule ID.

28547072

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

RequestIdstring

The request ID.

8abcb91f-d266-4073-b907-2ed670378ed1
AlertRuleobject

The information about the rule.

Idlong

The rule ID.

16035
Namestring

The name of the rule.

error_rule
Ownerstring

The ID of the Alibaba Cloud account used by the owner of the rule.

279961421580845157
Enabledboolean

Indicates whether the rule is enabled.

true
Notificationobject

The configuration for the alert notification.

SilenceStartTimestring

The start time for silence. The time is in the HH:mm:ss format.

00:00:00
SilenceEndTimestring

The end time for silence. The time is in the HH:mm:ss format.

00:00:00
IntervalInMinutesinteger

The interval at which an alert notification is sent. Unit: minutes. Valid values: [5,10000].

30
Maximuminteger

The maximum number of times an alert notification can be sent within a calendar day. Valid values: [1, 10000].

3
Channelsarray

The alert notification channels.

Channelsstring

The alert notification channel. Valid values:

  • Mail
  • Phone
  • Sms: text message
  • Dingding: DingTalk
  • Feishu: Lark
  • Weixin: WeCom
  • Webhook: custom webhook
Sms
Receiversarray<object>

The alert recipients.

Receiversobject
ReceiverTypestring

The type of the alert recipient. Valid valves:

  • AliUid: Alibaba Cloud account ID.
  • Shift Schedules: the personnel in a shift schedule.
  • TaskOwner: the task owner. The task owner can receive custom alerts and event alerts.
  • Owner: the baseline owner. The baseline owner can receive baseline alerts.
  • WebhookUrl: URL of a custom webhook.
  • DingdingUrl: DingTalk webhook URL.
  • FeishuUrl: Lark webhook URL.
  • WeixinUrl: WeCom webhook URL.
WebhookUrl
ReceiverValuesarray

The alert recipients.

ReceiverValuesstring

The ID of the alert recipient. If the ReceiverType parameter is set to AliUid, set this parameter to an Alibaba Cloud account ID. If the ReceiverType parameter is set to ShiftSchedule, set this parameter to a shift schedule ID. If the ReceiverType parameter is set to WebhookUrl, DingdingUrl, FeishuUrl, or WeixinUrl, set this parameter to a corresponding URL.

123123123
Extensionstring

The additional configuration of the alert recipient. If the ReceiverType parameter is set to DingdingUrl, you can set this parameter to {"atAll":true} to remind all members in a DingTalk group.

{"atAll":true}
TriggerConditionobject

The alert triggering condition.

Typestring

The alert type. Valid values:

  • Finished: An instance is successfully run.
  • UnFinished: An instance does not finish running before a specified point in time.
  • Error: An error occurs on an instance.
  • CycleUnfinished: An instance does not finish running as expected within a specific cycle.
  • Timeout: An instance times out.
  • InstanceTransferComplete: An instance is generated by the auto triggered node.
  • InstanceTransferFluctuate: The number of generated instances fluctuates.
  • ExhaustedError: An error persists after an instance is automatically rerun.
  • InstanceKeyword: An instance with errors contains specified keywords.
  • InstanceErrorCount: The number of instances on which an error occurs reaches a specified threshold.
  • InstanceErrorPercentage: The proportion of instances on which an error occurs in the workspace to the total number of instances reaches a specified threshold.
  • ResourceGroupPercentage: The usage rate of the resource group reaches a specified threshold.
  • ResourceGroupWaitCount: The number of instances that are waiting for resources in the resource group reaches a specified threshold.
Error
Extensionobject

The extended information about the rule. This parameter is required for specific types of alerts.

Errorobject

The configuration for an alert of the Error type.

StreamTaskIdsarray

The IDs of the real-time computing tasks. This parameter is required when you monitor real-time computing tasks.

StreamTaskIdslong

The ID of the real-time computing task.

123123
AutoRerunAlertboolean

Indicates whether an alert is triggered if a batch synchronization task is automatically rerun upon a failure.

false
Timeoutobject

The configuration for an alert of the Timeout type.

TimeoutInMinutesinteger

The timeout period. Unit: minutes. Valid values: [1, 21600].

10
UnFinishedobject

The configuration for an alert of the UnFinished type.

UnFinishedTimestring

The latest completion time of the instance. The period is in the hh:mm format. Valid values of hh: [0,47]. Valid values of mm: [0,59].

12:00
CycleUnfinishedobject

The configuration for an alert of the CycleUnfinished type.

CycleAndTimearray<object>

The configurations of the scheduling cycle and timeout period of the instance.

CycleAndTimeobject
CycleIdinteger

The ID of the scheduling cycle of the instance. Valid values: [1,288].

1
Timestring

The latest completion time of the instance within the scheduling cycle. The time is in the hh:mm format. Valid values of hh: [0,47]. Valid values of mm: [0,59].

12:00
InstanceErrorCountobject

The configuration for an alert of the InstanceErrorCount type.

Countinteger

The maximum number of instances on which an error occurs. Valid values: [1,10000].

10
InstanceErrorPercentageobject

The configuration for an alert of the InstanceErrorPercentage type.

Percentageinteger

The maximum percentage of instances on which an error occurs in the workspace to the total number of instances. Valid values: [1-100].

10
InstanceTransferFluctuateobject

The configuration for an alert of the InstanceTransferFluctuate type.

Trendstring

The way in which the number of auto triggered node instances that are generated in your workspace fluctuates. Valid values:

  • abs: the absolute value. The number of instances increases or decreases.
  • increase: The number of instances increases.
  • decrease: The number of instances decreases.
10
Percentageinteger

The maximum percentage of fluctuation in the number of auto triggered node instances that are generated in your workspace. Valid values: [1-100].

10
Targetobject

The monitored objects.

Typestring

The type of the monitored objects. Valid values:

  • Task: node
  • Baseline: baseline
  • Project: workspace
  • BizProcess: workflow
Task
Idsarray

The IDs of monitored objects.

Idslong

The ID of the monitored object.

32570
AllowTasksarray

The nodes that are not to be monitored.

AllowTaskslong

The ID of the node that is not to be monitored.

123123

Examples

Sample success responses

JSONformat

{
  "RequestId": "8abcb91f-d266-4073-b907-2ed670378ed1",
  "AlertRule": {
    "Id": 16035,
    "Name": "error_rule",
    "Owner": "279961421580845157",
    "Enabled": true,
    "Notification": {
      "SilenceStartTime": "00:00:00",
      "SilenceEndTime": "00:00:00",
      "IntervalInMinutes": 30,
      "Maximum": 3,
      "Channels": [
        "Sms"
      ],
      "Receivers": [
        {
          "ReceiverType": "WebhookUrl",
          "ReceiverValues": [
            "123123123"
          ],
          "Extension": "{\"atAll\":true}"
        }
      ]
    },
    "TriggerCondition": {
      "Type": "Error",
      "Extension": {
        "Error": {
          "StreamTaskIds": [
            123123
          ],
          "AutoRerunAlert": false
        },
        "Timeout": {
          "TimeoutInMinutes": 10
        },
        "UnFinished": {
          "UnFinishedTime": "12:00"
        },
        "CycleUnfinished": {
          "CycleAndTime": [
            {
              "CycleId": 1,
              "Time": "12:00"
            }
          ]
        },
        "InstanceErrorCount": {
          "Count": 10
        },
        "InstanceErrorPercentage": {
          "Percentage": 10
        },
        "InstanceTransferFluctuate": {
          "Trend": "10",
          "Percentage": 10
        }
      },
      "Target": {
        "Type": "Task",
        "Ids": [
          32570
        ],
        "AllowTasks": [
          123123
        ]
      }
    }
  }
}

Error codes

For a list of error codes, visit the Service error codes.