Creates a custom alert rule.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes CreateRemind

The operation that you want to perform. Set the value to CreateRemind.

RemindName String Yes test_error_remind

The name of the custom alert rule. The name must be 1 to 128 characters in length.

DndEnd String No 08:00

The end time of the quiet hours. Specify the time in the hh:mm format. Valid values of hh: 0 to 23. Valid values of mm: 0 to 59.

RemindUnit String Yes NODE

The type of the object to which the custom alert rule is applied. Valid values: NODE, BASELINE, PROJECT, and BIZPROCESS. The value NODE indicates a node. The value BASELINE indicates a baseline. The value PROJECT indicates a workspace. The value BIZPROCESS indicates a workflow.

NodeIds String No 1,2,3

The ID of the node to which the custom alert rule is applied. This parameter takes effect when the RemindUnit parameter is set to NODE. You can specify multiple IDs. Separate multiple IDs with commas (,). A maximum of 50 nodes can be specified for a custom alert rule.

BaselineIds String No 1,2,3

The ID of the baseline to which the custom alert rule is applied. This parameter takes effect when the RemindUnit parameter is set to BASELINE. You can specify multiple IDs. Separate multiple IDs with commas (,). A maximum of five baselines can be specified for a custom alert rule.

ProjectId Long No 9527

The ID of the workspace to which the custom alert rule is applied. This parameter takes effect when the RemindUnit parameter is set to PROJECT. Only one workspace can be specified for a custom alert rule.

BizProcessIds String No 1,2,3

The ID of the workflow to which the custom alert rule is applied. This parameter takes effect when the RemindUnit parameter is set to BIZPROCESS. You can specify multiple IDs. Separate multiple IDs with commas (,). A maximum of five workflows can be specified for a custom alert rule.

RemindType String Yes FINISHED

The conditions that trigger an alert. Valid values: FINISHED, UNFINISHED, ERROR, CYCLE_UNFINISHED, and TIMEOUT. The value FINISHED indicates that the node is run. The value UNFINISHED indicates that the node is still running at the specified point in time. The value ERROR indicates that an error occurs when the node is running. The value CYCLE_UNFINISHED indicates that the node is still running in the specified cycle. The value TIMEOUT indicates that the node times out.

MaxAlertTimes Integer No 2

The maximum number of alerts. Valid values: 1 to 10. Default value: 3.

AlertInterval Integer No 1800

The minimum interval at which alerts are reported. Unit: seconds. Minimum value: 1200. Default value: 1800.

Detail String No {"hour":23,"minu":59}

The details of the conditions that trigger an alert.

  • If the RemindType parameter is set to FINISHED, leave this parameter empty.
  • If the RemindType parameter is set to UNFINISHED, specify this parameter as key-value pairs. Example: {"hour":23,"minu":59}. Valid values of hour: 0 to 47. Valid values of minu: 0 to 59.
  • If the RemindType parameter is set to ERROR, leave this parameter empty.
  • If the RemindType parameter is set to CYCLE_UNFINISHED, specify this parameter as key-value pairs. Example: {"1":"05:50","2":"06:50","3":"07:50","4":"08:50","5":"09:50","6":"10:50","7":"11:50","8":"12:50","9":"13:50","10":"14:50","11":"15:50","12":"16:50","13":"17:50","14":"18:50","15":"19:50","16":"20:50","17":"21:50","18":"22:50","19":"23:50","20":"24:50","21":"25:50"}. The key indicates the ID of the cycle. Valid values of the ID: 1 to 288. The value indicates the timeout period of the node that is running in the cycle. Specify the value in the hh:mm format. Valid values of hh: 0 to 47. Valid values of mm: 0 to 59.
  • If the RemindType parameter is set to TIMEOUT, set this parameter to the timeout period. Unit: seconds. Example: 1800. This value indicates that an alert is reported if the node has run for more than 30 minutes.
AlertUnit String Yes OWNER

The recipient of the alert. Valid values: OWNER and OTHER. The value OWNER indicates the node owner. The value OTHER indicates a specified user.

AlertMethods String Yes SMS,MAIL

The notification method. Valid values:

  • MAIL: Alert notifications are sent by emails.
  • SMS: Alert notifications are sent by text messages.

    Alert notifications can be sent by text messages only in the Singapore, Malaysia (Kuala Lumpur), and Germany (Frankfurt) regions.

  • WEBHOOKS (WeCom or Lark chatbot): Alert notifications are sent by WeCom or Lark messages. If you want to use this notification method, you must configure the Webhooks parameter.

You can specify multiple notification methods. Separate them with commas (,).

