getIp()) { throw new ValidatorException('IP is required'); } $data = [ 'nfn' => 'Apagar', 'ids' => '0' ]; try { $response = $this->httpClient->request('POST', 'https://'.$client->getIp().':8000/ogAdmClient/Apagar', [ 'verify_peer' => false, 'verify_host' => false, 'headers' => [ 'Content-Type' => 'application/json', ], 'json' => $data, ]); } catch (TransportExceptionInterface $e) { return new JsonResponse( data: ['error' => $e->getMessage()], status: Response::HTTP_INTERNAL_SERVER_ERROR ); } $jobId = json_decode($response->getContent(), true)['job_id']; $client->setStatus(ClientStatus::OFF); $this->entityManager->persist($client); $this->entityManager->flush(); $this->createService->__invoke($client, CommandTypes::SHUTDOWN, TraceStatus::SUCCESS, $jobId, []); return new JsonResponse(data: $client, status: Response::HTTP_OK); } }