AOSharedServiceLibrary
|
The Consul Administrator, who handles configuration & service discovery. More...
#include <consul_interface.h>
Public Member Functions | |
virtual std::string | base64_decode (std::string const &encoded_string)=0 |
Convinience Method for base64 decoding. More... | |
virtual AOSSL::StringBuffer * | base64_decode_safe (std::string const &encoded_string)=0 |
Convinience Method for base64 decoding. More... | |
virtual bool | register_service (const ServiceInterface &s)=0 |
Register the Service. More... | |
virtual bool | deregister_service (const ServiceInterface &s)=0 |
Deregister the Service. More... | |
virtual bool | set_config_value (std::string key, std::string val)=0 |
Set a configuration value. More... | |
virtual std::string | get_config_value (std::string key)=0 |
Get a configuration value. More... | |
virtual AOSSL::StringBuffer * | get_config_value_safe (std::string key)=0 |
Get a configuration value. More... | |
virtual bool | del_config_value (std::string key)=0 |
Delete a configuration value. | |
virtual std::string | services ()=0 |
Query the local agent for services registered. More... | |
virtual AOSSL::StringBuffer * | services_safe ()=0 |
Query the local agent for services registered. | |
virtual std::string | agent_info ()=0 |
Query the local agent for it's info. More... | |
virtual AOSSL::StringBuffer * | agent_info_safe ()=0 |
Query the local agent for it's info. | |
virtual std::string | healthy_services ()=0 |
Query for healthy services only. More... | |
virtual AOSSL::StringBuffer * | healthy_services_safe ()=0 |
Query for healthy services only. | |
virtual std::string | datacenters ()=0 |
Query the catalog for datacenters. More... | |
virtual AOSSL::StringBuffer * | datacenters_safe ()=0 |
Query the catalog for datacenters. | |
virtual std::string | nodes_dc (std::string data_center)=0 |
Query the catalog for the nodes in a particular datacenter. More... | |
virtual AOSSL::StringBuffer * | nodes_dc_safe (std::string data_center)=0 |
Query the catalog for the nodes in a particular datacenter. More... | |
virtual std::string | services_dc (std::string data_center)=0 |
Query the catalog for the services in a particular datacenter. More... | |
virtual AOSSL::StringBuffer * | services_dc_safe (std::string data_center)=0 |
Query the catalog for the services in a particular datacenter. More... | |
virtual std::string | nodes_service (std::string service)=0 |
Query the catalog for the nodes running a particular service. More... | |
virtual AOSSL::StringBuffer * | nodes_service_safe (std::string service)=0 |
Query the catalog for the nodes running a particular service. More... | |
virtual std::string | services_node (std::string node, std::string data_center)=0 |
Query the catalog for the services provided by a particular node. More... | |
virtual AOSSL::StringBuffer * | services_node_safe (std::string node, std::string data_center)=0 |
Query the catalog for the services provided by a particular node. More... | |
The Consul Administrator, who handles configuration & service discovery.
This relies on the HTTP Administrator, and takes in a Service object in order to register. It's responses are JSON strings that are recieved from Consul. Note that the values returned from the Key-Value store will be stored in base64 format
|
pure virtual |
Query the local agent for it's info.
|
pure virtual |
Convinience Method for base64 decoding.
encoded_string | The string to decode |
|
pure virtual |
Convinience Method for base64 decoding.
This is needed as all configuration values are returned from Consul in base64, and need to be decoded after the json is parsed.
encoded_string | The string to decode |
|
pure virtual |
Query the catalog for datacenters.
|
pure virtual |
Deregister the Service.
s | The Service Interface to send to the Consul Agent |
|
pure virtual |
Get a configuration value.
key | A string key that will be retrieved from the KV Store |
|
pure virtual |
Get a configuration value.
key | A string key that will be retrieved from the KV Store |
|
pure virtual |
Query for healthy services only.
|
pure virtual |
Query the catalog for the nodes in a particular datacenter.
data_center | The string identifier for the data center to query |
|
pure virtual |
Query the catalog for the nodes in a particular datacenter.
data_center | The string identifier for the data center to query |
|
pure virtual |
Query the catalog for the nodes running a particular service.
service | The string identifier for the service to query |
|
pure virtual |
Query the catalog for the nodes running a particular service.
service | The string identifier for the service to query |
|
pure virtual |
Register the Service.
s | The Service Interface to send to the Consul Agent |
|
pure virtual |
Query the local agent for services registered.
|
pure virtual |
Query the catalog for the services in a particular datacenter.
data_center | The string identifier for the data center to query |
|
pure virtual |
Query the catalog for the services in a particular datacenter.
data_center | The string identifier for the data center to query |
|
pure virtual |
Query the catalog for the services provided by a particular node.
|
pure virtual |
Query the catalog for the services provided by a particular node.
node | The string identifier for the node to query |
data_center | The string id for the data center which holds the node |
|
pure virtual |
Set a configuration value.
If the key does not exist, then this will add it. Otherwise, it will update the existing key.
key | A string key that will be created/updated in the KV Store |
val | A string value that will be stored in the KV Store |