Updated on 2026-04-30 GMT+08:00

Creating a Pay-per-Use Instance

Function

This API is used to create a pay-per-use instance.

URI

POST /v2/{project_id}/instances

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Project ID. For details about how to obtain it, 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

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

Range

N/A

Default Value

N/A

description

No

String

Definition

Description of an instance.

Constraints

0–1024 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 type.

Constraints

N/A

Range

  • rocketmq: RocketMQ message engine.

  • reliability: RocketMQ message engine alias.

Default Value

N/A

engine_version

Yes

String

Definition

Version of the message engine.

Constraints

N/A

Range

  • 4.8.0

  • 5.x

Default Value

N/A

storage_space

Yes

Integer

Definition

Storage space, in GB.

Constraints

N/A

Range

Different instance specifications support different storage configurations.

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

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

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

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 Querying AZ Information.

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

During RocketMQ instance creation, brokers can be deployed in one AZ or three or more AZs. To specify AZs for brokers, separate AZs with commas (,).

Constraints

N/A

Range

N/A

Default Value

N/A

product_id

Yes

String

Definition

RocketMQ instance flavors.

Constraints

N/A

Range

  • c6.4u8g.cluster.small: Max. 2,000 topics and 2,000 consumer groups per broker

  • c6.4u8g.cluster: Max. 4,000 topics and 4,000 consumer groups per broker

  • c6.8u16g.cluster: Max. 8,000 topics and 8,000 consumer groups per broker

  • c6.12u24g.cluster: Max. 12,000 topics and 12,000 consumer groups per broker

  • c6.16u32g.cluster: Max. 16,000 topics and 16,000 consumer groups per broker

  • rocketmq.b1.large.1: RocketMQ 5.x basic edition single-node flavor, instance TPS 500

  • rocketmq.b2.large.4: RocketMQ 5.x basic edition cluster flavor, instance TPS 2,000

  • rocketmq.b2.large.8: RocketMQ 5.x basic edition cluster flavor, instance TPS 4,000

  • rocketmq.b2.large.12: RocketMQ 5.x basic edition cluster flavor, instance TPS 6,000

  • rocketmq.p1.large.1: RocketMQ 5.x professional edition single-node flavor, instance TPS 500

  • rocketmq.p2.large.8: RocketMQ 5.x professional edition cluster flavor, instance TPS 4,000

  • rocketmq.p2.large.12: RocketMQ 5.x professional edition cluster flavor, instance TPS 6,000

  • rocketmq.p2.large.20: RocketMQ 5.x professional edition cluster flavor, instance TPS 10,000

  • rocketmq.p2.large.40: RocketMQ 5.x professional edition cluster flavor, instance TPS 20,000

  • rocketmq.p2.large.100: RocketMQ 5.x professional edition cluster flavor, instance TPS 50,000

  • rocketmq.p2.large.150: RocketMQ 5.x professional edition cluster flavor, instance TPS 75,000

  • rocketmq.p2.large.200: RocketMQ 5.x professional edition cluster flavor, instance TPS 100,000

  • rocketmq.p2.large.300: RocketMQ 5.x professional edition cluster flavor, instance TPS 150,000

Default Value

N/A

ssl_enable

No

Boolean

Definition

Whether to enable SSL-encrypted access.

Constraints

N/A

Range

  • true: Yes

  • false: No

Default Value

false

storage_spec_code

Yes

String

Definition

Storage I/O flavor.

Constraints

N/A

Range

  • dms.physical.storage.high.v2: high I/O disk This value is not supported by RocketMQ 5.x professional edition.

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

Default Value

N/A

enterprise_project_id

No

String

Definition

Enterprise project ID. This parameter is mandatory for an enterprise project account.

Constraints

N/A

Range

N/A

Default Value

N/A

enable_acl

No

Boolean

Definition

Whether to enable access control.

Constraints

N/A

Range

  • true: Yes

  • false: No

Default Value

false

ipv6_enable

No

Boolean

Definition

Whether IPv6 is supported.

Constraints

N/A

Range

  • true: Yes

  • false: No

Default Value

false

proxy_enable

No

Boolean

Definition

Whether to enable the proxy function.

Constraints

N/A

Range

  • true: Yes

  • false: No

Default Value

N/A

enable_publicip

No

Boolean

Definition

Whether to enable public access. By default, public access is disabled.

Constraints

N/A

Range

  • true: Yes

  • false: No

Default Value

false

publicip_id

No

String

Definition

ID of the EIP bound to the 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).

Constraints

N/A

Range

N/A

Default Value

N/A

broker_num

Yes

Integer

Definition

Number of brokers. This field is mandatory for RocketMQ 4.8.0.

Constraints

N/A

Range

N/A

Default Value

N/A

tls_mode

No

String

Definition

Security protocol used by an instance.

Constraints

N/A

Range

N/A

Default Value

N/A

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

instance_id

String

Definition

Instance ID.

Constraints

N/A

Range

N/A

Default Value

N/A

Example Requests

Creating a pay-per-use instance

POST https://{endpoint}/v2/{project_id}/instances

{
  "name" : "reliability-1751840557",
  "description" : "",
  "engine" : "reliability",
  "engine_version" : "4.8.0",
  "storage_space" : 600,
  "vpc_id" : "3db8490c-4d6d-4d8f-8d3f-047b0de4c5cf",
  "subnet_id" : "0a0f1fcb-f019-458d-b9e5-301867394d50",
  "security_group_id" : "23c5977f-ff33-4b95-a73e-08d8a0bc4e6c",
  "available_zones" : [ "9f1c5806706d4c1fb0eb72f0a9b18c77" ],
  "product_id" : "c6.4u8g.cluster",
  "enterprise_project_id" : "0",
  "ssl_enable" : false,
  "storage_spec_code" : "dms.physical.storage.ultra.v2",
  "ipv6_enable" : false,
  "enable_publicip" : false,
  "publicip_id" : "",
  "broker_num" : 1
}

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.