com.vmware.vcloud.sdk
Class Vapp

java.lang.Object
  extended by com.vmware.vcloud.sdk.VcloudResource<T>
      extended by com.vmware.vcloud.sdk.VcloudEntity<com.vmware.vcloud.api.rest.schema.AbstractVAppType>
          extended by com.vmware.vcloud.sdk.AbstractVapp<com.vmware.vcloud.api.rest.schema.VAppType>
              extended by com.vmware.vcloud.sdk.Vapp

public class Vapp
extends AbstractVapp<com.vmware.vcloud.api.rest.schema.VAppType>

Helper class to access the vApp Resource in vCLoud API.

See Also:
VAppType

Constructor Summary
Vapp(VcloudClient client, com.vmware.vcloud.api.rest.schema.VAppType vAppType)
          Constructor for creating a vapp.
 
Method Summary
 void changeOwner(com.vmware.vcloud.api.rest.schema.ReferenceType userReference)
          Change VApp owner.
static void changeOwner(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType vappRef, com.vmware.vcloud.api.rest.schema.ReferenceType userReference)
          Change VApp owner.
 void disableDownload()
          Disable a vApp for download
static void disableDownload(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType vappRef)
          Disable a vApp for download
 void disableMaintenance()
          Disable vApp from Maintenance mode.
static void disableMaintenance(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType vappRef)
          Disable vApp from Maintenance mode.
 InputStream downloadFile(String fileName)
          Downloading the File.
 InputStream downloadLosslessOVF()
          Download lossless vApp OVF.
 InputStream downloadOVFFile()
          Downloading the OVF File.
 void downloadVapp(String downloadLocation)
          Download the vApp as an ovf package.
 Task enableDownload()
          Enable a vApp for download
static Task enableDownload(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType vappRef)
          Enable a vApp for download
 void enableMaintenance()
          Enable vApp for Maintenance mode.
static void enableMaintenance(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType vappRef)
          Enable vApp for Maintenance mode.
 List<Vapp> getChildrenVapps()
          Returns the list of children Vapp
 List<VM> getChildrenVms()
          Returns the list of children Vm
 com.vmware.vcloud.api.rest.schema.ControlAccessParamsType getControlAccess()
          Returns VApp Control access
 HashMap<String,com.vmware.vcloud.api.rest.schema.ovf.FileType> getDownloadFileNames()
          Returns all the file names which can be downloaded.
 com.vmware.vcloud.api.rest.schema.LeaseSettingsSectionType getLeaseSettingsSection()
          Returns the LeaseSettingsSection for the given vapp
static com.vmware.vcloud.api.rest.schema.LeaseSettingsSectionType getLeaseSettingsSection(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType vappRef)
          Returns the LeaseSettingsSection
 com.vmware.vcloud.api.rest.schema.ovf.NetworkSectionNetwork getNetworkByName(String networkName)
          Returns the Network By Name of a VApp
 com.vmware.vcloud.api.rest.schema.NetworkConfigSectionType getNetworkConfigSection()
          Returns the NetworkConfigSection for the given vapp
static com.vmware.vcloud.api.rest.schema.NetworkConfigSectionType getNetworkConfigSection(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType vappRef)
          Returns the NetworkConfigSection
 Set<String> getNetworkNames()
          Returns Network Names of a VApp
 Collection<com.vmware.vcloud.api.rest.schema.ovf.NetworkSectionNetwork> getNetworks()
          Returns the Networks of a VApp
 HashMap<String,com.vmware.vcloud.api.rest.schema.ovf.NetworkSectionNetwork> getNetworksByName()
          Returns the Networks By Name of a Vapp
 com.vmware.vcloud.api.rest.schema.ovf.NetworkSectionType getNetworkSection()
          Returns the NetworkSection for the given vapp
