From 55472d983bbeb94366a0209d5185c2b67e61c490 Mon Sep 17 00:00:00 2001 From: Nicholas Blumhardt Date: Tue, 12 Oct 2021 14:44:47 +1000 Subject: [PATCH 1/5] Dev version bump [skip ci] --- src/Seq.Api/Seq.Api.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Seq.Api/Seq.Api.csproj b/src/Seq.Api/Seq.Api.csproj index 643cb0b..6976adc 100644 --- a/src/Seq.Api/Seq.Api.csproj +++ b/src/Seq.Api/Seq.Api.csproj @@ -1,7 +1,7 @@ Client library for the Seq HTTP API. - 2021.3.0 + 2021.3.1 Datalust;Contributors netstandard2.0 true From 37f7acd197e0909ac3535cd75ec251d4027bcccd Mon Sep 17 00:00:00 2001 From: Ashley Mannix Date: Fri, 22 Oct 2021 12:02:17 +1000 Subject: [PATCH 2/5] Seq 2021.3 API updates * Removed IconUrl from app package * Add alert recent occurrence ranges --- src/Seq.Api/Model/Alerting/AlertActivityPart.cs | 13 +++++++++++++ .../Model/Alerting/AlertOccurrenceRangePart.cs | 16 ++++++++++++++++ src/Seq.Api/Model/Apps/AppPackagePart.cs | 7 +------ ...opertyPart.cs => InputAppliedPropertyPart.cs} | 0 .../ResourceGroups/AlertsResourceGroup.cs | 15 ++++++++++++--- 5 files changed, 42 insertions(+), 9 deletions(-) create mode 100644 src/Seq.Api/Model/Alerting/AlertOccurrenceRangePart.cs rename src/Seq.Api/Model/Shared/{EventPropertyPart.cs => InputAppliedPropertyPart.cs} (100%) diff --git a/src/Seq.Api/Model/Alerting/AlertActivityPart.cs b/src/Seq.Api/Model/Alerting/AlertActivityPart.cs index f869be3..97f25f5 100644 --- a/src/Seq.Api/Model/Alerting/AlertActivityPart.cs +++ b/src/Seq.Api/Model/Alerting/AlertActivityPart.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; + // ReSharper disable UnusedAutoPropertyAccessor.Global namespace Seq.Api.Model.Alerting @@ -39,9 +40,21 @@ public class AlertActivityPart /// public List RecentOccurrences { get; set; } = new List(); + /// + /// Minimal metrics for the most recent occurrences of the alert that triggered notifications. + /// The metrics in this list are a superset of . + /// + public List RecentOccurrenceRanges { get; set; } = + new List(); + /// /// The number of times this alert has been triggered since its creation. /// public int TotalOccurrences { get; set; } + + /// + /// The detection time of the most recent occurrence not included in . + /// + public DateTime? LastEarlierOccurrence { get; set; } } } diff --git a/src/Seq.Api/Model/Alerting/AlertOccurrenceRangePart.cs b/src/Seq.Api/Model/Alerting/AlertOccurrenceRangePart.cs new file mode 100644 index 0000000..bd2df84 --- /dev/null +++ b/src/Seq.Api/Model/Alerting/AlertOccurrenceRangePart.cs @@ -0,0 +1,16 @@ +using Seq.Api.Model.LogEvents; +using Seq.Api.Model.Shared; + +namespace Seq.Api.Model.Alerting +{ + /// + /// An occurrence metric of an alert that triggered notifications. + /// + public class AlertOccurrenceRangePart + { + /// + /// The time grouping that triggered the alert. + /// + public DateTimeRange DetectedOverRange { get; set; } + } +} diff --git a/src/Seq.Api/Model/Apps/AppPackagePart.cs b/src/Seq.Api/Model/Apps/AppPackagePart.cs index 6064781..8cd87ee 100644 --- a/src/Seq.Api/Model/Apps/AppPackagePart.cs +++ b/src/Seq.Api/Model/Apps/AppPackagePart.cs @@ -40,12 +40,7 @@ public class AppPackagePart /// Package authorship information. /// public string Authors { get; set; } - - /// - /// URL of an icon for the app package. - /// - public string IconUrl { get; set; } - + /// /// URL of the package license. /// diff --git a/src/Seq.Api/Model/Shared/EventPropertyPart.cs b/src/Seq.Api/Model/Shared/InputAppliedPropertyPart.cs similarity index 100% rename from src/Seq.Api/Model/Shared/EventPropertyPart.cs rename to src/Seq.Api/Model/Shared/InputAppliedPropertyPart.cs diff --git a/src/Seq.Api/ResourceGroups/AlertsResourceGroup.cs b/src/Seq.Api/ResourceGroups/AlertsResourceGroup.cs index 6961422..1d26cc1 100644 --- a/src/Seq.Api/ResourceGroups/AlertsResourceGroup.cs +++ b/src/Seq.Api/ResourceGroups/AlertsResourceGroup.cs @@ -18,6 +18,7 @@ using System.Threading.Tasks; using Seq.Api.Model; using Seq.Api.Model.Alerting; +using Seq.Api.Model.Signals; using Seq.Api.Model.Users; namespace Seq.Api.ResourceGroups @@ -55,17 +56,25 @@ public async Task FindAsync(string id, CancellationToken cancellati public async Task> ListAsync(string ownerId = null, bool shared = false, CancellationToken cancellationToken = default) { var parameters = new Dictionary { { "ownerId", ownerId }, { "shared", shared } }; - return await GroupListAsync("Items", parameters, cancellationToken: cancellationToken).ConfigureAwait(false); + return await GroupListAsync("Items", parameters, cancellationToken).ConfigureAwait(false); } /// /// Construct a alert with server defaults pre-initialized. /// /// allowing the operation to be canceled. + /// The source of events that will contribute to the alert. + /// An SQL query that will supply default clauses to the new alert. /// The unsaved alert. - public async Task TemplateAsync(CancellationToken cancellationToken = default) + public async Task TemplateAsync(SignalExpressionPart signal = null, string query = null, CancellationToken cancellationToken = default) { - return await GroupGetAsync("Template", cancellationToken: cancellationToken).ConfigureAwait(false); + var parameters = new Dictionary + { + ["signal"] = signal?.ToString(), + ["q"] = query + }; + + return await GroupGetAsync("Template", parameters, cancellationToken).ConfigureAwait(false); } /// From 0c5c2736811c7deb47c5ef1004ec7f50d35a2410 Mon Sep 17 00:00:00 2001 From: Ashley Mannix Date: Fri, 22 Oct 2021 12:09:39 +1000 Subject: [PATCH 3/5] rename EventPropertyPart --- .../Shared/{InputAppliedPropertyPart.cs => EventPropertyPart.cs} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/Seq.Api/Model/Shared/{InputAppliedPropertyPart.cs => EventPropertyPart.cs} (100%) diff --git a/src/Seq.Api/Model/Shared/InputAppliedPropertyPart.cs b/src/Seq.Api/Model/Shared/EventPropertyPart.cs similarity index 100% rename from src/Seq.Api/Model/Shared/InputAppliedPropertyPart.cs rename to src/Seq.Api/Model/Shared/EventPropertyPart.cs From ea1dc87f96b7a13740309995e2eba5eaf16d8811 Mon Sep 17 00:00:00 2001 From: Nicholas Blumhardt Date: Tue, 26 Oct 2021 08:34:29 +1000 Subject: [PATCH 4/5] Release version bump [skip ci] --- src/Seq.Api/Seq.Api.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Seq.Api/Seq.Api.csproj b/src/Seq.Api/Seq.Api.csproj index 6976adc..e3b1671 100644 --- a/src/Seq.Api/Seq.Api.csproj +++ b/src/Seq.Api/Seq.Api.csproj @@ -1,7 +1,7 @@ Client library for the Seq HTTP API. - 2021.3.1 + 2021.3.2 Datalust;Contributors netstandard2.0 true From 3e59dab0ada60816981a309ce566322b6eb0a23e Mon Sep 17 00:00:00 2001 From: Nicholas Blumhardt Date: Tue, 26 Oct 2021 08:57:42 +1000 Subject: [PATCH 5/5] Revert unnecessary version bump [skip ci] --- src/Seq.Api/Seq.Api.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Seq.Api/Seq.Api.csproj b/src/Seq.Api/Seq.Api.csproj index e3b1671..6976adc 100644 --- a/src/Seq.Api/Seq.Api.csproj +++ b/src/Seq.Api/Seq.Api.csproj @@ -1,7 +1,7 @@ Client library for the Seq HTTP API. - 2021.3.2 + 2021.3.1 Datalust;Contributors netstandard2.0 true