Creates a resource file in DataStudio. The following types are supported: JAR, Archive, File, and Python.
Debugging
Authorization information
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| ProjectId | long | Yes | 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 |
| FileFolderPath | string | Yes | The path of the file. | Business_process/First_Business_Process/MaxCompute/Folder_1/Folder_2 |
| FileName | string | Yes | The name of the file. | Filename |
| FileType | integer | Yes | 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 |
| FileDescription | string | No | The description of the file. | This is a description |
| Owner | string | No | 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 |
| Content | string | No | 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; |
| ResourceFile | string | No | 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 |
| OriginResourceName | string | Yes | The name of the original resource file. | origin_file_name.sql |
| UploadMode | boolean | No | The upload mode of MaxCompute file resources. This parameter takes effect only for MaxCompute file resources. Valid values:
| false |
| RegisterToCalcEngine | boolean | Yes | Specifies whether to upload the resource file to a desired compute engine. | false |
| StorageURL | string | No | 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
Examples
Sample success responses
JSONformat
{
"Data": 1000001,
"RequestId": "0000-ABCD-EFG"
}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.
