Skip to content

Commit 8f67a50

Browse files
committed
schema/state-schema.json: Add a JSON Schema for the state JSON
The IDs namespace the fields within the OCI, with /runtime to select the opencontainers/runtime-spec project, and /state to select the state JSON within runtime-spec. Signed-off-by: W. Trevor King <[email protected]>
1 parent 35b17a2 commit 8f67a50

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

schema/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ The layout of the files is as follows:
99
* [config-schema.json](config.json) - the primary entrypoint for the [configuration](../config.md) schema
1010
* [config-linux.json](config-linux.json) - the [Linux-specific configuration sub-structure](../config-linux.md)
1111
* [config-solaris.json](config-solaris.json) - the [Solaris-specific configuration sub-structure](../config-solaris.md)
12+
* [state-schema.json](state.json) - the primary entrypoint for the [state JSON](../runtime.md#state) schema
1213
* [defs.json](defs.json) - definitions for general types
1314
* [defs-linux.json](defs-linux.json) - definitions for Linux-specific types
1415
* [validate.go](validate.go) - validation utility source code

schema/state-schema.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"description": "Open Container Runtime State Schema",
3+
"$schema": "http://json-schema.org/draft-04/schema#",
4+
"id": "https://opencontainers.org/schema/state",
5+
"type": "object",
6+
"properties": {
7+
"ociVersion": {
8+
"id": "https://opencontainers.org/schema/runtime/state/ociVersion",
9+
"$ref": "defs.json#/definitions/ociVersion"
10+
},
11+
"id": {
12+
"id": "https://opencontainers.org/schema/runtime/state/id",
13+
"description": "the container's ID",
14+
"type": "string"
15+
},
16+
"status": {
17+
"id": "https://opencontainers.org/schema/runtime/state/status",
18+
"type": "string",
19+
"enum": [
20+
"created",
21+
"running",
22+
"stopped"
23+
]
24+
},
25+
"pid": {
26+
"id": "https://opencontainers.org/schema/runtime/state/pid",
27+
"type": "integer",
28+
"minimum": 0
29+
},
30+
"bundlePath": {
31+
"id": "https://opencontainers.org/schema/runtime/state/bundlePath",
32+
"type": "string"
33+
},
34+
"annotations": {
35+
"$ref": "defs.json#/definitions/annotations"
36+
}
37+
},
38+
"required": [
39+
"ociVersion",
40+
"id",
41+
"status",
42+
"pid",
43+
"bundlePath"
44+
]
45+
}

0 commit comments

Comments
 (0)