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;
|
||||
|
||||
class PowerManagementService
|
||||
@@ -17,7 +18,7 @@ class PowerManagementService
|
||||
public function SuspendVirtualMachine($vmware_id = ''): array|string
|
||||
{
|
||||
if ($this->client->checkApiExits()) {
|
||||
$response = Http::withoutVerifying()
|
||||
$response = TlsHttpClientFactory::vCenter()
|
||||
->withHeaders([
|
||||
'vmware-api-session-id' => $this->client->token
|
||||
])
|
||||
@@ -39,7 +40,7 @@ class PowerManagementService
|
||||
public function RebootVirtualMachine($product, $vmware_id = ''): array|string
|
||||
{
|
||||
if ($this->client->loginServer($product->ipaddress->host->datacenter->vCenter)) {
|
||||
$response = Http::withoutVerifying()
|
||||
$response = TlsHttpClientFactory::vCenter()
|
||||
->withHeaders([
|
||||
'vmware-api-session-id' => $this->client->token
|
||||
])
|
||||
@@ -61,7 +62,7 @@ class PowerManagementService
|
||||
public function StartVirtualMachine($product, $vmware_id = ''): array|string
|
||||
{
|
||||
if ($this->client->loginServer($product->ipaddress->host->datacenter->vCenter)) {
|
||||
$response = Http::withoutVerifying()
|
||||
$response = TlsHttpClientFactory::vCenter()
|
||||
->withHeaders([
|
||||
'vmware-api-session-id' => $this->client->token
|
||||
])
|
||||
@@ -83,7 +84,7 @@ class PowerManagementService
|
||||
public function ShutdownGuestVirtualMachine($product, $vmware_id = ''): array|string
|
||||
{
|
||||
if ($this->client->loginServer($product->ipaddress->host->datacenter->vCenter)) {
|
||||
$response = Http::withoutVerifying()
|
||||
$response = TlsHttpClientFactory::vCenter()
|
||||
->withHeaders([
|
||||
'vmware-api-session-id' => $this->client->token
|
||||
])
|
||||
@@ -106,7 +107,7 @@ class PowerManagementService
|
||||
public function PowerOffVirtualMachine($vmware_id = ''): array|string
|
||||
{
|
||||
if ($this->client->checkApiExits()) {
|
||||
$response = Http::withoutVerifying()
|
||||
$response = TlsHttpClientFactory::vCenter()
|
||||
->withHeaders([
|
||||
'vmware-api-session-id' => $this->client->token
|
||||
])
|
||||
@@ -128,7 +129,7 @@ class PowerManagementService
|
||||
public function DeleteVirtualMachine($vmware_id = ''): array|string
|
||||
{
|
||||
if ($this->client->checkApiExits()) {
|
||||
$response = Http::withoutVerifying()
|
||||
$response = TlsHttpClientFactory::vCenter()
|
||||
->withHeaders([
|
||||
'vmware-api-session-id' => $this->client->token
|
||||
])
|
||||
@@ -150,7 +151,7 @@ class PowerManagementService
|
||||
public function GetConsoleTickets($vmware_id = ''): array|string
|
||||
{
|
||||
if ($this->client->checkApiExits()) {
|
||||
$response = Http::withoutVerifying()
|
||||
$response = TlsHttpClientFactory::vCenter()
|
||||
->withHeaders([
|
||||
'vmware-api-session-id' => $this->client->token
|
||||
])
|
||||
@@ -219,7 +220,7 @@ class PowerManagementService
|
||||
return "Login_Again";
|
||||
}
|
||||
|
||||
$response = Http::withoutVerifying()
|
||||
$response = TlsHttpClientFactory::vCenter()
|
||||
->withHeaders([
|
||||
'vmware-api-session-id' => $this->client->token
|
||||
])
|
||||
@@ -265,7 +266,7 @@ class PowerManagementService
|
||||
return 'Login_Again';
|
||||
}
|
||||
|
||||
$response = Http::withoutVerifying()
|
||||
$response = TlsHttpClientFactory::vCenter()
|
||||
->withHeaders(['vmware-api-session-id' => $this->client->token])
|
||||
->timeout(8)
|
||||
->get("https://{$this->client->apiUri}/rest/vcenter/vm/$vmId/power");
|
||||
|
||||
Reference in New Issue
Block a user