Hook

In Juju, a hook is a Juju event that a Juju unit agent uses to communicate with a charm.

In the charm SDK, in Ops, Juju events = ‘hooks’ are translated into Ops events = ‘events’, specifically, into classes that inherit from HookEvent.

Contents:

List of hooks

Source

  • <action name>-action
  • <container name>-pebble-change-updated
  • <container name>-pebble-custom-notice
  • <container name>-pebble-ready
  • <endpoint name>-relation-broken
  • <endpoint name>-relation-changed
  • <endpoint name>-relation-created
  • <endpoint name>-relation-departed
  • <endpoint name>-relation-joined
  • <storage name>-storage-attached
  • <storage name>-storage-detaching
  • collect-metrics
  • config-changed
  • install
  • leader-deposed
  • leader-elected
  • leader-settings-changed
  • meter-status-changed
  • post-series-upgrade
  • pre-series-upgrade
  • remove
  • secret-changed

Triggered by Juju on a secret’s observer when the secret’s owner changes the secret’s contents.

  • secret-expired

Currently supported only for charm secrets.

Triggered by Juju on a secret’s owner when a secret’s expiration time elapses.

  • secret-remove

Currently supported only for charm secrets.

Triggered by Juju on a secret’s owner when one of the secret’s revisions can be removed.

  • secret-rotate

Currently supported only for charm secrets.

Triggered by Juju on a secret’s owner when the secret’s rotation policy elapses .

  • start
  • stop
  • update-status
  • upgrade-charm

Contributors: @anvial, @hmlanigan, @ppasotti , @simonrichardson, @tmihoc

Last updated 20 days ago. Help improve this document in the forum.