chg: [api] add documentation to default endpoints

main
Alexandre Dulaunoy 2021-05-22 12:55:46 +02:00
parent 5a8118574f
commit 12aaae05f7
No known key found for this signature in database
GPG Key ID: 09E2CD4944E6CBCD
1 changed files with 3 additions and 1 deletions

View File

@ -4,7 +4,7 @@ from flask_restx import Resource, Api
app = Flask(__name__)
app.url_map.strict_slashes = False
api = Api(app, version=version, title='CyCAT.org API', description='CyberSecurity catalog API services', doc='/doc/')
api = Api(app, version=version, title='CyCAT.org API', description='CyCAT - The Cybersecurity Resource Catalogue public API services.', doc='/doc/')
import uuid
import inspect
import redis
@ -12,11 +12,13 @@ import redis
r = redis.Redis(host='127.0.0.1', port='3033')
@api.route('/info')
@api.doc(description="Get information about the CyCAT backend services including status, overall statistics and version.")
class info(Resource):
def get(self):
return "CyCAT backend {}".format(version)
@api.route('/generate/uuid')
@api.doc(description="Generate an UUID version 4 RFC4122-compliant.")
class generateUUID(Resource):
def get(self):
genuuid = uuid.uuid4()