All Products
Search
Document Center

DataWorks:ListFiles

Last Updated:Nov 21, 2024

Queries a list of files.

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

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.
OperationAccess levelResource typeCondition keyAssociated operation
dataworks:*get
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
FileFolderPathstringNo

The path of the files.

ProjectIdlongNo

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.

You must configure either the ProjectId or ProjectIdentifier parameter to determine the DataWorks workspace to which the operation is applied.

10000
KeywordstringNo

The keyword in the file names. The keyword is used to perform a fuzzy match. You can specify a keyword to query all files whose names contain the keyword.

ods
ProjectIdentifierstringNo

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 either the ProjectId or ProjectIdentifier parameter to determine the DataWorks workspace to which the operation is applied.

dw_project
PageNumberintegerNo

The page number.

1
PageSizeintegerNo

The number of entries per page. Default value: 10. Maximum value: 100.

10
UseTypestringNo

The module to which the files belong. Valid values:

  • NORMAL: The files are used for DataStudio.
  • MANUAL: The files are used for manually triggered nodes.
  • MANUAL_BIZ: The files are used for manually triggered workflows.
  • SKIP: The files are used for dry-run nodes in DataStudio.
  • ADHOCQUERY: The files are used for ad hoc queries.
  • COMPONENT: The files are used for snippets.
NORMAL
FileTypesstringNo

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
OwnerstringNo

The owner of the files.

3726346****
NodeIdlongNo

The ID of the node that is scheduled. You can call the ListNodes operation to query the ID of the node.

123541234

Response parameters

ParameterTypeDescriptionExample
object
HttpStatusCodeinteger

The HTTP status code returned.

200
ErrorMessagestring

The error message returned.

The connection does not exist.
RequestIdstring

The ID of the request. You can troubleshoot errors based on the ID.

0000-ABCD-EFG
ErrorCodestring

The error code returned.

Invalid.Tenant.ConnectionNotExists
Successboolean

Indicates whether the request is successful. Valid values:

  • true: The request is successful.
  • false: The request fails.
true
Dataobject

The files returned.

PageNumberinteger

The page number of the returned page.

1
PageSizeinteger

The number of entries returned per page.

10
TotalCountinteger

The total number of entries returned.

13
Filesarray<object>

The details of the files.

Fileobject
CommitStatusinteger

Indicates whether the latest code in the file is committed. Valid values: 0 and 1. The value 0 indicates that the latest code in the file is not committed. The value 1 indicates that the latest code in the file is committed.

1
AutoParsingboolean

Specifies whether the automatic parsing feature is enabled for the file. Valid values:

  • true: The automatic parsing feature is enabled for the file.
  • false: The automatic parsing feature is not enabled for the file.

This parameter is equivalent to the Analyze Code parameter in the Dependencies section of the Properties panel in the DataWorks console.

true
Ownerstring

The ID of the Alibaba Cloud account used by the file owner.

3872572****
CreateTimelong

The time when the file was created. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

1593950832000
FileTypeinteger

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
CurrentVersioninteger

The latest version number of the file.

2
BizIdlong

The ID of the workflow to which the file belongs. This parameter is deprecated and replaced by the BusinessId parameter.

300000
LastEditUserstring

The ID of the Alibaba Cloud account that is used to last modify the file.

38748246285727
FileNamestring

The name of the file.

ods_user_info_d
ConnectionNamestring

The ID of the compute engine instance that is used to run the node that corresponds to the file.

odps_first
UseTypestring

The module to which the file belongs. Valid values:

  • NORMAL: The file is used for DataStudio.
  • MANUAL: The file is used for a manually triggered node.
  • MANUAL_BIZ: The file is used for a manually triggered workflow.
  • SKIP: The files is used for a dry-run node in DataStudio.
  • ADHOCQUERY: The file is used for an ad hoc query.
  • COMPONENT: The file is used for a snippet.
NORMAL
FileFolderIdstring

The ID of the folder to which the file belongs.

2735c2****
FileIdlong

The ID of the file.

10000001
ParentIdlong

The ID of the node group file to which the current file belongs. This parameter is returned only if the current file is an inner file of the node group file.

-1
CreateUserstring

The ID of the Alibaba Cloud account that is used to create the file.

382762****
IsMaxComputeboolean

Indicates whether the file needs to be uploaded to MaxCompute if the file is a MaxCompute resource file.

This parameter is returned only if the file is a MaxCompute resource file.

false
BusinessIdlong

The ID of the workflow to which the file belongs.

300000
FileDescriptionstring

The description of the file.

my test datastudio file
LastEditTimelong

The time when the file was last modified. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

1593950832000
Contentstring

This parameter is deprecated. You can call the GetFile operation to query the details of the file.

SHOW TABLES;
NodeIdlong

The ID of the auto triggered node that is generated in the scheduling system after the file is committed.

300001

Examples

Sample success responses

JSONformat

{
  "HttpStatusCode": 200,
  "ErrorMessage": "The connection does not exist.",
  "RequestId": "0000-ABCD-EFG",
  "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_first",
        "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": ""
      }
    ]
  }
}

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.

Change history

Change timeSummary of changesOperation
2023-07-14The Error code has changed. The request parameters of the API has changed. The response structure of the API has changedView Change Details