9130: Extend API to support streaming dummy audio sources #1

Merged
jono merged 7 commits from 9130_dummy_audio into main 2023-06-15 12:49:14 +09:30
2 changed files with 24 additions and 3 deletions
Showing only changes of commit dd216e54d3 - Show all commits

View File

@ -38,10 +38,10 @@ udpMaxPayloadSize: 1472
externalAuthenticationURL: externalAuthenticationURL:
# Enable the HTTP API. # Enable the HTTP API.
api: no api: yes
# Enable Prometheus-compatible metrics. # Enable Prometheus-compatible metrics.
metrics: no metrics: yes
# Enable pprof-compatible endpoint to monitor performances. # Enable pprof-compatible endpoint to monitor performances.
pprof: no pprof: no

View File

@ -1,5 +1,6 @@
#! /usr/bin/env python3 #! /usr/bin/env python3
import requests
import SoapySDR as soapy import SoapySDR as soapy
from radio import Radio from radio import Radio
from tuuube import Tuuube from tuuube import Tuuube
@ -13,9 +14,29 @@ swag = Swagger(app)
radios = {} radios = {}
@app.route('/report')
def report():
"""Get streams report from the RTSP relay.
---
responses:
200:
description: JSON
"""
try:
r = requests.get("http://localhost:9997/v1/paths/list")
j = r.json()
for item in j['items']:
del j['items'][item]['conf']
del j['items'][item]['confName']
return jsonify(j)
except:
return "Shat the bed", 500
@app.route('/radio/report') @app.route('/radio/report')
def report(): def radio_report():
"""List radio devices available to the system. """List radio devices available to the system.
--- ---
responses: responses: