文档

AddCustomAuthPermission - 添加Topic授权

更新时间:
一键部署

添加Topic资源授权信息,且需要在控制台提前创建一级Topic。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

授权信息

当前API暂无授权信息透出。

请求参数

名称类型必填描述示例值
InstanceIdstring

消息队列 MQTT 版实例的 ID。

mqtt-cn-0pp12gl****
IdentityTypestring

身份类型,USER: 仅用户名,CLIENT: 具体到客户端

USER
Identitystring

用户名或客户端 ID。

test
PermitActionstring

授权操作。

枚举值:
  • PUB
  • SUB
  • PUB_SUB
PUB_SUB
Effectstring

允许或拒绝。

枚举值:
  • ALLOW
  • DENY
ALLOW
Topicstring

授权的 topic,支持 mqtt 多级 topic 与通配符。

test/t1

返回参数

名称类型描述示例值
object

Schema of Response

RequestIdstring

Id of the request

82B9E503-F4A1-4F30-976F-C6999FF9****
Codeinteger

状态码。说明 200 表示成功。

200
Successboolean

是否调用成功。返回值:true:调用成功。 false:调用失败。

True
Messagestring

返回信息。

operation success.

示例

正常返回示例

JSON格式

{
  "RequestId": "82B9E503-F4A1-4F30-976F-C6999FF9****",
  "Code": 200,
  "Success": true,
  "Message": "operation success."
}

错误码

HTTP status code错误码错误信息描述
400InstancePermissionCheckFailedAn error occurred while validating the permissions of the instance. Please verify the account that created the instance and its permissions settings.实例权限校验失败,请确认MQTT实例的所属关系以及授权策略。
400InvalidParameter.%sAn error occurred while validating the parameter. The parameter may be missing or invalid.参数校验失败,可能缺失或者传入值非法。
400Customauth.over.capacityOver custom auth capacity.自定义权限数量容量超限
404ApiNotSupportThe specified API is not supported.当前接口不支持,请检查。

访问错误中心查看更多错误码。

  • 本页导读 (1)
文档反馈