What juju charm hooks are available and what does each one do?
Solution 1:
The documentation for all available hooks is available here:
- https://jujucharms.com/docs/stable/authors-charm-hooks
The basic lifecycle (install, start, stop) and relation hooks are documented under charms. Relation hooks are defined for every relation a charm defines in its metadata.
Beyond those there are two other hooks of interest, the 'upgrade-charm' hook, which is called when a service's charm is upgraded for each of its service units.
The other is the 'config-changed' hook, called when a charm which defines a service configuration schema has its configuration changed, since services can be deployed with configuration data, the config-changed hook is also invoked upon the initial deploy of a unit prior to starting it.
all hooks are optional.