Hook command 'relation-set'

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

Summary

Set relation settings.

Usage

relation-set [options] key=value [key=value ...]

Options

Flag Default Usage
--app false pick whether you are setting “application” settings or “unit” settings
--file file containing key-value pairs
--format deprecated format flag
-r, --relation specify a relation by id

Details

“relation-set” writes the local unit’s settings for some relation. If no relation is specified then the current relation is used. The setting values are not inspected and are stored as strings. Setting an empty string causes the setting to be removed. Duplicate settings are not allowed.

If the unit is the leader, it can set the application settings using “–app”. These are visible to related applications via ‘relation-get --app’ or by supplying the application name to ‘relation-get’ in place of a unit name.

The --file option should be used when one or more key-value pairs are too long to fit within the command length limit of the shell or operating system. The file will contain a YAML map containing the settings. Settings in the file will be overridden by any duplicate key-value arguments. A value of “-” for the filename means <stdin>.