Updates a file.

When you debug or call this API operation, make sure that the updated values are different from the original ones. For example, if the value of a parameter is A, you must change the value to B before you commit the node. If you set the parameter to A, an exception that indicates invalid data occurs.

Request parameters

Parameter Type Required Example Description
Action String Yes UpdateFile

The operation that you want to perform.

AutoRerunTimes Integer Yes 3

The maximum number of automatic reruns that are allowed after an error occurs.

FileId Long Yes 100000001

The ID of the file.

RegionId String Yes cn-zhangjiakou

The region ID.

FileFolderPath String No Workflow/1/Data Integration/Folder 1/Folder 2

The path of the file.

ProjectId Long No 10000

The ID of the DataWorks workspace. You can click the Workspace Manage icon in the upper-right corner of the DataStudio page to go to the Workspace Management page and view the workspace ID.

FileName String No ods_user_info_d

The name of the file. You can set the FileName parameter to a new value to change the file name.

You can call the ListFiles operation to query the ID of the file whose name you want to change. Then, you can set the Field parameter to the ID and set FileName to a new value when you call the UpdateFile operation.

FileDescription String No File description

The description of the file.

Content String No SELECT "1";

The code of the file. The code format varies based on the file type. To view the code format for a specific file type, go to Operation Center, right-click a node of the file type, and then select View Code.

AutoRerunIntervalMillis Integer No 120000

The interval between automatic reruns after an error occurs. Unit: milliseconds. This parameter corresponds to the Auto Rerun Interval upon Error parameter in the Schedule section of the Properties tab in the DataWorks console. The interval that you specify in the DataWorks console is measured in minutes. Pay attention to the conversion between the units of time when you call the operation.

RerunMode String No ALL_ALLOWED

Specifies whether the node can be rerun. Valid values: ALL_ALLOWED, FAILURE_ALLOWED, and ALL_DENIED. The value ALL_ALLOWED indicates that the node can be rerun regardless of whether the last running is successful. The value FAILURE_ALLOWED indicates that the node can be rerun only if the last running fails. The value ALL_DENIED indicates that the node cannot be rerun. This parameter corresponds to the Rerun parameter in the Schedule section of the Properties tab in the DataWorks console.

Stop Boolean No false

Specifies whether the scheduling for the node is suspended. This parameter corresponds to the Skip Execution parameter in the Schedule section of the Properties tab in the DataWorks console.

ParaValue String No x=a y=b z=c

The scheduling parameters of the node. This parameter corresponds to the Parameters parameter in the General section of the Properties tab in the DataWorks console.

StartEffectDate Long No 936923400000

The start time of automatic scheduling. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC. This parameter corresponds to the Validity Period parameter in the Schedule section of the Properties tab in the DataWorks console.

EndEffectDate Long No 4155787800000

The end time of automatic scheduling. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC. This parameter corresponds to the Validity Period parameter in the Schedule section of the Properties tab in the DataWorks console.

CronExpress String No 00 00-59/5 1-23 * * ?

The cron expression that represents the automatic scheduling policy of the node. This parameter corresponds to the Cron Expression parameter in the Schedule section of the Properties tab in the DataWorks console.

  • Cron expression for a node that is scheduled to run at 05:30 every day: 00 30 05 * * ?
  • Cron expression for a node that is scheduled to run at the fifteenth minute of each hour: 00 15 * * * ?
  • Cron expression for a node that is scheduled to run every 10 minutes: 00 00/10 * * * ?
  • Cron expression for a node that is scheduled to run every 10 minutes from 08:00 to 17:00 every day: 00 00-59/10 8-23 * * * ?
  • Cron expression for a node that is scheduled to run at 00:20 on the first day of each month: 00 20 00 1 * ?
  • Cron expression for a node that is scheduled to run every three months starting from 00:10 on January 1: 00 10 00 1 1-12/3 ?
  • Cron expression for a node that is scheduled to run at 00:05 every Tuesday and Friday: 00 05 00 * * 2,5

The scheduling system of DataWorks imposes the following limits on cron expressions:

  • A node can be scheduled to run at a minimum interval of 5 minutes.
  • A node can be scheduled to run at 00:05 every day at the earliest.
CycleType String No NOT_DAY

