All Products
Search
Document Center

DataWorks:UpdateFile

Last Updated:Jan 12, 2026

Updates a file.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
FileFolderPathstringNo

The path to the folder where the file is located.

Business_process/First_Business_Process/data_integration/Folder_1/Folder_2
ProjectIdlongNo

The DataWorks workspace ID. To obtain the ID, log on to the DataWorks console and navigate to the workspace management page.

100001
FileNamestringNo

The file name. You can modify the file name by setting a new value for FileName. For example, you can call the ListFiles operation to query the file ID in the target directory, and then call the UpdateFile operation with the file ID specified in the FileId parameter and a new value specified in the FileName parameter to modify the file name.

ods_user_info_d
FileDescriptionstringNo

The file description.

Here is the file description
ContentstringNo

The file code content. Different code types (fileType) have different code formats. In Operation Center, you can right-click a task of the corresponding type and select View Code to view the specific code format.

SELECT "1";
AutoRerunTimesintegerYes

The number of automatic reruns after the file execution fails.

3
AutoRerunIntervalMillisintegerNo

The interval at which the node is automatically rerun after a failure. Unit: milliseconds. Maximum value: 1800000 milliseconds (30 minutes).

This parameter corresponds to the Rerun interval parameter in Properties > Schedule > Auto Rerun upon Failure for data development nodes in the DataWorks console. In the console, the unit of the rerun interval is minutes. Convert the time unit when you call this operation.

120000
RerunModestringNo

The rerun policy. Valid values:

  • ALL_ALLOWED: Reruns are allowed regardless of whether the task succeeds or fails.
  • FAILURE_ALLOWED: Reruns are allowed only when the task fails.
  • ALL_DENIED: Reruns are not allowed regardless of whether the task succeeds or fails.

This parameter corresponds to the Support for Rerun setting in Scheduling > Scheduling Policies for Data Studio tasks in the DataWorks console.

Valid values:

  • ALL_ALLOWD
  • FAILURE_ALLOWED
  • ALL_DENIED
  • ALL_ALLOWED
ALL_ALLOWED
StopbooleanNo

Specifies whether to skip execution. Valid values:

  • true
  • false

This parameter corresponds to the Skip Execution option in Properties > Schedule > Recurrence for data development nodes in the DataWorks console.

false
ParaValuestringNo

The scheduling parameters of the node.

This parameter corresponds to the Scheduling Parameter setting in Properties for data development nodes in the DataWorks console. For more information, see Scheduling parameters.

x=a y=b z=c
StartEffectDatelongNo

The timestamp (in milliseconds) when automatic scheduling starts.

This parameter corresponds to the start time of Effective Period in Scheduling > Scheduling Time for Data Studio tasks in the DataWorks console.

936923400000
EndEffectDatelongNo

The timestamp (in milliseconds) when automatic scheduling stops.

This parameter corresponds to the end time of Effective Period in Scheduling > Scheduling Time for Data Studio tasks in the DataWorks console.

4155787800000
CronExpressstringNo

The cron expression for scheduled execution. This parameter corresponds to the Cron Expression setting in Scheduling > Scheduling Time for Data Studio tasks in the DataWorks console. After you configure Scheduling Cycle and Scheduled Time, DataWorks automatically generates a cron expression.

Examples:

  • Scheduled at 05:30 every day: 00 30 05 * * ?
  • Scheduled at the 15th minute of every hour: 00 15 * * * ?
  • Scheduled every 10 minutes: 00 00/10 * * * ?
  • Scheduled every 10 minutes between 08:00 and 23:00 every day: 00 00-59/10 8-23 * * * ?
  • Scheduled at 00:20 on the 1st day of every month: 00 20 00 1 * ?
  • Scheduled every 3 months starting from 00:10 on January 1: 00 10 00 1 1-12/3 ?
  • Scheduled at 00:05 on every Tuesday and Friday: 00 05 00 * * 2,5

Due to the rules of the DataWorks scheduling system, cron expressions have the following restrictions:

  • The minimum scheduling interval is 5 minutes.
  • The earliest scheduling time each day is 00:05.
00 00-59/5 1-23 * * ?
CycleTypestringNo

The type of scheduling cycle. Valid values: NOT_DAY (minute, hour) and DAY (day, week, month).

This parameter corresponds to the Scheduling Cycle setting in Scheduling > Scheduling Time for Data Studio tasks in the DataWorks console.

NOT_DAY
DependentTypestringNo

The dependency mode on the previous cycle. Valid values:

  • SELF: Depends on the current node.
  • CHILD: Depends on the child nodes.
  • USER_DEFINE: Depends on other nodes.
  • NONE: No dependencies. Does not depend on the previous cycle.
USER_DEFINE
DependentNodeIdListstringNo

The IDs of the nodes on which the current node depends. This parameter takes effect only when the DependentType parameter is set to USER_DEFINE. Separate multiple node IDs with commas (,).

This parameter corresponds to the Other Nodes option in Properties > Dependencies > Cross-cycle Dependency (Original Previous-cycle Dependency) for data development nodes in the DataWorks console.

5,10,15,20
InputListstringNo

The output names of the ancestor nodes on which the current node depends. Separate multiple output names with commas (,).

This parameter corresponds to the Output Name of Ancestor Node setting in Properties > Dependencies for data development nodes in the DataWorks console.

