Git Product home page Git Product logo

hetzner's Introduction

Python API for the Hetzner Robot

API usage

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

>>> from hetzner.robot import Robot
>>> robot = Robot("username", "password")
>>> list(robot.servers)
[<Server1>, <Server2>, <Server3>, <Server4>]
>>> server = robot.servers.get("1.2.3.4")
>>> server.status
u'ready'
>>> server.name
u'shiny server'
>>> server.reboot(mode='hard')
<httplib.HTTPResponse instance at 0x90d5a8>
>>> list(server.ips)
[<IpAddress 1.2.3.4>]
>>> server.set_name("foobar")
>>> server.name
u'foobar'
>>>
>>> server.rescue.shell()
Linux rescue 3.10.25 #128 SMP Tue Jan 7 10:58:27 CET 2014 x86_64

-------------------------------------------------------------------

  Welcome to the Hetzner Rescue System.

  This Rescue System is based on Debian 7.0 (wheezy) with a newer
  kernel. You can install software as in a normal system.

  To install a new operating system from one of our prebuilt
  images, run 'installimage' and follow the instructions.

  More information at http://wiki.hetzner.de

-------------------------------------------------------------------

Hardware data:
   ...

Network data:
   ...

root@rescue ~ # logout
>>> server.rescue.active
False
>>>

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.

hetzner's People

Contributors

aszlig avatar basvandijk avatar dangra avatar haron avatar nh2 avatar pk-lms-dev avatar rbvermaa avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.