chg: [backend] add statistics about number of publishers/projects

main
Alexandre Dulaunoy 2021-05-22 23:50:55 +02:00
parent ef25bc49c8
commit 520467947c
No known key found for this signature in database
GPG Key ID: 09E2CD4944E6CBCD
1 changed files with 5 additions and 1 deletions

View File

@ -29,7 +29,11 @@ def _validate_uuid(value=None):
@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)
info = {}
info['publishers'] = r.zcard('t:1')
info['projects'] = r.zcard('t:2')
info['version'] = version
return info
@api.route('/generate/uuid')
@api.doc(description="Generate an UUID version 4 RFC4122-compliant.")