summaryrefslogtreecommitdiffstats
path: root/configd/src/apps/sentinel/connectivity.h
blob: 69cea835da681872386f948d97addff4c17cf00c (plain) (blame)
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
// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include "rpcserver.h"
#include <vespa/config-sentinel.h>
#include <vespa/config-model.h>
#include <string>
#include <vector>

using cloud::config::SentinelConfig;
using cloud::config::ModelConfig;

namespace config::sentinel {

/**
 * Utility class for running connectivity check.
 **/
class Connectivity {
public:
    Connectivity(const SentinelConfig::Connectivity & config, RpcServer &rpcServer);
    ~Connectivity();

    struct CheckResult {
        bool enoughOk;
        bool allOk;
        std::vector<std::string> details;
        void logDetails() const;
    };

    CheckResult checkConnectivity(const ModelConfig &model);
private:
    const SentinelConfig::Connectivity _config;
    RpcServer &_rpcServer;
};

}