Consul Interface for Juju Charms
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Consul interface

This interface has been designed as a drop in interface for clients wishing to connect to the existing consul-charm in the juju charm store.



When this state is raised, the unit has connected but might not have transmitted the information we need in order to complete our connection. Defer until 'available' has been raised.


This state is set when the unit has presented all the required information:

  • Address
  • Port

Example Code:

def configure_consul(consul):
   connection_string = "consul://"
   for unit in consul.list_unit_data():
     host_string = "{}:{}".format(unit['address'], unit['port'])
     connection_string = "{}{},".format(connection_string, host_string)