VMware, Inc.
55
Chapter 4 Provisioning
To add an item to a catalog
1
Browse
the
vDCs
in
an
organization
to
find
ResourceEntity
elements
that
reference
the
item
you
want
to
add
to
the
catalog.
2
Create
a
CatalogItem
element
that
contains
a
reference
to
the
item.
Example 3
‐
4
on
page 37
lists
a
number
of
ResourceEntity
elements
in
a
vDC.
To
create
a
CatalogItem
that
references
this
one:
<ResourceEntity href="http://vcloud.example.com/api/v1.0/vAppTemplate/vappTemplate-111"
type="application/vnd.vmware.vcloud.vAppTxml" name="Ubuntu Template
with vsftpd"/>
follow
these
guidelines:
The
name
attribute
of
the
CatalogItem
can
be
the
same
as
the
one
in
the
ResourceEntity
,
or
you
can
make
up
a
new
value
for
name
.
The
Description
element
of
the
CatalogItem
can
be
the
same
as
the
Description
element
for
the
object
referenced
by
the
ResourceEntity
,
or
you
can
make
up
a
new
Description
.
The
href
attribute
of
the
Entity
element
in
the
CatalogItem
must
have
the
same
value
as
the
href
attribute
of
the
ResourceEntity
that
the
CatalogItem
references.
Property
elements
are
optional
in
any
CatalogItem.
For
more
information
about
how
these
elements
can
be
used,
see
Property
on
page 161
.
3
POST
the
CatalogItem
body
to
the
rel="add"
URL
included
in
the
Catalog
body.
Example 4
‐
22
adds
a
CatalogItem
to
the
catalog
listed
in
Example 3
‐
2
on
page 35
.
Example 4-22.
Add an Item to a Catalog
Request:
POST http://vcloud.example.com/api/v1.0/catalog/32/catalogItems
Content-Type: application/vnd.vmware.vcloud.cataxml
<CatalogItem name="Ubuntu Template with vsftpd" xmlns="http://www.vmware.com/vcloud/v1">
<Description>Approved template for public FTP sites</Description>
<Entity href="http://vcloud.example.com/api/v1.0/vAppTemplate/vappTemplate-111"/>
<Property key="Owner">Tech Ops</Property>
</CatalogItem>
Response:
201 Created
Content-Type: application/vnd.vmware.vcloud.cataxml
...
<CatalogItem name="Ubuntu Template with vsftpd"
type="application/vnd.vmware.vcloud.cataxml"
href="http://vcloud.example.com/api/v1.0/catalogItem/221" ...>
<Link rel="edit" type="application/vnd.vmware.vcloud.cataxml"
href="http://vcloud.example.com/api/v1.0/catalogItem/221"/>
<Link rel="up" type="application/vnd.vmware.vcloud.xml"
href="http://vcloud.example.com/api/v1.0/catalog/32"/>
<Link rel="remove" href="http://vcloud.example.com/api/v1.0/catalogItem/221"/>
<Description>Approved template for public FTP sites</Description>
<Entity href="http://vcloud.example.com/api/v1.0/vAppTemplate/vappTemplate-111"/>
<Property key="Owner">Tech Ops</Property>
</CatalogItem>
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...