创建参数模版
更新时间:2023-09-06
请求说明
创建参数模版,不区分地域。
请求结构
Plain Text
1POST /v2/template/create HTTP/1.1
2Host: redis.{region}.baidubce.com
3Authorization: authorization string
4{
5 "engineVersion" : "engineVersion",
6 "templateType" : templateType,
7 "clusterType" : "clusterType",
8 "engine" : "engine",
9 "name" : "name",
10 "comment" : "测试备注",
11 "parameters" : [ {
12 "confName" : "confName",
13 "confModule" : confModule,
14 "confValue" : "confValue,confValue1",
15 "confType" : confType
16 } ]
17}
请求头域
除公共头域外,无其它特殊头域。
请求参数
参数名称 | 类型 | 是否必选 | 参数位置 | 描述 |
---|---|---|---|---|
name | String | 是 | RequestBody参数 | 模板名称,格式要求:大小写字母、数字、中文以及-_/.特殊字符,必须以字母或者中文开头,长度1-65 |
engine | String | 是 | RequestBody参数 | 引擎(当前仅支持redis) |
engineVersion | String | 是 | RequestBody参数 | 引擎版本 |
clusterType | String | 是 | RequestBody参数 | 集群类型(master_slave\cluster) |
templateType | Integer | 是 | RequestBody参数 | 模板类型(1、自定义参数模板) |
comment | String | 否 | RequestBody参数 | 备注 |
parameters | List <Parameters> | 是 | RequestBody参数 | 参数列表,系统模版内的数据,和引擎及引擎版本有关 |
Parameters参数信息
参数名称 | 类型 | 是否必选 | 描述 |
---|---|---|---|
confName | String | 是 | 参数名称(可参考系统模版) |
confValue | String | 是 | 参数值(可修改对应的值,可参考系统模版在confRange的允许范围内修改) |
confType | Integer | 是 | 参数类型(可参考系统模版) |
confModule | Integer | 是 | 可参考系统模版 |
返回头域
除公共头域外,无其它特殊头域。
返回参数
参数名称 | 类型 | 描述 |
---|---|---|
templateId | Integer | 参数模版数字ID |
templateShowId | String | 参数模版展示ID |
请求示例
Plain Text
1POST /v2/template/create HTTP/1.1
2HOST: redis.bj.baidubce.com
3Content-Type: application/json
4Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2017-11-21T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
5{
6 "engineVersion" : "5.0",
7 "templateType" : 1,
8 "clusterType" : "master_slave",
9 "engine" : "redis",
10 "name" : "testTemplateName",
11 "comment" : "测试备注",
12 "parameters" : [ {
13 "confName" : "disable_commands",
14 "confModule" : 1,
15 "confValue" : "flushall,flushdb",
16 "confType" : 3
17 } ]
18}
返回示例
Plain Text
1HTTP/1.1 200 OK
2Content-Type: application/json;charset=UTF-8
3x-bce-request-id: d8752367-38e8-45e4-b4c7-e53be3137ce5
4{
5 "templateShowId" : "scs-tmpl-xxxxxx",
6 "templateId" : 0
7}