You can call this operation to create a Message Queue for Apache RocketMQ instance.

Note the following when calling this operation:

  • By default, only Alibaba Cloud accounts can call this operation. Resource Access Management (RAM) users can call this operation only after being authorized.
  • A maximum of eight Message Queue for Apache RocketMQ instances can be deployed in each region.
  • The name of a Message Queue for Apache RocketMQ instance must be unique in the region where the Message Queue for Apache RocketMQ instance is deployed.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes OnsInstanceCreate

The operation that you want to perform. Set the value to OnsInstanceCreate.

InstanceName String Yes test instance

The name of the Message Queue for Apache RocketMQ instance that you want to create. The value must be 3 to 64 Chinese or English characters in length.

Remark String No Description

The description of the Message Queue for Apache RocketMQ instance.

Response parameters

Parameter Type Example Description
Data Struct

The returned results.

InstanceId String MQ_INST_111111111111_DOxxxxxx

The ID of the Message Queue for Apache RocketMQ instance that was created.

InstanceType Integer 1

The type of the Message Queue for Apache RocketMQ instance. Valid values:

  • 1: pay-as-you-go
  • 2: Enterprise Platinum Edition
RequestId String A07E3902-B92E-44A6-B6C5-6AA1111111799

The ID of the request. This is a common parameter that facilitates troubleshooting and fault locating.

Examples

Sample requests

http(s)://[Endpoint]/? Action=OnsInstanceCreate
&InstanceName=test instance
&<Common request parameters>

Sample success responses

XML format

<OnsInstanceCreateResponse>
  <Data>
        <InstanceId>MQ_INST_111111111111_DOxxxxxx</InstanceId>
        <InstanceType>1</InstanceType>
  </Data>
  <RequestId>A07E3902-B92E-44A6-B6C5-6AA1111111799</RequestId>
</OnsInstanceCreateResponse>

JSON format

{
  "Data": {
    "InstanceId": "MQ_INST_111111111111_DOxxxxxx",
    "InstanceType": 1
  },
  "RequestId": "A07E3902-B92E-44A6-B6C5-6AA1111111799"
}

Error codes

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