feat: define management message contracts in Commons (10 command groups)
This commit is contained in:
@@ -0,0 +1,6 @@
|
|||||||
|
namespace ScadaLink.Commons.Messages.Management;
|
||||||
|
|
||||||
|
public record QueryAuditLogCommand(
|
||||||
|
string? User = null, string? EntityType = null, string? Action = null,
|
||||||
|
DateTimeOffset? From = null, DateTimeOffset? To = null,
|
||||||
|
int Page = 1, int PageSize = 50);
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
namespace ScadaLink.Commons.Messages.Management;
|
||||||
|
|
||||||
|
public record ListDataConnectionsCommand;
|
||||||
|
public record GetDataConnectionCommand(int DataConnectionId);
|
||||||
|
public record CreateDataConnectionCommand(string Name, string Protocol, string? Configuration);
|
||||||
|
public record UpdateDataConnectionCommand(int DataConnectionId, string Name, string Protocol, string? Configuration);
|
||||||
|
public record DeleteDataConnectionCommand(int DataConnectionId);
|
||||||
|
public record AssignDataConnectionToSiteCommand(int DataConnectionId, int SiteId);
|
||||||
|
public record UnassignDataConnectionFromSiteCommand(int AssignmentId);
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
namespace ScadaLink.Commons.Messages.Management;
|
||||||
|
|
||||||
|
public record MgmtDeployArtifactsCommand(int? SiteId = null);
|
||||||
|
public record QueryDeploymentsCommand(int? InstanceId = null, string? Status = null, int Page = 1, int PageSize = 50);
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
namespace ScadaLink.Commons.Messages.Management;
|
||||||
|
|
||||||
|
public record ListExternalSystemsCommand;
|
||||||
|
public record GetExternalSystemCommand(int ExternalSystemId);
|
||||||
|
public record CreateExternalSystemCommand(string Name, string EndpointUrl, string AuthType, string? AuthConfiguration);
|
||||||
|
public record UpdateExternalSystemCommand(int ExternalSystemId, string Name, string EndpointUrl, string AuthType, string? AuthConfiguration);
|
||||||
|
public record DeleteExternalSystemCommand(int ExternalSystemId);
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
namespace ScadaLink.Commons.Messages.Management;
|
||||||
|
|
||||||
|
public record GetHealthSummaryCommand;
|
||||||
|
public record GetSiteHealthCommand(string SiteIdentifier);
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
namespace ScadaLink.Commons.Messages.Management;
|
||||||
|
|
||||||
|
public record ListInstancesCommand(int? SiteId = null, int? TemplateId = null, string? SearchTerm = null);
|
||||||
|
public record GetInstanceCommand(int InstanceId);
|
||||||
|
public record CreateInstanceCommand(string UniqueName, int TemplateId, int SiteId, int? AreaId = null);
|
||||||
|
public record MgmtDeployInstanceCommand(int InstanceId);
|
||||||
|
public record MgmtEnableInstanceCommand(int InstanceId);
|
||||||
|
public record MgmtDisableInstanceCommand(int InstanceId);
|
||||||
|
public record MgmtDeleteInstanceCommand(int InstanceId);
|
||||||
|
public record SetConnectionBindingsCommand(int InstanceId, IReadOnlyList<(string AttributeName, int DataConnectionId)> Bindings);
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
namespace ScadaLink.Commons.Messages.Management;
|
||||||
|
|
||||||
|
public record AuthenticatedUser(
|
||||||
|
string Username, string DisplayName,
|
||||||
|
IReadOnlyList<string> Roles, IReadOnlyList<string> PermittedSiteIds);
|
||||||
|
|
||||||
|
public record ManagementEnvelope(AuthenticatedUser User, object Command, string CorrelationId);
|
||||||
|
|
||||||
|
public record ManagementSuccess(string CorrelationId, object? Data);
|
||||||
|
public record ManagementError(string CorrelationId, string Error, string ErrorCode);
|
||||||
|
public record ManagementUnauthorized(string CorrelationId, string Message);
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
namespace ScadaLink.Commons.Messages.Management;
|
||||||
|
|
||||||
|
public record ListNotificationListsCommand;
|
||||||
|
public record GetNotificationListCommand(int NotificationListId);
|
||||||
|
public record CreateNotificationListCommand(string Name, IReadOnlyList<string> RecipientEmails);
|
||||||
|
public record UpdateNotificationListCommand(int NotificationListId, string Name, IReadOnlyList<string> RecipientEmails);
|
||||||
|
public record DeleteNotificationListCommand(int NotificationListId);
|
||||||
|
public record ListSmtpConfigsCommand;
|
||||||
|
public record UpdateSmtpConfigCommand(int SmtpConfigId, string Server, int Port, string AuthMode, string FromAddress);
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
namespace ScadaLink.Commons.Messages.Management;
|
||||||
|
|
||||||
|
public record ListApiKeysCommand;
|
||||||
|
public record CreateApiKeyCommand(string Name);
|
||||||
|
public record DeleteApiKeyCommand(int ApiKeyId);
|
||||||
|
public record ListRoleMappingsCommand;
|
||||||
|
public record CreateRoleMappingCommand(string LdapGroupName, string Role);
|
||||||
|
public record UpdateRoleMappingCommand(int MappingId, string LdapGroupName, string Role);
|
||||||
|
public record DeleteRoleMappingCommand(int MappingId);
|
||||||
10
src/ScadaLink.Commons/Messages/Management/SiteCommands.cs
Normal file
10
src/ScadaLink.Commons/Messages/Management/SiteCommands.cs
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
namespace ScadaLink.Commons.Messages.Management;
|
||||||
|
|
||||||
|
public record ListSitesCommand;
|
||||||
|
public record GetSiteCommand(int SiteId);
|
||||||
|
public record CreateSiteCommand(string Name, string SiteIdentifier, string? Description);
|
||||||
|
public record UpdateSiteCommand(int SiteId, string Name, string? Description);
|
||||||
|
public record DeleteSiteCommand(int SiteId);
|
||||||
|
public record ListAreasCommand(int SiteId);
|
||||||
|
public record CreateAreaCommand(int SiteId, string Name, int? ParentAreaId);
|
||||||
|
public record DeleteAreaCommand(int AreaId);
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
namespace ScadaLink.Commons.Messages.Management;
|
||||||
|
|
||||||
|
public record ListTemplatesCommand;
|
||||||
|
public record GetTemplateCommand(int TemplateId);
|
||||||
|
public record CreateTemplateCommand(string Name, string? Description, int? ParentTemplateId);
|
||||||
|
public record UpdateTemplateCommand(int TemplateId, string Name, string? Description, int? ParentTemplateId);
|
||||||
|
public record DeleteTemplateCommand(int TemplateId);
|
||||||
|
public record ValidateTemplateCommand(int TemplateId);
|
||||||
Reference in New Issue
Block a user