Skip to content

Commit

Permalink
schema/state.json: Add a JSON Schema for the state JSON
Browse files Browse the repository at this point in the history
Signed-off-by: W. Trevor King <[email protected]>
  • Loading branch information
wking committed Jun 1, 2016
1 parent 6e19bb9 commit ef4c6b0
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
2 changes: 2 additions & 0 deletions schema/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ This directory contains the [JSON Schema](http://json-schema.org/) for
validating the `config.json` of this container runtime specification.

The layout of the files is as follows:

* [config.json](config.json) - the primary entrypoint for the [`config.json`](../config.md) schema
* [config-linux.json](config-linux.json) - the [Linux-specific sub-structure](../config-linux.md)
* [config-solaris.json](config-solaris.json) - the [Solaris-specific sub-structure](../config-solaris.md)
* [state.json](state.json) - the primary entrypoint for the [state JSON](../runtime.md#state) schema
* [defs.json](defs.json) - definitions for general types
* [defs-linux.json](defs-linux.json) - definitions for Linux-specific types
* [validate.go](validate.go) - validation utility source code
Expand Down
42 changes: 42 additions & 0 deletions schema/state.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"description": "Open Container Runtime State Schema",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "https://opencontainers.org/schema/state",
"type": "object",
"properties": {
"ociVersion": {
"id": "https://opencontainers.org/schema/state/ociVersion",
"$ref": "defs.json#/definitions/ociVersion"
},
"id": {
"id": "https://opencontainers.org/schema/state/id",
"description": "the container's ID",
"type": "string"
},
"status": {
"id": "https://opencontainers.org/schema/state/status",
"type": "string",
"enum": [
"created",
"running",
"stopped"
]
},
"pid": {
"id": "https://opencontainers.org/schema/state/pid",
"type": "integer",
"minimum": 0
},
"bundlePath": {
"id": "https://opencontainers.org/schema/state/bundlePath",
"type": "string"
}
},
"required": [
"ociVersion",
"id",
"status",
"pid",
"bundlePath"
]
}

0 comments on commit ef4c6b0

Please sign in to comment.