src/Actions/ManagesJobs.php
public function createJob($serverId, array $data, $wait = true)
    {
        $job = $this->post("servers/$serverId/jobs", $data)['job'];

        if ($wait) {
            return $this->retry($this->getTimeout(), function () use ($serverId, $job) {
                $job = $this->job($serverId, $job['id']);

                return $job->status == 'installed' ? $job : null;
            });
        }

        return new Job($job + ['server_id' => $serverId], $this);
    }
public function createJob($serverId, array $data, $wait = true)
    {
        $job = $this->post("servers/$serverId/jobs", $data)['job'];

        if ($wait) {
            return $this->retry($this->getTimeout(), function () use ($serverId, $job) {
                $job = $this->job($serverId, $job['id']);

                return $job->status == 'installed' ? $job : null;
            });
        }

        return new Job($job + ['server_id' => $serverId], $this);
    }
public function createJob ( $ serverId , array $ data , $ wait = true ) { $ job = $ this -> post ( "servers/$serverId/jobs" , $ data ) [ 'job' ] ; if ( $ wait ) { return $ this -> retry ( $ this -> getTimeout ( ) , function ( ) use ( $ serverId , $ job ) { $ job = $ this -> job ( $ serverId , $ job [ 'id' ] ) ; return $ job -> status == 'installed' ? $ job : null ; } ) ; } return new Job ( $ job + [ 'server_id' => $ serverId ] , $ this ) ; }
Create a new job.

@param  integer $serverId
@param  array $data
@param  boolean $wait
@return Job
Create a new job .