获取参数模版列表
更新时间:2023-09-06
请求说明
查看当前账号有权限的参数模版列表,不区分地域。
请求结构
Plain Text
1GET /v2/template/list?marker={marker}&maxKeys={maxKeys} HTTP/1.1
2Host: redis.{region}.baidubce.com
3Authorization: authorization string
请求头域
除公共头域外,无其它特殊头域。
请求参数
参数名称 | 类型 | 是否必选 | 参数位置 | 描述 |
---|---|---|---|---|
marker | String | 否 | Query参数 | 批量获取列表的查询的起始位置,是一个由系统生成的字符串 |
maxKeys | Integer | 否 | Query参数 | 每页包含的最大数量,最大数量通常不超过1000,缺省值为1000 |
返回头域
除公共头域外,无其它特殊头域。
返回参数
参数名称 | 类型 | 描述 |
---|---|---|
result | List<Result> | 参数模版列表 |
marker | String | 批量获取列表的查询的起始位置,是一个由系统生成的字符串,起始值可传入-1 |
maxKeys | Integer | 每页包含的最大数量,最大数量通常不超过1000,缺省值为1000 |
isTruncated | Boolean | true表示后面还有数据,false表示已经是最后一页 |
nextMarker | String | 获取下一页所需要传递的marker值。当isTruncated为false时,该域不出现 |
Result参数信息
参数名称 | 类型 | 描述 |
---|---|---|
templateId | Integer | 参数模板数字ID |
templateShowId | String | 参数模板ID |
templateName | String | 参数模板名称 |
parametersNum | Integer | 参数模板参数数量 |
clusterType | String | 集群类型 |
engine | String | 引擎类型 |
engineVersion | String | 引擎版本 |
templateType | Integer | 参数模板类型(1为自定义参数模板) |
needReboot | Integer | 是否需要重启(该参数模版是否有需要重启生效的参数),0:不需要,1:需要 |
comment | String | 备注 |
createTime | String | 创建时间 |
updateTime | String | 更新时间 |
parameters | List<Parameters> | 参数列表 |
Parameters参数信息
参数名称 | 类型 | 描述 |
---|---|---|
confName | String | 参数名称 |
confDefault | String | 参数默认值 |
confValue | String | 参数值 |
confType | Integer | 参数类型(1:单选类型 2.数字类型 3.多选类型 4.多选类型,单值) |
confRange | String | 参数范围: 当confType=1时,以逗号(,)为分割符所有选择项 当confType=2时,以逗号(,)为分割符,第一项为范围最小值,第二项为范围最大值 当confType=3,以逗号(,)为间隔符所有可选项 当confType=4时,以逗号(,)为间隔符所有可选项 |
confModule | Integer | 1:redis 2:proxy 3.redis+proxy 4.metaserver |
confDesc | String | 配置对用户展示含义(转码后的一串字符) |
needReboot | Integer | 该参数是否需要重启,0:不需要,1:需要 |
confRedisVersion | String | 参数对应的redis版本。例如:2.6、3.2、 4.0、 all |
confCacheVersion | Integer | 生效redis version(和VERSION_TYPE保持一致) |
请求示例
Plain Text
1GET /v2/template/list?marker=-1&maxKeys=20 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
返回示例
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 "result" : [ {
6 "engineVersion" : "5.0",
7 "templateType" : 1,
8 "clusterType" : "master_slave",
9 "needReboot" : 0,
10 "templateShowId" : "scs-tmpl-zuiflgqnmwrx",
11 "updateTime" : "2022-04-26T16:17:03Z",
12 "templateId" : 13,
13 "parametersNum" : 0,
14 "templateName" : "test3",
15 "engine" : "redis",
16 "createTime" : "2022-04-26T16:17:03Z",
17 "comment" : "test template",
18 "parameters" : [ {
19 "confName" : "appendonly",
20 "confModule" : 1,
21 "confCacheVersion" : 0,
22 "confValue" : "no",
23 "needReboot" : 0,
24 "confRedisVersion" : "all",
25 "confDefault" : "yes",
26 "confType" : 1,
27 "confRange" : "yes|no|partial",
28 "confDesc" : "5piv5ZCm5ZCv55SoIEFPRiDmjIHkuYXljJY="
29 } ]
30 }],
31 "isTruncated" : true,
32 "nextMarker" : "scs-tmpl-dycgmxbxlbow",
33 "maxKeys" : 10,
34 "marker" : "-1"
35}