Creating a Queue
Function
This API is used to create a queue. The queue will be bound to specified compute resources.
It takes 5 to 15 minutes to start a job using a new queue for the first time.
Authorization
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see the required permissions in Introduction.
- If you are using identity policy-based authorization, the following identity policy-based permissions are required.
Action
Access Level
Resource Type (*: required)
Condition Key
Alias
Dependency
dli:queue:create
Write
queue *
-
-
-
-
-
-
URI
- URI format
- Parameter description
Table 1 URI parameter Parameter
Mandatory
Type
Description
project_id
Yes
String
Definition
Project ID, which is used for resource isolation. For details about how to obtain its value, see Obtaining a Project ID.
Example: 48cc2c48765f481480c7db940d6409d1
Constraints
N/A
Range
The value can contain up to 64 characters. Only letters and digits are allowed.
Default Value
N/A
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| queue_name | Yes | String | Name of the new queue. Definition Name of the new queue. Constraints
Range N/A Default Value N/A |
| queue_type | No | String | Definition Queue type. Constraints If unset, the default value sql is used. Range
Default Value sql |
| description | No | String | Definition Queue description. Constraints N/A Range N/A Default Value N/A |
| cu_count | Yes | Integer | Definition Minimum number of CUs bound to a queue. Constraints N/A Range The options are 16, 64, and 256. Default Value N/A |
| charging_mode | No | Integer | Definition Billing mode of a queue. Constraints N/A Range The value can only be 1, indicating that the billing is based on the CUH. Default Value N/A |
| enterprise_project_id | No | String | Definition Enterprise project ID. The value 0 indicates the default enterprise project. Constraints Only users who have enabled Enterprise Management can set this parameter to bind a specified project. Range N/A Default Value N/A |
| platform | No | String | Definition CPU architecture of queue compute resources. Constraints N/A Range
Default Value x86_64 |
| resource_mode | No | Integer | Definition Queue resource mode. Constraints N/A Range 0: shared resource mode. 1: dedicated resource mode. Default Value N/A |
| labels | No | Array of strings | Definition Queue labels. Constraints N/A Range N/A Default Value N/A |
| feature | No | String | Definition Type of images used by the queue. Constraints N/A Range
Default Value The default value is basic. |
| tags | No | Array of objects | Definition Queue tags for identifying cloud resources. A tag consists of a key and tag value. For details, see Table 3. Constraints N/A Range N/A Default Value N/A |
| elastic_resource_pool_name | No | String | Definition Name of the elastic resource pool the new queue belongs to. Constraints Only digits, lowercase letters, and underscores (_) are allowed. The value must not contain only digits or start with an underscore (_). The value can contain up to 128 characters. To add a queue to an elastic resource pool, set resource_mode to dedicated. Otherwise, this parameter does not take effect. Range N/A Default Value N/A |
| engine | No | String | Definition Engine type of the queue. Constraints This parameter is available only when queue_type is set to sql. Range You can choose the Spark engine, configured as spark. For details about the engine types and descriptions, see DLI Overview. Default Value The default value is spark. |
| properties | No | Object | Definition Queue properties. For details, see Table 4. Constraints Currently, Spark Native attributes can be set only in the following regions:
Range For details, see Table 4. Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| Key | Yes | String | Definition Tag key. Constraints N/A Range A tag key can contain up to 128 characters, cannot start or end with a space, and cannot start with _sys_. Only letters, digits, spaces, and the following special characters are allowed: _.:+-@ Default Value N/A |
| value | Yes | String | Definition Tag value. Constraints N/A Range A tag value can contain a maximum of 255 characters. Only letters, digits, spaces, and the following special characters (_.:+-@) are allowed. Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| computeEngine.spark.nativeEnabled | No | String | Definition Spark Native is a core component of Apache Spark designed to enhance the performance of Spark SQL computations. By utilizing vectorized C++ acceleration libraries, it accelerates the performance of Spark operators. Enables the Spark Native engine to improve Spark SQL job performance and reduce CPU and memory usage. Whether to enable Spark Native for a queue. This function can be currently enabled for Scan and Filter operators. Constraints Modifying the properties of an existing queue requires a restart for the changes to take effect. Range Currently, Spark Native can be enabled only for Scan and Filter operators.
Default Value N/A |
Response Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| is_success | No | Boolean | Definition Whether the request is successfully executed. true indicates that the request is successfully executed. Range N/A |
| message | No | String | Definition System prompt. If the execution succeeds, this parameter may be left blank. Range N/A |
| queue_name | No | String | Definition Name of the created queue. The queue name is case-insensitive. Uppercase letters will be automatically converted to lowercase letters. Range N/A |
Example Request
Create a dedicated general-purpose queue named queue1, with specifications of 16 CUs and compute resources distributed in two AZs.
{
"queue_name": "queue1",
"description": "test",
"cu_count": 16,
"resource_mode": 1,
"enterprise_project_id": "0",
"queue_type": "general",
"labels": ["multi_az=2"]
} Creating a queue in a specified elastic resource pool
{
"queue_name": "queue2",
"description": "test_esp",
"cu_count": 16,
"resource_mode": 1,
"enterprise_project_id": "0",
"queue_type": "general",
"labels": ["multi_az=2"],
"elastic_resource_pool_name": "elastic_pool_0622_10"
} Example Response
{
"is_success": true,
"message": "",
"queue_name": "queue1"
} Status Codes
Table 6 describes status codes.
Error Codes
If an error occurs when this API is called, the system does not return the result similar to the preceding example, but returns an error code and error message. For details, see Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot