CShells.Management.Api 0.0.28

dotnet add package CShells.Management.Api --version 0.0.28
                    
NuGet\Install-Package CShells.Management.Api -Version 0.0.28
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CShells.Management.Api" Version="0.0.28" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CShells.Management.Api" Version="0.0.28" />
                    
Directory.Packages.props
<PackageReference Include="CShells.Management.Api" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CShells.Management.Api --version 0.0.28
                    
#r "nuget: CShells.Management.Api, 0.0.28"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package CShells.Management.Api@0.0.28
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CShells.Management.Api&version=0.0.28
                    
Install as a Cake Addin
#tool nuget:?package=CShells.Management.Api&version=0.0.28
                    
Install as a Cake Tool

CShells.Management.Api

Optional REST management API for CShells. Maps a small set of root-level Minimal API endpoints onto an existing IEndpointRouteBuilder so you can reload shells, observe drain progress, and force-terminate stuck drains from outside the running process.

Purpose

Manual testing and demonstration of shell-reload and drain-lifecycle mechanics over HTTP. Hosts install the endpoints with one line and apply their own authorization, CORS, rate limiting, etc. by chaining the standard ASP.NET Core endpoint conventions on the returned RouteGroupBuilder.

Manual-testing tool. This package is intended as a developer/operator aid. It applies no authorization of its own — see "Authorization" below.

Installation

dotnet add package CShells.Management.Api

The package depends only on CShells.Abstractions plus the Microsoft.AspNetCore.App framework reference. It does not pull in CShells.AspNetCore or any third-party endpoint stack.

Usage

var app = builder.Build();
app.MapShells();
app.MapShellManagementApi("/_admin/shells");
app.Run();

The argument is the route prefix (defaults to /_admin/shells). MapShellManagementApi returns a RouteGroupBuilder so you can chain any standard ASP.NET Core endpoint convention.

Endpoints

Under the configured prefix:

Verb Route Purpose
GET / Paginated list of all shells (catalogue + active-gen state).
GET /{name} Focused view: blueprint + every live generation + per-gen drain.
GET /{name}/blueprint Registered blueprint (incl. ConfigurationData) without activating.
POST /reload/{name} Reload a single shell; returns new generation + drain snapshot.
POST /reload-all Reload every active shell; per-shell outcomes returned as an array. Optional ?maxDegreeOfParallelism=N.
POST /{name}/force-drain Force every in-flight drain on the shell to terminate; returns array of DrainResult.

All non-2xx responses use RFC 7807 problem-details bodies.

Authorization

The endpoints expose direct control over the registry — reloading shells, forcing drains, and returning the registered ConfigurationData of every shell verbatim (which may contain secrets your shell configuration includes, like connection strings or API keys). You must gate them with your host's authorization scheme before exposing them on any non-localhost interface.

MapShellManagementApi returns a RouteGroupBuilder — chain RequireAuthorization, RequireCors, RequireRateLimiting, or any endpoint convention on the result:

app.MapShellManagementApi("/_admin/shells")
   .RequireAuthorization("AdminOnly")
   .WithTags("CShells Management")
   .AddEndpointFilter(new AuditEndpointFilter());

The package itself applies no authorization, authentication, or rate-limit policy — by design, so it composes with whatever auth scheme your host already runs. The trade-off is that an unprotected install is a foot-gun outside dev environments.

What's intentionally missing

  • Endpoints for unregistering or mutating blueprints over HTTP.
  • WebSocket-based lifecycle event streaming.
  • Framework-generated OpenAPI documents — chain .WithOpenApi() on the install method's return value if you want OpenAPI generation.

Hosts that need any of those build them on top of IShellRegistry directly.

License

MIT — see LICENSE.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.0.28 612 6/12/2026
0.0.27 126 6/12/2026
0.0.26 119 6/12/2026