Hook command 'relation-get'

The information in this doc is based on Juju version 3.5.6, and may not accurately reflect other versions of Juju.

Summary

Get relation settings.

Usage

relation-get [options] <key> <unit id>

Options

Flag Default Usage
--app false Get the relation data for the overall application, not just a unit
--format smart Specify output format (json|smart|yaml)
-o, --output Specify an output file
-r, --relation Specify a relation by id

Details

relation-get prints the value of a unit’s relation setting, specified by key. If no key is given, or if the key is “-”, all keys and values will be printed.

A unit can see its own settings by calling “relation-get - MYUNIT”, this will include any changes that have been made with “relation-set”.

When reading remote relation data, a charm can call relation-get --app - to get the data for the application data bag that is set by the remote applications leader.