本节介绍分布式缓存Redis产品订购、扩缩容、增减分片数、增减副本数、变配以及对应询价接口API参数,包括单品编码、版本号、主机类型、分片规格、分片数、规格、副本数、磁盘类型等。
具体参数范围可能因为不同资源池配置上线的产品有所差异,产品信息可通过 查询产品信息 接口查询,单品规格信息可通过 查询单品规格列表 接口查询,具体可参照下表 API参数对照表。
资源池、可用区、虚拟私有云ID、所在子网ID、安全组ID、实例名称、实例密码参数为产品订购必填参数,本节不作详细说明。
基础版API参数
| 参数说明 | 参数取值 | 标准版 | Cluster集群 | Proxy集群 | 读写分离 |
|---|---|---|---|---|---|
单品编码 | skuCode | originalSingleHA | clusterOriginal | clusterOriginalProxy | originalMultipleReadLvs |
| 版本号 | engineVersion |
|
|
|
|
| 主机类型 | hostType | X86计算:
ARM计算:
| X86计算:
ARM计算:
| X86计算:
ARM计算:
| X86计算:
ARM计算:
|
| 分片规格 | shardMemSize |
|
|
|
|
| 分片数 | shardCount | 不填 | 3~256 | 3~256 | 不填 |
| 副本数 | copiesCount | 1~10(默认值:2) | 1~10(默认值:2) | 1~10(默认值:2) | 1~10(默认值:2) |
| 磁盘类型 | dataDiskType |
|
|
|
|
基础版规格编码
| 分片规格 | 标准版 | Cluster集群 | Proxy集群 | 读写分离 |
|---|---|---|---|---|
| 1G | redis.standard.basic.ha.{hostType}.1g | redis.standard.basic.cluster.{hostType}.1g | redis.standard.basic.proxy.{hostType}.1g | redis.standard.basic.rw.{hostType}.1g |
| 2G | redis.standard.basic.ha.{hostType}.2g | redis.standard.basic.cluster.{hostType}.2g | redis.standard.basic.proxy.{hostType}.2g | redis.standard.basic.rw.{hostType}.2g |
| 4G | redis.standard.basic.ha.{hostType}.4g | redis.standard.basic.cluster.{hostType}.4g | redis.standard.basic.proxy.{hostType}.4g | redis.standard.basic.rw.{hostType}.4g |
| 8G | redis.standard.basic.ha.{hostType}.8g | redis.standard.basic.cluster.{hostType}.8g | redis.standard.basic.proxy.{hostType}.8g | redis.standard.basic.rw.{hostType}.8g |
| 16G | redis.standard.basic.ha.{hostType}.16g | redis.standard.basic.cluster.{hostType}.16g | redis.standard.basic.proxy.{hostType}.16g | redis.standard.basic.rw.{hostType}.16g |
| 32G | redis.standard.basic.ha.{hostType}.32g | redis.standard.basic.cluster.{hostType}.32g | redis.standard.basic.proxy.{hostType}.32g | redis.standard.basic.rw.{hostType}.32g |
| 64G | redis.standard.basic.ha.{hostType}.64g | redis.standard.basic.cluster.{hostType}.64g | redis.standard.basic.proxy.{hostType}.64g | redis.standard.basic.rw.{hostType}.64g |
示例:
redis.standard.basic.ha.c.8g 基础标准版8G-计算增强型
redis.standard.basic.cluster.s.1g 基础版本Cluster集群1G-通用型
redis.standard.basic.proxy.ks.2g 基础版Proxy集群2G-鲲鹏通用型
redis.standard.basic.rw.hc.4g 基础版读写分离4G-海光计算增强型
增强版API参数
| 参数说明 | 参数取值 | 标准版 | Cluster集群 | Proxy集群 | 读写分离 |
|---|---|---|---|---|---|
| 单品编码 | skuCode | originalHAPlus | clusterOriginalPlus | clusterOriginalProxyPlus | originalMultipleReadLvsPlus |
| 版本号 | engineVersion |
|
|
|
|
| 主机类型 | hostType | X86计算:
ARM计算:
| X86计算:
ARM计算:
| X86计算:
ARM计算:
| X86计算:
ARM计算:
|
| 分片规格 | shardMemSize |
|
|
|
|
| 分片数 | shardCount | 不填 | 3~256 | 3~256 | 不填 |
| 副本数 | copiesCount | 1~10(默认值:2) | 1~10(默认值:2) | 1~10(默认值:2) | 2~10(默认值:2) |
| 磁盘类型 | dataDiskType |
|
|
|
|
增强版规格编码
| 分片规格 | 标准版 | Cluster集群 | Proxy集群 | 读写分离 |
|---|---|---|---|---|
| 4G | redis.standard.plus.ha.{hostType}.4g | redis.standard.plus.cluster.{hostType}.4g | redis.standard.plus.proxy.{hostType}.4g | redis.standard.plus.rw.{hostType}.4g |
| 8G | redis.standard.plus.ha.{hostType}.8g | redis.standard.plus.cluster.{hostType}.8g | redis.standard.plus.proxy.{hostType}.8g | redis.standard.plus.rw.{hostType}.8g |
| 16G | redis.standard.plus.ha.{hostType}.16g | redis.standard.plus.cluster.{hostType}.16g | redis.standard.plus.proxy.{hostType}.16g | redis.standard.plus.rw.{hostType}.16g |
| 32G | redis.standard.plus.ha.{hostType}.32g | redis.standard.plus.cluster.{hostType}.32g | redis.standard.plus.proxy.{hostType}.32g | redis.standard.plus.rw.{hostType}.32g |
| 64G | redis.standard.plus.ha.{hostType}.64g | redis.standard.plus.cluster.{hostType}.64g | redis.standard.plus.proxy.{hostType}.64g | redis.standard.plus.rw.{hostType}.64g |
示例:
redis.standard.plus.ha.s.4g 增强标准版4G-通用型
redis.standard.plus.cluster.c.4g 增强版Cluster集群4G-计算增强型
redis.standard.plus.proxy.c.4g 增强版Proxy集群4G-计算增强型
redis.standard.plus.rw.c.4g 增强版读写分离4G-计算增强型
API参数对照表
| 参数 | 是否必填 | 参数类型 | 说明 | 示例 |
|---|---|---|---|---|
| skuCode | 否 | String | 单品编码,可通过 查询产品信息 接口使用表skus中的skuCode值。 | originalSingleHA |
| engineVersion | 是 | String | 版本号,可通过 查询产品信息 接口使用表skus中的engineVersion(Redis版本号可选值)。 | 6.0 |
| hostType | 否 | String | 主机类型,可通过 查询产品信息 接口使用表skus中hostTypes(主机类型可选值) 。若已传flavorCode值,此参数可不填。 | S |
| hostFlavorType | 否 | String | 主机规格簇类型,可通过 查询产品信息接口使用表 hostFlavorList中hostFlavorType值 。说明:当标准模式部署时,本参数才生效。 | s3 |
| shardMemSize | 否 | String | 分片规格,可通过 查询产品信息 接口使用表skus中shardMemSize(单分片规格可选值)。若已传flavorCode值,此参数可不填。 | 1G |
| flavorCode | 否 | String | 规格编码,可通过 查询单品规格列表 接口使用表flavorList中的flavorCode值。或参考规格编码填写。 | redis.standard.basic.ha.s.1g |
| shardCount | 否 | Integer | 分片数。取值:3~256,不传默认取规格定义最小值 | 3 |
| copiesCount | 否 | Integer | 副本数,默认值:2,取值范围1~10。 | 2 |
| dataDiskType | 否 | String | 磁盘类型,可通过 查询单品规格列表 接口使用表 dataDiskList中的dataDiskType值。 | SSD |
请求参数示例
创建一个按需计费的Redis 基础标准版实例,内核版本号是5.0,缓存容量是4GB。
POST https://dcs2-global.ctapi.ctyun.cn/v3/lifeCycleServant/createInstances
{
"chargeType":"PostPaid",
"skuCode": "originalSingleHA",
"flavorCode":"redis.standard.basic.ha.s.4g",
"copiesCount": 2,
"engineVersion":"5.0",
"zoneName":"cn-xinan1-1A",
"secondaryZoneName":"cn-xinan1-2A",
"dataDiskType": "SSD",
"instanceName":"DCS2-StandardDual-APITest-1",
"password":"********",
"vpcId":"vpc-uf9gof2qa0",
"subnetId":"subnet-6do1ll389s",
"securityGroupId":"sg-j9ryoyupxr",
"port": 6379
}创建一个包周期计费1个月的Redis 基础Cluster集群版单副本3分片实例,内核版本号是6.0,缓存容量是6GB。
POST https://dcs2-global.ctapi.ctyun.cn/v3/lifeCycleServant/createInstances
{
"chargeType":"PrePaid",
"period": 1,
"autoPay": true,
"skuCode": "clusterOriginal",
"flavorCode": "redis.standard.basic.cluster.c.2g",
"shardCount": 3,
"copiesCount": 2,
"engineVersion":"6.0",
"zoneName":"cn-xinan1-1A",
"secondaryZoneName":"cn-xinan1-2A",
"dataDiskType": "SSD",
"instanceName":"DCS2-DirectCluster-APITest-2",
"password":"********",
"vpcId":"vpc-uf9gof2qa0",
"subnetId":"subnet-6do1ll389s",
"securityGroupId":"sg-j9ryoyupxr",
"port": 6379
}创建一个包周期计费2个月,到期自动续订3个月的Redis 增强Proxy集群版3副本3分片实例,内核版本号是6.0,缓存容量是24GB。
POST https://dcs2-global.ctapi.ctyun.cn/v3/lifeCycleServant/createInstances
{
"chargeType":"PrePaid",
"period": 2,
"autoRenew": true,
"autoRenewPeriod": 3,
"autoPay": true,
"skuCode": "clusterOriginalProxyPlus",
"flavorCode": "redis.standard.plus.proxy.hc.8g",
"shardCount": 3,
"copiesCount": 3,
"engineVersion":"6.0",
"zoneName":"cn-xinan1-1A",
"secondaryZoneName":"cn-xinan1-2A",
"dataDiskType": "SSD",
"instanceName":"DCS2-ClusterOriginalProxy-APITest-3",
"password":"********",
"vpcId":"vpc-uf9gof2qa0",
"subnetId":"subnet-6do1ll389s",
"securityGroupId":"sg-j9ryoyupxr",
"port": 6379
}创建一个按需计费的Redis 基础读写分离3副本实例,内核版本号是7.0,缓存容量是8GB。
POST https://dcs2-global.ctapi.ctyun.cn/v3/lifeCycleServant/createInstances
{
"chargeType":"PostPaid",
"skuCode": "originalMultipleReadLvs",
"flavorCode":"redis.standard.basic.rw.s.8g",
"copiesCount": 3,
"engineVersion":"7.0",
"zoneName":"cn-xinan1-1A",
"secondaryZoneName":"cn-xinan1-2A",
"dataDiskType": "SSD",
"instanceName":"DCS2-OriginalMultipleReadLvs-APITest-4",
"password":"********",
"vpcId":"vpc-uf9gof2qa0",
"subnetId":"subnet-6do1ll389s",
"securityGroupId":"sg-j9ryoyupxr",
"port": 6379
}