All Products
Search
Document Center

DataWorks:ListResources

Last Updated:Jun 11, 2026

Mengkueri daftar Sumber daya file di DataStudio. Anda juga dapat menentukan kondisi filter untuk mengkueri Sumber daya file tertentu.

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tabel berikut menjelaskan otorisasi yang diperlukan untuk memanggil API ini. Anda dapat menentukannya dalam kebijakan Resource Access Management (RAM). Kolom pada tabel dijelaskan sebagai berikut:

  • Action: Aksi yang dapat digunakan dalam elemen Action pada pernyataan kebijakan izin RAM untuk memberikan izin guna melakukan operasi tersebut.

  • API: API yang dapat Anda panggil untuk melakukan aksi tersebut.

  • Access level: Tingkat akses yang telah ditentukan untuk setiap API. Nilai yang valid: create, list, get, update, dan delete.

  • Resource type: Jenis resource yang mendukung otorisasi untuk melakukan aksi tersebut. Ini menunjukkan apakah aksi tersebut mendukung izin tingkat resource. Resource yang ditentukan harus kompatibel dengan aksi tersebut. Jika tidak, kebijakan tersebut tidak akan berlaku.

    • Untuk API dengan izin tingkat resource, jenis resource yang diperlukan ditandai dengan tanda bintang (*). Tentukan Nama Sumber Daya Alibaba Cloud (ARN) yang sesuai dalam elemen Resource pada kebijakan.

    • Untuk API tanpa izin tingkat resource, ditampilkan sebagai All Resources. Gunakan tanda bintang (*) dalam elemen Resource pada kebijakan.

  • Condition key: Kunci kondisi yang didefinisikan oleh layanan. Kunci ini memungkinkan kontrol granular, berlaku baik hanya untuk aksi maupun untuk aksi yang terkait dengan resource tertentu. Selain kunci kondisi spesifik layanan, Alibaba Cloud menyediakan serangkaian common condition keys yang berlaku di semua layanan yang didukung RAM.

  • Dependent action: Aksi dependen yang diperlukan untuk menjalankan aksi tersebut. Untuk menyelesaikan aksi tersebut, pengguna RAM atau role RAM harus memiliki izin untuk melakukan semua aksi dependen.

Action

Access level

Resource type

Condition key

Dependent action

dataworks:*

list

*全部资源

*

None None

Parameter permintaan

Parameter

Type

Required

Description

Example

ProjectId

integer

Yes

ID ruang kerja DataWorks. Anda dapat masuk ke Konsol DataWorks dan membuka halaman Workspace untuk mengkueri ID tersebut.

Anda harus mengonfigurasi parameter ini untuk menentukan ruang kerja DataWorks tempat operasi API diterapkan.

10002

Owner

string

No

ID akun Alibaba Cloud yang digunakan oleh administrator ruang kerja. Anda dapat log ke Konsol Manajemen Alibaba Cloud dan Tampilan ID pada halaman Pengaturan Keamanan.

110755000425XXXX

Type

string

No

Tipe Sumber daya. Parameter ini menentukan kondisi filter.

Nilai valid:

  • Python

  • Jar

  • Archive

  • File.

Valid values:

  • Archive :

    Archive.

  • Jar :

    Jar.

  • File :

    File.

  • Python :

    Python.

Python

Name

string

No

Nama Sumber daya file. Mendukung pencarian fuzzy.

test

PageNumber

integer

No

Nomor halaman data yang akan diambil, digunakan untuk paginasi.

1

PageSize

integer

No

Nomor halaman data yang akan diambil, digunakan untuk paginasi.

10

Elemen respons

Element

Type

Description

Example

object

Schema of Response

RequestId

string

The request ID.

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

PagingInfo

object

The pagination information.

TotalCount

integer

The total number of entries returned.

131

PageSize

integer

The number of entries per page.

10

PageNumber

integer

The page number.

1

Resources

array<object>

The returned resource list.

array<object>

The elements in the resource list.

Name

string

The resource name.

math.py

ProjectId

integer

The ID of the DataWorks workspace. To obtain the workspace ID, log on to the DataWorks console and navigate to the workspace configuration page.

344247

Owner

string

The owner of the file resource.

110755000425XXXX

CreateTime

integer

The time when the file resource was created. This value is a UNIX timestamp.

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

root/demo

Runtime

object

Runtime

Command

string

Command. This parameter indicates the file type.

ODPS_PYTHON

Id

string

The ID of the script.

Catatan

This field is of type Long in SDK versions prior to 8.0.0, and of type String in SDK version 8.0.0 and later. This change does not affect the normal use of the SDK. The parameter is returned based on the type defined in the SDK. Compilation failures caused by the type change may occur only when you upgrade the SDK across version 8.0.0. In this case, you must manually update the data type.

123348864897630XXXX

Type

string

The resource type.

Valid values:

  • Python

  • Jar

  • Archive

  • File

Valid values:

  • Archive :

    Archive

  • Jar :

    Jar

  • File :

    File

  • Python :

    Python

Jar

SourceType

string

The source storage type of the file resource.

Valid values:

  • Local

  • OSS

Valid values:

  • Local :

    Local

  • Oss :

    Oss

Local

SourcePath

string

Source path of the file resource. This parameter is empty if the type is Local.

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

TargetType

string

The destination storage type.

Valid values:

  • Gateway

  • OSS

  • HDFS

Valid values:

  • Gateway :

    Gateway

  • Hdfs :

    Hdfs

  • Oss :

    Oss

Oss

TargetPath

string

The destination storage path.

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

Id

string

The unique identifier of the file resource.

Catatan

Prior to SDK version 8.0.0, this field is of type Long. In SDK version 8.0.0 and later, it is of type String. This change does not affect the normal use of the SDK. The parameter is returned based on the type defined in the SDK. Compilation failures caused by the type change may occur only when you upgrade the SDK across version 8.0.0. In this case, you must manually update the data type.

631478864897630XXXX

Contoh

Respons sukses

JSONformat

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

Kode kesalahan

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.