IJsonpWsEndUserSetEnqueueHardwareUpdate 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 = "SetEnqueueHardwareUpdate/{jsonp}/{userName}/{token}/{serverId}/{cpuQuantity}/{ramQuantity}/{restartAfterExecuted}")]
Stream SetEnqueueHardwareUpdate(
string jsonp,
string userName,
string token,
string serverId,
string cpuQuantity,
string ramQuantity,
string restartAfterExecuted
)<OperationContractAttribute>
<WebGetAttribute(ResponseFormat := WebMessageFormat.Json, UriTemplate := "SetEnqueueHardwareUpdate/{jsonp}/{userName}/{token}/{serverId}/{cpuQuantity}/{ramQuantity}/{restartAfterExecuted}")>
Function SetEnqueueHardwareUpdate (
jsonp As String,
userName As String,
token As String,
serverId As String,
cpuQuantity As String,
ramQuantity As String,
restartAfterExecuted As String
) As Stream[OperationContractAttribute]
[WebGetAttribute(ResponseFormat = WebMessageFormat::Json, UriTemplate = L"SetEnqueueHardwareUpdate/{jsonp}/{userName}/{token}/{serverId}/{cpuQuantity}/{ramQuantity}/{restartAfterExecuted}")]
Stream^ SetEnqueueHardwareUpdate(
String^ jsonp,
String^ userName,
String^ token,
String^ serverId,
String^ cpuQuantity,
String^ ramQuantity,
String^ restartAfterExecuted
)[<OperationContractAttribute>]
[<WebGetAttribute(ResponseFormat = WebMessageFormat.Json, UriTemplate = "SetEnqueueHardwareUpdate/{jsonp}/{userName}/{token}/{serverId}/{cpuQuantity}/{ramQuantity}/{restartAfterExecuted}")>]
abstract SetEnqueueHardwareUpdate :
jsonp : string *
userName : string *
token : string *
serverId : string *
cpuQuantity : string *
ramQuantity : string *
restartAfterExecuted : string -> Stream
function SetEnqueueHardwareUpdate(
jsonp : String,
userName : String,
token : String,
serverId : String,
cpuQuantity : String,
ramQuantity : String,
restartAfterExecuted : String
) : Stream
Parameters
- jsonp
- Type: SystemString
- userName
- Type: SystemString
- token
- Type: SystemString
- serverId
- Type: SystemString
- cpuQuantity
- Type: SystemString
- ramQuantity
- Type: SystemString
- restartAfterExecuted
- 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