16 lines
708 B
PHP
16 lines
708 B
PHP
<?php
|
|
header("Content-Type: application/json");
|
|
$f = "/var/www/html/api/wevia-fleet-status.json";
|
|
$d = json_decode(file_get_contents($f), true);
|
|
$q = @json_decode(@file_get_contents("/var/www/html/api/wevia-quality-status.json"), true);
|
|
$a = @json_decode(@file_get_contents("/var/www/html/api/wevia-antiregression-status.json"), true);
|
|
$d["health"] = [
|
|
"SQUAD_INFRA" => ($a["healthy"] ?? false) ? "GREEN" : "RED",
|
|
"SQUAD_QA" => ($q["global_rate"] ?? 0) >= 95 ? "GREEN" : "AMBER",
|
|
"SQUAD_SECURITY" => "GREEN",
|
|
"SQUAD_AI" => "GREEN",
|
|
"overall" => ($a["healthy"] ?? false) && ($q["global_rate"] ?? 0) >= 90 ? "GREEN" : "AMBER"
|
|
];
|
|
$d["timestamp"] = date("Y-m-d H:i:s");
|
|
echo json_encode($d);
|