com.vmware.vcloud.sdk
Class AbstractVapp<T extends com.vmware.vcloud.api.rest.schema.AbstractVAppType>

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<T>
Direct Known Subclasses:
Vapp, VM

public abstract class AbstractVapp<T extends com.vmware.vcloud.api.rest.schema.AbstractVAppType>
extends VcloudEntity<com.vmware.vcloud.api.rest.schema.AbstractVAppType>

Helper class to access the Abstract vApp Resource in vCLoud API. This is the base for the Vapp and VM helper classes.

Since:
SDK 1.5
See Also:
AbstractVAppType

Method Summary
 Task createSnapshot(String name, String description, boolean memory, boolean quiesce)
          Creates new snapshot of a virtual machine or of all the virtual machines in a vApp.
static Task createSnapshot(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType ref, String name, String description, boolean memory, boolean quiesce)
          Creates new snapshot of a virtual machine or of all the virtual machines in a vApp.
 Task delete()
          Delete VAPP/VM .
static Task delete(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType ref)
          Delete VAPP/VM.
 Task deploy(boolean powerOn, int lease, boolean forceCustomization)
          Deploy VAPP/VM .
static Task deploy(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType ref, boolean powerOn, int lease, boolean forceCustomization)
          Deploy VAPP/VM.
 Task discardSuspend()
          Discard the Suspended State of a vApp or Virtual Machine
static Task discardSuspend(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType ref)
          Discard the Suspended State of a vApp or Virtual Machine
 List<com.vmware.vcloud.api.rest.schema.ovf.ProductSectionType> getProductSections()
          Returns the ProductSections of a vApp/VM
static List<com.vmware.vcloud.api.rest.schema.ovf.ProductSectionType> getProductSections(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType ref)
          Returns the ProductSections for the vApp/VM
 T getResource()
          Returns the abstract vapp type resource.
 com.vmware.vcloud.api.rest.schema.SnapshotSectionType getSnapshotSection()
          Returns the SnapshotSection for the given vapp
static com.vmware.vcloud.api.rest.schema.SnapshotSectionType getSnapshotSection(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType vappRef)
          Returns the SnapshotSection
 Boolean isDeployed()
          Returns whether the vApp or VM is deployed
 Task powerOff()
          Power off VAPP/VM.
static Task powerOff(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType ref)
          Power off VAPP/VM.
 Task powerOn()
          Power on VAPP/VM.
static Task powerOn(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType ref)
          Power on VAPP/VM.
 Task reboot()
          Reboot VAPP/VM
static Task reboot(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType ref)
          Reboot VAPP/VM
 Task removeAllSnapshots()
          Removes all user created snapshots for a vApp or virtual machine.
static Task removeAllSnapshots(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType ref)
          Removes all user created snapshots for a vApp or virtual machine.
 Task reset()
          Reset VAPP/VM.
static Task reset(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType ref)
          Reset VAPP/VM.
 Task revertToCurrentSnapshot()
          Reverts a vApp or virtual machine to the current snapshot, if any.
static Task revertToCurrentSnapshot(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType ref)
          Reverts a vApp or virtual machine to the current snapshot, if any.
 Task shutdown()
          Shutdown VAPP/VM gracefully.
static Task shutdown(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType ref)
          Shutdown VAPP/VM gracefully.
 Task suspend()
          Suspend VAPP/VM.
static Task suspend(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType ref)
          Suspend VAPP/VM.
 Task undeploy(UndeployPowerActionType undeployPowerAction)
          Undeploys the vApp/VM
static Task undeploy(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType ref, UndeployPowerActionType undeployPowerAction)
          Undeploys the vApp/VM
 Task updateProductSections(List<com.vmware.vcloud.api.rest.schema.ovf.ProductSectionType> productSections)
          Update the product sections of a vApp/VM
 
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
 

Method Detail

getResource

public T getResource()
Returns the abstract vapp type resource. It can be VmType or VAppType

Overrides:
getResource in class VcloudResource<com.vmware.vcloud.api.rest.schema.AbstractVAppType>
Returns:
ResourceType

isDeployed

public Boolean isDeployed()
Returns whether the vApp or VM is deployed

Returns:
Boolean

getProductSections

public List<com.vmware.vcloud.api.rest.schema.ovf.ProductSectionType> getProductSections()
                                                                                  throws VCloudException
Returns the ProductSections of a vApp/VM

Returns:
List<ProductSectionType>
Throws:
VCloudException
Since:
API 1.5

getProductSections

public static List<com.vmware.vcloud.api.rest.schema.ovf.ProductSectionType> getProductSections(VcloudClient client,
                                                                                                com.vmware.vcloud.api.rest.schema.ReferenceType ref)
                                                                                         throws VCloudException
