A Catalog object includes links that implement copy and move operations for the catalog items it contains.

To copy or move a catalog item from a source catalog to a target catalog, POST a CopyOrMoveCatalogItemParams element that contains a reference to the catalog item to move to the copy or move link of the target catalog.

Prerequisites

  • This operation requires the rights included in the predefined Catalog Author role or an equivalent set of rights. Verify that you are logged in to the vCloud Air Compute Service as a Virtual Infrastructure Administrator.

  • Verify that the target catalog does not have an external subscription.

Procedure

  1. Retrieve the XML representation of the source catalog.
    Use a request like this one:
    GET https://vcloud.example.com/api/catalog/32
  2. Examine the Catalog element to find the CatalogItem elements it contains.
    Each CatalogItem in the CatalogItems container has name, type, and href attributes. If you need more information about a catalog item, you can retrieve it with a GET request to the URL in its href attribute.
  3. Retrieve the XML representation of the target catalog.
  4. Examine the Catalog element to find the copy and move links it contains.
    These links have the following form:
    <Link
       rel="copy"
       type="application/vnd.vmware.vcloud.copyOrMoveCatalogItemParams+xml"
       href="https://vcloud.example.com/api/catalog/44/action/copy" />
    <Link
       rel="move"
       type="application/vnd.vmware.vcloud.copyOrMoveCatalogItemParams+xml"
       href="https://vcloud.example.com/api/catalog/44/action/move" />
  5. Create a CopyOrMoveCatalogItemParams element that specifies the catalog item in the Source element.
  6. POST the CopyOrMoveCatalogItemParams to the appropriate link from the target catalog.
    Option Description
    Copy the Catalog Item POST the CopyOrMoveCatalogItemParams to the rel="copy" link.
    Move the Catalog Item POST the CopyOrMoveCatalogItemParams to the rel="move" link.

Example: Copy a Catalog Item

This request copies the catalog item shown in Retrieve a Catalog Item to another catalog. The response is a Task.

Request:
POST https://vcloud.example.com/api/catalog/44/action/copy
Content-Type: application/vnd.vmware.vcloud.copyOrMoveCatalogItemParams+xml
...
<?xml version="1.0" encoding="UTF-8"?>
<CopyOrMoveCatalogItemParams
   xmlns="http://www.vmware.com/vcloud/v1.5"
   name="Ubuntu 10.04 Template">
   <Description>Reference copy of Ubuntu FTP Server</Description>
   <Source
      href="https://vcloud.example.com/api/catalogItem/221" />
</CopyOrMoveCatalogItemParams>
Response:
202 Accepted
Content-Type: application/vnd.vmware.vcloud.task+xml
...
<Task ... operation="Copying Virtual Application Template Ubuntu 10.04 Template" ...>
...
</Task>