minicodemonkey / hetzner-robot
API Client for the Hetzner Robot API
Installs: 6 851
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 4
Forks: 2
Open Issues: 0
Requires
- php: >=5.4.0
- ext-curl: *
- ext-json: *
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