Skip to content

Commit 156ab5e

Browse files
authored
[DCS] Change Capacity to float32 (#380)
[DCS] Change Capacity to float32 What this PR does / why we need it Change Capacity from int to float32 Which issue this PR fixes fixes #1839 Reviewed-by: Artem Lifshits <None> Reviewed-by: Anton Sidelnikov <None>
1 parent 770f191 commit 156ab5e

File tree

3 files changed

+17
-16
lines changed

3 files changed

+17
-16
lines changed

acceptance/openstack/dcs/v1/helpers.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func createDCSInstance(t *testing.T, client *golangsdk.ServiceClient) *instances
4040

4141
var productID string
4242
for _, v := range productList.Products {
43-
if v.SpecCode == "dcs.single_node" {
43+
if v.SpecCode == "redis.ha.xu1.tiny.r2.128" {
4444
productID = v.ProductID
4545
}
4646
}
@@ -49,22 +49,20 @@ func createDCSInstance(t *testing.T, client *golangsdk.ServiceClient) *instances
4949
}
5050

5151
defaultSG := openstack.DefaultSecurityGroup(t)
52-
5352
dcsName := tools.RandomString("dcs-instance-", 3)
54-
createOpts := instances.CreateOps{
53+
var createOpts = instances.CreateOps{
5554
Name: dcsName,
5655
Description: "some test DCSv1 instance",
5756
Engine: "Redis",
58-
EngineVersion: "3.0",
59-
Capacity: 64,
57+
EngineVersion: "5.0",
58+
Capacity: 0.125,
6059
Password: "Qwerty123!",
6160
VPCID: vpcID,
6261
SubnetID: networkID,
6362
AvailableZones: []string{az},
6463
ProductID: productID,
6564
SecurityGroupID: defaultSG,
6665
}
67-
6866
dcsInstanceCreate, err := instances.Create(client, createOpts).Extract()
6967
th.AssertNoErr(t, err)
7068

openstack/dcs/v1/instances/requests.go

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,18 @@ type CreateOps struct {
2929
// Cache engine version, which is 3.0.7.
3030
EngineVersion string `json:"engine_version"`
3131

32-
// Indicates the message storage space.
33-
// Cache capacity.
34-
35-
// Unit: GB.
36-
// For a DCS Redis instance in single-node or master/standby mode,
37-
// the cache capacity can be 2 GB, 4 GB, 8 GB, 16 GB, 32 GB, or 64 GB.
38-
// For a DCS Redis instance in cluster mode, the cache capacity can be
39-
// 64, 128, 256, 512, or 1024 GB.
40-
Capacity int `json:"capacity" required:"true"`
32+
// Cache capacity. Unit: GB.
33+
//
34+
// For a single-node or master/standby DCS Redis 3.0 instance,
35+
// the value can be 2, 4, 8, 16, 32, or 64.
36+
// For a Proxy Cluster DCS Redis 3.0 instance,
37+
// the value can be 64, 128, 256, 512, or 1024.
38+
39+
// For a single-node or master/standby DCS Redis 4.0 or 5.0 instance,
40+
// the value can be 0.125, 0.25, 0.5, 1, 2, 4, 8, 16, 32, 24, 48, or 64.
41+
// For a Redis Cluster DCS Redis 4.0 or 5.0 instance,
42+
// the value can be 4, 8, 16, 24, 32, 48, 64, 96, 128, 192, 256, 384, 512, 768, or 1024.
43+
Capacity float32 `json:"capacity" required:"true"`
4144

4245
// Indicate if no password visit cache instance is allowed.
4346
NoPasswordAccess string `json:"no_password_access,omitempty"`

openstack/dcs/v1/instances/results.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ type ListDcsResponse struct {
3636
type Instance struct {
3737
Name string `json:"name"`
3838
Engine string `json:"engine"`
39-
Capacity int `json:"capacity"`
39+
Capacity float32 `json:"capacity"`
4040
IP string `json:"ip"`
4141
Port int `json:"port"`
4242
Status string `json:"status"`

0 commit comments

Comments
 (0)