All Products
Search
Document Center

ApsaraMQ for RocketMQ:CreateInstance

Last Updated:Jun 10, 2026

Membuat instans ApsaraMQ for RocketMQ 5.x.

Deskripsi operasi

Penting

Alibaba Cloud's OpenAPI is a management API for managing and querying your resources. It is intended for integration with the management plane only. To prevent instability, do not use OpenAPI for message transport in core data links.

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tabel berikut menjelaskan otorisasi yang diperlukan untuk memanggil API ini. Anda dapat menentukannya dalam kebijakan Resource Access Management (RAM). Kolom pada tabel dijelaskan sebagai berikut:

  • Action: Aksi yang dapat digunakan dalam elemen Action pada pernyataan kebijakan izin RAM untuk memberikan izin guna melakukan operasi tersebut.

  • API: API yang dapat Anda panggil untuk melakukan aksi tersebut.

  • Access level: Tingkat akses yang telah ditentukan untuk setiap API. Nilai yang valid: create, list, get, update, dan delete.

  • Resource type: Jenis resource yang mendukung otorisasi untuk melakukan aksi tersebut. Ini menunjukkan apakah aksi tersebut mendukung izin tingkat resource. Resource yang ditentukan harus kompatibel dengan aksi tersebut. Jika tidak, kebijakan tersebut tidak akan berlaku.

    • Untuk API dengan izin tingkat resource, jenis resource yang diperlukan ditandai dengan tanda bintang (*). Tentukan Nama Sumber Daya Alibaba Cloud (ARN) yang sesuai dalam elemen Resource pada kebijakan.

    • Untuk API tanpa izin tingkat resource, ditampilkan sebagai All Resources. Gunakan tanda bintang (*) dalam elemen Resource pada kebijakan.

  • Condition key: Kunci kondisi yang didefinisikan oleh layanan. Kunci ini memungkinkan kontrol granular, berlaku baik hanya untuk aksi maupun untuk aksi yang terkait dengan resource tertentu. Selain kunci kondisi spesifik layanan, Alibaba Cloud menyediakan serangkaian common condition keys yang berlaku di semua layanan yang didukung RAM.

  • Dependent action: Aksi dependen yang diperlukan untuk menjalankan aksi tersebut. Untuk menyelesaikan aksi tersebut, pengguna RAM atau role RAM harus memiliki izin untuk melakukan semua aksi dependen.

Action

Access level

Resource type

Condition key

Dependent action

rocketmq:CreateInstance

create

*Instance

