Queries files in a DataWorks workspace, with optional filters for file type, owner, keyword, and more.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
dataworks:* |
get |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| FileFolderPath |
string |
No |
The folder path of the files. |
Business_process/my_first_business_process/MaxCompute/ods_layer |
| ProjectId |
integer |
No |
The DataWorks workspace ID. You can obtain this from the Workspace Management page in the DataWorks console. You must set either ProjectId or ProjectIdentifier to specify the workspace. |
10000 |
| Keyword |
string |
No |
The keyword for fuzzy matching file names. Files whose names contain this keyword are returned. |
ods |
| ProjectIdentifier |
string |
No |
The DataWorks workspace name. You can obtain this from the Workspace Management page in the DataWorks console. You must set either ProjectId or ProjectIdentifier to specify the workspace. |
dw_project |
| PageNumber |
integer |
No |
The page number. |
1 |
| PageSize |
integer |
No |
The number of entries per page. Default value: 10. Maximum value: 100. |
10 |
| UseType |
string |
No |
The module to which the files belong. Valid values:
|
NORMAL |
| FileTypes |
string |
No |
The types of the code in the files. Valid values: 6 (Shell), 10 (ODPS SQL), 11 (ODPS MR), 23 (Data Integration), 24 (ODPS Script), 97 (PAI), 98 (node group), 99 (zero load), 221 (PyODPS 2), 225 (ODPS Spark), 227 (EMR Hive), 228 (EMR Spark), 229 (EMR Spark SQL), 230 (EMR MR), 239 (OSS object inspection), 257 (EMR Shell), 258 (EMR Spark Shell), 259 (EMR Presto), 260 (EMR Impala), 900 (real-time synchronization), 1002 (PAI inner node), 1089 (cross-tenant collaboration), 1091 (Hologres development), 1093 (Hologres SQL), 1100 (assignment), 1106 (for-each), and 1221 (PyODPS 3). |
10,23 |
| Owner |
string |
No |
The owner of the files. |
3726346**** |
| NodeId |
integer |
No |
The scheduled node ID. You can call the ListNodes operation to obtain the node ID. |
123541234 |
| NeedContent |
boolean |
No |
Specifies whether to include file content in the response. Enabling this for large files may increase latency. |
false |
| NeedAbsoluteFolderPath |
boolean |
No |
Specifies whether to include the absolute folder path of each file in the response. |
false |
| ExactFileName |
string |
No |
The exact file name to match. Only files with this exact name are returned. |
ods_create.sql |
| FileIdIn |
string |
No |
A comma-separated list of file IDs to filter by. Maximum: 50 IDs per request. |
78237,816123 |
| LastEditUser |
string |
No |
The ID of the Alibaba Cloud account that is used to last modify the file. |
38748246285727 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The returned data. |
||
| HttpStatusCode |
integer |
The HTTP status code returned. |
200 |
| ErrorMessage |
string |
The error message returned. |
The connection does not exist. |
| RequestId |
string |
The request ID for troubleshooting. |
0000-ABCD-EFG |
| ErrorCode |
string |
The error code returned. |
Invalid.Tenant.ConnectionNotExists |
| Success |
boolean |
Indicates whether the request is successful. Valid values:
|
true |
| Data |
object |
The files returned. |
|
| PageNumber |
integer |
The page number of the returned page. |
1 |
| PageSize |
integer |
The number of entries returned per page. |
10 |
| TotalCount |
integer |
The total number of entries returned. |
13 |
| Files |
array<object> |
The details of the files. |
|
|
object |
The information about the file. |
||
| CommitStatus |
integer |
Indicates whether the latest code is committed. Valid values: 0 (not committed) and 1 (committed). |
1 |
| AutoParsing |
boolean |
Indicates whether automatic parsing is enabled for the file.
Corresponds to the Analyze Code setting in the Dependencies section of the Properties panel in the DataWorks console. |
true |
| Owner |
string |
The Alibaba Cloud account ID of the file owner. |
3872572**** |
| CreateTime |
integer |
The file creation time, in UNIX timestamp format (milliseconds). |
1593950832000 |
| FileType |
integer |
The type of the code in the file. Valid values: 6 (Shell), 10 (ODPS SQL), 11 (ODPS MR), 23 (Data Integration), 24 (ODPS Script), 99 (zero load), 221 (PyODPS 2), 225 (ODPS Spark), 227 (EMR Hive), 228 (EMR Spark), 229 (EMR Spark SQL), 230 (EMR MR), 239 (OSS object inspection), 257 (EMR Shell), 258 (EMR Spark Shell), 259 (EMR Presto), 260 (EMR Impala), 900 (real-time synchronization), 1089 (cross-tenant collaboration), 1091 (Hologres development), 1093 (Hologres SQL), 1100 (assignment), and 1221 (PyODPS 3). |
10 |
| CurrentVersion |
integer |
The latest version number of the file. |
2 |
| BizId |
integer |
The ID of the workflow to which the file belongs. This parameter is deprecated and replaced by the BusinessId parameter. |
300000 |
| LastEditUser |
string |
The ID of the Alibaba Cloud account that is used to last modify the file. |
38748246285727 |
| FileName |
string |
The name of the file. |
ods_user_info_d |
| ConnectionName |
string |
The compute engine instance used to run the corresponding node. |
odps_first |
| UseType |
string |
The module to which the file belongs. Valid values:
|
NORMAL |
| FileFolderId |
string |
The ID of the folder to which the file belongs. |
2735c2**** |
| FileId |
integer |
The ID of the file. |
10000001 |
| ParentId |
integer |
The ID of the parent node group file. Returned only for inner files of a node group. |
-1 |
| CreateUser |
string |
The ID of the Alibaba Cloud account that is used to create the file. |
382762**** |
| IsMaxCompute |
boolean |
Indicates whether the file needs to be uploaded to MaxCompute. Returned only for MaxCompute resource files. |
false |
| BusinessId |
integer |
The ID of the workflow to which the file belongs. |
300000 |
| FileDescription |
string |
The description of the file. |
my test datastudio file |
| LastEditTime |
integer |
The last modification time, in UNIX timestamp format (milliseconds). |
1593950832000 |
| Content |
string |
Deprecated. Use the GetFile operation instead. |
SHOW TABLES; |
| NodeId |
integer |
The auto-triggered node ID generated in the scheduling system after the file is committed. |
300001 |
| AbsoluteFolderPath |
string |
The path of the folder to which the file belongs. |
Business_process/my_first_business_process/MaxCompute/ods_layer |
Examples
Success response
JSON format
{
"HttpStatusCode": 200,
"ErrorMessage": "The connection does not exist.",
"RequestId": "0000-ABCD-****",
"ErrorCode": "Invalid.Tenant.ConnectionNotExists",
"Success": true,
"Data": {
"PageNumber": 1,
"PageSize": 10,
"TotalCount": 13,
"Files": [
{
"CommitStatus": 1,
"AutoParsing": true,
"Owner": "3872572****",
"CreateTime": 1593950832000,
"FileType": 10,
"CurrentVersion": 2,
"BizId": 300000,
"LastEditUser": "38748246285727",
"FileName": "ods_user_info_d",
"ConnectionName": "odps_source",
"UseType": "NORMAL",
"FileFolderId": "2735c2****",
"FileId": 10000001,
"ParentId": -1,
"CreateUser": "382762****",
"IsMaxCompute": false,
"BusinessId": 300000,
"FileDescription": "my test datastudio file",
"LastEditTime": 1593950832000,
"Content": "SHOW TABLES;",
"NodeId": 300001,
"AbsoluteFolderPath": "Business_process/my_first_business_process/MaxCompute/ods_layer"
}
]
}
}
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.