chg: [api] add documentation to default endpoints
parent
5a8118574f
commit
12aaae05f7
|
@ -4,7 +4,7 @@ from flask_restx import Resource, Api
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
app.url_map.strict_slashes = False
|
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 uuid
|
||||||
import inspect
|
import inspect
|
||||||
import redis
|
import redis
|
||||||
|
@ -12,11 +12,13 @@ import redis
|
||||||
|
|
||||||
r = redis.Redis(host='127.0.0.1', port='3033')
|
r = redis.Redis(host='127.0.0.1', port='3033')
|
||||||
@api.route('/info')
|
@api.route('/info')
|
||||||
|
@api.doc(description="Get information about the CyCAT backend services including status, overall statistics and version.")
|
||||||
class info(Resource):
|
class info(Resource):
|
||||||
def get(self):
|
def get(self):
|
||||||
return "CyCAT backend {}".format(version)
|
return "CyCAT backend {}".format(version)
|
||||||
|
|
||||||
@api.route('/generate/uuid')
|
@api.route('/generate/uuid')
|
||||||
|
@api.doc(description="Generate an UUID version 4 RFC4122-compliant.")
|
||||||
class generateUUID(Resource):
|
class generateUUID(Resource):
|
||||||
def get(self):
|
def get(self):
|
||||||
genuuid = uuid.uuid4()
|
genuuid = uuid.uuid4()
|
||||||
|
|
Loading…
Reference in New Issue