all routes added
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Torma Kristóf 2020-11-24 22:53:31 +01:00
parent d1ef5be5d8
commit 603d08cc61
2 changed files with 87 additions and 2 deletions

View File

@ -14,7 +14,9 @@ from jwtman import jwtman
from fbcrypt import bcrypt
from marshm import ma
from healthchecks import health_database_status
from resources import SignupApi, LoginApi, UsersApi, UserParameterApi
from resources import SignupApi, LoginApi, UsersApi, UserParameterApi, CreateIngestResource, CreateEncodeResource, \
CreateRestreamResource, ManipulateStreamResource, GetAllStreamResources, ModifyEncodeResource, \
ModifyIngressResource, ModifyRestreamResource
"""
Main Flask RESTful API
@ -65,6 +67,14 @@ api.add_resource(SignupApi, '/api/auth/signup')
api.add_resource(LoginApi, '/api/auth/login')
api.add_resource(UsersApi, '/api/users')
api.add_resource(UserParameterApi, '/api/users/<username>')
api.add_resource(CreateIngestResource, '/api/objects/streamerobjects/ingest')
api.add_resource(CreateEncodeResource, '/api/objects/streamerobjects/encode')
api.add_resource(CreateRestreamResource, '/api/objects/streamerobjects/restream')
api.add_resource(ManipulateStreamResource, '/api/objects/streamerobjects/<resourceid>')
api.add_resource(GetAllStreamResources, '/api/objects/streamerobjects')
api.add_resource(ModifyEncodeResource, '/api/objects/streamerobjects/encode/<resourceid>')
api.add_resource(ModifyIngressResource, '/api/objects/streamerobjects/ingest/<resourceid>')
api.add_resource(ModifyRestreamResource, '/api/objects/streamerobjects/restream/<resourceid>')
health.add_check(health_database_status)
app.add_url_rule("/healthz", "healthcheck", view_func=lambda: health.run())

View File

@ -1,4 +1,5 @@
#!/usr/bin/env python3
from uuid import uuid4
import datetime
from flask_jwt_extended import create_access_token, jwt_required
@ -155,3 +156,77 @@ class UserParameterApi(Resource):
abort(503, "db session error")
return self.usermetadataschema.dump(user), 200
class CreateIngestResource(Resource):
"""
See: https://swagger.kmlabz.com/?urls.primaryName=videON%20Backend#/backend/createIngest
"""
def post(self):
pass
class CreateRestreamResource(Resource):
"""
See: https://swagger.kmlabz.com/?urls.primaryName=videON%20Backend#/backend/createRestream
"""
def post(self):
pass
class CreateEncodeResource(Resource):
"""
See: https://swagger.kmlabz.com/?urls.primaryName=videON%20Backend#/backend/createEncode
"""
def post(self):
pass
class GetAllStreamResources(Resource):
"""
See: https://swagger.kmlabz.com/?urls.primaryName=videON%20Backend#/backend/getResource
"""
def get(self):
pass
class ManipulateStreamResource(Resource):
def get(self, resourceid: uuid4):
"""
See: https://swagger.kmlabz.com/?urls.primaryName=videON%20Backend#/backend/getAResource
:param resourceid:
:return:
"""
pass
def delete(self, resourceid: uuid4):
"""
See: https://swagger.kmlabz.com/?urls.primaryName=videON%20Backend#/backend/deleteResource
:param resourceid:
:return:
"""
pass
class ModifyIngressResource(Resource):
"""
See: https://swagger.kmlabz.com/?urls.primaryName=videON%20Backend#/backend/editIngress
"""
def put(self, resourceid: uuid4):
pass
class ModifyRestreamResource(Resource):
"""
See: https://swagger.kmlabz.com/?urls.primaryName=videON%20Backend#/backend/editRestream
"""
def put(self, resourceid: uuid4):
pass
class ModifyEncodeResource(Resource):
"""
See: https://swagger.kmlabz.com/?urls.primaryName=videON%20Backend#/backend/editEncode
"""
def put(self, resourceid: uuid4):
pass