Coverage for yaptide/routes/main_routes.py: 100%
34 statements
« prev ^ index » next coverage.py v7.6.4, created at 2024-11-22 07:31 +0000
« prev ^ index » next coverage.py v7.6.4, created at 2024-11-22 07:31 +0000
1from flask_restful import Api, Resource
3from yaptide.routes.auth_routes import (AuthLogIn, AuthLogOut, AuthRefresh, AuthRegister, AuthStatus)
4from yaptide.routes.batch_routes import Clusters, JobsBatch
5from yaptide.routes.celery_routes import ConvertResource, JobsDirect
6from yaptide.routes.common_sim_routes import (JobsResource, InputsResource, LogfilesResource, ResultsResource)
7from yaptide.routes.estimator_routes import EstimatorResource
8from yaptide.routes.keycloak_routes import AuthKeycloak
9from yaptide.routes.task_routes import TasksResource
10from yaptide.routes.user_routes import UserSimulations, UserUpdate
11from yaptide.routes.utils.response_templates import yaptide_response
14class HelloWorld(Resource):
15 """Root route"""
17 @staticmethod
18 def get():
19 """Root route get method"""
20 return yaptide_response(message="Hello World!", code=200)
23def initialize_routes(api: Api):
24 """Function initializing routes"""
25 api.add_resource(HelloWorld, "/")
27 api.add_resource(JobsDirect, "/jobs/direct")
28 api.add_resource(JobsBatch, "/jobs/batch")
30 api.add_resource(JobsResource, "/jobs")
32 api.add_resource(TasksResource, "/tasks")
34 api.add_resource(ResultsResource, "/results")
35 api.add_resource(InputsResource, "/inputs")
36 api.add_resource(LogfilesResource, "/logfiles")
38 api.add_resource(ConvertResource, "/convert")
40 api.add_resource(UserSimulations, "/user/simulations")
41 api.add_resource(UserUpdate, "/user/update")
43 api.add_resource(AuthRegister, "/auth/register")
44 api.add_resource(AuthLogIn, "/auth/login")
45 api.add_resource(AuthRefresh, "/auth/refresh")
46 api.add_resource(AuthStatus, "/auth/status")
47 api.add_resource(AuthLogOut, "/auth/logout")
49 api.add_resource(AuthKeycloak, "/auth/keycloak")
51 api.add_resource(Clusters, "/clusters")
52 api.add_resource(EstimatorResource, "/estimators")