Skip to content
Snippets Groups Projects
Commit 745a884e authored by David Trattnig's avatar David Trattnig
Browse files

Added body for PUT clock. #6

parent 7a752ed4
No related branches found
No related tags found
No related merge requests found
......@@ -12,7 +12,7 @@ def current_track(): # noqa: E501
Retrieves the currently playing track. # noqa: E501
:rtype: PlayLog
:rtype: Track
"""
service = current_app.config['SERVICE']
return service.current_track()
......@@ -28,7 +28,7 @@ def list_tracks(page=None, limit=None): # noqa: E501
:param limit: The numbers of items to return per page
:type limit: int
:rtype: List[PlayLog]
:rtype: List[Track]
"""
service = current_app.config['SERVICE']
return service.list_tracks(page, limit)
......@@ -113,26 +113,20 @@ paths:
"400":
description: bad input parameter
x-openapi-router-controller: src.rest.controllers.internal_controller
/clock/{number}:
put:
tags:
- internal
summary: Set current studio clock information such as schedule info and track-list
for engine 1 or 2
description: |
Set current studio clock information (schedule and track-list) of the given play-out source (engine1, engine2)
Set current studio clock information (source, schedule and track-list) and the next schedule of the given play-out source (engine1, engine2). Please note, the `current_track` information is ignored in the PUT request. It's only populated in the GET request. To store current track information use `/playlog/store` instead.
operationId: set_clock_info
parameters:
- name: number
in: path
description: Number of the engine
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ClockInfo'
required: true
style: simple
explode: false
schema:
maximum: 2
minimum: 1
type: integer
responses:
"200":
description: status updated
......
......@@ -40,7 +40,7 @@ class TestInternalController(BaseTestCase):
"""
body = PlayLog()
response = self.client.open(
'/playlog/store',
'/api/v1/playlog/store',
method='POST',
data=json.dumps(body),
content_type='application/json')
......@@ -115,7 +115,7 @@ class TestInternalController(BaseTestCase):
"""
body = HealthLog()
response = self.client.open(
'/source/health/{number}'.format(number=2),
'api/v1/source/health/{number}'.format(number=2),
method='POST',
data=json.dumps(body),
content_type='application/json')
......@@ -128,7 +128,7 @@ class TestInternalController(BaseTestCase):
Set active play-out source (engine1, engine2)
"""
response = self.client.open(
'/source/active/{number}'.format(number=2),
'/api/v1/source/active/{number}'.format(number=2),
method='PUT')
self.assert200(response,
'Response body is : ' + response.data.decode('utf-8'))
......@@ -138,13 +138,16 @@ class TestInternalController(BaseTestCase):
Set current studio clock information such as schedule info and track-list for engine 1 or 2
"""
body = ClockInfo()
response = self.client.open(
'/clock/{number}'.format(number=2),
method='PUT')
'/api/v1/clock',
method='PUT',
data=json.dumps(body),
content_type='application/json')
self.assert200(response,
'Response body is : ' + response.data.decode('utf-8'))
if __name__ == '__main__':
import unittest
unittest.main()
unittest.main()
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment