From 55db246f84514d42e211156c8e7fa28ff4d1b8d4 Mon Sep 17 00:00:00 2001 From: Andrew Christian Date: Thu, 16 Feb 2012 15:18:02 -0500 Subject: Schema validation for remote socket protocol. Change-Id: Ia4981187fb35edde82540042ff60688b8066f725 Reviewed-by: Chris Craig --- schema/remote/inbound/set.json | 19 +++++++++++++++++++ schema/remote/inbound/start.json | 9 +++++++++ schema/remote/inbound/stop.json | 9 +++++++++ schema/remote/inbound/write.json | 13 +++++++++++++ schema/remote/outbound/error.json | 10 ++++++++++ schema/remote/outbound/finished.json | 10 ++++++++++ schema/remote/outbound/output.json | 10 ++++++++++ schema/remote/outbound/started.json | 9 +++++++++ schema/remote/outbound/statechanged.json | 9 +++++++++ 9 files changed, 98 insertions(+) create mode 100644 schema/remote/inbound/set.json create mode 100644 schema/remote/inbound/start.json create mode 100644 schema/remote/inbound/stop.json create mode 100644 schema/remote/inbound/write.json create mode 100644 schema/remote/outbound/error.json create mode 100644 schema/remote/outbound/finished.json create mode 100644 schema/remote/outbound/output.json create mode 100644 schema/remote/outbound/started.json create mode 100644 schema/remote/outbound/statechanged.json (limited to 'schema') diff --git a/schema/remote/inbound/set.json b/schema/remote/inbound/set.json new file mode 100644 index 0000000..da29b4e --- /dev/null +++ b/schema/remote/inbound/set.json @@ -0,0 +1,19 @@ +{ + "title": "Set schema", + "description": "The client would like to change a setting on an existing process", + "properties": { + "command": { "type": "string", "pattern": "set", "required": true }, + "id": { "type": "integer", "required": true }, + + "key": { + "type": "string", + "enum": ["priority", "oomAdjustment"], + "required": true + }, + + "value": { + "type": "integer", + "required": true + } + } +} diff --git a/schema/remote/inbound/start.json b/schema/remote/inbound/start.json new file mode 100644 index 0000000..378e171 --- /dev/null +++ b/schema/remote/inbound/start.json @@ -0,0 +1,9 @@ +{ + "title": "Start schema", + "description": "The client request a new process to be started", + "properties": { + "command": { "type": "string", "pattern": "start", "required": true }, + "id": { "type": "integer", "required": true }, + "info": { "type": "object", "required": true } + } +} diff --git a/schema/remote/inbound/stop.json b/schema/remote/inbound/stop.json new file mode 100644 index 0000000..7a9e6c3 --- /dev/null +++ b/schema/remote/inbound/stop.json @@ -0,0 +1,9 @@ +{ + "title": "Stop schema", + "description": "The client request a process to be stopped", + "properties": { + "command": { "type": "string", "pattern": "stop", "required": true }, + "id": { "type": "integer", "required": true }, + "timeout": { "type": "integer", "required": true } + } +} diff --git a/schema/remote/inbound/write.json b/schema/remote/inbound/write.json new file mode 100644 index 0000000..22e8595 --- /dev/null +++ b/schema/remote/inbound/write.json @@ -0,0 +1,13 @@ +{ + "title": "Write schema", + "description": "The client is writing data to the stdin of an existing process", + "properties": { + "command": { "type": "string", "pattern": "write", "required": true }, + "id": { "type": "integer", "required": true }, + + "data": { + "type": "string", + "required": true + } + } +} diff --git a/schema/remote/outbound/error.json b/schema/remote/outbound/error.json new file mode 100644 index 0000000..1544070 --- /dev/null +++ b/schema/remote/outbound/error.json @@ -0,0 +1,10 @@ +{ + "title": "Error schema", + "description": "Signal the client that a process has sent the error() signal", + "properties": { + "event": { "type": "string", "pattern": "error", "required": true }, + "id": { "type": "integer", "required": true }, + "error": { "type": "integer", "required": true }, + "errorString": { "type": "string", "required": true } + } +} diff --git a/schema/remote/outbound/finished.json b/schema/remote/outbound/finished.json new file mode 100644 index 0000000..4f53729 --- /dev/null +++ b/schema/remote/outbound/finished.json @@ -0,0 +1,10 @@ +{ + "title": "Finished schema", + "description": "Signal the client that a process has sent the finished() signal", + "properties": { + "event": { "type": "string", "pattern": "finished", "required": true }, + "id": { "type": "integer", "required": true }, + "exitCode": { "type": "integer", "required": true }, + "exitStatus": { "type": "integer", "required": true } + } +} diff --git a/schema/remote/outbound/output.json b/schema/remote/outbound/output.json new file mode 100644 index 0000000..ee70cf2 --- /dev/null +++ b/schema/remote/outbound/output.json @@ -0,0 +1,10 @@ +{ + "title": "Output schema", + "description": "Signal the client that a process has written data on stdout or stderr", + "properties": { + "event": { "type": "string", "pattern": "output", "required": true }, + "id": { "type": "integer", "required": true }, + "stdout": { "type": "string" }, + "stderr": { "type": "string" } + } +} diff --git a/schema/remote/outbound/started.json b/schema/remote/outbound/started.json new file mode 100644 index 0000000..cef861a --- /dev/null +++ b/schema/remote/outbound/started.json @@ -0,0 +1,9 @@ +{ + "title": "Started schema", + "description": "Signal the client that a process has sent the started() signal", + "properties": { + "event": { "type": "string", "pattern": "started", "required": true }, + "id": { "type": "integer", "required": true }, + "pid": { "type": "integer", "required": true } + } +} diff --git a/schema/remote/outbound/statechanged.json b/schema/remote/outbound/statechanged.json new file mode 100644 index 0000000..acdddf8 --- /dev/null +++ b/schema/remote/outbound/statechanged.json @@ -0,0 +1,9 @@ +{ + "title": "State Changed schema", + "description": "Signal the client that a process has sent the stateChanged() signal", + "properties": { + "event": { "type": "string", "pattern": "stateChanged", "required": true }, + "id": { "type": "integer", "required": true }, + "stateChanged": { "type": "integer", "required": true }, + } +} -- cgit v1.2.3