`jhack fire` support for pebble custom notices

Hi there! Had a couple of spare minutes last Friday, so I added support for pebble notices to jhack fire.

Get it from the Snap Store

If you grab the latest/edge snap you should be able to:

jhack fire myapp/0 container-pebble-custom-notice

As you may know, a charm can define multiple custom notices, and the event name alone is therefore not always enough to determine which one to trigger.

Therefore, if your container has a single custom notice, that one will be selected automatically, but in the general case where you have more notices, you’ll have to pass a --notice-id=<some-integer> arg to jhack fire so we know what notice you intend to trigger.

Have no idea what ID your notices have? Fear not:

$ jhack fire tempo/0 tempo-pebble-custom-notice    
existing notices for tempo/0:tempo                

ID:      name  
1:       canonical.com/tempo/workload-ready         
2:       canonical.com/tempo/some-other-notice         
[... any more notices that pebble is aware of will be listed here]
                                                           
select a notice ID to fire (or enter 'abort' to exit): 1     

and have the notice canonical.com/tempo/workload-ready fired on your charm.

image

The next time you invoke the command, you can pass --notice-id=1 to skip the interactive bit.

Have fun!

3 Likes