Prose\UsingSavageD::stopWatchingServerCpu PHP Method

stopWatchingServerCpu() public method

    public function stopWatchingServerCpu()
    {
        // what are we doing?
        $log = usingLog()->startAction("stop watching the server's cpu on host '{$this->args[0]}'");
        // where are we doing this?
        $safeTestName = urlencode($this->args[0] . '.host');
        $url = $this->getSavagedUrl() . "/server/{$safeTestName}/cpu";
        // make the request
        usingHttp()->delete($url);
        // did it work?
        $response = fromHttp()->get($url);
        expectsHttpResponse($response)->hasStatusCode(404);
        expectsHttpResponse($response)->hasBody('{"error": "no such alias"}');
        // all done
        $log->endAction();
    }