Hi,
Can someone please tell me what is the API to delete the virtual machine ? I am using Axis WS.
Thanks,
new_vbuser
API to delete VM
-
TerryE
- Volunteer
- Posts: 3572
- Joined: 28. May 2008, 08:40
- Primary OS: Ubuntu other
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
- Contact:
Welcome to our forum. You might want to take this opportunity to browse the Forum Posting Guide. This contains some useful tips on how to search for VBox knowledge and how to frame Qs. And with your username, I assume that you won't be posting here long otherwise you would become an old new user 
I find that the easiest way to work out what API calls to use is to look at the VBox code since this uses the API itself. You can download the OSE source from the download page, and the best routine to look at is src/VBox/Frontends/VBoxManage/VBoxManage.cpp. Alternatively you can also use the source browser. The routine that you want is handleUnregisterVM which is here in the online browser. This gives the following pseudo code for this delete (you would need to add error handling etc:
Given the lack of examples, this is really the best way to work out the API sequences. Hope this helps.
I find that the easiest way to work out what API calls to use is to look at the VBox code since this uses the API itself. You can download the OSE source from the download page, and the best routine to look at is src/VBox/Frontends/VBoxManage/VBoxManage.cpp. Alternatively you can also use the source browser. The routine that you want is handleUnregisterVM which is here in the online browser. This gives the following pseudo code for this delete (you would need to add error handling etc:
Code: Select all
IVirtualBox virtualBox
ISession session
IMachine machine
virtualBox.createLocalObject (CLSID_VirtualBox)
session.createInprocObject (CLSID_Session)
if exists guid
virtualBox.GetMachine(guid, machine)
else
virtualBox.FindMachine(strName, machine)
guid=machine.uuid
virtualBox.UnregisterMachine(guid, machine)
machine.DeleteSettings()Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
Google your Q site:VirtualBox.org or search for the answer before posting.