|
DigitalOcean API Client in Java | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface DigitalOcean
DigitalOcean API client written in Java
A simple and meaningful wrapper methods for DigitalOcean's API. All of the RESTful that you find in DigitalOcean API's will be made available via simple java methods.
Sample Code:
// Create a DigitalOcean client
DigitalOcean apiClient = new DigitalOceanClient(clientId, apiKey);
// Let's invoke the appropriate method as per need
// Fetching all the available droplets from control panel
List<Droplet> droplets = apiClient.getAvailableDroplets();
// Create a new droplet
Droplet newDroplet = new Droplet();
newDroplet.setName("api-cliet-test-host");
newDroplet.setSizeId(66); // 66 => 512MB plan
newDroplet.setRegionId(3); // 3 => San Francisco 1 Data center
newDroplet.setImageId(473123); // 473123 => Ubuntu 12.10 x64 Image
Droplet droplet = apiClient.createDroplet(newDroplet);
// Fetch droplet information
Droplet droplet = apiClient.getDropletInfo(dropletId);
// Fetch Available Plans/Sizes supported by DigitalOcean
List<DropletSize> sizes = apiClient.getAvailableSizes();
and so on... simple to use and effective!
| Method Summary | |
|---|---|
SshKey |
addSshKey(String sshKeyName,
String sshPublicKey)
To be release in v1.2 |
Domain |
createDomain(String domainName,
String ipAddress)
To be release in v1.1 |
DomainRecord |
createDomainRecord(DomainRecord domainRecord)
To be release in v1.1 |
Droplet |
createDroplet(Droplet droplet)
Method allows you to create a new droplet. |
Droplet |
createDroplet(Droplet droplet,
String sshKeyIds)
Method allows you to create a new droplet. |
Domain |
deleteDomain(Integer domainId)
To be release in v1.1 |
Response |
deleteDomainRecord(Integer domainId,
Integer recordId)
To be release in v1.1 |
Response |
deleteDroplet(Integer dropletId)
Method destroys one of your droplets - this is irreversible. |
Response |
deleteImage(Integer imageId)
Method allows you to deletes an image. |
Response |
deleteSshKey(Integer sshKeyId)
To be release in v1.2 |
Response |
disableDropletBackups(Integer dropletId)
Method disables automatic backups from running to backup your droplet's data. |
DomainRecord |
editDomainRecord(DomainRecord domainRecord)
To be release in v1.1 |
SshKey |
editSshKey(Integer sshKeyId,
String sshPublicKey)
To be release in v1.2 |
Response |
enableDropletBackups(Integer dropletId)
Method enables automatic backups which run in the background daily to backup your droplet's data. |
List<Domain> |
getAvailableDomains()
To be release in v1.1 |
List<Droplet> |
getAvailableDroplets()
Method returns all active droplets that are currently running in your account. |
List<DropletImage> |
getAvailableImages()
Method returns all the available images that can be accessed by your client ID. |
List<Region> |
getAvailableRegions()
Method will return all the available regions within the DigitalOcean cloud. |
List<DropletSize> |
getAvailableSizes()
Method returns all the available sizes that can be used to create a droplet. |
List<SshKey> |
getAvailableSshKeys()
To be release in v1.2 |
Domain |
getDomainInfo(Integer domainId)
To be release in v1.1 |
DomainRecord |
getDomainRecord(Integer domainId,
Integer recordId)
To be release in v1.1 |
List<DomainRecord> |
getDomainRecords(Integer domainId)
To be release in v1.1 |
Droplet |
getDropletInfo(Integer dropletId)
Method returns full information for a specific droplet ID that is passed in the URL. |
DropletImage |
getImageInfo(Integer imageId)
Method retrieves the attributes of an image. |
SshKey |
getSshKeyInfo(Integer sshKeyId)
To be release in v1.2 |
Response |
powerCyleDroplet(Integer dropletId)
Method allows you to power cycle a droplet. |
Response |
powerOffDroplet(Integer dropletId)
Method allows you to poweroff a running droplet. |
Response |
powerOnDroplet(Integer dropletId)
Method allows you to poweron a powered off droplet. |
Response |
rebootDroplet(Integer dropletId)
Method allows you to reboot a droplet. |
Response |
rebuildDroplet(Integer dropletId,
Integer imageId)
Method allows you to reinstall a droplet with a default image. |
Response |
renameDroplet(Integer dropletId,
String name)
Method renames the droplet to the specified name. |
Response |
resetDropletPassword(Integer dropletId)
Method will reset the root password for a droplet. |
Response |
resizeDroplet(Integer dropletId,
Integer sizeId)
Method allows you to resize a specific droplet to a different size. |
Response |
restoreDroplet(Integer dropletId,
Integer imageId)
Method allows you to restore a droplet with a previous image or snapshot. |
Response |
shutdownDroplet(Integer dropletId)
Method allows you to shutdown a running droplet. |
Response |
takeDropletSnapshot(Integer dropletId)
Method allows you to take a snapshot of the running droplet, which can later be restored or used to create a new droplet from the same image. |
Response |
takeDropletSnapshot(Integer dropletId,
String snapshotName)
Method allows you to take a snapshot of the running droplet, which can later be restored or used to create a new droplet from the same image. |
Response |
transerImage(Integer imageId,
Integer regionId)
Method allows you to transfer an image to a specified region. |
| Method Detail |
|---|
List<Droplet> getAvailableDroplets()
throws AccessDeniedException,
ResourceNotFoundException,
RequestUnsuccessfulException
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
Droplet createDroplet(Droplet droplet)
throws AccessDeniedException,
ResourceNotFoundException,
RequestUnsuccessfulException
Method allows you to create a new droplet. See the required parameters section below for an explanation of the variables that are needed to create a new droplet.
Create a instance of Droplet object and populate following values
droplet - a Droplet object
Droplet
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
Droplet createDroplet(Droplet droplet,
String sshKeyIds)
throws AccessDeniedException,
ResourceNotFoundException,
RequestUnsuccessfulException
Method allows you to create a new droplet. See the required parameters section below for an explanation of the variables that are needed to create a new droplet.
Create a instance of Droplet object and populate following values
droplet - a Droplet objectsshKeyIds - a String object - Numeric CSV, comma separated list of
ssh_key_ids that you would like to be added to the server
Droplet
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
Droplet getDropletInfo(Integer dropletId)
throws AccessDeniedException,
ResourceNotFoundException,
RequestUnsuccessfulException
dropletId - a Integer object
Droplet
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
Response rebootDroplet(Integer dropletId)
throws AccessDeniedException,
ResourceNotFoundException,
RequestUnsuccessfulException
dropletId - a Integer object
Response
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
Response powerCyleDroplet(Integer dropletId)
throws AccessDeniedException,
ResourceNotFoundException,
RequestUnsuccessfulException
dropletId - a Integer object
Response
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
Response shutdownDroplet(Integer dropletId)
throws AccessDeniedException,
ResourceNotFoundException,
RequestUnsuccessfulException
dropletId - a Integer object
Response
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
Response powerOffDroplet(Integer dropletId)
throws AccessDeniedException,
ResourceNotFoundException,
RequestUnsuccessfulException
dropletId - a Integer object
Response
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
Response powerOnDroplet(Integer dropletId)
throws AccessDeniedException,
ResourceNotFoundException,
RequestUnsuccessfulException
dropletId - a Integer object
Response
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
Response resetDropletPassword(Integer dropletId)
throws AccessDeniedException,
ResourceNotFoundException,
RequestUnsuccessfulException
dropletId - a Integer object
Response
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
Response resizeDroplet(Integer dropletId,
Integer sizeId)
throws AccessDeniedException,
ResourceNotFoundException,
RequestUnsuccessfulException
dropletId - a Integer object
Response
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
Response takeDropletSnapshot(Integer dropletId)
throws AccessDeniedException,
ResourceNotFoundException,
RequestUnsuccessfulException
dropletId - a Integer object
Response
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
Response takeDropletSnapshot(Integer dropletId,
String snapshotName)
throws AccessDeniedException,
ResourceNotFoundException,
RequestUnsuccessfulException
dropletId - a Integer objectsnapshotName - a String object
Response
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
Response restoreDroplet(Integer dropletId,
Integer imageId)
throws AccessDeniedException,
ResourceNotFoundException,
RequestUnsuccessfulException
dropletId - a Integer object
Response
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
Response rebuildDroplet(Integer dropletId,
Integer imageId)
throws AccessDeniedException,
ResourceNotFoundException,
RequestUnsuccessfulException
dropletId - a Integer object
Response
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
Response enableDropletBackups(Integer dropletId)
throws AccessDeniedException,
ResourceNotFoundException,
RequestUnsuccessfulException
dropletId - a Integer object
Response
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
Response disableDropletBackups(Integer dropletId)
throws AccessDeniedException,
ResourceNotFoundException,
RequestUnsuccessfulException
dropletId - a Integer object
Response
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
Response renameDroplet(Integer dropletId,
String name)
throws AccessDeniedException,
ResourceNotFoundException,
RequestUnsuccessfulException
dropletId - a Integer object
Response
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
Response deleteDroplet(Integer dropletId)
throws AccessDeniedException,
ResourceNotFoundException,
RequestUnsuccessfulException
dropletId - a Integer object
Response
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
List<Region> getAvailableRegions()
throws AccessDeniedException,
ResourceNotFoundException,
RequestUnsuccessfulException
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
List<DropletImage> getAvailableImages()
throws AccessDeniedException,
ResourceNotFoundException,
RequestUnsuccessfulException
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
DropletImage getImageInfo(Integer imageId)
throws AccessDeniedException,
ResourceNotFoundException,
RequestUnsuccessfulException
imageId - a Integer object
DropletImage
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
Response deleteImage(Integer imageId)
throws AccessDeniedException,
ResourceNotFoundException,
RequestUnsuccessfulException
imageId - a Integer object
Response
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
Response transerImage(Integer imageId,
Integer regionId)
throws AccessDeniedException,
ResourceNotFoundException,
RequestUnsuccessfulException
imageId - a Integer objectregionId - a Integer object
Response
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulExceptionList<SshKey> getAvailableSshKeys()
SshKey getSshKeyInfo(Integer sshKeyId)
SshKey addSshKey(String sshKeyName,
String sshPublicKey)
SshKey editSshKey(Integer sshKeyId,
String sshPublicKey)
Response deleteSshKey(Integer sshKeyId)
List<DropletSize> getAvailableSizes()
throws AccessDeniedException,
ResourceNotFoundException,
RequestUnsuccessfulException
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulExceptionList<Domain> getAvailableDomains()
Domain getDomainInfo(Integer domainId)
Domain createDomain(String domainName,
String ipAddress)
Domain deleteDomain(Integer domainId)
List<DomainRecord> getDomainRecords(Integer domainId)
DomainRecord getDomainRecord(Integer domainId,
Integer recordId)
DomainRecord createDomainRecord(DomainRecord domainRecord)
DomainRecord editDomainRecord(DomainRecord domainRecord)
Response deleteDomainRecord(Integer domainId,
Integer recordId)
|
DigitalOcean API Client in Java | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||