Skip to content

Commit c29b364

Browse files
committed
Add JSON schema and guidance on API usage to docs
- Add a hidden command to generate JSON schema - Wire it up to the new `make update-generated` - Describe how to use it in the docs Signed-off-by: Colin Walters <[email protected]>
1 parent d91c00a commit c29b364

File tree

7 files changed

+420
-5
lines changed

7 files changed

+420
-5
lines changed

docs/src/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
- [`man bootc-rollback`](man/bootc-rollback.md)
2828
- [`man bootc-usr-overlay`](man/bootc-usr-overlay.md)
2929
- [`man bootc-fetch-apply-updates.service`](man-md/bootc-fetch-apply-updates-service.md)
30+
- [Controlling bootc via API](bootc-via-api.md)
3031

3132
# Using `bootc install`
3233

docs/src/bootc-via-api.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Using bootc via API
2+
3+
At the current time, bootc is primarily intended to be
4+
driven via a fork/exec model. The core CLI verbs
5+
are stable and will not change.
6+
7+
## Using `bootc edit` and `bootc status --json --format-version=0`
8+
9+
While bootc does not depend on Kubernetes, it does currently
10+
also offere a Kubernetes *style* API, especially oriented
11+
towards the [spec and status and other conventions](https://kubernetes.io/docs/reference/using-api/api-concepts/).
12+
13+
In general, most use cases of driving bootc via API are probably
14+
most easily done by forking off `bootc upgrade` when desired,
15+
and viewing `bootc status --json --format-version=0`.
16+
17+
## JSON Schema
18+
19+
The current API is classified as `org.containers.bootc/v1alpha1` but
20+
it will likely be officially stabilized mostly as is. However,
21+
you should still request the current "v0" format via an explicit
22+
`--format-version=0` as referenced above.
23+
24+
There is a [JSON schema](https://json-schema.org/) generated from
25+
the Rust source code available here: [host-v0.schema.json](host-v0.schema.json).
26+
27+
A common way to use this is to run a code generator such as
28+
[go-jsonschema](https://github.com/omissis/go-jsonschema) on the
29+
input schema.

0 commit comments

Comments
 (0)