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, IDisposable, IHostedService
Examples
echo "gc collect 2" | nc -U /path/to/endpoint.sock
Constructors
View SourceCommandLineMaintenanceInterfaceHost(UnixDomainSocketEndPoint, ILoggerFactory?)
Initializes a new host.
Declaration
public CommandLineMaintenanceInterfaceHost(UnixDomainSocketEndPoint endPoint, ILoggerFactory? loggerFactory = null)
Parameters
| Type | Name | Description |
|---|---|---|
| UnixDomainSocketEndPoint | endPoint | Unix Domain Socket address used as an interaction point. |
| ILoggerFactory | loggerFactory | Optional logger factory. |
Properties
View SourceAuthentication
Gets or sets authentication handler.
Declaration
public IAuthenticationHandler? Authentication { get; init; }
Property Value
| Type | Description |
|---|---|
| IAuthenticationHandler |
Authorization
Gets or sets authorization handler.
Declaration
public AuthorizationCallback? Authorization { get; init; }
Property Value
| Type | Description |
|---|---|
| AuthorizationCallback |
ParserSettings
Gets or sets parser settings.
Declaration
public ParserConfiguration ParserSettings { get; init; }
Property Value
| Type | Description |
|---|---|
| ParserConfiguration |
Methods
View SourceAddCommands(params IEnumerable<ApplicationMaintenanceCommand>)
Registers maintenance commands.
Declaration
public void AddCommands(params IEnumerable<ApplicationMaintenanceCommand> commands)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<ApplicationMaintenanceCommand> | commands | A set of commands to register. |
ExecuteCommandAsync(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. |