Phone sales support +39 0575 05077
  Phone technical support +39 0575 0508
 

4.1.10 Deleting a Snapshot

Performs a creation, restoration or deletion of a snapshot operation on the disks of a virtual server.
Using Aruba's WsEndUser SetEnqueueServerSnapshot method you can queue a creation, restoration or deletion of a snapshot operation (Job) associated with a virtual server. When a snapshot is restored, the disks and the data contained in them are restored. On the other hand the RAM, CPU and network connections as Virtual LAN and Public IPs remain unchanged.
The snapshot functionality is only available for servers based on VMware hypervisors. Each virtual server can have at most one active snapshot. Once the snapshot for a virtual server has been activated you can request the deletion (merger) or restoration (roll-back) within 7 days of the activation date. Once this period has expired the snapshot will be automatically deleted and you will no longer be able to restore it.

Parameters
serverId
Type: int
System.Int32 type value which represents the unique identifier for the virtual server.
snapshotOperation
Type: SnapshotOperationTypes
Member of the SnapshotOperationTypes enumeration which indicates the type of operation to be performed on the snapshot. For more details, see the definition of the SnapshotOperationTypes object.

Let's look at the example of a method that removes a snapshot of a virtual server.

//IWsEndUser.SetEnqueueServerSnapshot Method (c# .NET)
private static void DeleteSnapshot(WsEndUserClient client, int serverId)
{
    try
    {
        //calls the SetEnqueueServerSnapshot method, 
        //getting a WsResult object
        WsResult result = client.SetEnqueueServerSnapshot(
            serverId, SnapshotOperationTypes.Delete);

        //if the call fails; it relaunches the error indicating the message
        if (!result.Success)
            throw new ApplicationException(result.ResultMessage);
    }
    catch (Exception ex)
    {
        //relaunches the generic error
        throw new ApplicationException(ex.Message);
    }
}
//IWsEndUser.setEnqueueServerSnapshot Method (JAVA)
private static void DeleteSnapshot(IWsEndUser client, int serverId)
{
    try
    {
        //calls the setEnqueueServerSnapshot method, 
        //getting a WsResult object
        WsResult result = client.setEnqueueServerSnapshot(
            serverId, SnapshotOperationTypes.DELETE);

        //if the call fails; it relaunches the error indicating the message
        if (!result.isSuccess())
        {
            throw new Exception(result.getResultMessage());
        }
    }
    catch (Exception ex)
    {
        //prints the error
        System.out.println(ex);
    }
}

Version
API: v2.8 URL: https://api.dc1.computing.cloud.it/WsEndUser/v2.8/WsEndUser.svc?wsdl
See also

API: v2.8 URL: https://api.dc1.computing.cloud.it/WsEndUser/v2.8/WsEndUser.svc?wsdl

Bookmark and Share