Returns the ProductSections for the vApp/VM

Parameters:
client - VcloudClient
ref - ReferenceType
Returns:
List<ProductSectionType>
Throws:
VCloudException
Since:
API 1.5

getSnapshotSection

public com.vmware.vcloud.api.rest.schema.SnapshotSectionType getSnapshotSection()
                                                                         throws VCloudException
Returns the SnapshotSection for the given vapp

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

getSnapshotSection

public static com.vmware.vcloud.api.rest.schema.SnapshotSectionType getSnapshotSection(VcloudClient client,
                                                                                       com.vmware.vcloud.api.rest.schema.ReferenceType vappRef)
                                                                                throws VCloudException
Returns the SnapshotSection

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

updateProductSections

public Task updateProductSections(List<com.vmware.vcloud.api.rest.schema.ovf.ProductSectionType> productSections)
                           throws VCloudException
Update the product sections of a vApp/VM

Parameters:
productSections - List<ProductSectionType>
Returns:
Task
Throws:
VCloudException
Since:
API 1.5

deploy

public Task deploy(boolean powerOn,
                   int lease,
                   boolean forceCustomization)
            throws VCloudException
Deploy VAPP/VM . This is long running operation and returns the Task

Parameters:
powerOn - True if the vApp/VM should be powered on after deployment
lease - Duration of the deployment lease, in seconds
forceCustomization - True if the vApp/VM should be customized after deployment
Returns:
Task Task
Throws:
VCloudException
Since:
API 1.5

deploy

public static Task deploy(VcloudClient client,
                          com.vmware.vcloud.api.rest.schema.ReferenceType ref,
                          boolean powerOn,
                          int lease,
                          boolean forceCustomization)
                   throws VCloudException
Deploy VAPP/VM. This is long running operation and returns the Task

Parameters:
client - vCloud Client VcloudClient
ref - ReferenceType to the vApp/VM
powerOn - True if the vApp/VM should be powered on after deployment
lease - Duration of the deployment lease, in seconds
forceCustomization - True if the vApp/VM should be customized after deployment
Returns:
Task Task
Throws:
VCloudException
Since:
API 1.5

undeploy

public Task undeploy(UndeployPowerActionType undeployPowerAction)
              throws VCloudException
Undeploys the vApp/VM

Parameters:
undeployPowerAction - UndeployPowerActionType
Returns:
Task
Throws:
VCloudException
Since:
API 1.5

undeploy

public static Task undeploy(VcloudClient client,
                            com.vmware.vcloud.api.rest.schema.ReferenceType ref,
                            UndeployPowerActionType undeployPowerAction)
                     throws VCloudException
Undeploys the vApp/VM

Parameters:
client - - VcloudClient
ref - - ReferenceType vApp/VM ReferenceType
undeployPowerAction - UndeployPowerActionType
Returns:
Task
Throws:
VCloudException
Since:
API 1.5

powerOn

public Task powerOn()
             throws VCloudException
Power on VAPP/VM. This is long running operation and returns the Task

Returns:
Task Task
Throws:
VCloudException

powerOn

public static Task powerOn(VcloudClient client,
                           com.vmware.vcloud.api.rest.schema.ReferenceType ref)
                    throws VCloudException
Power on VAPP/VM. This is long running operation and returns the Task

Parameters:
client - vCloud Client VcloudClient
ref - VAPP/VM Ref
Returns:
Task Task
Throws:
VCloudException

powerOff

public Task powerOff()
              throws VCloudException
Power off VAPP/VM. This is long running operation and returns the Task

Returns:
Task Task
Throws:
VCloudException

powerOff

public static Task powerOff(VcloudClient client,
                            com.vmware.vcloud.api.rest.schema.ReferenceType ref)
                     throws VCloudException
Power off VAPP/VM. This is long running operation and returns the Task

Parameters:
client - vCloud Client VcloudClient
ref - VAPP/VM Ref
Returns:
Task Task
Throws:
VCloudException

reset

public Task reset()
           throws VCloudException
Reset VAPP/VM. This is long running operation and returns the Task

Returns:
Task Task
Throws:
VCloudException

reset

public static Task reset(VcloudClient client,
                         com.vmware.vcloud.api.rest.schema.ReferenceType ref)
                  throws VCloudException
Reset VAPP/VM. This is long running operation and returns the Task

Parameters:
client - vCloud Client VcloudClient
ref - VAPP/VM Ref
Returns:
Task Task
Throws:
VCloudException

suspend

public Task suspend()
             throws VCloudException
Suspend VAPP/VM. This is long running operation and returns the Task

Returns:
Task Task
Throws:
VCloudException

suspend

public static Task suspend(VcloudClient client,
                           com.vmware.vcloud.api.rest.schema.ReferenceType ref)
                    throws VCloudException
