parent
f885d90a0a
commit
9f2070dced
|
@ -54,19 +54,7 @@ class IcingaEndpoint extends IcingaObject
|
||||||
{
|
{
|
||||||
$format = $this->connection->settings()->config_format;
|
$format = $this->connection->settings()->config_format;
|
||||||
if ($format === 'v2') {
|
if ($format === 'v2') {
|
||||||
$client = new RestApiClient(
|
return new CoreApi($this->getRestApiClient());
|
||||||
$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);
|
|
||||||
} elseif ($format === 'v1') {
|
} elseif ($format === 'v1') {
|
||||||
return new LegacyDeploymentApi($this->connection);
|
return new LegacyDeploymentApi($this->connection);
|
||||||
} else {
|
} 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
|
* Use duration time renderer helper
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue