/** * @param Jenkins_Executor $executor * @throws RuntimeException */ public function stopExecutor(Jenkins_Executor $executor) { $url = sprintf('%s/computer/%s/executors/%s/stop', $this->baseUrl, $executor->getComputer(), $executor->getNumber()); $curl = curl_init($url); curl_setopt($curl, CURLOPT_POST, 1); $headers = array(); if ($this->areCrumbsEnabled()) { $headers[] = $this->getCrumbHeader(); } curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); curl_exec($curl); if (curl_errno($curl)) { throw new RuntimeException(sprintf('Error durring stopping executor #%s', $executor->getNumber())); } }
/** * @param Jenkins_Executor $executor * @throws RuntimeException */ public function stopExecutor(Jenkins_Executor $executor) { $url = sprintf('%s/computer/%s/executors/%s/stop', $this->baseUrl, $executor->getComputer(), $executor->getNumber()); $curl = curl_init($url); curl_setopt($curl, CURLOPT_POST, 1); curl_exec($curl); if (curl_errno($curl)) { throw new RuntimeException(sprintf('Error durring stopping executor #%s', $executor->getNumber())); } }