api_v1.4/hub_api/uptime.py

23 lines
477 B
Python

"""
Uptime
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2022 Project Author name guillermo.gutierrezmorote@concordia.ca
"""
import datetime
import json
from flask import Response
from flask_restful import Resource
import hub_api.helpers.session_helper as sh
class Uptime(Resource):
def __init__(self):
pass
@staticmethod
def get():
uptime = {"uptime": f"{datetime.datetime.now() - sh.begin_time}"}
return Response(json.dumps(uptime))