summaryrefslogtreecommitdiffstats
path: root/configd/src/apps/sentinel/state-api.h
blob: 879563b79a5b66e8a9a73915312e7d44e63fcd9d (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
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include <vespa/vespalib/net/state_api.h>
#include <vespa/vespalib/net/simple_metrics_producer.h>
#include <vespa/vespalib/net/simple_health_producer.h>
#include <vespa/vespalib/net/simple_component_config_producer.h>

namespace config {
namespace sentinel {

struct StateApi {
    vespalib::string host_and_port;
    vespalib::SimpleHealthProducer myHealth;
    vespalib::SimpleMetricsProducer myMetrics;
    vespalib::SimpleComponentConfigProducer myComponents;
    vespalib::StateApi myStateApi;

    StateApi() : myStateApi(myHealth, myMetrics, myComponents) {}

    vespalib::string get(const char *path) const;
    void bound(int port);
};

} // namespace config::sentinel
} // namespace config