Skip to content
SHC Docs

Stack module

Layer 6. Services. Services

The stack package is the stack axis. The running unit is the deployment.

Source: modules/stack/.

CLINone
Subcommands0
HTTP endpointssee the route reference
Events emittedsee the event reference
Error codessee the error code reference
Service classesService
Cross-module depsapp, node
modules/stack/
├── errors.go
├── events.go
├── router.go
├── service.go
├── models.go
└── commands/

Routes are listed in the generated route reference; request/response notes live in the API reference.

Event codes, durability class, and payload shapes are listed in the generated event reference.

Typed errors are catalogued in the error code reference with HTTP statuses and message templates.

The stack package is the stack axis. The running unit is the deployment. The module starts, stops, restarts, and execs that deployment. It owns the four lifecycle verbs that do not change the on-disk definition:

  • start brings services up through the node runtime and emits A200100STKSTR on success, V500100STRFAL on failure.
  • stop: graceful shutdown, emits A200101STKSTP / V500101STPFAL.
  • restart: stop then start, emits A200102STKRST / V500102RSTFAL.
  • exec: run a command inside a running service container, emits A200103STKEXC / V500103EXCFAL.

All four are surfaced through Service in service.go and exposed on both the CLI (shc start|stop|restart|exec) and the HTTP API (/api/method/shc.stack.*).

What the stack module does not own: deciding what a deployment contains, or rendering it (that is app; the leader renders once), running backups or restore (that is backup), or running scheduled tasks (that is job). This module is a controller over a deployment’s runtime operations.

The service resolves the deployment’s owning node before execution. Local operations use the runtime executor; remote ones go through the internal API’s /internal/stacks/... routes. Operator start and stop requests also write the scheduler’s desired state (running or stopped).