static com.vmware.vcloud.api.rest.schema.ovf.NetworkSectionType getNetworkSection(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType vappRef)
          Returns the NetworkSection
 com.vmware.vcloud.api.rest.schema.extension.VimObjectRefType getNetworkVimRef(String vAppNetworkName)
          Given a vAppNetwork name.
 com.vmware.vcloud.api.rest.schema.ovf.EnvelopeType getOvf()
          Get the ovf of the vapp
static com.vmware.vcloud.api.rest.schema.ovf.EnvelopeType getOvf(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType vappRef)
          Get the ovf of the vapp
 String getOvfAsString()
          Returns the ovf of vapp as a String
 com.vmware.vcloud.api.rest.schema.ReferenceType getOwner()
          Returns the owner of the vapp.
static com.vmware.vcloud.api.rest.schema.ReferenceType getOwner(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType vappRef)
          Returns the owner of the vapp
 com.vmware.vcloud.api.rest.schema.ovf.StartupSectionType getStartUpSection()
          Returns the StartUpSection for the given vapp
static com.vmware.vcloud.api.rest.schema.ovf.StartupSectionType getStartUpSection(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType vappRef)
          Returns the StartupSection
 Set<String> getUploadedFileNames()
          Get the uploaded file names for this vApp.
 Set<String> getUploadFileNames()
          Get the upload vmdk file names and the manifest file (if any) for this vApp.
static Vapp getVappById(VcloudClient client, String vCloudId)
          Get Vapp helper using the vCloud ID
static Vapp getVappByReference(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType vappRef)
          Returns vApp for the given reference
 com.vmware.vcloud.api.rest.schema.VAppNetworkConfigurationType getVappNetworkConfigurationByName(String vappNetworkConfigurationName)
          Returns the Vapp Network Configuration By Name
 Set<String> getVappNetworkConfigurationNames()
          Returns the Vapp Network Configuration Names
 Collection<com.vmware.vcloud.api.rest.schema.VAppNetworkConfigurationType> getVappNetworkConfigurations()
          Returns Vapp Network Configurations
 HashMap<String,com.vmware.vcloud.api.rest.schema.VAppNetworkConfigurationType> getVappNetworkConfigurationsByName()
          Returns Vapp Network Configurations By Name
 HashMap<String,com.vmware.vcloud.api.rest.schema.ReferenceType> getVappNetworkRefsByName()
          Returns the vApp Network References by name.
 BigInteger getVappSize()
          Returns the vApp size in MB.
 VappStatus getVappStatus()
          Returns the vApp status.
 com.vmware.vcloud.api.rest.schema.ReferenceType getVdcReference()
          Returns the Parent Vdc ReferenceType.
 HashMap<String,String> getVmUUIDsByName()
          Returns a map of the vm's UUIDs based on the name
 Task recomposeVapp(com.vmware.vcloud.api.rest.schema.RecomposeVAppParamsType recomposeVappParamsType)
          Recompose vApp
 Task resetvAppNetwork(String vAppNetworkName)
          Reset VApp network.
 Task syncSyslogServer(String vAppNetworkName)
          Synchronizes the syslog server settings with the system defaults.
 com.vmware.vcloud.api.rest.schema.ControlAccessParamsType updateControlAccess(com.vmware.vcloud.api.rest.schema.ControlAccessParamsType controlAccessParams)
          Update Vapp Control access
 Task updateSection(com.vmware.vcloud.api.rest.schema.ovf.SectionType sectionType)
          Updating the vApp.
 Task updateVapp(com.vmware.vcloud.api.rest.schema.VAppType vAppType)
          Updates name and description of a vApp.
 void uploadFile(String fileName, InputStream is, long size)
          Upload the vApp related files.
 void uploadOVFFile(InputStream is, long size)
          Upload the OVF file for the vApp.
 
