创建租户
更新时间:2025-05-28
创建租户
接口描述
本接口用于创建租户。
请求结构
Plain Text
1POST /v{version}/ddc/ob/instance/{instanceId}/tenant HTTP/1.1
2Host: ddc.bj.baidubce.com
3Authorization: authorization string
4{
5 "tenantName": "clltest",
6 "description": "备注",
7 "cpu": 2,
8 "memory": 8,
9 "unitNum": 1,
10 "primaryZone": "cn-bd-b",
11 "tenantMode": "MySQL",
12 "timeZone": "Asia/Shanghai",
13 "charset": "utf8mb4",
14 "collation": "utf8mb4_bin",
15 "proxyAddressMasterZone": "cn-bd-c",
16 "createParams": {
17 "lowerCaseTableNames": "0"
18 }
19}
请求头域
除公共头域外,无其它特殊头域。
请求参数
| 参数名称 | 类型 | 是否必选 | 参数位置 | 描述 |
|---|---|---|---|---|
| version | String | 是 | URL参数 | API版本号。 |
| instanceId | String | 是 | URL参数 | 集群ID。 |
| tenantName | String | 是 | RequestBody参数 | 租户名称。长度为 2~64 字符,只能包含中文、数字、英文字母、下划线、短横线。 |
| description | String | 否 | RequestBody参数 | 租户备注。 |
| cpu | Integer | 是 | RequestBody参数 | 租户的 CPU 大小,单位:核数(Cores)。 |
| memory | Integer | 是 | RequestBody参数 | 租户内存大小,单位 GiB。 |
| unitNum | Integer | 否 | RequestBody参数 | 租户的资源分布节点数,当前仅支持1。 其与集群的部署模式相耦合,如集群模式为 1-1-1,则最后分布节点数最多为 1 个。 |
| primaryZone | String | 是 | RequestBody参数 | 租户的主可用区。 其为集群部署可用区中的一个。 |
| proxyAddressMasterZone | String | 是 | RequestBody参数 | 主地址代理可用区。 |
| tenantMode | String | 是 | RequestBody参数 | 租户模式。 当前支持 MySQL 模式(MySQL)。 |
| timeZone | String | 是 | RequestBody参数 | 租户所在时区。 取值如下: Asia/Shanghai |
| charset | String | 是 | RequestBody参数 | 字符集。 详细取值参考:ObEncodingType |
| collation | String | 是 | RequestBody参数 | 字符序。 详细取值参考:ObCollationType |
| createParams | CreateParams | 是 | RequestBody参数 | 创建租户的一些额外参数。 |
CreateParams
| 参数名称 | 类型 | 描述 |
|---|---|---|
| lowerCaseTableNames | String | 表名大小写敏感。 0: 关闭; 1:开启 |
响应头域
除公共头域外,无其它特殊头域。
响应参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| tenantId | String | 租户ID。 |
请求示例
Plain Text
1POST http://ddc.bj.baidubce.com/v1/ddc/ob/instance/ob6oqa3a891obk/tenant
2Host: ddc.bj.baidubce.com
3Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2015-08-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
4{
5 "tenantName": "clltest",
6 "description": "备注",
7 "cpu": 2,
8 "memory": 8,
9 "unitNum": 1,
10 "primaryZone": "cn-bd-b",
11 "tenantMode": "MySQL",
12 "timeZone": "Asia/Shanghai",
13 "charset": "utf8mb4",
14 "collation": "utf8mb4_bin",
15 "proxyAddressMasterZone": "cn-bd-d",
16 "createParams": {
17 "lowerCaseTableNames": "0"
18 }
19}
响应示例
Plain Text
1HTTP/1.1 200 OK
2Content-Type: application/json;charset=UTF-8
3Date: Wed, 08 Jul 2015 03:28:11 GMT
4x-bce-request-id: d8752367-38e8-45e4-b4c7-e53be3137ce5
5Server: BWS
6{
7 "tenantId": "xxx"
8}
评价此篇文章
