IWsEndUserGetLoadBalancerNotifications Method |
Namespace: Aruba.Cloud.WsEndUser
[OperationContractAttribute] WsResult<LoadBalancerNotifications> GetLoadBalancerNotifications( LoadBalancerNotificationsRequest request )
/// IWsEndUser.GetLoadBalancerNotifications Method (c# .NET) public static string GetLoadBalancerNotifications(WsEndUserClient client, int loadBalancerID, int loadBalancerRuleID, DateTime startDate, DateTime endDate) { //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 LoadBalancerNotificationsRequest request = new LoadBalancerNotificationsRequest(); request.LoadBalancerID = loadBalancerID; request.LoadBalancerRuleID = loadBalancerRuleID; request.StartDate = startDate; request.EndDate = endDate; // call method GetLoadBalancerNotifications // obtaining a WsResultOfLoadBalancerRuleStatistics item WsResultOfLoadBalancerNotifications result = client.GetLoadBalancerNotifications(request); //if the call is Success print values if (result.Success) { stringBuilder.Append(" Operation ends successfully."); LoadBalancerNotifications item = result.Value; stringBuilder.Append("\n CompanyID: "); stringBuilder.Append(item.CompanyID); stringBuilder.Append("\n DataCenterID: "); stringBuilder.Append(item.DataCenterID); stringBuilder.Append("\n Name: "); stringBuilder.Append(item.Name); stringBuilder.Append("\n LoadBalancerID: "); stringBuilder.Append(item.LoadBalancerID); if (item.RuleNotificationEvents != null) { foreach (RuleNotificationEvent entity in item.RuleNotificationEvents) { stringBuilder.Append("\nEventDate: "); stringBuilder.Append(entity.EventDate); stringBuilder.Append("\nHostIP: "); stringBuilder.Append(entity.HostIP); stringBuilder.Append("\nLoadBalancerRuleID: "); stringBuilder.Append(entity.LoadBalancerRuleID); if (entity.Communications != null) { foreach (Communication comm in entity.Communications) { stringBuilder.Append("\nCommunication SendDate: "); stringBuilder.Append(comm.SendDate); stringBuilder.Append("\nCommunication NotificationType:"); stringBuilder.Append(comm.NotificationType); stringBuilder.Append("\nCommunication Text : "); stringBuilder.Append(comm.Text); } } } } } else { throw new ApplicationException(result.ResultMessage); } } catch (Exception ex) { // re-run the error throw new ApplicationException(ex.Message); } return stringBuilder.ToString(); }