Methods inherited from class com.vmware.vcloud.sdk.AbstractVapp
createSnapshot, createSnapshot, delete, delete, deploy, deploy, discardSuspend, discardSuspend, getProductSections, getProductSections, getResource, getSnapshotSection, getSnapshotSection, isDeployed, powerOff, powerOff, powerOn, powerOn, reboot, reboot, removeAllSnapshots, removeAllSnapshots, reset, reset, revertToCurrentSnapshot, revertToCurrentSnapshot, shutdown, shutdown, suspend, suspend, undeploy, undeploy, updateProductSections
 
Methods inherited from class com.vmware.vcloud.sdk.VcloudEntity
getMetadata, getReference, getTasks
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Vapp

public Vapp(VcloudClient client,
            com.vmware.vcloud.api.rest.schema.VAppType vAppType)
Constructor for creating a vapp.

Parameters:
client - VcloudClient
vAppType - VAppType
See Also:
VAppType
Method Detail

getVappByReference

public static Vapp getVappByReference(VcloudClient client,
                                      com.vmware.vcloud.api.rest.schema.ReferenceType vappRef)
                               throws VCloudException
Returns vApp for the given reference

Parameters:
client - vCloud API client VcloudClient
vappRef - ReferenceType to the vApp ReferenceType
Returns:
Vapp
Throws:
VCloudException
See Also:
Vdc.getVappRefs(), Vdc.getVappRefsByName()

getVappById

public static Vapp getVappById(VcloudClient client,
                               String vCloudId)
                        throws VCloudException
Get Vapp helper using the vCloud ID

Parameters:
client - VcloudClient
vCloudId - format - The vCloud ID is of the form: "urn:vcloud:type:uuid". For example: "urn:vcloud:media:d9d976ba-e0ec-4682-a67d-380af49b54e1". String
Returns:
Vapp
Throws:
VCloudException
Since:
API 1.5, SDK 1.5

updateVapp

public Task updateVapp(com.vmware.vcloud.api.rest.schema.VAppType vAppType)
                throws VCloudException
Updates name and description of a vApp.

Parameters:
vAppType - VAppType
Returns:
Task
Throws:
VCloudException
See Also:
VAppType

getVappStatus

public VappStatus getVappStatus()
Returns the vApp status.

Returns:
VappStatus

getChildrenVapps

public List<Vapp> getChildrenVapps()
                            throws VCloudException
Returns the list of children Vapp

Returns:
List
Throws:
VCloudException

getChildrenVms

public List<VM> getChildrenVms()
                        throws VCloudException
Returns the list of children Vm

Returns:
List
Throws:
VCloudException

getLeaseSettingsSection

public com.vmware.vcloud.api.rest.schema.LeaseSettingsSectionType getLeaseSettingsSection()
                                                                                   throws VCloudException
Returns the LeaseSettingsSection for the given vapp

Returns:
LeaseSettingsSectionType
Throws:
VCloudException

getLeaseSettingsSection

public static com.vmware.vcloud.api.rest.schema.LeaseSettingsSectionType getLeaseSettingsSection(VcloudClient client,
                                                                                                 com.vmware.vcloud.api.rest.schema.ReferenceType vappRef)
                                                                                          throws VCloudException
Returns the LeaseSettingsSection

Parameters:
client -
vappRef -
Returns:
LeaseSettingsSectionType
Throws:
VCloudException

getStartUpSection

public com.vmware.vcloud.api.rest.schema.ovf.StartupSectionType getStartUpSection()
                                                                           throws VCloudException
Returns the StartUpSection for the given vapp

Returns:
StartupSectionType
Throws:
VCloudException

getStartUpSection

public static com.vmware.vcloud.api.rest.schema.ovf.StartupSectionType getStartUpSection(VcloudClient client,
                                                                                         com.vmware.vcloud.api.rest.schema.ReferenceType vappRef)
                                                                                  throws VCloudException
Returns the StartupSection

Parameters:
client -
vappRef -
Returns:
StartupSectionType
Throws:
VCloudException

getNetworkSection

