Updated on 2024-03-06 GMT+08:00

Queue-Related SDKs

Constraints

Jobs created using the SDK cannot run on the default queue.

Querying All Queues

You can use the API provided by DLI to query the queue list and select the corresponding queue to execute the job. Sample code is as follows:

1
2
3
4
5
6
7
8
9
def list_all_queues(dli_client):
    try:        
       queues = dli_client.list_queues()
    except DliException as e:
        print(e)
        return

    for queue in queues:
        print(queue.name)

For details about the dependencies and complete sample code, see Overview.