UpdateFile

Updated at:

Updates an existing file.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request parameters

Parameter

Type

Required

Description

Example

FileFolderPath

string

No

The path where the file is stored.

Business_process/First_Business_Process/data_integration/Folder_1/Folder_2

ProjectId

integer

No

The ID of the DataWorks workspace. You can logon to the DataWorks console and go to the Workspace Management page to obtain the ID.

100001

FileName

string

No

The name of the file. You can change the file name by resetting the value of FileName. For example, you can call the ListFiles operation to query the ID of a file in the destination directory, call the UpdateFile operation, specify the queried file ID in the FileId parameter, and configure the FileName parameter to change the name of the file.

ods_user_info_d

FileDescription

string

No

The description of the file.

Here is the file description

Content

string

No

The code content of the file. The code format varies based on the file type. You can go to Operation Center, right-click a task of the corresponding type, and select View Code to view the specific code format.

SELECT "1";

AutoRerunTimes

integer

No

The number of automatic reruns allowed after an error occurs.

3

AutoRerunIntervalMillis

integer

No

The interval between automatic reruns after a failure, in milliseconds. The maximum value is 1800000, which indicates 30 minutes.

This parameter corresponds to the Rerun Interval parameter in the Schedule > Time Attributes > Auto Rerun upon Failure section of the DataWorks console. The unit of the Rerun Interval parameter in the console is minutes. Convert the time unit when you call this operation.

120000

RerunMode

string

No

The rerun mode. Valid values:

  • ALL_ALLOWED: The task can be rerun regardless of whether it is successfully run or fails to run.

  • FAILURE_ALLOWED: The task can be rerun only after it fails to run.

  • ALL_DENIED: The task cannot be rerun regardless of whether it is successfully run or fails to run.

This parameter corresponds to the Rerun Mode parameter in the Schedule > Time Attributes section of the DataWorks console.

Valid values:

  • ALL_ALLOWED :

    All allowed.

  • ALL_DENIED :

    All denied.

  • ALL_ALLOWD :

    All allowed.

  • FAILURE_ALLOWED :

    Allowed after failure.

ALL_ALLOWED

Stop

boolean

No

Specifies whether to pause scheduling. Valid values:

  • true: Pause scheduling.

  • false: Do not pause scheduling.

This parameter corresponds to the Pause Scheduling option in the Schedule > Time Attributes > Schedule Type section of the DataWorks console.

false

ParaValue

string

No

The scheduling parameters.

This parameter corresponds to the Scheduling Parameters section in the Schedule section of the DataWorks console. For more information, see Scheduling parameters.

x=a y=b z=c

StartEffectDate

integer

No

The start time of automatic scheduling, in the form of a millisecond timestamp.

This parameter corresponds to the start time in the Schedule > Time Attributes > Effective Date section of the DataWorks console.

936923400000

EndEffectDate

integer

No

The end time of automatic scheduling, in the form of a millisecond timestamp.

This parameter corresponds to the end time in the Schedule > Time Attributes > Effective Date section of the DataWorks console.

4155787800000

CronExpress

string

No

The cron expression for periodic scheduling. This parameter corresponds to the cron expression in the Schedule > Time Property section for the data development task in the DataWorks console. After you configure the scheduling cycle and timed scheduling time, DataWorks automatically generates the corresponding cron expression.

Examples:

  • Schedule a task at 05:30 every day: 00 30 05 * * ?.

  • Schedule a task at the 15th minute of every hour: 00 15 * * * ?.

  • Schedule a task every 10 minutes: 00 00/10 * * * ?.

  • Schedule a task every 10 minutes from 08:00 to 17:00 every day: 00 00-59/10 8-23 * * * ?.

  • Schedule a task at 00:20 on the first day of every month: 00 20 00 1 * ?.

  • Schedule a task every three months starting from 00:10 on January 1: 00 10 00 1 1-12/3 ?.

  • Schedule a task at 00:05 every Tuesday and Friday: 00 05 00 * * 2,5.

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

  • The minimum scheduling interval is 5 minutes.

  • The earliest scheduling time of a day is 00:05.

00 00-59/5 1-23 * * ?

CycleType

string

No

The type of the scheduling cycle. Valid values: NOT_DAY (minutes and hours) and DAY (days, weeks, and months).

This parameter corresponds to the Schedule Type parameter in the Schedule > Time Attributes section of the DataWorks console.

Valid values:

  • NOT_DAY :

    Minutes and hours.

  • DAY :

    Days, weeks, and months.

NOT_DAY

DependentType

string

No

The dependency on the previous cycle. Valid values:

  • SELF: The current node.

  • CHILD: The child nodes at the first level.

  • USER_DEFINE: Other nodes.

  • NONE: No dependency on the previous cycle.

