summaryrefslogtreecommitdiff
path: root/schemas/response.schema.json
diff options
context:
space:
mode:
authorLukasz Stanislawski <l.stanislaws@samsung.com>2018-07-25 18:00:00 +0200
committerLukasz Stanislawski <l.stanislaws@samsung.com>2018-07-25 18:00:00 +0200
commitfe365e77fa99790bf2bb2370a52f5258daf10ebe (patch)
treebcc4a1bff0e636dcfdf4d9bc3cade173f484cdfd /schemas/response.schema.json
parent8f5d052f9313d1f9e1fa920897523bcabe71bc2b (diff)
downloadttsd-worker-task-fe365e77fa99790bf2bb2370a52f5258daf10ebe.tar.gz
ttsd-worker-task-fe365e77fa99790bf2bb2370a52f5258daf10ebe.tar.bz2
ttsd-worker-task-fe365e77fa99790bf2bb2370a52f5258daf10ebe.zip
add json schemas
Change-Id: Idb2e992107de8b84ee9ba78d54394c69d7d9eac6
Diffstat (limited to 'schemas/response.schema.json')
-rw-r--r--schemas/response.schema.json120
1 files changed, 120 insertions, 0 deletions
diff --git a/schemas/response.schema.json b/schemas/response.schema.json
new file mode 100644
index 0000000..a48e115
--- /dev/null
+++ b/schemas/response.schema.json
@@ -0,0 +1,120 @@
+{
+ "$schema": "http://json-schema.org/schema#",
+ "id": "http://ttsd-worker-task.org/schemas/response.json",
+ "definitions": {
+ "response_type": {
+ "enum": [
+ "LOAD_AVG",
+ "SYSTEM",
+ "PROCESS",
+ "TOP"
+ ]
+ },
+ "process": {
+ "type": "object",
+ "properties": {
+ "app_id": {
+ "type": ["string", "null"]
+ },
+ "exe": {
+ "type": "string"
+ },
+ "pid": {
+ "type": "integer"
+ },
+ "cpu": {
+ "type": "number"
+ },
+ "memory": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "app_id",
+ "exe",
+ "cpu",
+ "memory",
+ "pid"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "type": "object",
+ "properties": {
+ "type": {
+ "$ref": "#/definitions/response_type"
+ },
+ "time": {
+ "type": "integer"
+ },
+ "system_data": {
+ "type": "object",
+ "properties": {
+ "cpu": {
+ "type": "number"
+ },
+ "memory": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "cpu",
+ "memory"
+ ]
+ },
+ "load_avg_data": {
+ "type": "object",
+ "properties": {
+ "one_min_avg": {
+ "type": "number"
+ },
+ "five_min_avg": {
+ "type": "number"
+ },
+ "fifteen_min_avg": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "one_min_avg",
+ "five_min_avg",
+ "fifteen_min_avg"
+ ]
+ },
+ "process_data": {
+ "type": [
+ "array"
+ ],
+ "items": {
+ "$ref": "#/definitions/process"
+ }
+ },
+ "top_data": {
+ "type": "object",
+ "properties": {
+ "cpu": {
+ "type": [
+ "array"
+ ],
+ "items": {
+ "$ref": "#/definitions/process"
+ }
+ },
+ "memory": {
+ "type": [
+ "array"
+ ],
+ "items": {
+ "$ref": "#/definitions/process"
+ }
+ }
+ }
+ }
+ },
+ "required": [
+ "time",
+ "type"
+ ],
+ "minProperties": 1,
+ "additionalProperties": false
+}