interface layer test #0

Supports: bionic

Description

Dumps info from relations (via interface layers) via update_status. This example uses interface:elasticsearch; replace the required interface here and update reactive/layer_test.py


Overview

This charm exposes the values exposed via an interface layer for quick debugging purposes.

This particular implementation uses the interfaces:elasticsearch interface layer.

Usage

To deploy this version, do the following:

juju deploy cs:elasticsearch
juju deploy cs:~vultaire/interface-layer-test
juju add-relation elasticsearch interface-layer-test

Once the model has settled, you should see a status message for the interface-layer-test unit which looks like this:

[{'cluster_name': None, 'host': '10.1.2.3', 'port': '9200'}]

Customizing

If you wish to build this charm against a custom version of the interfaces:elasticsearch interface, place the customized version of the interface in your $INTERFACE_PATH directory. If you're not familiar with $INTERFACE_PATH, please see this page for setting up your environment appropriately: https://discourse.jujucharms.com/t/writing-a-layer-by-example/1120#heading--prepare-your-workspace

If you wish to use this charm against a different interface, it's not particularly difficult:

  1. Update layer.yaml to include the correct interface layer.
  2. Update metadata.yaml to require the correct interface.
  3. Update reactive/interface_layer_test.py to work with the interface in question. The specific flags to trigger on or functions to call will depend upon the interface being tested; you will need to review the interface's requires.py and see what flags it sets and what functions it provides.

Once completed, build the charm via charm build and do a juju deploy <path/to/built/charm> to deploy your locally-built charm.

License

This charm is licensed under the GNU General Public License version 3; see COPYING for details.