Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

118 Commits

Repository files navigation

Python API for the Hetzner Robot

API usage

This is a small example session to illustrate how to use the API:

>>>fromhetzner.robotimportRobot>>>robot=Robot("username", "password")
>>>list(robot.servers)
[<Server1>, <Server2>, <Server3>, <Server4>]
>>>server=robot.servers.get("1.2.3.4")
>>>server.statusu'ready'>>>server.nameu'shiny server'>>>server.reboot(mode='hard')
<httplib.HTTPResponseinstanceat0x90d5a8>>>>list(server.ips)
[<IpAddress1.2.3.4>]
>>>server.set_name("foobar")
>>>server.nameu'foobar'>>>>>>server.rescue.shell()
Linuxrescue3.10.25#128 SMP Tue Jan 7 10:58:27 CET 2014 x86_64-------------------------------------------------------------------WelcometotheHetznerRescueSystem.
ThisRescueSystemisbasedonDebian7.0 (wheezy) withanewerkernel. Youcaninstallsoftwareasinanormalsystem.
Toinstallanewoperatingsystemfromoneofourprebuiltimages, run'installimage'andfollowtheinstructions.
Moreinformationathttp://wiki.hetzner.de-------------------------------------------------------------------Hardwaredata:
...
Networkdata:
...
root@rescue~# logout>>>server.rescue.activeFalse>>>

Commandline helper tool

There is also a small commandline helper tool called hetznerctl, which exposes most of the API functionality in a CLI similar to popular SCMs like Git or SVN.

In order to show the available commands type hetznerctl --help. Every subcommand has its own help, like for example hetznerctl rescue --help.

About

A high-level Python API for accessing the Hetzner robot.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages