Updated on 2023-03-20 GMT+08:00

Creating a Queue

Scenario Description

This section describes how to create and query a queue using APIs.

Constraints

  • Queues created using this API will be bound to specified compute resources.
  • It takes 6 to 10 minutes to start a job using a new queue for the first time.

Involved APIs

Procedure

  1. Create a queue.
    • API

      URI format: POST /v1.0/{project_id}/queues

    • Request example
      • Description: Create an SQL queue named queue1 in the project whose ID is 48cc2c48765f481480c7db940d6409d1.
      • Example URL: POST https://{endpoint}/v1.0/48cc2c48765f481480c7db940d6409d1/queues
      • Body:
        {
            "queue_name": "queue1",
            "description": "test",
            "cu_count": 16,
            "resource_mode": 1,
            "queue_type": "sql"
        }
    • Example response
      {
        "is_success": true,
        "message": "",
        "queue_name": "queue1"
      }
  2. Verify that the queue is created successfully.
    • API

      URI format: GET /v1.0/{project_id}/queues/{queue_name}

    • Request example
      • Description: Query details about queue1 in the project whose ID is 48cc2c48765f481480c7db940d6409d1.
      • Example URL: GET https://{endpoint}/v1.0/48cc2c48765f481480c7db940d6409d1/queues/queue1
      • Body:
        {}
    • Example response
      {
          "is_success": true,
          "message": "",
          "owner": "testuser",
          "description": "",
          "queue_name": "queue1",
          "create_time": 1587613028851,
          "queue_type": "sql",
          "cu_count": 16,
          "resource_id": "03d51b88-db63-4611-b779-9a72ba0cf58b",
          "resource_mode": 0
      }