update rm deadcode

This commit is contained in:
baodev0
2026-09-27 11:42:40 +07:00
parent 82a71244ca
commit 3af59bd9c5
129 changed files with 5194 additions and 2698 deletions
@@ -8,7 +8,7 @@ use App\DTOs\VirtualMachine\Rebuild\RebuildContext;
use App\Http\Services\vCenter as VCenterService;
use App\Models\ModuleDatastore;
use App\Models\vCenter as VCenterModel;
use Illuminate\Support\Facades\Http;
use App\Support\TlsHttpClientFactory;
use Illuminate\Support\Facades\Log;
use RuntimeException;
@@ -74,7 +74,7 @@ final class VmRebuildCloneService
'template' => $ctx->template,
]);
$response = Http::withoutVerifying()
$response = TlsHttpClientFactory::vCenter()
->timeout(self::CLONE_TIMEOUT)
->connectTimeout(30)
->withHeaders([
@@ -121,7 +121,7 @@ final class VmRebuildCloneService
throw new RuntimeException("Rebuild powerOn: cannot login to vCenter #{$ctx->vcenterId}");
}
$powerResp = Http::withoutVerifying()
$powerResp = TlsHttpClientFactory::vCenter()
->timeout(self::POWER_ON_TIMEOUT)
->withHeaders(['vmware-api-session-id' => $this->vCenter->token])
->post("https://{$this->vCenter->apiUri}/rest/vcenter/vm/{$ctx->newVmId}/power/start");
@@ -138,7 +138,7 @@ final class VmRebuildCloneService
]);
for ($i = 1; $i <= self::TOOLS_MAX_ATTEMPTS; $i++) {
$info = Http::withoutVerifying()
$info = TlsHttpClientFactory::vCenter()
->timeout(10)
->withHeaders(['vmware-api-session-id' => $this->vCenter->token])
->get("https://{$this->vCenter->apiUri}/rest/vcenter/vm/{$ctx->newVmId}/guest/identity")
@@ -185,7 +185,7 @@ final class VmRebuildCloneService
}
try {
Http::withoutVerifying()
TlsHttpClientFactory::vCenter()
->timeout(30)
->withHeaders(['vmware-api-session-id' => $this->vCenter->token])
->post("https://{$this->vCenter->apiUri}/rest/vcenter/vm/{$ctx->oldVmId}/power/stop");