DataSift\Storyplayer\HostLib\VagrantVms::destroyHost PHP Метод

destroyHost() публичный Метод

public destroyHost ( stdClass $groupDef ) : void
$groupDef stdClass
Результат void
    public function destroyHost($groupDef)
    {
        // what are we doing?
        $log = usingLog()->startAction("destroy VM(s)");
        // stop all the VMs, one by one
        foreach ($groupDef->details->machines as $hostId => $machine) {
            // get the machine details
            $vmDetails = fromHostsTable()->getDetailsForHost($hostId);
            if ($vmDetails) {
                // is the VM actually running?
                if (fromHost($hostId)->getHostIsRunning()) {
                    // delete the VM from disk
                    //
                    // this will also deregister the host from the
                    // HostsTable and RolesTable
                    usingVagrant()->destroyVm($hostId);
                }
            }
        }
        // all done
        $log->endAction();
    }