refs #311 #394 changes oglivecli to take isoname in download

pull/3/head
Luis Gerardo Romero Garcia 2024-05-27 12:15:57 +02:00
parent a13dabc93c
commit 9471f1c6e1
1 changed files with 35 additions and 36 deletions

View File

@ -2,7 +2,6 @@
// src/OgBootBundle/Controller/OgBootController.php
namespace App\OgBootBundle\Controller;
require_once __DIR__ . '/../constants.php';
use OpenApi\Annotations as OA;
use Psr\Log\LoggerInterface;
use App\OgBootBundle\Service\CurlRequestService;
@ -467,43 +466,43 @@ Regenerar plantilla - PUT /ogboot/pxe-templates
]);
}
/**
* @Route("/ogboot/oglives/{id}", name="installOglive", methods={"POST"})
* @OA\Post(
* path="/ogboot/oglives/{id}",
* summary="Install an ogLive client",
* @OA\Parameter(
* name="id",
* in="path",
* description="ID of the ogLive client to install",
* required=true,
* @OA\Schema(
* type="integer"
* )
* ),
* @OA\Response(
* response=200,
* description="ogLive client installed successfully",
* @OA\JsonContent(
* type="object",
* @OA\Property(property="message", type="string")
* )
* ),
* @OA\Response(
* response=500,
* description="Failed to install ogLive client",
* @OA\JsonContent(
* type="object",
* @OA\Property(property="error", type="string")
* )
* )
* )
*/
public function installOglive(Request $request): Response
/**
* @Route("/ogboot/oglives/{isoName}", name="installOglive", methods={"POST"})
* @OA\Post(
* path="/ogboot/oglives/{isoName}",
* summary="Install an ogLive client",
* @OA\Parameter(
* name="isoName",
* in="path",
* description="Name of the ogLive ISO to install",
* required=true,
* @OA\Schema(
* type="string",
* example="ogLive-focal-5.13.0-27-beta-amd64-r20210706.5b4bf5f.iso"
* )
* ),
* @OA\Response(
* response=200,
* description="ogLive client installed successfully",
* @OA\JsonContent(
* type="object",
* @OA\Property(property="message", type="string")
* )
* ),
* @OA\Response(
* response=500,
* description="Failed to install ogLive client",
* @OA\JsonContent(
* type="object",
* @OA\Property(property="error", type="string")
* )
* )
* )
*/
public function installOglive(string $isoName): Response
{
$id = (int) $request->get('id');
# $result = $this->curlRequestService->common_request(OG_REST_CMD_POWEROFF, POST, [OG_REST_PARAM_CLIENTS => $ips]);
$result = $this->curlRequestService->callOgLive("download $id");
$result = $this->curlRequestService->callOgLive("download $isoName");
if ($result) {
return new Response($result, Response::HTTP_OK);