VMware Cloud Director API - POST-ImportVmAsVAppTemplate

VMware Cloud Director API - POST-ImportVmAsVAppTemplate

POST /admin/extension/vimServer/{id}/importVmAsVAppTemplate

Operation:
POST /admin/extension/vimServer/{id}/importVmAsVAppTemplate
Description:
Import a virtual machine from vCenter as a vCloud Director vApp template.
Since:
1.0
Input parameters
Consume media type(s):
application/vnd.vmware.admin.importVmAsVAppTemplateParams+xml
application/vnd.vmware.admin.importVmAsVAppTemplateParams+json
Input type:
ImportVmAsVAppTemplateParamsType
Output parameters
VAppTemplateType

This operation is asynchronous. The response contains an embedded task object that you can monitor to track the progress of the request.

Produce media type(s):
application/vnd.vmware.vcloud.vAppTemplate+xml
application/vnd.vmware.vcloud.vAppTemplate+json
Output type:
VAppTemplateType
Examples
Request
HTTP 1.1
POST /api/admin/extension/vimServer/3691f5d6-32eb-44f6-804a-1d30d17068c3/importVmAsVAppTemplate

Headers:
Content-Length: 518
Content-Type: application/vnd.vmware.admin.importVmAsVAppTemplateParams+xml; charset=ISO-8859-1
x-vcloud-authorization: X600Twh81GezzqBm3B3GXTe8r9U8+U5kIrA3X4H2ctE=

Body:
<?xml version="1.0" encoding="UTF-8"?><vmext:ImportVmAsVAppTemplateParams
    xmlns:vmext="http://www.vmware.com/vcloud/extension/v1.5"
    name="ImportedVmAsVappTempl"
    sourceMove="false">
    <vmext:ComputerName>vAppTemplComp</vmext:ComputerName>
    <vmext:VmMoRef>vm-72</vmext:VmMoRef>
    <vmext:Vdc
        href="https://vcloud.example.com/api/vdc/afaafb99-228c-4838-ad07-5bf3aa649d42"/>
    <vmext:Catalog
        href="https://vcloud.example.com/api/catalog/39867ab4-04e0-4b13-b468-08abcc1de810"/>
</vmext:ImportVmAsVAppTemplateParams>
Response
HTTP/1.1 201 Created

Headers:
Content-Length: 5273
Content-Type: application/vnd.vmware.vcloud.vapptemplate+xml;version=5.1
Location: https://vcloud.example.com/api/vAppTemplate/vappTemplate-8aec9be4-f122-4281-ae41-834215add134
Vary: Accept-Encoding

