54 lines
2.0 KiB
Python
54 lines
2.0 KiB
Python
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
|
|
from typing import Self
|
|
from Abstracts.ControllerAbstract import ControllerAbstract
|
|
from Models.ResponseModel import ResponseModel
|
|
from Models.RequestModel import RequestModel
|
|
from Utils.Utils import Utils
|
|
|
|
class AgentsController(ControllerAbstract):
|
|
|
|
def debian(self:Self, request:RequestModel, response:ResponseModel) -> None:
|
|
|
|
key:str = request.get("key")
|
|
hostnames:list[str]
|
|
domain:str|None
|
|
interfaces:list[list[int, str, bool, str, int]]
|
|
disks:list[list[str, int, int, str|None]]
|
|
iterations:int
|
|
candle_times:list[int, int]
|
|
cpu:list[float, float, float, float]
|
|
memory:list[int, int, int, int, int, float]
|
|
net_use:list[list[list[str, int, int, int, int, int, int]]]
|
|
|
|
print(Utils.json_decode(request.body))
|
|
|
|
hostnames, domain, interfaces, disks, iterations, candle_times, cpu, memory, net_use = Utils.json_decode(request.body)
|
|
|
|
print([hostnames, domain, interfaces, disks, iterations, candle_times, cpu, memory, net_use])
|
|
|
|
def windows(self:Self, request:RequestModel, response:ResponseModel) -> None:
|
|
|
|
key:str = request.get("key")
|
|
hostnames:list[str]
|
|
domain:str|None
|
|
interfaces:list[str]
|
|
disks:list[list[str, int, int]]
|
|
iterations:int
|
|
candle_times:list[int, int]
|
|
cpu:list[float, float, float, float, float]
|
|
memory:list[int, int, int, int, int, float]
|
|
net_use:list[list[list[str, int, int, int, int, int, int]]] = []
|
|
|
|
print(Utils.json_decode(request.body))
|
|
|
|
hostnames, domain, interfaces, disks, candle_times, iterations, cpu, memory = Utils.json_decode(request.body)
|
|
|
|
print([hostnames, domain, interfaces, disks, iterations, candle_times, cpu, memory, net_use])
|
|
|
|
def test(self:Self, request:RequestModel, response:ResponseModel) -> None:
|
|
response.set_data({
|
|
"message": "Test successful",
|
|
"key" : request.get("key")
|
|
}, "application/json") |