mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2025-01-21 10:45:29 +01:00
22 lines
490 B
Python
22 lines
490 B
Python
|
import logging
|
||
|
from app.classes.web.base_api_handler import BaseApiHandler
|
||
|
|
||
|
logger = logging.getLogger(__name__)
|
||
|
|
||
|
|
||
|
class ApiCraftyHostStatsHandler(BaseApiHandler):
|
||
|
def get(self):
|
||
|
auth_data = self.authenticate_user()
|
||
|
if not auth_data:
|
||
|
return
|
||
|
|
||
|
latest = self.controller.management.get_latest_hosts_stats()
|
||
|
|
||
|
self.finish_json(
|
||
|
200,
|
||
|
{
|
||
|
"status": "ok",
|
||
|
"data": latest,
|
||
|
},
|
||
|
)
|