VMware, Inc.
13
3
This
chapter
presents
an
example
of
using
the
vCloud
SDK
for
Java
to
implement
a
structured
workflow
through
the
lifecycle
of
a
vApp.
It
contains
the
following
topics.
“Running
the
HellovCloud
Sample”
on
page 13
“Logging
In
and
Getting
an
Organization
List”
on
page 14
“Getting
References
to
the
vDC
and
Catalog”
on
page 14
“Upload
an
OVF
Package
to
Create
a
vApp
Template”
on
page 15
“Add
the
vApp
Template
to
a
Catalog”
on
page 16
“Instantiate
the
vApp
Template”
on
page 16
“Operate
the
vApp”
on
page 17
Running the HellovCloud Sample
The
HellovCloud.java
sample,
included
in
the
samples
folder
of
vcloud-java-sdk-samples-1.0-sources.jar
,
demonstrates
a
number
of
the
operations
supported
by
the
vCloud
SDK
for
Java:
Logging
in
to
the
vCloud
Uploading
an
OVF
package
to
create
a
vApp
template
Adding
the
vApp
template
to
a
catalog
Instantiating
the
vApp
template
to
create
a
vApp
Operating
the
vApp
The
file
HellovCloud.txt
in
that
folder
includes
sample
input
and
output.
The
examples
shown
in
this
section
are
extracted
from
the
HellovCloud.java
sample.
To
run
the
HellovCloud.java
sample,
use
the
following
command
line.
java HellovCloud
vCloudApiVersionsURL versionId user@vcloud-organization password orgName vdcName
ovfFileLocation vmdkFileLocation vmdkFileName catalogName
where:
vCloudApiVersionsURL
is
the
base
API
URL
of
the
vCloud.
versionId
is
the
version
of
the
API
to
use
(always
1.0
for
this
release).
username
is
the
name
of
a
Cloud
Director
user,
in
the
form
user
@
vcloud
‐
organization
,
who
has
rights
to
upload
OVF,
create
vApp
templates,
create
vApps,
and
operate
vApps.
password
is
the
user’s
password.
Hello vCloud: A Structured Java
Workflow Example
3