A Go package for orchestrating operations across OSAPI-managed hosts -- typed operations, chaining, conditions, and result decoding built on top of the osapi-sdk engine.
go install github.com/osapi-io/osapi-orchestrator@latestAs a library dependency:
go get github.com/osapi-io/osapi-orchestratorMost operations accept a target parameter to control which agents receive
the request:
| Target | Behavior |
|---|---|
_any |
Send to any available agent (load balanced) |
_all |
Broadcast to every agent |
hostname |
Send to a specific host |
key:value |
Send to agents matching a label |
- Operations -- 18 typed constructors for every OSAPI operation
- Features -- Step chaining, guards, retry, broadcast, discovery, file workflows, and result decoding
- API Reference -- Auto-generated Go documentation
Each example is a standalone Go file. Run with:
cd examples/features
OSAPI_TOKEN="<jwt>" go run basic.go
| Example | What it shows |
|---|---|
| basic.go | Simple DAG with health check and hostname query |
| parallel.go | Five parallel queries depending on health check |
| retry.go | Retry on failure with configurable attempts |
| verbose.go | Verbose output with stdout/stderr/response data |
| guards.go | When predicate for conditional execution |
| only-if-changed.go | Skip step unless dependency reported changes |
| error-recovery.go | Continue strategy with OnlyIfFailed cleanup |
| broadcast.go | Per-host results from broadcast operations |
| task-func.go | Custom steps with typed result decoding |
| agent-facts.go | List agents with OS, load, memory, and interfaces |
| discover.go | Find agents by OS and architecture predicates |
| group-by-fact.go | Group agents by distro, run per-group commands |
| when-fact.go | Fact-based guard on a step |
| fact-predicates.go | Compose multiple predicates for discovery |
| label-filter.go | Filter by labels and arbitrary fact values |
| condition-filter.go | Filter by node conditions (e.g., DiskPressure) |
| Example | What it shows |
|---|---|
| command.go | Command exec and shell with result decoding |
| dns-update.go | Read-then-write pattern with DNS operations |
| file-deploy.go | Upload, deploy, and verify a file end-to-end |
| file-changed.go | Conditional upload with FileChanged + OnlyIfChanged |
See the Development guide for prerequisites, setup, and conventions. See the Contributing guide before submitting a PR.
The MIT License.