parent
f885d90a0a
commit
9f2070dced
|
@ -54,19 +54,7 @@ class IcingaEndpoint extends IcingaObject
|
|||
{
|
||||
$format = $this->connection->settings()->config_format;
|
||||
if ($format === 'v2') {
|
||||
$client = new RestApiClient(
|
||||
$this->getResolvedProperty('host', $this->getObjectName()),
|
||||
$this->getResolvedProperty('port')
|
||||
);
|
||||
|
||||
$user = $this->getApiUser();
|
||||
$client->setCredentials(
|
||||
// TODO: $user->client_dn,
|
||||
$user->object_name,
|
||||
$user->password
|
||||
);
|
||||
|
||||
return new CoreApi($client);
|
||||
return new CoreApi($this->getRestApiClient());
|
||||
} elseif ($format === 'v1') {
|
||||
return new LegacyDeploymentApi($this->connection);
|
||||
} else {
|
||||
|
@ -74,6 +62,26 @@ class IcingaEndpoint extends IcingaObject
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return RestApiClient
|
||||
*/
|
||||
public function getRestApiClient()
|
||||
{
|
||||
$client = new RestApiClient(
|
||||
$this->getResolvedProperty('host', $this->getObjectName()),
|
||||
$this->getResolvedProperty('port')
|
||||
);
|
||||
|
||||
$user = $this->getApiUser();
|
||||
$client->setCredentials(
|
||||
// TODO: $user->client_dn,
|
||||
$user->object_name,
|
||||
$user->password
|
||||
);
|
||||
|
||||
return $client;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use duration time renderer helper
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue