Overview

This interface layer handles communication between Mongodb and its clients.

Usage

Provides

To implement this relation to offer an nbi:

In your charm's metadata.yaml:

provides:
    nbi:
        interface: osm-nbi

reactive/mynbi.py:

@when('nbi.joined')
def send_config(nbi):
    nbi.send_connection(
        unit_get('private-address'),
        get_nbi_port()
    )

Requires

If you would like to use an nbi from your charm:

metadata.yaml:

requires:
    nbi:
        interface: osm-nbi

reactive/mycharm.py:

@when('nbi.ready')
def nbi_ready():
    nbi = endpoint_from_flag('nbi.ready')
    if nbi:
        for unit in nbi.nbis():
            add_nbi(unit['host'], unit['port'])