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.

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/1/MaxCompute/ods

The directory in which the files are stored.

ProjectId Long No 10000

The ID of the DataWorks workspace. You can log on to the DataWorks console and go to the Workspace Management page to obtain the ID. You must specify either this parameter or ProjectIdentifier to determine the DataWorks workspace to which the operation is applied.

Keyword String No ods

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

ProjectIdentifier String No dw_project

The name of the DataWorks workspace. You can log on to the DataWorks console and go to the Workspace Settings panel to obtain the name. 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 NORMAL

The functional module to which the files belong. Valid values: NORMAL, MANUAL, MANUAL_BIZ, SKIP, ADHOCQUERY, and COMPONENT. The value SKIP indicates that the nodes corresponding to the files are run in dry-run mode.

FileTypes String No 10,23

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), 1089 (cross-tenant collaboration), 1091 (Hologres development), 1093 (Hologres SQL), 1100 (assignment), 1106 (for-each), and 1221 (PyODPS 3).

Owner String No 3726346****

The owner of the files.

Response parameters

Parameter Type Example Description
Data Struct

The files returned.

Files Array of File

The details of the files.

AutoParsing Boolean true

Indicates whether the automatic parsing feature is enabled for the file. This parameter corresponds to the Auto Parse parameter in the Dependencies section of the Properties tab in the DataWorks console.

BizId Long 300000

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

BusinessId Long 300000

The ID of the workflow to which the file belongs.

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.

ConnectionName String odps_first

The ID of the compute engine instance that is used to run the node corresponding 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 (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).

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.

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. This parameter is returned only if the current file is an inner file of the node group file.

UseType String NORMAL

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 use the ID to troubleshoot issues.

Success Boolean true

Indicates whether the request is successful.

Examples

Sample requests

http(s)://[Endpoint]/?Action=ListFiles
&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>
        <CurrentVersion>2</CurrentVersion>
        <UseType>NORMAL</UseType>
        <FileName>ods_user_info_d</FileName>
        <CreateTime>1593950832000</CreateTime>
        <CreateUser>382762****</CreateUser>
        <IsMaxCompute>false</IsMaxCompute>
        <ConnectionName>odps_first</ConnectionName>
        <LastEditTime>1593950832000</LastEditTime>
        <FileDescription>my test datastudio file</FileDescription>
        <FileType>10</FileType>
        <LastEditUser>38748246285727</LastEditUser>
        <Content>SHOW TABLES;</Content>
        <CommitStatus>1</CommitStatus>
        <NodeId>300001</NodeId>
        <FileId>10000001</FileId>
        <FileFolderId>2735c2****</FileFolderId>
        <BizId>300000</BizId>
        <BusinessId>300000</BusinessId>
    </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****",
            "CurrentVersion": 2,
            "UseType": "NORMAL",
            "FileName": "ods_user_info_d",
            "CreateTime": 1593950832000,
            "CreateUser": "382762****",
            "IsMaxCompute": false,
            "ConnectionName": "odps_first",
            "LastEditTime": 1593950832000,
            "FileDescription": "my test datastudio file",
            "FileType": 10,
            "LastEditUser": 38748246285727,
            "Content": "SHOW TABLES;",
            "CommitStatus": 1,
            "NodeId": 300001,
            "FileId": 10000001,
            "FileFolderId": "2735c2****",
            "BizId": 300000,
            "BusinessId": 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 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 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 within 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 allowed to perform this operation. Activate DataWorks Enterprise Edition or Ultimate Edition.

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