All Products
Search
Document Center

Data Management:UpdateTaskFlowSchedule

Last Updated:Apr 17, 2024

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

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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.
OperationAccess levelResource typeCondition keyAssociated operation
dms:UpdateTaskFlowScheduleRead
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
TidlongNo

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***
DagIdlongYes

The ID of the task flow.

7***
ScheduleSwitchbooleanYes

Specifies whether to enable scheduling. Valid values:

  • Enable
  • Disable
Disable
CronBeginDatestringNo

The start of the time range for scheduling.

CronBeginDate_test
CronEndDatestringNo

The end of the time range for scheduling.

CronEndDate_test
ScheduleParamstringYes

The event scheduling configuration. The value of this parameter is a JSON string.

ScheduleParam_test
CronStrstringNo

The cron expression for timed scheduling.

CronStr_test
TriggerTypestringYes

The mode in which the task flow is triggered. Valid values:

  • Cron: The task flow is triggered based on timed scheduling.
  • Event: The task flow is triggered by events.
Event
CronTypestringNo

The type of the scheduling cycle. Valid values:

  • MINUTE: scheduling by minute
  • HOUR: scheduling by hour
  • DAY: scheduling by day
  • WEEK: scheduling by week
  • MONTH: scheduling by month
HOUR
TimeZoneIdstringNo

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

  1. CronStr: CronStr defines how a task flow is scheduled.
  2. 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.
  3. CronType: This is used for verification. Enter a value based on the scheduling cycle specified by CronStr.
  4. 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

ParameterTypeDescriptionExample
object

The response parameters.

RequestIdstring

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

7BF38A13-C181-5B5E-97F1-8643F8A10093
ErrorCodestring

The error code returned if the request failed.

InvalidParameterValid
ErrorMessagestring

The error message returned if the request failed.

InvalidParameterValid
Successboolean

Indicates whether the request was successful. Valid values:

  • true: The request was successful.
  • false: The request failed.
true

Examples

Sample success responses

JSONformat

{
  "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 timeSummary of changesOperation
No change history