2021-10-07 11:14:08 +00:00
|
|
|
from flask_restful import Resource, Api
|
|
|
|
|
|
|
|
from app.api.apache_restart import ApacheRestartFlag
|
|
|
|
from app.api.config import Config, ConfigTest
|
|
|
|
from app.api.infobases import InfobasesAvailable, InfobasesAll
|
|
|
|
from app.api.module import EnterpriseModule
|
|
|
|
from app.api.publications import Publications, Publication, PublicationURL
|
2021-10-07 10:54:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
class APIIndex(Resource):
|
|
|
|
def get(self):
|
|
|
|
return ['infobases-available', 'infobases-all', 'publications',
|
2021-10-07 11:14:08 +00:00
|
|
|
'module', 'config', 'config-test', 'apache-restart']
|
|
|
|
|
|
|
|
|
|
|
|
def add_api_resources(api: Api) -> None:
|
|
|
|
api.add_resource(InfobasesAvailable, '/infobases-available')
|
|
|
|
api.add_resource(InfobasesAll, '/infobases-all')
|
|
|
|
api.add_resource(Publications, '/publications', '/publications/')
|
|
|
|
api.add_resource(Publication, '/publications/<string:name>')
|
|
|
|
api.add_resource(PublicationURL, '/publications/<string:name>/url')
|
|
|
|
api.add_resource(EnterpriseModule, '/module')
|
|
|
|
api.add_resource(Config, '/config')
|
|
|
|
api.add_resource(ConfigTest, '/config-test')
|
|
|
|
api.add_resource(ApacheRestartFlag, '/apache-restart')
|
|
|
|
api.add_resource(APIIndex, '/')
|
|
|
|
|