Creates a group.
Usage notes
When you release a new application or implement a new business logic, you need new groups. You can call this operation to create a group.
Request limit
Each Alibaba Cloud account can call this operation up to 10 times per second. If the number of requests that you send to call this operation within 1 second reaches the request limit, new requests fail. This may interrupt your business. For information about the request limit of each operation, see API rate limits.
Authorization
By default, only Alibaba Cloud accounts can call this operation. A Resource Access Management (RAM) user can call this operation only after the RAM user is granted the required permissions. The following table describes the permissions that must be granted to a RAM user to call this operation. For information about how to grant permissions, Policies and examples.
API |
Action |
Resource |
---|---|---|
OnsGroupCreate |
mq:QueryInstanceBaseInfo mq:CreateGroup |
acs:mq:*:*:{instanceId} |
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | OnsGroupCreate |
The operation that you want to perform. Set the value to OnsGroupCreate. |
GroupId | String | Yes | GID_test_groupId |
The ID of the group that you want to create. Specify the group ID based on the following rules:
Note
|
Remark | String | No | test |
The description of the group. |
InstanceId | String | Yes | MQ_INST_111111111111_DOxxxxxx |
The ID of the Message Queue for Apache RocketMQ instance in which you want to create the group. |
GroupType | String | No | tcp |
The protocol over which clients in the group communicate with the Message Queue for Apache RocketMQ broker. All clients in a group communicate with the Message Queue for Apache RocketMQ broker over the same protocol. You must create different groups for TCP clients and HTTP clients. Valid values:
|
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | A07E3902-B92E-44A6-B6C5-6AA111111**** |
The ID of the request. The system generates a unique ID for each request. You can troubleshoot issues based on the request ID. |
Examples
Sample requests
http(s)://ons.cn-hangzhou.aliyuncs.com/?Action=OnsGroupCreate
&GroupId=GID_test_groupId
&InstanceId=MQ_INST_111111111111_DOxxxxxx
&Remark=test
&GroupType=tcp
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<OnsGroupCreateResponse>
<RequestId>A07E3902-B92E-44A6-B6C5-6AA111111****</RequestId>
</OnsGroupCreateResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "A07E3902-B92E-44A6-B6C5-6AA111111****"
}
Error codes
For a list of error codes, visit the API Error Center.
Create a group in the console
You can also create a group in the Message Queue for Apache RocketMQ console. For more information, see Manage groups.