Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions src/Seq.Api/Api/Client/SeqApiClient.cs
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 SeqApiV3MediaType = "application/vnd.continuousit.seq.v3+json";
const string SeqApiV4MediaType = "application/vnd.continuousit.seq.v4+json";

readonly HttpClient _httpClient;
readonly CookieContainer _cookies = new CookieContainer();
Expand All @@ -38,9 +38,7 @@ public class SeqApiClient : IDisposable

public SeqApiClient(string serverUrl, string apiKey = null)
{
if (serverUrl == null) throw new ArgumentNullException(nameof(serverUrl));

ServerUrl = serverUrl;
ServerUrl = serverUrl ?? throw new ArgumentNullException(nameof(serverUrl));

if (!string.IsNullOrEmpty(apiKey))
_apiKey = apiKey;
Expand Down Expand Up @@ -172,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(SeqApiV3MediaType));
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(SeqApiV4MediaType));

var response = await _httpClient.SendAsync(request).ConfigureAwait(false);
var stream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false);
Expand Down
7 changes: 6 additions & 1 deletion src/Seq.Api/Api/Model/Apps/AppEntity.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;

namespace Seq.Api.Model.Apps
{
Expand All @@ -7,16 +8,20 @@ public class AppEntity : Entity
public AppEntity()
{
Name = "New App";
#pragma warning disable CS0618 // Type or member is obsolete
AssemblyNames = new List<string>();
AvailableSettings = new List<AppSettingPart>();
#pragma warning restore CS0618 // Type or member is obsolete
}

public string Name { get; set; }

public string Description { get; set; }

[Obsolete("Packages must be installed via a feed.")]
public string MainReactorTypeName { get; set; }

[Obsolete("Packages must be installed via a feed.")]
public List<string> AssemblyNames { get; set; }

public List<AppSettingPart> AvailableSettings { get; set; }
Expand Down
1 change: 1 addition & 0 deletions src/Seq.Api/Api/Model/Apps/AppPackagePart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ public class AppPackagePart
public string Authors { get; set; }
public string IconUrl { get; set; }
public string LicenseUrl { get; set; }
public bool UpdateAvailable { get; set; }
}
}
2 changes: 1 addition & 1 deletion src/Seq.Api/Api/Model/Data/QueryExecutionStatisticsPart.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Seq.Api.Data
namespace Seq.Api.Model.Data
{
public class QueryExecutionStatisticsPart
{
Expand Down
2 changes: 1 addition & 1 deletion src/Seq.Api/Api/Model/Data/QueryResultPart.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Newtonsoft.Json;

namespace Seq.Api.Data
namespace Seq.Api.Model.Data
{
public class QueryResultPart
{
Expand Down
2 changes: 1 addition & 1 deletion src/Seq.Api/Api/Model/Data/TimeSlicePart.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Seq.Api.Data
namespace Seq.Api.Model.Data
{
public class TimeSlicePart
{
Expand Down
2 changes: 1 addition & 1 deletion src/Seq.Api/Api/Model/Data/TimeseriesPart.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Seq.Api.Data
namespace Seq.Api.Model.Data
{
public class TimeseriesPart
{
Expand Down
8 changes: 8 additions & 0 deletions src/Seq.Api/Api/Model/Diagnostics/ServerMetricsEntity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public ServerMetricsEntity()

public int EndpointArrivalsPerMinute { get; set; }
public int EndpointInfluxPerMinute { get; set; }
public long EndpointIngestedBytesPerMinute { get; set; }
public int EndpointInvalidPayloadsPerMinute { get; set; }
public int EndpointUnauthorizedPayloadsPerMinute { get; set; }

Expand All @@ -31,5 +32,12 @@ public ServerMetricsEntity()
public double SystemMemoryUtilization { get; set; }

public List<RunningTaskPart> RunningTasks { get; set; }

public int QueriesPerMinute { get; set; }
public int QueryCacheTimeSliceHitsPerMinute { get; set; }
public int QueryCacheInvalidationsPerMinute { get; set; }

public int DocumentStoreActiveSessions { get; set; }
public int DocumentStoreActiveTransactions { get; set; }
}
}
3 changes: 3 additions & 0 deletions src/Seq.Api/Api/Model/Events/MessageTemplateTokenPart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ public class MessageTemplateTokenPart
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public string PropertyName { get; set; }

[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public string RawText { get; set; }

[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public string FormattedValue { get; set; }
}
Expand Down
7 changes: 7 additions & 0 deletions src/Seq.Api/Api/Model/Expressions/SqlExpressionPart.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Seq.Api.Model.Expressions
{
public class SqlExpressionPart
{
public string Expression { get; set; }
}
}
2 changes: 2 additions & 0 deletions src/Seq.Api/Api/Model/Inputs/ApiKeyEntity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ public ApiKeyEntity()
public SignalFilterPart InputFilter { get; set; }
public bool CanActAsPrincipal { get; set; }
public LogEventLevel? MinimumLevel { get; set; }
public bool UseServerTimestamps { get; set; }
public int InfluxPerMinute { get; set; }
public int ArrivalsPerMinute { get; set; }
public ApiKeyMetricsPart Metrics { get; set; }
public bool IsDefault { get; set; }
}
}
2 changes: 1 addition & 1 deletion src/Seq.Api/Api/Model/License/LicenseEntity.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Seq.Api.Model.License
{
public class LicenseEntity : Seq.Api.Model.Entity
public class LicenseEntity : Entity
{
public string LicenseText { get; set; }
public bool IsValid { get; set; }
Expand Down
16 changes: 16 additions & 0 deletions src/Seq.Api/Api/Model/Monitoring/AlertPart.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using Seq.Api.Model.LogEvents;
using System;

namespace Seq.Api.Model.Monitoring
{
public class AlertPart
{
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; }
}
}
15 changes: 15 additions & 0 deletions src/Seq.Api/Api/Model/Monitoring/ChartPart.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System.Collections.Generic;

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 List<ChartQueryPart> Queries { get; set; } = new List<ChartQueryPart>();
}
}
15 changes: 15 additions & 0 deletions src/Seq.Api/Api/Model/Monitoring/ChartQueryPart.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System.Collections.Generic;

namespace Seq.Api.Model.Monitoring
{
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 List<string> GroupBy { get; set; } = new List<string>();
public MeasurementDisplayStylePart DisplayStyle = new MeasurementDisplayStylePart();
public List<AlertPart> Alerts { get; set; } = new List<AlertPart>();
}
}
15 changes: 15 additions & 0 deletions src/Seq.Api/Api/Model/Monitoring/DashboardEntity.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System.Collections.Generic;

namespace Seq.Api.Model.Monitoring
{
public class DashboardEntity : Entity
{
public string OwnerId { get; set; }

public string Title { get; set; }

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

public List<ChartPart> Charts { get; set; } = new List<ChartPart>();
}
}
10 changes: 10 additions & 0 deletions src/Seq.Api/Api/Model/Monitoring/MeasurementDisplayPalette.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace Seq.Api.Model.Monitoring
{
public enum MeasurementDisplayPalette
{
Default,
Reds,
Greens,
Blues
}
}
11 changes: 11 additions & 0 deletions src/Seq.Api/Api/Model/Monitoring/MeasurementDisplayStylePart.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace Seq.Api.Model.Monitoring
{
public class MeasurementDisplayStylePart
{
public MeasurementDisplayType Type { get; set; } = MeasurementDisplayType.Line;
public bool LineFillToZeroY { get; set; }
public bool LineShowMarkers { get; set; } = true;
public bool BarOverlaySum { get; set; }
public MeasurementDisplayPalette Palette { get; set; } = MeasurementDisplayPalette.Default;
}
}
9 changes: 9 additions & 0 deletions src/Seq.Api/Api/Model/Monitoring/MeasurementDisplayType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace Seq.Api.Model.Monitoring
{
public enum MeasurementDisplayType
{
Line,
Bar,
Point
}
}
8 changes: 8 additions & 0 deletions src/Seq.Api/Api/Model/Monitoring/MeasurementPart.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace Seq.Api.Model.Monitoring
{
public class MeasurementPart
{
public string Value { get; set; }
public string Label { get; set; }
}
}
16 changes: 16 additions & 0 deletions src/Seq.Api/Api/Model/Permalinks/PermalinkEntity.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System;
using Newtonsoft.Json;
using Seq.Api.Model.Events;

namespace Seq.Api.Model.Permalinks
{
public class PermalinkEntity : Entity
{
public string OwnerId { get; set; }
public string EventId { get; set; }
public DateTime CreatedUtc { get; set; }

[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public EventEntity Event { get; set; }
}
}
26 changes: 0 additions & 26 deletions src/Seq.Api/Api/Model/Pins/PinEntity.cs

This file was deleted.

1 change: 1 addition & 0 deletions src/Seq.Api/Api/Model/Users/CredentialsPart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ public class CredentialsPart
{
public string Username { get; set; }
public string Password { get; set; }
public string NewPassword { get; set; }
}
}
7 changes: 2 additions & 5 deletions src/Seq.Api/Api/Model/Users/UserEntity.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using Seq.Api.Model.Signals;

namespace Seq.Api.Model.Users
Expand All @@ -13,8 +12,6 @@ public class UserEntity : Entity
public bool IsAdministrator { get; set; }
public string NewPassword { get; set; }
public SignalFilterPart ViewFilter { get; set; }

[Obsolete("Use Links.Avatar")]
public string AvatarUrl { get; set; }
public bool MustChangePassword { get; set; }
}
}
14 changes: 0 additions & 14 deletions src/Seq.Api/Api/Model/Watches/DataPointPart.cs

This file was deleted.

14 changes: 0 additions & 14 deletions src/Seq.Api/Api/Model/Watches/DataRangePart.cs

This file was deleted.

14 changes: 0 additions & 14 deletions src/Seq.Api/Api/Model/Watches/TimeSliceDuration.cs

This file was deleted.

17 changes: 0 additions & 17 deletions src/Seq.Api/Api/Model/Watches/WatchEntity.cs

This file was deleted.

Loading