|
DigitalOcean API Client in Java | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.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_DATA, PARAM_IMAGE_ID, PARAM_IP_ADDRESS, PARAM_NAME, PARAM_PORT, PARAM_PRIORITY, PARAM_RECORD_TYPE, PARAM_REGION_ID, PARAM_SIDE_ID, PARAM_SSH_KEY_IDS, PARAM_SSH_PUB_KEY, PARAM_WEIGHT, STATUS, TYPE_DOMAIN_LIST, TYPE_DOMAIN_RECORD_LIST, TYPE_DROPLET_LIST, TYPE_IMAGE_LIST, TYPE_REGION_LIST, TYPE_SIZE_LIST, TYPE_SSH_KEY_LIST, UTF_8 |
Constructor Summary | |
---|---|
DigitalOceanClient(String clientId,
String apiKey)
Constructor for initializing DigitalOcean Client |
Method Summary | |
---|---|
SshKey |
addSshKey(String sshKeyName,
String sshPublicKey)
Method allows you to add a new public SSH key to your account |
Domain |
createDomain(String domainName,
String ipAddress)
Method creates a new domain name with an A record for the specified [ip_address]. |
DomainRecord |
createDomainRecord(DomainRecord domainRecord)
Method creates a new domain record name with an given domain record values |
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. |
Response |
deleteDomain(Integer domainId)
Method deletes the specified domain from DNS control panel |
Response |
deleteDomainRecord(Integer domainId,
Integer recordId)
Method deletes the specified domain record from domain. |
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)
Method will delete the SSH key from your account. |
Response |
disableDropletBackups(Integer dropletId)
Method disables automatic backups from running to backup your droplet's data. |
DomainRecord |
editDomainRecord(DomainRecord domainRecord)
method edits an existing domain record of the given domain. |
SshKey |
editSshKey(Integer sshKeyId,
String newSshPublicKey)
Method allows you to modify an existing public SSH key in your account. |
Response |
enableDropletBackups(Integer dropletId)
Method enables automatic backups which run in the background daily to backup your droplet's data. |
List<Domain> |
getAvailableDomains()
Method returns all of your available domains from DNS control panel |
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()
Method lists all the available public SSH keys in your account that can be added to a droplet. |
Domain |
getDomainInfo(Integer domainId)
Method returns the specified domain attributes and zone file info. |
DomainRecord |
getDomainRecordInfo(Integer domainId,
Integer recordId)
Method returns the specified domain record. |
List<DomainRecord> |
getDomainRecords(Integer domainId)
Method returns all of your current domain records from DNS control panel for given domain. |
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)
Method shows a specific public SSH key in your account that can be added to a droplet. |
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 |
transferImage(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
- the id of the droplet
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
- the id of the dropletsshKeyIds
- 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
- the id of the droplet
Droplet
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public Response rebootDroplet(Integer dropletId) throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
rebootDroplet
in interface DigitalOcean
dropletId
- the id of the droplet
Response
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public Response powerCyleDroplet(Integer dropletId) throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
powerCyleDroplet
in interface DigitalOcean
dropletId
- the id of the droplet
Response
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public Response shutdownDroplet(Integer dropletId) throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
shutdownDroplet
in interface DigitalOcean
dropletId
- the id of the droplet
Response
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public Response powerOffDroplet(Integer dropletId) throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
powerOffDroplet
in interface DigitalOcean
dropletId
- the id of the droplet
Response
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public Response powerOnDroplet(Integer dropletId) throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
powerOnDroplet
in interface DigitalOcean
dropletId
- the id of the droplet
Response
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public Response resetDropletPassword(Integer dropletId) throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
resetDropletPassword
in interface DigitalOcean
dropletId
- the id of the droplet
Response
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public Response resizeDroplet(Integer dropletId, Integer sizeId) throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
resizeDroplet
in interface DigitalOcean
dropletId
- the id of the droplet
Response
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public Response takeDropletSnapshot(Integer dropletId) throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
takeDropletSnapshot
in interface DigitalOcean
dropletId
- the id of the droplet
Response
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public Response takeDropletSnapshot(Integer dropletId, String snapshotName) throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
takeDropletSnapshot
in interface DigitalOcean
dropletId
- the id of the dropletsnapshotName
- the name the snapshot to be created
Response
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public Response restoreDroplet(Integer dropletId, Integer imageId) throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
restoreDroplet
in interface DigitalOcean
dropletId
- the id of the droplet
Response
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public Response rebuildDroplet(Integer dropletId, Integer imageId) throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
rebuildDroplet
in interface DigitalOcean
dropletId
- the id of the droplet
Response
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public Response enableDropletBackups(Integer dropletId) throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
enableDropletBackups
in interface DigitalOcean
dropletId
- the id of the droplet
Response
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public Response disableDropletBackups(Integer dropletId) throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
disableDropletBackups
in interface DigitalOcean
dropletId
- the id of the droplet
Response
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public Response renameDroplet(Integer dropletId, String name) throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
renameDroplet
in interface DigitalOcean
dropletId
- the id of the droplet
Response
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public Response deleteDroplet(Integer dropletId) throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
deleteDroplet
in interface DigitalOcean
dropletId
- the id of the droplet
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
- the image Id of the droplet/snapshot/backup images
DropletImage
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public Response deleteImage(Integer imageId) throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
deleteImage
in interface DigitalOcean
imageId
- the image Id of the droplet/snapshot/backup images
Response
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public Response transferImage(Integer imageId, Integer regionId) throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
transferImage
in interface DigitalOcean
imageId
- the image Id of the droplet/snapshot/backup imagesregionId
- the region Id of the digitalocean data centers
Response
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public List<SshKey> getAvailableSshKeys() throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
getAvailableSshKeys
in interface DigitalOcean
List<SshKey>
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public SshKey getSshKeyInfo(Integer sshKeyId) throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
getSshKeyInfo
in interface DigitalOcean
sshKeyId
- the SSH key Id
SshKey
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public SshKey addSshKey(String sshKeyName, String sshPublicKey) throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
addSshKey
in interface DigitalOcean
sshKeyName
- the name you want to give this SSH keysshPublicKey
- the actual public SSH key
SshKey
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public SshKey editSshKey(Integer sshKeyId, String newSshPublicKey) throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
editSshKey
in interface DigitalOcean
sshKeyId
- the SSH key Id, you would like to editnewSshPublicKey
- the new public SSH key
SshKey
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public Response deleteSshKey(Integer sshKeyId) throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
deleteSshKey
in interface DigitalOcean
sshKeyId
- the SSH key Id, you would like to delete
Response
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public List<DropletSize> getAvailableSizes() throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
getAvailableSizes
in interface DigitalOcean
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public List<Domain> getAvailableDomains() throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
getAvailableDomains
in interface DigitalOcean
List<Domain>
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public Domain getDomainInfo(Integer domainId) throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
getDomainInfo
in interface DigitalOcean
domainId
- the Id of the domain
Domain
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public Domain createDomain(String domainName, String ipAddress) throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
createDomain
in interface DigitalOcean
domainName
- the name of the domainipAddress
- the IP Address for the domain
Domain
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public Response deleteDomain(Integer domainId) throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
deleteDomain
in interface DigitalOcean
domainId
- the Id of the domain
Response
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public List<DomainRecord> getDomainRecords(Integer domainId) throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
getDomainRecords
in interface DigitalOcean
domainId
- the Id of the domain
List<DomainRecord>
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public DomainRecord getDomainRecordInfo(Integer domainId, Integer recordId) throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
getDomainRecordInfo
in interface DigitalOcean
domainId
- the Id of the domainrecordId
- the record Id of the domain
DomainRecord
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public DomainRecord createDomainRecord(DomainRecord domainRecord) throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
createDomainRecord
in interface DigitalOcean
domainRecord
- the domain record values domain Id, record type, data, name,
priority, port, weight
DomainRecord
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public DomainRecord editDomainRecord(DomainRecord domainRecord) throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
editDomainRecord
in interface DigitalOcean
domainRecord
- the domain record values domain Id, record type, data, name,
priority, port, weight
DomainRecord
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
public Response deleteDomainRecord(Integer domainId, Integer recordId) throws AccessDeniedException, ResourceNotFoundException, RequestUnsuccessfulException
DigitalOcean
deleteDomainRecord
in interface DigitalOcean
AccessDeniedException
ResourceNotFoundException
RequestUnsuccessfulException
|
DigitalOcean API Client in Java | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |