4using System.Threading.Tasks;
31 [Page(2,
"Pagination", 200)]
32 [Header(3,
"Offset:")]
33 [ToolTip(4,
"Skip this number of objects in the result set.")]
35 [Range(0,
int.MaxValue)]
36 public int Offset = 0;
38 [Page(2,
"Pagination", 200)]
39 [Header(5,
"Max Count:")]
40 [ToolTip(6,
"Maximum number of objects to return.")]
42 [Range(1,
int.MaxValue)]
43 public int MaxCount = 1000;
45 [Page(7,
"Time", 150)]
47 [ToolTip(9,
"Search for events from this point in time.")]
50 [Page(7,
"Time", 150)]
52 [ToolTip(11,
"Search for events to this point in time.")]
55 [Page(12,
"Scope", 100)]
56 [Header(13,
"Object:")]
57 [ToolTip(14,
"Return events related to this object. Use asterisks (*) as wildcard characters.")]
58 public string Object =
string.Empty;
60 [Page(12,
"Scope", 100)]
61 [Header(15,
"Actor:")]
62 [ToolTip(16,
"Return events related to this actor. Use asterisks (*) as wildcard characters.")]
63 public string Actor =
string.Empty;
65 [Page(12,
"Scope", 100)]
66 [Header(17,
"Event ID:")]
67 [ToolTip(18,
"Return events with this Event ID. Use asterisks (*) as wildcard characters.")]
68 public string EventId =
string.Empty;
70 [Page(12,
"Scope", 100)]
71 [Header(19,
"Module:")]
72 [ToolTip(20,
"Return events related to this module. Use asterisks (*) as wildcard characters.")]
73 public string Module =
string.Empty;
75 [Page(12,
"Scope", 100)]
76 [Header(21,
"Facility:")]
77 [ToolTip(22,
"Return events related to this facility. Use asterisks (*) as wildcard characters.")]
78 public string Facility =
string.Empty;
80 [Page(23,
"Types", 110)]
82 [ToolTip(25,
"Check this box to include debug messages in the result.")]
83 public bool Debug =
true;
85 [Page(23,
"Types", 110)]
86 [Header(26,
"Information")]
87 [ToolTip(27,
"Check this box to include information messages in the result.")]
88 public bool Informational =
true;
90 [Page(23,
"Types", 110)]
91 [Header(28,
"Notice")]
92 [ToolTip(29,
"Check this box to include notification messages in the result.")]
93 public bool Notice =
true;
95 [Page(23,
"Types", 110)]
96 [Header(30,
"Warning")]
97 [ToolTip(31,
"Check this box to include warning messages in the result.")]
98 public bool Warning =
true;
100 [Page(23,
"Types", 110)]
101 [Header(32,
"Error")]
102 [ToolTip(33,
"Check this box to include error messages in the result.")]
103 public bool Error =
true;
105 [Page(23,
"Types", 110)]
106 [Header(34,
"Critical")]
107 [ToolTip(35,
"Check this box to include critical messages in the result.")]
108 public bool Critical =
true;
110 [Page(23,
"Types", 110)]
111 [Header(36,
"Alert")]
112 [ToolTip(37,
"Check this box to include alert messages in the result.")]
113 public bool Alert =
true;
115 [Page(23,
"Types", 110)]
116 [Header(38,
"Emergency")]
117 [ToolTip(39,
"Check this box to include emergency messages in the result.")]
118 public bool Emergency =
true;
120 [Page(40,
"Levels", 120)]
121 [Header(41,
"Minor")]
122 [ToolTip(42,
"Check this box to include minor events in the result.")]
123 public bool Minor =
true;
125 [Page(40,
"Levels", 120)]
126 [Header(43,
"Medium")]
127 [ToolTip(44,
"Check this box to include medium events in the result.")]
128 public bool Medium =
true;
130 [Page(40,
"Levels", 120)]
131 [Header(45,
"Major")]
132 [ToolTip(46,
"Check this box to include major events in the result.")]
133 public bool Major =
true;
142 DateTime TP = DateTime.Now;
143 return new DateTime(TP.Year, TP.Month, TP.Day, TP.Hour, TP.Minute, 0);
164 Offset = this.Offset,
165 MaxCount = this.MaxCount,
168 Object = this.Object,
170 EventId = this.EventId,
171 Module = this.Module,
172 Facility = this.Facility,
174 Informational = this.Informational,
175 Notice = this.Notice,
176 Warning = this.Warning,
178 Critical = this.Critical,
180 Emergency = this.Emergency,
182 Medium = this.Medium,
195 return Task.CompletedTask;
205 if (this.To < this.From)
207 DateTime Temp = this.To;
218 WebServices.SearchEvents.AddFilter(Filters,
"Object", this.Object);
219 WebServices.SearchEvents.AddFilter(Filters,
"Actor", this.Actor);
220 WebServices.SearchEvents.AddFilter(Filters,
"EventId", this.EventId);
221 WebServices.SearchEvents.AddFilter(Filters,
"Module", this.Module);
222 WebServices.SearchEvents.AddFilter(Filters,
"Facility", this.Facility);
224 if (!(this.Debug && this.Informational && this.Notice && this.Warning && this.Error && this.Critical && this.Alert && this.Emergency))
226 List<Filter> Ors =
new List<Filter>();
228 WebServices.SearchEvents.AddFilter(Ors,
"Type", this.Debug,
EventType.Debug);
229 WebServices.SearchEvents.AddFilter(Ors,
"Type", this.Informational,
EventType.Informational);
230 WebServices.SearchEvents.AddFilter(Ors,
"Type", this.Notice,
EventType.Notice);
231 WebServices.SearchEvents.AddFilter(Ors,
"Type", this.Warning,
EventType.Warning);
232 WebServices.SearchEvents.AddFilter(Ors,
"Type", this.Error,
EventType.Error);
233 WebServices.SearchEvents.AddFilter(Ors,
"Type", this.Critical,
EventType.Critical);
234 WebServices.SearchEvents.AddFilter(Ors,
"Type", this.Alert,
EventType.Alert);
235 WebServices.SearchEvents.AddFilter(Ors,
"Type", this.Emergency,
EventType.Emergency);
240 if (!(this.Minor && this.Medium && this.Major))
242 List<Filter> Ors =
new List<Filter>();
244 WebServices.SearchEvents.AddFilter(Ors,
"Level", this.Minor,
EventLevel.Minor);
245 WebServices.SearchEvents.AddFilter(Ors,
"Level", this.Medium,
EventLevel.Medium);
246 WebServices.SearchEvents.AddFilter(Ors,
"Level", this.Major,
EventLevel.Major);
275 if (this.MaxCount-- <= 0)
289 sb.Append(Tag.
Value?.ToString());
Class representing an event.
string Message
Free-text event message.
EventType Type
Type of event.
string Object
Object related to the event.
EventLevel Level
Event Level.
string Actor
Actor responsible for the action causing the event.
string Module
Module where the event is reported.
DateTime Timestamp
Timestamp of event.
KeyValuePair< string, object >[] Tags
Variable set of tags providing event-specific information.
string EventId
Computer-readable Event ID identifying type of even.
string Facility
Facility can be either a facility in the network sense or in the system sense.
string StackTrace
Stack Trace of event.
Class representing a persisted event.
Class representing a persisted tag.
Static interface for database persistence. In order to work, a database provider has to be assigned t...
static Task< IEnumerable< object > > Find(string Collection, params string[] SortOrder)
Finds objects in a given collection.
This filter selects objects that conform to all child-filters provided.
This filter selects objects that have a named field greater or equal to a given value.
This filter selects objects that have a named field lesser or equal to a given value.
This filter selects objects that conform to any of the child-filters provided.
ReportNode Report
Report node.
A chunked list is a linked list of chunks of objects of type T .
void Add(T Item)
Adds an item to the collection.
T[] ToArray()
Returns an array containing all elements of the collection.
Contains information about a language.
Task< string > GetStringAsync(Type Type, int Id, string Default)
Gets the string value of a string ID. If no such string exists, a string is created with the default ...
Query command that searches the event log for events.
SearchEventsCommand(SearchEventLogNode ReportNode)
Query command that searches the event log for events.
override ICommand Copy()
Creates a copy of the command object.
static DateTime CurrentMinute
Returns the current time, omitting seconds and fractions of seconds.
override Task< string > GetNameAsync(Language Language)
Gets the displayable name of the command.
override Task StartQueryExecutionAsync(Query Query, Language Language)
Starts the execution of a query.
Abstract base class for commands executing a server administrator report.
Defines a column in a table.
Class handling the reception of data from a query.
Task TableDone(string TableId)
Reports a table as being complete.
Task EndSection()
Ends a section. Each call to BeginSection(string) must be followed by a call to EndSection().
Task Start()
Starts query execution.
Task NewRecords(string TableId, params Record[] Records)
Reports a new set of records in a table.
Task BeginSection(string Header)
Begins a new section. Sections can be nested. Each call to BeginSection(string) must be followed by a...
Task NewTable(string TableId, string TableName, params Column[] Columns)
Defines a new table in the query output.
Task LogMessage(Exception Exception)
Logs an Exception as a query message.
async Task Done()
Query execution completed.
Task SetStatus(string Status)
Sets the current status of the query execution.
Task SetTitle(string Title)
Sets the title of the report.
Defines a record in a table.
ColumnAlignment
Column alignment.