全部產品
Search
文件中心

DataWorks:ListFiles

更新時間:Sep 03, 2026

透過呼叫 ListFiles 查詢檔案清單。

調試

您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。

調試

授權資訊

當前API暫無授權資訊透出。

請求參數

名稱

類型

必填

描述

樣本值

FileFolderPath

string

否

The path of the folder where the file is stored.

Business_process/my_first_business_process/MaxCompute/ods_layer

ProjectId

integer

否

The ID of the DataWorks workspace. You can log on to the DataWorks console and go to the workspace configuration page to obtain the workspace ID.

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

10000

Keyword

string

否

The keyword of the file name. Fuzzy match is supported. You can enter a keyword to query all files whose names contain the keyword.

ods

ProjectIdentifier

string

否

The name of the DataWorks workspace. You can log on to the DataWorks console and go to the workspace configuration 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

PageNumber

integer

否

The page number for pagination.

1

PageSize

integer

否

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

10

UseType

string

否

The functional module to which the file belongs. Valid values:

  • NORMAL: DataStudio.

  • MANUAL: manual node.

  • MANUAL_BIZ: manual workflow.

  • SKIP: dry-run scheduling in DataStudio.

  • ADHOCQUERY: ad hoc query.

  • COMPONENT: component management.

NORMAL

FileTypes

string

否

The code type of the file.

Common codes and their corresponding file types include 6 (Shell), 10 (ODPS SQL), 11 (ODPS MR), 23 (Data Integration), 24 (ODPS Script), 97 (PAI), 98 (combined node), 99 (virtual node), 221 (PyODPS 2), 225 (ODPS Spark), 227 (EMR Hive), 228 (EMR Spark), 229 (EMR Spark SQL), 230 (EMR MR), 239 (OSS object check), 257 (EMR Shell), 258 (EMR Spark Shell), 259 (EMR Presto), 260 (EMR Impala), 900 (real-time synchronization), 1002 (PAI internal node), 1089 (cross-tenant node), 1091 (Hologres development), 1093 (Hologres SQL), 1100 (assignment node), 1106 (foreach node), 1221 (PyODPS 3).

10,23

Owner

string

否

The owner of the file.

3726346****

NodeId

integer

否

The ID of the scheduling node. You can call the ListNodes operation to obtain the node ID.

123541234

NeedContent

boolean

否

Specifies whether the query result includes the file content. For files with large content, network transmission latency may be significant.

false

NeedAbsoluteFolderPath

boolean

否

Specifies whether the query result includes the path of the folder where the file is stored.

false

ExactFileName

string

否

The file name for exact match. The file name in the query result exactly matches this parameter value.

ods_create.sql

FileIdIn

string

否

The list of file IDs. The file IDs in the query result can only be a subset of this list. A maximum of 50 file IDs can be specified at a time.

78237,816123

LastEditUser

string

否

The Alibaba Cloud ID of the user who last updated the file.

11233***

CommitStatus

integer

否

The current commit status of the file. Valid values: 0 (the latest code has not been committed) and 1 (the latest code has been committed).

1

返回參數

名稱

類型

描述

樣本值

object

The response parameters.

HttpStatusCode

integer

The HTTP status code.

200

ErrorMessage

string

The error message.

The connection does not exist.

RequestId

string

The request ID. You can use this ID to troubleshoot issues.

0000-ABCD-****

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

Data

object

The returned data details.

PageNumber

integer

The page number of the returned data.

1

PageSize

integer

The number of entries per page.

10

TotalCount

integer

The total number of entries that meet the conditions.

13

Files

array<object>

The file details.

object

The file information.

CommitStatus

integer

The current commit status of the file. Valid values: 0 (the latest code has not been committed) and 1 (the latest code has been committed).

1

AutoParsing

boolean

Indicates whether the automatic parsing feature is enabled 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" option when you select "Same Cycle" in "Scheduling Configuration > Scheduling Dependencies" for a DataStudio task in the DataWorks console.

true

Owner

string

The Alibaba Cloud user ID of the file owner.

3872572****

CreateTime

integer

The timestamp when the file was created, in milliseconds.

1593950832000

FileType

integer

The file type. Different file types have different codes. For more information, see DataWorks nodes.

10

CurrentVersion

integer

The latest version of the file.

2

BizId

integer

[Deprecated] The ID of the workflow to which the file belongs. This field is deprecated. Use the BusinessId field instead.

300000

LastEditUser

string

The Alibaba Cloud ID of the user who last updated the file.

382762****

FileName

string

The name of the file.

ods_user_info_d

ConnectionName

string

The name of the data source used when the task corresponding to the file is executed.

odps_source

UseType

string

The functional module to which the file belongs. Valid values:

  • NORMAL: DataStudio.

  • MANUAL: manual node.

  • MANUAL_BIZ: manual workflow.

  • SKIP: dry-run scheduling in DataStudio.

  • ADHOCQUERY: ad hoc query.

  • COMPONENT: component management.

NORMAL

FileFolderId

string

The ID of the folder where the file is stored.

2735c2****

FileId

integer

The ID of the file.

10000001

ParentId

integer

If the current file is an internal file of a combined node, this field indicates the ID of the corresponding combined node file.

-1

CreateUser

string

The Alibaba Cloud user ID of the file creator.

382762****

IsMaxCompute

boolean

If the current file is a MaxCompute resource file, this field indicates whether the resource file needs to be uploaded to MaxCompute.

This parameter needs to be configured only when the file is a MaxCompute resource file.

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 timestamp of the last file edit, in milliseconds.

1593950832000

Content

string

[Deprecated] This parameter is deprecated. You can call the GetFile operation to query file content.

SHOW TABLES;

NodeId

integer

The ID of the scheduling task generated in the scheduling system after the file is committed.

300001

AbsoluteFolderPath

string

The path of the folder where the file is stored.

Business_process/my_first_business_process/MaxCompute/ods_layer

樣本

正常返回樣本

JSON格式

{
  "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": "382762****",
        "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"
      }
    ]
  }
}

錯誤碼

HTTP status code

錯誤碼

錯誤資訊

描述

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.
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.

訪問錯誤中心查看更多錯誤碼。

變更歷史

更多資訊,參考變更詳情。