VMware Cloud Director API - POST-UploadVAppTemplate

VMware Cloud Director API - POST-UploadVAppTemplate

POST /catalog/{id}/action/upload

Operation:
POST /catalog/{id}/action/upload
Description:
Upload a vApp template to a catalog
Since:
5.5
Input parameters
Consume media type(s):
application/vnd.vmware.vcloud.uploadVAppTemplateParams+xml
application/vnd.vmware.vcloud.uploadVAppTemplateParams+json
Input type:
UploadVAppTemplateParamsType
Output parameters
CatalogItemType

The response is the CatalogItemType. The API client then need to make another call to the referenced media entity in order to get the upload URI.

Produce media type(s):
application/vnd.vmware.vcloud.catalogItem+xml
application/vnd.vmware.vcloud.catalogItem+json
Output type:
CatalogItemType
Examples
Request
HTTP 1.1
POST /api/catalog/5aac6b64-e4e6-4be3-83c8-58248efd67aa/action/upload

Headers:
Content-Length: 462
Content-Type: application/vnd.vmware.vcloud.media+xml; charset=ISO-8859-1
x-vcloud-authorization: /LOwXxsAG2/2J87P4zt3nZ2dkxZXke77j6cFEpCExac=

Body:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<vcloud:Media
    xmlns:vcloud="http://www.vmware.com/vcloud/v1.5"
    imageType="iso"
    name="Uploaded Media Name"
    operationKey="operationKey"
    size="14427">
    <vcloud:Description>Uploaded Media Description</vcloud:Description>
    <vcloud:VdcStorageProfile
        href="https://vcloud.example.com/api/vdcStorageProfile/2fe57ba0-a6f9-436e-8b32-fb7daad3194d"
        name="*"
        type="application/vnd.vmware.vcloud.vdcStorageProfile+xml"/>
</vcloud:Media>
Response
HTTP/1.1 201 Created

Headers:
Content-Length: 1397
Content-Type: application/vnd.vmware.vcloud.catalogItem+xml; version=5.5
Location: https://vcloud.example.com/api/catalogItem/345ccca0-ea8c-436f-bb05-4a6b2d122a31
Vary: Accept-Encoding

Body:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<CatalogItem
    xmlns="http://www.vmware.com/vcloud/v1.5"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    href="https://vcloud.example.com/api/catalogItem/345ccca0-ea8c-436f-bb05-4a6b2d122a31"
    id="urn:vcloud:catalogitem:345ccca0-ea8c-436f-bb05-4a6b2d122a31"
    name="Uploaded Media Name"
    size="14427"
    type="application/vnd.vmware.vcloud.catalogItem+xml"
    xsi:schemaLocation="http://www.vmware.com/vcloud/v1.5 http://https://vcloud.example.com/api/v1.5/schema/master.xsd">
    <Link
        href="https://vcloud.example.com/api/catalog/5aac6b64-e4e6-4be3-83c8-58248efd67aa"
        rel="up"
        type="application/vnd.vmware.vcloud.catalog+xml"/>
    <Link
        href="https://vcloud.example.com/api/catalogItem/345ccca0-ea8c-436f-bb05-4a6b2d122a31/metadata"
        rel="down"
        type="application/vnd.vmware.vcloud.metadata+xml"/>
    <Link
        href="https://vcloud.example.com/api/catalogItem/345ccca0-ea8c-436f-bb05-4a6b2d122a31"
        rel="edit"
        type="application/vnd.vmware.vcloud.catalogItem+xml"/>
    <Link
        href="https://vcloud.example.com/api/catalogItem/345ccca0-ea8c-436f-bb05-4a6b2d122a31"
        rel="remove"/>
    <Description>Uploaded Media Description</Description>
    <Entity
        href="https://vcloud.example.com/api/media/9bf6be67-b6bc-42f9-812d-66a34bb171a5"
        name="Uploaded Media Name"
        type="application/vnd.vmware.vcloud.media+xml"/>
    <DateCreated>2013-03-19T14:11:09.479+02:00</DateCreated>
    <VersionNumber>1</VersionNumber>
</CatalogItem>