mirror of
https://github.com/OpenNebula/one.git
synced 2024-12-25 23:21:29 +03:00
Signed-off-by: Pierre Lafievre <pierre.lafievre@iguanesolutions.com>
This commit is contained in:
parent
10d317123f
commit
de5deda28f
@ -291,11 +291,16 @@ func (vc *VMController) Resize(template string, enforce bool) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// Saveas exports a disk to an image. If imageType is empty the default one
|
||||
// will be used. If snapID is -1 the current image state will be exported
|
||||
func (vc *VMDiskController) Saveas(imageName, imageType string, snapID int) error {
|
||||
_, err := vc.c.Client.Call("one.vm.disksaveas", vc.entityID, vc.ID, imageName, imageType, snapID)
|
||||
return err
|
||||
// Saveas exports a disk to an image and returns the image ID.
|
||||
// If imageType is empty the default one will be used.
|
||||
// If snapID is -1 the current image state will be exported
|
||||
func (vc *VMDiskController) Saveas(imageName, imageType string, snapID int) (int, error) {
|
||||
response, err := vc.c.Client.Call("one.vm.disksaveas", vc.entityID, vc.ID, imageName, imageType, snapID)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
return response.BodyInt(), nil
|
||||
}
|
||||
|
||||
// SnapshotCreate will create a snapshot of the disk image
|
||||
|
Loading…
Reference in New Issue
Block a user