All Products
Search
Document Center

DataWorks:ListFiles

Last Updated:Apr 01, 2024

Queries a list of files.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter

Type

Required

Example

Description

Action

String

Yes

ListFiles

The operation that you want to perform.

FileFolderPath

String

No

Workflow/My first workflow/MaxCompute/ods

The path of the folder to which files belong.

ProjectId

Long

No

10000

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

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

Keyword

String

No

ods

The keyword in 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.

ProjectIdentifier

String

No

dw_project

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

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

PageNumber

Integer

No

1

The page number.

PageSize

Integer

No

10

The number of entries per page. Valid values: 1 to 100. Default value: 10.

UseType

String

No

NORMAL

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

FileTypes

String

No

10,23

The type of the code for the file.

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

Owner

String

No

3726346****

The file owner.

NodeId

Long

No

123541234

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

NeedContent

Boolean

No

false

Specifies whether to contain the file content in query results. A file that contains a large amount of data may lead to a long network transmission delay.

NeedAbsoluteFolderPath

Boolean

No

false

Specifies whether to contain the path of the folder to which the file belongs in query results.

ExactFileName

String

No

ods_create.sql

The exact file name. The name of the file in query results must be exactly the same as the value of this parameter.

FileIdIn

String

No

78237,816123

The list of file IDs. The set of file IDs in query results can only be a subset of the list that is specified by this parameter. You can specify up to 50 file IDs at a time.

Response parameters

Parameter

Type

Example

Description

HttpStatusCode

Integer

200

The HTTP status code.

ErrorMessage

String

The connection does not exist.

The error message.

RequestId

String

0000-ABCD-EFG

The request ID.

ErrorCode

String

Invalid.Tenant.ConnectionNotExists

The error code.

Success

Boolean

true

Indicates whether the request was successful. Valid values:

  • true

  • false

Data

Object

The files returned.

PageNumber

Integer

1

The page number.

PageSize

Integer

10

The number of entries per page.

TotalCount

Integer

13

The total number of entries returned.

Files

Array of File

The details of the files.

CommitStatus

Integer

1

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.

AutoParsing

Boolean

true

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

  • true

  • false

This parameter corresponds to the Automatic Parsing From Code Before Node Committing parameter that is displayed after you select Same Cycle in the Dependencies section of the Properties tab in the DataWorks console.

Owner

String

3872572****

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

CreateTime

Long

1593950832000

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.

FileType

Integer

10

The type of the code for 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).

CurrentVersion

Integer

2

The latest version number of the file.

BizId

Long

300000

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

LastEditUser

String

38748246285727

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

FileName

String

ods_user_info_d

The name of the file.

ConnectionName

String

odps_source

The name of the data source that is used to run the node that corresponds to the file.

UseType

String

NORMAL

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

FileFolderId

String

2735c2****

The ID of the folder to which the file belongs.

FileId

Long

10000001

The file ID.

ParentId

Long

-1

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.

CreateUser

String

382762****

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

IsMaxCompute

Boolean

false

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.

BusinessId

Long

300000

The ID of the workflow to which the file belongs.

FileDescription

String

my test datastudio file

The description of the file.

LastEditTime

Long

1593950832000

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.

Content

String

SHOW TABLES;

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

NodeId

Long

300001

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

AbsoluteFolderPath

String

Workflow/My first workflow/MaxCompute/ods

The path of the folder to which the file belongs.

Examples

Sample requests

http(s)://[Endpoint]/?Action=ListFiles
&FileFolderPath=Workflow/My first workflow/MaxCompute/ods
&ProjectId=10000
&Keyword=ods
&ProjectIdentifier=dw_project
&PageNumber=1
&PageSize=10
&UseType=NORMAL
&FileTypes=10,23
&Owner=3726346****
&NodeId=123541234
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<ListFilesResponse>
    <HttpStatusCode>200</HttpStatusCode>
    <ErrorMessage>The connection does not exist.</ErrorMessage>
    <RequestId>0000-ABCD-EFG</RequestId>
    <ErrorCode>Invalid.Tenant.ConnectionNotExists</ErrorCode>
    <Success>true</Success>
    <Data>
        <PageNumber>1</PageNumber>
        <PageSize>10</PageSize>
        <TotalCount>13</TotalCount>
        <Files>
            <CommitStatus>1</CommitStatus>
            <AutoParsing>true</AutoParsing>
            <Owner>3872572****</Owner>
            <CreateTime>1593950832000</CreateTime>
            <FileType>10</FileType>
            <CurrentVersion>2</CurrentVersion>
            <BizId>300000</BizId>
            <LastEditUser>38748246285727</LastEditUser>
            <FileName>ods_user_info_d</FileName>
            <ConnectionName>odps_source</ConnectionName>
            <UseType>NORMAL</UseType>
            <FileFolderId>2735c2****</FileFolderId>
            <FileId>10000001</FileId>
            <ParentId>-1</ParentId>
            <CreateUser>382762****</CreateUser>
            <IsMaxCompute>false</IsMaxCompute>
            <BusinessId>300000</BusinessId>
            <FileDescription>my test datastudio file</FileDescription>
            <LastEditTime>1593950832000</LastEditTime>
            <Content>SHOW TABLES;</Content>
            <NodeId>300001</NodeId>
        </Files>
    </Data>
</ListFilesResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "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_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
    }
  }
}

Error codes

HTTP status code

Error code

Error message

Description

429

Throttling.Api

The request for this resource has exceeded your available limit.

The number of requests for the resource has exceeded the upper limit.

429

Throttling.System

The DataWorks system is busy. Try again later.

The DataWorks system is busy. Try again later.

429

Throttling.User

Your request is too frequent. Try again later.

Excessive requests have been submitted within a short period of time. Try again later.

500

InternalError.System

An internal system error occurred. Try again later.

An internal error occurred. Try again later.

500

InternalError.UserId.Missing

An internal system error occurred. Try again later.

An internal error occurred. Try again later.

For a list of error codes, see Service error codes.