创建消费者。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
polardb:CreateConsumer |
create |
*全部资源
|
无 | 无 |
请求语法
POST HTTP/1.1
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| GwClusterId |
string |
是 |
网关实例 ID,可从 CreateGateway 返回的 GwClusterId 获取。 |
pg-xxxxxxxxxx |
| Name |
string |
是 |
用户名称 |
test |
| ConsumerGroupName |
string |
否 |
用户组 ID,可从 CreateConsumerGroup 返回的 ConsumerGroupId 获取。此参数实际为必填,未提供时 API 返回 InvalidParameters.Format(400)。尽管参数名为 ConsumerGroupName,实际应传入 ConsumerGroupId(cg-xxxx 格式),可从 CreateConsumerGroup 或 DescribeConsumerGroups 返回的 ConsumerGroupId 字段获取。 |
cg-p3gk2oh55c** |
| NickName |
string |
否 |
用户昵称 |
test |
| KeyType |
string |
否 |
密钥类型,默认 ApiKey,当前仅支持 ApiKey |
ApiKey |
| RegionId |
string |
否 |
地域 ID。 |
cn-beijing |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
Schema of Response |
{} |
|
| RequestId |
string |
请求 ID。 |
CD3FA5F3-FAF3-44CA-AFFF-BAF869****** |
| ApiKey |
string |
完整 APIKey,仅本次返回 |
6c4b1f0317cd4fd7a5b446d3503d** |
| KeyType |
string |
密钥类型,默认 ApiKey,当前仅支持 ApiKey |
ApiKey |
| ConsumerId |
string |
用户 ID. |
c-mqveroemc*** |
示例
正常返回示例
JSON格式
{
"RequestId": "CD3FA5F3-FAF3-44CA-AFFF-BAF869******",
"ApiKey": "6c4b1f0317cd4fd7a5b446d3503d**",
"KeyType": "ApiKey",
"ConsumerId": "c-mqveroemc***"
}
错误码
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。