Note This parameter is required when you call the CreateDISyncTask or UpdateFile operation to create a batch synchronization node.
project_root,project.file1,project.001_out
ProjectIdentifierstringNo

The DataWorks workspace name. To obtain the workspace name, log on to the DataWorks console and navigate to the workspace configuration page.

You must specify either this parameter or ProjectId to identify the target DataWorks workspace for this API call.

dw_project
FileIdlongYes

The file ID. You can call the ListFiles operation to obtain the file ID.

100000001
OutputListstringNo

The outputs of the node.

This parameter corresponds to the Output Name setting in Properties > Dependencies for data development nodes in the DataWorks console.

dw_project.ods_user_info_d
ResourceGroupIdentifierstringNo

The resource group for the task published from the file. You can call the ListResourceGroups operation to query the available resource groups in the workspace.

default_group
ConnectionNamestringNo

The name of the data source that is used to run the node. You can call the ListDataSources operation to query the available data sources.

odps_source
OwnerstringNo

The file owner ID.

18023848927592
AutoParsingbooleanNo

Specifies whether to enable automatic parsing for the file. Valid values:

  • true
  • false

This parameter corresponds to the Analyze Code setting in Properties > Dependencies for data development nodes in the DataWorks console.

true
SchedulerTypestringNo

The scheduling type. Valid values:

  • NORMAL: Normal scheduled task.
  • MANUAL: Manually triggered node. Not scheduled for daily execution. Corresponds to nodes in manually triggered workflows.
  • PAUSE: Paused task.
  • SKIP: Dry-run task. Scheduled for daily execution but is directly marked as successful when scheduling starts.
NORMAL
AdvancedSettingsstringNo

The advanced settings for the task.

This parameter corresponds to the Advanced Settings in the right-side navigation pane on the editing page for EMR Spark Streaming and EMR Streaming SQL tasks in Data Studio in the DataWorks console.

Currently, only EMR Spark Streaming and EMR Streaming SQL tasks support this parameter, and the parameter must be in JSON format.

{"queue":"default","SPARK_CONF":"--conf spark.driver.memory=2g"}
StartImmediatelybooleanNo

Specifies whether to start the task immediately after it is published. Valid values:

  • true: Start the task immediately after it is published.
  • false: Do not start the task immediately after it is published.

This parameter corresponds to the Start Method setting in Configuration > Scheduling Policies in the right-side navigation pane on the editing page for EMR Spark Streaming and EMR Streaming SQL tasks in Data Studio in the DataWorks console.

true
InputParametersstringNo

The input context parameters of the node. The value must be in the JSON format. For more information about the parameter structure, see the InputContextParameterList parameter in the response parameters of the GetFile operation.

This parameter corresponds to the Input Parameters setting in Properties > Input and Output Parameters for data development nodes in the DataWorks console.

[{"ValueSource": "project_001.first_node:bizdate_param","ParameterName": "bizdate_input"}]
OutputParametersstringNo

The output context parameters of the node. The value must be in the JSON format. For more information about the parameter structure, see the OutputContextParameterList parameter in the response parameters of the GetFile operation.

This parameter corresponds to the Output Parameters setting in Properties > Input and Output Parameters for data development nodes in the DataWorks console.

[{"Type": 1,"Value": "${bizdate}","ParameterName": "bizdate_param"}]
IgnoreParentSkipRunningPropertybooleanNo

This parameter corresponds to the Skip The Dry-Run Property Of The Ancestor Node option in Properties > Dependencies > Cross-cycle Dependency (Original Previous-cycle Dependency) when Instances of Current Node or Level-1 Child Node is selected for data development nodes in the DataWorks console.

true
ApplyScheduleImmediatelybooleanNo

Specifies whether to apply the scheduling configuration immediately after the file is published.

true
TimeoutintegerNo

The timeout settings for scheduling configuration.

1
ImageIdstringNo

The custom image ID.

m-uf6d7npxk1hhek8ng0cb

Response parameters

ParameterTypeDescriptionExample
object

The response.

HttpStatusCodeinteger

The HTTP status code.

200
ErrorMessagestring

The error message.

The connection does not exist.
RequestIdstring

The request ID. Use this ID to troubleshoot issues.

0000-ABCD-EFGH-IJKLMNOPQ
ErrorCodestring

The error code.

Invalid.Tenant.ConnectionNotExists
Successboolean

Indicates whether the call succeeded. Valid values:

  • true: The call succeeded.
  • false: The call failed.
true

Examples

Sample success responses

JSONformat

{
  "HttpStatusCode": 200,
  "ErrorMessage": "The connection does not exist.",
  "RequestId": "0000-ABCD-EFGH-IJKLMNOPQ",
  "ErrorCode": "Invalid.Tenant.ConnectionNotExists",
  "Success": true
}

Error codes

HTTP status codeError codeError messageDescription
403Forbidden.AccessAccess is forbidden. Please first activate DataWorks Enterprise Edition or Flagship Edition.No permission, please authorize
429Throttling.ApiThe request for this resource has exceeded your available limit.-
429Throttling.SystemThe DataWorks system is busy. Try again later.-
429Throttling.UserYour request is too frequent. Try again later.-
500InternalError.SystemAn internal system error occurred. Try again later.-
500InternalError.UserId.MissingAn internal system error occurred. Try again later.-

For a list of error codes, visit the Service error codes.