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.

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

The path of the files.

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 view the workspace ID.

You must specify one of the ProjectId and ProjectIdentifier parameters 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. You can specify a keyword to query all the files whose names contain the keyword.

RegionId String Yes cn-zhangjiakou

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

ProjectIdentifier String No dw_project

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

You must specify one of the ProjectId and ProjectIdentifier parameters 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 per page. Default value: 10. The number cannot exceed 100.

UseType String No NORMAL

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 DataStudio nodes.
  • ADHOCQUERY: The files are used for ad hoc queries.
  • COMPONENT: The files are used for snippets.
FileTypes String No 10,23

The types of the code in the files.

Examples: 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 internal 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 owner of the files.

NodeId Long No 123541234

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

Response parameters

Parameter Type Example Description
HttpStatusCode Integer 200

The HTTP status code.

ErrorMessage String The connection does not exist.

The error message returned.

RequestId String 0000-ABCD-EFG

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

ErrorCode String Invalid.Tenant.ConnectionNotExists

The error code returned.

Success Boolean true

Indicates whether the request is successful. Valid values:

  • true: The request is successful.
  • false: The request fails.
Data Object

The files returned.

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.

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. A value of 0 indicates that the latest code is not committed. A value of 1 indicates that the latest code is committed.

AutoParsing Boolean true

Indicates 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 Auto Parse parameter in the Dependencies section of the Properties panel 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 in the file. Examples: 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_first

The ID of the compute engine instance 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 DataStudio node.
  • 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 ID of the file.

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;

The code in the file.

NodeId Long 300001

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

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_first</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_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
    }
  }
}

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

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