Skip to content

Commit

Permalink
add MachineCycle (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwennrich authored Jul 21, 2021
1 parent cc9a356 commit ff001b4
Show file tree
Hide file tree
Showing 5 changed files with 388 additions and 1 deletion.
40 changes: 40 additions & 0 deletions api/client/machine/machine_client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

170 changes: 170 additions & 0 deletions api/client/machine/machine_cycle_parameters.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

116 changes: 116 additions & 0 deletions api/client/machine/machine_cycle_responses.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,21 @@ func (d *Driver) MachinePowerReset(machineID string) (*MachinePowerResponse, err
return response, nil
}

// MachinePowerCycle power-cycles the given machine
func (d *Driver) MachinePowerCycle(machineID string) (*MachinePowerResponse, error) {
machineCycle := machine.NewMachineCycleParams()
machineCycle.ID = machineID
machineCycle.Body = []string{}

response := &MachinePowerResponse{}
resp, err := d.machine.MachineCycle(machineCycle, nil)
if err != nil {
return response, err
}
response.Machine = resp.Payload
return response, nil
}

// MachineBootBios boots given machine into BIOS
func (d *Driver) MachineBootBios(machineID string) (*MachineFirmwareResponse, error) {
machineBios := machine.NewMachineBiosParams()
Expand Down
Loading

0 comments on commit ff001b4

Please sign in to comment.