ListResources

Updated at:

Lists resource files with pagination and optional filters.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

dataworks:*

list

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

ProjectId

integer

Yes

The ID of the DataWorks workspace. You can log on to the DataWorks console and go to the Workspace Management page to obtain the workspace ID. This parameter specifies the DataWorks workspace for the API operation.

10002

Owner

string

No

The ID of the owner, which is the UID of the workspace administrator account. You can log on to the Alibaba Cloud Management Console and view the account UID in the Security Settings section of the Account Center.

110755000425XXXX

Type

string

No

The resource type used as a filter condition. Valid values:

  • Python

  • Jar

  • Archive

  • File

Valid values:

  • Archive :

    Archive

  • Jar :

    Jar

  • File :

    File

  • Python :

    Python

Python

Name

string

No

The name of the file resource. Fuzzy search is supported.

test

PageNumber

integer

No

The page number of the requested data.

1

PageSize

integer

No

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

10

Response elements

Element

Type

Description

Example

object

Schema of Response

RequestId

string

The unique ID of the request. You can use the ID to troubleshoot issues if an error occurs.

99EBE7CF-69C0-5089-BE3E-79563C31XXXX

PagingInfo

object

The pagination information.

TotalCount

integer

The total number of entries that meet the conditions.

131

PageSize

integer

The number of entries per page.

10

PageNumber

integer

The page number of the requested data.

1

Resources

array<object>

The list of resources returned by the query.

array<object>

A file resource in the list.

Name

string

The name of the resource.

math.py

ProjectId

integer

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

344247

Owner

string

The owner of the file resource.

110755000425XXXX

CreateTime

integer

The timestamp when the file resource was created.

1724505917000

ModifyTime

integer

The timestamp when the file resource was last modified.

1724505917000

DataSource

object

The data source.

Name

string

The name of the data source.

odps_first

Type

string

The type of the data source.

odps

Script

object

The script information.

Path

string

The path of the script.

root/demo

Runtime

object

The runtime.

Command

string

The command, which indicates the file type.

ODPS_PYTHON

Id

string

The ID of the script.

Important The data type of this field is Long in SDK versions earlier than 8.0.0, and String in SDK 8.0.0 and later. This change does not affect the normal use of the SDK. The SDK returns this field in the type defined by that version. However, if you upgrade the SDK across version 8.0.0, the data type change may cause project compilation failures. In this case, you must manually correct the data type.

123348864897630XXXX

Type

string

The type of the resource. Valid values:

  • Python

  • Jar

  • Archive

  • File

Valid values:

  • python :

    Python file.

  • Archive :

    Archive

  • file :

    Regular file.

  • Jar :

    Jar

  • archive :

    Archive file.

  • jar :

    JAR package.

  • File :

    File

  • Python :

    Python

jar

SourceType

string

The source storage type of the file resource. Valid values:

  • Local: local storage.

  • Oss: Object Storage Service (OSS).

Valid values:

  • local :

    Local.

  • oss :

    OSS.

local

SourcePath

string

The source path of the file resource. This parameter is empty when the type is local.

XXX/unknown/ide/1/XXX/20240820200851_963a9da676de44ef8d06a6576a8c4d6a.py

TargetType

string

The target file storage type. Valid values:

  • Gateway: gateway.

  • Oss: Object Storage Service.

  • Hdfs: Hadoop Distributed File System (HDFS).

Valid values:

  • hdfs :

    HDFS.

  • gateway :

    Gateway.

  • oss :

    OSS.

oss

TargetPath

string

The target storage path of the file resource.

XXX/unknown/ide/1/XXX/20240820200851_963a9da676de44ef8d06a6576a8c4d6a.py

Id

string

The unique identifier of the file resource.

Important The data type of this field is Long in SDK versions earlier than 8.0.0, and String in SDK 8.0.0 and later. This change does not affect the normal use of the SDK. The SDK returns this field in the type defined by that version. However, if you upgrade the SDK across version 8.0.0, the data type change may cause project compilation failures. In this case, you must manually correct the data type.

631478864897630XXXX

Examples

Success response

JSON format

{
  "RequestId": "99EBE7CF-69C0-5089-BE3E-79563C31XXXX",
  "PagingInfo": {
    "TotalCount": 131,
    "PageSize": 10,
    "PageNumber": 1,
    "Resources": [
      {
        "Name": "math.py",
        "ProjectId": 344247,
        "Owner": "110755000425XXXX",
        "CreateTime": 1724505917000,
        "ModifyTime": 1724505917000,
        "DataSource": {
          "Name": "odps_first",
          "Type": "odps"
        },
        "Script": {
          "Path": "root/demo",
          "Runtime": {
            "Command": "ODPS_PYTHON"
          },
          "Id": "123348864897630XXXX"
        },
        "Type": "jar",
        "SourceType": "local",
        "SourcePath": "XXX/unknown/ide/1/XXX/20240820200851_963a9da676de44ef8d06a6576a8c4d6a.py",
        "TargetType": "oss",
        "TargetPath": "XXX/unknown/ide/1/XXX/20240820200851_963a9da676de44ef8d06a6576a8c4d6a.py",
        "Id": "631478864897630XXXX"
      }
    ]
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.