parent
09eb1e1ef0
commit
54c008cb07
|
@ -466,19 +466,21 @@ Regenerar plantilla - PUT /ogboot/pxe-templates
|
|||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/ogboot/oglives/{isoName}", name="installOglive", methods={"POST"})
|
||||
/**
|
||||
* @Route("/ogboot/v1/oglives", name="installOglive", methods={"POST"})
|
||||
* @OA\Post(
|
||||
* path="/ogboot/oglives/{isoName}",
|
||||
* path="/ogboot/v1/oglives",
|
||||
* summary="Install an ogLive client",
|
||||
* @OA\Parameter(
|
||||
* name="isoName",
|
||||
* in="path",
|
||||
* description="Name of the ogLive ISO to install",
|
||||
* @OA\RequestBody(
|
||||
* required=true,
|
||||
* @OA\Schema(
|
||||
* type="string",
|
||||
* example="ogLive-focal-5.13.0-27-beta-amd64-r20210706.5b4bf5f.iso"
|
||||
* @OA\JsonContent(
|
||||
* type="object",
|
||||
* @OA\Property(
|
||||
* property="isoName",
|
||||
* type="string",
|
||||
* description="Name of the ogLive ISO to install",
|
||||
* example="ogLive-focal-5.13.0-27-beta-amd64-r20210706.5b4bf5f.iso"
|
||||
* )
|
||||
* )
|
||||
* ),
|
||||
* @OA\Response(
|
||||
|
@ -499,10 +501,17 @@ Regenerar plantilla - PUT /ogboot/pxe-templates
|
|||
* )
|
||||
* )
|
||||
*/
|
||||
public function installOglive(string $isoName): Response
|
||||
public function installOglive(Request $request): Response
|
||||
{
|
||||
# $result = $this->curlRequestService->common_request(OG_REST_CMD_POWEROFF, POST, [OG_REST_PARAM_CLIENTS => $ips]);
|
||||
$result = $this->curlRequestService->callOgLive("download $isoName");
|
||||
$data = json_decode($request->getContent(), true);
|
||||
$isoName = $data['isoName'] ?? null;
|
||||
#$isoName = $request->get('isoName');
|
||||
var_dump($isoName);
|
||||
if (!$isoName) {
|
||||
return new Response('ISO name is required', Response::HTTP_BAD_REQUEST);
|
||||
}
|
||||
|
||||
$result = $this->curlRequestService->callOgLive("download " . escapeshellarg($isoName));
|
||||
|
||||
if ($result) {
|
||||
return new Response($result, Response::HTTP_OK);
|
||||
|
@ -511,6 +520,7 @@ Regenerar plantilla - PUT /ogboot/pxe-templates
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @Route("/ogboot/oglives/{id}", name="uninstallOglive", methods={"DELETE"})
|
||||
* @OA\Delete(
|
||||
|
|
Loading…
Reference in New Issue