refs #1543 fix swagger annotation
parent
16eedd9546
commit
96783a972f
|
@ -140,7 +140,7 @@ class DhcpController
|
||||||
$output = shell_exec("df -h " . realpath($this->backup_dir) . " | tail -1 | awk '{print $2, $3, $4, $5}'");
|
$output = shell_exec("df -h " . realpath($this->backup_dir) . " | tail -1 | awk '{print $2, $3, $4, $5}'");
|
||||||
if (!$output) {
|
if (!$output) {
|
||||||
$this->logger->error("Failed to execute disk usage command");
|
$this->logger->error("Failed to execute disk usage command");
|
||||||
return null;
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
list($total, $used, $available, $percentage) = explode(' ', $output);
|
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="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="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="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(
|
* @OA\Property(
|
||||||
* property="reservations",
|
* property="reservations",
|
||||||
* type="array",
|
* type="array",
|
||||||
|
@ -395,7 +397,7 @@ class DhcpController
|
||||||
* @OA\Property(property="mask", type="string", example="255.255.255.0"),
|
* @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="address", type="string", example="192.168.1.0"),
|
||||||
* @OA\Property(property="nextServer", type="string", example="192.168.1.1"),
|
* @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="DNS", type="string", example="192.168.1.1"),
|
||||||
* @OA\Property(property="bootFileName", type="string", example="pxelinux.0"),
|
* @OA\Property(property="bootFileName", type="string", example="pxelinux.0"),
|
||||||
* @OA\Property(property="router", type="string", example="192.168.1.254")
|
* @OA\Property(property="router", type="string", example="192.168.1.254")
|
||||||
|
@ -521,7 +523,7 @@ public function addDhcpSubnet(Request $request): JsonResponse
|
||||||
if (!empty($DNS)) {
|
if (!empty($DNS)) {
|
||||||
$newSubnet["option-data"][] = [
|
$newSubnet["option-data"][] = [
|
||||||
"name" => "domain-name-servers",
|
"name" => "domain-name-servers",
|
||||||
"code" => 23,
|
"code" => 6,
|
||||||
"space" => "dhcp4",
|
"space" => "dhcp4",
|
||||||
"csv-format" => true,
|
"csv-format" => true,
|
||||||
"data" => $DNS
|
"data" => $DNS
|
||||||
|
@ -888,8 +890,8 @@ public function addDhcpSubnet(Request $request): JsonResponse
|
||||||
* type="object",
|
* type="object",
|
||||||
* @OA\Property(property="mask", type="string"),
|
* @OA\Property(property="mask", type="string"),
|
||||||
* @OA\Property(property="address", type="string"),
|
* @OA\Property(property="address", type="string"),
|
||||||
* @OA\Property(property="DNS", type="string")
|
* @OA\Property(property="DNS", type="string"),
|
||||||
* @OA\Property(property="subnetName", type="string")
|
* @OA\Property(property="subnetName", type="string"),
|
||||||
* @OA\Property(property="router", type="string", example="192.168.1.254"),
|
* @OA\Property(property="router", type="string", example="192.168.1.254"),
|
||||||
* @OA\Property(property="nextServer", type="string"),
|
* @OA\Property(property="nextServer", type="string"),
|
||||||
* @OA\Property(property="bootFileName", 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));
|
], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES));
|
||||||
return new JsonResponse(['error' => $errorText], Response::HTTP_INTERNAL_SERVER_ERROR);
|
return new JsonResponse(['error' => $errorText], Response::HTTP_INTERNAL_SERVER_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return new JsonResponse(['error' => 'Unexpected error occurred'], Response::HTTP_INTERNAL_SERVER_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue