Add create recording http endpoint
parent
3beae5b0d5
commit
5d9264cfbb
|
@ -107,6 +107,13 @@ class DeviceRecordingResource(ProtectedResource):
|
|||
return RecordingsWrapperSchema().dump(
|
||||
{'recordings': devices.get_device_recordings(device_id)}), 200
|
||||
|
||||
@swag_from('swagger/create_device_recording_spec.yaml')
|
||||
def post(self, device_id):
|
||||
validate_device_ownership(device_id)
|
||||
success = devices.create_recording(device_id, request.json)
|
||||
if success:
|
||||
return '', 201
|
||||
|
||||
|
||||
class DeviceListResource(ProtectedResource):
|
||||
@use_args(DeviceWrapperSchema())
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
Creates new recoding
|
||||
---
|
||||
tags:
|
||||
- Recording
|
||||
- Device
|
||||
parameters:
|
||||
- in: path
|
||||
name: device_id
|
||||
required: true
|
||||
type: integer
|
||||
description: Id of the device
|
||||
- in: body
|
||||
name: body
|
||||
required: true
|
||||
schema:
|
||||
type: object
|
||||
required:
|
||||
- recording
|
||||
properties:
|
||||
recording:
|
||||
$ref: '#/definitions/Recording'
|
||||
responses:
|
||||
201:
|
||||
description: Successful creation
|
|
@ -7,7 +7,7 @@ parameters:
|
|||
name: dashboard_id
|
||||
required: true
|
||||
type: integer
|
||||
description: Id of the device
|
||||
description: Id of the dashboard
|
||||
- in: body
|
||||
name: body
|
||||
required: true
|
||||
|
|
Loading…
Reference in New Issue