All Products
Search
Document Center

DataWorks:CreateResourceFile

Last Updated:Nov 05, 2025

Creates a resource file in DataStudio. The following types are supported: JAR, Archive, File, and Python.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
ProjectIdlongYes

The DataWorks workspace ID. You can log on to the DataWorks console and go to the Workspace page to query the ID. You must configure this parameter to specify the DataWorks workspace to which the operation is applied.

10000
FileFolderPathstringYes

The path of the file.

Business_process/First_Business_Process/MaxCompute/Folder_1/Folder_2
FileNamestringYes

The name of the file.

Filename
FileTypeintegerYes

The type of the code for the file.

The code for files varies based on the file type. For more information, see DataWorks nodes. You can call the ListFileType operation to query the type of the code for the file.

10
FileDescriptionstringNo

The description of the file.

This is a description
OwnerstringNo

The ID of the Alibaba Cloud account used by the file owner. If this parameter is not configured, the ID of the Alibaba Cloud account of the user who calls the operation is used by default.

1000000000001
ContentstringNo

The code for 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, open the directed acyclic graph (DAG) of a node of the file type, right-click the node, and then select View Code.

SHOW TABLES;
ResourceFilestringNo

The URL of the Object Storage Service (OSS) bucket to which you upload the file. The URL is provided by the POP platform.

http://bucketname1.oss-cn-shanghai.aliyuncs.com/example
OriginResourceNamestringYes

The name of the original resource file.

origin_file_name.sql
UploadModebooleanNo

The upload mode of MaxCompute file resources. This parameter takes effect only for MaxCompute file resources. Valid values:

  • true: indicates the resource upload and download mode.
  • false: indicates the online editing mode.
false
RegisterToCalcEnginebooleanYes

Specifies whether to upload the resource file to a desired compute engine.

false
StorageURLstringNo

The storage path of the resource file in a desired compute engine. This parameter takes effect only for E-MapReduce (EMR) and Cloudera's Distribution including Apache Hadoop (CDH) compute engines. In an EMR compute engine, this parameter is configured in the [osshdfs]://path/to/object format. In a CDH compute engine, this parameter is set to /user/admin/lib by default.

oss://oss-cn-shanghai.aliyuncs.com/emr-test

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

Datalong

The ID of the file that is created.

1000001
RequestIdstring

The request ID.

0000-ABCD-EFG

Examples

Sample success responses

JSONformat

{
  "Data": 1000001,
  "RequestId": "0000-ABCD-EFG"
}

Error codes

HTTP status codeError codeError messageDescription
403Forbidden.AccessAccess is forbidden. Please first activate DataWorks Enterprise Edition or Flagship Edition.No permission, please authorize
429Throttling.ApiThe request for this resource has exceeded your available limit.-
429Throttling.SystemThe DataWorks system is busy. Try again later.-
429Throttling.UserYour request is too frequent. Try again later.-
500InternalError.SystemAn internal system error occurred. Try again later.-
500InternalError.UserId.MissingAn internal system error occurred. Try again later.-

For a list of error codes, visit the Service error codes.