@@ -20,7 +20,11 @@ func TestClusters_ListClusters(t *testing.T) {
2020 "results": [
2121 {
2222 "autoScaling": {
23- "diskGBEnabled": true
23+ "diskGBEnabled": true,
24+ "compute": {
25+ "enabled": true,
26+ "scaleDownEnabled": true
27+ }
2428 },
2529 "backupEnabled": true,
2630 "biConnector": {
@@ -55,7 +59,13 @@ func TestClusters_ListClusters(t *testing.T) {
5559 "diskIOPS": 1320,
5660 "encryptEBSVolume": false,
5761 "instanceSizeName": "M40",
58- "regionName": "US_WEST_2"
62+ "regionName": "US_WEST_2",
63+ "autoScaling": {
64+ "compute": {
65+ "maxInstanceSize": "M60",
66+ "minInstanceSize": "M10"
67+ }
68+ }
5969 },
6070 "replicationFactor": 3,
6171 "replicationSpec": {
@@ -70,7 +80,11 @@ func TestClusters_ListClusters(t *testing.T) {
7080 },
7181 {
7282 "autoScaling": {
73- "diskGBEnabled": true
83+ "diskGBEnabled": true,
84+ "compute": {
85+ "enabled": true,
86+ "scaleDownEnabled": true
87+ }
7488 },
7589 "backupEnabled": true,
7690 "biConnector": {
@@ -105,7 +119,13 @@ func TestClusters_ListClusters(t *testing.T) {
105119 "diskIOPS": 1320,
106120 "encryptEBSVolume": false,
107121 "instanceSizeName": "M40",
108- "regionName": "US_WEST_2"
122+ "regionName": "US_WEST_2",
123+ "autoScaling": {
124+ "compute": {
125+ "maxInstanceSize": "M60",
126+ "minInstanceSize": "M10"
127+ }
128+ }
109129 },
110130 "replicationFactor": 3,
111131 "replicationSpec": {
@@ -129,7 +149,13 @@ func TestClusters_ListClusters(t *testing.T) {
129149 }
130150
131151 cluster1 := Cluster {
132- AutoScaling : & AutoScaling {DiskGBEnabled : pointy .Bool (true )},
152+ AutoScaling : & AutoScaling {
153+ DiskGBEnabled : pointy .Bool (true ),
154+ Compute : & Compute {
155+ Enabled : pointy .Bool (true ),
156+ ScaleDownEnabled : pointy .Bool (true ),
157+ },
158+ },
133159 BackupEnabled : pointy .Bool (true ),
134160 BiConnector : & BiConnector {Enabled : pointy .Bool (false ), ReadPreference : "secondary" },
135161 ClusterType : "REPLICASET" ,
@@ -141,6 +167,7 @@ func TestClusters_ListClusters(t *testing.T) {
141167 Private : "mongodb://cluster0-shard-00-00-pri.auylw.mongodb.net:27017,cluster0-shard-00-01-pri.auylw.mongodb.net:27017,cluster0-shard-00-02-pri.auylw.mongodb.net:27017/?ssl=true&authSource=admin&replicaSet=Cluster0-shard-0" ,
142168 PrivateSrv : "mongodb+srv://cluster0-pri.auylw.mongodb.net" ,
143169 },
170+
144171 DiskSizeGB : pointy .Float64 (160 ),
145172 EncryptionAtRestProvider : "AWS" ,
146173 GroupID : "5356823b3794de37132bb7b" ,
@@ -157,6 +184,12 @@ func TestClusters_ListClusters(t *testing.T) {
157184 EncryptEBSVolume : pointy .Bool (false ),
158185 InstanceSizeName : "M40" ,
159186 RegionName : "US_WEST_2" ,
187+ AutoScaling : & AutoScaling {
188+ Compute : & Compute {
189+ MaxInstanceSize : "M60" ,
190+ MinInstanceSize : "M10" ,
191+ },
192+ },
160193 },
161194 ReplicationFactor : pointy .Int64 (3 ),
162195
@@ -262,8 +295,9 @@ func TestClusters_Create(t *testing.T) {
262295 groupID := "1"
263296
264297 createRequest := & Cluster {
265- ID : "1" ,
266- AutoScaling : & AutoScaling {DiskGBEnabled : pointy .Bool (true )},
298+ ID : "1" ,
299+ AutoScaling : & AutoScaling {DiskGBEnabled : pointy .Bool (true ),
300+ Compute : & Compute {Enabled : pointy .Bool (true ), ScaleDownEnabled : pointy .Bool (true )}},
267301 BackupEnabled : pointy .Bool (true ),
268302 BiConnector : & BiConnector {Enabled : pointy .Bool (false ), ReadPreference : "secondary" },
269303 ClusterType : "REPLICASET" ,
@@ -283,6 +317,7 @@ func TestClusters_Create(t *testing.T) {
283317 EncryptEBSVolume : pointy .Bool (false ),
284318 InstanceSizeName : "M40" ,
285319 RegionName : "US_WEST_2" ,
320+ AutoScaling : & AutoScaling {Compute : & Compute {MinInstanceSize : "M10" , MaxInstanceSize : "M60" }},
286321 },
287322 ReplicationFactor : pointy .Int64 (3 ),
288323
@@ -302,6 +337,10 @@ func TestClusters_Create(t *testing.T) {
302337 "id" : "1" ,
303338 "autoScaling" : map [string ]interface {}{
304339 "diskGBEnabled" : true ,
340+ "compute" : map [string ]interface {}{
341+ "enabled" : true ,
342+ "scaleDownEnabled" : true ,
343+ },
305344 },
306345 "backupEnabled" : true ,
307346 "biConnector" : map [string ]interface {}{
@@ -325,6 +364,12 @@ func TestClusters_Create(t *testing.T) {
325364 "encryptEBSVolume" : false ,
326365 "instanceSizeName" : "M40" ,
327366 "regionName" : "US_WEST_2" ,
367+ "autoScaling" : map [string ]interface {}{
368+ "compute" : map [string ]interface {}{
369+ "minInstanceSize" : "M10" ,
370+ "maxInstanceSize" : "M60" ,
371+ },
372+ },
328373 },
329374 "replicationFactor" : float64 (3 ),
330375 "replicationSpec" : map [string ]interface {}{
@@ -342,7 +387,11 @@ func TestClusters_Create(t *testing.T) {
342387 {
343388 "id":"1",
344389 "autoScaling": {
345- "diskGBEnabled": true
390+ "diskGBEnabled": true,
391+ "compute": {
392+ "enabled": true,
393+ "scaleDownEnabled": true
394+ }
346395 },
347396 "backupEnabled": true,
348397 "biConnector": {
@@ -366,7 +415,13 @@ func TestClusters_Create(t *testing.T) {
366415 "diskIOPS": 1320,
367416 "encryptEBSVolume": false,
368417 "instanceSizeName": "M40",
369- "regionName": "US_WEST_2"
418+ "regionName": "US_WEST_2",
419+ "autoScaling": {
420+ "compute": {
421+ "minInstanceSize": "M10",
422+ "maxInstanceSize": "M60"
423+ }
424+ }
370425 },
371426 "replicationFactor": 3,
372427 "replicationSpec": {
@@ -422,8 +477,9 @@ func TestClusters_Update(t *testing.T) {
422477 clusterName := "AppData"
423478
424479 updateRequest := & Cluster {
425- ID : "1" ,
426- AutoScaling : & AutoScaling {DiskGBEnabled : pointy .Bool (true )},
480+ ID : "1" ,
481+ AutoScaling : & AutoScaling {DiskGBEnabled : pointy .Bool (true ),
482+ Compute : & Compute {Enabled : pointy .Bool (true ), ScaleDownEnabled : pointy .Bool (true )}},
427483 BackupEnabled : pointy .Bool (true ),
428484 BiConnector : & BiConnector {Enabled : pointy .Bool (false ), ReadPreference : "secondary" },
429485 ClusterType : "REPLICASET" ,
@@ -443,6 +499,7 @@ func TestClusters_Update(t *testing.T) {
443499 EncryptEBSVolume : pointy .Bool (false ),
444500 InstanceSizeName : "M40" ,
445501 RegionName : "US_WEST_2" ,
502+ AutoScaling : & AutoScaling {Compute : & Compute {MinInstanceSize : "M20" , MaxInstanceSize : "M80" }},
446503 },
447504 ReplicationFactor : pointy .Int64 (3 ),
448505
@@ -462,6 +519,10 @@ func TestClusters_Update(t *testing.T) {
462519 "id" : "1" ,
463520 "autoScaling" : map [string ]interface {}{
464521 "diskGBEnabled" : true ,
522+ "compute" : map [string ]interface {}{
523+ "enabled" : true ,
524+ "scaleDownEnabled" : true ,
525+ },
465526 },
466527 "backupEnabled" : true ,
467528 "biConnector" : map [string ]interface {}{
@@ -485,6 +546,12 @@ func TestClusters_Update(t *testing.T) {
485546 "encryptEBSVolume" : false ,
486547 "instanceSizeName" : "M40" ,
487548 "regionName" : "US_WEST_2" ,
549+ "autoScaling" : map [string ]interface {}{
550+ "compute" : map [string ]interface {}{
551+ "minInstanceSize" : "M20" ,
552+ "maxInstanceSize" : "M80" ,
553+ },
554+ },
488555 },
489556 "replicationFactor" : float64 (3 ),
490557 "replicationSpec" : map [string ]interface {}{
@@ -501,7 +568,11 @@ func TestClusters_Update(t *testing.T) {
501568 jsonBlob := `
502569 {
503570 "autoScaling": {
504- "diskGBEnabled": true
571+ "diskGBEnabled": true,
572+ "compute": {
573+ "enabled": true,
574+ "scaleDownEnabled": true
575+ }
505576 },
506577 "backupEnabled": true,
507578 "biConnector": {
@@ -525,7 +596,13 @@ func TestClusters_Update(t *testing.T) {
525596 "diskIOPS": 1320,
526597 "encryptEBSVolume": false,
527598 "instanceSizeName": "M40",
528- "regionName": "US_WEST_2"
599+ "regionName": "US_WEST_2",
600+ "autoScaling": {
601+ "compute": {
602+ "minInstanceSize": "M10",
603+ "maxInstanceSize": "M60"
604+ }
605+ }
529606 },
530607 "replicationFactor": 3,
531608 "replicationSpec": {
0 commit comments