tree: a5907640dc7d26c3bd5b7fff370253f50cdac398 [path history] [tgz]
  1. README.md
  2. copyright
  3. interface.yaml
  4. provides.py
  5. requires.py
installers/charm/interfaces/osm-nbi/README.md

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'])