public com.vmware.vcloud.api.rest.schema.ovf.NetworkSectionType getNetworkSection()
                                                                           throws VCloudException
Returns the NetworkSection for the given vapp

Returns:
NetworkSectionType
Throws:
VCloudException
VCloudException

getNetworkSection

public static com.vmware.vcloud.api.rest.schema.ovf.NetworkSectionType getNetworkSection(VcloudClient client,
                                                                                         com.vmware.vcloud.api.rest.schema.ReferenceType vappRef)
                                                                                  throws VCloudException
Returns the NetworkSection

Parameters:
client -
vappRef -
Returns:
NetworkSectionType
Throws:
VCloudException

getNetworksByName

public HashMap<String,com.vmware.vcloud.api.rest.schema.ovf.NetworkSectionNetwork> getNetworksByName()
                                                                                              throws VCloudException
Returns the Networks By Name of a Vapp

Returns:
HashMap<String, NetworkSectionNetwork
Throws:
VCloudException

getNetworkByName

public com.vmware.vcloud.api.rest.schema.ovf.NetworkSectionNetwork getNetworkByName(String networkName)
                                                                             throws VCloudException
Returns the Network By Name of a VApp

Parameters:
networkName -
Returns:
NetworkSectionNetwork
Throws:
VCloudException

getNetworkNames

public Set<String> getNetworkNames()
                            throws VCloudException
Returns Network Names of a VApp

Returns:
Set
Throws:
VCloudException

getNetworks

public Collection<com.vmware.vcloud.api.rest.schema.ovf.NetworkSectionNetwork> getNetworks()
                                                                                    throws VCloudException
Returns the Networks of a VApp

Returns:
Collection
Throws:
VCloudException

getNetworkConfigSection

public com.vmware.vcloud.api.rest.schema.NetworkConfigSectionType getNetworkConfigSection()
                                                                                   throws VCloudException
Returns the NetworkConfigSection for the given vapp

Returns:
NetworkConfigSectionType
Throws:
VCloudException

getNetworkConfigSection

public static com.vmware.vcloud.api.rest.schema.NetworkConfigSectionType getNetworkConfigSection(VcloudClient client,
                                                                                                 com.vmware.vcloud.api.rest.schema.ReferenceType vappRef)
                                                                                          throws VCloudException
Returns the NetworkConfigSection

Parameters:
client -
vappRef -
Returns:
NetworkConfigSectionType
Throws:
VCloudException

getVappNetworkRefsByName

public HashMap<String,com.vmware.vcloud.api.rest.schema.ReferenceType> getVappNetworkRefsByName()
Returns the vApp Network References by name.

Returns:
HashMap< String, ReferenceType>
Since:
API 1.5, SDK 1.5

getVappNetworkConfigurationsByName

public HashMap<String,com.vmware.vcloud.api.rest.schema.VAppNetworkConfigurationType> getVappNetworkConfigurationsByName()
                                                                                                                  throws VCloudException
Returns Vapp Network Configurations By Name

Returns:
HashMap<String, VAppNetworkConfigurationType
Throws:
VCloudException

getVappNetworkConfigurationByName

public com.vmware.vcloud.api.rest.schema.VAppNetworkConfigurationType getVappNetworkConfigurationByName(String vappNetworkConfigurationName)
                                                                                                 throws VCloudException
Returns the Vapp Network Configuration By Name

Parameters:
vappNetworkConfigurationName -
Returns:
VAppNetworkConfigurationType
Throws:
VCloudException

getVappNetworkConfigurationNames

public Set<String> getVappNetworkConfigurationNames()
                                             throws VCloudException
Returns the Vapp Network Configuration Names

Returns:
Set
Throws:
VCloudException

getVappNetworkConfigurations

public Collection<com.vmware.vcloud.api.rest.schema.VAppNetworkConfigurationType> getVappNetworkConfigurations()
                                                                                                        throws VCloudException
