false, // Ignorar la verificación del certificado SSL 'verify_host' => false, // Ignorar la verificación del nombre del host ]); foreach ($bootFile->getClients() as $client) { $data = [ 'template_name' => 'pxe_default', 'mac' => $client->getMac(), 'lang' => 'es_ES.UTF_8', 'ip' => $client->getIp(), 'server_ip' => '92.168.2.1', 'router' => $client->getOrganizationalUnit()->getNetworkSettings()->getRouter(), 'netmask' => $client->getOrganizationalUnit()->getNetworkSettings() ? $client->getOrganizationalUnit()->getNetworkSettings()->getNetmask() : '255.255.255.0', 'computer_name' => $client->getName(), 'netiface' => $client->getNetiface(), 'group' => $client->getOrganizationalUnit()->getName(), 'ogrepo' => $client->getRepository() ? $client->getRepository()->getIpAddress() : '192.168.2.1', 'oglive' => '127.0.0.1', 'oglog' => '192.168.2.1', 'ogshare' => '192.168.2.1', 'oglivedir' => 'ogLive', 'ogprof' => 'false', 'hardprofile' => $client->getHardwareProfile() ? $client->getHardwareProfile()->getDescription() : 'default', 'ogntp' => $client->getOrganizationalUnit()->getNetworkSettings()?->getNtp(), 'ogdns' => $client->getOrganizationalUnit()->getNetworkSettings()?->getDns(), 'ogProxy' => $client->getOrganizationalUnit()->getNetworkSettings()?->getProxy(), 'ogunit' => '', 'resolution' => '788' ]; try { $response = $httpClient->request('POST', $this->ogBootApiUrl.'/ogboot/v1/pxes', [ 'headers' => [ 'accept' => 'application/json', 'Content-Type' => 'application/json', ], 'json' => $data ]); } catch (TransportExceptionInterface $e) { return new JsonResponse( data: $e->getMessage(), status: Response::HTTP_INTERNAL_SERVER_ERROR); } return json_decode($response->getContent(), true); } return 1; } }