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>>>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.