Expand description
Business logic layer — orchestrates backend calls and enforces domain rules for every resource type exposed by the CLI and HTTP server.
§Position in the layering
Sits between crate::server (HTTP handlers) and
crate::backend_dispatcher (CSM / OCHAMI dispatch). Per
CLAUDE.md’s boundary rule, handlers MUST only call functions in
this module; they never reach the backend dispatcher directly. The
service layer in turn calls backend trait methods on the
InfraContext’s backend field, which routes to the active
crate::dispatcher::StaticBackendDispatcher variant.
§Conventions
- Every public async function takes a
&InfraContext<'_>and atoken: &strso authorization can run before any backend call. - All fallible paths return
[
manta_backend_dispatcher::error::Error]; the handler layer maps these to HTTP responses throughto_handler_error. - Authorization helpers in
authorizationare called from every function that takes a node, group, or session name from the caller — including read-only endpoints, so listings can’t leak resources the caller couldn’t have queried directly.
§Module map
- Cross-cutting:
authorization,infra_backend,analysis,sat_groups,node_ops,ims_ops. - Per-resource:
auth,boot_parameters,configuration,group,hardware,image,kernel_parameters,node,node_details,power,redfish,session,template. - Composite operations:
cluster,ephemeral_env,migrate,hw_cluster(the last is a subdirectory module).
Modules§
- analysis
- Cross-resource analyses that fan IMS / CFS / BSS fetches and link the results in a pure helper.
- auth
- Authentication service — proxies CLI credential exchange to the configured CSM/OCHAMI backend.
- authorization
- Authorization helpers: validate user access to HSM groups and their members.
- boot_
parameters - BSS boot parameter queries, changeset preparation, and persistence.
- cluster
- Cluster-scoped node detail queries using HSM group membership.
- configuration
- CFS configuration queries, layer-detail lookups, and cascading deletion of all dependent resources (sessions, BOS templates, IMS images).
- console
- Console-attach service wrappers.
- ephemeral_
env - Ephemeral CFS environment provisioning — launches a temporary IMS customize container booted from an existing IMS image and returns its SSH hostname.
- group
- HSM group CRUD operations and membership management.
- hardware
- Hardware inventory queries for individual nodes and clusters.
- hw_
cluster - Hardware-cluster pin/unpin and hw-component add/delete service logic.
- image
- IMS image queries and safety-checked deletion.
- ims_ops
- IMS image helpers shared by handlers that need to locate or cross-reference images by CFS configuration name (e.g. boot-config application, SAT-file rendering).
- infra_
backend - Dispatcher-meta methods on
InfraContext. - kernel_
parameters - Kernel boot parameter mutations (add, apply, delete) with SBPS iSCSI image projection.
- migrate
- Node migration between HSM groups.
- node
- HSM node queries, registration, and deletion, with rollback on partial failure.
- node_
details - Per-xname
NodeDetailsaggregation built from the backend dispatcher. - node_
ops - Node-expression resolution: parsing hostlist strings, NID-to-xname translation, HSM-group expansion, and the authorization helpers that validate the caller can act on the resolved set.
- power
- Power on/off/reset operations against PCS.
- redfish
- HSM Redfish-endpoint registry queries and CRUD.
- sat_
file - SAT-file service wrappers.
- sat_
groups - SAT-entry → HSM group-name extractors.
- session
- CFS session queries, creation, deletion, and console-readiness validation.
- template
- BOS session template queries and BOS session creation with access validation.