update rm deadcode
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Http\Services\vCenter;
|
||||
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use App\Support\TlsHttpClientFactory;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Http\Client\ConnectionException;
|
||||
use Illuminate\Support\Str;
|
||||
@@ -32,7 +33,7 @@ class VirtualMachineService
|
||||
$params['filter.hosts'] = $host;
|
||||
}
|
||||
|
||||
$response = Http::withoutVerifying()
|
||||
$response = TlsHttpClientFactory::vCenter()
|
||||
->withHeaders([
|
||||
'vmware-api-session-id' => $this->client->token
|
||||
])
|
||||
@@ -111,7 +112,7 @@ class VirtualMachineService
|
||||
try {
|
||||
Log::info('Bắt đầu clone VM với timeout 300 giây', ['template' => $template, 'target_name' => $body['spec']['name']]);
|
||||
|
||||
$response = Http::withoutVerifying()
|
||||
$response = TlsHttpClientFactory::vCenter()
|
||||
->timeout(300)
|
||||
->connectTimeout(30)
|
||||
->withHeaders([
|
||||
@@ -230,7 +231,7 @@ class VirtualMachineService
|
||||
'hot_add_enabled' => true
|
||||
]
|
||||
];
|
||||
$response = Http::withoutVerifying()
|
||||
$response = TlsHttpClientFactory::vCenter()
|
||||
->timeout(30)
|
||||
->withHeaders([
|
||||
'vmware-api-session-id' => $this->client->token,
|
||||
@@ -264,7 +265,7 @@ class VirtualMachineService
|
||||
]
|
||||
];
|
||||
|
||||
$response = Http::withoutVerifying()
|
||||
$response = TlsHttpClientFactory::vCenter()
|
||||
->timeout(30)
|
||||
->withHeaders([
|
||||
'vmware-api-session-id' => $this->client->token,
|
||||
@@ -299,7 +300,7 @@ class VirtualMachineService
|
||||
]
|
||||
];
|
||||
|
||||
$diskResponse = Http::withoutVerifying()
|
||||
$diskResponse = TlsHttpClientFactory::vCenter()
|
||||
->timeout(30)
|
||||
->withHeaders([
|
||||
'vmware-api-session-id' => $this->client->token,
|
||||
@@ -318,7 +319,7 @@ class VirtualMachineService
|
||||
$firstDisk = $diskData['value'][0];
|
||||
$diskKey = $firstDisk['key'];
|
||||
|
||||
$response = Http::withoutVerifying()
|
||||
$response = TlsHttpClientFactory::vCenter()
|
||||
->timeout(30)
|
||||
->withHeaders([
|
||||
'vmware-api-session-id' => $this->client->token,
|
||||
@@ -340,7 +341,7 @@ class VirtualMachineService
|
||||
public function CheckVirtualMachine($vmware_id = '')
|
||||
{
|
||||
if ($this->client->checkApiExits()) {
|
||||
$response = Http::withoutVerifying()
|
||||
$response = TlsHttpClientFactory::vCenter()
|
||||
->withHeaders([
|
||||
'vmware-api-session-id' => $this->client->token
|
||||
])
|
||||
@@ -358,7 +359,7 @@ class VirtualMachineService
|
||||
{
|
||||
$check = $this->client->checkApiExits();
|
||||
if ($check) {
|
||||
$response = Http::withoutVerifying()
|
||||
$response = TlsHttpClientFactory::vCenter()
|
||||
->withHeaders([
|
||||
'vmware-api-session-id' => $this->client->token
|
||||
])
|
||||
@@ -383,7 +384,7 @@ class VirtualMachineService
|
||||
return null;
|
||||
}
|
||||
|
||||
$response = Http::withoutVerifying()
|
||||
$response = TlsHttpClientFactory::vCenter()
|
||||
->withHeaders([
|
||||
'vmware-api-session-id' => $this->client->token
|
||||
])
|
||||
@@ -406,7 +407,7 @@ class VirtualMachineService
|
||||
|
||||
public function GetDetailVirtualMachine($vmware_id = ''): array
|
||||
{
|
||||
$response = Http::withoutVerifying()
|
||||
$response = TlsHttpClientFactory::vCenter()
|
||||
->withHeaders([
|
||||
'vmware-api-session-id' => $this->client->token
|
||||
])
|
||||
@@ -425,7 +426,7 @@ class VirtualMachineService
|
||||
|
||||
public function GetIPAddressVirtualMachine($vmware_id = ''): array
|
||||
{
|
||||
$response = Http::withoutVerifying()
|
||||
$response = TlsHttpClientFactory::vCenter()
|
||||
->withHeaders([
|
||||
'vmware-api-session-id' => $this->client->token
|
||||
])
|
||||
@@ -451,7 +452,7 @@ class VirtualMachineService
|
||||
];
|
||||
|
||||
try {
|
||||
$hardwareResponse = Http::withoutVerifying()
|
||||
$hardwareResponse = TlsHttpClientFactory::vCenter()
|
||||
->withHeaders([
|
||||
'vmware-api-session-id' => $this->client->token
|
||||
])
|
||||
@@ -480,7 +481,7 @@ class VirtualMachineService
|
||||
}
|
||||
}
|
||||
|
||||
$guestMemoryResponse = Http::withoutVerifying()
|
||||
$guestMemoryResponse = TlsHttpClientFactory::vCenter()
|
||||
->withHeaders([
|
||||
'vmware-api-session-id' => $this->client->token
|
||||
])
|
||||
@@ -494,7 +495,7 @@ class VirtualMachineService
|
||||
: 0;
|
||||
}
|
||||
|
||||
$guestCpuResponse = Http::withoutVerifying()
|
||||
$guestCpuResponse = TlsHttpClientFactory::vCenter()
|
||||
->withHeaders([
|
||||
'vmware-api-session-id' => $this->client->token
|
||||
])
|
||||
@@ -512,7 +513,7 @@ class VirtualMachineService
|
||||
|
||||
public function ConfigNetworkVirtualMachine($vmware_id = '', $config = []): int
|
||||
{
|
||||
return Http::withoutVerifying()
|
||||
return TlsHttpClientFactory::vCenter()
|
||||
->withHeaders([
|
||||
'vmware-api-session-id' => $this->client->token
|
||||
])
|
||||
@@ -526,7 +527,7 @@ class VirtualMachineService
|
||||
|
||||
if ($check) {
|
||||
try {
|
||||
$response = Http::withoutVerifying()
|
||||
$response = TlsHttpClientFactory::vCenter()
|
||||
->withHeaders([
|
||||
'vmware-api-session-id' => $this->client->token
|
||||
])
|
||||
@@ -552,7 +553,7 @@ class VirtualMachineService
|
||||
}
|
||||
|
||||
try {
|
||||
$response = Http::withoutVerifying()
|
||||
$response = TlsHttpClientFactory::vCenter()
|
||||
->withHeaders([
|
||||
'vmware-api-session-id' => $this->client->token
|
||||
])
|
||||
@@ -578,7 +579,7 @@ class VirtualMachineService
|
||||
|
||||
$vmId = $vmList[0]['vm'];
|
||||
|
||||
$detailResponse = Http::withoutVerifying()
|
||||
$detailResponse = TlsHttpClientFactory::vCenter()
|
||||
->withHeaders([
|
||||
'vmware-api-session-id' => $this->client->token
|
||||
])
|
||||
@@ -655,7 +656,7 @@ class VirtualMachineService
|
||||
"size_MiB" => $ram * 1024,
|
||||
]
|
||||
];
|
||||
$response = Http::withoutVerifying()
|
||||
$response = TlsHttpClientFactory::vCenter()
|
||||
->withHeaders([
|
||||
'vmware-api-session-id' => $this->client->token
|
||||
])
|
||||
@@ -686,7 +687,7 @@ class VirtualMachineService
|
||||
"count" => $cpu
|
||||
]
|
||||
];
|
||||
$response = Http::withoutVerifying()
|
||||
$response = TlsHttpClientFactory::vCenter()
|
||||
->withHeaders([
|
||||
'vmware-api-session-id' => $this->client->token
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user