All Products
Search
Document Center

ApsaraMQ for RocketMQ:CreateInstance

Last Updated:Nov 29, 2024

Creates an ApsaraMQ for RocketMQ 5.x instance.

Operation description

Note API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
rocketmq:CreateInstancecreate
*Instance
acs:rocketmq:{#regionId}:{#accountId}:Instance/*
    none
none

Request syntax

POST /instances HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
clientTokenstringNo

The client token that is used to ensure the idempotence of the request. You can use the client to generate the value of this parameter, but you must ensure that the value is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.

c2c5d1274a8d4317a13bc5b0d4******
bodyobjectNo

The request body.

instanceNamestringNo

The name of the instance that you want to create.

If you leave this parameter empty, the instance ID is used as the instance name.

rmq-cn-72u3048uxxx
serviceCodestringYes

The code of the service to which the instance belongs. The service code of ApsaraMQ for RocketMQ is rmq.

rmq
seriesCodestringYes

The primary edition of the instance. For information about the differences among primary edition instances, see Instance selection.

Valid values:

  • standard: Standard Edition
  • ultimate: Enterprise Platinum Edition
  • professional: Professional Edition
Note After you create an instance, you can only upgrade the primary edition of the instance. The following editions are sorted in ascending order: Standard Edition, Professional Edition, Enterprise Platinum Edition. For example, you can upgrade an instance from Standard Edition to Professional Edition, but you cannot downgrade an instance from Professional Edition to Standard Edition.
standard
subSeriesCodestringYes

The sub-category edition of the instance. For information about the differences among sub-category edition instances, see Instance selection.

Valid values:

  • cluster_ha: Cluster High-availability Edition
  • single_node: Standalone Edition
  • serverless: serverless

If you set seriesCode to ultimate, you can set this parameter only to cluster_ha.

Note After you create an instance, you cannot change the sub-category edition of the instance.

Valid values:

  • serverless: serverless
  • cluster_ha: Cluster High-availability Edition
  • single_node: Standalone Edition
cluster_ha
paymentTypestringYes

The billing method of the instance. ApsaraMQ for RocketMQ supports the subscription and pay-as-you-go billing methods.

Valid values:

  • PayAsYouGo: This billing method allows you to use resources before you pay for the resources.
  • Subscription: This billing method allows you to use resources after you pay for the resources.

For more information, see Billing methods.

Subscription
periodintegerNo

The subscription duration of the instance. This parameter takes effect only if you set paymentType to Subscription.

Valid values:

  • Monthly subscription: 1, 2, 3, 4, 5, and 6
  • Yearly subscription: 1, 2, and 3
3
periodUnitstringNo

The unit of the subscription duration.

Valid values:

  • Month
  • Year
Month
autoRenewbooleanNo

Specifies whether to enable auto-renewal for the instance. This parameter takes effect only if you set paymentType to Subscription. Valid values:

  • true
  • false
true
autoRenewPeriodintegerNo

The auto-renewal cycle of the instance. This parameter takes effect only if you set autoRenew to true. Unit: months.

Valid values:

  • Monthly renewal: 1, 2, 3, 6, and 12
3
remarkstringNo

The instance description.

This is the remark for test.
productInfoobjectNo

The information about the instance specifications.

msgProcessSpecstringYes

The computing specification that specifies the messaging transactions per second (TPS) of the instance. For more information, see Instance editions.

rmq.s2.2xlarge
sendReceiveRatiofloatNo

The ratio of the message sending TPS to the messaging TPS of the instance.

For example, if the maximum messaging TPS of an instance is 1,000 and the ratio of the message sending TPS to the messaging TPS of the instance is 0.8, the maximum message sending TPS of the instance is 800 and the maximum message receiving TPS is 200.

Valid values: 0 to 1. Default value: 0.5.

0.5
autoScalingbooleanNo

Specifies whether to enable the elastic TPS feature for the instance.

Valid values:

  • true
  • false

After you enable the elastic TPS feature for an ApsaraMQ for RocketMQ instance, you can use a specific amount of TPS that exceeds the specification limit. You are charged for the elastic TPS feature. For more information, see Computing fees.

Note The elastic TPS feature is supported only by instances of specific editions. For more information, see Instance editions.
true
messageRetentionTimeintegerNo

The retention period of messages. Unit: hours.

For information about the valid values of this parameter, see the "Limits on resource quotas" section of the Limits topic.

ApsaraMQ for RocketMQ supports serverless scaling of message storage. You are charged storage fees based on your actual storage usage. You can change the retention period of messages to manage storage capacity. For more information, see Storage fees.

72
chargeTypestringNo

The billing method.

Valid values:

  • provisioned
  • ondemand
provisioned
intranetSpecstringNo

This parameter is no longer used. You do not need to configure this parameter.

xxxx
storageEncryptionbooleanNo

Indicates whether storage encryption is enabled.

false
storageSecretKeystringNo

The storage encryption key.

xxx
networkInfoobjectYes

The information about the network.

vpcInfoobjectYes

The virtual private cloud (VPC)-related configurations.

vpcIdstringYes

The ID of the VPC with which the instance to be created is associated.

Note After you create an ApsaraMQ for RocketMQ instance, you cannot change the VPC with which the instance is associated. If you want to change the VPC with which the instance is associated, you must release the instance and create a new instance.
vpc-wz9qt50xhtj9krb******
vSwitchIddeprecatedstringNo

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

Note After you create an ApsaraMQ for RocketMQ instance, you cannot change the vSwitch with which the instance is associated. If you want to change the vSwitch with which the instance is associated, you must release the instance and purchase a new instance.
Note We recommend that you configure vSwitches instead of this parameter.
vsw-uf6gwtbn6etadpv*******
securityGroupIdsstringNo

The ID of the security group to which the instance belongs.

sg-bp17hpmgz96tvnsdy6so
vSwitchesarray<object>No

The vSwitches.

Note After you create an ApsaraMQ for RocketMQ instance, you cannot change the vSwitch with which the instance is associated. If you want to change the vSwitch with which the instance is associated, you must release the instance and purchase a new instance.
Note This parameter is required. We recommend that you configure this parameter instead of vSwitchId.
objectNo
vSwitchIdstringNo

The ID of the vSwitch with which the instance is associated.

vsw-uf6gwtbn6etadpv*******
internetInfoobjectYes

The Internet-related configurations.

internetSpecstringYes

Specifies whether to enable the Internet access feature.

Valid values:

  • enable
  • disable

By default, ApsaraMQ for RocketMQ allows you to access instances in VPCs. If you enable Internet access for an instance, you can access the instance over the Internet. After you enable this feature, you are charged for outbound Internet traffic. For more information, see Internet access fees.

disable
flowOutTypestringYes

The billing method of Internet usage.

Valid values:

  • payByBandwidth: pay-by-bandwidth. This value is valid only if you enable Internet access.
  • payByTraffic: pay-by-traffic. This value is valid only if you enable Internet access.
  • uninvolved: No billing method is involved. This value is valid only if you disable Internet access.
uninvolved
flowOutBandwidthintegerNo

The Internet bandwidth. Unit: MB/s.

This parameter is required only if you set flowOutType to payByBandwidth.

Valid values: 1 to 1000.

100
ipWhitelistdeprecatedarrayNo

The whitelist that includes the IP addresses that are allowed to access the ApsaraMQ for RocketMQ broker over the Internet. This parameter can be configured only if you use the public endpoint to access the instance.

  • If you do not configure an IP address whitelist, all CIDR blocks are allowed to access the ApsaraMQ for RocketMQ broker over the Internet.
  • If you configure an IP address whitelist, only the IP addresses in the whitelist are allowed to access the ApsaraMQ for RocketMQ broker over the Internet.
stringNo

The IP addresses in the whitelist.

192.168.x.x/24
commodityCodestringNo

The commodity code. Valid values:

  • ons_rmqpost_public_intl: pay-as-you-go
  • ons_rmqsub_public_intl: subscription
ons_ rmqpost_public_cn
resourceGroupIdstringNo

The ID of the resource group.

rg-aekzy6pist7uuna

Response parameters

ParameterTypeDescriptionExample
object

The returned data.

requestIdstring

The ID of the request. Each request has a unique ID. You can use this ID to troubleshoot issues.

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

Indicates whether the call was successful.

true
datastring

The ID of the created instance.

rmq-cn-7e22ody****
codestring

The error code returned if the call failed.

200
messagestring

The error message.

Success
httpStatusCodeinteger

The HTTP status code returned.

200
dynamicCodestring

The dynamic error code.

InstanceId
dynamicMessagestring

The dynamic error message.

instanceId

Examples

Sample success responses

JSONformat

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

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-11-26The internal configuration of the API is changed, but the call is not affectedView Change Details
2024-07-03The internal configuration of the API is changed, but the call is not affectedView Change Details
2023-10-09The internal configuration of the API is changed, but the call is not affectedView Change Details
2023-10-09The request parameters of the API has changedView Change Details
2023-10-09The request parameters of the API has changedView Change Details