Updates the scheduling properties for a task flow.
Operation description
You can call this operation to update the scheduling properties for a task flow in the editing state. You can configure a timed scheduling task flow or an event scheduling task flow. When you configure a timed scheduling task flow, you can choose from one-time scheduling or periodic scheduling. When you configure an event scheduling task flow, you can subscribe to task flows or task flow nodes.****
After you update the scheduling properties, you need to publish and deploy the task flow again. The new task flow instance will run based on the updated scheduling properties.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
dms:UpdateTaskFlowSchedule | update | *All Resources * |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
Tid | long | No | The ID of the tenant. Note
: To view the ID of the tenant, go to the Data Management (DMS) console and move the pointer over the profile picture in the upper-right corner. For more information, see View information about the current tenant.
| 3*** |
DagId | long | Yes | The ID of the task flow. | 7*** |
ScheduleSwitch | boolean | Yes | Specifies whether to enable scheduling. Valid values:
| Disable |
CronBeginDate | string | No | The start of the time range for scheduling. | CronBeginDate_test |
CronEndDate | string | No | The end of the time range for scheduling. | CronEndDate_test |
ScheduleParam | string | Yes | The event scheduling configuration. The value of this parameter is a JSON string. | ScheduleParam_test |
CronStr | string | No | The cron expression for timed scheduling. | CronStr_test |
TriggerType | string | Yes | The mode in which the task flow is triggered. Valid values:
| Event |
CronType | string | No | The type of the scheduling cycle. Valid values:
| HOUR |
TimeZoneId | string | No | The time zone. The default time zone is UTC+8 (Asia/Shanghai). | Asia/Shanghai |
Note about scheduling configuration parameters
When you configure a timed scheduling task flow, you can choose from one-time scheduling or periodic scheduling.
The following parameters are required:
- ScheduleSwitch: True
- TriggerType: Cron
- CronBeginDate
- CronEndDate
- CronStr
- CronType
- ScheduleParam: The task can be run by day, week, month, or only once.
The following section provides examples:
Scheduling by day:
{
"triggerType":"0",
"dateTime":"00:00"
}
Scheduling by week: "1" for Sunday, "2" for Monday, ..., and "7" for Saturday.
{
"triggerType":"0",
"dateWeek":[
"1",
"5"
],
"weekTime":"00:00"
}
Scheduling by month:
{
"triggerType":"0",
"dateMonth":"1",
"MonthTime":"00:00"
}
Scheduling once:
{
"triggerType":"1",
"specificTime":"2022-09-02 00:00"
}
Parameter description
- CronStr: CronStr defines how a task flow is scheduled.
- CronBeginDate and CronEndDate: For periodic scheduling, CronBeginDate, CronEndDate, and CronStr together define task flow scheduling. If the time specified by CronStr is within the time range between CronBeginDate and CronEndDate, the task is triggered.
- CronType: This is used for verification. Enter a value based on the scheduling cycle specified by CronStr.
- ScheduleParam: Enter a value based on the scheduling configuration specified by CronStr.
Event Scheduling (automatically triggered across task flows)
The following parameters are required:
- ScheduleSwitch: True
- TriggerType: Event
- ScheduleParam
The following section provides examples:
{
"triggerType":"2" // The scheduling type. The value 2 indicates event scheduling.
"deps":[ // The subscription configurations for task flows and task nodes.
{
"eventType":1, // The type of the subscription. The value 0 indicates subscription to task flows. The value 1 indicates subscription to task nodes.
"lisDagId":12345, // The task flow to which the subscribed node belongs.
"lisNodeId":2134 // The ID of the node to which you subscribe.
},
{
"eventType":0,
"lisDagId":12343 // The ID of the task flow to which you subscribe.
},
{
"eventType":0,
"lisDagId":23456
}
],
"maxWait":21600 // The maximum waiting time before all the preceding task flows or nodes to which you subscribe run.
}
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "7BF38A13-C181-5B5E-97F1-8643F8A10093",
"ErrorCode": "InvalidParameterValid",
"ErrorMessage": "InvalidParameterValid",
"Success": true
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|