Suspend VAPP/VM. This is long running operation and returns the Task

Parameters:
client - vCloud Client VcloudClient
ref - VAPP/VM Ref
Returns:
Task Task
Throws:
VCloudException

discardSuspend

public Task discardSuspend()
                    throws VCloudException
Discard the Suspended State of a vApp or Virtual Machine

Returns:
Task Task
Throws:
VCloudException

discardSuspend

public static Task discardSuspend(VcloudClient client,
                                  com.vmware.vcloud.api.rest.schema.ReferenceType ref)
                           throws VCloudException
Discard the Suspended State of a vApp or Virtual Machine

Parameters:
client - vCloud Client VcloudClient
ref - VAPP/VM Ref
Returns:
Task Task
Throws:
VCloudException

shutdown

public Task shutdown()
              throws VCloudException
Shutdown VAPP/VM gracefully.

Returns:
Task
Throws:
VCloudException

shutdown

public static Task shutdown(VcloudClient client,
                            com.vmware.vcloud.api.rest.schema.ReferenceType ref)
                     throws VCloudException
Shutdown VAPP/VM gracefully.

Parameters:
client - vCloud Client VcloudClient
ref - VAPP/VM Ref
Returns:
Task
Throws:
VCloudException

reboot

public Task reboot()
            throws VCloudException
Reboot VAPP/VM

Returns:
Task
Throws:
VCloudException

reboot

public static Task reboot(VcloudClient client,
                          com.vmware.vcloud.api.rest.schema.ReferenceType ref)
                   throws VCloudException
Reboot VAPP/VM

Parameters:
client - vCloud Client VcloudClient
ref - VAPP/VM Ref
Returns:
Task
Throws:
VCloudException

removeAllSnapshots

public Task removeAllSnapshots()
                        throws VCloudException
Removes all user created snapshots for a vApp or virtual machine.

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

removeAllSnapshots

public static Task removeAllSnapshots(VcloudClient client,
                                      com.vmware.vcloud.api.rest.schema.ReferenceType ref)
                               throws VCloudException
Removes all user created snapshots for a vApp or virtual machine.

Parameters:
client -
ref -
Returns:
Task
Throws:
VCloudException
Since:
API 5.1, SDK 5.1

revertToCurrentSnapshot

public Task revertToCurrentSnapshot()
                             throws VCloudException
Reverts a vApp or virtual machine to the current snapshot, if any.

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

revertToCurrentSnapshot

public static Task revertToCurrentSnapshot(VcloudClient client,
                                           com.vmware.vcloud.api.rest.schema.ReferenceType ref)
                                    throws VCloudException
Reverts a vApp or virtual machine to the current snapshot, if any.

Parameters:
client -
ref -
Returns:
Task
Throws:
VCloudException
Since:
API 5.1, SDK 5.1

createSnapshot

public Task createSnapshot(String name,
                           String description,
                           boolean memory,
                           boolean quiesce)
                    throws VCloudException
Creates new snapshot of a virtual machine or of all the virtual machines in a vApp. Prior to creation of the new snapshots, any existing user created snapshots associated with the virtual machines are removed.

Parameters:
name -
description -
memory - - Whether to include a dump of the internal state of the virtual machine (basically a memory dump) in the snapshot.
quiesce - - Whether to include a dump of the internal state of the virtual machine (basically a memory dump) in the snapshot.
Returns:
Task
Throws:
VCloudException
Since:
API 5.1, SDK 5.1

createSnapshot

public static Task createSnapshot(VcloudClient client,
                                  com.vmware.vcloud.api.rest.schema.ReferenceType ref,
                                  String name,
                                  String description,
                                  boolean memory,
                                  boolean quiesce)
                           throws VCloudException
Creates new snapshot of a virtual machine or of all the virtual machines in a vApp. Prior to creation of the new snapshots, any existing user created snapshots associated with the virtual machines are removed.

Parameters:
client -
ref -
name -
description -
memory - - Whether to include a dump of the internal state of the virtual machine (basically a memory dump) in the snapshot.
quiesce - - Whether to include a dump of the internal state of the virtual machine (basically a memory dump) in the snapshot.
Returns:
Task
Throws:
VCloudException
Since:
API 5.1, SDK 5.1

delete

public static Task delete(VcloudClient client,
                          com.vmware.vcloud.api.rest.schema.ReferenceType ref)
                   throws VCloudException
Delete VAPP/VM. This is long running operation and returns the Task

Parameters:
client - vCloud Client VcloudClient
ref - VAPP/VM Ref
Returns:
Task Task
Throws:
VCloudException

delete

public Task delete()
            throws VCloudException
Delete VAPP/VM . This is long running operation and returns the Task

Returns:
Task Task
Throws:
VCloudException


Copyright © 2016. All Rights Reserved.