Valid values:

  • CHILD_AND_SELF :

    Current node and downstream nodes.

  • USER_DEFINE :

    Specified nodes.

  • SELF :

    Current node.

  • USER_DEFINE_AND_SELF :

    Specified nodes and current node.

  • NONE :

    None.

  • CHILD :

    Downstream nodes.

USER_DEFINE

DependentNodeIdList

string

No

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

This parameter corresponds to the content configured when you set the Dependency parameter to Cross-cycle Dependency (Previous Cycle) and select Other Nodes in the Schedule > Scheduling Dependencies section for the data development node in the DataWorks console.

5,10,15,20

InputList

string

No

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

This parameter corresponds to the Output Name of Upstream Node parameter in the Schedule > Scheduling Dependencies section of the DataWorks console.

Note

This parameter is required when you create a offline synchronization task by calling the CreateDISyncTask or UpdateFile operation.

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 Settings page to obtain the workspace name.

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

dw_project

FileId

integer

Yes

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

100000001

OutputList

string

No

The output of the file.

This parameter corresponds to the Output Name of Current Node parameter in the Schedule > Scheduling Dependencies section of the DataWorks console.

dw_project.ods_user_info_d

ResourceGroupIdentifier

string

No

The resource group used when the task is executed after the file is published as a task. You can call the ListResourceGroups operation to obtain the list of available resource groups in the workspace.

default_group

ConnectionName

string

No

The identifier of the data source used when the task corresponding to the file is executed. You can call the ListDataSources operation to obtain the list of available data sources.

odps_source

Owner

string

No

The user ID of the file owner.

18023848927592

AutoParsing

boolean

No

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

  • true: The file automatically parses code.

  • false: The file does not automatically parse code.

This parameter corresponds to the Code Parsing parameter in the Schedule > Scheduling Dependencies section of the DataWorks console.

true

SchedulerType

string

No

The scheduling type. Valid values:

  • NORMAL: Normal scheduling task.

  • MANUAL: Manual task. It is not scheduled on a daily basis and corresponds to a node in a manual workflow.

  • PAUSE: Paused task.

  • SKIP: Dry-run task. It is scheduled on a daily basis, but its status is directly set to successful when the scheduling is triggered.

Valid values:

  • PAUSE :

    Paused task.

  • SKIP :

    Dry-run task. It is scheduled on a daily basis, but its status is directly set to successful when the scheduling is triggered.

  • MANUAL :

    Manual task. It is not scheduled on a daily basis and corresponds to a node in a manual workflow.

  • NORMAL :

    Normal scheduling task.

NORMAL

AdvancedSettings

string

No

The advanced settings of the task.

This parameter corresponds to the Advanced Settings section in the right-side navigation pane of the edit page for EMR Spark Streaming and EMR Streaming SQL data development tasks in the DataWorks console.

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

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

StartImmediately

boolean

No

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 Startup Method parameter in the Configuration > Time Attributes section in the right-side navigation pane of the edit page for EMR Spark Streaming and EMR Streaming SQL data development tasks in the DataWorks console.

true

InputParameters

string

No

The context input parameters of the node. The parameter value is in JSON format. For the included fields, refer to the InputContextParameterList parameter structure in the response of the GetFile operation.

This parameter corresponds to the Input Parameters of Current Node parameter in the Schedule > Node Context Parameters section of the DataWorks console.

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

OutputParameters

string

No

The context output parameters of the node. The parameter value is in JSON format. For the included fields, refer to the OutputContextParameterList parameter structure in the response of the GetFile operation.

This parameter corresponds to the Output Parameters of Current Node parameter in the Schedule > Node Context Parameters section of the DataWorks console.

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

IgnoreParentSkipRunningProperty

boolean

No

This parameter corresponds to the Skip Dry Run of Upstream Nodes parameter that is configured when you set the Dependency parameter to Cross-cycle Dependency (Previous Cycle) and select Current Node or Child Nodes at First Level in the Schedule > Scheduling Dependencies section of the DataWorks console.

true

ApplyScheduleImmediately

boolean

No

Specifies whether the scheduling configuration takes effect immediately after the file is published.

true

Timeout

integer

No

The timeout definition in the scheduling configuration.

1

ImageId

string

No

The ID of the custom image.

m-uf6d7npxk1hhek8ng0cb

Response elements

Element

Type

Description

Example

object

The returned result.

HttpStatusCode

integer

The HTTP status code.

200

ErrorMessage

string

The error message.

The connection does not exist.

RequestId

string

The unique ID of the request. You can use the ID to troubleshoot issues when an error occurs.

0000-ABCD-EFGH-IJKLMNOPQ

ErrorCode

string

The error code.

Invalid.Tenant.ConnectionNotExists

Success

boolean

Indicates whether the call was successful. Valid values:

  • true: The call was successful.

  • false: The call failed.

true

Examples

Success response

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

500 InternalError.System An internal system error occurred. Try again later.
500 InternalError.UserId.Missing An internal system error occurred. Try again later.
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.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.