This is a wrapper for the Digitalocean API (Issues / Changelog)
<?php
require 'vendor/autoload.php';
use NickNickIO\Digitalocean\Digitalocean;
$digitalocean = new Digitalocean('your_access_token');
// Return an account object
$account = $digitalocean->account->get();
// Return the customer balance
$balance = $digitalocean->balance->customer();
// Return a collection of Action objects
$actions = $digitalocean->action->all();
// Return an Action object.
$action = $digitalocean->action->get(123);
// Return a collection of Domain objects
$domains = $digitalocean->domain->all();
// Return a Domain object
$domain = $digitalocean->domain->get('foo.dk');
// Return the created domain called bar.dk
$domain = $digitalocean->domain->create('bar.dk');
// Delete the domain called baz.dk
$digitalocean->domain->delete('baz.dk');
// Return a collection DomainRecord objects
$records = $digitalocean->domainRecord->all();
// Return a DomainRecord object
$record = $digitalocean->domainRecord->get('baz.dk', 123);
// Return a collection of Droplet objects
$droplets = $digitalocean->droplet->all();
// Return a Droplet object
$droplet = $digitalocean->droplet->get(123);
// Return the created droplet
$droplet = $digitalocean->droplet->create([
'name' => 'test-droplet',
'image' => 31650475,
'region' => 'fra1',
'size' => 's-1vcpu-1gb'
]);
// Delete a droplet
$digitalocean->droplet->delete(123);
// List all firewalls
$firewalls = $digitalocean->firewall->all();