InspectController: discover endpoint if none given

Also fixes host/service inspect hooks
This commit is contained in:
Thomas Gelf 2016-02-09 20:38:56 +01:00
parent 8e4e441484
commit 543601e5c6
1 changed files with 4 additions and 0 deletions

View File

@ -98,6 +98,10 @@ class InspectController extends ActionController
protected function api()
{
$this->view->endpoint = $this->params->get('endpoint');
if ($this->view->endpoint === null) {
$this->view->endpoint = $this->db()->getDeploymentEndpointName();
}
$endpoint = IcingaEndpoint::load($this->view->endpoint, $this->db());
$apiconfig = $this->Config()->getSection('api');
$client = new RestApiClient($endpoint->host, $endpoint->port);