Click or drag to resize

IJsonpWsEndUserSetEnqueueServerUpdate 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]
[WebGetAttribute(ResponseFormat = WebMessageFormat.Json, UriTemplate = "SetEnqueueServerUpdate/{jsonp}/{userName}/{token}?serverId={serverId}&cpuQuantity={cpuQuantity}&ramQuantity={ramQuantity}&virtualDisks={virtualDisks}&restartAfterExecuted={restartAfterExecuted}&smartVMWarePackageID={smartVMWarePackageID}")]
Stream SetEnqueueServerUpdate(
	string jsonp,
	string userName,
	string token,
	int serverId,
	string cpuQuantity,
	string ramQuantity,
	string virtualDisks,
	bool restartAfterExecuted,
	string smartVMWarePackageID
)

Parameters

jsonp
Type: SystemString
userName
Type: SystemString
token
Type: SystemString
serverId
Type: SystemInt32
cpuQuantity
Type: SystemString
ramQuantity
Type: SystemString
virtualDisks
Type: SystemString
restartAfterExecuted
Type: SystemBoolean
smartVMWarePackageID
Type: SystemString

Return Value

Type: Stream
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