The update plugin manages OS and package updates on headless Debian-based
nodes. It exposes endpoints to list pending updates, trigger security-only
or full upgrades, view run logs, and retrieve configuration. All endpoints
are available under /api/v1/plugins/update.
The plugin is integrated into Config Manager by importing it and registering it with the core's plugin registry:
import update "github.com/msutara/cm-plugin-update"
plugin.Register(update.NewUpdatePlugin())Note: The plugin implements the
plugin.Plugininterface fromconfig-manager-coredirectly.
curl http://localhost:7788/api/v1/plugins/update/statuscurl -X POST http://localhost:7788/api/v1/plugins/update/run \
-H "Content-Type: application/json" \
-d '{"type": "security"}'curl -X POST http://localhost:7788/api/v1/plugins/update/run \
-H "Content-Type: application/json" \
-d '{"type": "full"}'Note: Only one update can run at a time. A second request while an update is in progress returns
409 Conflict.
curl http://localhost:7788/api/v1/plugins/update/logscurl http://localhost:7788/api/v1/plugins/update/config| Job ID | Default Schedule | Description |
|---|---|---|
| update.full | (none) | Run full system upgrade |
| update.security | 0 3 * * * |
Run security updates |
update.fullis always available for manual triggering via the jobs API.
update.securityis registered when the security source is available (seesecurity_sourceconfig). The cron schedule is attached only whenauto_securityis enabled.
The plugin exposes a read-only configuration view via GET /config:
{
"schedule": "0 3 * * *",
"auto_security": true,
"security_source": "detected",
"security_available": true
}| Field | Type | Description |
|---|---|---|
schedule |
string | Cron expression for automatic security updates |
auto_security |
bool | Whether automatic security updates are enabled |
security_source |
string | "detected" or "always" — controls gating |
security_available |
bool | Read-only; computed once at startup, not persisted in config |
security_available is determined once during service initialization by
probing the system's apt sources. The cached value is returned in every
/config response for informational purposes but is not a configurable
setting.
When security_source is "detected" and the system lacks a separate
security apt source, the scheduled job is omitted. When set to "always",
the job runs regardless of source availability.