Updates a file.
Operation description
When you debug or call this operation, you must specify 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 change the value of this parameter to B before you commit the node. If you set the parameter to A, an exception that indicates invalid data occurs.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
dataworks:* | update | *All Resources * |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
FileFolderPath | string | No | The path of the file. | |
ProjectId | long | No | The ID of the DataWorks workspace. You can log on to the DataWorks console and go to the Workspace Management page to obtain the workspace ID. | 10000 |
FileName | string | No | 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 FileId parameter to the ID and set the FileName parameter to a new value when you call the UpdateFile operation. | ods_user_info_d |
FileDescription | string | No | The description of the file. | |
Content | string | No | 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. | SELECT "1"; |
AutoRerunTimes | integer | Yes | The number of automatic reruns that are allowed after an error occurs. | 3 |
AutoRerunIntervalMillis | integer | No | The interval between two consecutive automatic reruns after an error occurs. Unit: milliseconds. Maximum value: 1800000 (30 minutes). This parameter corresponds to the Rerun Interval parameter that is displayed after the Auto Rerun upon Error check box is selected 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. | 120000 |
RerunMode | string | No | Specifies whether the node that corresponds to the file can be rerun. Valid values:
This parameter corresponds to the Rerun parameter in the Schedule section of the Properties tab in the DataWorks console. Enumeration Value:
| ALL_ALLOWED |
Stop | boolean | No | Specifies whether to suspend the scheduling of the node. Valid values:
This parameter corresponds to the Recurrence parameter in the Schedule section of the Properties tab in the DataWorks console. | false |
ParaValue | string | No | The scheduling parameters of the node. This parameter corresponds to the Parameters section of the Properties tab in the DataWorks console. For more information, see Configure scheduling parameters. | x=a y=b z=c |
StartEffectDate | long | No | The start time of automatic scheduling. Set this parameter to 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. | 936923400000 |
EndEffectDate | long | No | The end time of automatic scheduling. Set this parameter to a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC. This parameter corresponds to the end time specified for the Validity Period parameter in the Schedule section of the Properties tab in the DataWorks console. | 4155787800000 |
CronExpress | string | No | The CRON expression that represents the periodic 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. After you configure the Scheduling Cycle and Run At parameters in the DataWorks console, DataWorks automatically generates a value for the Cron Expression parameter. Examples:
The scheduling system of DataWorks imposes the following limits on CRON expressions:
| 00 00-59/5 1-23 * * ? |
CycleType | string | No | The type of the scheduling cycle of the node that corresponds to the file. 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. | NOT_DAY |
DependentType | string | No | The type of the cross-cycle scheduling dependency of the node. Valid values:
| USER_DEFINE |
DependentNodeIdList | string | No | The ID of the node on which the node corresponding to the file depends when the DependentType parameter is set to USER_DEFINE. Multiple IDs are separated by commas (,). The value of this parameter corresponds to the ID of the node that you specified after you select Previous Cycle and set Depend On to Other Nodes in the Dependencies section of the Properties tab in the DataWorks console. | 5,10,15,20 |
InputList | string | No | The output name of the parent file on which the current file depends. If you specify multiple output names, separate them with commas (,). This parameter corresponds to the Parent Nodes parameter that is displayed after you select Same Cycle in the Dependencies section of the Properties tab in the DataWorks console. Note
You must configure this parameter when you call the CreateDISyncTask or UpdateFile operation to create a batch synchronization task.
| project_root,project.file1,project.001_out |
ProjectIdentifier | string | No | The name of the DataWorks workspace. You can log on to the DataWorks console and go to the Workspace Management page to obtain the workspace name. You must configure this parameter or the ProjectId parameter to determine the DataWorks workspace to which the operation is applied. | dw_project |
FileId | long | Yes | The ID of the file. You can call the ListFiles operation to obtain the ID. | 100000001 |
OutputList | string | No | 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. | dw_project.ods_user_info_d |
ResourceGroupIdentifier | string | No | The identifier 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. | default_group |
ConnectionName | string | No | The name of the connected data source that is used to run the node. You can call the ListDataSources operation to query the available data sources of the workspace. | odps_first |
Owner | string | No | The ID of the file owner. | 18023848927592 |
AutoParsing | boolean | No | Specifies whether the automatic parsing feature is enabled for the file. Valid values:
This parameter corresponds to the Analyze Code parameter that is displayed after Same Cycle is selected in the Dependencies section of the Properties tab in the DataWorks console. | true |
SchedulerType | string | No | The scheduling type of the node. Valid values:
| NORMAL |
AdvancedSettings | string | No | The advanced configurations of the node. This parameter is valid only for an EMR Spark Streaming node or an EMR Streaming SQL node. This parameter corresponds to the Advanced Settings tab of the node in the DataWorks console. This parameter is configured in the JSON format. | {"queue":"default","SPARK_CONF":"--conf spark.driver.memory=2g"} |
StartImmediately | boolean | No | Specifies whether to immediately run a node after the node is deployed to the production environment. Valid values:
This parameter is valid only for an EMR Spark Streaming node or an EMR Streaming SQL node. This parameter corresponds to the Start Method parameter in the Schedule section of the Configure tab in the DataWorks console. | true |
InputParameters | string | No | The input parameters of the node. This parameter is configured in the JSON format. For more information about the input parameters, refer to the InputContextParameterList parameter in the Response parameters section of the GetFile operation. This parameter corresponds to the Input Parameters table in the Input and Output Parameters section of the Properties tab in the DataWorks console. | [{"ValueSource": "project_001.first_node:bizdate_param","ParameterName": "bizdate_input"}] |
OutputParameters | string | No | The output parameters of the node. This parameter is configured in the JSON format. For more information about the output parameters, refer to the OutputContextParameterList parameter in the Response parameters section of the GetFile operation. This parameter corresponds to the Output Parameters table in the Input and Output Parameters section of the Properties tab in the DataWorks console. | [{"Type": 1,"Value": "${bizdate}","ParameterName": "bizdate_param"}] |
Response parameters
Examples
Sample success responses
JSON
format
{
"HttpStatusCode": 200,
"ErrorMessage": "The connection does not exist.",
"RequestId": "0000-ABCD-EFGH-IJKLMNOPQ",
"ErrorCode": "Invalid.Tenant.ConnectionNotExists",
"Success": true
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
403 | Forbidden.Access | Access is forbidden. Please first activate DataWorks Enterprise Edition or Flagship Edition. | No permission, please authorize |
429 | Throttling.Api | The request for this resource has exceeded your available limit. | - |
429 | Throttling.System | The DataWorks system is busy. Try again later. | - |
429 | Throttling.User | Your request is too frequent. Try again later. | - |
500 | InternalError.System | An internal system error occurred. Try again later. | - |
500 | InternalError.UserId.Missing | An internal system error occurred. Try again later. | - |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2024-12-13 | The Error code has changed. The request parameters of the API has changed | View Change Details |
2024-09-02 | The Error code has changed. The request parameters of the API has changed | View Change Details |
2024-04-03 | The Error code has changed | View Change Details |
2023-07-14 | The Error code has changed | View Change Details |
2023-04-25 | The Error code has changed. The request parameters of the API has changed | View Change Details |