feat(vm.importBackup): returns the new VM id (#345)
This commit is contained in:
parent
d02358ac0d
commit
9460822529
@ -804,9 +804,7 @@ exports.backup = backup
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
|
||||
importBackup = $coroutine ({remote, file, sr}) ->
|
||||
yield @importVmBackup(remote, file, sr)
|
||||
return
|
||||
importBackup = ({remote, file, sr}) -> @importVmBackup(remote, file, sr)
|
||||
|
||||
importBackup.permission = 'admin'
|
||||
importBackup.description = 'Imports a VM into host, from a file found in the chosen remote'
|
||||
|
@ -106,7 +106,8 @@ export default class {
|
||||
const stream = await handler.createReadStream(file)
|
||||
const xapi = this._xo.getXapi(sr)
|
||||
|
||||
await xapi.importVm(stream, { srId: sr._xapiId })
|
||||
const vm = await xapi.importVm(stream, { srId: sr._xapiId })
|
||||
return xapiObjectToXo(vm).id
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user