IWsBackupGetLogs Method |
Namespace: Aruba.Cloud.WsBackup
[OperationContractAttribute] WsResult<List<BackupLog>> GetLogs( DateTime from, DateTime to )
/// WsBackupClient.GetLogs Method (c# .NET) public static string GetLogs(WsBackupClient client, DateTime from, DateTime to) { //specify the account login details client.ClientCredentials.UserName.UserName = "ARU-0000"; client.ClientCredentials.UserName.Password = "0123456789"; StringBuilder stringBuilder = new StringBuilder(); try { // call method GetLogs // obtaining a WsResultOfArrayOfBackupLog item WsResultOfArrayOfBackupLog result = client.GetLogs(from, to); // if the call is Success print returned values if (result.Success) { stringBuilder.Append("Operation ends successfully\n"); // get Value returned from server BackupLog[] items = result.Value; if (items != null) { foreach (BackupLog item in items) { stringBuilder.Append("\nBackupLog detail\n"); stringBuilder.Append("\nOperationName: "); stringBuilder.Append(item.OperationName); stringBuilder.Append("\nOperationUsername: "); stringBuilder.Append(item.OperationUsername); stringBuilder.Append("\nMessage: "); stringBuilder.Append(item.Message); stringBuilder.Append("\nUserId: "); stringBuilder.Append(item.UserId); stringBuilder.Append("\nRegionId: "); stringBuilder.Append(item.RegionId); stringBuilder.Append("\nJobId: "); stringBuilder.Append(item.JobId); stringBuilder.Append("\nJobStatus: "); stringBuilder.Append(item.JobStatus); } } } else { throw new ApplicationException(result.ResultMessage); } } catch (Exception ex) { // re-run the error throw new ApplicationException(ex.Message); } return stringBuilder.ToString(); }