5.1

Table Of Contents
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, undeploy it and power it off, then use an HTTP DELETE request to delete the vApp object.
A deployed vApp has a link that you can use with a POST request to undeploy it and then take a power action
such as powering it off or suspending it. 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 to the vCloud API as a system administrator or the object owner.
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 Undeploy the vApp, and specify that it should also be powered off.
Make a POST request to the vApp's action/undeploy link, which has the following form:
<Link
rel="undeploy"
href="https://vcloud.example.com/api/vApp/vapp-7/action/undeploy"/>
In the request body, specify that the undeployment include powering off the vApp. See
“Example: Undeploy, Power Off, and Delete a vApp,” on page 39.
vCloud API Programming Guide
38 VMware, Inc.