Returns Vapp Network Configurations

Returns:
Collection<VAppNetworkConfigurationType>
Throws:
VCloudException

updateSection

public Task updateSection(com.vmware.vcloud.api.rest.schema.ovf.SectionType sectionType)
                   throws VCloudException
Updating the vApp. You should be able to reconfigure sections on vApp level (like LeaseSettings, StartupSections, NetworkConfigSection)

Parameters:
sectionType -
Returns:
Task
Throws:
VCloudException

getControlAccess

public com.vmware.vcloud.api.rest.schema.ControlAccessParamsType getControlAccess()
                                                                           throws VCloudException
Returns VApp Control access

Returns:
ControlAccessParamsType
Throws:
VCloudException

updateControlAccess

public com.vmware.vcloud.api.rest.schema.ControlAccessParamsType updateControlAccess(com.vmware.vcloud.api.rest.schema.ControlAccessParamsType controlAccessParams)
                                                                              throws VCloudException
Update Vapp Control access

Parameters:
controlAccessParams - ControlAccessParamsType
Returns:
ControlAccessParamsType
Throws:
VCloudException

getVappSize

public BigInteger getVappSize()
                       throws VCloudException
Returns the vApp size in MB.

Returns:
BigInteger
Throws:
VCloudException
Since:
API 1.5, SDK 1.5

getVdcReference

public com.vmware.vcloud.api.rest.schema.ReferenceType getVdcReference()
                                                                throws VCloudException
Returns the Parent Vdc ReferenceType. Root Vapp contains this information.

Returns:
ReferenceType
Throws:
VCloudException

getNetworkVimRef

public com.vmware.vcloud.api.rest.schema.extension.VimObjectRefType getNetworkVimRef(String vAppNetworkName)
                                                                              throws VCloudException
Given a vAppNetwork name. Returns the network vim object reference. The network should be deployed.

Parameters:
vAppNetworkName -
Returns:
VimObjectRefType
Throws:
VCloudException
Since:
API 1.5, SDK 1.5

recomposeVapp

public Task recomposeVapp(com.vmware.vcloud.api.rest.schema.RecomposeVAppParamsType recomposeVappParamsType)
                   throws VCloudException
Recompose vApp

Parameters:
recomposeVappParamsType - RecomposeVAppParamsType
Returns:
Task
Throws:
VCloudException

getOwner

public com.vmware.vcloud.api.rest.schema.ReferenceType getOwner()
                                                         throws VCloudException
Returns the owner of the vapp.

Returns:
ReferenceType
Throws:
VCloudException
Since:
API 1.5, SDK 1.5

getOwner

public static com.vmware.vcloud.api.rest.schema.ReferenceType getOwner(VcloudClient client,
                                                                       com.vmware.vcloud.api.rest.schema.ReferenceType vappRef)
                                                                throws VCloudException
Returns the owner of the vapp

Parameters:
client - - VcloudClient
vappRef - - ReferenceType ReferenceType of the vApp.
Returns:
ReferenceType
Throws:
VCloudException
Since:
API 1.5, SDK 1.5

changeOwner

public static void changeOwner(VcloudClient client,
                               com.vmware.vcloud.api.rest.schema.ReferenceType vappRef,
                               com.vmware.vcloud.api.rest.schema.ReferenceType userReference)
                        throws VCloudException
Change VApp owner. The VApp ownership cannot be transferred outside the current organization

Parameters:
client - - VcloudClient
vappRef - - ReferenceType vApp ReferenceType contained in the VDC
userReference - ReferenceType
Throws:
VCloudException
Since:
API 1.5, SDK 1.5

changeOwner

public void changeOwner(com.vmware.vcloud.api.rest.schema.ReferenceType userReference)
                 throws VCloudException
Change VApp owner. The VApp ownership cannot be transferred outside the current organization

Parameters:
userReference - ReferenceType
Throws:
VCloudException
Since:
API 1.5, SDK 1.5

