IJsonPostWsEndUserSetEnqueueServerUpdate 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]
[WebInvokeAttribute(Method = "POST", ResponseFormat = WebMessageFormat.Json)]
Stream SetEnqueueServerUpdate(
SetEnqueueServerUpdateRequest request
)
<OperationContractAttribute>
<WebInvokeAttribute(Method := "POST", ResponseFormat := WebMessageFormat.Json)>
Function SetEnqueueServerUpdate (
request As SetEnqueueServerUpdateRequest
) As Stream
[OperationContractAttribute]
[WebInvokeAttribute(Method = L"POST", ResponseFormat = WebMessageFormat::Json)]
Stream^ SetEnqueueServerUpdate(
SetEnqueueServerUpdateRequest^ request
)
[<OperationContractAttribute>]
[<WebInvokeAttribute(Method = "POST", ResponseFormat = WebMessageFormat.Json)>]
abstract SetEnqueueServerUpdate :
request : SetEnqueueServerUpdateRequest -> Stream
function SetEnqueueServerUpdate(
request : SetEnqueueServerUpdateRequest
) : Stream
Parameters
- request
- Type: Aruba.Cloud.WsEndUser.JsonSetEnqueueServerUpdateRequest
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