Updates the scheduling configurations of a task flow.
You can call this operation to update the scheduling configurations of a task flow in the editing state. You can configure timed scheduling, recurring scheduling, and event scheduling. Timed scheduling allows you to configure one-time or periodic scheduling. Event scheduling allows you to configure subscriptions to task flows and task flow nodes.
After the configuration is updated, the task flow is republished and deployed. New task flow instances are scheduled based on the new scheduling settings.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | UpdateTaskFlowSchedule |
The operation that you want to perform. Set the value to UpdateTaskFlowSchedule. |
Tid | Long | No | 3*** |
The ID of the tenant. Note The ID of the tenant is displayed when you move the pointer over the profile picture
in the upper-right corner of the Data Management (DMS) console. For more information,
see the "View information about the current tenant" section of the Manage DMS tenants topic.
|
DagId | Long | Yes | 7*** |
The ID of the task flow. |
ScheduleSwitch | Boolean | Yes | Disable |
Specifies whether to enable scheduling.
|
CronBeginDate | String | No | CronBeginDate_test |
The task flow is not scheduled before this point in time. |
CronEndDate | String | No | CronEndDate_test |
The end time of the timed scheduling. The task flow is not scheduled after this point in time. |
ScheduleParam | String | Yes | ScheduleParam_test |
The event scheduling configuration. This parameter is a JSON string. |
CronStr | String | No | CronStr_test |
Timed scheduling: Cron. |
TriggerType | String | Yes | Event |
The mode in which the task flow is triggered. Valid values:
|
CronType | String | No | HOUR |
The type of the scheduling cycle. Valid values:
|
TimeZoneId | String | No | Asia/Shanghai |
The time zone. Default value: UTC+8 (Asia/Shanghai). |
Scheduling parameters
Timed scheduling: You can configure this parameter to one-time or periodic scheduling.
The following parameters are required:
- ScheduleSwitch: True
- TriggerType: Cron
- CronBeginDate
- CronEndDate
- CronStr
- CronType
- ScheduleParam: The scheduling is performed once or by day, week, or month.
Example:
Scheduling by day:json
{
"triggerType":"0",
"dateTime":"00:00"
}
Scheduling by week: "1" for Sunday, "2" for Monday, …"7" for Saturday.
json
{
"triggerType":"0",
"dateWeek":[
"1",
"5"
],
"weekTime":"00:00"
}
Scheduling by month:
json
{
"triggerType":"0",
"dateMonth":"1",
"MonthTime":"00:00"
}
One-time scheduling:
json
{
"triggerType":"1",
"specificTime":"2022-09-02 00:00"
}
Parameters
1. CronStr: The scheduling of the task flow is based on the value of CronStr.
2. CronBeginDate and CronEndDate: During periodic scheduling, CronBeginDate, CronEndDate, and CronStr define the task flow scheduling. If the time point specified by CronStr is within the range of CronBeginDate and CronEndDate, the task is triggered.
3. CronType: It is used for verification. You must configure this parameter based on the cycle defined by CronStr.
4. ScheduleParam: You must configure this parameter based on the scheduling type specified by CronStr.
Event scheduling (automatically triggered across task flows)
The following parameters are required:
- ScheduleSwitch: True
- TriggerType: Event
- ScheduleParam
Example:
json
{
"triggerType":"2" // Set the value to 2 for event scheduling.
"deps":[ // Configure the subscription to task flows/nodes.
{
"eventType":1, // Subscription type: "0" for task flow and "1" for task node.
"lisDagId":12345, // The task flow where the subscribed node resides.
"lisNodeId":2134 // The ID of the subscribed node.
},
{
"eventType":0,
"lisDagId":12343 // The ID of the subscribed task flow.
},
{
"eventType":0,
"lisDagId":23456
}
],
"maxWait":21600 // The longest amount of time to wait for the preceding subscriptions to complete.
}
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | 7BF38A13-C181-5B5E-97F1-8643F8A10093 |
The ID of the request. You can use the ID to locate logs and troubleshoot issues. |
ErrorCode | String | InvalidParameterValid |
The error code returned if the request failed. |
ErrorMessage | String | InvalidParameterValid |
The error message returned if the request failed. |
Success | Boolean | true |
Indicates whether the request was successful. Valid values:
|
Examples
Sample requests
http(s)://dms-enterprise.aliyuncs.com/?Action=UpdateTaskFlowSchedule
&ScheduleSwitch=false
&CronBeginDate=CronBeginDate_test
&CronEndDate=CronEndDate_test
&ScheduleParam=ScheduleParam_test
&CronStr=CronStr_test
&TriggerType=Event
&CronType=HOUR
&TimeZoneId=Asia/Shanghai
&Common request parameters
Sample responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<UpdateTaskFlowScheduleResponse>
<RequestId>7BF38A13-C181-5B5E-97F1-8643F8A10093</RequestId>
<ErrorCode>InvalidParameterValid</ErrorCode>
<ErrorMessage>InvalidParameterValid</ErrorMessage>
<Success>true</Success>
</UpdateTaskFlowScheduleResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "7BF38A13-C181-5B5E-97F1-8643F8A10093",
"ErrorCode" : "InvalidParameterValid",
"ErrorMessage" : "InvalidParameterValid",
"Success" : true
}
Error codes
For a list of error codes, see Service error codes.