The type of the scheduling cycle. Valid values: NOT_DAY and DAY. The value NOT_DAY indicates that the node is scheduled to run by minute or hour. The value DAY indicates that the node is scheduled to run by day, week, or month. This parameter corresponds to the Scheduling Cycle parameter in the Schedule section of the Properties tab in the DataWorks console.

DependentType String No USER_DEFINE

The way in which the node depends on last-cycle instances. Valid values: NONE, SELF, CHILD, and USER_DEFINE. The value NONE indicates that the node does not depend on last-cycle instances. The value SELF indicates that the node depends on its own last-cycle instance. The value CHILD indicates that the node depends on the last-cycle instances of its descendant nodes. The value USER_DEFINE indicates that the node depends on the last-cycle instances of specific nodes.

DependentNodeIdList String No 5,10,15,20

The IDs of the auto triggered nodes on which the current node depends. Separate multiple IDs with commas (,). Specify this parameter when the DependentType parameter is set to USER_DEFINE. This parameter corresponds to the field that appears after Cross-Cycle Dependencies is selected and the Depend On parameter is set to Instances of Custom Nodes in the DataWorks console.

InputList String No project_root,project.file1,project.001_out

The output name of the parent file on which the current file depends. This parameter corresponds to the Parent Node Output Name parameter in the Dependencies section of the Properties tab in the DataWorks console. If you specify multiple output names, separate them with commas (,).

ProjectIdentifier String No dw_project

The globally unique identifier (GUID) of the DataWorks workspace. You can view the GUID at the top of the DataStudio page. You can also click the GUID to switch to another workspace.

You must specify either this parameter or ProjectId to determine the DataWorks workspace to which the operation is applied.

OutputList String No dw_project.ods_user_info_d

The output name of the current file. This parameter corresponds to the Output Name parameter in the Dependencies section of the Properties tab in the DataWorks console. If you specify multiple output names, separate them with commas (,).

ResourceGroupIdentifier String No default_group

The name of the resource group that is used to run the node that corresponds to the file. You can call the ListResourceGroups operation and set the resourceGroupType parameter to 1 to query available resource groups.

ConnectionName String No odps_first

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

Owner String No 18023848927592

The ID of the file owner.

AutoParsing Boolean No true

Specifies whether the automatic parsing feature is enabled for the file. This parameter corresponds to the Auto Parse parameter in the Dependencies section of the Properties tab in the DataWorks console.

Response parameters

Parameter Type Example Description
ErrorCode String Invalid.Tenant.ConnectionNotExists

The error code returned.

ErrorMessage String The connection does not exist.

The error message returned.

HttpStatusCode Integer 200

The HTTP status code returned.

RequestId String 0000-ABCD-EFGH-IJKLMNOPQ

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

Success Boolean true

Indicates whether the request is successful.

Examples

Sample requests

http(s)://[Endpoint]/?Action=UpdateFile
&AutoRerunTimes=3
&FileDescription=File description
&FileFolderPath=Workflow/1/Data Integration/Folder 1/Folder 2
&FileId=100000001
&FileName=ods_user_info_d
&InputList=project_root,project.file1,project.001_out
&RegionId=cn-zhangjiakou
&<Common request parameters>

Sample success responses

XML format

<RequestId>0000-ABCD-EFGH-IJKLMNOPQ</RequestId>
<HttpStatusCode>200</HttpStatusCode>
<Success>true</Success>

JSON format

null

Error codes

HttpCode Error code Error message Description
500 InternalError.System An internal system error occurred. Try again later. The error message returned because an internal error has occurred. Try again later.
500 InternalError.UserId.Missing An internal system error occurred. Try again later. The error message returned because an internal error has occurred. Try again later.
429 Throttling.Api The request for this resource has exceeded your available limit. The error message returned because the maximum number of requests for the resource has been reached.
429 Throttling.System The DataWorks system is busy. Try again later. The error message returned because the DataWorks system is busy. Try again later.
429 Throttling.User Your request is too frequent. Try again later. The error message returned because excessive requests have been submitted within a short period of time. Try again later.
403 Forbidden.Access Access is forbidden. Please first activate DataWorks Enterprise Edition or Flagship Edition. The error message returned because you are not allowed to perform this operation. Activate DataWorks Enterprise Edition or DataWorks Ultimate Edition.

For a list of error codes, visit the API Error Center.