Hetzner Cloud Integration with Frappe, also showcasing Virtual DocTypes

@buildwithhussain just finished a wonderful livestream showcasing how easy it is to integrate with a providers’ API, named:
# E24: Hetzner Cloud Integration with Virtual DocTypes, Automate your DevOps!
Find it here:

You’ll see step by step how to:

  • create a relevant doctype
  • get the connection started
  • put the API key at a place from where you won’t accidentally push it to a (public?) repo when pushing your app code
  • interact with the API
  • build the link between API-Access and the UI being built on frappe
  • debug and refactor the integration
  • put a finishing functional UI touch on it.

I enjoyed the stream a lot, it’s a timely gift that will help me to better interact with servers managed for myself and at work.
It’s just a first step for connecting with the server for now and turning it on and off an rebooting it – which is real and useful functionality! – , but having seen it, many further steps seem rather straightforward.
It seems to be a first of a series, and it’s easy to imagine much more functionality.

It’s built using a python lib from the provider which you can simply import in any python script.

A big thank you, Hussain!

BTW, for those who saw the video:
You can explore the lib like this, in order to get an overview of the available functionality and to match it (in your brain) with the documentation of the API at the provider’s site, e.g. for exploring and further building:

$ sudo pip install hcloud
$ python
Python 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import hcloud
>>> dir(hcloud)
['APIException', 'Client', 'HCloudException', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', '__version__', '_client', '_exceptions', 'actions', 'annotations', 'certificates', 'core', 'datacenters', 'deprecation', 'firewalls', 'floating_ips', 'images', 'isos', 'load_balancer_types', 'load_balancers', 'locations', 'networks', 'placement_groups', 'primary_ips', 'server_types', 'servers', 'ssh_keys', 'volumes']
>>> print('\n'.join(dir(hcloud)))
APIException
Client
HCloudException
__builtins__
__cached__
__doc__
__file__
__loader__
__name__
__package__
__path__
__spec__
__version__
_client
_exceptions
actions
annotations
certificates
core
datacenters
deprecation
firewalls
floating_ips
images
isos
load_balancer_types
load_balancers
locations
networks
placement_groups
primary_ips
server_types
servers
ssh_keys
volumes

>>> print('\n'.join(dir(hcloud.servers)))
[...]
>>> print('\n'.join(dir(hcloud.servers.Server)))
[...]

Have fun building and automating with frappe!

Ah, and lest I forget: He also showcases using virtual doctypes creating one of these which directly interacts with the data via the API. So far only for listing and getting one doc, which is the base for anything else.
This could be handy in many other cases.

2 Likes

Enjoy the second part planned for today:

E25: Hetzner Cloud Integration with Virtual DocTypes, Part 2

5th Dec, 2023|06:00PM IST
Direct link: https://youtube.com/live/W1kN9ysePGw?feature=share

as announced here: https://buildwithhussain.dev/

In Germany and western chunks of EU the start is at 1.30 pm = 13.30 Uhr