数据湖探索 DLI-资源相关:查询所有资源包

时间:2024-07-05 17:23:48

查询所有资源包

DLI 提供查询资源列表接口,您可以使用该接口并选择相应的资源来执行作业。示例代码如下:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
def list_resources(dli_client):
    try:
        resources = dli_client.list_resources()
    except DliException as e:
        print(e)
        return

    for resources_info in resources.package_resources:
        print('Package resource name:' + resources_info.resource_name)

    for group_resource in resources.group_resources:
        print('Group resource name:' + group_resource.group_name)

完整样例代码和依赖包说明请参考:Python SDK概述

support.huaweicloud.com/sdkreference-dli/dli_04_0144.html