CreateInstance - Create an instance

Updated at:

You can call the CreateInstance operation to create an ApsaraMQ for RocketMQ 5.0 instance. This operation creates an order for the new instance and automatically completes the payment.

Debug

You can call this operation directly in OpenAPI Explorer to test it without calculating a signature. If the call is successful, OpenAPI Explorer automatically generates sample SDK code.

Request parameters

Name

Type

Required

Example

Description

Action

String

Yes

CreateInstance

A required parameter. Set the value to CreateInstance.

Parameter.N.Code

String

Yes

InstanceType

The code of the Nth module property. If you have multiple module properties, concatenate them in the N=0,1,2,3... format.

This parameter must be used with Parameter.N.Value.

To create an ApsaraMQ for RocketMQ instance, you must configure more properties. For more information, see Configure the Parameter.N.Code parameter.

Parameter.N.Value

String

Yes

professional

The value that corresponds to the Nth module property code. If you have multiple module properties, concatenate them in the N=0,1,2,3... format.

ProductCode

String

Yes

ons

The product code. Set the value to ons.

ProductType

String

No

ons_rmqsub_public_cn

The product type. Set the value to ons_rmqsub_public_cn.

SubscriptionType

String

Yes

Subscription

The billing method. Valid value:

  • Upfront subscription

When you use this operation to create an ApsaraMQ for RocketMQ 5.0 instance, you can set this parameter only to Subscription.

RenewalStatus

String

No

AutoRenewal

The renewal method. Valid values:

  • AutoRenewal: auto-renewal

  • ManualRenewal: manual renewal

RenewPeriod

Integer

No

1

The auto-renewal period. Unit: month.

Note

This parameter is required only when RenewalStatus is set to AutoRenewal.

Period

Integer

No

1

The subscription duration. Unit: month. If you want to purchase a yearly subscription, specify an integer multiple of 12.

Logistics

String

No

Not applicable

The logistics information. This parameter is not applicable when you create an ApsaraMQ for RocketMQ instance. You do not need to specify this parameter.

ClientToken

String

No

JASIOFKVNVIXXXXXX

A client-side idempotence parameter. The server-side checks whether a request with the same ClientToken has been received. If it has, the server-side directly returns the result of the previous call.

Table 1. The Parameter.N.Code parameter

Parameter

Value

Required

Description

Parameter.0.Code

internet_spec

Yes

Specifies whether to enable public network access for the instance.

Valid values for Parameter.0.Value:

  • disable: Disables public network access. The instance can be accessed only from a VPC.

  • enable: Enables public network access. The instance can be accessed from both a VPC and the Internet.

If you enable public network access, ApsaraMQ for RocketMQ charges for downstream public bandwidth. For more information about billing, see Public network access fees.

Parameter.1.Code

flow_out_type

Yes

The billing method for public network access.

Valid values for Parameter.1.Value:

  • uninvolved: Not applicable. If Parameter.0.Value is set to disable, which means public network access is disabled, set Parameter.1.Value to uninvolved.

  • payByBandwidth: Pay-by-bandwidth. If Parameter.0.Value is set to enable, which means public network access is enabled, set Parameter.1.Value to payByBandwidth.

Parameter.2.Code

flow_out_bandwidth

No

The public bandwidth. This parameter is required if Parameter.1.Value is set to payByBandwidth.

The value of Parameter.2.Value ranges from 1 to 1,000. Unit: Mbps.

Parameter.3.Code

region

Yes

The region where the instance resides. Set Parameter.3.Value to the ID of a region that the instance supports, such as cn-shenzhen. For information about the region IDs, see Regions and zones.

Parameter.4.Code

instance_version

Yes

You can configure the instance version.

Set Parameter.4.Value to rocketmq5.0.

Parameter.5.Code

vpc_id

Yes

The VPC to which the instance is attached.

Set Parameter.5.Value to the ID of an existing VPC, such as vpc-**1u0bwhyb586i7axgs**.

The selected VPC and the ApsaraMQ for RocketMQ instance to be created must be in the same region.

