添加Topic资源授权信息,且需要在控制台提前创建一级Topic。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
mq:AddCustomAuthPermission |
create |
*Instance
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| InstanceId |
string |
是 |
消息队列 MQTT 版实例的 ID。 |
mqtt-cn-0pp12gl**** |
| IdentityType |
string |
是 |
身份类型,USER: 仅用户名,CLIENT: 具体到客户端 |
USER |
| Identity |
string |
是 |
用户名或客户端 ID。 |
test |
| PermitAction |
string |
是 |
授权操作。 |
PUB_SUB |
| Effect |
string |
是 |
允许或拒绝。 |
ALLOW |
| Topic |
string |
是 |
授权的 topic,支持 mqtt 多级 topic 与通配符。 |
test/t1 |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
Schema of Response |
||
| RequestId |
string |
Id of the request |
82B9E503-F4A1-4F30-976F-C6999FF9**** |
| Code |
integer |
状态码。说明 200 表示成功。 |
200 |
| Success |
boolean |
是否调用成功。返回值:true:调用成功。 false:调用失败。 |
True |
| Message |
string |
返回信息。 |
operation success. |
示例
正常返回示例
JSON格式
{
"RequestId": "82B9E503-F4A1-4F30-976F-C6999FF9****",
"Code": 200,
"Success": true,
"Message": "operation success."
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | InstancePermissionCheckFailed | An error occurred while validating the permissions of the instance. Please verify the account that created the instance and its permissions settings. | |
| 400 | InvalidParameter.%s | An error occurred while validating the parameter. The parameter may be missing or invalid. | |
| 400 | Customauth.over.capacity | Over custom auth capacity. | |
| 404 | ApiNotSupport | The specified API is not supported. |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。