api_v1.4/hub_api/control/uptime.py

23 lines
477 B
Python
Raw Permalink Normal View History

"""
Uptime
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2022 Project Author name guillermo.gutierrezmorote@concordia.ca
"""
import datetime
import json
2023-01-23 12:29:41 -05:00
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}"}
2023-02-13 08:09:48 -05:00
return Response(json.dumps(uptime))