Updated on 2025-06-20 GMT+08:00

Creating an Instance

Function

This API is used to create an instance.

Call Method

For details, see How to Call an API.

URI

POST /v1.0/{project_id}/instances

Table 1 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

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

Request Parameters

None

Response Parameters

Status code: 200

Table 2 Response body parameter

Parameter

Type

Description

name

String

Instance name.

An instance name starts with a letter, consists of 4 to 64 characters, and can contain only letters, digits, underscores (_), and hyphens (-).

description

String

Description of an instance.

The description supports up to 1024 characters.

NOTE:

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 \".

engine

String

Message engine. Value: reliability

engine_version

String

Version of the message engine. Value: 4.8.0

storage_space

Integer

Storage space.

vpc_id

String

VPC ID.

To obtain it, log in to the VPC console and view the VPC ID on the VPC details page.

subnet_id

String

Subnet information.

To obtain it, log in to VPC console and click the target subnet on the Subnets page. You can view the network ID on the displayed page.

security_group_id

String

Security group which the instance belongs to.

To obtain it, log in to the VPC console and view the security group ID on the security group details page.

available_zones

Array of strings

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

The parameter value cannot be empty or null. Check whether resources exist in the AZs.

A RocketMQ instance can be deployed in 1 AZ or at least 3 AZs. When specifying AZs for brokers, use commas (,) to separate multiple AZs.

product_id

String

RocketMQ instance flavors.

  • c6.4u8g.cluster.small: maximum number of topics on each broker: 2,000; maximum number of consumer groups on each broker: 2,000

  • c6.4u8g.cluster: maximum number of topics on each broker: 4,000; maximum number of consumer groups on each broker: 4,000

  • c6.8u16g.cluster: maximum number of topics on each broker: 8,000; maximum number of consumer groups on each broker: 8,000

  • c6.12u24g.cluster: maximum number of topics on each broker: 12,000; maximum number of consumer groups on each broker: 12,000

  • c6.16u32g.cluster: maximum number of topics on each broker: 16,000; maximum number of consumer groups on each broker: 16,000

ssl_enable

Boolean

Indicates whether to enable SSL-encrypted access.

  • true: enable

  • false: disable

storage_spec_code

String

Storage I/O specification.

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

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

enterprise_project_id

String

Indicates the enterprise project ID. This parameter is mandatory for an enterprise project account.

enable_acl

Boolean

Whether access control is enabled.

ipv6_enable

Boolean

Whether IPv6 is supported.

  • true: yes

  • false: no

enable_publicip

Boolean

Indicates whether to enable public access. By default, public access is disabled.

  • true: enable

  • false: disable

publicip_id

String

ID of the elastic IP address (EIP) bound to an instance.

Use commas (,) to separate multiple EIP IDs.

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

broker_num

Integer

Number of brokers.

bss_param

BssParam object

Parameter related to the yearly/monthly billing mode.

If this parameter is left blank, the billing mode is pay-per-use by default. If this parameter is not left blank, the billing mode is yearly/monthly.

Table 3 BssParam

Parameter

Type

Description

is_auto_renew

Boolean

Indicates whether auto-renewal is enabled.

Value range:

  • true: Yes

  • false: No

By default, auto renewal is disabled.

charging_mode

String

Billing mode.

This parameter specifies a payment mode.

Value range:

  • prePaid: yearly/monthly

  • postPaid: pay-per-use

The default value is postPaid.

is_auto_pay

Boolean

Specifies whether the order is automatically or manually paid.

Value range:

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

  • false: No. The order needs to be paid manually.

The default value is false.

period_type

String

Subscription period

Value range:

  • month

  • year

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

period_num

Integer

Number of subscription periods.

Value range:

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

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

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

Example Requests

POST https://{endpoint}/v1.0/dms/{project_id}/instances

Example Response

Status code: 200

Successfully created.

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

Status Code

Status Code

Description

200

Successful

Error Codes

See Error Codes.