We ended our last blog post with a teaser on how to automatically import Studio built images into your SUSE Cloud or OpenStack installation. Here we’ll explain step by step how this can be done with Studio’s WebHooks feature.
Do note that while this post and the referenced code is targeted for SUSE Cloud / OpenStack, it can easily be adapted to handle other image types and use cases.
WHAT ARE WEBHOOKS?
The WebHooks push notification feature was implemented and released by our awesome intern, Nick Lee, earlier this year. Quick recall on WebHooks — these are simple HTTP callbacks, often used for push notifications in application integration. It makes it easy for your application or environment to react immediately to events in Studio, without having to aggressively poll for changes.
These reactions can be post-processing, such as converting the image format, performing additional configuration changes, or consumption like importing it into your deployment or test systems.
SETTING IT UP
The WebHooks feature in Studio is pretty well-documented, including code samples on how to write the receiver. To make it even easier for production use, we’ve opensourced a reference implementation that includes proper logging and detailed documentation. Code contributions are very welcomed!
Once you have the WebHooks receiver running, you need to point Studio to it via http://susestudio.com/user/account#/api-hooks (replace susestudio.com with your Onsite hostname if you’re using Studio Onsite). You’ll need to login if you haven’t already done so. Now your all your SUSE Cloud builds in Studio will be automatically and immediately imported into your SUSE Cloud instance!
Do try it out and let us know if you have any problems, or suggestions for improvements. The reference implementation is MIT licensed, so feel free to use and modify it as you like. Pull requests and additions for other image type handlers are very much appreciated!
Update: This is the last blog post in the SUSE Cloud series. The previous two blog posts in this series are: