@@ -260,13 +260,19 @@ func NewCmdLoadBalancer(base *cli.Base) *cobra.Command { //nolint:funlen,gocyclo
260
260
return fmt .Errorf ("error parsing flag 'instances' for load balancer create : %v" , errIn )
261
261
}
262
262
263
+ nodes , errNo := cmd .Flags ().GetInt ("nodes" )
264
+ if errNo != nil {
265
+ return fmt .Errorf ("error parsing flag 'nodes' for load balancer create : %v" , errNo )
266
+ }
267
+
263
268
o .CreateReq = & govultr.LoadBalancerReq {
264
269
Region : region ,
265
270
Label : label ,
266
271
VPC : & vpc ,
267
272
ProxyProtocol : & proxyProtocol ,
268
273
SSLRedirect : & sslRedirect ,
269
274
BalancingAlgorithm : algorithm ,
275
+ Nodes : nodes ,
270
276
Instances : instances ,
271
277
HealthCheck : & govultr.HealthCheck {
272
278
Port : port ,
@@ -403,6 +409,13 @@ When not provided, load balancer defaults to public network.`,
403
409
"(optional) an array of instances IDs that you want attached to the load balancer." ,
404
410
)
405
411
412
+ create .Flags ().IntP (
413
+ "nodes" ,
414
+ "n" ,
415
+ 1 ,
416
+ "(optional) The number of nodes to add to the load balancer (1-99), must be an odd number" ,
417
+ )
418
+
406
419
// Update
407
420
update := & cobra.Command {
408
421
Use : "update <Load Balancer ID>" ,
@@ -512,6 +525,11 @@ When not provided, load balancer defaults to public network.`,
512
525
return fmt .Errorf ("error parsing flag 'instances' for load balancer update : %v" , errIn )
513
526
}
514
527
528
+ nodes , errNo := cmd .Flags ().GetInt ("nodes" )
529
+ if errNo != nil {
530
+ return fmt .Errorf ("error parsing flag 'nodes' for load balancer update : %v" , errNo )
531
+ }
532
+
515
533
o .UpdateReq = & govultr.LoadBalancerReq {}
516
534
517
535
if len (rulesInForward ) > 0 {
@@ -609,6 +627,10 @@ When not provided, load balancer defaults to public network.`,
609
627
o .UpdateReq .Instances = instances
610
628
}
611
629
630
+ if cmd .Flags ().Changed ("nodes" ) {
631
+ o .UpdateReq .Nodes = nodes
632
+ }
633
+
612
634
if err := o .update (); err != nil {
613
635
return fmt .Errorf ("error updating load balancer : %v" , err )
614
636
}
@@ -686,6 +708,13 @@ When not provided, load balancer defaults to public network.`,
686
708
"(optional) an array of instances IDs that you want attached to the load balancer." ,
687
709
)
688
710
711
+ update .Flags ().IntP (
712
+ "nodes" ,
713
+ "n" ,
714
+ 1 ,
715
+ "(optional) The number of nodes to add to the load balancer (1-99), must be an odd number" ,
716
+ )
717
+
689
718
// Delete
690
719
del := & cobra.Command {
691
720
Use : "delete <Load Balancer ID>" ,
0 commit comments