mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-02 11:46:34 +02:00
added some json schemas
This commit is contained in:
parent
1fa9d3fa71
commit
ae2478bb54
8 changed files with 446 additions and 0 deletions
28
doc/json_rpc_api/client.json
Normal file
28
doc/json_rpc_api/client.json
Normal 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"
|
||||||
|
}
|
||||||
|
}
|
112
doc/json_rpc_api/client.schema.json
Normal file
112
doc/json_rpc_api/client.schema.json
Normal 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"
|
||||||
|
]
|
||||||
|
}
|
15
doc/json_rpc_api/server.json
Normal file
15
doc/json_rpc_api/server.json
Normal 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"
|
||||||
|
}
|
||||||
|
}
|
60
doc/json_rpc_api/server.schema.json
Normal file
60
doc/json_rpc_api/server.schema.json
Normal 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"
|
||||||
|
]
|
||||||
|
}
|
99
doc/json_rpc_api/server_status.json
Normal file
99
doc/json_rpc_api/server_status.json
Normal 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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
42
doc/json_rpc_api/server_status.schema.json
Normal file
42
doc/json_rpc_api/server_status.schema.json
Normal 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"
|
||||||
|
]
|
||||||
|
}
|
18
doc/json_rpc_api/stream.json
Normal file
18
doc/json_rpc_api/stream.json
Normal 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"
|
||||||
|
}
|
||||||
|
}
|
72
doc/json_rpc_api/stream.schema.json
Normal file
72
doc/json_rpc_api/stream.schema.json
Normal 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"
|
||||||
|
]
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue