Updated on 2025-11-17 GMT+08:00

Allocating Queues to a Workspace

Function

This API is used to allocate queues to a specified workspace.

Calling Method

For details, see Calling APIs.

URI

POST /v1/{project_id}/security/permission/queue/assigned-source

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details about how to obtain the project ID, see Project ID and Account ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

workspace

Yes

String

Workspace ID. For details about how to obtain the workspace ID, see Instance ID and Workspace ID.

X-Auth-Token

Yes

String

IAM token, which is obtained by calling the IAM API for obtaining a user token (value of X-Subject-Token in the response header). This parameter is mandatory for token authentication.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

source_type

No

String

Queue type, which can only be mrs or dli.

queue_name

No

Array of strings

Queue name

conn_id

No

String

Data connection ID

cluster_id

No

String

Cluster ID

description

No

String

Description of the queue allocated to the current workspace

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

[items]

Array of QueueSrcAssignEntity objects

Queue

Table 5 QueueSrcAssignEntity

Parameter

Type

Description

id

String

Queue ID

source_type

String

Service providing queues

queue_name

String

Queue name

queue_type

String

Enumerates the queue types.

queue_attr

Integer

Queue attribute. Value 0 indicates the default queue, 1 indicates a real-time queue, and 2 indicates an offline queue. This parameter is available only for Yarn queues.

conn_id

String

Data connection ID

conn_name

String

Data connection name

cluster_id

String

Cluster ID

cluster_name

String

Cluster name.

create_time

Long

Time when the queue was added to the current workspace

create_user

String

User who added the queue to the current workspace

update_time

Long

Update time of the queues in the current workspace

update_user

String

User who updates the queues in the current workspace

project_id

String

Project ID

description

String

Description of the queue allocated to the current workspace

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Example Requests

/v1/0833a5737480d53b2f25c010dc1a7b88/security/permission/queue/assigned-source

{
  "source_type" : "mrs",
  "queue_name" : [ "root.dgc_test" ],
  "conn_id" : "8e2bd0e9aa24401ea1a8edf83cd50323",
  "cluster_id" : "ec26b187-626a-4e89-bd1f-6824fbcfb2b6",
  "description" : ""
}

Example Responses

Status code: 200

ok

[ {
  "cluster_id" : "ec26b187-626a-4e89-bd1f-6824fbcfb2b6",
  "cluster_name" : "mrs_noauth_autotest_do_not_del",
  "conn_id" : "8e2bd0e9aa24401ea1a8edf83cd50323",
  "conn_name" : "ranger_0324_noauth",
  "create_time" : 1712493119159,
  "create_user" : "ei_dayu_xxxx_01",
  "description" : "",
  "id" : "8c92991966c1456b9175f3c93a08ee4e",
  "project_id" : "0833a5737480d53b2f25c010dc1a7b88-workspace-f7bc8f2a71524d268c4293974e3dc35b",
  "queue_attr" : 0,
  "queue_name" : "root.dgc_test",
  "queue_type" : "yarn",
  "source_type" : "mrs",
  "update_time" : null,
  "update_user" : null
} ]

Status Codes

Status Code

Description

200

ok

400

Bad Request