|
DigitalOcean API Client in Java | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.myjeeva.digitalocean.impl.DigitalOceanClient
public class DigitalOceanClient
DigitalOcean API client wrapper methods Implementation
Field Summary |
---|
Fields inherited from interface com.myjeeva.digitalocean.Constants |
---|
HTTPS_SCHEME, PARAM_API_KEY, PARAM_CLIENT_ID, PARAM_IMAGE_ID, PARAM_NAME, PARAM_REGION_ID, PARAM_SIDE_ID, PARAM_SSH_KEY_IDS, STATUS |
Constructor Summary | |
---|---|
DigitalOceanClient(String clientId,
String apiKey)
Constructor for initializing DigitalOcean Client |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DigitalOceanClient(String clientId, String apiKey)
clientId
- a String
objectapiKey
- a String
object
ResourceNotFoundException
Method Detail |
---|
public List<Droplet> getAvailableDroplets() throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
getAvailableDroplets
in interface DigitalOcean
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public Droplet createDroplet(Droplet droplet) throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
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
createDroplet
in interface DigitalOcean
droplet
- a Droplet
object
Droplet
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public Droplet createDroplet(Droplet droplet, String sshKeyIds) throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
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
createDroplet
in interface DigitalOcean
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
public Droplet getDropletInfo(Integer dropletId) throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
getDropletInfo
in interface DigitalOcean
dropletId
- a Integer
object
Droplet
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public Response rebootDroplet(Integer dropletId) throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
rebootDroplet
in interface DigitalOcean
dropletId
- a Integer
object
Response
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public Response powerCyleDroplet(Integer dropletId) throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
powerCyleDroplet
in interface DigitalOcean
dropletId
- a Integer
object
Response
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public Response shutdownDroplet(Integer dropletId) throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
shutdownDroplet
in interface DigitalOcean
dropletId
- a Integer
object
Response
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public Response powerOffDroplet(Integer dropletId) throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
powerOffDroplet
in interface DigitalOcean
dropletId
- a Integer
object
Response
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public Response powerOnDroplet(Integer dropletId) throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
powerOnDroplet
in interface DigitalOcean
dropletId
- a Integer
object
Response
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public Response resetDropletPassword(Integer dropletId) throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
resetDropletPassword
in interface DigitalOcean
dropletId
- a Integer
object
Response
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public Response resizeDroplet(Integer dropletId, Integer sizeId) throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
resizeDroplet
in interface DigitalOcean
dropletId
- a Integer
object
Response
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public Response takeDropletSnapshot(Integer dropletId) throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
takeDropletSnapshot
in interface DigitalOcean
dropletId
- a Integer
object
Response
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public Response takeDropletSnapshot(Integer dropletId, String snapshotName) throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
takeDropletSnapshot
in interface DigitalOcean
dropletId
- a Integer
objectsnapshotName
- a String
object
Response
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public Response restoreDroplet(Integer dropletId, Integer imageId) throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
restoreDroplet
in interface DigitalOcean
dropletId
- a Integer
object
Response
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public Response rebuildDroplet(Integer dropletId, Integer imageId) throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
rebuildDroplet
in interface DigitalOcean
dropletId
- a Integer
object
Response
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public Response enableDropletBackups(Integer dropletId) throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
enableDropletBackups
in interface DigitalOcean
dropletId
- a Integer
object
Response
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public Response disableDropletBackups(Integer dropletId) throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
disableDropletBackups
in interface DigitalOcean
dropletId
- a Integer
object
Response
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public Response renameDroplet(Integer dropletId, String name) throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
renameDroplet
in interface DigitalOcean
dropletId
- a Integer
object
Response
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public Response deleteDroplet(Integer dropletId) throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
deleteDroplet
in interface DigitalOcean
dropletId
- a Integer
object
Response
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public List<Region> getAvailableRegions() throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
getAvailableRegions
in interface DigitalOcean
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public List<DropletImage> getAvailableImages() throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
getAvailableImages
in interface DigitalOcean
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public DropletImage getImageInfo(Integer imageId) throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
getImageInfo
in interface DigitalOcean
imageId
- a Integer
object
DropletImage
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public Response deleteImage(Integer imageId) throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
deleteImage
in interface DigitalOcean
imageId
- a Integer
object
Response
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public Response transerImage(Integer imageId, Integer regionId) throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
transerImage
in interface DigitalOcean
imageId
- a Integer
objectregionId
- a Integer
object
Response
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public List<SshKey> getAvailableSshKeys()
DigitalOcean
getAvailableSshKeys
in interface DigitalOcean
public SshKey getSshKeyInfo(Integer sshKeyId)
DigitalOcean
getSshKeyInfo
in interface DigitalOcean
public SshKey addSshKey(String sshKeyName, String sshPublicKey)
DigitalOcean
addSshKey
in interface DigitalOcean
public SshKey editSshKey(Integer sshKeyId, String sshPublicKey)
DigitalOcean
editSshKey
in interface DigitalOcean
public Response deleteSshKey(Integer sshKeyId)
DigitalOcean
deleteSshKey
in interface DigitalOcean
public List<DropletSize> getAvailableSizes() throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
getAvailableSizes
in interface DigitalOcean
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public List<Domain> getAvailableDomains()
DigitalOcean
getAvailableDomains
in interface DigitalOcean
public Domain getDomainInfo(Integer domainId)
DigitalOcean
getDomainInfo
in interface DigitalOcean
public Domain createDomain(String domainName, String ipAddress)
DigitalOcean
createDomain
in interface DigitalOcean
public Domain deleteDomain(Integer domainId)
DigitalOcean
deleteDomain
in interface DigitalOcean
public List<DomainRecord> getDomainRecords(Integer domainId)
DigitalOcean
getDomainRecords
in interface DigitalOcean
public DomainRecord getDomainRecord(Integer domainId, Integer recordId)
DigitalOcean
getDomainRecord
in interface DigitalOcean
public DomainRecord createDomainRecord(DomainRecord domainRecord)
DigitalOcean
createDomainRecord
in interface DigitalOcean
public DomainRecord editDomainRecord(DomainRecord domainRecord)
DigitalOcean
editDomainRecord
in interface DigitalOcean
public Response deleteDomainRecord(Integer domainId, Integer recordId)
DigitalOcean
deleteDomainRecord
in interface DigitalOcean
|
DigitalOcean API Client in Java | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |