Show / Hide Table of Contents

Class CommandLineMaintenanceInterfaceHost

Provides AMI in the form of the text commands with the syntax identical to OS shell commands.

Inheritance
object
BackgroundService
ApplicationMaintenanceInterfaceHost
CommandLineMaintenanceInterfaceHost
Implements
IHostedService
IDisposable
Inherited Members
ApplicationMaintenanceInterfaceHost.Backlog
ApplicationMaintenanceInterfaceHost.BufferSize
ApplicationMaintenanceInterfaceHost.ByteBufferAllocator
ApplicationMaintenanceInterfaceHost.CharBufferAllocator
ApplicationMaintenanceInterfaceHost.TextEncoding
BackgroundService.StartAsync(CancellationToken)
BackgroundService.StopAsync(CancellationToken)
BackgroundService.Dispose()
BackgroundService.ExecuteTask
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.ReferenceEquals(object, object)
object.ToString()
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 Source

CommandLineMaintenanceInterfaceHost(UnixDomainSocketEndPoint, IEnumerable<ApplicationMaintenanceCommand>, IAuthenticationHandler?, AuthorizationCallback?, ILoggerFactory?)

Initializes a new host.

Declaration
public CommandLineMaintenanceInterfaceHost(UnixDomainSocketEndPoint endPoint, IEnumerable<ApplicationMaintenanceCommand> commands, IAuthenticationHandler? authentication = null, AuthorizationCallback? authorization = 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.

ILoggerFactory loggerFactory

Optional logger factory.

Methods

| Edit this page View Source

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.

Overrides
ApplicationMaintenanceInterfaceHost.ExecuteCommandAsync(IMaintenanceSession, ReadOnlyMemory<char>, CancellationToken)

Implements

IHostedService
IDisposable

Extension Methods

BasicExtensions.As<T>(T)
BasicExtensions.GetUserData<T>(T)
BasicExtensions.IsBetween<T, TLowerBound, TUpperBound>(T, TLowerBound, TUpperBound)
BasicExtensions.IsOneOf<T>(T, ReadOnlySpan<T>)
ExpressionBuilder.Const<T>(T)
AsyncLockAcquisition.AcquireLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireLockAsync<T>(T, TimeSpan, CancellationToken)
AsyncLockAcquisition.AcquireReadLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireReadLockAsync<T>(T, TimeSpan, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, bool, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, bool, TimeSpan, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, TimeSpan, CancellationToken)
LockAcquisition.AcquireReadLock<T>(T)
LockAcquisition.AcquireReadLock<T>(T, TimeSpan)
LockAcquisition.AcquireUpgradeableReadLock<T>(T)
LockAcquisition.AcquireUpgradeableReadLock<T>(T, TimeSpan)
LockAcquisition.AcquireWriteLock<T>(T)
LockAcquisition.AcquireWriteLock<T>(T, TimeSpan)
  • Edit this page
  • View Source
☀
☾
In this article
Back to top
Supported by the .NET Foundation
☀
☾