Parameter.6.Code

vswitch_id

Yes

The vSwitch to which the instance is attached.

Set Parameter.6.Value to the ID of a vSwitch in the selected VPC. Example: vsw-***bdohgpe5atvjbu***.

Parameter.7.Code

series_type

Yes

The primary series of the instance.

Valid values for Parameter.7.Value:

  • standard: Standard Edition

  • professional: Professional Edition

  • ultimate: Platinum Edition

For information about the differences between instance types, see Instance types.

Parameter.8.Code

sub_series_type

Yes

The sub-series of the instance.

Valid values for Parameter.8.Value:

  • cluster_ha: High-availability Edition (recommended for production environments)

  • single_node: Single Node Edition (for specific environments)

Parameter.9.Code

msg_process_spec

Yes

The computing specification of the ApsaraMQ for RocketMQ instance.

For the valid values of Parameter.9.Value, see the Instance Type column in Instance types. Example: rmq.s2.2xlarge.

Important

The specified instance type must be supported by the selected primary series and sub-series.

Parameter.10.Code

order_num

No

The number of instances to create.

The value of Parameter.10.Value ranges from

1 to 9,999.

Parameter.11.Code

ord_time

No

The subscription duration of the instance.

The value of Parameter.11.Value is an integer that ranges from 1 to 36. Unit: month.

Returned data

Name

Type

Example

Description

Code

String

Success

The status code.

Data

Struct

The returned data.

InstanceId

String

rmq-cn-wny3psj****

The ID of the instance that corresponds to the order.

OrderId

String

21014976059****

The ID of the order that is successfully created.

Message

String

Successful!

Message.

RequestId

String

B62C712B-1789-5114-B0BB-80CB2AFD****

The request ID.

Success

Boolean

true

Indicates whether the call was successful.

Examples

Sample request

http(s)://business.aliyuncs.com/?Action=CreateInstance

&Parameter.0.Code=internet_spec

&Parameter.0.Value=enable

&Parameter.1.Code=flow_out_type

&Parameter.1.Value=payByBandwidth

&Parameter.2.Code=flow_out_bandwidth

&Parameter.2.Value=30
&Parameter.3.Code=region

&Parameter.3.Value=cn-shenzhen

&Parameter.4.Code=instance_version

&Parameter.4.Value=rocketmq5.0

&Parameter.5.Code=vpc_id

&Parameter.5.Value=vpc-**1u0bwhyb586i7axgs**

&Parameter.6.Code=vswitch_id

&Parameter.6.Value=vsw-***bdohgpe5atvjbu***

&Parameter.7.Code=series_type

&Parameter.7.Value=standard
&Parameter.8.Code=sub_series_type

&Parameter.8.Value=single_node

&Parameter.9.Code=msg_process_spec

&Parameter.9.Value=rmq.s1.micro

&Parameter.10.Code=order_num
&Parameter.10.Value=1

&Parameter.11.Code=ord_time

&Parameter.11.Value=1

&ProductCode=ons

&ProductType=ons_rmqsub_public_cn

&SubscriptionType=Subscription

&Period=1

&RenewPeriod=1

&RenewalStatus=AutoRenewal

&<Common request parameters>

Sample responses

XML format

<CreateInstanceResponse>
      <RequestId>B62C712B-1789-5114-B0BB-80CB2AFD****</RequestId>
      <Message>Successful!</Message>
      <Data>
            <InstanceId>rmq-cn-wny3p***</InstanceId>
            <OrderId>21014976059****</OrderId>
      </Data>
      <Code>Success</Code>
      <Success>true</Success>
</CreateInstanceResponse>

JSON format

{
  "RequestId": "B62C712B-1789-5114-B0BB-80CB2AFD****",
  "Message": "Successful!",
  "Data": {
    "InstanceId": "rmq-cn-wny3p***",
    "OrderId": 21014976059****
  },
  "Code": "Success",
  "Success": true
}

Error codes

For a list of error codes, see the API Error Center.

For a list of error codes, see the API Error Center.