Skip to content

Commit ef4c6b0

Browse files
committed
schema/state.json: Add a JSON Schema for the state JSON
Signed-off-by: W. Trevor King <[email protected]>
1 parent 6e19bb9 commit ef4c6b0

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

schema/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ This directory contains the [JSON Schema](http://json-schema.org/) for
66
validating the `config.json` of this container runtime specification.
77

88
The layout of the files is as follows:
9+
910
* [config.json](config.json) - the primary entrypoint for the [`config.json`](../config.md) schema
1011
* [config-linux.json](config-linux.json) - the [Linux-specific sub-structure](../config-linux.md)
1112
* [config-solaris.json](config-solaris.json) - the [Solaris-specific sub-structure](../config-solaris.md)
13+
* [state.json](state.json) - the primary entrypoint for the [state JSON](../runtime.md#state) schema
1214
* [defs.json](defs.json) - definitions for general types
1315
* [defs-linux.json](defs-linux.json) - definitions for Linux-specific types
1416
* [validate.go](validate.go) - validation utility source code

schema/state.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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/state/ociVersion",
9+
"$ref": "defs.json#/definitions/ociVersion"
10+
},
11+
"id": {
12+
"id": "https://opencontainers.org/schema/state/id",
13+
"description": "the container's ID",
14+
"type": "string"
15+
},
16+
"status": {
17+
"id": "https://opencontainers.org/schema/state/status",
18+
"type": "string",
19+
"enum": [
20+
"created",
21+
"running",
22+
"stopped"
23+
]
24+
},
25+
"pid": {
26+
"id": "https://opencontainers.org/schema/state/pid",
27+
"type": "integer",
28+
"minimum": 0
29+
},
30+
"bundlePath": {
31+
"id": "https://opencontainers.org/schema/state/bundlePath",
32+
"type": "string"
33+
}
34+
},
35+
"required": [
36+
"ociVersion",
37+
"id",
38+
"status",
39+
"pid",
40+
"bundlePath"
41+
]
42+
}

0 commit comments

Comments
 (0)