Skip to content

Commit

Permalink
condition/serverControl: Add control action to set pxe boot and power…
Browse files Browse the repository at this point in the history
… on/cycle the server
  • Loading branch information
joelrebel committed Aug 22, 2024
1 parent b0e2d57 commit d74bb11
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions condition/server_control.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ const (
// - utilities
SetNextBootDevice ServerControlAction = "set_next_boot_device"

// Set PXE boot persistent and power on/cycle the server
PxeBootPersistent ServerControlAction = "pxe_boot_persistent"

// PowerCycleBMC power cycles the BMC
PowerCycleBMC ServerControlAction = "power_cycle_bmc"

Expand Down Expand Up @@ -94,6 +97,14 @@ func (p *ServerControlTaskParameters) Marshal() (json.RawMessage, error) {
return json.Marshal(p)
}

func (p *ServerControlTaskParameters) MustJSON() []byte {
byt, err := json.Marshal(p)
if err != nil {
panic(err)
}
return byt
}

func NewServerControlTaskParameters(assetID uuid.UUID, action ServerControlAction, controlParam string, bootDevicePersistent, efiBoot bool) *ServerControlTaskParameters {
return &ServerControlTaskParameters{
AssetID: assetID,
Expand Down

0 comments on commit d74bb11

Please sign in to comment.