Add Name field to AlertInfo (#649)

This commit is contained in:
Karl Burtram
2018-06-30 11:16:54 -07:00
committed by GitHub
parent 704b25f082
commit d86a1ce1d3
2 changed files with 6 additions and 4 deletions

View File

@@ -424,23 +424,24 @@ namespace Microsoft.SqlTools.ServiceLayer.Agent
alerts[i] = new AgentAlertInfo alerts[i] = new AgentAlertInfo
{ {
Id = alert.ID, Id = alert.ID,
Name = alert.Name,
DelayBetweenResponses = alert.DelayBetweenResponses, DelayBetweenResponses = alert.DelayBetweenResponses,
EventDescriptionKeyword = alert.EventDescriptionKeyword, EventDescriptionKeyword = alert.EventDescriptionKeyword,
EventSource = alert.EventSource, EventSource = alert.EventSource,
HasNotification = alert.HasNotification, HasNotification = alert.HasNotification,
IncludeEventDescription = (Contracts.NotifyMethods)alert.IncludeEventDescription, IncludeEventDescription = (Contracts.NotifyMethods)alert.IncludeEventDescription,
IsEnabled = alert.IsEnabled, IsEnabled = alert.IsEnabled,
JobId = alert.JobID != null ? alert.JobID.ToString() : null, JobId = alert.JobID.ToString(),
JobName = alert.JobName, JobName = alert.JobName,
LastOccurrenceDate = alert.LastOccurrenceDate != null ? alert.LastOccurrenceDate.ToString() : null, LastOccurrenceDate =alert.LastOccurrenceDate.ToString(),
LastResponseDate = alert.LastResponseDate != null ? alert.LastResponseDate.ToString() : null, LastResponseDate = alert.LastResponseDate.ToString(),
MessageId = alert.MessageID, MessageId = alert.MessageID,
NotificationMessage = alert.NotificationMessage, NotificationMessage = alert.NotificationMessage,
OccurrenceCount = alert.OccurrenceCount, OccurrenceCount = alert.OccurrenceCount,
PerformanceCondition = alert.PerformanceCondition, PerformanceCondition = alert.PerformanceCondition,
Severity = alert.Severity, Severity = alert.Severity,
DatabaseName = alert.DatabaseName, DatabaseName = alert.DatabaseName,
CountResetDate = alert.CountResetDate != null ? alert.CountResetDate.ToString() : null, CountResetDate = alert.CountResetDate.ToString(),
CategoryName = alert.CategoryName, CategoryName = alert.CategoryName,
AlertType = (Contracts.AlertType)alert.AlertType, AlertType = (Contracts.AlertType)alert.AlertType,
WmiEventNamespace = alert.WmiEventNamespace, WmiEventNamespace = alert.WmiEventNamespace,

View File

@@ -33,6 +33,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Agent.Contracts
public class AgentAlertInfo public class AgentAlertInfo
{ {
public int Id { get; set; } public int Id { get; set; }
public string Name { get; set; }
public int DelayBetweenResponses { get; set; } public int DelayBetweenResponses { get; set; }
public string EventDescriptionKeyword { get; set; } public string EventDescriptionKeyword { get; set; }
public string EventSource { get; set; } public string EventSource { get; set; }