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

Overview

This interface layer handles communication between OSM's RO and its clients.

Usage

Provides

To implement this relation to offer an ro:

In your charm's metadata.yaml:

provides:
    ro:
        interface: osm-ro

reactive/myro.py:

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

Requires

If you would like to use a rodb from your charm:

metadata.yaml:

requires:
    ro:
        interface: osm-ro

reactive/mycharm.py:

@when('ro.ready')
def ro_ready():
    ro = endpoint_from_flag('ro.ready')
    if ro:
        for unit in ro.ros():
            add_ro(unit['host'], unit['port'])