This commit is contained in:
parent
d1ef5be5d8
commit
603d08cc61
12
src/app.py
12
src/app.py
@ -14,7 +14,9 @@ from jwtman import jwtman
|
|||||||
from fbcrypt import bcrypt
|
from fbcrypt import bcrypt
|
||||||
from marshm import ma
|
from marshm import ma
|
||||||
from healthchecks import health_database_status
|
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
|
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(LoginApi, '/api/auth/login')
|
||||||
api.add_resource(UsersApi, '/api/users')
|
api.add_resource(UsersApi, '/api/users')
|
||||||
api.add_resource(UserParameterApi, '/api/users/<username>')
|
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)
|
health.add_check(health_database_status)
|
||||||
app.add_url_rule("/healthz", "healthcheck", view_func=lambda: health.run())
|
app.add_url_rule("/healthz", "healthcheck", view_func=lambda: health.run())
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
from uuid import uuid4
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
from flask_jwt_extended import create_access_token, jwt_required
|
from flask_jwt_extended import create_access_token, jwt_required
|
||||||
@ -155,3 +156,77 @@ class UserParameterApi(Resource):
|
|||||||
abort(503, "db session error")
|
abort(503, "db session error")
|
||||||
|
|
||||||
return self.usermetadataschema.dump(user), 200
|
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
|
||||||
|
Loading…
Reference in New Issue
Block a user