Skip to content

Commit 6b33120

Browse files
Merge pull request #212 from RedisLabs/feat/OPCR-17-implement-database-redis-version
Redisversion supported in database create call
2 parents 04df93e + 4e332fe commit 6b33120

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

database_test.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ func TestDatabase_Create(t *testing.T) {
2626
"dataPersistence": "none",
2727
"dataEvictionPolicy": "allkeys-lru",
2828
"queryPerformanceFactor": "6x",
29+
"redisVersion": "6.0.5",
2930
"replication": true,
3031
"throughputMeasurement": {
3132
"by": "operations-per-second",
@@ -96,6 +97,7 @@ func TestDatabase_Create(t *testing.T) {
9697
DataPersistence: redis.String("none"),
9798
DataEvictionPolicy: redis.String("allkeys-lru"),
9899
QueryPerformanceFactor: redis.String("6x"),
100+
RedisVersion: redis.String("6.0.5"),
99101
Replication: redis.Bool(true),
100102
ThroughputMeasurement: &databases.CreateThroughputMeasurement{
101103
By: redis.String("operations-per-second"),
@@ -138,15 +140,17 @@ func TestDatabase_List(t *testing.T) {
138140
"protocol": "redis",
139141
"provider": "AWS",
140142
"region": "eu-west-1",
141-
"queryPerformanceFactor": "Standard"
143+
"queryPerformanceFactor": "Standard",
144+
"redisVersion": "6.0.5"
142145
},
143146
{
144147
"databaseId": 43,
145148
"name": "second-example",
146149
"protocol": "redis",
147150
"provider": "AWS",
148151
"region": "eu-west-1",
149-
"queryPerformanceFactor": "Standard"
152+
"queryPerformanceFactor": "Standard",
153+
"redisVersion": "6.0.5"
150154
}
151155
]
152156
}
@@ -178,6 +182,7 @@ func TestDatabase_List(t *testing.T) {
178182
Provider: redis.String("AWS"),
179183
Region: redis.String("eu-west-1"),
180184
QueryPerformanceFactor: redis.String("Standard"),
185+
RedisVersion: redis.String("6.0.5"),
181186
},
182187
{
183188
ID: redis.Int(43),
@@ -186,6 +191,7 @@ func TestDatabase_List(t *testing.T) {
186191
Provider: redis.String("AWS"),
187192
Region: redis.String("eu-west-1"),
188193
QueryPerformanceFactor: redis.String("Standard"),
194+
RedisVersion: redis.String("6.0.5"),
189195
},
190196
}, actual)
191197

@@ -216,6 +222,7 @@ func TestDatabase_Get(t *testing.T) {
216222
"value": 10000
217223
},
218224
"QueryPerformanceFactor": "Standard",
225+
"redisVersion": "6.0.5",
219226
"activatedOn": "2020-11-03T09:03:30Z",
220227
"lastModified": "2020-11-03T09:03:30Z",
221228
"publicEndpoint": "example.com:16668",
@@ -292,6 +299,7 @@ func TestDatabase_Get(t *testing.T) {
292299
Value: redis.Int(10_000),
293300
},
294301
QueryPerformanceFactor: redis.String("Standard"),
302+
RedisVersion: redis.String("6.0.5"),
295303
Clustering: &databases.Clustering{
296304
NumberOfShards: redis.Int(1),
297305
RegexRules: []*databases.RegexRule{

service/databases/model.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ type CreateDatabase struct {
3434
PortNumber *int `json:"port,omitempty"`
3535
RemoteBackup *DatabaseBackupConfig `json:"remoteBackup,omitempty"`
3636
QueryPerformanceFactor *string `json:"queryPerformanceFactor,omitempty"`
37+
RedisVersion *string `json:"redisVersion,omitempty"`
3738
}
3839

3940
func (o CreateDatabase) String() string {
@@ -80,6 +81,7 @@ type Database struct {
8081
RedisVersionCompliance *string `json:"redisVersionCompliance,omitempty"`
8182
Backup *Backup `json:"backup,omitempty"`
8283
QueryPerformanceFactor *string `json:"queryPerformanceFactor,omitempty"`
84+
RedisVersion *string `json:"redisVersion,omitempty"`
8385
}
8486

8587
func (o Database) String() string {

0 commit comments

Comments
 (0)