refs #1543 fix swagger annotation
testing/og-dhcp-API/pipeline/pr-main There was a failure building this commit Details
testing/og-dhcp-API/pipeline/head There was a failure building this commit Details

pull/3/head
Luis Gerardo Romero Garcia 2025-03-03 08:30:42 +01:00
parent 16eedd9546
commit 96783a972f
1 changed files with 9 additions and 5 deletions

View File

@ -140,7 +140,7 @@ class DhcpController
$output = shell_exec("df -h " . realpath($this->backup_dir) . " | tail -1 | awk '{print $2, $3, $4, $5}'");
if (!$output) {
$this->logger->error("Failed to execute disk usage command");
return null;
return [];
}
list($total, $used, $available, $percentage) = explode(' ', $output);
@ -217,6 +217,8 @@ class DhcpController
* @OA\Property(property="subnet", type="string", description="The name of the subnet"),
* @OA\Property(property="next-server", type="string", description="The next server in the subnet"),
* @OA\Property(property="boot-file-name", type="string", description="The boot file name for the subnet"),
* @OA\Property(property="DNS", type="string", description="DNS subnet"),
* @OA\Property(property="subnetName", type="string", description="subnetName subnet"),
* @OA\Property(
* property="reservations",
* type="array",
@ -395,7 +397,7 @@ class DhcpController
* @OA\Property(property="mask", type="string", example="255.255.255.0"),
* @OA\Property(property="address", type="string", example="192.168.1.0"),
* @OA\Property(property="nextServer", type="string", example="192.168.1.1"),
* @OA\Property(property="subnetName", type="string", example="Aula informatica),
* @OA\Property(property="subnetName", type="string", example="Aula informatica"),
* @OA\Property(property="DNS", type="string", example="192.168.1.1"),
* @OA\Property(property="bootFileName", type="string", example="pxelinux.0"),
* @OA\Property(property="router", type="string", example="192.168.1.254")
@ -521,7 +523,7 @@ public function addDhcpSubnet(Request $request): JsonResponse
if (!empty($DNS)) {
$newSubnet["option-data"][] = [
"name" => "domain-name-servers",
"code" => 23,
"code" => 6,
"space" => "dhcp4",
"csv-format" => true,
"data" => $DNS
@ -888,8 +890,8 @@ public function addDhcpSubnet(Request $request): JsonResponse
* type="object",
* @OA\Property(property="mask", type="string"),
* @OA\Property(property="address", type="string"),
* @OA\Property(property="DNS", type="string")
* @OA\Property(property="subnetName", type="string")
* @OA\Property(property="DNS", type="string"),
* @OA\Property(property="subnetName", type="string"),
* @OA\Property(property="router", type="string", example="192.168.1.254"),
* @OA\Property(property="nextServer", type="string"),
* @OA\Property(property="bootFileName", type="string")
@ -2008,6 +2010,8 @@ public function updateDhcpHost(Request $request, $subnetId): JsonResponse
], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES));
return new JsonResponse(['error' => $errorText], Response::HTTP_INTERNAL_SERVER_ERROR);
}
return new JsonResponse(['error' => 'Unexpected error occurred'], Response::HTTP_INTERNAL_SERVER_ERROR);
}