Skip to content
This repository has been archived by the owner on Oct 9, 2018. It is now read-only.

betacloud-archive/python-hetzner-failover

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Script to work with Hetzner failover IP addresses

Requirements

Implemented commands

list

$ python src/hetzner-failover.py --config-file hetzner-failover.conf list
+------------------+---------+-----------------+---------------+-----------+
| active_server_ip | ip      | netmask         | server_number | server_ip |
+==================+=========+=================+===============+===========+
| a.b.c.d          | e.f.g.h | 255.255.255.255 |        123456 | a.b.c.d   |
| ...              | ...     | ...             |           ... | ...       |
| ...              | ...     | ...             |           ... | ...       |
+------------------+---------+-----------------+---------------+-----------+

show

$ python src/hetzner-failover.py --config-file hetzner-failover.conf show e.f.g.h
+------------------+---------+-----------------+---------------+-----------+
| active_server_ip | ip      | netmask         | server_number | server_ip |
+==================+=========+=================+===============+===========+
| a.b.c.d          | e.f.g.h | 255.255.255.255 |        123456 | a.b.c.d   |
+------------------+---------+-----------------+---------------+-----------+

route

$ python src/hetzner-failover.py --config-file hetzner-failover.conf route e.f.g.h i.j.k.l
elapsed time for failover: 28.0130250454 seconds
+------------------+---------+-----------------+---------------+-----------+
| active_server_ip | ip      | netmask         | server_number | server_ip |
+==================+=========+=================+===============+===========+
| i.j.k.l          | e.f.g.h | 255.255.255.255 |        123456 | a.b.c.d   |
+------------------+---------+-----------------+---------------+-----------+

API Rate Limits

Hetzner robot webservice is rate limited.

  • 100 queries per 1 hour window for GET /failover (list command)
  • 100 queries per 1 hour window for GET /failover/<failover-address> (show command)
  • 50 queries per 1 hour window for POST /failover/<failover-address> (route command)

Documentation

Development

$ virtualenv .venv
$ source .venv/bin/activate
$ pip install -r requirements.txt

About

Script to work with Hetzner failover IP addresses.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages