minicodemonkey/hetzner-robot

There is no license information available for the latest version (1.0.3) of this package.

API Client for the Hetzner Robot API

1.0.3 2017-11-22 03:04 UTC

This package is auto-updated.

Last update: 2020-07-27 22:33:01 UTC


README

Note: This is just a copy of the Hetzner API client, that has been namespaced and composer/packagist support added. The source code can be found here: https://robot.your-server.de/downloads/robot-client.zip

Usage

use Hetzner\Robot\Client;

$robot = new Client('https://robot-ws.your-server.de', 'login', 'password');

// retrieve all failover ips
$results = $robot->failoverGet();

foreach ($results as $result)
{
  echo $result->failover->ip . "\n";
  echo $result->failover->server_ip . "\n";
  echo $result->failover->active_server_ip . "\n";
}

// retrieve a specific failover ip
$result = $robot->failoverGet('123.123.123.123');

echo $result->failover->ip . "\n";
echo $result->failover->server_ip . "\n";
echo $result->failover->active_server_ip . "\n";

// switch routing
try
{
  $robot->failoverRoute('123.123.123.123', '213.133.104.190');
}
catch (RobotClientException $e)
{
  echo $e->getMessage() . "\n";
}

Full API documentation is available here: https://robot.your-server.de/doc/webservice/en.html