diff --git a/src/OgBootBundle/Controller/OgBootController.php b/src/OgBootBundle/Controller/OgBootController.php index 96c8c01..a0f50ad 100644 --- a/src/OgBootBundle/Controller/OgBootController.php +++ b/src/OgBootBundle/Controller/OgBootController.php @@ -68,9 +68,9 @@ Regenerar plantilla - PUT /ogboot/pxe-templates } /** - * @Route("/ogboot/config", name="config", methods={"GET"}) + * @Route("/ogboot/v1/config", name="config", methods={"GET"}) * @OA\Get( - * path="/ogboot/config", + * path="/ogboot/v1/config", * summary="Get ogboot configuration", * @OA\Response( * response=200, @@ -129,9 +129,9 @@ Regenerar plantilla - PUT /ogboot/pxe-templates } /** - * @Route("/ogboot/status", name="status", methods={"GET"}) + * @Route("/ogboot/v1/status", name="status", methods={"GET"}) * @OA\Get( - * path="/ogboot/status", + * path="/ogboot/v1/status", * summary="Get ogboot status", * @OA\Response( * response=200, @@ -165,9 +165,9 @@ Regenerar plantilla - PUT /ogboot/pxe-templates } /** - * @Route("/ogboot/oglives", name="getOglives", methods={"GET"}) + * @Route("/ogboot/v1/oglives", name="getOglives", methods={"GET"}) * @OA\Get( - * path="/ogboot/oglives", + * path="/ogboot/v1/oglives", * summary="Get information of all installed ogLive clients", * @OA\Response( * response=200, @@ -229,9 +229,9 @@ Regenerar plantilla - PUT /ogboot/pxe-templates } /** - * @Route("/ogboot/oglives/default", name="getOgliveDefault", methods={"GET"}) + * @Route("/ogboot/v1/oglives/default", name="getOgliveDefault", methods={"GET"}) * @OA\Get( - * path="/ogboot/oglives/default", + * path="/ogboot/v1/oglives/default", * summary="Get information of the default ogLive client", * @OA\Response( * response=200, @@ -290,9 +290,9 @@ Regenerar plantilla - PUT /ogboot/pxe-templates } /** - * @Route("/ogboot/oglives/{id}", name="getOglive", methods={"GET"}) + * @Route("/ogboot/v1/oglives/{id}", name="getOglive", methods={"GET"}) * @OA\Get( - * path="/ogboot/oglives/{id}", + * path="/ogboot/v1/oglives/{id}", * summary="Get information of an installed ogLive client", * @OA\Parameter( * name="id", @@ -361,9 +361,9 @@ Regenerar plantilla - PUT /ogboot/pxe-templates } /** - * @Route("/ogboot/oglives/default/{id}", name="setOgliveDefault", methods={"POST"}) + * @Route("/ogboot/v1/oglives/default/{id}", name="setOgliveDefault", methods={"POST"}) * @OA\Post( - * path="/ogboot/oglives/default/{id}", + * path="/ogboot/v1/oglives/default/{id}", * summary="Change default ogLive", * @OA\Parameter( * name="id", @@ -406,9 +406,9 @@ Regenerar plantilla - PUT /ogboot/pxe-templates /** - * @Route("/ogboot/images/download", name="getDownloadMenu", methods={"GET"}) + * @Route("/ogboot/v1/isos", name="getDownloadMenu", methods={"GET"}) * @OA\Get( - * path="/ogboot/images/download", + * path="/ogboot/v1/isos", * summary="Get available ISO images for download", * @OA\Response( * response=200, @@ -522,9 +522,9 @@ Regenerar plantilla - PUT /ogboot/pxe-templates /** - * @Route("/ogboot/oglives/{id}", name="uninstallOglive", methods={"DELETE"}) + * @Route("/ogboot/v1/oglives/{id}", name="uninstallOglive", methods={"DELETE"}) * @OA\Delete( - * path="/ogboot/oglives/{id}", + * path="/ogboot/v1/oglives/{id}", * summary="Uninstall an ogLive client", * @OA\Parameter( * name="id", @@ -796,9 +796,46 @@ public function getBootFiles(): JsonResponse return new JsonResponse(['message' => 'PXE boot file created successfully'], Response::HTTP_OK); } - /** - * @Route("/ogboot/v1/pxes/{mac}", name="ogboot_delete_boot_file", methods={"DELETE"}) - */ + +/** + * @Route("/ogboot/v1/pxes/{mac}", name="ogboot_delete_boot_file", methods={"DELETE"}) + * @OA\Delete( + * path="/ogboot/v1/pxes/{mac}", + * summary="Eliminar archivo de arranque", + * description="Elimina un archivo de arranque específico utilizando su dirección MAC.", + * @OA\Parameter( + * name="mac", + * in="path", + * description="La dirección MAC del cliente cuyo archivo de arranque se desea eliminar", + * required=true, + * @OA\Schema(type="string", example="00:11:22:33:44:55") + * ), + * @OA\Response( + * response=200, + * description="El archivo de arranque se eliminó correctamente", + * @OA\JsonContent( + * type="object", + * @OA\Property(property="message", type="string", example="El archivo de arranque se eliminó correctamente") + * ) + * ), + * @OA\Response( + * response=404, + * description="No se encontró ningún archivo de arranque con la dirección MAC especificada", + * @OA\JsonContent( + * type="object", + * @OA\Property(property="error", type="string", example="No se encontró ningún archivo de arranque con la dirección MAC especificada") + * ) + * ), + * @OA\Response( + * response=500, + * description="Error al eliminar el archivo de arranque", + * @OA\JsonContent( + * type="object", + * @OA\Property(property="error", type="string", example="Error al eliminar el archivo de arranque") + * ) + * ) + * ) + */ public function deleteBootFile(string $mac): Response { $directory = '/opt/ogboot/tftpboot/ipxe_scripts';