acs:rocketmq:{#regionId}:{#accountId}:Instance/*

None None

Sintaks permintaan

POST /instances HTTP/1.1

Parameter permintaan

Parameter

Type

Required

Description

Example

clientToken

string

No

Token yang dihasilkan klien untuk memastikan idempotensi permintaan. Token harus unik untuk setiap permintaan dan dapat berisi hingga 64 karakter ASCII.

c2c5d1274a8d4317a13bc5b0d4******

body

object

No

Badan permintaan.

instanceName

string

No

The name of the instance. If you do not specify this parameter, the instance ID is used as its name.

If left blank, the instance ID is used as the instance name.

rmq-cn-72u3048uxxx

serviceCode

string

Yes

The service code of the instance. For Message Queue for Apache RocketMQ, the service code is rmq.

rmq

seriesCode

string

Yes

The primary edition of the instance. For more information about the differences between primary editions, see Product selection.

Penting

After an instance is created, you can only upgrade its edition, not downgrade it. The upgrade path is: Standard Edition > Professional Edition > Platinum Edition.

Valid values:

  • standard :

    Standard Edition

  • dedicated :

    独享版

  • shared :

    共享版

  • ultimate :

    Platinum Edition

  • professional :

    Professional Edition

standard

subSeriesCode

string

Yes

The sub-edition of the instance. For more information about the differences between sub-editions, see Product selection.

If you set the seriesCode parameter to ultimate (Platinum Edition), this parameter can only be set to cluster_ha (High-availability Cluster Edition).

Penting After an instance is created, you cannot change its sub-edition.

Valid values:

  • serverless :

    Serverless Edition

  • cluster_ha :

    High-availability Cluster Edition

  • single_node :

    Single-node Testing Edition

cluster_ha

paymentType

string

Yes

The billing method of the instance. Message Queue for Apache RocketMQ supports subscription and pay-as-you-go.

For more information, see Billing methods.

Valid values:

  • PayAsYouGo :

    pay-as-you-go. This is a postpaid mode in which you are billed for your actual usage.

  • Subscription :

    subscription. This is a prepaid mode in which you pay for a subscription duration in advance.

Subscription

period

integer

No

The subscription duration. This parameter is required only if you set the paymentType parameter to Subscription.

Valid values:

  • If periodUnit is set to Month, valid values are 1, 2, 3, 4, 5, and 6.

  • If periodUnit is set to Year, valid values are 1, 2, and 3.

3

periodUnit

string

No

The unit of the subscription duration.

Valid values:

  • Month :

    The subscription duration is specified in months.

  • Year :

    The subscription duration is specified in years.

Month

autoRenew

boolean

No

Specifies whether to enable auto-renewal for the instance. This parameter is valid only for subscription instances.

Valid values:

  • true :

    Enables auto-renewal.

  • false :

    Disables auto-renewal.

true

autoRenewPeriod

integer

No

The auto-renewal period. This parameter is valid only if auto-renewal is enabled. Unit: months.

Valid values:

  • 1, 2, 3, 6, and 12.

3

remark

string

No

The remarks on the instance.

This is the remark for test.

productInfo

object

No

The specifications of the instance.

msgProcessSpec

string

No

The computing specification for message sending and receiving. For information about the TPS limits for message sending and receiving, see Instance specifications.

rmq.s2.2xlarge

sendReceiveRatio

number

No

The ratio of TPS for sending messages to the total TPS of the instance.

For example, if the TPS limit for an instance is 1,000 and the ratio is 0.8, the TPS limit for sending messages is 800 and the TPS limit for receiving messages is 200.

The value of this parameter must be a decimal between 0.05 and 0.95. Default value: 0.5.

0.5

autoScaling

boolean

No

Specifies whether to enable elastic TPS for the instance.

If you enable this feature, the instance can process more messages than the number specified by the basic specifications. You are charged for the extra TPS. For more information, see Computing fees.

Catatan

This feature is supported only by specific instance editions. For more information, see Instance specifications.

Valid values:

  • true :

    Enables elastic TPS.

  • false :

    Disables elastic TPS.

true

messageRetentionTime

integer

No

The message retention period. Unit: hours.

For information about the value range, see the "Message retention period" section in the Limits topic.

Message Queue for Apache RocketMQ provides serverless message storage that is billed based on your actual usage. You can adjust the message retention period to manage storage capacity. For more information, see Storage fees.

72

storageEncryption

boolean

No

Specifies whether to enable storage encryption.

false

storageSecretKey

string

No

The key that is used for storage encryption.

xxxxx

capacityType

string

No

The capacity mode.

Valid values:

  • provisioned :

    Reserved + Elastic

  • ondemand :

    pay-as-you-go

provisioned

provisionedCapacity

integer

No

The reserved capacity.

5000

traceOn

boolean

No

Specifies whether to enable the message trace feature. Valid values:

This parameter is valid only for serverless instances. If you enable the message trace feature, you are charged for the feature. For more information, see Billing of serverless instances. For pay-as-you-go and subscription instances, this parameter does not take effect. The message trace feature is enabled for these instances by default.

true

drReplicationMode

string

No

The cross-zone replication mode.

Valid values:

  • async_cross_az :

    asynchronous replication

  • sync_cross_az :

    synchronous replication

async_cross_az

networkInfo

object

Yes

The network configurations.

vpcInfo

object

Yes

The virtual private cloud (VPC) configurations.

vpcId

string

Yes

The ID of the VPC to which the instance is connected.

Catatan

After a Message Queue for Apache RocketMQ instance is created, you cannot change the VPC to which the instance is connected. If you want to change the VPC, you must release the instance and purchase a new one.

vpc-wz9qt50xhtj9krb******

vSwitchId deprecated

string

No

The ID of the vSwitch to which the instance is connected. If you want to connect the instance to multiple vSwitches, separate the vSwitch IDs with vertical bars (|).

Catatan

After a Message Queue for Apache RocketMQ instance is created, you cannot change the vSwitch to which the instance is connected. If you want to change the vSwitch, you must release the instance and purchase a new one.

Penting

This parameter is deprecated. We recommend that you use the vSwitches parameter.

vsw-uf6gwtbn6etadpv*******

securityGroupIds

string

No

The ID of the security group.

sg-bp17hpmgz96tvnsdy6so

vSwitches

array<object>

No

The list of vSwitches.

Catatan

After a Message Queue for Apache RocketMQ instance is created, you cannot change the vSwitches for the instance. If you want to change the vSwitches, you must release the instance and purchase a new one.

Penting

This parameter is required. We recommend that you use this parameter to specify a vSwitch instead of the deprecated vSwitchId parameter.

object

No

The vSwitches.

vSwitchId

string

No

The ID of the vSwitch to which the instance is connected.

vsw-uf6gwtbn6etadpv*******

internetInfo

object

Yes

The Internet access configurations.

internetSpec

string

Yes

Specifies whether to enable Internet access.

By default, instances can be accessed only within a VPC. If you enable Internet access for an instance, you are charged for Internet traffic that is generated by the instance. For more information, see Internet access fees.

Valid values:

  • enable :

    Enables Internet access.

  • disable :

    Disables Internet access.

disable

flowOutType

string

Yes

The billing method for Internet access.

Valid values:

  • payByBandwidth :

    pay-by-bandwidth. This billing method is available only when you enable Internet access.

  • payByTraffic :

    pay-by-traffic. This billing method is available only when you enable Internet access.

  • uninvolved :

    not involved. This value is used when you disable Internet access.

uninvolved

flowOutBandwidth

integer

No

The Internet bandwidth. Unit: Mbit/s.

This parameter is required only when the billing method for Internet access is pay-by-bandwidth.

Value range: 1 to 1000.

100

ipWhitelist deprecated

array

No

The IP address whitelist for Internet access. You can configure an IP address whitelist only for public endpoints. VPC endpoints do not support this feature.

  • If you do not configure an IP address whitelist, all IP addresses are allowed to access the Message Queue for Apache RocketMQ instance over the Internet.

  • If you configure an IP address whitelist, only the IP addresses in the whitelist can access the Message Queue for Apache RocketMQ instance over the Internet.

string

No

An IP address or CIDR block in the whitelist.

192.168.x.x/24

commodityCode deprecated

string

No

The commodity code.

  • ons_rmqpost_public_intl: pay-as-you-go instance

  • ons_rmqsub_public_intl: subscription instance

  • ons_rmqsrvlesspost_public_intl: serverless instance

ons_ rmqpost_public_cn

resourceGroupId

string

No

The ID of the resource group.

rg-aekzy6pist7uuna

tags

array<object>

No

The resource tags.

object

No

The resource tag.

key

string

No

The key of the resource tag.

xxxKey

value

string

No

The value of the resource tag.

xxxValue

aclInfo

object

No

The access control information.

defaultVpcAuthFree

boolean

No

Specifies whether to enable password-free access to the instance within the VPC by using intelligent identity recognition.

  • true: Enables password-free access.

  • false: Disables password-free access.

false

Elemen respons

Element

Type

Description

Example

object

The returned data.

requestId

string

The request ID. This parameter is a common parameter. Each request has a unique ID. You can use this ID to troubleshoot issues.

AF9A8B10-C426-530F-A0DD-96320B39****

success

boolean

Indicates whether the call was successful.

true

data

string

The ID of the instance that is created.

rmq-cn-7e22ody****

code

string

The error code.

200

message

string

The error message.

Success

httpStatusCode

integer

The HTTP status code.

200

dynamicCode

string

The dynamic error code.

InstanceId

dynamicMessage

string

The dynamic error message.

instanceId

Contoh

Respons sukses

JSONformat

{
  "requestId": "AF9A8B10-C426-530F-A0DD-96320B39****",
  "success": true,
  "data": "rmq-cn-7e22ody****",
  "code": "200",
  "message": "Success",
  "httpStatusCode": 200,
  "dynamicCode": "InstanceId",
  "dynamicMessage": "instanceId"
}

Kode kesalahan

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.