12#ifndef CONSULSERVICEREGISTRYADAPTER_HPP
13#define CONSULSERVICEREGISTRYADAPTER_HPP
16#include <ppconsul/agent.h>
37 std::vector<std::string>
40 const std::string& service_name,
41 const std::string& service_type,
42 const bool health_check)
override;
47 bool IsComponent(
const ppconsul::ServiceInfo& service_info,
51 static const std::string CONSUL_COMMON_SERVICE;
52 static const std::string CONSUL_NAME_KEY;
53 static const std::string CONSUL_TYPE_KEY;
54 static const std::string CONSUL_ENDPOINT_TYPE_KEY;
55 static const std::string CONSUL_ENDPOINT_URI_KEY;
56 static const std::string RUNTIME_REPO_ENDPOINT;
57 static const std::string PERSISTENT_REPO_ENDPOINT;
58 static const std::string OLDB_ENDPOINT;
59 static const std::string TELEGRAF_ENDPOINT;
60 std::unique_ptr<ppconsul::Consul> m_consul_client;
61 std::unique_ptr<ppconsul::agent::Agent> m_consul_agent;
62 std::map<std::string, ppconsul::ServiceInfo> m_services;
std::vector< std::string > ListComponents(const std::string &service_type=COMPONENT_TYPE) override
Get known components.
Definition consulServiceRegistryAdapter.cpp:168
ServiceEndpoint GetPersistentRepoEndpoint() override
Get the Persistent Repository Endpoint from the service registry.
Definition consulServiceRegistryAdapter.cpp:225
bool IsComponent(const ppconsul::ServiceInfo &service_info, const std::string &service_type=COMPONENT_TYPE)
Definition consulServiceRegistryAdapter.cpp:233
ConsulServiceRegistryAdapter(const elt::mal::Uri &endpoint)
Definition consulServiceRegistryAdapter.cpp:44
static const std::string SUPPORTED_URI_SCHEME
Definition consulServiceRegistryAdapter.hpp:34
ServiceEndpoint GetTelegrafEndpoint() override
Get the Telegraf Endpoint from the service registry.
Definition consulServiceRegistryAdapter.cpp:229
ServiceEndpoint GetRuntimeRepoEndpoint() override
Get the Runtime Repository Endpoint from the service registry.
Definition consulServiceRegistryAdapter.cpp:214
ServiceEndpoint GetOldbEndpoint() override
Get the Oldb Endpoint from the service registry.
Definition consulServiceRegistryAdapter.cpp:209
ServiceEndpoint Get(const std::string &comp_name, const std::string &service_name, const std::string &service_type, const bool health_check) override
Get endpoint of specific service of a specific component.
Definition consulServiceRegistryAdapter.cpp:59
Class that implements a service registry to be used by the service discovery.
Definition serviceRegistryIf.hpp:30
static const std::string COMPONENT_TYPE
the string for component type (default)
Definition serviceRegistryIf.hpp:59
elt::mal::Uri ServiceEndpoint
Definition serviceRegistryIf.hpp:42
Header file for DataPointPath.
Definition commandReplier.cpp:21
Class that implements the service registry interface.