Updates a file.

When you debug or call the operation, you must set new values for the specified parameters to ensure that the values are different from the original configurations of the file. For example, if the original value of a parameter is A, you must set the parameter to B before you send a request. If you set the parameter to A, an exception that indicates invalid data occurs.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes UpdateFile

The operation that you want to perform.

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

The path of the folder that stores the file.

ProjectId Long No 10000

The ID of the DataWorks workspace. You can log on to the DataWorks console and go to the Workspace Management page to query 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 Fileld parameter to the ID and set the FileName parameter 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 code 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.

RegionId String Yes cn-zhangjiakou

The ID of the region in which the DataWorks workspace resides. For example, the ID of the China (Shanghai) region is cn-shanghai, and the ID of the China (Zhangjiakou) region is cn-zhangjiakou. The system automatically determines the value of this parameter based on the endpoint that is used to call the operation.

AutoRerunTimes Integer Yes 3

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

AutoRerunIntervalMillis Integer No 120000

The interval between two consecutive automatic reruns after an error occurs. Unit: milliseconds.

This parameter is equivalent to the Rerun Interval parameter in the Schedule section of the Properties panel 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: The node can be rerun regardless of whether it is successfully run or fails to run.
  • FAILURE_ALLOWED: The node can be rerun only after it fails to run.
  • ALL_DENIED: The node cannot be rerun regardless of whether it is successfully run or fails to run.

This parameter is equivalent to the Rerun parameter in the Schedule section of the Properties panel in the DataWorks console.

Stop Boolean No false

Specifies whether to suspend the scheduling for the node.

  • true: suspends the scheduling for the node.
  • false: does not suspend the scheduling for the node.

This parameter is equivalent to the Skip Execution option in the Schedule section of the Properties panel in the DataWorks console.

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

The scheduling parameters of the node.

This parameter is equivalent to the configuration of the scheduling parameters in the Parameters section of the Properties panel in the DataWorks console. For more information, see Configure scheduling parameters.

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 is equivalent to the start time specified for the Validity Period parameter in the Schedule section of the Properties panel 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 is equivalent to the end time specified for the Validity Period parameter in the Schedule section of the Properties panel in the DataWorks console.

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

The CRON expression that represents the periodic scheduling policy of the node. This parameter is equivalent to the Cron Expression parameter in the Schedule section of the Properties panel in the DataWorks console. After you set the Scheduling Cycle and Run At parameters in the DataWorks console, DataWorks automatically generates the value of the Cron Expression parameter.

Examples:

  • 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 of the node that corresponds to the file. Valid values: NOT_DAY and DAY. A value of NOT_DAY indicates that the node is scheduled to run by minute or hour. A value of DAY indicates that the node is scheduled to run by day, week, or month.

This parameter is equivalent to the Scheduling Cycle parameter in the Schedule section of the Properties panel in the DataWorks console.

DependentType String No USER_DEFINE

The type of the cross-cycle scheduling dependency of the node that corresponds to the file. Valid values:

  • SELF: The instance generated for the node in the current cycle depends on the instance generated for the node in the previous cycle.
  • CHILD: The instance generated for the node in the current cycle depends on the instances generated for the descendant nodes at the nearest level of the node in the previous cycle.
  • USER_DEFINE: The instance generated for the node in the current cycle depends on the instances generated for one or more specified nodes in the previous cycle.
  • NONE: No cross-cycle scheduling dependency type is selected for the node.
DependentNodeIdList String No 5,10,15,20

The IDs of the nodes on which the node corresponding to the file depends when the DependentType parameter is set to USER_DEFINE. Separate multiple IDs with commas (,).

This parameter is equivalent to the field that appears after Previous Cycle is selected and the Depend On parameter is set to Other Nodes in the Dependencies section of the Properties panel in the DataWorks console.

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

The output names of the parent files on which the current file depends. Separate multiple names with commas (,).

