105
105
Because of the way in which settings state is presented through the
106
106
command line utilities within hooks clients are provided a string
107
107
token through a calling environmental variable,
108
*ENSEMBLE_CLIENT_ID*. Using this variable all command line tools will
108
*JUJU_CLIENT_ID*. Using this variable all command line tools will
109
109
connect with a shared common state when used from a single hook
174
174
* **list_relations(client_id)** - Returns a list of all relations
175
175
associated with a hook at the time of invocation. The values
176
176
of this call will typically also be exposed as a environment
177
variable, **ENSEMBLE_MEMBERS**.
177
variable, **JUJU_MEMBERS**.
179
179
* **flush(client_id)** - reserved
259
259
Hooks can expect to be invoked with a standard environment and
260
260
context. The following be included:
262
* `$ENSEMBLE_SOCKET` - Path to a UNIX Domain socket which will be
262
* `$JUJU_SOCKET` - Path to a UNIX Domain socket which will be
263
263
made available to the command line tools in order to communicate
266
* `$ENSEMBLE_CLIENT_ID` - A unique identifier passed to a hook
266
* `$JUJU_CLIENT_ID` - A unique identifier passed to a hook
267
267
invocation used to populate the --client_id flag to cli
268
268
tools. This is describe in the section, `Client Id`_.
270
* `$ENSEMBLE_LOCAL_UNIT` - The unit name of the unit this hook is
270
* `$JUJU_LOCAL_UNIT` - The unit name of the unit this hook is
271
271
being invoked in. (ex: myblog/0)
273
* `$ENSEMBLE_SERVICE` - The name of the service for which this hook
273
* `$JUJU_SERVICE` - The name of the service for which this hook
274
274
is running. (ex: myblog)
276
* `$ENSEMBLE_FORMULA` - The name of the forumla which deployed the
276
* `$JUJU_CHARM` - The name of the charm which deployed the
277
277
unit the hook is running in. (ex: wordpress)
280
280
Hooks called for relationships will have the follow additional
281
281
environment variables available to them.
283
* `$ENSEMBLE_MEMBERS` - A space-delimited list of qualified
283
* `$JUJU_MEMBERS` - A space-delimited list of qualified
284
284
relationship ids uniquely specifying all the UAs participating in
285
285
a given relationship. (ex. "wordpress/1 worpress/2")
287
* `$ENSEMBLE_RELATION` - The relation name this hook is running
287
* `$JUJU_RELATION` - The relation name this hook is running
288
288
for. It's redundant with the hook name, but is necessary for
289
289
the command line tools to know the current context.
291
* `$ENSEMBLE_REMOTE_UNIT` - The unit name of the remote unit
291
* `$JUJU_REMOTE_UNIT` - The unit name of the remote unit
292
292
which has triggered the hook execution.