update rm deadcode
This commit is contained in:
@@ -20,7 +20,7 @@ use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use App\Support\TlsHttpClientFactory;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
/**
|
||||
@@ -309,14 +309,14 @@ class UpdateVmConfigJob implements ShouldQueue
|
||||
$action = $powerOff ? 'stop' : 'start';
|
||||
$targetState = $powerOff ? 'POWERED_OFF' : 'POWERED_ON';
|
||||
|
||||
Http::withoutVerifying()
|
||||
TlsHttpClientFactory::vCenter()
|
||||
->withHeaders(['vmware-api-session-id' => $service->token])
|
||||
->post("https://{$service->apiUri}/rest/vcenter/vm/{$vmwareId}/power/{$action}");
|
||||
|
||||
for ($i = 0; $i < 15; $i++) {
|
||||
sleep(2);
|
||||
|
||||
$state = Http::withoutVerifying()
|
||||
$state = TlsHttpClientFactory::vCenter()
|
||||
->withHeaders(['vmware-api-session-id' => $service->token])
|
||||
->get("https://{$service->apiUri}/rest/vcenter/vm/{$vmwareId}")
|
||||
->json('value.power_state');
|
||||
|
||||
Reference in New Issue
Block a user