resetvAppNetwork

public Task resetvAppNetwork(String vAppNetworkName)
                      throws VCloudException
Reset VApp network. VApp network can be reset if VApp network is deployed.

Parameters:
vAppNetworkName - - Name of the vApp Network getVappNetworkRefsByName() getVappNetworkConfigurationByName(String) getVappNetworkConfigurationNames() getVappNetworkConfigurations() getVappNetworkConfigurationsByName()
Returns:
Task
Throws:
VCloudException
Since:
API 1.5, SDK 1.5

syncSyslogServer

public Task syncSyslogServer(String vAppNetworkName)
                      throws VCloudException
Synchronizes the syslog server settings with the system defaults. Only Routed vApp Networks can be synchronized.

Parameters:
vAppNetworkName - - Name of the vApp Network getVappNetworkRefsByName() getVappNetworkConfigurationByName(String) getVappNetworkConfigurationNames() getVappNetworkConfigurations() getVappNetworkConfigurationsByName()
Returns:
Task
Throws:
VCloudException
Since:
API 1.5, SDK 1.5

enableMaintenance

public void enableMaintenance()
                       throws VCloudException
Enable vApp for Maintenance mode. vApp's in maintenance mode prevents end-user vApp modifications. Enabling maintenance mode prevents users from creating new tasks the vApp. However the currently running tasks will not be affected.

Throws:
VCloudException
Since:
API 1.5, SDK 1.5

disableMaintenance

public void disableMaintenance()
                        throws VCloudException
Disable vApp from Maintenance mode.

Throws:
VCloudException
Since:
API 1.5, SDK 1.5

enableMaintenance

public static void enableMaintenance(VcloudClient client,
                                     com.vmware.vcloud.api.rest.schema.ReferenceType vappRef)
                              throws VCloudException
Enable vApp for Maintenance mode. vApp's in maintenance mode prevents end-user vApp modifications. Enabling maintenance mode prevents users from creating new tasks the vApp. However the currently running tasks will not be affected.

Parameters:
client - VcloudClient
vappRef - ReferenceType
Throws:
VCloudException
Since:
API 1.5, SDK 1.5

disableMaintenance

public static void disableMaintenance(VcloudClient client,
                                      com.vmware.vcloud.api.rest.schema.ReferenceType vappRef)
                               throws VCloudException
Disable vApp from Maintenance mode.

Parameters:
client - VcloudClient
vappRef - ReferenceType
Throws:
VCloudException
Since:
API 1.5, SDK 1.5

getOvf

public static com.vmware.vcloud.api.rest.schema.ovf.EnvelopeType getOvf(VcloudClient client,
                                                                        com.vmware.vcloud.api.rest.schema.ReferenceType vappRef)
                                                                 throws VCloudException
Get the ovf of the vapp

Parameters:
client -
vappRef -
Returns:
EnvelopeType
Throws:
VCloudException
Since:
API 5.1, SDK 5.1

getOvf

public com.vmware.vcloud.api.rest.schema.ovf.EnvelopeType getOvf()
                                                          throws VCloudException
Get the ovf of the vapp

Returns:
EnvelopeType
Throws:
VCloudException
Since:
API 5.1, SDK 5.1

enableDownload

public Task enableDownload()
                    throws VCloudException
Enable a vApp for download

Returns:
Task
Throws:
VCloudException
Since:
API 5.5, SDK 5.5

enableDownload

public static Task enableDownload(VcloudClient client,
                                  com.vmware.vcloud.api.rest.schema.ReferenceType vappRef)
                           throws VCloudException
Enable a vApp for download

Parameters:
client - VcloudClient
vappRef - ReferenceType
Returns:
Task
Throws:
VCloudException
Since:
API 5.5, SDK 5.5

disableDownload

public void disableDownload()
                     throws VCloudException
Disable a vApp for download

