全部產品
Search
文件中心

DataWorks:CreateRemind - 建立自訂警示規則

更新時間:Mar 21, 2026

調用CreateRemind建立自訂警示規則。

調試

您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。

調試

授權資訊

當前API暫無授權資訊透出。

請求參數

名稱

類型

必填

描述

樣本值

RemindName

string

自訂規則的名稱,不能超過 128 個字元。

test_error_remind

DndEnd

string

免打擾截止時間,格式為 hh:mm。hh 的取值範圍為[0,23],mm 的取值範圍為[0,59]。

08:00

RemindUnit

string

對象的類型,包括 NODE(任務節點)、BASELINE(基準) 、PROJECT(工作空間)和 BIZPROCESS(商務程序)。

NODE

NodeIds

string

RemindUnit(物件類型)為 NODE(任務節點)時,監控的任務節點 ID。多個 ID 之間使用英文逗號(,)分隔,一個規則最多監控 50 個節點。

1,2,3

BaselineIds

string

當 RemindUnit(物件類型)為 BASELINE(基準)時,監控的基準 ID。多個 ID 之間使用英文逗號(,)分隔,一個規則最多監控 5 條基準。

1,2,3

ProjectId

integer

當 RemindUnit(物件類型)為 PROJECT(工作空間)時,監控的工作空間 ID。一個規則只能監控一個工作空間。

9527

BizProcessIds

string

當 RemindUnit(物件類型)為 BIZPROCESS(商務程序)時,監控的商務程序 ID。多個商務程序 ID 之間使用英文逗號(,)分隔,一個規則最多監控 5 個商務程序。

1,2,3

RemindType

string

觸發條件,包括 FINISHED(完成)、UNFINISHED(未完成)、ERROR(出錯)、 CYCLE_UNFINISHED(周期未完成)和 TIMEOUT(運行逾時)。

FINISHED

MaxAlertTimes

integer

最大警示次數。最小值為 1,最大值為 10,預設值為 3。

2

AlertInterval

integer

最小警示間隔,單位為秒。最小值為 1200,預設值為 1800。

1800

Detail

string

不同觸發條件的說明如下:

  • 當 RemindType(觸發條件)為 FINISHED(完成)時,傳空。

  • 當 RemindType(觸發條件)為 UNFINISHED(未完成)時,傳參格式為{"hour":23,"minu":59}。hour 的取值範圍為[0,47],minu 的取值範圍為[0,59]。

  • 當 RemindType(觸發條件)為 ERROR(出錯)時,傳空。

  • 當 RemindType(觸發條件)為 CYCLE_UNFINISHED(周期未完成)時,傳參格式為{"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"}。JSON 字串 key 為周期號,取值範圍為[1,288]。value 為該周期對應的未完成時間,格式為 hh:mm。hh 的取值範圍為[0,47],mm 的取值範圍為[0,59]。

  • 當 RemindType(觸發條件)為 TIMEOUT(運行逾時)時,傳參格式為 1800,單位為秒。即從開始運行起,運行超過 30 分鐘觸發警示。

{"hour":"23","minu":"59"}

AlertUnit

string

警示接收對象的粒度,包括 OWNER(任務責任人)和 OTHER(指定的人)。

OWNER

AlertMethods

string

警示方式,取值如下:

  • MAIL:郵件。

  • SMS:簡訊。 可使用簡訊警示的地區為:新加坡、馬來西亞(吉隆坡)、德國(法蘭克福)。

  • Webhooks(企業微信或飛書機器人),僅當配置 Webhooks 參數後,該警示方式才會生效。

  • DINGROBOTS:DingTalk群機器人。

多個警示方式之間使用英文逗號(,)分隔。

SMS,MAIL

AlertTargets

string

  • 當 AlertUnit(警示接收人)為 OWNER(節點任務責任人)時,傳空。

  • 當 AlertUnit(警示接收人)為 OTHER(指定的人)時,傳入指定使用者的阿里雲 UID。多個阿里雲 UID 之間使用英文逗號(,)分隔,最多支援 10 個。

9527952795279527

RobotUrls

string

DingTalk群機器人的 webhook 地址,多個 webhook 地址之間使用英文逗號(,)分隔。

https://oapi.dingtalk.com/robot/send?access_token=******************************

Webhooks

string

企業微信或飛書機器人的 webhook 地址,多個 webhook 地址之間使用英文逗號(,)分隔。alertMethods 中需要包含 WEBHOOKS 警示方式。

僅 DataWorks 企業版支援。 可用地區:華東 2(上海)、西南 1(成都)、華北 3(張家口)、華北 2(北京)、華東 1(杭州)、華南 1(深圳)、中國(香港)、歐洲中部 1(法蘭克福)、亞太地區東南 1(新加坡)。

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

返回參數

名稱

類型

描述

樣本值

object

請求返回結果

HttpStatusCode

integer

HTTP 返回碼。

200

Data

integer

建立自訂監控規則成功後,返回的自訂規則 ID。

1234

ErrorMessage

string

錯誤資訊。

The specified parameters are invalid.

RequestId

string

本次調用的唯一 ID。出現錯誤後,您可以根據該 ID 排查問題。

0000-ABCD-EFG****

Success

boolean

調用是否成功。

true

ErrorCode

string

錯誤碼。

1031203110005

樣本

正常返回樣本

JSON格式

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

錯誤碼

HTTP status code

錯誤碼

錯誤資訊

描述

500 Forbidden.Not.Server The dataworksAPI service is not available in this area. Please try it in another area.
500 Forbidden.Wkbench.BaselineNoPermission You are not authorized to access the baseline.
500 Forbidden.Wkbench.ProjectNoPermission You are not authorized to access the workspace.
500 InternalError.System An internal system error occurred. Try again later.
500 InternalError.UserId.Missing An internal system error occurred. Try again later.
500 Forbidden.Wkbench.NoProject You have not joined any project.
500 Invalid.Wkbench.NodeNotExist The node does not exist.
500 Invalid.Wkbench.BaselineNotExist The baseline does not exist.
500 Forbidden.Wkbench.RemindOverlimit The maximum number of reminders is exceeded.
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.

訪問錯誤中心查看更多錯誤碼。

變更歷史

更多資訊,參考變更詳情