Body:
<?xml version="1.0" encoding="UTF-8"?><VAppTemplate
    xmlns="http://www.vmware.com/vcloud/v1.5"
    xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    goldMaster="false"
    href="https://vcloud.example.com/api/vAppTemplate/vappTemplate-8aec9be4-f122-4281-ae41-834215add134"
    id="urn:vcloud:vapptemplate:8aec9be4-f122-4281-ae41-834215add134"
    name="urn:uuid:a2955828-d523-481f-a852-46fc8509c588"
    ovfDescriptorUploaded="true"
    status="0"
    type="application/vnd.vmware.vcloud.vAppTemplate+xml"
    xsi:schemaLocation="http://schemas.dmtf.org/ovf/envelope/1 http://schemas.dmtf.org/ovf/envelope/1/dsp8023_1.1.0.xsd 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/vdc/afaafb99-228c-4838-ad07-5bf3aa649d42"
        rel="up"
        type="application/vnd.vmware.vcloud.vdc+xml"/>
    <Description/>
    <Tasks>
        <Task
            cancelRequested="false"
            expiryTime="2013-05-13T16:55:02.825+03:00"
            href="https://vcloud.example.com/api/task/a60a17ab-8ccd-4870-aca1-53a3b61eab43"
            id="urn:vcloud:task:a60a17ab-8ccd-4870-aca1-53a3b61eab43"
            name="task"
            operation="Importing Virtual Application Template urn:uuid:a2955828-d523-481f-a852-46fc8509c588(8aec9be4-f122-4281-ae41-834215add134)"
            operationName="importSingletonTemplate"
            serviceNamespace="com.vmware.vcloud"
            startTime="2013-02-12T16:55:02.825+02:00"
            status="running"
            type="application/vnd.vmware.vcloud.task+xml">
            <Link
                href="https://vcloud.example.com/api/task/a60a17ab-8ccd-4870-aca1-53a3b61eab43/action/cancel"
                rel="task:cancel"/>
            <Owner
                href="https://vcloud.example.com/api/vAppTemplate/vappTemplate-8aec9be4-f122-4281-ae41-834215add134"
                name="urn:uuid:a2955828-d523-481f-a852-46fc8509c588"
                type="application/vnd.vmware.vcloud.vAppTemplate+xml"/>
            <User
                href="https://vcloud.example.com/api/admin/user/1260efee-6915-494c-8afa-84e7e6d8a310"
                name="system"
                type="application/vnd.vmware.admin.user+xml"/>
            <Organization
                href="https://vcloud.example.com/api/org/7b832bc5-3d65-45a2-8d35-da28388ab80a"
                name="Default"
                type="application/vnd.vmware.vcloud.org+xml"/>
            <Progress>1</Progress>
            <Details/>
        </Task>
    </Tasks>
    <Owner
        type="application/vnd.vmware.vcloud.owner+xml">
        <User
            href="https://vcloud.example.com/api/admin/user/51e86769-9e2d-4edc-af4e-5d3606494cbf"
            name="system"
            type="application/vnd.vmware.admin.user+xml"/>
    </Owner>
    <Children>
        <Vm
            goldMaster="false"
            href="https://vcloud.example.com/api/vAppTemplate/vm-475322ec-80da-4915-b9dd-856564c1ee1f"
            id="urn:vcloud:vm:475322ec-80da-4915-b9dd-856564c1ee1f"
            name="ImportedVmAsVappTempl"
            type="application/vnd.vmware.vcloud.vm+xml">
            <Description/>
            <NetworkConnectionSection
                href="https://vcloud.example.com/api/vAppTemplate/vm-475322ec-80da-4915-b9dd-856564c1ee1f/networkConnectionSection/"
                ovf:required="false"
                type="application/vnd.vmware.vcloud.networkConnectionSection+xml">
                <ovf:Info>Specifies the available VM network connections</ovf:Info>
            </NetworkConnectionSection>
            <GuestCustomizationSection
                href="https://vcloud.example.com/api/vAppTemplate/vm-475322ec-80da-4915-b9dd-856564c1ee1f/guestCustomizationSection/"
                ovf:required="false"
                type="application/vnd.vmware.vcloud.guestCustomizationSection+xml">
                <ovf:Info>Specifies Guest OS Customization Settings</ovf:Info>
                <Enabled>false</Enabled>
                <ChangeSid>false</ChangeSid>
                <JoinDomainEnabled>false</JoinDomainEnabled>
                <UseOrgSettings>false</UseOrgSettings>
                <AdminPasswordEnabled>false</AdminPasswordEnabled>
                <AdminPasswordAuto>false</AdminPasswordAuto>
                <ResetPasswordRequired>false</ResetPasswordRequired>
                <ComputerName>vAppTemplComp</ComputerName>
            </GuestCustomizationSection>
            <VAppScopedLocalId>ImportedVmAsVappTempl</VAppScopedLocalId>
            <DateCreated>2013-02-12T16:54:59.357+02:00</DateCreated>
        </Vm>
    </Children>
    <LeaseSettingsSection
        href="https://vcloud.example.com/api/vAppTemplate/vappTemplate-8aec9be4-f122-4281-ae41-834215add134/leaseSettingsSection/"
        ovf:required="false"
        type="application/vnd.vmware.vcloud.leaseSettingsSection+xml">
        <ovf:Info>Lease settings section</ovf:Info>
        <Link
            href="https://vcloud.example.com/api/vAppTemplate/vappTemplate-8aec9be4-f122-4281-ae41-834215add134/leaseSettingsSection/"
            rel="edit"
            type="application/vnd.vmware.vcloud.leaseSettingsSection+xml"/>
        <StorageLeaseInSeconds>2592000</StorageLeaseInSeconds>
        <StorageLeaseExpiration>2013-03-14T16:54:59.357+02:00</StorageLeaseExpiration>
    </LeaseSettingsSection>
    <CustomizationSection
        goldMaster="false"
        href="https://vcloud.example.com/api/vAppTemplate/vappTemplate-8aec9be4-f122-4281-ae41-834215add134/customizationSection/"
        ovf:required="false"
        type="application/vnd.vmware.vcloud.customizationSection+xml">
        <ovf:Info>VApp template customization section</ovf:Info>
        <CustomizeOnInstantiate>false</CustomizeOnInstantiate>
    </CustomizationSection>
    <DateCreated>2013-02-12T16:54:59.357+02:00</DateCreated>
</VAppTemplate>