Class CommandLineMaintenanceInterfaceHost
Provides AMI in the form of the text commands with the syntax identical to OS shell commands.
Inheritance
CommandLineMaintenanceInterfaceHost
Inherited Members
Namespace: DotNext.Maintenance.CommandLine
Assembly: DotNext.MaintenanceServices.dll
Syntax
public sealed class CommandLineMaintenanceInterfaceHost : ApplicationMaintenanceInterfaceHost, IHostedService, IDisposable
Examples
echo "gc collect 2" | nc -U /path/to/endpoint.sock
Constructors
| Edit this page View SourceCommandLineMaintenanceInterfaceHost(UnixDomainSocketEndPoint, IEnumerable<ApplicationMaintenanceCommand>, IAuthenticationHandler?, AuthorizationCallback?, ParserConfiguration?, ILoggerFactory?)
Initializes a new host.
Declaration
public CommandLineMaintenanceInterfaceHost(UnixDomainSocketEndPoint endPoint, IEnumerable<ApplicationMaintenanceCommand> commands, IAuthenticationHandler? authentication = null, AuthorizationCallback? authorization = null, ParserConfiguration? configuration = null, ILoggerFactory? loggerFactory = null)
Parameters
| Type | Name | Description |
|---|---|---|
| UnixDomainSocketEndPoint | endPoint | Unix Domain Socket address used as a interaction point. |
| IEnumerable<ApplicationMaintenanceCommand> | commands | A set of commands to be available for execution. |
| IAuthenticationHandler | authentication | Optional authentication handler. |
| AuthorizationCallback | authorization | A set of global authorization rules to be applied to all commands. |
| ParserConfiguration | configuration | Command-line parser configuration. |
| ILoggerFactory | loggerFactory | Optional logger factory. |
Methods
| Edit this page View SourceExecuteCommandAsync(IMaintenanceSession, ReadOnlyMemory<char>, CancellationToken)
Executes command asynchronously.
Declaration
protected override ValueTask ExecuteCommandAsync(IMaintenanceSession session, ReadOnlyMemory<char> command, CancellationToken token)
Parameters
| Type | Name | Description |
|---|---|---|
| IMaintenanceSession | session | Command session. |
| ReadOnlyMemory<char> | command | The command to execute. |
| CancellationToken | token | The token that is associated with the host lifetime. |
Returns
| Type | Description |
|---|---|
| ValueTask | A task representing asynchronous execution of the command. |