1.5

Table Of Contents
Example: ResourceEntity and Corresponding CatalogItem
This example starts with this ResourceEntity, which references a vApp template.
<ResourceEntity
href="https://vcloud.example.com/api/vAppTemplate/vappTemplate-111"
type="application/vnd.vmware.vcloud.vAppTemplate+xml"
name="Ubuntu Template with vsftpd"/>
Follow these guidelines to create a CatalogItem from a ResourceEntity.
n
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.
n
The Description element of the CatalogItem can be the same as the Description element for the object
that the ResourceEntity element references, or you can create a Description element.
n
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.
This request creates the catalog item that is retrieved in “Example: Retrieve a Catalog Item,” on page 29. The
response echoes the request, and includes links that an administrator or catalog owner can use to manage the
CatalogItem and its metadata.
Request:
POST https://vcloud.example.com/api/catalog/32/catalogItems
Content-Type: application/vnd.vmware.vcloud.catalogItem+xml
...
<?xml version="1.0" encoding="UTF-8"?>
<CatalogItem
name="Ubuntu Template with vsftpd"
type="application/vnd.vmware.vcloud.catalogItem+xml"
xmlns="http://www.vmware.com/vcloud/v1.5">
<Description>Approved template for public FTP sites</Description>
<Entity
href="https://vcloud.example.com/api/vAppTemplate/vappTemplate-111"/>
</CatalogItem>
Response:
200 OK
Content-Type: application/vnd.vmware.vcloud.catalogItem+xml
...
<CatalogItem
xmlns="http://www.vmware.com/vcloud/v1.5"
name="Ubuntu Template with vsftpd"
id="urn:vcloud:catalogitem:221"
href="https://vcloud.example.com/api/catalogItem/221" ... >
<Link
rel="up"
type="application/vnd.vmware.vcloud.catalog+xml"
href="https://vcloud.example.com/api/catalog/32" />
<Link
rel="down"
type="application/vnd.vmware.vcloud.metadata+xml"
href="https://vcloud.example.com/api/catalogItem/221/metadata" />
<Link
rel="edit"
vCloud API Programming Guide
72 VMware, Inc.