org.jclouds.digitalocean.features
Interface DropletApi

All Superinterfaces:
Closeable

public interface DropletApi
extends Closeable

Provides access to the Droplet management features.

Author:
Sergi Castro, Ignasi Barrera

Method Summary
 DropletCreation create(String name, int imageId, int sizeId, int regionId)
          Creates a new droplet.
 DropletCreation create(String name, int imageId, int sizeId, int regionId, CreateDropletOptions options)
          Creates a new droplet.
 int destroy(int id)
          Destroys the given droplet.
 int destroy(int id, boolean scrubData)
          Destroys the given droplet.
 Droplet get(int id)
          Gets the details of the given droplet.
 List<Droplet> list()
          Lists all existing droplets.
 int powerCycle(int id)
          Power cycles the given droplet.
 int powerOff(int id)
          Powers off the given droplet.
 int powerOn(int id)
          Powers on the given droplet.
 int reboot(int id)
          Reboots the given droplet.
 int rebuild(int id, int imageId)
          Rebuilds a droplet with a default image.
 int rename(int id, String name)
          Renames a droplet to the specified name.
 int resetPassword(int id)
          Resets the password for the given droplet.
 int resize(int id, int sizeId)
          Changes the size for the given droplet.
 int restore(int id, int imageId)
          Restores a droplet with a previous image or snapshot.
 int shutdown(int id)
          Shuts down the given droplet.
 int snapshot(int id)
          Takes a snapshot of the droplet once it has been powered off.
 int snapshot(int id, String name)
          Takes a snapshot of the droplet once it has been powered off.
 
Methods inherited from interface java.io.Closeable
close
 

Method Detail

list

List<Droplet> list()
Lists all existing droplets.

Returns:
The list of all existing droplets.

get

Droplet get(int id)
Gets the details of the given droplet.

Parameters:
id - The id of the droplet to get.
Returns:
The details of the droplet or null if no droplet exists with the given id.

create

DropletCreation create(String name,
                       int imageId,
                       int sizeId,
                       int regionId)
Creates a new droplet.

Parameters:
name - The name for the new droplet.
imageId - The id of the image to use to create the droplet.
sizeId - The size to use to create the droplet.
regionId - The region where the droplet must be created.
Returns:
The created droplet.

create

DropletCreation create(String name,
                       int imageId,
                       int sizeId,
                       int regionId,
                       CreateDropletOptions options)
Creates a new droplet.

Parameters:
name - The name for the new droplet.
imageId - The id of the image to use to create the droplet.
sizeId - The size to use to create the droplet.
regionId - The region where the droplet must be created.
options - Custom options to create the droplet.
Returns:
The created droplet.

reboot

int reboot(int id)
Reboots the given droplet.

Parameters:
id - The id of the droplet to reboot.
Returns:
The id of the event to track the reboot process.

powerCycle

int powerCycle(int id)
Power cycles the given droplet.

Parameters:
id - The id of the droplet to power cycle.
Returns:
The id of the event to track the power cycle process.

shutdown

int shutdown(int id)
Shuts down the given droplet.

Parameters:
id - The id of the droplet to shutdown.
Returns:
The id of the event to track the shutdown process.

powerOff

int powerOff(int id)
Powers off the given droplet.

Parameters:
id - The id of the droplet to power off.
Returns:
The id of the event to track the power off process.

powerOn

int powerOn(int id)
Powers on the given droplet.

Parameters:
id - The id of the droplet to power on.
Returns:
The id of the event to track the power on process.

resetPassword

int resetPassword(int id)
Resets the password for the given droplet.

Parameters:
id - The id of the droplet to reset the password to.
Returns:
The id of the event to track the password reset process.

resize

int resize(int id,
           int sizeId)
Changes the size for the given droplet.

Parameters:
id - The id of the droplet to change the size to.
sizeId - The id of the new size for the droplet.
Returns:
The id of the event to track the resize process.

snapshot

int snapshot(int id)
Takes a snapshot of the droplet once it has been powered off.

Parameters:
id - The id of the droplet to take the snapshot of.
Returns:
The id of the event to track the snapshot process.

snapshot

int snapshot(int id,
             String name)
Takes a snapshot of the droplet once it has been powered off.

Parameters:
id - The id of the droplet to take the snapshot of.
name - The name for the snapshot.
Returns:
The id of the event to track the snapshot process.

restore

int restore(int id,
            int imageId)
Restores a droplet with a previous image or snapshot.

This will be a mirror copy of the image or snapshot to your droplet. Be sure you have backed up any necessary information prior to restore.

Parameters:
id - The id of the droplet to restore.
imageId - The id of the image or snapshot to use to restore the droplet.
Returns:
The id of the event to track the restore process.

rebuild

int rebuild(int id,
            int imageId)
Rebuilds a droplet with a default image.

This is useful if you want to start again but retain the same IP address for your droplet.

Parameters:
id - The id of the droplet to rebuild.
imageId - The id of the image or snapshot to use to restore the droplet.
Returns:
The id of the event to track the restore process.

rename

int rename(int id,
           String name)
Renames a droplet to the specified name.

Parameters:
id - The id of the droplet to rename.
name - The new name for the droplet.
Returns:
The id of the event to track the rename process.

destroy

int destroy(int id)
Destroys the given droplet.

Parameters:
id - The id of the droplet to destroy.
Returns:
The id of the event to track the destroy process.

destroy

int destroy(int id,
            boolean scrubData)
Destroys the given droplet.

Parameters:
id - The id of the droplet to destroy.
scrubData - If true this will strictly write 0s to your prior partition to ensure that all data is completely erased.
Returns:
The id of the event to track the destroy process.


Copyright © 2009-2014 The Apache Software Foundation. All Rights Reserved.