added some json schemas

This commit is contained in:
badaix 2016-05-28 12:25:49 +02:00
parent 1fa9d3fa71
commit ae2478bb54
8 changed files with 446 additions and 0 deletions

View file

@ -0,0 +1,28 @@
{
"config": {
"latency": 0,
"name": "Schlafzimmer",
"stream": "pipe:///tmp/snapfifo",
"volume": {
"muted": false,
"percent": 100
}
},
"connected": false,
"host": {
"arch": "armv6l",
"ip": "192.168.0.24",
"mac": "80:1f:02:ed:fd:e0",
"name": "wohnzimmer",
"os": "Raspbian GNU/Linux 8.0 (jessie)"
},
"lastSeen": {
"sec": 1464339375,
"usec": 480894
},
"snapclient": {
"name": "Snapclient",
"protocolVersion": 2,
"version": "0.7.0"
}
}

View file

@ -0,0 +1,112 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"config": {
"type": "object",
"properties": {
"latency": {
"type": "integer"
},
"name": {
"type": "string"
},
"stream": {
"type": "string"
},
"volume": {
"type": "object",
"properties": {
"muted": {
"type": "boolean"
},
"percent": {
"type": "integer"
}
},
"required": [
"muted",
"percent"
]
}
},
"required": [
"latency",
"name",
"stream",
"volume"
]
},
"connected": {
"type": "boolean"
},
"host": {
"type": "object",
"properties": {
"arch": {
"type": "string"
},
"ip": {
"type": "string"
},
"mac": {
"type": "string"
},
"name": {
"type": "string"
},
"os": {
"type": "string"
}
},
"required": [
"arch",
"ip",
"mac",
"name",
"os"
]
},
"lastSeen": {
"type": "object",
"properties": {
"sec": {
"type": "integer"
},
"usec": {
"type": "integer"
}
},
"required": [
"sec",
"usec"
]
},
"snapclient": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"protocolVersion": {
"type": "integer"
},
"version": {
"type": "string"
}
},
"required": [
"name",
"protocolVersion",
"version"
]
}
},
"required": [
"config",
"connected",
"host",
"lastSeen",
"snapclient"
]
}

View file

@ -0,0 +1,15 @@
{
"host": {
"arch": "x86_64",
"ip": "",
"mac": "",
"name": "elaine",
"os": "Linux Mint 17.3 Rosa"
},
"snapserver": {
"controlProtocolVersion": 1,
"name": "Snapserver",
"protocolVersion": 1,
"version": "0.7.0"
}
}

View file

@ -0,0 +1,60 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"host": {
"type": "object",
"properties": {
"arch": {
"type": "string"
},
"ip": {
"type": "string"
},
"mac": {
"type": "string"
},
"name": {
"type": "string"
},
"os": {
"type": "string"
}
},
"required": [
"arch",
"ip",
"mac",
"name",
"os"
]
},
"snapserver": {
"type": "object",
"properties": {
"controlProtocolVersion": {
"type": "integer"
},
"name": {
"type": "string"
},
"protocolVersion": {
"type": "integer"
},
"version": {
"type": "string"
}
},
"required": [
"controlProtocolVersion",
"name",
"protocolVersion",
"version"
]
}
},
"required": [
"host",
"snapserver"
]
}

View file

@ -0,0 +1,99 @@
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"clients": [
{
"config": {
"latency": 0,
"name": "Schlafzimmer",
"stream": "pipe:///tmp/snapfifo",
"volume": {
"muted": false,
"percent": 100
}
},
"connected": false,
"host": {
"arch": "armv6l",
"ip": "192.168.0.24",
"mac": "80:1f:02:ed:fd:e0",
"name": "wohnzimmer",
"os": "Raspbian GNU/Linux 8.0 (jessie)"
},
"lastSeen": {
"sec": 1464339375,
"usec": 480894
},
"snapclient": {
"name": "Snapclient",
"protocolVersion": 2,
"version": "0.7.0"
}
},
{
"config": {
"latency": 0,
"name": "Küche",
"stream": "pipe:///tmp/snapfifo",
"volume": {
"muted": false,
"percent": 100
}
},
"connected": true,
"host": {
"arch": "armv6l",
"ip": "192.168.0.31",
"mac": "80:1f:02:ff:79:6e",
"name": "kueche",
"os": "Raspbian GNU/Linux 8 (jessie)"
},
"lastSeen": {
"sec": 1464358728,
"usec": 910393
},
"snapclient": {
"name": "Snapclient",
"protocolVersion": 2,
"version": "0.7.0"
}
}
],
"server": {
"host": {
"arch": "x86_64",
"ip": "",
"mac": "",
"name": "elaine",
"os": "Linux Mint 17.3 Rosa"
},
"snapserver": {
"controlProtocolVersion": 1,
"name": "Snapserver",
"protocolVersion": 1,
"version": "0.7.0"
}
},
"streams": [
{
"id": "pipe:///tmp/snapfifo",
"status": "playing",
"uri": {
"fragment": "",
"host": "",
"path": "/tmp/snapfifo",
"query": {
"buffer_ms": "20",
"codec": "flac",
"mode": "",
"name": "Radio",
"sampleformat": "48000:16:2"
},
"raw": "pipe:///tmp/snapfifo?name=Radio&sampleformat=48000:16:2",
"scheme": "pipe"
}
}
]
}
}

View file

@ -0,0 +1,42 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"jsonrpc": {
"type": "string"
},
"result": {
"type": "object",
"properties": {
"clients": {
"type": "array",
"items": {
"$ref": "https://raw.githubusercontent.com/badaix/snapcast/master/doc/json_rpc_api/client.schema.json"
}
},
"server": {
"$ref": "https://raw.githubusercontent.com/badaix/snapcast/master/doc/json_rpc_api/server.schema.json"
},
"streams": {
"type": "array",
"items": {
"$ref": "https://raw.githubusercontent.com/badaix/snapcast/master/doc/json_rpc_api/stream.schema.json"
}
}
},
"required": [
"clients",
"server",
"streams"
]
}
},
"required": [
"id",
"jsonrpc",
"result"
]
}

View file

@ -0,0 +1,18 @@
{
"id": "pipe:///tmp/snapfifo",
"status": "playing",
"uri": {
"fragment": "",
"host": "",
"path": "/tmp/snapfifo",
"query": {
"buffer_ms": "20",
"codec": "flac",
"mode": "",
"name": "Radio",
"sampleformat": "48000:16:2"
},
"raw": "pipe:///tmp/snapfifo?name=Radio&sampleformat=48000:16:2",
"scheme": "pipe"
}
}

View file

@ -0,0 +1,72 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"status": {
"type": "string"
},
"uri": {
"type": "object",
"properties": {
"fragment": {
"type": "string"
},
"host": {
"type": "string"
},
"path": {
"type": "string"
},
"query": {
"type": "object",
"properties": {
"buffer_ms": {
"type": "string"
},
"codec": {
"type": "string"
},
"mode": {
"type": "string"
},
"name": {
"type": "string"
},
"sampleformat": {
"type": "string"
}
},
"required": [
"buffer_ms",
"codec",
"mode",
"name",
"sampleformat"
]
},
"raw": {
"type": "string"
},
"scheme": {
"type": "string"
}
},
"required": [
"fragment",
"host",
"path",
"query",
"raw",
"scheme"
]
}
},
"required": [
"id",
"status",
"uri"
]
}