UpdateTask

Updated at:

Updates a specified task. The modifications are synchronized to Data Studio, and a new saved version is created.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

dataworks:*

update

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

Id

integer

Yes

The ID of the task to update. You can obtain the ID from the PagingInfo.Tasks[].Id parameter returned by the ListTasks operation.

1234

ClientUniqueCode

string

No

The client unique code of the task, which is used to uniquely identify the task. This parameter is used to implement asynchronous processing and idempotence. If you do not specify this parameter when you create the task, the system automatically generates a client unique code and uniquely binds it to the resource ID. If you specify this parameter when you update or delete the resource, the value must be the same as the client unique code used when the resource was created.

Task_0bc5213917368545132902xxxxxxxx

EnvType

string

No

The project environment. Valid values:

  • Prod: production

  • Dev: development

Valid values:

  • Prod :

    production.

  • Dev :

    development.

Prod

Name

string

No

The name.

SQL node

Description

string

No

The description.

test

Owner

string

No

The account ID of the task owner.

1000

InstanceMode

string

No

The instance generation mode. Valid values:

  • T+1: generated on the next day

  • Immediately: generated immediately. Note: Periodic instances are generated normally only when the scheduled time of the node is at least 10 minutes after the node is published. During the full instance generation period (22:00 to 24:00), real-time instance generation is not supported. You can submit and publish nodes, but new nodes are not automatically converted into instances.

Valid values:

  • Immediately :

    generated immediately.

  • T+1 :

    generated on the next day.

T+1

Timeout

integer

No

The timeout period for task execution, in seconds. The scheduling system uses this configuration in whole hours. The number of seconds you specify is rounded down to the nearest hour.

3600

RerunMode

string

No

Specifies whether the task can be rerun. Valid values:

  • AllDenied: The task cannot be rerun regardless of whether it succeeds or fails.

  • FailureAllowed: The task can be rerun only when it fails.

  • AllAllowed: The task can be rerun regardless of whether it succeeds or fails.

Valid values:

  • AllDenied :

    The task cannot be rerun regardless of whether it succeeds or fails.

  • FailureAllowed :

    The task can be rerun only when it fails.

  • AllAllowed :

    The task can be rerun regardless of whether it succeeds or fails.

AllAllowed

RerunTimes

integer

No

The number of retries. This parameter takes effect only when the task is configured to be rerunnable.

3

RerunInterval

integer

No

The retry time interval, in milliseconds. The value cannot exceed 1800000.

60000

Script

object

No

The script information.

Content deprecated

string

No

The script content.

echo "helloWorld"

Parameters

string

No

The list of script parameters.

para1=$bizdate

Trigger

object

No

The task trigger method.

Type

string

No

The trigger type. Valid values:

  • Scheduler: triggered by a scheduling cycle

  • Manual: triggered manually

Valid values:

  • Scheduler :

    triggered by a scheduling cycle.

  • Manual :

    triggered manually.

Scheduler

Recurrence

string

No

The running mode when the task is triggered. This parameter takes effect only when Type is set to Scheduler. Valid values:

  • Pause: paused

  • Skip: dry run

  • Normal: normal running

Valid values:

  • Pause :

    paused.

  • Skip :

    dry run.

  • Normal :

    normal running.

Normal

Cron

string

No

The cron expression. This parameter takes effect only when Type is set to Scheduler.

00 00 00 * * ?

StartTime

string

No

The start time of the periodic trigger. This parameter takes effect only when Type is set to Scheduler. The format is yyyy-mm-dd hh:mm:ss.

1970-01-01 00:00:00

EndTime

string

No

The expiration time of the periodic trigger. This parameter takes effect only when Type is set to Scheduler. The format is yyyy-mm-dd hh:mm:ss.

9999-01-01 00:00:00

CycleType

string

No

The cycle type. This parameter takes effect when Type is set to Scheduler and the cron expression specifies scheduling at a specific hour. Valid values:

  • Daily: daily scheduling

  • NotDaily: hourly scheduling Default value: Daily.

Valid values:

  • Daily :

    daily scheduling.

  • NotDaily :

    hourly scheduling.

Daily

RuntimeResource

object

No

The runtime environment configuration, such as the resource group information.

ResourceGroupId

string

No

The identifier of the scheduling resource group configured for task execution.

S_res_group_524258031846018_1684XXXXXXXXX

Image

string

No

The ID of the image configured for task execution.

i-xxxxxx

Cu

string

No

The number of compute units (CUs) consumed by the task execution configuration.

0.25

DataSource

object

No

The associated data source information.

Name

string

No

The name of the data source.

odps_test

Inputs

object

No

The input information.

Variables

array<object>

No

The list of variable definitions.

object

No

Type

string

Yes

The type. Valid values:

  • Constant: constant

  • PassThrough: output of a parameter node

  • System: variable

  • NodeOutput: script output

Valid values:

  • Constant :

    constant.

  • PassThrough :

    output of a parameter node.

  • NodeOutput :

    script output.

  • System :

    variable.

Constant

Value

string

No

The variable value.

value1

Name

string

No

The variable name.

key1

Outputs

object

No

The output information.

TaskOutputs

array<object>

No

The list of task output definitions.

object

No

Output

string

No

The output identifier.

pre.odps_sql_demo_0

Variables

array<object>

No

The list of variable definitions.

object

No

Type

string

Yes

The type. Valid values:

  • Constant: constant

  • PassThrough: output of a parameter node

  • System: variable

  • NodeOutput: script output

Valid values:

  • Constant :

    constant.

  • PassThrough :

    output of a parameter node.

  • NodeOutput :

    script output.

  • System :

    variable.

Constant

Value

string

No

The variable value.

value1

Name

string

No

The variable name.

key1

Dependencies

array<object>

No

The dependency information.

object

No

Type

string

Yes

The dependency type. Valid values:

  • CrossCycleDependsOnChildren: cross-cycle dependency on first-level child nodes

  • CrossCycleDependsOnSelf: cross-cycle dependency on the node itself

  • CrossCycleDependsOnOtherNode: cross-cycle dependency on other nodes

  • Normal: same-cycle dependency

Valid values:

  • CrossCycleDependsOnChildren :

    cross-cycle dependency on first-level child nodes.

  • CrossCycleDependsOnOtherNode :

    cross-cycle dependency on other nodes.

  • CrossCycleDependsOnSelf :

    cross-cycle dependency on the node itself.

  • Normal :

    same-cycle dependency.

Normal

UpstreamOutput

string

No

The output identifier of the upstream task. This field is returned when the dependency type is same-cycle dependency and the input content is configured.

pre.odps_sql_demo_0

UpstreamTaskId

integer

No

The ID of the upstream task. This field is returned when the dependency type is cross-cycle dependency on other nodes or same-cycle dependency without input content configured. This field is not returned in other cases.

1234

Tags

array<object>

No

The list of task tags.

object

No

Value

string

No

The tag value.

value1

Key

string

Yes

The tag key.

key1

Response elements

Element

Type

Description

Example

object

RequestId

string

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

22C97E95-F023-56B5-8852-B1A77A17XXXX

Success

boolean

Indicates whether the task was updated successfully.

true

Examples

Success response

JSON format

{
  "RequestId": "22C97E95-F023-56B5-8852-B1A77A17XXXX",
  "Success": true
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.