1.5

Table Of Contents
n
Verify that your browser has an installed copy of the vmware-vmrc plug-in. This plug-in is installed by your
browser whenever you use the vCloud Director Web Console to access the console of a running virtual
machine. After this plug-in is installed, you can find it in the folder where your browser stores plug-ins.
Procedure
1 Retrieve the screen ticket.
POST a request to the acquireTicket link of the Vm.
Request:
POST https://vcloud.example.com/api/vApp/vm-4/screen/action/acquireTicket
Response:
200 OK
Content-Type: application/vnd.vmware.vcloud.screenTicket+xml
...
<ScreenTicket xmlns="http://www.vmware.com/vcloud/v1.5"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.vmware.com/vcloud/v1 ...>
ticket-string
</ScreenTicket>
The ticket string itself has the following form:
mks://
ip-address
/
VM-MoRef
/ticket=
encoded-ticket
n
ip-address is the IP address of the virtual machine.
n
VM-MoRef is the managed object reference of the virtual machine.
n
encoded-ticket is the encoded screen ticket. You must decode this ticket using a function such as the
Java URLDecoder or PERL url_escape before you can use it.
2 Use the ticket with the VMRC API.
The ticket is valid for 30 seconds. To use it, you must initialize the VMRC browser plug-in and use the
VMRC API, as described in the VMware Technical Note Using the VMRC API.
Delete the vApp
To delete the vApp, power it off, undeploy it, and then use an HTTP DELETE request to delete the vApp object.
A powered-on vApp has a link that you can use with a POST request to power it off. A powered-off vApp has
a link that you can use with a DELETE request to remove it.
Prerequisites
Verify that you are logged in as a system administrator or member of an organization in the cloud.
Procedure
1 Retrieve the XML representation of the vApp.
Make a GET request to the URL provided in the href attribute of the VApp element returned when you
created the vApp from the template. See “Get Information About a vApp,” on page 34.
2 Power off the vApp.
Make a POST request to the vApp's power/action/powerOff link, which has the following form:
<Link
rel="power:powerOff"
href="https://vcloud.example.com/api/vApp/vapp-7/power/action/powerOff"/>
vCloud API Programming Guide
38 VMware, Inc.