Import OVF As vApp Template operation


The Import OVF As vApp Template operation enables you to create a vApp template from an OVF package.

The following figure shows a sample <items> XML element for the Import OVF As vApp Template operation:

Sample <items> XML element for the Import OVF As vApp Template operation

<items>
 <item>
   <parameters>
     <vdc-id></vdc-id>
     <catalog-id></catalog-id>
     <import-ovf-as-vapp-template-params>
       <vapp-template-name></vapp-template-name>
       <description>test desc</description>
       <ovf-descriptor-file></ovf-descriptor-file>
     </import-ovf-as-vapp-template-params>
   </parameters>
 </item>
</items>

The following table describes the elements for this adapter request:

Adapter request elements for the Import OVF As vApp Template operation

Element

Definition

Required

<operation-name>

Defines the type of operation: Import Ovf_As_vApp_Template

Yes

<vcloud-organization>

Specifies the name of the vCloud organization

Conditional:

  • Required if not specified in the configuration
  • If used, requires <user-name> and <password>
<user-name>

Specifies the user name required for basic HTTP authentication on vCloud

Conditional:

  • Required if not specified in the configuration
  • If used, requires <vcloud-organization> and <password>
<password>

Contains the password corresponding to the specified user name

Conditional:

  • Required if not specified in the configuration
  • If used, requires <vcloud-organization> and <user-name>
<parameters>

Contains the elements for the operation

Yes

<vdc-id>

Specifies the ID of the target vDC

Valid value: Any string

Yes

<catalog-id>

Specifies the ID corresponding to the catalog to which the vApp template is added

Valid value: Any string

Yes

<vapp-template-name>

Specifies a unique name for the vApp template being created

Valid value: Any string

Yes

<description>

Specifies the description of the vApp template

Valid value: Any string

No

<ovf-descriptor-file>

Specifies the path of the descriptor file
The descriptor file and the disk files must exist in the same folder and the names of the disk files should be the same as those specified in the descriptor file.

Valid value: Any string

Yes

The following figure shows the sample adapter request for the Import OVF As vApp Template operation:

Sample adapter request for the Import OVF As vApp Template operation

<vmware-vcloud-request>
 <operation-name>Import_Ovf_As_vApp_Template</operation-name>
 <vcloud-organization>TestOrg</vcloud-organization>
 <user-name>TestUser</user-name>
 <password>Password</password>
 <parameters>
   <vdc-id>882004552</vdc-id>
   <catalog-id>1545932923</catalog-id>
   <import-ovf-as-vapp-template-params>
     <vapp-template-name>Test Template new2</vapp-template-name>
     <description>test desc</description>
     <ovf-descriptor-file>/export/home/user/o@v#f/descriptor.ovf
</ovf-descriptor-file>
   </import-ovf-as-vapp-template-params>
 </parameters>
</vmware-vcloud-request>

The following figure shows the response for the sample adapter request:

Sample adapter response for the Import OVF As vApp Template operation

<vmware-vcloud-response>
   <metadata>
       <status>success</status>
   </metadata>
   <status-line>
       <code>201</code>
       <reason>Created</reason>
   </status-line>
   <message-body>
       <CatalogItem
           name = "Test Template new2"
           type = "application/vnd.vmware.vcloud.catalogItem+xml"
           href = "https://10.128.248.112/api/v1.0/catalogItem/1535894605">
           <Link
             rel = "up"
             type = "application/vnd.vmware.vcloud.catalog+xml"
             href = "https://10.128.248.112/api/v1.0/catalog/1545932923"/>
           <Link
             rel = "edit"
             type = "application/vnd.vmware.vcloud.catalogItem+xml"
             href = "https://10.128.248.112/api/v1.0/catalogItem/1535894605"/>
           <Link rel = "remove" href =
"https://10.128.248.112/api/v1.0/catalogItem/1535894605"/>
           <Description>test desc</Description>
           <Entity
             type = "application/vnd.vmware.vcloud.vAppTemplate+xml"
             name = "Test Template new2"
             href = "https://10.128.248.112/api/v1.0/vAppTemplate/
vappTemplate-145139217"
/>
       </CatalogItem>
   </message-body>
</vmware-vcloud-response>

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*