AOSharedServiceLibrary
|
The Consul Administrator, who handles configuration & service discovery. More...
#include <consul_interface.h>
Public Member Functions | |
virtual void | base64_decode_by_reference (std::string const &encoded_string, StringBuffer &ret_buffer)=0 |
Convinience Method for base64 decoding. More... | |
virtual 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 bool | del_config_value (std::string key)=0 |
Delete a configuration value. | |
virtual AOSSL::StringBuffer * | services ()=0 |
Query the local agent for services registered. More... | |
virtual AOSSL::StringBuffer * | agent_info ()=0 |
Query the local agent for it's info. | |
virtual AOSSL::StringBuffer * | healthy_services ()=0 |
Query for healthy services only. | |
virtual AOSSL::StringBuffer * | datacenters ()=0 |
Query the catalog for datacenters. | |
virtual AOSSL::StringBuffer * | nodes_dc (std::string data_center)=0 |
Query the catalog for the nodes in a particular datacenter. More... | |
virtual AOSSL::StringBuffer * | services_dc (std::string data_center)=0 |
Query the catalog for the services in a particular datacenter. More... | |
virtual AOSSL::StringBuffer * | nodes_service (std::string service)=0 |
Query the catalog for the nodes running a particular service. More... | |
virtual AOSSL::StringBuffer * | services_node (std::string node, std::string data_center)=0 |
Query the catalog for the services provided by a particular node. More... | |
virtual void | add_acl_token (std::string &token)=0 |
Add an ACL Token to the Consul Admin. | |
Public Member Functions inherited from AOSSL::KeyValueStoreInterface | |
virtual bool | opt_exist (std::string key)=0 |
Does a key exist? | |
virtual StringBuffer * | get_opt (std::string key)=0 |
Get an option by key. | |
virtual void | get_opt (std::string key, StringBuffer &val)=0 |
Get an option by key. | |
virtual void | load_config ()=0 |
Re-load configuration. | |
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 |
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 |
ret_buffer | A String buffer in which to populate the response |
Implemented in AOSSL::ConsulAdmin.
|
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 |
Implemented in AOSSL::ConsulAdmin.
|
pure virtual |
Deregister the Service.
s | The Service Interface to send to the Consul Agent |
Implemented in AOSSL::ConsulAdmin.
|
pure virtual |
Query the catalog for the nodes in a particular datacenter.
data_center | The string identifier for the data center to query |
Implemented in AOSSL::ConsulAdmin.
|
pure virtual |
Query the catalog for the nodes running a particular service.
service | The string identifier for the service to query |
Implemented in AOSSL::ConsulAdmin.
|
pure virtual |
Register the Service.
s | The Service Interface to send to the Consul Agent |
Implemented in AOSSL::ConsulAdmin.
|
pure virtual |
Query the local agent for services registered.
Query the local agent for services registered
Implemented in AOSSL::ConsulAdmin.
|
pure virtual |
Query the catalog for the services in a particular datacenter.
data_center | The string identifier for the data center to query |
Implemented in AOSSL::ConsulAdmin.
|
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 |
Implemented in AOSSL::ConsulAdmin.
|
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 |
Implemented in AOSSL::ConsulAdmin.