VMware, Inc.
23
Chapter 2 Hello vCloud: A Structured REST Workflow Example
Finding a vApp Template
The
client
can
use
the
catalog
URL
shown
in
Example 2
‐
2
as
the
target
of
a
GET
request
that
returns
the
contents
of
the
catalog,
as
shown
in
Example 2
‐
3
.
Example 2-3.
Finding a vApp Template in a Catalog
Request:
GET http://vcloud.example.com/api/v1.0/catalog/32
Response:
200 OK
Content-Type: application/vnd.vmware.vcloud.xml
...
<Catalog name="MainCatalog" type="application/vnd.vmware.vcloud.xml"
href="http://vcloud.example.com/api/v1.0/catalog/32" ...>
...
<Description>Main Org Catalog</Description>
<CatalogItems>
...
<CatalogItem type="application/vnd.vmware.vcloud.cataxml" name="Ubuntu Template
with vsftpd" href="http://vcloud.example.com/api/v1.0/catalogItem/221"/>
...
</CatalogItems>
...
</Catalog>
Every
vApp
template
or
media
image
that
has
been
added
to
the
catalog
is
represented
as
a
CatalogItem
element.
When
a
client
browses
a
catalog,
it
can
read
only
the
name
,
type
,
and
href
of
each
CatalogItem
.
To
retrieve
an
item
from
the
catalog,
more
information
is
required.
In
Example 2
‐
4
,
the
client
makes
a
GET
request
to
a
CatalogItem
URL
(its
href
value).
The
response
provides
more
information,
including
a
description
of
the
referenced
object
and
another
URL
that
the
client
can
use
to
retrieve
a
representation
of
the
object.
Example 2-4.
Getting the vApp Template URL From a CatalogItem
Request:
GET http://vcloud.example.com/api/v1.0/catalogItem/221
Response:
200 OK
Content-Type: application/vnd.vmware.vcloud.cataxml
...
<CatalogItem name="Ubuntu Template with vsftpd"
href="http://vcloud.example.com/api/v1.0/catalogItem/221" ...>
...
<Description>Ubuntu Template with vsftpd</Description>
<Entity href="http://vcloud.example.com/api/v1.0/vAppTemplate/vappTemplate-111"
type="application/vnd.vmware.vcloud.vAppTxml" name="Ubuntu Template
with vsftpd"/>
...
</CatalogItem>
This
response
shows
that
a
suitable
vApp
template
can
be
found
at
http://vcloud.example.com/api/v1.0/vAppTemplate/vappTemplate
‐
111.
Содержание VCLOUD API 1.0 - TECHNICAL NOTE
Страница 10: ...vCloud API Programming Guide 10 VMware Inc...
Страница 20: ...vCloud API Programming Guide 20 VMware Inc...
Страница 32: ...vCloud API Programming Guide 32 VMware Inc...
Страница 90: ...vCloud API Programming Guide 90 VMware Inc...
Страница 150: ...vCloud API Programming Guide 150 VMware Inc...
Страница 170: ...vCloud API Programming Guide 170 VMware Inc...
Страница 202: ...vCloud API Programming Guide 202 VMware Inc...
Страница 212: ...vCloud API Programming Guide 212 VMware Inc...