Skip to content

Commit

Permalink
Merge pull request #44 from datalust/dev
Browse files Browse the repository at this point in the history
4.2.0 Release
  • Loading branch information
nblumhardt authored Jan 15, 2018
2 parents e6041ce + 5276b44 commit 2098dc3
Show file tree
Hide file tree
Showing 99 changed files with 406 additions and 153 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ Generated_Code/
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
/Backup*/
UpgradeLog*.XML
UpgradeLog*.htm

Expand Down
12 changes: 8 additions & 4 deletions Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,13 @@ echo "build: Version suffix is $suffix"
foreach ($src in ls src/*) {
Push-Location $src

echo "build: Packaging project in $src"
echo "build: Packaging project in $src"

& dotnet pack -c Release -o ..\..\artifacts --version-suffix=$suffix
if ($suffix) {
& dotnet pack -c Release -o ..\..\artifacts --version-suffix=$suffix
} else {
& dotnet pack -c Release -o ..\..\artifacts
}
if($LASTEXITCODE -ne 0) { exit 1 }

Pop-Location
Expand All @@ -31,7 +35,7 @@ foreach ($src in ls src/*) {
foreach ($test in ls test/*.Benchmarks) {
Push-Location $test

echo "build: Building performance test project in $test"
echo "build: Building performance test project in $test"

& dotnet build -c Release
if($LASTEXITCODE -ne 0) { exit 2 }
Expand All @@ -42,7 +46,7 @@ foreach ($test in ls test/*.Benchmarks) {
foreach ($test in ls test/*.Tests) {
Push-Location $test

echo "build: Testing project in $test"
echo "build: Testing project in $test"

& dotnet test -c Release
if($LASTEXITCODE -ne 0) { exit 3 }
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This library includes:

It's useful for querying events and working with configuration data - *everything you can do using the Seq web UI*, you can do programmatically via the API.

If you want to *write events* to Seq, use one of the logging framework clients, such as _Serilog.Sinks.Seq_ or _Seq.Client.Slab_ instead.
If you want to *write events* to Seq, use one of the logging framework clients, such as _Serilog.Sinks.Seq_ or _NLog.Targets.Seq_ instead.

### Getting started

Expand Down Expand Up @@ -136,3 +136,7 @@ var matched = await client.List<EventEntity>(
foreach (var match in matched)
Console.WriteLine(matched.RenderedMessage);
```

### Package versioning

This package does not follow the SemVer rule of major version increments for breaking changes. Instead, the package version tracks the Seq version it supports.
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ artifacts:
deploy:
- provider: NuGet
api_key:
secure: 7AS4wbHVs08D6so0JGAVczexCX9ST6CRbNToHZC08rtPqkQENpyNhhSAIX0FShzh
secure: luVm1C63eoBD+VuUPGu66KsalR39FTAbnQtRgs8HmO21D53xm/I6o0eIN7Tm0Y83
skip_symbols: true
on:
branch: /^(master|dev)$/
Expand Down
64 changes: 0 additions & 64 deletions src/Seq.Api/Api/ResourceGroups/DataResourceGroup.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class SeqApiClient : IDisposable
// Future versions of Seq may not completely support v1 features, however
// providing this as an Accept header will ensure what compatibility is available
// can be utilised.
const string SeqApiV4MediaType = "application/vnd.continuousit.seq.v4+json";
const string SeqApiV5MediaType = "application/vnd.datalust.seq.v5+json";

readonly HttpClient _httpClient;
readonly CookieContainer _cookies = new CookieContainer();
Expand Down Expand Up @@ -170,7 +170,7 @@ async Task<Stream> HttpSendAsync(HttpRequestMessage request)
if (_apiKey != null)
request.Headers.Add("X-Seq-ApiKey", _apiKey);

request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(SeqApiV4MediaType));
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(SeqApiV5MediaType));

var response = await _httpClient.SendAsync(request).ConfigureAwait(false);
var stream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false);
Expand Down Expand Up @@ -204,20 +204,20 @@ static string ResolveLink(ILinked entity, string link, IDictionary<string, objec
{
Link linkItem;
if (!entity.Links.TryGetValue(link, out linkItem))
throw new NotSupportedException("The requested link isn't available.");
throw new NotSupportedException($"The requested link `{link}` isn't available on entity `{entity}`.");

var expression = linkItem.GetUri();
var template = new UriTemplate(expression);
if (parameters != null)
{
var missing = parameters.Select(p => p.Key).Except(template.GetParameterNames()).ToArray();
if (missing.Any())
throw new ArgumentException("The URI template '" + expression + "' does not contain parameter: " + string.Join(",", missing));
throw new ArgumentException($"The URI template `{expression}` does not contain parameter: `{string.Join("`, `", missing)}`.");

foreach (var parameter in parameters)
{
var value = parameter.Value is DateTime
? ((DateTime) parameter.Value).ToString("O")
var value = parameter.Value is DateTime time
? time.ToString("O")
: parameter.Value;

template.SetParameter(parameter.Key, value);
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using System;
using System.Collections.Generic;
using Seq.Api.Model.Apps;
using Seq.Api.Model.Signals;

namespace Seq.Api.Model.AppInstances
{
Expand All @@ -8,19 +10,30 @@ public class AppInstanceEntity : Entity
public AppInstanceEntity()
{
Settings = new Dictionary<string, string>();
SignalIds = new List<string>();
InvocationOverridableSettings = new List<string>();
InvocationOverridableSettingDefinitions = new List<AppSettingPart>();
EventsPerSuppressionWindow = 1;
#pragma warning disable 618
SignalIds = new List<string>();
#pragma warning restore 618
}

public string Title { get; set; }
public bool IsManualInputOnly { get; set; }
public string AppId { get; set; }
public Dictionary<string, string> Settings { get; set; }
public List<string> InvocationOverridableSettings { get; set; }
public TimeSpan? ArrivalWindow { get; set; }
public List<string> SignalIds { get; set; }
public SignalExpressionPart InputSignalExpression { get; set; }
public bool DisallowManualInput { get; set; }
public int ChannelCapacity { get; set; }
public TimeSpan SuppressionTime { get; set; }
public int EventsPerSuppressionWindow { get; set; }
public int? ProcessedEventsPerMinute { get; set; }

[Obsolete("Replaced by InputSignalExpression.")]
public List<string> SignalIds { get; set; }

public List<AppSettingPart> InvocationOverridableSettingDefinitions { get; set; }
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ public ServerMetricsEntity()
RunningTasks = new List<RunningTaskPart>();
}

public double EventStoreDaysRecorded { get; set; }
public double EventStoreDaysCached { get; set; }
public int EventStoreEventsCached { get; set; }
public DateTime? EventStoreFirstSegmentDateUtc { get; set; }
public DateTime? EventStoreLastSegmentDateUtc { get; set; }
public DateTime? EventStoreFirstExtentRangeStartUtc { get; set; }
public DateTime? EventStoreLastExtentRangeEndUtc { get; set; }
public long EventStoreDiskRemainingBytes { get; set; }

public int EndpointArrivalsPerMinute { get; set; }
Expand Down
File renamed without changes.
7 changes: 7 additions & 0 deletions src/Seq.Api/Model/Events/DeleteResultPart.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Seq.Api.Model.Events
{
public class DeleteResultPart
{
public long DeletedEventCount { get; set; }
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ public class LicenseEntity : Entity
public bool IsSingleUser { get; set; }
public string StatusDescription { get; set; }
public bool IsWarning { get; set; }
public bool CanRenewOnlineNow { get; set; }
}
}
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
using Seq.Api.Model.LogEvents;
using System;
using System.Collections.Generic;

namespace Seq.Api.Model.Monitoring
{
public class AlertPart
{
Dictionary<string, string> _notificationAppSettingOverrides = new Dictionary<string, string>();

public string Id { get; set; }
public string Condition { get; set; }
public TimeSpan MeasurementWindow { get; set; }
public TimeSpan StabilizationWindow { get; set; } = TimeSpan.FromSeconds(30);
public TimeSpan SuppressionTime { get; set; }
public LogEventLevel Level { get; set; } = LogEventLevel.Warning;
public string NotificationAppInstanceId { get; set; }

public Dictionary<string, string> NotificationAppSettingOverrides
{
get => _notificationAppSettingOverrides;
set => _notificationAppSettingOverrides = value ?? new Dictionary<string, string>();
}
}
}
8 changes: 8 additions & 0 deletions src/Seq.Api/Model/Monitoring/ChartDisplayStylePart.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace Seq.Api.Model.Monitoring
{
public class ChartDisplayStylePart
{
public int WidthColumns { get; set; } = 6;
public int HeightRows { get; set; } = 1;
}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
using System.Collections.Generic;
using Seq.Api.Model.Signals;

namespace Seq.Api.Model.Monitoring
{
public class ChartPart
{
public string Id { get; set; }

public string Title { get; set; }

public List<string> SignalIds { get; set; } = new List<string>();

public SignalExpressionPart SignalExpression { get; set; }
public List<ChartQueryPart> Queries { get; set; } = new List<ChartQueryPart>();
public ChartDisplayStylePart DisplayStyle { get; set; } = new ChartDisplayStylePart();
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using Seq.Api.Model.Signals;

namespace Seq.Api.Model.Monitoring
{
Expand All @@ -7,9 +8,9 @@ public class ChartQueryPart
public string Id { get; set; }
public List<MeasurementPart> Measurements { get; set; } = new List<MeasurementPart>();
public string Where { get; set; }
public List<string> SignalIds { get; set; } = new List<string>();
public SignalExpressionPart SignalExpression { get; set; }
public List<string> GroupBy { get; set; } = new List<string>();
public MeasurementDisplayStylePart DisplayStyle = new MeasurementDisplayStylePart();
public MeasurementDisplayStylePart DisplayStyle { get; set; } = new MeasurementDisplayStylePart();
public List<AlertPart> Alerts { get; set; } = new List<AlertPart>();
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using Seq.Api.Model.Signals;

namespace Seq.Api.Model.Monitoring
{
Expand All @@ -8,7 +9,7 @@ public class DashboardEntity : Entity

public string Title { get; set; }

public List<string> SignalIds { get; set; } = new List<string>();
public SignalExpressionPart SignalExpression { get; set; }

public List<ChartPart> Charts { get; set; } = new List<ChartPart>();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ public enum MeasurementDisplayPalette
Default,
Reds,
Greens,
Blues
Blues,
OrangePurple
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ public enum MeasurementDisplayType
{
Line,
Bar,
Point
Point,
Value,
Pie
}
}
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
using System;
using Seq.Api.Model.Signals;

namespace Seq.Api.Model.Retention
{
public class RetentionPolicyEntity : Entity
{
public TimeSpan RetentionTime { get; set; }

public SignalExpressionPart RemovedSignalExpression { get; set; }

[Obsolete("Replaced by RemovedSignalExpression.")]
public string SignalId { get; set; }
}
}
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace Seq.Api.Model.Settings
{
public class InternalErrorReportingSettingsPart
{
public bool InternalErrorReportingEnabled { get; set; }
public string ReplyEmail { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Seq.Api.Model.Settings
{
public class SettingEntity : Seq.Api.Model.Entity
public class SettingEntity : Entity
{
public string Name { get; set; }
public object Value { get; set; }
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,9 @@ public SignalEntity()
public bool IsWatched { get; set; }

public bool IsRestricted { get; set; }

public SignalGrouping Grouping { get; set; }

public string ExplicitGroupName { get; set; }
}
}
Loading

0 comments on commit 2098dc3

Please sign in to comment.