Update source into github

This commit is contained in:
pbao9
2025-07-24 16:18:27 +07:00
parent 41419358dd
commit 69851ac7bc
2642 changed files with 284095 additions and 0 deletions
@@ -0,0 +1,54 @@
<?php
namespace App\Jobs\VirtualMachine\Create;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
class CheckStatusVirtualMachine implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
protected $vmware_id;
protected $serviceVCenter;
protected $data;
/**
* Create a new job instance.
*
* @return void
*/
public function __construct($vmware_id, $data,$service)
{
$this->vmware_id = $vmware_id;
$this->serviceVCenter = $service;
$this->data = $data;
}
/**
* Execute the job.
*
* @return void
*/
public function handle()
{
$status = $this->serviceVCenter->CheckVirtualMachine($this->vmware_id);
if ($status['error'] === true) {
throw new \Exception(json_encode($status['message']));
}
if ($status['data']['operations_ready'] === false) {
do {
sleep(10);
$status = $this->serviceVCenter->CheckVirtualMachine($this->vmware_id);
} while ($status['data']['operations_ready'] !== true);
}
$jobs_configNetwork = new GetNetworkVirtualMachine($this->vmware_id,$this->data,$this->serviceVCenter);
dispatch($jobs_configNetwork)->delay(now()->addSeconds(5));
}
}