@@ -24,6 +24,7 @@ func TestFixedDatabase_Create(t *testing.T) {
2424 `{
2525 "name": "my-test-fixed-database",
2626 "protocol": "memcached",
27+ "redisVersion": "7.4",
2728 "respVersion": "resp2",
2829 "dataPersistence": "none",
2930 "dataEvictionPolicy": "noeviction",
@@ -84,6 +85,7 @@ func TestFixedDatabase_Create(t *testing.T) {
8485 fixedDatabases.CreateFixedDatabase {
8586 Name : redis .String ("my-test-fixed-database" ),
8687 Protocol : redis .String ("memcached" ),
88+ RedisVersion : redis .String ("7.4" ),
8789 RespVersion : redis .String ("resp2" ),
8890 DataPersistence : redis .String ("none" ),
8991 DataEvictionPolicy : redis .String ("noeviction" ),
@@ -124,6 +126,7 @@ func TestFixedDatabase_List(t *testing.T) {
124126 "protocol": "memcached",
125127 "provider": "AWS",
126128 "region": "us-west-1",
129+ "redisVersion": "7.4",
127130 "respVersion": "resp2",
128131 "status": "draft",
129132 "planMemoryLimit": 1,
@@ -228,6 +231,7 @@ func TestFixedDatabase_List(t *testing.T) {
228231 Protocol : redis .String ("memcached" ),
229232 Provider : redis .String ("AWS" ),
230233 Region : redis .String ("us-west-1" ),
234+ RedisVersion : redis .String ("7.4" ),
231235 RespVersion : redis .String ("resp2" ),
232236 Status : redis .String ("draft" ),
233237 PlanMemoryLimit : redis .Float64 (1 ),
@@ -286,6 +290,7 @@ func TestFixedDatabase_Get(t *testing.T) {
286290 "protocol": "memcached",
287291 "provider": "AWS",
288292 "region": "us-west-1",
293+ "redisVersion": "7.4",
289294 "respVersion": "resp2",
290295 "status": "draft",
291296 "planMemoryLimit": 1,
@@ -354,6 +359,7 @@ func TestFixedDatabase_Get(t *testing.T) {
354359 Protocol : redis .String ("memcached" ),
355360 Provider : redis .String ("AWS" ),
356361 Region : redis .String ("us-west-1" ),
362+ RedisVersion : redis .String ("7.4" ),
357363 RespVersion : redis .String ("resp2" ),
358364 Status : redis .String ("draft" ),
359365 PlanMemoryLimit : redis .Float64 (1 ),
@@ -546,3 +552,74 @@ func TestFixedDatabase_Delete(t *testing.T) {
546552 require .NoError (t , err )
547553
548554}
555+
556+ func TestFixedDatabase_UpgradeRedisVersion (t * testing.T ) {
557+ server := httptest .NewServer (
558+ testServer (
559+ "apiKey" ,
560+ "secret" ,
561+ postRequest (
562+ t ,
563+ "/fixed/subscriptions/111728/databases/51055029/upgrade" ,
564+ `{
565+ "targetRedisVersion": "7.4"
566+ }` ,
567+ `{
568+ "taskId": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
569+ "commandType": "fixedDatabaseUpgradeRedisVersionRequest",
570+ "status": "received",
571+ "description": "Task request received and is being queued for processing.",
572+ "timestamp": "2024-05-10T14:14:14.736763484Z",
573+ "links": [
574+ {
575+ "rel": "task",
576+ "type": "GET",
577+ "href": "https://api-staging.qa.redislabs.com/v1/tasks/a1b2c3d4-5678-90ab-cdef-1234567890ab"
578+ }
579+ ]
580+ }` ,
581+ ),
582+ getRequest (
583+ t ,
584+ "/tasks/a1b2c3d4-5678-90ab-cdef-1234567890ab" ,
585+ `{
586+ "taskId": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
587+ "commandType": "fixedDatabaseUpgradeRedisVersionRequest",
588+ "status": "processing-completed",
589+ "description": "Request processing completed successfully and its resources are now being provisioned / de-provisioned.",
590+ "timestamp": "2024-05-10T14:14:34.153537279Z",
591+ "response": {
592+ "resourceId": 51055029,
593+ "additionalResourceId": 111728
594+ },
595+ "links": [
596+ {
597+ "rel": "resource",
598+ "type": "GET",
599+ "href": "https://api-staging.qa.redislabs.com/v1/fixed/subscriptions/111728/databases/51055029"
600+ },
601+ {
602+ "rel": "self",
603+ "type": "GET",
604+ "href": "https://api-staging.qa.redislabs.com/v1/tasks/a1b2c3d4-5678-90ab-cdef-1234567890ab"
605+ }
606+ ]
607+ }` ,
608+ ),
609+ ),
610+ )
611+
612+ subject , err := clientFromTestServer (server , "apiKey" , "secret" )
613+ require .NoError (t , err )
614+
615+ err = subject .FixedDatabases .UpgradeRedisVersion (
616+ context .TODO (),
617+ 111728 ,
618+ 51055029 ,
619+ fixedDatabases.UpgradeRedisVersion {
620+ TargetRedisVersion : redis .String ("7.4" ),
621+ },
622+ )
623+
624+ require .NoError (t , err )
625+ }
0 commit comments