2022-10-12 11:08:55 -04:00
|
|
|
<?php
|
|
|
|
|
|
2023-11-17 06:56:07 -05:00
|
|
|
namespace Icinga\Module\Director\Integration;
|
2022-12-29 14:36:25 -05:00
|
|
|
|
2023-11-17 06:31:20 -05:00
|
|
|
use Icinga\Web\Url;
|
2022-10-12 11:08:55 -04:00
|
|
|
|
2023-11-17 06:56:07 -05:00
|
|
|
interface BackendInterface
|
2022-10-12 11:08:55 -04:00
|
|
|
{
|
2023-11-17 07:30:02 -05:00
|
|
|
/**
|
|
|
|
|
* Whether the backend has the given host
|
|
|
|
|
*
|
2023-11-17 08:13:03 -05:00
|
|
|
* @param ?string $hostName
|
2023-11-17 07:30:02 -05:00
|
|
|
*
|
|
|
|
|
* @return bool
|
|
|
|
|
*/
|
2023-11-17 08:13:03 -05:00
|
|
|
public function hasHost(?string $hostName): bool;
|
2022-10-12 11:08:55 -04:00
|
|
|
|
2023-11-17 07:30:02 -05:00
|
|
|
/**
|
|
|
|
|
* Whether the backend has the given service of the specified host
|
|
|
|
|
*
|
2023-11-17 08:13:03 -05:00
|
|
|
* @param ?string $hostName
|
|
|
|
|
* @param ?string $serviceName
|
2023-11-17 07:30:02 -05:00
|
|
|
*
|
|
|
|
|
* @return bool
|
|
|
|
|
*/
|
2023-11-17 08:13:03 -05:00
|
|
|
public function hasService(?string $hostName, ?string $serviceName): bool;
|
2023-11-17 04:27:25 -05:00
|
|
|
|
2023-11-17 07:30:02 -05:00
|
|
|
/**
|
|
|
|
|
* Whether an authenticated user has the permission (is not restricted) to modify given host
|
|
|
|
|
*
|
2023-11-17 08:13:03 -05:00
|
|
|
* @param ?string $hostName
|
2023-11-17 07:30:02 -05:00
|
|
|
*
|
|
|
|
|
* @return bool
|
|
|
|
|
*/
|
2023-11-17 08:13:03 -05:00
|
|
|
public function canModifyHost(?string $hostName): bool;
|
2023-11-17 04:27:25 -05:00
|
|
|
|
2023-11-17 07:30:02 -05:00
|
|
|
/**
|
|
|
|
|
* Whether an authenticated user has the permission (is not restricted) to modify given service of specified host
|
|
|
|
|
*
|
2023-11-17 08:13:03 -05:00
|
|
|
* @param ?string $hostName
|
|
|
|
|
* @param ?string $serviceName
|
2023-11-17 07:30:02 -05:00
|
|
|
*
|
|
|
|
|
* @return bool
|
|
|
|
|
*/
|
2023-11-17 08:13:03 -05:00
|
|
|
public function canModifyService(?string $hostName, ?string $serviceName): bool;
|
2023-11-17 06:31:20 -05:00
|
|
|
|
2023-11-17 07:30:02 -05:00
|
|
|
/**
|
|
|
|
|
* Get the url of given host
|
|
|
|
|
*
|
2023-11-17 08:13:03 -05:00
|
|
|
* @param ?string $hostName
|
2023-11-17 07:30:02 -05:00
|
|
|
*
|
|
|
|
|
* @return Url
|
|
|
|
|
*/
|
2023-11-17 08:13:03 -05:00
|
|
|
public function getHostUrl(?string $hostName): ?Url;
|
2022-10-12 11:08:55 -04:00
|
|
|
}
|