Interface DigitalOcean

All Known Implementing Classes:
DigitalOceanClient

public interface DigitalOcean
DigitalOcean API client in Java

A simple and meaningful java methods for DigitalOcean's API. All of the RESTful that you find in DigitalOcean API's Version 2 is available via simple java methods.

Sample Code:

 // Create a DigitalOcean client
 DigitalOcean apiClient = new DigitalOceanClient(authToken);
 or
 DigitalOcean apiClient = new DigitalOceanClient("v2", authToken);

 Let's invoke the appropriate method as per need

 // Fetching all the available droplets from control panel
 Droplets droplets = apiClient.getAvailableDroplets(pageNo);

 // Fetching all the available kernels for droplet
 Kernels kernels = apiClient.getAvailableKernels(dropletId, pageNo);

 // Create a new droplet
 Droplet newDroplet = new Droplet();
 newDroplet.setName("api-client-test-host");
 newDroplet.setSize(new Size("512mb")); // setting size by slug value
 newDroplet.setRegion(new Region("sgp1")); // setting region by slug value; sgp1 => Singapore 1 Data center
 newDroplet.setImage(new Image(1601)); // setting by Image Id 1601 => centos-5-8-x64 also available in image slug value
 newDroplet.setEnableBackup(Boolean.TRUE);
 newDroplet.setEnableIpv6(Boolean.TRUE);
 newDroplet.setEnablePrivateNetworking(Boolean.TRUE);
 Droplet droplet = apiClient.createDroplet(newDroplet);

 // Fetch droplet information
 Droplet droplet = apiClient.getDropletInfo(dropletId);

 // Fetch Available Plans/Sizes supported by DigitalOcean
 Sizes sizes = apiClient.getAvailableSizes(pageNo);

 // Fetch Available Regions supported by DigitalOcean
 Sizes sizes = apiClient.getAvailableRegions(pageNo);

 and so on... simple to use and effective!
 
Since:
v1.0
Author:
Jeevanandam M. (jeeva@myjeeva.com)