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

ProjectId Long Yes 10000

The ID of the DataWorks workspace. You can click the Workspace Manage icon in the upper-right corner of the DataStudio page to go to the Workspace Management page and view the workspace ID.

RegionId String Yes cn-zhangjiakou

The region ID. For example, the ID of the China (Shanghai) region is cn-shanghai, and that of the China (Zhangjiakou) region is cn-zhangjiakou. The system automatically determines the value of this parameter based on the endpoint used to call the operation.

FileFolderPath String No Workflow/My first workflow/MaxCompute/ods

The directory in which the file is stored.

Keyword String No ods

The keyword in the file name. The keyword is used to perform a fuzzy match.

ProjectIdentifier String No dw_project

The unique identifier of the DataWorks workspace. You can click the unique identifier in the upper-left corner of the DataStudio page to switch to another workspace.

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

PageNumber Integer No 1

The number of the page to return.

PageSize Integer No 10

The number of entries to return on each page. Default value: 10. Maximum value: 100.

UseType String No 0

The functional module to which the file belongs. Valid values: NORMAL, MANUAL, MANUAL_BIZ, SKIP, ADHOCQUERY, and COMPONENT. The value SKIP indicates that the node corresponding to the file is run in dry-run mode.

FileTypes String No 10,23

The type of the code in the file. Valid values: 6 (Shell), 10 (MaxCompute SQL), 11 (MaxCompute MR), 23 (Data Integration), 24 (MaxCompute script), 99 (Virtual node), 221 (PyODPS 2), 225 (MaxCompute 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 node), 1091 (Hologres development), 1093 (Hologres SQL), 1100 (Assignment node), and 1221 (PyODPS 3).

Owner String No 3726346****

The owner of the file.

Response parameters

Parameter Type Example Description
Data Struct

The files returned.

Files Array of File

The details of the file.

BizId Long 300000

The ID of the workflow to which the file belongs.

CommitStatus Integer 1

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

ConnectionName String odps_first

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

Content String SHOW TABLES;

The code in the file.

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.

CreateUser String 382762****

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

CurrentVersion Integer 2

The latest version number of the file.

FileDescription String my test datastudio file

The description of the file.

FileFolderId String 2735c2****

The ID of the folder to which the file belongs.

FileId Long 10000001

The ID of the file.

FileName String ods_user_info_d

The name of the file.

FileType Integer 10

The type of the code in the file. Valid values: 6 (Shell), 10 (MaxCompute SQL), 11 (MaxCompute MR), 23 (Data Integration), 24 (MaxCompute script), 99 (Virtual node), 221 (PyODPS 2), 225 (MaxCompute 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 node), 1091 (Hologres development), 1093 (Hologres SQL), 1100 (Assignment node), and 1221 (PyODPS 3).

IsMaxCompute Boolean false

Indicates whether the MaxCompute resource file needs to be uploaded to MaxCompute.

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.

LastEditUser String 38748246285727

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

NodeId Long 300001

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

Owner String 3872572****

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

ParentId Long -1

The ID of the node group file to which the current file belongs.

UseType String 0

The functional module to which the file belongs. Valid values: NORMAL, MANUAL, MANUAL_BIZ, SKIP, ADHOCQUERY, and COMPONENT. The value SKIP indicates that the node corresponding to the file is run in dry-run mode.

PageNumber Integer 1

The page number of the returned page.

PageSize Integer 10

The number of entries returned per page.

TotalCount Integer 13

The total number of entries returned.

ErrorCode String Invalid.Tenant.ConnectionNotExists

The error code returned.

ErrorMessage String The connection does not exist.

The error message returned.

HttpStatusCode Integer 200

The HTTP status code returned.

RequestId String 0000-ABCD-EFG

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

Success Boolean true

Indicates whether the request is successful.

Examples

Sample requests

http(s)://[Endpoint]/?Action=ListFiles
&FileFolderPath=Workflow/My first workflow/MaxCompute/ods
&Keyword=ods
&ProjectId=10000
&RegionId=cn-zhangjiakou
&<Common request parameters>

Sample success responses

XML format

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

JSON format

{
    "RequestId": "0000-ABCD-EFG",
    "HttpStatusCode": 200,
    "Data": {
        "TotalCount": 13,
        "PageSize": 10,
        "PageNumber": 1,
        "Files": {
            "ParentId": -1,
            "Owner": "3872572****",
            "CreateTime": 1593950832000,
            "FileName": "ods_user_info_d",
            "UseType": 0,
            "CurrentVersion": 2,
            "CreateUser": "382762****",
            "IsMaxCompute": false,
            "ConnectionName": "odps_first",
            "LastEditTime": 1593950832000,
            "FileDescription": "my test datastudio file",
            "FileType": 10,
            "Content": "SHOW TABLES;",
            "LastEditUser": "387482****",
            "NodeId": 300001,
            "CommitStatus": 1,
            "FileFolderId": "2735c2****",
            "BizId": 300000
        }
    },
    "ErrorCode": "Invalid.Tenant.ConnectionNotExists",
    "ErrorMessage": "The connection does not exist.",
    "Success": true
}

Error codes

Http status code Error code Error message Description
500 InternalError.System An internal system error occurred. Try again later. The error message returned because an internal system error has occurred. Try again later.
500 InternalError.UserId.Missing An internal system error occurred. Try again later. The error message returned because an internal system error has occurred. Try again later.
429 Throttling.Api The request for this resource has exceeded your available limit. The error message returned because the number of requests for the resource has exceeded the upper limit.
429 Throttling.System The DataWorks system is busy. Try again later. The error message returned because the DataWorks system is busy. Try again later.
429 Throttling.User Your request is too frequent. Try again later. The error message returned because excessive requests have been submitted in a short period of time. Try again later.
403 Forbidden.Access Access is forbidden. Please first activate DataWorks Enterprise Edition or Flagship Edition. The error message returned because you are not authorized to perform this operation. Activate DataWorks Enterprise Edition or Ultimate Edition.

For a list of error codes, visit the API Error Center.