AlertTargets String No 9527952795279527
  • If the AlertUnit parameter is set to OWNER, leave this parameter empty.
  • If the AlertUnit parameter is set to OTHER, set this parameter to the ID of the Alibaba Cloud account used by a specific user. You can specify multiple IDs. Separate multiple IDs with commas (,). You can specify a maximum of 10 IDs.
RobotUrls String No https://oapi.dingtalk.com/robot/send?access_token=******************************

The webhook URL of the DingTalk chatbot. You can specify multiple webhook URLs. Separate the specified webhook URLs with commas (,).

Webhooks String No https://open.feishu.cn/open-apis/bot/v2/hook/*******

The webhook URL of the WeCom or Lark chatbot. You can specify multiple webhook URLs. Separate the specified webhook URLs with commas (,). The WEBHOOKS notification method must be specified for alertMethods.

Only DataWorks Enterprise Edition supports this parameter.

The webhook URL-based alerting feature is supported in the following regions: China (Shanghai), China (Chengdu), China (Zhangjiakou), China (Beijing), China (Hangzhou), China (Shenzhen), China (Hong Kong), Germany (Frankfurt), and Singapore.

Response parameters

Parameter Type Example Description
HttpStatusCode Integer 200

The HTTP status code returned.

Data Long 1234

The ID of the custom alert rule returned.

ErrorMessage String The specified parameters are invalid.

The error message returned.

RequestId String 0000-ABCD-EFG****

The ID of the request. You can use the ID to troubleshoot issues.

Success Boolean true

Indicates whether the request was successful.

ErrorCode String 1031203110005

The error code returned.

Examples

Sample requests

http(s)://[Endpoint]/?Action=CreateRemind
&RemindName=test_error_remind
&DndEnd=08:00
&RemindUnit=NODE
&NodeIds=1,2,3
&BaselineIds=1,2,3
&ProjectId=9527
&BizProcessIds=1,2,3
&RemindType=FINISHED
&MaxAlertTimes=2
&AlertInterval=1800
&Detail={"hour":23,"minu":59}
&AlertUnit=OWNER
&AlertMethods=SMS,MAIL
&AlertTargets=9527952795279527
&RobotUrls=https://oapi.dingtalk.com/robot/send?access_token=******************************
&Webhooks=https://open.feishu.cn/open-apis/bot/v2/hook/*******
&<Common request parameters>

Sample success responses

XML format

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

<CreateRemindResponse>
    <HttpStatusCode>200</HttpStatusCode>
    <Data>1234</Data>
    <ErrorMessage>The specified parameters are invalid.</ErrorMessage>
    <RequestId>0000-ABCD-EFG****</RequestId>
    <Success>true</Success>
    <ErrorCode>1031203110005</ErrorCode>
</CreateRemindResponse>

JSON format

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

{
  "HttpStatusCode" : 200,
  "Data" : 1234,
  "ErrorMessage" : "The specified parameters are invalid.",
  "RequestId" : "0000-ABCD-EFG****",
  "Success" : true,
  "ErrorCode" : 1031203110005
}

Error codes

HTTP status code Error code Error message Description
429 Throttling.Api The request for this resource has exceeded your available limit. The error message returned because the number of requests for the resource has exceeded the upper limit.
429 Throttling.Api.Risk The request for this resource has exceeded your daily available limit. The error message returned because the number of requests per day for the resource has exceeded the upper limit.
429 Throttling.System The DataWorks system is busy. Try again later. The error message returned because the DataWorks system is busy. Try again later.
429 Throttling.User Your request is too frequent. Try again later. The error message returned because excessive requests have been submitted within a short period of time. Try again later.
500 Forbidden.Not.Server The dataworksAPI service is not available in this area. Please try it in another area. The error message returned because DataWorks API is unavailable in this region. Try another region.
500 Forbidden.Wkbench.BaselineNoPermission You are not authorized to access the baseline. The error message returned because you are not authorized to access the specified baseline.
500 Forbidden.Wkbench.ProjectNoPermission You are not authorized to access the workspace. The error message returned because you are not authorized to access the workspace.
500 InternalError.System An internal system error occurred. Try again later. The error message returned because an internal error has occurred. Try again later.
500 InternalError.UserId.Missing An internal system error occurred. Try again later. The error message returned because an internal error has occurred. Try again later.
500 Forbidden.Wkbench.NoProject You have not joined any project. The error message returned because you have not joined a workspace.
500 Invalid.Wkbench.NodeNotExist The node does not exist. The error message returned because the node does not exist.
500 Invalid.Wkbench.BaselineNotExist The baseline does not exist. The error message returned because the baseline does not exist.
500 Forbidden.Wkbench.RemindOverlimit The maximum number of reminders is exceeded. The error message returned because the number of custom alert rules has exceeded the upper limit.

For a list of error codes, see Service error codes.