summaryrefslogtreecommitdiffstats
path: root/library/Director/Integration/BackendInterface.php
blob: 7b2b88c18bd9cb87c534eebfd1e94cd0d487e153 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php

namespace Icinga\Module\Director\Integration;

use Icinga\Web\Url;

interface BackendInterface
{
    /**
     * Whether the backend has the given host
     *
     * @param ?string $hostName
     *
     * @return bool
     */
    public function hasHost(?string $hostName): bool;

    /**
     * Whether the backend has the given service of the specified host
     *
     * @param ?string $hostName
     * @param ?string $serviceName
     *
     * @return bool
     */
    public function hasService(?string $hostName, ?string $serviceName): bool;

    /**
     * Whether an authenticated user has the permission (is not restricted) to modify given host
     *
     * @param ?string $hostName
     *
     * @return bool
     */
    public function canModifyHost(?string $hostName): bool;

    /**
     * Whether an authenticated user has the permission (is not restricted) to modify given service of specified host
     *
     * @param ?string $hostName
     * @param ?string $serviceName
     *
     * @return bool
     */
    public function canModifyService(?string $hostName, ?string $serviceName): bool;

    /**
     * Get the url of given host
     *
     * @param ?string $hostName
     *
     * @return Url
     */
    public function getHostUrl(?string $hostName): ?Url;
}