From e4e3f276049220ba75d3953b4cb8124812d83367 Mon Sep 17 00:00:00 2001 From: Nicholas Blumhardt Date: Wed, 22 Apr 2020 13:18:00 +1000 Subject: [PATCH 1/2] Update with the lastest Seq preview features --- example/SignalCopy/Program.cs | 2 +- src/Seq.Api/Client/SeqApiClient.cs | 2 +- src/Seq.Api/Client/SeqApiException.cs | 2 +- .../Model/AppInstances/AppInstanceEntity.cs | 2 +- .../AppInstances/AppInstanceMetricsPart.cs | 2 +- src/Seq.Api/Model/Apps/AppEntity.cs | 2 +- src/Seq.Api/Model/Apps/AppPackagePart.cs | 2 +- src/Seq.Api/Model/Apps/AppSettingPart.cs | 2 +- src/Seq.Api/Model/Backups/BackupEntity.cs | 2 +- .../Data/QueryExecutionStatisticsPart.cs | 6 +- src/Seq.Api/Model/Data/QueryResultPart.cs | 2 +- src/Seq.Api/Model/Data/TimeSlicePart.cs | 2 +- src/Seq.Api/Model/Data/TimeseriesPart.cs | 2 +- .../Model/Diagnostics/RunningTaskPart.cs | 2 +- .../Model/Diagnostics/ServerMetricsEntity.cs | 2 +- .../Model/Diagnostics/ServerStatusPart.cs | 2 +- .../Model/Diagnostics/StatusMessagePart.cs | 2 +- src/Seq.Api/Model/Entity.cs | 2 +- src/Seq.Api/Model/Events/DeleteResultPart.cs | 2 +- src/Seq.Api/Model/Events/EventEntity.cs | 2 +- .../Model/Events/EventInputResultPart.cs | 2 +- src/Seq.Api/Model/Events/EventPropertyPart.cs | 2 +- .../Model/Events/MessageTemplateTokenPart.cs | 2 +- src/Seq.Api/Model/Events/ResultSetPart.cs | 2 +- .../Model/Expressions/ExpressionPart.cs | 2 +- .../Model/Expressions/SqlExpressionPart.cs | 2 +- src/Seq.Api/Model/Feeds/NuGetFeedEntity.cs | 2 +- src/Seq.Api/Model/ILinked.cs | 2 +- src/Seq.Api/Model/Inputs/ApiKeyEntity.cs | 2 +- src/Seq.Api/Model/Inputs/ApiKeyMetricsPart.cs | 2 +- .../Model/Inputs/InputAppliedPropertyPart.cs | 2 +- src/Seq.Api/Model/License/LicenseEntity.cs | 2 +- src/Seq.Api/Model/Link.cs | 2 +- src/Seq.Api/Model/LinkCollection.cs | 2 +- src/Seq.Api/Model/LogEvents/LogEventLevel.cs | 2 +- src/Seq.Api/Model/Monitoring/AlertPart.cs | 2 +- .../Model/Monitoring/AlertStateEntity.cs | 79 +++++++++++++++++++ .../Model/Monitoring/ChartDisplayStylePart.cs | 2 +- src/Seq.Api/Model/Monitoring/ChartPart.cs | 2 +- .../Model/Monitoring/ChartQueryPart.cs | 2 +- .../Model/Monitoring/DashboardEntity.cs | 2 +- .../Monitoring/MeasurementDisplayPalette.cs | 2 +- .../Monitoring/MeasurementDisplayStylePart.cs | 2 +- .../Monitoring/MeasurementDisplayType.cs | 2 +- .../Model/Monitoring/MeasurementPart.cs | 2 +- .../Model/Permalinks/PermalinkEntity.cs | 2 +- src/Seq.Api/Model/ResourceGroup.cs | 2 +- .../Model/Retention/RetentionPolicyEntity.cs | 2 +- src/Seq.Api/Model/Root/RootEntity.cs | 2 +- src/Seq.Api/Model/Security/Permission.cs | 2 +- src/Seq.Api/Model/Security/RoleEntity.cs | 2 +- src/Seq.Api/Model/Security/WellKnownRole.cs | 2 +- .../InternalErrorReportingSettingsPart.cs | 2 +- src/Seq.Api/Model/Settings/SettingEntity.cs | 2 +- src/Seq.Api/Model/Settings/SettingName.cs | 7 +- .../Model/Shared/DeferredRequestEntity.cs | 2 +- src/Seq.Api/Model/Shared/ErrorPart.cs | 2 +- src/Seq.Api/Model/Shared/ResultSetStatus.cs | 2 +- src/Seq.Api/Model/Shared/StatisticsPart.cs | 4 +- ...gedPropertyPart.cs => SignalColumnPart.cs} | 10 +-- src/Seq.Api/Model/Signals/SignalEntity.cs | 8 +- .../Model/Signals/SignalExpressionKind.cs | 2 +- .../Model/Signals/SignalExpressionPart.cs | 2 +- src/Seq.Api/Model/Signals/SignalFilterPart.cs | 2 +- src/Seq.Api/Model/Signals/SignalGrouping.cs | 2 +- .../Model/SqlQueries/SqlQueryEntity.cs | 2 +- .../Model/Updates/AvailableUpdateEntity.cs | 2 +- .../Model/Users/AuthProviderInfoPart.cs | 2 +- src/Seq.Api/Model/Users/AuthProvidersPart.cs | 2 +- src/Seq.Api/Model/Users/CredentialsPart.cs | 2 +- .../Model/Users/SearchHistoryEntity.cs | 2 +- .../Model/Users/SearchHistoryItemPart.cs | 2 +- .../Model/Users/SearchHistoryItemStatus.cs | 2 +- src/Seq.Api/Model/Users/UserEntity.cs | 2 +- .../Model/Workspaces/WorkspaceContentPart.cs | 2 +- .../Model/Workspaces/WorkspaceEntity.cs | 2 +- .../ResourceGroups/AlertStateResourceGroup.cs | 65 +++++++++++++++ .../ResourceGroups/ApiKeysResourceGroup.cs | 2 +- .../ResourceGroups/ApiResourceGroup.cs | 2 +- .../AppInstancesResourceGroup.cs | 2 +- .../ResourceGroups/AppsResourceGroup.cs | 4 +- .../ResourceGroups/BackupsResourceGroup.cs | 2 +- .../ResourceGroups/DashboardsResourceGroup.cs | 2 +- .../ResourceGroups/DataResourceGroup.cs | 2 +- .../DiagnosticsResourceGroup.cs | 2 +- .../ResourceGroups/EventsResourceGroup.cs | 2 +- .../ExpressionsResourceGroup.cs | 2 +- .../ResourceGroups/FeedsResourceGroup.cs | 4 +- src/Seq.Api/ResourceGroups/ISeqConnection.cs | 2 +- .../ResourceGroups/LicensesResourceGroup.cs | 2 +- .../ResourceGroups/PermalinksResourceGroup.cs | 2 +- .../RetentionPoliciesResourceGroup.cs | 2 +- .../ResourceGroups/RolesResourceGroup.cs | 2 +- .../ResourceGroups/SettingsResourceGroup.cs | 12 +-- .../ResourceGroups/SignalsResourceGroup.cs | 2 +- .../ResourceGroups/SqlQueriesResourceGroup.cs | 2 +- .../ResourceGroups/UpdatesResourceGroup.cs | 2 +- .../ResourceGroups/UsersResourceGroup.cs | 4 +- .../ResourceGroups/WorkspacesResourceGroup.cs | 2 +- src/Seq.Api/Seq.Api.csproj | 10 +-- src/Seq.Api/SeqConnection.cs | 10 ++- .../Serialization/LinkCollectionConverter.cs | 2 +- .../Streams/ObservableStream.Unsubscriber.cs | 2 +- src/Seq.Api/Streams/ObservableStream.cs | 22 +++--- 104 files changed, 292 insertions(+), 133 deletions(-) create mode 100644 src/Seq.Api/Model/Monitoring/AlertStateEntity.cs rename src/Seq.Api/Model/Signals/{TaggedPropertyPart.cs => SignalColumnPart.cs} (74%) create mode 100644 src/Seq.Api/ResourceGroups/AlertStateResourceGroup.cs diff --git a/example/SignalCopy/Program.cs b/example/SignalCopy/Program.cs index 539afe6..89b57cd 100644 --- a/example/SignalCopy/Program.cs +++ b/example/SignalCopy/Program.cs @@ -94,7 +94,7 @@ static async Task Run(string src, string srcKey, string dst, string dstKey) target.Title = signal.Title; target.Filters = signal.Filters; - target.TaggedProperties = signal.TaggedProperties; + target.Columns = signal.Columns; target.Description = signal.Description + " (copy)"; await (target.Id != null ? dstConnection.Signals.UpdateAsync(target) : dstConnection.Signals.AddAsync(target)); diff --git a/src/Seq.Api/Client/SeqApiClient.cs b/src/Seq.Api/Client/SeqApiClient.cs index 13445df..2108ac1 100644 --- a/src/Seq.Api/Client/SeqApiClient.cs +++ b/src/Seq.Api/Client/SeqApiClient.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Client/SeqApiException.cs b/src/Seq.Api/Client/SeqApiException.cs index fc53da9..853a1b3 100644 --- a/src/Seq.Api/Client/SeqApiException.cs +++ b/src/Seq.Api/Client/SeqApiException.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/AppInstances/AppInstanceEntity.cs b/src/Seq.Api/Model/AppInstances/AppInstanceEntity.cs index ea7558f..2f76a56 100644 --- a/src/Seq.Api/Model/AppInstances/AppInstanceEntity.cs +++ b/src/Seq.Api/Model/AppInstances/AppInstanceEntity.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/AppInstances/AppInstanceMetricsPart.cs b/src/Seq.Api/Model/AppInstances/AppInstanceMetricsPart.cs index a164809..bcf348c 100644 --- a/src/Seq.Api/Model/AppInstances/AppInstanceMetricsPart.cs +++ b/src/Seq.Api/Model/AppInstances/AppInstanceMetricsPart.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Apps/AppEntity.cs b/src/Seq.Api/Model/Apps/AppEntity.cs index f7a260e..a2ee358 100644 --- a/src/Seq.Api/Model/Apps/AppEntity.cs +++ b/src/Seq.Api/Model/Apps/AppEntity.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Apps/AppPackagePart.cs b/src/Seq.Api/Model/Apps/AppPackagePart.cs index 42b28fe..6064781 100644 --- a/src/Seq.Api/Model/Apps/AppPackagePart.cs +++ b/src/Seq.Api/Model/Apps/AppPackagePart.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Apps/AppSettingPart.cs b/src/Seq.Api/Model/Apps/AppSettingPart.cs index ddc21bc..d04f83e 100644 --- a/src/Seq.Api/Model/Apps/AppSettingPart.cs +++ b/src/Seq.Api/Model/Apps/AppSettingPart.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Backups/BackupEntity.cs b/src/Seq.Api/Model/Backups/BackupEntity.cs index 3823b2c..9130f30 100644 --- a/src/Seq.Api/Model/Backups/BackupEntity.cs +++ b/src/Seq.Api/Model/Backups/BackupEntity.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Data/QueryExecutionStatisticsPart.cs b/src/Seq.Api/Model/Data/QueryExecutionStatisticsPart.cs index 5a7e8c7..ac3f6d7 100644 --- a/src/Seq.Api/Model/Data/QueryExecutionStatisticsPart.cs +++ b/src/Seq.Api/Model/Data/QueryExecutionStatisticsPart.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -23,12 +23,12 @@ public class QueryExecutionStatisticsPart /// The number of events inspected in the course of computing the query result. This will /// not include events that could be skipped based on index information or text pre-filtering. /// - public long ScannedEventCount { get; set; } + public ulong ScannedEventCount { get; set; } /// /// The number of events that contributed to the query result. /// - public long MatchingEventCount { get; set; } + public ulong MatchingEventCount { get; set; } /// /// Whether the query needed to search disk-backed storage. diff --git a/src/Seq.Api/Model/Data/QueryResultPart.cs b/src/Seq.Api/Model/Data/QueryResultPart.cs index 81bb654..dcbefd6 100644 --- a/src/Seq.Api/Model/Data/QueryResultPart.cs +++ b/src/Seq.Api/Model/Data/QueryResultPart.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Data/TimeSlicePart.cs b/src/Seq.Api/Model/Data/TimeSlicePart.cs index 32f7b93..7b50ff8 100644 --- a/src/Seq.Api/Model/Data/TimeSlicePart.cs +++ b/src/Seq.Api/Model/Data/TimeSlicePart.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Data/TimeseriesPart.cs b/src/Seq.Api/Model/Data/TimeseriesPart.cs index 058dad5..0713919 100644 --- a/src/Seq.Api/Model/Data/TimeseriesPart.cs +++ b/src/Seq.Api/Model/Data/TimeseriesPart.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Diagnostics/RunningTaskPart.cs b/src/Seq.Api/Model/Diagnostics/RunningTaskPart.cs index 5274276..fc6c2fd 100644 --- a/src/Seq.Api/Model/Diagnostics/RunningTaskPart.cs +++ b/src/Seq.Api/Model/Diagnostics/RunningTaskPart.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Diagnostics/ServerMetricsEntity.cs b/src/Seq.Api/Model/Diagnostics/ServerMetricsEntity.cs index 2865050..63051ea 100644 --- a/src/Seq.Api/Model/Diagnostics/ServerMetricsEntity.cs +++ b/src/Seq.Api/Model/Diagnostics/ServerMetricsEntity.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Diagnostics/ServerStatusPart.cs b/src/Seq.Api/Model/Diagnostics/ServerStatusPart.cs index 00c3054..e9fc286 100644 --- a/src/Seq.Api/Model/Diagnostics/ServerStatusPart.cs +++ b/src/Seq.Api/Model/Diagnostics/ServerStatusPart.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Diagnostics/StatusMessagePart.cs b/src/Seq.Api/Model/Diagnostics/StatusMessagePart.cs index 196ee8e..e35e0f3 100644 --- a/src/Seq.Api/Model/Diagnostics/StatusMessagePart.cs +++ b/src/Seq.Api/Model/Diagnostics/StatusMessagePart.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Entity.cs b/src/Seq.Api/Model/Entity.cs index 9b3e02e..23e0825 100644 --- a/src/Seq.Api/Model/Entity.cs +++ b/src/Seq.Api/Model/Entity.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Events/DeleteResultPart.cs b/src/Seq.Api/Model/Events/DeleteResultPart.cs index 4c7943d..0c54518 100644 --- a/src/Seq.Api/Model/Events/DeleteResultPart.cs +++ b/src/Seq.Api/Model/Events/DeleteResultPart.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Events/EventEntity.cs b/src/Seq.Api/Model/Events/EventEntity.cs index 5995066..48181d6 100644 --- a/src/Seq.Api/Model/Events/EventEntity.cs +++ b/src/Seq.Api/Model/Events/EventEntity.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Events/EventInputResultPart.cs b/src/Seq.Api/Model/Events/EventInputResultPart.cs index 07ec1f6..c0ca947 100644 --- a/src/Seq.Api/Model/Events/EventInputResultPart.cs +++ b/src/Seq.Api/Model/Events/EventInputResultPart.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Events/EventPropertyPart.cs b/src/Seq.Api/Model/Events/EventPropertyPart.cs index 006ce1e..1c54054 100644 --- a/src/Seq.Api/Model/Events/EventPropertyPart.cs +++ b/src/Seq.Api/Model/Events/EventPropertyPart.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Events/MessageTemplateTokenPart.cs b/src/Seq.Api/Model/Events/MessageTemplateTokenPart.cs index a691e52..707c0a1 100644 --- a/src/Seq.Api/Model/Events/MessageTemplateTokenPart.cs +++ b/src/Seq.Api/Model/Events/MessageTemplateTokenPart.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Events/ResultSetPart.cs b/src/Seq.Api/Model/Events/ResultSetPart.cs index c900a15..6a05567 100644 --- a/src/Seq.Api/Model/Events/ResultSetPart.cs +++ b/src/Seq.Api/Model/Events/ResultSetPart.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Expressions/ExpressionPart.cs b/src/Seq.Api/Model/Expressions/ExpressionPart.cs index 5362840..82a492b 100644 --- a/src/Seq.Api/Model/Expressions/ExpressionPart.cs +++ b/src/Seq.Api/Model/Expressions/ExpressionPart.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Expressions/SqlExpressionPart.cs b/src/Seq.Api/Model/Expressions/SqlExpressionPart.cs index e7650e6..efd26c7 100644 --- a/src/Seq.Api/Model/Expressions/SqlExpressionPart.cs +++ b/src/Seq.Api/Model/Expressions/SqlExpressionPart.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Feeds/NuGetFeedEntity.cs b/src/Seq.Api/Model/Feeds/NuGetFeedEntity.cs index bb318f0..03184d3 100644 --- a/src/Seq.Api/Model/Feeds/NuGetFeedEntity.cs +++ b/src/Seq.Api/Model/Feeds/NuGetFeedEntity.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/ILinked.cs b/src/Seq.Api/Model/ILinked.cs index ae30187..6c3dbe6 100644 --- a/src/Seq.Api/Model/ILinked.cs +++ b/src/Seq.Api/Model/ILinked.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Inputs/ApiKeyEntity.cs b/src/Seq.Api/Model/Inputs/ApiKeyEntity.cs index 9cc7300..f755713 100644 --- a/src/Seq.Api/Model/Inputs/ApiKeyEntity.cs +++ b/src/Seq.Api/Model/Inputs/ApiKeyEntity.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Inputs/ApiKeyMetricsPart.cs b/src/Seq.Api/Model/Inputs/ApiKeyMetricsPart.cs index d68ec35..7e431ad 100644 --- a/src/Seq.Api/Model/Inputs/ApiKeyMetricsPart.cs +++ b/src/Seq.Api/Model/Inputs/ApiKeyMetricsPart.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Inputs/InputAppliedPropertyPart.cs b/src/Seq.Api/Model/Inputs/InputAppliedPropertyPart.cs index 3a6fb3d..6f4d3d4 100644 --- a/src/Seq.Api/Model/Inputs/InputAppliedPropertyPart.cs +++ b/src/Seq.Api/Model/Inputs/InputAppliedPropertyPart.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/License/LicenseEntity.cs b/src/Seq.Api/Model/License/LicenseEntity.cs index f03d3ca..ea7aa61 100644 --- a/src/Seq.Api/Model/License/LicenseEntity.cs +++ b/src/Seq.Api/Model/License/LicenseEntity.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Link.cs b/src/Seq.Api/Model/Link.cs index 0513d68..6d48fc8 100644 --- a/src/Seq.Api/Model/Link.cs +++ b/src/Seq.Api/Model/Link.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/LinkCollection.cs b/src/Seq.Api/Model/LinkCollection.cs index 27fc505..b122b97 100644 --- a/src/Seq.Api/Model/LinkCollection.cs +++ b/src/Seq.Api/Model/LinkCollection.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/LogEvents/LogEventLevel.cs b/src/Seq.Api/Model/LogEvents/LogEventLevel.cs index dde7281..35160e7 100644 --- a/src/Seq.Api/Model/LogEvents/LogEventLevel.cs +++ b/src/Seq.Api/Model/LogEvents/LogEventLevel.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Monitoring/AlertPart.cs b/src/Seq.Api/Model/Monitoring/AlertPart.cs index d9b10a7..678311d 100644 --- a/src/Seq.Api/Model/Monitoring/AlertPart.cs +++ b/src/Seq.Api/Model/Monitoring/AlertPart.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Monitoring/AlertStateEntity.cs b/src/Seq.Api/Model/Monitoring/AlertStateEntity.cs new file mode 100644 index 0000000..27ba7f6 --- /dev/null +++ b/src/Seq.Api/Model/Monitoring/AlertStateEntity.cs @@ -0,0 +1,79 @@ +// Copyright Datalust and contributors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; + +namespace Seq.Api.Model.Monitoring +{ + /// + /// Describes the state of an active alert. + /// + public class AlertStateEntity : Entity + { + /// + /// The unique id of the alert being described. + /// + public string AlertId { get; set; } + + /// + /// The alert's title. + /// + public string Title { get; set; } + + /// + /// The title of the chart to which the alert is attached. + /// + public string ChartTitle { get; set; } + + /// + /// The title of the dashboards in which the alert is set. + /// + public string DashboardTitle { get; set; } + + /// + /// The user id of the user who owns the alert; if null, the alert is shared. + /// + public string OwnerId { get; set; } + + /// + /// The notification level associated with the alert. + /// + public string Level { get; set; } + + /// + /// The id of an app instance that will receive notifications when the alert is triggered. + /// + public string NotificationAppInstanceId { get; set; } + + /// + /// The time at which the alert was last checked. Not preserved across server restarts. + /// + public DateTime? LastCheck { get; set; } + + /// + /// The time at which the alert last triggered a notification. Not preserved across server restarts. + /// + public DateTime? LastNotification { get; set; } + + /// + /// The time until which no further notifications will be sent by the alert. + /// + public DateTime? SuppressedUntil { get; set; } + + /// + /// true if the alert is in the failing state; otherwise, false. + /// + public bool IsFailing { get; set; } + } +} diff --git a/src/Seq.Api/Model/Monitoring/ChartDisplayStylePart.cs b/src/Seq.Api/Model/Monitoring/ChartDisplayStylePart.cs index 32af9b0..7f6dbf4 100644 --- a/src/Seq.Api/Model/Monitoring/ChartDisplayStylePart.cs +++ b/src/Seq.Api/Model/Monitoring/ChartDisplayStylePart.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Monitoring/ChartPart.cs b/src/Seq.Api/Model/Monitoring/ChartPart.cs index 196a11c..6e8c092 100644 --- a/src/Seq.Api/Model/Monitoring/ChartPart.cs +++ b/src/Seq.Api/Model/Monitoring/ChartPart.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Monitoring/ChartQueryPart.cs b/src/Seq.Api/Model/Monitoring/ChartQueryPart.cs index d2562bb..069bf86 100644 --- a/src/Seq.Api/Model/Monitoring/ChartQueryPart.cs +++ b/src/Seq.Api/Model/Monitoring/ChartQueryPart.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Monitoring/DashboardEntity.cs b/src/Seq.Api/Model/Monitoring/DashboardEntity.cs index ba6f91a..9a49d10 100644 --- a/src/Seq.Api/Model/Monitoring/DashboardEntity.cs +++ b/src/Seq.Api/Model/Monitoring/DashboardEntity.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Monitoring/MeasurementDisplayPalette.cs b/src/Seq.Api/Model/Monitoring/MeasurementDisplayPalette.cs index 8b16577..401c3f8 100644 --- a/src/Seq.Api/Model/Monitoring/MeasurementDisplayPalette.cs +++ b/src/Seq.Api/Model/Monitoring/MeasurementDisplayPalette.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Monitoring/MeasurementDisplayStylePart.cs b/src/Seq.Api/Model/Monitoring/MeasurementDisplayStylePart.cs index 9f22f40..9cfd9c6 100644 --- a/src/Seq.Api/Model/Monitoring/MeasurementDisplayStylePart.cs +++ b/src/Seq.Api/Model/Monitoring/MeasurementDisplayStylePart.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Monitoring/MeasurementDisplayType.cs b/src/Seq.Api/Model/Monitoring/MeasurementDisplayType.cs index c1f28cc..61e6b57 100644 --- a/src/Seq.Api/Model/Monitoring/MeasurementDisplayType.cs +++ b/src/Seq.Api/Model/Monitoring/MeasurementDisplayType.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Monitoring/MeasurementPart.cs b/src/Seq.Api/Model/Monitoring/MeasurementPart.cs index b43f863..97edb6a 100644 --- a/src/Seq.Api/Model/Monitoring/MeasurementPart.cs +++ b/src/Seq.Api/Model/Monitoring/MeasurementPart.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Permalinks/PermalinkEntity.cs b/src/Seq.Api/Model/Permalinks/PermalinkEntity.cs index 539e0fe..d2fc667 100644 --- a/src/Seq.Api/Model/Permalinks/PermalinkEntity.cs +++ b/src/Seq.Api/Model/Permalinks/PermalinkEntity.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/ResourceGroup.cs b/src/Seq.Api/Model/ResourceGroup.cs index 3837ca8..0d4ba32 100644 --- a/src/Seq.Api/Model/ResourceGroup.cs +++ b/src/Seq.Api/Model/ResourceGroup.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Retention/RetentionPolicyEntity.cs b/src/Seq.Api/Model/Retention/RetentionPolicyEntity.cs index 451460b..ef8a587 100644 --- a/src/Seq.Api/Model/Retention/RetentionPolicyEntity.cs +++ b/src/Seq.Api/Model/Retention/RetentionPolicyEntity.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Root/RootEntity.cs b/src/Seq.Api/Model/Root/RootEntity.cs index f529f3b..ebaacf7 100644 --- a/src/Seq.Api/Model/Root/RootEntity.cs +++ b/src/Seq.Api/Model/Root/RootEntity.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Security/Permission.cs b/src/Seq.Api/Model/Security/Permission.cs index 0ef450c..8c8b015 100644 --- a/src/Seq.Api/Model/Security/Permission.cs +++ b/src/Seq.Api/Model/Security/Permission.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Security/RoleEntity.cs b/src/Seq.Api/Model/Security/RoleEntity.cs index c44748c..57ad0e8 100644 --- a/src/Seq.Api/Model/Security/RoleEntity.cs +++ b/src/Seq.Api/Model/Security/RoleEntity.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Security/WellKnownRole.cs b/src/Seq.Api/Model/Security/WellKnownRole.cs index 4a05e5c..b4631ef 100644 --- a/src/Seq.Api/Model/Security/WellKnownRole.cs +++ b/src/Seq.Api/Model/Security/WellKnownRole.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Settings/InternalErrorReportingSettingsPart.cs b/src/Seq.Api/Model/Settings/InternalErrorReportingSettingsPart.cs index cee8bd9..8f6a00d 100644 --- a/src/Seq.Api/Model/Settings/InternalErrorReportingSettingsPart.cs +++ b/src/Seq.Api/Model/Settings/InternalErrorReportingSettingsPart.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Settings/SettingEntity.cs b/src/Seq.Api/Model/Settings/SettingEntity.cs index 9b35481..11e4153 100644 --- a/src/Seq.Api/Model/Settings/SettingEntity.cs +++ b/src/Seq.Api/Model/Settings/SettingEntity.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Settings/SettingName.cs b/src/Seq.Api/Model/Settings/SettingName.cs index 955684f..5740a87 100644 --- a/src/Seq.Api/Model/Settings/SettingName.cs +++ b/src/Seq.Api/Model/Settings/SettingName.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -110,6 +110,11 @@ public enum SettingName /// MinimumFreeStorageSpace, + /// + /// A comma-separated list of role ids that will be assigned to new users by default. + /// + NewUserRoleIds, + /// /// A comma-separated list of (shared) signal ids that will be included in any new user's /// personal default workspace. diff --git a/src/Seq.Api/Model/Shared/DeferredRequestEntity.cs b/src/Seq.Api/Model/Shared/DeferredRequestEntity.cs index 517b19a..486e851 100644 --- a/src/Seq.Api/Model/Shared/DeferredRequestEntity.cs +++ b/src/Seq.Api/Model/Shared/DeferredRequestEntity.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Shared/ErrorPart.cs b/src/Seq.Api/Model/Shared/ErrorPart.cs index fca82e2..d3dcdc9 100644 --- a/src/Seq.Api/Model/Shared/ErrorPart.cs +++ b/src/Seq.Api/Model/Shared/ErrorPart.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Shared/ResultSetStatus.cs b/src/Seq.Api/Model/Shared/ResultSetStatus.cs index dcd375d..23fbb04 100644 --- a/src/Seq.Api/Model/Shared/ResultSetStatus.cs +++ b/src/Seq.Api/Model/Shared/ResultSetStatus.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Shared/StatisticsPart.cs b/src/Seq.Api/Model/Shared/StatisticsPart.cs index c66140d..a560132 100644 --- a/src/Seq.Api/Model/Shared/StatisticsPart.cs +++ b/src/Seq.Api/Model/Shared/StatisticsPart.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -30,7 +30,7 @@ public class StatisticsPart /// The number of events that were scanned in the search (and were not /// able to be excluded based on index information or pre-filtering). /// - public long ScannedEventCount { get; set; } + public ulong ScannedEventCount { get; set; } /// /// The id of the last event inspected in the search. diff --git a/src/Seq.Api/Model/Signals/TaggedPropertyPart.cs b/src/Seq.Api/Model/Signals/SignalColumnPart.cs similarity index 74% rename from src/Seq.Api/Model/Signals/TaggedPropertyPart.cs rename to src/Seq.Api/Model/Signals/SignalColumnPart.cs index 2e54080..f716900 100644 --- a/src/Seq.Api/Model/Signals/TaggedPropertyPart.cs +++ b/src/Seq.Api/Model/Signals/SignalColumnPart.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -15,14 +15,14 @@ namespace Seq.Api.Model.Signals { /// - /// A property that will be displayed as a column when a signal + /// An expression that will be displayed as a column when a signal /// including it is selected. /// - public class TaggedPropertyPart + public class SignalColumnPart { /// - /// The property name. + /// The expression to show as a column. /// - public string PropertyName { get; set; } + public string Expression { get; set; } } } diff --git a/src/Seq.Api/Model/Signals/SignalEntity.cs b/src/Seq.Api/Model/Signals/SignalEntity.cs index c45d02d..0c266d0 100644 --- a/src/Seq.Api/Model/Signals/SignalEntity.cs +++ b/src/Seq.Api/Model/Signals/SignalEntity.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -31,7 +31,7 @@ public SignalEntity() { Title = "New Signal"; Filters = new List(); - TaggedProperties = new List(); + Columns = new List(); } /// @@ -50,9 +50,9 @@ public SignalEntity() public List Filters { get; set; } /// - /// Properties that show as columns when the signal is selected in the events screen. + /// Expressions that show as columns when the signal is selected in the events screen. /// - public List TaggedProperties { get; set; } + public List Columns { get; set; } /// /// Obsolete. diff --git a/src/Seq.Api/Model/Signals/SignalExpressionKind.cs b/src/Seq.Api/Model/Signals/SignalExpressionKind.cs index 323bf65..ee1540e 100644 --- a/src/Seq.Api/Model/Signals/SignalExpressionKind.cs +++ b/src/Seq.Api/Model/Signals/SignalExpressionKind.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Signals/SignalExpressionPart.cs b/src/Seq.Api/Model/Signals/SignalExpressionPart.cs index 054c08b..7f31382 100644 --- a/src/Seq.Api/Model/Signals/SignalExpressionPart.cs +++ b/src/Seq.Api/Model/Signals/SignalExpressionPart.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Signals/SignalFilterPart.cs b/src/Seq.Api/Model/Signals/SignalFilterPart.cs index 78675e9..7f77324 100644 --- a/src/Seq.Api/Model/Signals/SignalFilterPart.cs +++ b/src/Seq.Api/Model/Signals/SignalFilterPart.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Signals/SignalGrouping.cs b/src/Seq.Api/Model/Signals/SignalGrouping.cs index e4e9c8c..db31b85 100644 --- a/src/Seq.Api/Model/Signals/SignalGrouping.cs +++ b/src/Seq.Api/Model/Signals/SignalGrouping.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/SqlQueries/SqlQueryEntity.cs b/src/Seq.Api/Model/SqlQueries/SqlQueryEntity.cs index 826928b..528c865 100644 --- a/src/Seq.Api/Model/SqlQueries/SqlQueryEntity.cs +++ b/src/Seq.Api/Model/SqlQueries/SqlQueryEntity.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Updates/AvailableUpdateEntity.cs b/src/Seq.Api/Model/Updates/AvailableUpdateEntity.cs index 938fe46..a87fd8e 100644 --- a/src/Seq.Api/Model/Updates/AvailableUpdateEntity.cs +++ b/src/Seq.Api/Model/Updates/AvailableUpdateEntity.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Users/AuthProviderInfoPart.cs b/src/Seq.Api/Model/Users/AuthProviderInfoPart.cs index deeece0..1e17049 100644 --- a/src/Seq.Api/Model/Users/AuthProviderInfoPart.cs +++ b/src/Seq.Api/Model/Users/AuthProviderInfoPart.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Users/AuthProvidersPart.cs b/src/Seq.Api/Model/Users/AuthProvidersPart.cs index effaca0..4bedb21 100644 --- a/src/Seq.Api/Model/Users/AuthProvidersPart.cs +++ b/src/Seq.Api/Model/Users/AuthProvidersPart.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Users/CredentialsPart.cs b/src/Seq.Api/Model/Users/CredentialsPart.cs index 46d95c5..252394e 100644 --- a/src/Seq.Api/Model/Users/CredentialsPart.cs +++ b/src/Seq.Api/Model/Users/CredentialsPart.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Users/SearchHistoryEntity.cs b/src/Seq.Api/Model/Users/SearchHistoryEntity.cs index 19c5638..9d2c901 100644 --- a/src/Seq.Api/Model/Users/SearchHistoryEntity.cs +++ b/src/Seq.Api/Model/Users/SearchHistoryEntity.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Users/SearchHistoryItemPart.cs b/src/Seq.Api/Model/Users/SearchHistoryItemPart.cs index 91777fa..1014a7a 100644 --- a/src/Seq.Api/Model/Users/SearchHistoryItemPart.cs +++ b/src/Seq.Api/Model/Users/SearchHistoryItemPart.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Users/SearchHistoryItemStatus.cs b/src/Seq.Api/Model/Users/SearchHistoryItemStatus.cs index 57c76a5..7944494 100644 --- a/src/Seq.Api/Model/Users/SearchHistoryItemStatus.cs +++ b/src/Seq.Api/Model/Users/SearchHistoryItemStatus.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Users/UserEntity.cs b/src/Seq.Api/Model/Users/UserEntity.cs index d3e97d3..d206fab 100644 --- a/src/Seq.Api/Model/Users/UserEntity.cs +++ b/src/Seq.Api/Model/Users/UserEntity.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Workspaces/WorkspaceContentPart.cs b/src/Seq.Api/Model/Workspaces/WorkspaceContentPart.cs index 82b19af..9b5d666 100644 --- a/src/Seq.Api/Model/Workspaces/WorkspaceContentPart.cs +++ b/src/Seq.Api/Model/Workspaces/WorkspaceContentPart.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Model/Workspaces/WorkspaceEntity.cs b/src/Seq.Api/Model/Workspaces/WorkspaceEntity.cs index 9c3a448..f7b434c 100644 --- a/src/Seq.Api/Model/Workspaces/WorkspaceEntity.cs +++ b/src/Seq.Api/Model/Workspaces/WorkspaceEntity.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/ResourceGroups/AlertStateResourceGroup.cs b/src/Seq.Api/ResourceGroups/AlertStateResourceGroup.cs new file mode 100644 index 0000000..2ad1fb9 --- /dev/null +++ b/src/Seq.Api/ResourceGroups/AlertStateResourceGroup.cs @@ -0,0 +1,65 @@ +// Copyright Datalust and contributors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Seq.Api.Model.Monitoring; + +namespace Seq.Api.ResourceGroups +{ + /// + /// Inspect the current states of alerts being monitored by the server.. + /// + public class AlertStateResourceGroup : ApiResourceGroup + { + internal AlertStateResourceGroup(ISeqConnection connection) + : base("AlertState", connection) + { + } + + /// + /// Retrieve the alert state with the given id; throws if the entity does not exist. + /// + /// The id of the alert state. + /// A allowing the operation to be canceled. + /// The alert state. + public async Task FindAsync(string id, CancellationToken cancellationToken = default) + { + if (id == null) throw new ArgumentNullException(nameof(id)); + return await GroupGetAsync("Item", new Dictionary { { "id", id } }, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieve the states of all alerts being monitored by the server. + /// + /// allowing the operation to be canceled. + /// A list containing all current alert states. + public async Task> ListAsync(CancellationToken cancellationToken = default) + { + return await GroupListAsync("Items", null, cancellationToken).ConfigureAwait(false); + } + + /// + /// Remove an alert state; this will remove the corresponding alert. + /// + /// The alert state to remove + /// allowing the operation to be canceled. + public async Task RemoveAsync(AlertStateEntity entity, CancellationToken cancellationToken = default) + { + await Client.DeleteAsync(entity, "Self", entity, cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} diff --git a/src/Seq.Api/ResourceGroups/ApiKeysResourceGroup.cs b/src/Seq.Api/ResourceGroups/ApiKeysResourceGroup.cs index 8f4533e..7de4f5c 100644 --- a/src/Seq.Api/ResourceGroups/ApiKeysResourceGroup.cs +++ b/src/Seq.Api/ResourceGroups/ApiKeysResourceGroup.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/ResourceGroups/ApiResourceGroup.cs b/src/Seq.Api/ResourceGroups/ApiResourceGroup.cs index a31667e..a515dd6 100644 --- a/src/Seq.Api/ResourceGroups/ApiResourceGroup.cs +++ b/src/Seq.Api/ResourceGroups/ApiResourceGroup.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/ResourceGroups/AppInstancesResourceGroup.cs b/src/Seq.Api/ResourceGroups/AppInstancesResourceGroup.cs index d7c55e8..208ddcd 100644 --- a/src/Seq.Api/ResourceGroups/AppInstancesResourceGroup.cs +++ b/src/Seq.Api/ResourceGroups/AppInstancesResourceGroup.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/ResourceGroups/AppsResourceGroup.cs b/src/Seq.Api/ResourceGroups/AppsResourceGroup.cs index 66a6bb0..9b9d76d 100644 --- a/src/Seq.Api/ResourceGroups/AppsResourceGroup.cs +++ b/src/Seq.Api/ResourceGroups/AppsResourceGroup.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -71,7 +71,7 @@ public async Task TemplateAsync(CancellationToken cancellationToken = /// The app, with server-allocated properties such as initialized. public async Task AddAsync(AppEntity entity, CancellationToken cancellationToken = default) { - return await Client.PostAsync(entity, "Create", entity, cancellationToken: cancellationToken).ConfigureAwait(false); + return await GroupCreateAsync(entity, cancellationToken: cancellationToken).ConfigureAwait(false); } /// diff --git a/src/Seq.Api/ResourceGroups/BackupsResourceGroup.cs b/src/Seq.Api/ResourceGroups/BackupsResourceGroup.cs index 885bc4f..8277985 100644 --- a/src/Seq.Api/ResourceGroups/BackupsResourceGroup.cs +++ b/src/Seq.Api/ResourceGroups/BackupsResourceGroup.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/ResourceGroups/DashboardsResourceGroup.cs b/src/Seq.Api/ResourceGroups/DashboardsResourceGroup.cs index b5f7b06..4a673cf 100644 --- a/src/Seq.Api/ResourceGroups/DashboardsResourceGroup.cs +++ b/src/Seq.Api/ResourceGroups/DashboardsResourceGroup.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/ResourceGroups/DataResourceGroup.cs b/src/Seq.Api/ResourceGroups/DataResourceGroup.cs index 3ab76f2..33b2690 100644 --- a/src/Seq.Api/ResourceGroups/DataResourceGroup.cs +++ b/src/Seq.Api/ResourceGroups/DataResourceGroup.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/ResourceGroups/DiagnosticsResourceGroup.cs b/src/Seq.Api/ResourceGroups/DiagnosticsResourceGroup.cs index 6fc7643..9eddec4 100644 --- a/src/Seq.Api/ResourceGroups/DiagnosticsResourceGroup.cs +++ b/src/Seq.Api/ResourceGroups/DiagnosticsResourceGroup.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/ResourceGroups/EventsResourceGroup.cs b/src/Seq.Api/ResourceGroups/EventsResourceGroup.cs index ad50d98..01b4259 100644 --- a/src/Seq.Api/ResourceGroups/EventsResourceGroup.cs +++ b/src/Seq.Api/ResourceGroups/EventsResourceGroup.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/ResourceGroups/ExpressionsResourceGroup.cs b/src/Seq.Api/ResourceGroups/ExpressionsResourceGroup.cs index 0c7631c..50043c0 100644 --- a/src/Seq.Api/ResourceGroups/ExpressionsResourceGroup.cs +++ b/src/Seq.Api/ResourceGroups/ExpressionsResourceGroup.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/ResourceGroups/FeedsResourceGroup.cs b/src/Seq.Api/ResourceGroups/FeedsResourceGroup.cs index 937bd57..121ce97 100644 --- a/src/Seq.Api/ResourceGroups/FeedsResourceGroup.cs +++ b/src/Seq.Api/ResourceGroups/FeedsResourceGroup.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -71,7 +71,7 @@ public async Task TemplateAsync(CancellationToken cancellationT /// The feed, with server-allocated properties such as initialized. public async Task AddAsync(NuGetFeedEntity entity, CancellationToken cancellationToken = default) { - return await Client.PostAsync(entity, "Create", entity, cancellationToken: cancellationToken).ConfigureAwait(false); + return await GroupCreateAsync(entity, cancellationToken: cancellationToken).ConfigureAwait(false); } /// diff --git a/src/Seq.Api/ResourceGroups/ISeqConnection.cs b/src/Seq.Api/ResourceGroups/ISeqConnection.cs index 990c01e..ae29134 100644 --- a/src/Seq.Api/ResourceGroups/ISeqConnection.cs +++ b/src/Seq.Api/ResourceGroups/ISeqConnection.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/ResourceGroups/LicensesResourceGroup.cs b/src/Seq.Api/ResourceGroups/LicensesResourceGroup.cs index 7d96750..9bb8e17 100644 --- a/src/Seq.Api/ResourceGroups/LicensesResourceGroup.cs +++ b/src/Seq.Api/ResourceGroups/LicensesResourceGroup.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/ResourceGroups/PermalinksResourceGroup.cs b/src/Seq.Api/ResourceGroups/PermalinksResourceGroup.cs index 6c46965..166821d 100644 --- a/src/Seq.Api/ResourceGroups/PermalinksResourceGroup.cs +++ b/src/Seq.Api/ResourceGroups/PermalinksResourceGroup.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/ResourceGroups/RetentionPoliciesResourceGroup.cs b/src/Seq.Api/ResourceGroups/RetentionPoliciesResourceGroup.cs index 759f40a..9c3d712 100644 --- a/src/Seq.Api/ResourceGroups/RetentionPoliciesResourceGroup.cs +++ b/src/Seq.Api/ResourceGroups/RetentionPoliciesResourceGroup.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/ResourceGroups/RolesResourceGroup.cs b/src/Seq.Api/ResourceGroups/RolesResourceGroup.cs index 4e3aee3..bdc61ca 100644 --- a/src/Seq.Api/ResourceGroups/RolesResourceGroup.cs +++ b/src/Seq.Api/ResourceGroups/RolesResourceGroup.cs @@ -1,4 +1,4 @@ -// Copyright 2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/ResourceGroups/SettingsResourceGroup.cs b/src/Seq.Api/ResourceGroups/SettingsResourceGroup.cs index be9925a..8146b97 100644 --- a/src/Seq.Api/ResourceGroups/SettingsResourceGroup.cs +++ b/src/Seq.Api/ResourceGroups/SettingsResourceGroup.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -67,20 +67,22 @@ public async Task UpdateAsync(SettingEntity entity, CancellationToken cancellati /// /// Get internal error reporting settings. /// + /// A allowing the operation to be canceled. /// Internal error reporting settings. - public async Task GetInternalErrorReportingAsync() + public async Task GetInternalErrorReportingAsync(CancellationToken cancellationToken = default) { - return await GroupGetAsync("InternalErrorReporting").ConfigureAwait(false); + return await GroupGetAsync("InternalErrorReporting", cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// Update internal error reporting settings. /// /// New internal error reporting settings. + /// A allowing the operation to be canceled. /// A task indicating completion. - public async Task UpdateInternalErrorReportingAsync(InternalErrorReportingSettingsPart internalErrorReporting) + public async Task UpdateInternalErrorReportingAsync(InternalErrorReportingSettingsPart internalErrorReporting, CancellationToken cancellationToken = default) { - await GroupPutAsync("InternalErrorReporting", internalErrorReporting).ConfigureAwait(false); + await GroupPutAsync("InternalErrorReporting", internalErrorReporting, cancellationToken: cancellationToken).ConfigureAwait(false); } } } diff --git a/src/Seq.Api/ResourceGroups/SignalsResourceGroup.cs b/src/Seq.Api/ResourceGroups/SignalsResourceGroup.cs index 4fa3dff..c1fb65c 100644 --- a/src/Seq.Api/ResourceGroups/SignalsResourceGroup.cs +++ b/src/Seq.Api/ResourceGroups/SignalsResourceGroup.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/ResourceGroups/SqlQueriesResourceGroup.cs b/src/Seq.Api/ResourceGroups/SqlQueriesResourceGroup.cs index 968ed51..7ce7cde 100644 --- a/src/Seq.Api/ResourceGroups/SqlQueriesResourceGroup.cs +++ b/src/Seq.Api/ResourceGroups/SqlQueriesResourceGroup.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/ResourceGroups/UpdatesResourceGroup.cs b/src/Seq.Api/ResourceGroups/UpdatesResourceGroup.cs index 0016bf8..d5146b2 100644 --- a/src/Seq.Api/ResourceGroups/UpdatesResourceGroup.cs +++ b/src/Seq.Api/ResourceGroups/UpdatesResourceGroup.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/ResourceGroups/UsersResourceGroup.cs b/src/Seq.Api/ResourceGroups/UsersResourceGroup.cs index d9a8a9b..c99dae0 100644 --- a/src/Seq.Api/ResourceGroups/UsersResourceGroup.cs +++ b/src/Seq.Api/ResourceGroups/UsersResourceGroup.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -83,7 +83,7 @@ public async Task TemplateAsync(CancellationToken cancellationToken /// The user, with server-allocated properties such as initialized. public async Task AddAsync(UserEntity entity, CancellationToken cancellationToken = default) { - return await Client.PostAsync(entity, "Create", entity, cancellationToken: cancellationToken).ConfigureAwait(false); + return await GroupCreateAsync(entity, cancellationToken: cancellationToken).ConfigureAwait(false); } /// diff --git a/src/Seq.Api/ResourceGroups/WorkspacesResourceGroup.cs b/src/Seq.Api/ResourceGroups/WorkspacesResourceGroup.cs index 2231ef9..89b4ce0 100644 --- a/src/Seq.Api/ResourceGroups/WorkspacesResourceGroup.cs +++ b/src/Seq.Api/ResourceGroups/WorkspacesResourceGroup.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Seq.Api.csproj b/src/Seq.Api/Seq.Api.csproj index d5fd432..0138235 100644 --- a/src/Seq.Api/Seq.Api.csproj +++ b/src/Seq.Api/Seq.Api.csproj @@ -1,20 +1,20 @@ Client library for the Seq HTTP API. - 5.1.3 + 2020.1.0 Datalust;Contributors - netstandard2.0 + netstandard2.0 true true seq - Copyright © 2014-2019 Datalust Pty Ltd and Contributors + Copyright © Datalust Pty Ltd and Contributors https://datalust.co/images/seq-nuget.png https://github.com/datalust/seq-api Apache-2.0 - 7.3 + 8 - + diff --git a/src/Seq.Api/SeqConnection.cs b/src/Seq.Api/SeqConnection.cs index d7e7ba8..f1f96ba 100644 --- a/src/Seq.Api/SeqConnection.cs +++ b/src/Seq.Api/SeqConnection.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -75,6 +75,12 @@ public void Dispose() /// public SeqApiClient Client { get; } + /// + /// List and administratively remove active alerts. To create/edit/remove alerts in normal + /// circumstances, use . + /// + public AlertStateResourceGroup AlertState => new AlertStateResourceGroup(this); + /// /// Perform operations on API keys. /// @@ -181,7 +187,7 @@ public void Dispose() /// /// The maximum amount of time to retry until giving up. /// A task that will complete if the API could be reached, or fault otherwise. - public async Task EnsureConnected(TimeSpan timeout) + public async Task EnsureConnectedAsync(TimeSpan timeout) { var started = DateTime.UtcNow; // Fractional milliseconds are lost here, but that's fine. diff --git a/src/Seq.Api/Serialization/LinkCollectionConverter.cs b/src/Seq.Api/Serialization/LinkCollectionConverter.cs index c560bed..6c518d5 100644 --- a/src/Seq.Api/Serialization/LinkCollectionConverter.cs +++ b/src/Seq.Api/Serialization/LinkCollectionConverter.cs @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Datalust and contributors. +// Copyright © Datalust and contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Seq.Api/Streams/ObservableStream.Unsubscriber.cs b/src/Seq.Api/Streams/ObservableStream.Unsubscriber.cs index f7f510b..ffded68 100644 --- a/src/Seq.Api/Streams/ObservableStream.Unsubscriber.cs +++ b/src/Seq.Api/Streams/ObservableStream.Unsubscriber.cs @@ -1,4 +1,4 @@ -// Copyright 2016 Datalust; based on code from +// Copyright © Datalust; based on code from // Serilog.Sinks.Observable, Copyright 2013-2016 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/Seq.Api/Streams/ObservableStream.cs b/src/Seq.Api/Streams/ObservableStream.cs index 2af4853..00a735e 100644 --- a/src/Seq.Api/Streams/ObservableStream.cs +++ b/src/Seq.Api/Streams/ObservableStream.cs @@ -1,4 +1,4 @@ -// Copyright 2016 Datalust; based on code from +// Copyright © Datalust; based on code from // Serilog.Sinks.Observable, Copyright 2013-2016 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -52,7 +52,7 @@ public IDisposable Subscribe(IObserver observer) lock (_syncRoot) { if (_disposed) - throw new ObjectDisposedException(message: "The observable stream is disposed.", innerException: null); + throw new ObjectDisposedException("The observable stream is disposed."); if (_ended) { @@ -76,7 +76,7 @@ void Unsubscribe(IObserver observer) lock (_syncRoot) { if (_disposed) - throw new ObjectDisposedException(message: "The observable stream is disposed.", innerException: null); + throw new ObjectDisposedException("The observable stream is disposed."); _observers = _observers.Except(new[] { observer }).ToList(); } @@ -93,7 +93,11 @@ async Task Receive() var received = await _socket.ReceiveAsync(new ArraySegment(buffer), CancellationToken.None); if (received.MessageType == WebSocketMessageType.Close) { - await _socket.CloseAsync(WebSocketCloseStatus.NormalClosure, "", CancellationToken.None); + // Managed web sockets are self-closing + if (_socket.State != WebSocketState.Closed) + { + await _socket.CloseAsync(WebSocketCloseStatus.NormalClosure, "", CancellationToken.None); + } } else { @@ -198,12 +202,10 @@ public void Dispose() { if (_socket.State == WebSocketState.Open) { - using (var timeout = new CancellationTokenSource()) - { - timeout.CancelAfter(30000); - _socket.CloseAsync(WebSocketCloseStatus.NormalClosure, "Close requested", timeout.Token) - .ConfigureAwait(false).GetAwaiter().GetResult(); - } + using var timeout = new CancellationTokenSource(); + timeout.CancelAfter(30000); + _socket.CloseAsync(WebSocketCloseStatus.NormalClosure, "Close requested", timeout.Token) + .ConfigureAwait(false).GetAwaiter().GetResult(); } } catch From afc7b422562aa1d22cc14e2704e9ee77f844b63e Mon Sep 17 00:00:00 2001 From: Nicholas Blumhardt Date: Wed, 22 Apr 2020 13:24:31 +1000 Subject: [PATCH 2/2] Use GroupCreateAsync to add app instances --- src/Seq.Api/ResourceGroups/AppInstancesResourceGroup.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Seq.Api/ResourceGroups/AppInstancesResourceGroup.cs b/src/Seq.Api/ResourceGroups/AppInstancesResourceGroup.cs index 208ddcd..1a16f39 100644 --- a/src/Seq.Api/ResourceGroups/AppInstancesResourceGroup.cs +++ b/src/Seq.Api/ResourceGroups/AppInstancesResourceGroup.cs @@ -78,7 +78,7 @@ public async Task TemplateAsync(string appId, CancellationTok public async Task AddAsync(AppInstanceEntity entity, bool runOnExisting = false, CancellationToken cancellationToken = default) { if (entity == null) throw new ArgumentNullException(nameof(entity)); - return await Client.PostAsync(entity, "Create", entity, new Dictionary { { "runOnExisting", runOnExisting } }, cancellationToken) + return await GroupCreateAsync(entity, new Dictionary { { "runOnExisting", runOnExisting } }, cancellationToken) .ConfigureAwait(false); }