chore(xo-server/vm.reboot): move into Xapi#rebootVm
This commit is contained in:
@@ -630,13 +630,7 @@ set.resolve = {
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
export async function restart({ vm, force = false }) {
|
||||
const xapi = this.getXapi(vm)
|
||||
|
||||
if (force) {
|
||||
await xapi.call('VM.hard_reboot', vm._xapiRef)
|
||||
} else {
|
||||
await xapi.call('VM.clean_reboot', vm._xapiRef)
|
||||
}
|
||||
return this.getXapi(vm).rebootVm(vm._xapiId, { hard: force })
|
||||
}
|
||||
|
||||
restart.params = {
|
||||
|
||||
@@ -513,6 +513,13 @@ export default {
|
||||
return this.call('VM.unpause', this.getObject(vmId).$ref)
|
||||
},
|
||||
|
||||
rebootVm(vmId, { hard = false } = {}) {
|
||||
return this.callAsync(
|
||||
`VM.${hard ? 'hard' : 'clean'}_reboot`,
|
||||
this.getObject(vmId).$ref
|
||||
).then(noop)
|
||||
},
|
||||
|
||||
shutdownVm(vmId, { hard = false } = {}) {
|
||||
return this.call(
|
||||
`VM.${hard ? 'hard' : 'clean'}_shutdown`,
|
||||
|
||||
Reference in New Issue
Block a user