Peer discovery charm for juju
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.


This interface is practically only a placeholder peer interface which provides no special functionality, except access to the 'private-address' field of all peers which is provided by juju implicitly.



By using the peer-discovery interface on a peer type relation, you will get notified when peers join or leave.

@when('relation-name.joined ')
def connected(peers):
    hosts = peers.units()
    if data_changed('my-peers', hosts):

The interface sets those states for you:

  • *.connected
  • *.joined
  • *.departed

connected is set while at least one peer is connected.

joined and departed states will clear at the end of the hook invocation. They behave more like events than states.

The units() method only works inside of the relation hook which triggered the handler.