Click or drag to resize

IWsEndUserSetEnqueueServerUpdate Method

Performs an update of the resources of a virtual server. By the method SetEnqueueServerUpdate () Aruba's WsEndUser you can change the resources of a virtual server by specifying the resources that have changed.

Namespace:  Aruba.Cloud.WsEndUser
Assembly:  Aruba.Cloud.WsEndUser (in Aruba.Cloud.WsEndUser.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
[OperationContractAttribute]
WsResult SetEnqueueServerUpdate(
	ServerUpdate server
)

Parameters

server
Type: Aruba.Cloud.Provisioning.EntitiesServerUpdate
UpdateServer class object that represents the structure of the server to be modified. The class UpdateServer contains inside all the information needed to complete the update operation of the virtual server, and all related resources. To get more details, see the definition of the UpdateServer.

Return Value

Type: WsResult
The method returns an object WsResult containing information on the outcome of the method call.
Examples
The following example shows a user-defined method, called UpdateServer (), which performs a upgrade the CPU, RAM and virtual disk of a primary virtual server with id 803.
private static void UpdateServer()
{
  try
  {
    ServerUpdate serverToUpdate = new ServerUpdate()
    {
      CPUQuantity = 4,
      RAMQuantity = 8,
      ServerId = 803,
      VirtualDisks = new List<VirtualDiskUpdate>() 
      { 
        new VirtualDiskUpdate()
        {
          Size = 10, 
          VirtualDiskUpdateType = VirtualDiskOperationTypes.Resize  
        }
      }.ToArray()
    };

    WsResult result = client.SetEnqueueServerUpdate(serverToUpdate);

    if (!result.Success)
    {
      throw new ApplicationException(String.Format(
        "An error has occurred while invoking SetEnqueueServerUpdate(). {0}", result.ResultMessage));
    }

  }
  catch (Exception ex)
  {
    throw new ApplicationException(String.Format(
      "An error has occurred while updating a virtual server. {0}", ex.Message));
  }
}
See Also