Click or drag to resize

IWsMonitoringGetLogs Method

By the method GetLogs you can retrieve the list of Logs from Monitoring task
By the method GetLogs you can retrieve the list of Logs from Monitoring task

Namespace:  Aruba.Cloud.WsMonitoring
Assembly:  Aruba.Cloud.WsMonitoring (in Aruba.Cloud.WsMonitoring.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
[OperationContractAttribute]
WsResult<List<MonitoringLogEntity>> GetLogs(
	GetLogEntity getLogEntity
)

Parameters

getLogEntity
Type: Aruba.Cloud.Provisioning.Entities.MonitoringSLAGetLogEntity

Return Value

Type: WsResultListMonitoringLogEntity
Examples
By the method GetLogs you can retrieve the list of Logs from Monitoring.
/// WsMonitoring.GetLogs Method (c# .NET)
public static string GetLogs(WsMonitoringClient client,
    DateTime fromDate, DateTime toDate)
{
    //specify the account login details 
    client.ClientCredentials.UserName.UserName = "ARU-0000";
    client.ClientCredentials.UserName.Password = "0123456789";

    StringBuilder stringBuilder = new StringBuilder();

    try
    {
 // create the request object
 GetLogEntity request = new GetLogEntity();
 request.From = fromDate;
 request.To = toDate;

 // call method GetLogs 
 // obtaining a WsResultOfArrayOfMonitoringLogEntity item
 WsResultOfArrayOfMonitoringLogEntity result =
     client.GetLogs(request);

 // if the call is Success print returned values
 if (result.Success)
 {
     stringBuilder.Append("Operation ends successfully\n");

     // get Value returned from server
     MonitoringLogEntity[] items = result.Value;

     // for each item print the information
     foreach (MonitoringLogEntity item in items)
     {
  stringBuilder.Append("\nJobID: ");
  stringBuilder.Append(item.JobID);
  stringBuilder.Append("\nResourceId: ");
  stringBuilder.Append(item.ResourceId);
  stringBuilder.Append("\nOperationName: ");
  stringBuilder.Append(item.OperationName);
     }
 }
 else
 {
     throw new ApplicationException(result.ResultMessage);
 }
    }
    catch (Exception ex)
    {
 // re-run the error
 throw new ApplicationException(ex.Message);
    }

    return stringBuilder.ToString();
}
See Also