VMware, Inc.
29
Chapter 2 Hello vCloud: A Structured REST Workflow Example
<IpAddress>10.147.122.134</IpAddress>
<IsConnected>true</IsConnected>
<MACAddress>00:50:56:01:01:49</MACAddress>
...
</NetworkConnection>
...
</NetworkConnectionSection>
<GuestCustomizationSection ...>
...
</GuestCustomizationSection>
<VAppScopedLocalId>20ea086f-1a6a-4fb2-8e2e-23372facf7de</VAppScopedLocalId>
</Vm>
</Children>
</VApp>
Displaying the Console
After
the
vApp
has
been
powered
on,
you
can
retrieve
a
screen
ticket
from
one
of
its
virtual
machines
and
use
that
ticket
to
gain
access
to
the
console
of
the
virtual
machine.
Retrieve a Screen Ticket
A
screen
ticket
is
a
string
that
includes
the
virtual
machine’s
IP
address,
its
managed
object
reference,
and
a
string
that
has
been
encoded
as
described
in
RFC
2396.
Each
Vm
element
in
a
vApp
includes
a
link
where
rel="screen:acquireTicket"
.
You
can
use
that
link
to
request
a
screen
ticket
that
you
can
use
with
the
vmware-vmrc
utility
to
open
a
VMware
Remote
Console
for
the
virtual
machine
represented
by
that
Vm
element.
Example 2
‐
9
makes
such
a
request
using
the
acquireTicket
link
returned
in
Example 2
‐
8
.
Example 2-9.
Get a Screen Ticket for a Virtual Machine
Request:
POST http://vcloud.example.com/api/v1.0/vApp/vm-4/screen/action/acquireTicket
Response:
200 OK
Content-Type: application/vnd.vmware.vcloud.screexml
...
<ScreenTicket xmlns="http://www.vmware.com/vcloud/v1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.vmware.com/vcloud/v1 ...>
mks://10.147.43.171/vm-61?ticket=Pznh4HMb7k%2FlniSLwyAD1fmlPIXOuSACKgEReF7ylTIn4qRkxhFv9QT7I3
SLTAQu%2F7W5RxVpDxjVKuuHQ4VIwu59F%2FG1WL1OmYMWistJC9tkRjQ1RRQiB1Oem5E7qX9O
</ScreenTicket>
The
ticket
itself
has
the
following
form:
mks://
ip-address
/
VM-MoRef
/ticket=
encoded-ticket
where:
ip
‐
address
is
the
IP
address
of
the
virtual
machine
VM
‐
MoRef
is
the
managed
object
reference
of
the
virtual
machine
encoded
‐
ticket
is
the
encoded
screen
ticket.
You
must
decode
this
ticket
using
a
function
such
as
URLDecoder
(Java)
or
url_escape
(PERL)
before
you
can
use
it.
The
ticket
is
valid
for
30
seconds.
Summary of Contents for VCLOUD API 1.0 - TECHNICAL NOTE
Page 10: ...vCloud API Programming Guide 10 VMware Inc...
Page 20: ...vCloud API Programming Guide 20 VMware Inc...
Page 32: ...vCloud API Programming Guide 32 VMware Inc...
Page 90: ...vCloud API Programming Guide 90 VMware Inc...
Page 150: ...vCloud API Programming Guide 150 VMware Inc...
Page 170: ...vCloud API Programming Guide 170 VMware Inc...