This parameter is equivalent to the Output Name parameter under Parent Nodes in the Dependencies section of the Properties panel in the DataWorks console.

ProjectIdentifier String No dw_project

The name of the DataWorks workspace. You can log on to the DataWorks console and go to the Workspace Management page to view the workspace name.

You must specify one of the ProjectId and ProjectIdentifier parameters to determine the DataWorks workspace to which the operation is applied.

FileId Long Yes 100000001

The ID of the file. You can call the ListFiles operation to query the ID of the file.

OutputList String No dw_project.ods_user_info_d

The output names of the current file.

This parameter is equivalent to the Output Name parameter under Output in the Dependencies section of the Properties panel in the DataWorks console.

ResourceGroupIdentifier String No default_group

The ID of the resource group that is used to run the node. You can call the ListResourceGroups operation to query the available resource groups in the workspace.

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 ListDataSources operation to query available data sources.

Owner String No 18023848927592

The ID of the file owner.

AutoParsing Boolean No true

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

  • true: enables the automatic parsing feature for the file.
  • false: does not enable the automatic parsing feature for the file.

This parameter is equivalent to the Auto Parse parameter in the Dependencies section of the Properties panel in the DataWorks console.

SchedulerType String No NORMAL

The scheduling type of the node. Valid values:

  • NORMAL: The node is an auto triggered node.
  • MANUAL: The node is a manually triggered node. Manually triggered nodes cannot be automatically triggered. They correspond to the nodes in the Manually Triggered Workflows pane.
  • PAUSE: The node is a paused node.
  • SKIP: The node is a dry-run node. Dry-run nodes are started as scheduled but the system sets the status of the nodes to successful when it starts to run them.

Response parameters

Parameter Type Example Description
HttpStatusCode Integer 200

The HTTP status code.

ErrorMessage String The connection does not exist.

The error message returned.

RequestId String 0000-ABCD-EFGH-IJKLMNOPQ

The unique ID of the request. You can troubleshoot errors based on the ID.

ErrorCode String Invalid.Tenant.ConnectionNotExists

The error code returned.

Success Boolean true

Indicates whether the request is successful. Valid values:

  • true: The request is successful.
  • false: The request fails.

Examples

Sample requests

http(s)://[Endpoint]/?Action=UpdateFile
&FileFolderPath=Business Flow/1/Data Integration/Folder1/Folder2
&ProjectId=10000
&FileName=ods_user_info_d
&FileDescription=File description
&Content=SELECT "1";
&AutoRerunTimes=3
&AutoRerunIntervalMillis=120000
&RerunMode=ALL_ALLOWED
&Stop=false
&ParaValue=x=a y=b z=c
&StartEffectDate=936923400000
&EndEffectDate=4155787800000
&CronExpress=00 00-59/5 1-23 * * ?
&CycleType=NOT_DAY
&DependentType=USER_DEFINE
&DependentNodeIdList=5,10,15,20
&InputList=project_root,project.file1,project.001_out
&ProjectIdentifier=dw_project
&FileId=100000001
&OutputList=dw_project.ods_user_info_d
&ResourceGroupIdentifier=default_group
&ConnectionName=odps_first
&Owner=18023848927592
&AutoParsing=true
&SchedulerType=NORMAL
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<UpdateFileResponse>
    <HttpStatusCode>200</HttpStatusCode>
    <ErrorMessage>The connection does not exist.</ErrorMessage>
    <RequestId>0000-ABCD-EFGH-IJKLMNOPQ</RequestId>
    <ErrorCode>Invalid.Tenant.ConnectionNotExists</ErrorCode>
    <Success>true</Success>
</UpdateFileResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

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

Error codes

Http satus code Error code Error message Description
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 Ultimate Edition.
429 Throttling.Api The request for this resource has exceeded your available limit. The error message returned because the number of requests for the resource has exceeded the upper limit.
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.
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.

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