3 This is the base layer for all charms [built using layers][building]. It
4 provides all of the standard Juju hooks and runs the
5 [charms.reactive.main][charms.reactive] loop for them. It also bootstraps the
6 [charm-helpers][] and [charms.reactive][] libraries and all of their
7 dependencies for use by the charm.
11 To create a charm layer using this base layer, you need only include it in
15 includes: ['layer:basic']
18 This will fetch this layer from [interfaces.juju.solutions][] and incorporate
19 it into your charm layer. You can then add handlers under the `reactive/`
20 directory. Note that **any** file under `reactive/` will be expected to
21 contain handlers, whether as Python decorated functions or [executables][non-python]
22 using the [external handler protocol][].
24 You can also define Python libraries under `lib/charms/X` where `X` is a
25 package under the `charms.` namespace for your charm. See [PyPI][pypi charms.X]
26 for what packages already exist under the `charms.` namespace.
30 This layer provides hooks that other layers can react to using the decorators
31 of the [charms.reactive][] library:
36 * `leader-settings-changed`
42 Other hooks are not implemented at this time. A new layer can implement storage
43 or relation hooks in their own layer by putting them in the `hooks` directory.
45 **Note:** Because `update-status` is invoked every 5 minutes, you should take
46 care to ensure that your reactive handlers only invoke expensive operations
47 when absolutely necessary. It is recommended that you use helpers like
48 [`@only_once`][], [`@when_file_changed`][], and [`data_changed`][] to ensure
49 that handlers run only when necessary.
53 This layer does not currently support any configuration.
58 This layer currently does not set any reactive states.
63 This layer currently does not define any actions.
66 [building]: https://jujucharms.com/docs/devel/authors-charm-building
67 [charm-helpers]: https://pythonhosted.org/charmhelpers/
68 [charms.reactive]: https://pythonhosted.org/charms.reactive/
69 [interfaces.juju.solutions]: http://interfaces.juju.solutions/
70 [non-python]: https://pythonhosted.org/charms.reactive/#non-python-reactive-handlers
71 [external handler protocol]: https://pythonhosted.org/charms.reactive/charms.reactive.bus.html#charms.reactive.bus.ExternalHandler
72 [pypi charms.X]: https://pypi.python.org/pypi?%3Aaction=search&term=charms.&submit=search
73 [`@only_once`]: https://pythonhosted.org/charms.reactive/charms.reactive.decorators.html#charms.reactive.decorators.only_once
74 [`@when_file_changed`]: https://pythonhosted.org/charms.reactive/charms.reactive.decorators.html#charms.reactive.decorators.when_file_changed
75 [`data_changed`]: https://pythonhosted.org/charms.reactive/charms.reactive.helpers.html#charms.reactive.helpers.data_changed