Updated on 2025-09-03 GMT+08:00

Creating an Instance

Function

This API is used to create an instance in the pay-per-use mode.

URI

POST /v2/{engine}/{project_id}/instances

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

engine

Yes

String

Definition:

Message engine.

Constraints:

N/A

Range:

rabbitmq: RabbitMQ engine.

Default Value:

N/A

project_id

Yes

String

Definition

Project ID. For details, see Obtaining a Project ID.

Constraints

N/A

Range

N/A

Default Value

N/A

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

name

Yes

String

Definition:

Instance name.

Constraints:

A username must start with a letter. It can contain 4 to 64 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed.

Range:

N/A

Default Value:

N/A

description

No

String

Definition:

Description of an instance.

Constraints:

0–1,024 characters

The backslash () and quotation mark (") are special characters for JSON messages. When using these characters in a parameter value, add the escape character () before the characters, for example, \\ and \".

Range:

N/A

Default Value:

N/A

engine

Yes

String

Definition:

Message engine.

Constraints:

N/A

Range:

rabbitmq: RabbitMQ engine.

Default Value:

N/A

engine_version

Yes

String

Definition:

Message engine version.

Constraints:

N/A

Range:

  • 3.8.35

  • 3.7.17

Default Value:

N/A

enable_acl

No

Boolean

Definition:

ACL

Constraints:

Available only for the AMQP version.

Range:

  • true: enabled.

  • false: disabled.

Default Value:

N/A

storage_space

Yes

Integer

Definition

Message storage space, in GB.

Constraints

N/A

Range

  • Single-node instance: 100 GB to 30,000 GB

  • Cluster instance: 100 GB × Number of nodes to 30,000 GB × Number of nodes

Default Value

N/A

access_user

No

String

Definition:

Authentication username.

Constraints:

Starts with a letter, consists of 4 to 64 characters, and contains only letters, digits, hyphens (-), and underscores (_). This parameter is mandatory when ssl_enable is set to true. This parameter is invalid when ssl_enable is set to false.

Range:

N/A

Default Value:

N/A

password

No

String

Definition:

Instance password.

Constraints:

  • Can contain 8 to 32 characters.

  • Must contain at least three of the following character types:

    • Lowercase letters

    • Uppercase letters

    • Digits

    • Special characters include (`~!@#$ %^&*()-_=+|[{}]:'",<.>/?) and spaces, and cannot start with a hyphen (-).

  • This parameter is mandatory when ssl_enable is set to true. This parameter is invalid when ssl_enable is set to false.

Range:

N/A

Default Value:

N/A

vpc_id

Yes

String

Definition:

VPC ID. You can call the API for querying VPCs to obtain the VPC ID. The VPC ID is in the response body. For details, see Virtual Private Cloud API Reference.

Constraints:

N/A

Range:

N/A

Default Value:

N/A

security_group_id

Yes

String

Definition:

Security group to which the instance belongs. You can call the API for querying security groups to obtain the security group ID. The security group ID is in the response body. For details, see Virtual Private Cloud API Reference.

Constraints:

N/A

Range:

N/A

Default Value:

N/A

subnet_id

Yes

String

Definition:

Subnet information. You can call the API for querying subnets to obtain the subnet ID. The subnet ID is in the response body. For details, see Virtual Private Cloud API Reference.

Constraints:

N/A

Range:

N/A

Default Value:

N/A

available_zones

Yes

Array of strings

Definition:

ID of the AZ where instance brokers reside and which has available resources. Obtain the AZ ID by referring to Listing AZ Information.

Constraints:

This parameter cannot be empty or null.

A RabbitMQ instance should be deployed in 1 AZ or at least 3 AZs. If the instance is deployed in multiple AZs, separate the AZ IDs with commas (,).

product_id

Yes

String

Definition:

Product ID. Obtain the product ID from Querying Product Specifications List.

Constraints:

N/A

Range:

N/A

Default Value:

N/A

broker_num

No

Integer

Definition:

Number of brokers.

Constraints:

If the product is of the single-node type, there can be only 1 broker. If the product is of the cluster type, there can be 3, 5, or 7 brokers.

Range:

  • 1

  • 3

  • 5

  • 7

Default Value:

N/A

maintain_begin

No

String

Definition:

Start time of the maintenance time window.

Constraints:

The value is in HH:mm format.

Range:

N/A

Default Value:

N/A

maintain_end

No

String

Definition:

End time of the maintenance time window.

Constraints:

The value is in HH:mm format.

Range:

N/A

Default Value:

N/A

enable_publicip

No

Boolean

Definition:

Whether to enable public access.

Constraints:

N/A

Range:

  • true: Yes

  • false: No

Default Value:

false

publicip_id

No

String

Definition:

ID of the EIP bound to the instance.

Constraints:

Use commas (,) to separate multiple EIP IDs.

This parameter is mandatory if public access is enabled (that is, enable_publicip is set to true).

Range:

N/A

Default Value:

N/A

ssl_enable

No

Boolean

Definition:

Whether to enable SSL.

Constraints:

N/A

Range:

  • true: Yes

  • false: No

Default Value:

N/A

storage_spec_code

Yes

String

Definition

Storage I/O specification.

Constraints

N/A

Range

  • dms.physical.storage.high.v2: high I/O EVS

  • dms.physical.storage.ultra.v2: ultra-high I/O EVS

Default Value

N/A

enterprise_project_id

No

String

Definition:

Enterprise project ID.

Constraints:

This parameter is mandatory for an enterprise project account.

Range:

N/A

Default Value:

N/A

tags

No

Array of TagEntity objects

Definition:

Tag list.

Constraints:

A maximum of 20 tags can be added to a RabbitMQ instance.

bss_param

No

BssParam object

Definition:

Parameter related to the yearly/monthly billing mode.

Constraints:

N/A

Table 3 TagEntity

Parameter

Mandatory

Type

Description

key

No

String

Parameter description:

Tag key.

Value range:

N/A

value

No

String

Parameter description:

Tag value.

Value range:

N/A

Table 4 BssParam

Parameter

Mandatory

Type

Description

is_auto_renew

No

Boolean

Definition:

Indicates whether auto-renewal is enabled.

Constraints:

N/A

Range:

  • true: Subscriptions will be automatically renewed.

  • false: Subscriptions will not be automatically renewed.

Default Value:

false

charging_mode

No

String

Definition:

Billing mode.

Constraints:

N/A

Range:

  • prePaid: indicates the yearly/monthly billing mode.

  • postPaid: pay-per-use billing.

Default Value:

postPaid

is_auto_pay

No

Boolean

Definition:

Whether the order is automatically or manually paid.

Constraints:

N/A

Range:

  • true: yes. The order will be automatically paid.

  • false: The order must be manually paid.

Default Value:

false

period_type

No

String

Definition:

Subscription period type.

Constraints:

This parameter is valid and mandatory only when chargingMode is set to prePaid.

Range:

  • month: monthly subscription

  • year: yearly subscription

Default Value:

N/A

period_num

No

Integer

Definition:

Number of subscription periods.

Constraints:

This parameter is valid and mandatory only when chargingMode is set to prePaid.

Range:

  • If periodType is month, the value ranges from 1 to 9.

  • If periodType is year, the value ranges from 1 to 3.

Default Value:

N/A

Response Parameters

Status code: 200

Table 5 Response body parameters

Parameter

Type

Description

instance_id

String

Definition:

Instance ID.

Range:

N/A

Example Requests

  • Creating a pay-per-use RabbitMQ instance whose version is 3.8.35, specifications are 2 vCPUs | 4 GB x 1, and storage space is 100 GB

    POST https://{endpoint}/v2/{engine}/{project_id}/instances
    
    {
      "name" : "rabbitmq-demo",
      "description" : "",
      "engine" : "RabbitMQ",
      "engine_version" : "3.8.35",
      "storage_space" : 100,
      "access_user" : "******",
      "password" : "******",
      "vpc_id" : "1e93f86e-13af-46c8-97d6-d40fa62b76c2",
      "security_group_id" : "0aaa0033-bf7f-4c41-a6c2-18cd04cad2c8",
      "subnet_id" : "b5fa806c-35e7-4299-b659-b39398dd4718",
      "available_zones" : [ "d573142f24894ef3bd3664de068b44b0" ],
      "product_id" : "c6.2u4g.single",
      "ssl_enable" : false,
      "enable_publicip" : false,
      "publicip_id" : "",
      "storage_spec_code" : "dms.physical.storage.high.v2"
    }
  • Creating a yearly/monthly RabbitMQ instance whose version is 3.8.35, specifications are 2 vCPUs | 4 GB x 1, and storage space is 100 GB

    POST https://{endpoint}/v2/{engine}/{project_id}/instances
    
    {
      "name" : "rabbitmq-demo",
      "description" : "",
      "engine" : "RabbitMQ",
      "engine_version" : "3.8.35",
      "storage_space" : 100,
      "access_user" : "******",
      "password" : "******",
      "vpc_id" : "1e93f86e-13af-46c8-97d6-d40fa62b76c2",
      "security_group_id" : "0aaa0033-bf7f-4c41-a6c2-18cd04cad2c8",
      "subnet_id" : "b5fa806c-35e7-4299-b659-b39398dd4718",
      "available_zones" : [ "d573142f24894ef3bd3664de068b44b0" ],
      "product_id" : "c6.2u4g.single",
      "ssl_enable" : false,
      "enable_publicip" : false,
      "publicip_id" : "",
      "storage_spec_code" : "dms.physical.storage.high.v2",
      "bss_param" : {
        "charging_mode" : "prePaid",
        "period_type" : "month",
        "period_num" : 1,
        "is_auto_pay" : true
      }
    }

Example Responses

Status code: 200

Instance created successfully.

{
  "instance_id" : "8959ab1c-7n1a-yyb1-a05t-93dfc361b32d"
}

Status Codes

Status Code

Description

200

Instance created successfully.

Error Codes

See Error Codes.