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
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:
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.
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:
The scheduling system of DataWorks imposes the following limits on CRON expressions:
|
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:
|
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:
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:
|
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:
|
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.