Click or drag to resize

IWsEndUserGetVMPerformance Method

The method return information about virtual server actual state. The available information sets are CPU and Net info. The servers with VMWare hypervisor have additional data regarding RAM and Hard Disk.

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<VMPerformanceResult> GetVMPerformance(
	int VmID,
	VMPInformationType infoTypes
)

Parameters

VmID
Type: SystemInt32
The ID of the Virtual server
infoTypes
Type: VMPInformationType
Object of type VMPInformationType specifying the desired informations

Return Value

Type: WsResultVMPerformanceResult
The method return an object of type VMPerformanceResult, folowed by the information set requested
Examples
public VMPerformanceResult GetVMPerformance()
{
  int vmID = 12 //The ID of the server i'm interested to
  VMPInformationType infoTypes = new VMPInformationType()
  {
      BANDWIDTH = true,
      CPU = true,
      IO = true,
      NET = false
  };

  using (var client = new WsEndUserClient())
  {
    WsResultOfVMPerformanceResult result = client.GetVMPerformance(vmID, infoTypes);
    if (result.Success)
      return result.Value;
    else
    {
      throw new CodedException(GetErrorCode(result.ResultCode), result.ResultMessage);
    }
  }
}
See Also