ops.main entry point¶
The main entry point to initialise and run your charm.
- ops.main( )¶
Set up the charm and dispatch the observed event.
Recommended usage:
import ops class SomeCharm(ops.CharmBase): ... if __name__ == "__main__": ops.main(SomeCharm)
- Parameters:
charm_class – the charm class to instantiate and receive the event.
use_juju_for_storage – whether to use controller-side storage. The default is
False
for most charms. Podspec charms that haven’t previously used local storage and that are running on a new enough Juju default to controller-side storage, and local storage otherwise.
legacy main module¶
Support legacy ops.main.main() import.