partition->getEntity(); switch ($input->method){ case DeployMethodTypes::UNICAST: case DeployMethodTypes::UNICAST_DIRECT: $inputData = [ 'method' => $input->method, 'client' => $input->client->getEntity()->getUuid(), 'image' => $image->getUuid(), 'numDisk' => (string) $partition->getDiskNumber(), 'numPartition' => (string) $partition->getPartitionNumber(), ]; $agentJobId = $this->deployImageOgAgentAction->__invoke($image, $input, DeployMethodTypes::UNICAST); $this->createService->__invoke($input->client->getEntity(), CommandTypes::DEPLOY_IMAGE, TraceStatus::IN_PROGRESS, $agentJobId, $inputData); break; case DeployMethodTypes::MULTICAST_UFTP: case DeployMethodTypes::MULTICAST_UDPCAST: case DeployMethodTypes::MULTICAST: case DeployMethodTypes::MULTICAST_UFTP_DIRECT: case DeployMethodTypes::MULTICAST_UDPCAST_DIRECT: $inputData = [ 'method' => $input->method, 'client' => $input->client->getEntity()->getUuid(), 'image' => $image->getUuid(), 'mcastIp' => $input->mcastIp, 'mcastPort' => $input->mcastPort, 'mcastSpeed' => $input->mcastSpeed, 'mcastMode' => $input->mcastMode, 'numDisk' => (string) $partition->getDiskNumber(), 'numPartition' => (string) $partition->getPartitionNumber(), ]; try { $this->deployImageOgRepositoryAction->__invoke($input, $image, $this->httpClient); } catch (\Exception $e) { return new JsonResponse(data: ['error' => $e->getMessage()], status: Response::HTTP_INTERNAL_SERVER_ERROR); } $agentJobId = $this->deployImageOgAgentAction->__invoke($image, $input, DeployMethodTypes::MULTICAST); $this->createService->__invoke($input->client->getEntity(), CommandTypes::DEPLOY_IMAGE, TraceStatus::IN_PROGRESS, $agentJobId, $inputData); break; case DeployMethodTypes::TORRENT: $inputData = [ 'method' => $input->method, 'client' => $input->client->getEntity()->getUuid(), 'image' => $image->getUuid(), 'p2pMode' => $input->p2pMode, 'p2pTime' => $input->p2pTime, 'numDisk' => (string) $partition->getDiskNumber(), 'numPartition' => (string) $partition->getPartitionNumber(), ]; $agentJobId = $this->deployImageOgAgentAction->__invoke($image, $input, DeployMethodTypes::TORRENT); $this->createService->__invoke($input->client->getEntity(), CommandTypes::DEPLOY_IMAGE, TraceStatus::IN_PROGRESS, $agentJobId, $inputData); break; } return new JsonResponse(data: [], status: Response::HTTP_OK); } }