Skip to content

Commit 06892fa

Browse files
authored
Merge pull request #104 from datalust/dev
2021.3 Errata
2 parents 00836cf + 3e59dab commit 06892fa

File tree

5 files changed

+43
-10
lines changed

5 files changed

+43
-10
lines changed

src/Seq.Api/Model/Alerting/AlertActivityPart.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3+
34
// ReSharper disable UnusedAutoPropertyAccessor.Global
45

56
namespace Seq.Api.Model.Alerting
@@ -39,9 +40,21 @@ public class AlertActivityPart
3940
/// </summary>
4041
public List<AlertOccurrencePart> RecentOccurrences { get; set; } = new List<AlertOccurrencePart>();
4142

43+
/// <summary>
44+
/// Minimal metrics for the most recent occurrences of the alert that triggered notifications.
45+
/// The metrics in this list are a superset of <see cref="RecentOccurrences"/>.
46+
/// </summary>
47+
public List<AlertOccurrenceRangePart> RecentOccurrenceRanges { get; set; } =
48+
new List<AlertOccurrenceRangePart>();
49+
4250
/// <summary>
4351
/// The number of times this alert has been triggered since its creation.
4452
/// </summary>
4553
public int TotalOccurrences { get; set; }
54+
55+
/// <summary>
56+
/// The detection time of the most recent occurrence not included in <see cref="RecentOccurrences"/>.
57+
/// </summary>
58+
public DateTime? LastEarlierOccurrence { get; set; }
4659
}
4760
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using Seq.Api.Model.LogEvents;
2+
using Seq.Api.Model.Shared;
3+
4+
namespace Seq.Api.Model.Alerting
5+
{
6+
/// <summary>
7+
/// An occurrence metric of an alert that triggered notifications.
8+
/// </summary>
9+
public class AlertOccurrenceRangePart
10+
{
11+
/// <summary>
12+
/// The time grouping that triggered the alert.
13+
/// </summary>
14+
public DateTimeRange DetectedOverRange { get; set; }
15+
}
16+
}

src/Seq.Api/Model/Apps/AppPackagePart.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,7 @@ public class AppPackagePart
4040
/// Package authorship information.
4141
/// </summary>
4242
public string Authors { get; set; }
43-
44-
/// <summary>
45-
/// URL of an icon for the app package.
46-
/// </summary>
47-
public string IconUrl { get; set; }
48-
43+
4944
/// <summary>
5045
/// URL of the package license.
5146
/// </summary>

src/Seq.Api/ResourceGroups/AlertsResourceGroup.cs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
using System.Threading.Tasks;
1919
using Seq.Api.Model;
2020
using Seq.Api.Model.Alerting;
21+
using Seq.Api.Model.Signals;
2122
using Seq.Api.Model.Users;
2223

2324
namespace Seq.Api.ResourceGroups
@@ -55,17 +56,25 @@ public async Task<AlertEntity> FindAsync(string id, CancellationToken cancellati
5556
public async Task<List<AlertEntity>> ListAsync(string ownerId = null, bool shared = false, CancellationToken cancellationToken = default)
5657
{
5758
var parameters = new Dictionary<string, object> { { "ownerId", ownerId }, { "shared", shared } };
58-
return await GroupListAsync<AlertEntity>("Items", parameters, cancellationToken: cancellationToken).ConfigureAwait(false);
59+
return await GroupListAsync<AlertEntity>("Items", parameters, cancellationToken).ConfigureAwait(false);
5960
}
6061

6162
/// <summary>
6263
/// Construct a alert with server defaults pre-initialized.
6364
/// </summary>
6465
/// <param name="cancellationToken"><see cref="CancellationToken"/> allowing the operation to be canceled.</param>
66+
/// <param name="signal">The source of events that will contribute to the alert.</param>
67+
/// <param name="query">An SQL query that will supply default clauses to the new alert.</param>
6568
/// <returns>The unsaved alert.</returns>
66-
public async Task<AlertEntity> TemplateAsync(CancellationToken cancellationToken = default)
69+
public async Task<AlertEntity> TemplateAsync(SignalExpressionPart signal = null, string query = null, CancellationToken cancellationToken = default)
6770
{
68-
return await GroupGetAsync<AlertEntity>("Template", cancellationToken: cancellationToken).ConfigureAwait(false);
71+
var parameters = new Dictionary<string, object>
72+
{
73+
["signal"] = signal?.ToString(),
74+
["q"] = query
75+
};
76+
77+
return await GroupGetAsync<AlertEntity>("Template", parameters, cancellationToken).ConfigureAwait(false);
6978
}
7079

7180
/// <summary>

src/Seq.Api/Seq.Api.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<Description>Client library for the Seq HTTP API.</Description>
4-
<VersionPrefix>2021.3.0</VersionPrefix>
4+
<VersionPrefix>2021.3.1</VersionPrefix>
55
<Authors>Datalust;Contributors</Authors>
66
<TargetFramework>netstandard2.0</TargetFramework>
77
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>

0 commit comments

Comments
 (0)