Throws:
VCloudException
Since:
API 5.5, SDK 5.5

disableDownload

public static void disableDownload(VcloudClient client,
                                   com.vmware.vcloud.api.rest.schema.ReferenceType vappRef)
                            throws VCloudException
Disable a vApp for download

Parameters:
client - VcloudClient
vappRef - ReferenceType
Throws:
VCloudException
Since:
API 5.5, SDK 5.5

downloadOVFFile

public InputStream downloadOVFFile()
                            throws VCloudException
Downloading the OVF File. Close the input stream after use

Returns:
InputStream
Throws:
VCloudException
Since:
API 5.5, SDK 5.5

downloadLosslessOVF

public InputStream downloadLosslessOVF()
                                throws VCloudException
Download lossless vApp OVF. Lossless download mode generates ovf without loosing any of its configurations.

Returns:
InputStream
Throws:
VCloudException
Since:
API 5.5, SDK 5.5

getDownloadFileNames

public HashMap<String,com.vmware.vcloud.api.rest.schema.ovf.FileType> getDownloadFileNames()
                                                                                    throws VCloudException
Returns all the file names which can be downloaded.

Returns:
HashMap
Throws:
VCloudException
Since:
API 5.5, SDK 5.5
See Also:
downloadOVFFile(), downloadFile(String), enableDownload(), disableDownload()

downloadFile

public InputStream downloadFile(String fileName)
                         throws VCloudException
Downloading the File. Close the input stream after use.

Parameters:
fileName - - Name of the file which needs to be downloaded
Returns:
InputStream
Throws:
VCloudException
Since:
API 5.5, SDK 5.5
See Also:
getDownloadFileNames(), downloadOVFFile(), enableDownload(), disableDownload()

downloadVapp

public void downloadVapp(String downloadLocation)
                  throws VCloudException
Download the vApp as an ovf package. The ovf file and its vmdk contents are downloaded to the specified location. Before downloading make sure the vapp is enabled for download.

Parameters:
downloadLocation -
Throws:
VCloudException
Since:
API 5.5, SDK 5.5
See Also:
enableDownload()

uploadOVFFile

public void uploadOVFFile(InputStream is,
                          long size)
                   throws VCloudException
Upload the OVF file for the vApp. Once the ovf file is uploaded completely the ovfDescriptorUploaded becomes true.

Parameters:
is - Input stream for the file contents
size - File Size
Throws:
VCloudException
Since:
API 5.5, SDK 5.5

getUploadFileNames

public Set<String> getUploadFileNames()
                               throws VCloudException
Get the upload vmdk file names and the manifest file (if any) for this vApp. If the OVF file is not uploaded then exception is thrown as VMDK file names and manifest file (if any) are not available.

Returns:
Set
Throws:
VCloudException
Since:
API 5.5, SDK 5.5

getUploadedFileNames

public Set<String> getUploadedFileNames()
                                 throws VCloudException
Get the uploaded file names for this vApp.

Returns:
Set
Throws:
VCloudException
Since:
API 5.5, SDK 5.5

uploadFile

public void uploadFile(String fileName,
                       InputStream is,
                       long size)
                throws VCloudException
Upload the vApp related files. This can be vmdk or a manifest file and must be present in the vApp file Map.

Parameters:
fileName - vApp File name
is - Input stream for the file contents
size - The total file size
Throws:
VCloudException
Since:
API 5.5, SDK 5.5

getOvfAsString

public String getOvfAsString()
                      throws VCloudException
Returns the ovf of vapp as a String

Returns:
String
Throws:
VCloudException
Since:
API 5.5, SDK 5.5

getVmUUIDsByName

public HashMap<String,String> getVmUUIDsByName()
                                        throws VCloudException
Returns a map of the vm's UUIDs based on the name

Returns:
HashMap
Throws:
VCloudException
Since:
API 5.5, SDK 5.5


Copyright © 2016. All Rights Reserved.