@@ -22,6 +22,7 @@ func GetGeneratedCommands() *core.Commands {
22
22
baremetalRoot (),
23
23
baremetalServer (),
24
24
baremetalOs (),
25
+ baremetalBmc (),
25
26
baremetalServerList (),
26
27
baremetalServerGet (),
27
28
baremetalServerCreate (),
@@ -31,6 +32,9 @@ func GetGeneratedCommands() *core.Commands {
31
32
baremetalServerReboot (),
32
33
baremetalServerStart (),
33
34
baremetalServerStop (),
35
+ baremetalBmcStart (),
36
+ baremetalBmcGet (),
37
+ baremetalBmcStop (),
34
38
baremetalOsList (),
35
39
baremetalOsGet (),
36
40
)
@@ -61,6 +65,17 @@ func baremetalOs() *core.Command {
61
65
}
62
66
}
63
67
68
+ func baremetalBmc () * core.Command {
69
+ return & core.Command {
70
+ Short : `Baseboard Management Controller (BMC) management commands` ,
71
+ Long : `Baseboard Management Controller (BMC) allows you to remotely access the low-level parameters of your dedicated server.
72
+ For instance, your KVM-IP management console could be accessed with it.
73
+ ` ,
74
+ Namespace : "baremetal" ,
75
+ Resource : "bmc" ,
76
+ }
77
+ }
78
+
64
79
func baremetalServerList () * core.Command {
65
80
return & core.Command {
66
81
Short : `List baremetal servers` ,
@@ -496,6 +511,104 @@ func baremetalServerStop() *core.Command {
496
511
}
497
512
}
498
513
514
+ func baremetalBmcStart () * core.Command {
515
+ return & core.Command {
516
+ Short : `Start BMC (Baseboard Management Controller) access for a given baremetal server` ,
517
+ Long : `Start BMC (Baseboard Management Controller) access associated with the given ID.
518
+ The BMC (Baseboard Management Controller) access is available one hour after the installation of the server.
519
+ ` ,
520
+ Namespace : "baremetal" ,
521
+ Resource : "bmc" ,
522
+ Verb : "start" ,
523
+ ArgsType : reflect .TypeOf (baremetal.StartBMCAccessRequest {}),
524
+ ArgSpecs : core.ArgSpecs {
525
+ {
526
+ Name : "server-id" ,
527
+ Short : `ID of the server` ,
528
+ Required : true ,
529
+ Positional : false ,
530
+ },
531
+ {
532
+ Name : "ip" ,
533
+ Short : `The IP authorized to connect to the given server` ,
534
+ Required : true ,
535
+ Positional : false ,
536
+ },
537
+ core .ZoneArgSpec (scw .ZoneFrPar2 ),
538
+ },
539
+ Run : func (ctx context.Context , args interface {}) (i interface {}, e error ) {
540
+ request := args .(* baremetal.StartBMCAccessRequest )
541
+
542
+ client := core .ExtractClient (ctx )
543
+ api := baremetal .NewAPI (client )
544
+ return api .StartBMCAccess (request )
545
+
546
+ },
547
+ }
548
+ }
549
+
550
+ func baremetalBmcGet () * core.Command {
551
+ return & core.Command {
552
+ Short : `Get BMC (Baseboard Management Controller) access for a given baremetal server` ,
553
+ Long : `Get the BMC (Baseboard Management Controller) access associated with the given ID.` ,
554
+ Namespace : "baremetal" ,
555
+ Resource : "bmc" ,
556
+ Verb : "get" ,
557
+ ArgsType : reflect .TypeOf (baremetal.GetBMCAccessRequest {}),
558
+ ArgSpecs : core.ArgSpecs {
559
+ {
560
+ Name : "server-id" ,
561
+ Short : `ID of the server` ,
562
+ Required : true ,
563
+ Positional : false ,
564
+ },
565
+ core .ZoneArgSpec (scw .ZoneFrPar2 ),
566
+ },
567
+ Run : func (ctx context.Context , args interface {}) (i interface {}, e error ) {
568
+ request := args .(* baremetal.GetBMCAccessRequest )
569
+
570
+ client := core .ExtractClient (ctx )
571
+ api := baremetal .NewAPI (client )
572
+ return api .GetBMCAccess (request )
573
+
574
+ },
575
+ }
576
+ }
577
+
578
+ func baremetalBmcStop () * core.Command {
579
+ return & core.Command {
580
+ Short : `Stop BMC (Baseboard Management Controller) access for a given baremetal server` ,
581
+ Long : `Stop BMC (Baseboard Management Controller) access associated with the given ID.` ,
582
+ Namespace : "baremetal" ,
583
+ Resource : "bmc" ,
584
+ Verb : "stop" ,
585
+ ArgsType : reflect .TypeOf (baremetal.StopBMCAccessRequest {}),
586
+ ArgSpecs : core.ArgSpecs {
587
+ {
588
+ Name : "server-id" ,
589
+ Short : `ID of the server` ,
590
+ Required : true ,
591
+ Positional : false ,
592
+ },
593
+ core .ZoneArgSpec (scw .ZoneFrPar2 ),
594
+ },
595
+ Run : func (ctx context.Context , args interface {}) (i interface {}, e error ) {
596
+ request := args .(* baremetal.StopBMCAccessRequest )
597
+
598
+ client := core .ExtractClient (ctx )
599
+ api := baremetal .NewAPI (client )
600
+ e = api .StopBMCAccess (request )
601
+ if e != nil {
602
+ return nil , e
603
+ }
604
+ return & core.SuccessResult {
605
+ Resource : "bmc" ,
606
+ Verb : "stop" ,
607
+ }, nil
608
+ },
609
+ }
610
+ }
611
+
499
612
func baremetalOsList () * core.Command {
500
613
return & core.Command {
501
614
Short : `List all available OS that can be install on a baremetal server` ,
0 commit comments