CreateGroupId - 创建 Group ID
消息生产者和消费者客户端接入云消息队列 MQTT 版服务端收发消息时,需要指定Client ID,用于唯一标识一个客户端。
Client ID由两部分组成,组织形式为
接口说明
每成功调用一次 CreateGroupId 接口,都会计算为一次消息 TPS,从而影响您的计费。详情请参见计费说明。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
mq:CreateMqttGroupId |
create |
*Instance
|
无 |
|
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| GroupId |
string |
是 |
您需创建的 Group ID。取值说明如下:
|
GID_test |
| InstanceId |
string |
是 |
创建的 Group ID 所在的实例 ID。 |
mqtt-cn-0pp1ldu**** |
| Tag |
array<object> |
否 |
标签键值对数组。 |
|
|
object |
否 |
资源标签列表,一次最多添加 20 个标签,一个资源最多可以添加 20 个标签 |
||
| Key |
string |
否 |
标签键 |
test |
| Value |
string |
否 |
标签值。 |
test |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
|||
| RequestId |
string |
公共参数,每个请求的 ID 都是唯一的。 |
2C7D722D-0F3D-4415-A9CD-A464D82C**** |
示例
正常返回示例
JSON格式
{
"RequestId": "2C7D722D-0F3D-4415-A9CD-A464D82C****"
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | GroupIdAlreadyExsited | The specified GroupId already exists. | 当前Group ID已经存在。 |
| 400 | GroupIdAlreadyUsedByOtherUsers | The current GroupId is used by another user. Please change to a different GroupId. | 当前Group ID已经被其他用户占用,请更换其他名称。 |
| 400 | ParameterFieldCheckFailed | Failed to validate the parameters. The parameters may be missing or invalid. | 参数校验失败,可能缺失或者传入值非法。 |
| 400 | InstancePermissionCheckFailed | An error occurred while validating the permissions of the instance. Please verify the account that created the instance and its permissions settings. | 实例权限校验失败,请确认MQTT实例的所属关系以及授权策略。 |
| 400 | InstanceNotFound | Failed to find the instance. The instanceId may be invalid. | 无法找到实例。 |
| 400 | PermissionCheckFailed | An error occurred while validating the resource permissions. Please check the account that created the instance, topic, and GroupId, and check their permission settings. | 资源权限校验失败,请检查实例、Topic和Group ID的所属权限和授权策略。 |
| 500 | CreateGroupIdError | Failed to create GroupId. Try again later. | 创建Group ID请求执行失败,请稍后重试。 |
| 500 | InternalError | An error occurred while processing your request. Try again later. | MQTT后端服务异常,请重试。 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。