Click or drag to resize

IWsEndUserGetVMMetrics Method

The method return information about Virtual Machine metrics.

Namespace:  Aruba.Cloud.WsEndUser
Assembly:  Aruba.Cloud.WsEndUser (in Aruba.Cloud.WsEndUser.dll) Version: (
WsResult<VMMetricsResult[]> GetVMMetrics(
	GetVMMetricsRequest[] infoTypes


Type: GetVMMetricsRequest
Array of type GetVMMetricsRequest, it allow to explain wich type of informations are requested, Each object of the array meet a Server metrics request. The available sets of informations regards CPU and NET. The servers with VMWare hypervisor have additional information regarding RAM and Hard Disk. For each information set, it's possible to specify the beginning date, the ending date and the precision of data returned. Higher is the precision value, higher will be the amount of data, but the approximation will raise down.

Return Value

Type: WsResultVMMetricsResult
The method return a set of results of type VMMetricsResult, one for each VM requested, followed by requested data.
public VMMetricsResult[] GetVMMetrics() {

    GetVMMetricsRequest myRequest = new GetVMMetricsRequest
        CPU = new ResourceRequest()
            //Going back to midnight of 30 days ago:
            StartDate = DateTime.Now.Date.AddDays(-30),
            //Searching until today's midnight
            EndDate = DateTime.Now.Date,
            Precision = 31

    GetVMMetricsRequest[] infoTypes = { myRequest };

    using (var client = new WsEndUserClient())
        WsResultOfArrayOfVMMetricsResult result = client.GetVMMetrics(infoTypes);
        if (result.Success)
            return result.Value;
            throw new CodedException(GetErrorCode(result.ResultCode), result.ResultMessage);
See Also