Interface DigitalOcean
- All Known Implementing Classes:
DigitalOceanClient
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)
-
Method Summary
Modifier and TypeMethodDescriptionaddDropletsToFirewall(String firewallId, List<Integer> dropletIds) addDropletsToLoadBalancer(String loadBalancerId, List<Integer> dropletIds) Method allows you to assign a Droplet to a Load Balancer instance.addForwardingRulesToLoadBalancer(String loadBalancerId, List<ForwardingRules> forwardingRules) Method allows you to add an additional forwarding rule to a Load Balancer instance.assignFloatingIP(Integer dropletId, String ipAddress) Method will assign Floating IP to a Droplet.attachVolume(Integer dropletId, String volumeId, String regionSlug) Method attaches the given volume into droplet by identifierattachVolumeByName(Integer dropletId, String volumeName, String regionSlug) Method attaches the given volume into droplet by namechangeDropletKernel(Integer dropletId, Integer kernelId) Method changes a OS kernel for given dropletconvertImage(Integer imageId) Method allows you to convert image into snapshotcreateCertificate(Certificate certificate) Method allows you to create a new certificate.createCustomImage(Image image) Method creates the custom image.createDomain(Domain domain) Method creates a new domain name with an A record for the specified [ip_address].createDomainRecord(String domainName, DomainRecord domainRecord) Method creates a new domain record name with an given domain record valuescreateDroplet(Droplet droplet) Method allows you to create a new droplet.createDroplets(Droplet droplet) Method allows you to create multiple droplets simultaneously.createFirewall(Firewall firewall) Method allows you to add a new firewall to restrict network access to and from a Droplet.createFloatingIP(Integer dropletId) Method creates a new Floating IP and assigns to the Droplet.createFloatingIP(String region) Method creates a new Floating IP and its reserved to a RegionMethod allows you to add a new public SSH key to your accountcreateLetsEncryptCertificate(Certificate certificate) Method allows you to create a new Let's Encrypt certificate.createLoadBalancer(LoadBalancer loadBalancer) Method allows you to add a new load balancer to distribute traffic across multiple Droplets.createProject(Project project) Method allows you to create a new project.Method will create a Tag on DigitalOcean aacount.createVolume(Volume volume) Method creates new volume with given detailsdeleteCertificate(String certificateId) Method allows you to delete a Certificate by Id from your account.deleteDomain(String domainName) Method deletes the specified domain from DNS control paneldeleteDomainRecord(String domainName, Integer recordId) Method deletes the specified domain record from domain.deleteDroplet(Integer dropletId) Method destroys one of your droplet; this is irreversible.deleteDropletByTagName(String tagName) Method destroys one or more of your droplet by given tag name; this is irreversible.deleteFirewall(String firewallId) Method allows you to delete a Firewall instance, disassociating any Droplets assigned to it and removing it from your account.deleteFloatingIP(String ipAddress) Method deletes the Floating IP and removes it from your account.deleteImage(Integer imageId) Method allows you to deletes an image.Method will delete the SSH key from your account.Method will delete the SSH key from your account.deleteLoadBalancer(String loadBalancerId) Method allows you to delete a Load Balancer instance, disassociating any Droplets assigned to it and removing it from your account.deleteProject(String projectId) deleteSnapshot(String snapshotId) Method deletes snapshot by idMethod deletes the existing Tag from DigitalOcean account.deleteVolume(String volumeId) Method deletes volume by identifierdeleteVolume(String volumeName, String regionSlug) Method deletes volume by name and region slugdetachVolume(Integer dropletId, String volumeId, String regionSlug) Method detaches volume from the droplet by identifierdetachVolumeByName(Integer dropletId, String volumeName, String regionSlug) Method detaches volume from the droplet by volume namedisableDropletBackups(Integer dropletId) Method disables automatic backups from running to backup your droplet's data.enableDropletBackups(Integer dropletId) Method enables automatic backups for your droplet's data.enableDropletIpv6(Integer dropletId) Enabling IP v6 networking capability for droplet.enableDropletPrivateNetworking(Integer dropletId) Enabling private networking capability for droplet.Method returns account information for provided credentialsgetActionInfo(Integer actionId) To retrieve a specific action information by action IDgetAllDropletNeighbors(Integer pageNo) For an entire account; Method retrieves a list of any droplets that are running on the same physical server (any other droplets that share the same physical hardware).getAllDropletSnapshots(Integer pageNo, Integer perPage) Method return all of the droplet snapshots available on your accountgetAllVolumeSnapshots(Integer pageNo, Integer perPage) Method return all of the volume snapshots available on your accountgetAvailableActions(Integer pageNo, Integer perPage) Method return all the action informations, regardless of categories.getAvailableCertificates(Integer pageNo, Integer perPage) Method returns all available Certificates from your account.getAvailableDomains(Integer pageNo) Method returns all of your available domains from DNS control panelgetAvailableDropletActions(Integer dropletId, Integer pageNo, Integer perPage) Method return all the action informations; specific to given Droplet IdgetAvailableDroplets(Integer pageNo, Integer perPage) Method returns all active droplets that are currently running in your account.getAvailableDropletsByTagName(String tagName, Integer pageNo, Integer perPage) To list Droplets by a tag.getAvailableFirewalls(Integer pageNo, Integer perPage) Method returns all available firewalls that are currently running in your account.getAvailableFloatingIPActions(String ipAddress, Integer pageNo, Integer perPage) Method retrives all actions that have been executed on a Floating IP address.getAvailableFloatingIPs(Integer pageNo, Integer perPage) Method will list all of the Floating IPs available from your account.getAvailableImageActions(Integer imageId, Integer pageNo, Integer perPage) Method return all the action informations; specific to given Image IdgetAvailableImages(Integer pageNo, Integer perPage) Method returns all the available images that can be accessed by your OAuth Token.getAvailableImages(Integer pageNo, Integer perPage, ActionType type) Method returns all the available images based ontype={distribution or application}that can be accessed by your OAuth Token.getAvailableKeys(Integer pageNo) Method lists all the available public SSH keys in your account that can be added to a droplet.getAvailableLoadBalancers(Integer pageNo, Integer perPage) Method returns all active loadbalancers that are currently running in your account.Method allows you to get all the projects.getAvailableRegions(Integer pageNo) Method returns all the available regions within the DigitalOcean cloud.getAvailableSizes(Integer pageNo) Method returns all the available sizes that can be used to create a droplet.getAvailableSnapshots(Integer pageNo, Integer perPage) Method return all of the snapshots available on your accountgetAvailableTags(Integer pageNo, Integer perPage) Method will list all of the Tags available from your account.getAvailableVolumeActions(String volumeId) Method will get all the available volume action by volume identifiergetAvailableVolumes(String regionSlug) Method will list all of the Volumes available from your account.getCertificateInfo(String certificateId) Method returns the Certificate information for given certificate ID.getDomainInfo(String domainName) Method returns the specified domain attributes and zone file info.getDomainRecordInfo(String domainName, Integer recordId) Method returns the specified domain record.getDomainRecords(String domainName, Integer pageNo, Integer perPage) Method returns all of your current domain records from DNS control panel for given domain.getDropletBackups(Integer dropletId, Integer pageNo, Integer perPage) Method returns all available snapshots for given droplet IDgetDropletInfo(Integer dropletId) Method returns complete information for given droplet IDgetDropletKernels(Integer dropletId, Integer pageNo, Integer perPage) Method returns all available kernels for given droplet IDgetDropletNeighbors(Integer dropletId, Integer pageNo) For an individual droplet; Method retrieves a list of droplets that are running on the same physical server (any other droplets that share the same physical hardware).getDropletSnapshots(Integer dropletId, Integer pageNo, Integer perPage) Method returns all available snapshots for given droplet IDgetFirewallInfo(String firewallId) Method returns complete information for given firewall ID.getFloatingIPActionInfo(String ipAddress, Integer actionId) Method to retrieve the status of a Floating IP action.getFloatingIPInfo(String ipAddress) Method retrieves the information about given Floating IPgetImageInfo(Integer imageId) Method retrieves the attributes of an image.getImageInfo(String slug) Method retrieves the attributes of an image.getKeyInfo(Integer sshKeyId) Method shows a specific public SSH key information from your account that can be added to a droplet.getKeyInfo(String fingerprint) Method shows a specific public SSH key information from your account that can be added to a droplet.getLoadBalancerInfo(String loadBalancerId) Method returns complete information for given load balancer ID.getProject(String projectId) getSnaphotInfo(String snapshotId) Method returns specific snapshot info by idMethod retrieves the Tag from DigitalOcean account.getUserImages(Integer pageNo, Integer perPage) Method retrieves only the private images of a usergetVolumeAction(String volumeId, Integer actionId) Method returns specific volume action by action and volume identifiergetVolumeInfo(String volumeId) Method shows specific volume information by identifiergetVolumeInfo(String volumeName, String regionSlug) Method shows volume information by name and region sluggetVolumeSnapshots(String volumeId, Integer pageNo, Integer perPage) Method return all of the snapshots for given volume IdpatchDefaultProject(Project project) patchProject(Project project) powerCycleDroplet(Integer dropletId) Method allows you to power cycle a droplet.powerOffDroplet(Integer dropletId) Method allows you to poweroff a running droplet.powerOnDroplet(Integer dropletId) Method allows you to poweron a powered off droplet.rebootDroplet(Integer dropletId) Method allows you to reboot a droplet.rebuildDroplet(Integer dropletId, Integer imageId) Method allows you to reinstall a droplet with a default image.removeDropletsFromFirewall(String firewallId, List<Integer> dropletIds) Method allows you to remove a Droplet from a Load Balancer instance.removeDropletsFromLoadBalancer(String loadBalancerId, List<Integer> dropletIds) Method allows you to remove a Droplet from a Load Balancer instance.removeForwardingRulesFromLoadBalancer(String loadBalancerId, List<ForwardingRules> forwardingRules) Method allows you to remove forwarding rules from a Load Balancer instance.renameDroplet(Integer dropletId, String name) Method renames the droplet to the specified name.resetDropletPassword(Integer dropletId) Method will reset the root password for a droplet.resizeDroplet(Integer dropletId, String size) Method allows you to resize a specific droplet to a different size.resizeDroplet(Integer dropletId, String size, Boolean disk) Method allows you to resize a specific droplet to a different size.resizeVolume(String volumeId, String regionSlug, Double sizeGigabytes) Method resizes volume by identifierrestoreDroplet(Integer dropletId, Integer imageId) Method allows you to restore a droplet with a previous image or snapshot.shutdownDroplet(Integer dropletId) Method allows you to shutdown a running droplet.tagResources(String name, List<Resource> resources) Method tags a tag to given list of resources on DigitalOcean account.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.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.takeVolumeSnapshot(String volumeId, String snapshotName) Method take snapshot of given volume IdtransferImage(Integer imageId, String regionSlug) Method allows you to transfer an image to a specified region.unassignFloatingIP(String ipAddress) Method will unassign Floating IP from a Droplet.untagResources(String name, List<Resource> resources) Method untags a tag from given list of resources on DigitalOcean account.updateDefaultProject(Project project) updateDomainRecord(String domainName, Integer recordId, DomainRecord domainRecord) method edits an existing domain record of the given domain.updateFirewall(Firewall firewall) Method allows you to update an existing fireawll.updateImage(Image image) Method updates the given details for an image.Method allows you to modify an existing SSH key in your account.Method allows you to modify an existing SSH key in your account.updateLoadBalancer(LoadBalancer loadBalancer) Method allows you to update an existign load balancer.updateProject(Project project)
-
Method Details
-
getAvailableDroplets
Droplets getAvailableDroplets(Integer pageNo, Integer perPage) throws DigitalOceanException, RequestUnsuccessfulException Method returns all active droplets that are currently running in your account. All available API information is presented for each droplet.- Parameters:
pageNo- for paginationperPage- no. of items per page- Returns:
Droplets- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.0
-
getDropletKernels
Kernels getDropletKernels(Integer dropletId, Integer pageNo, Integer perPage) throws DigitalOceanException, RequestUnsuccessfulException Method returns all available kernels for given droplet ID- Parameters:
dropletId- for kernel infopageNo- for paginationperPage- no. of items per page- Returns:
Kernels- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.0
-
getDropletSnapshots
Snapshots getDropletSnapshots(Integer dropletId, Integer pageNo, Integer perPage) throws DigitalOceanException, RequestUnsuccessfulException Method returns all available snapshots for given droplet ID- Parameters:
dropletId- for snapshot infopageNo- for paginationperPage- no. of items per page- Returns:
Snapshots- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.0
-
getDropletBackups
Backups getDropletBackups(Integer dropletId, Integer pageNo, Integer perPage) throws DigitalOceanException, RequestUnsuccessfulException Method returns all available snapshots for given droplet ID- Parameters:
dropletId- for backup infopageNo- for paginationperPage- no. of items per page- Returns:
Backups- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.0
-
getDropletInfo
Droplet getDropletInfo(Integer dropletId) throws DigitalOceanException, RequestUnsuccessfulException Method returns complete information for given droplet ID- Parameters:
dropletId- the id of the droplet- Returns:
Droplet- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v1.0
-
createDroplet
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.Note: Currently return object doesn't include 'action' information of create droplet.
Create a instance of
Dropletclass and populated the droplet object appropriately. Minimum required values are -{ "name": "example-droplet-name", "region": "nyc1", "size": "512mb", "image": "ubuntu-14-04-x64", "backups": false }- Parameters:
droplet- the instance of the droplet class- Returns:
Droplet- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v1.0
-
createDroplets
Method allows you to create multiple droplets simultaneously. See the required parameters section below for an explanation of the variables that are needed to create multiple droplets.Create a instance of
Dropletclass and populated the droplet object appropriately. Particularly names attribute in the Droplet class. Minimum required values are -{ "names": [ "sub-01.example.com", "sub-02.example.com" ], "region": "nyc1", "size": "512mb", "image": "ubuntu-14-04-x64", "backups": false }- Parameters:
droplet- the instance of the droplet class- Returns:
Droplet- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.3
-
deleteDroplet
Method destroys one of your droplet; this is irreversible.- Parameters:
dropletId- the id of the droplet- Returns:
Delete- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v1.0
-
deleteDropletByTagName
Delete deleteDropletByTagName(String tagName) throws DigitalOceanException, RequestUnsuccessfulException Method destroys one or more of your droplet by given tag name; this is irreversible.- Parameters:
tagName- the associated tag name with droplet- Returns:
Delete- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.9
-
getDropletNeighbors
Droplets getDropletNeighbors(Integer dropletId, Integer pageNo) throws DigitalOceanException, RequestUnsuccessfulException For an individual droplet; Method retrieves a list of droplets that are running on the same physical server (any other droplets that share the same physical hardware).- Parameters:
dropletId- the id of the dropletpageNo- for pagination- Returns:
Droplets- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.0
-
getAllDropletNeighbors
Neighbors getAllDropletNeighbors(Integer pageNo) throws DigitalOceanException, RequestUnsuccessfulException For an entire account; Method retrieves a list of any droplets that are running on the same physical server (any other droplets that share the same physical hardware).- Parameters:
pageNo- for pagination- Returns:
Neighbors- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.0
-
getAvailableDropletsByTagName
Droplets getAvailableDropletsByTagName(String tagName, Integer pageNo, Integer perPage) throws DigitalOceanException, RequestUnsuccessfulException To list Droplets by a tag.The response will match that of regular droplet listing request but will be filtered to only include the tagged Droplets.
- Parameters:
tagName- for tagNamepageNo- for paginationperPage- for pagination- Returns:
Droplets- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.16
-
rebootDroplet
Method allows you to reboot a droplet. This is the preferred method to use if a server is not responding.- Parameters:
dropletId- the id of the droplet- Returns:
Action- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v1.0
-
powerCycleDroplet
Action powerCycleDroplet(Integer dropletId) throws DigitalOceanException, RequestUnsuccessfulException Method allows you to power cycle a droplet. This will turn off the droplet and then turn it back on.- Parameters:
dropletId- the id of the droplet- Returns:
Action- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v1.0
-
shutdownDroplet
Action shutdownDroplet(Integer dropletId) throws DigitalOceanException, RequestUnsuccessfulException Method allows you to shutdown a running droplet.- Parameters:
dropletId- the id of the droplet- Returns:
Action- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v1.0
-
powerOffDroplet
Action powerOffDroplet(Integer dropletId) throws DigitalOceanException, RequestUnsuccessfulException Method allows you to poweroff a running droplet.- Parameters:
dropletId- the id of the droplet- Returns:
Action- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v1.0
-
powerOnDroplet
Method allows you to poweron a powered off droplet.- Parameters:
dropletId- the id of the droplet- Returns:
Action- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v1.0
-
resetDropletPassword
Action resetDropletPassword(Integer dropletId) throws DigitalOceanException, RequestUnsuccessfulException Method will reset the root password for a droplet. Please be aware that this will reboot the droplet to allow resetting the password.- Parameters:
dropletId- the id of the droplet- Returns:
Action- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v1.0
-
resizeDroplet
Action resizeDroplet(Integer dropletId, String size) throws DigitalOceanException, RequestUnsuccessfulException Method allows you to resize a specific droplet to a different size. This will affect the number of processors and memory allocated to the droplet.- Parameters:
dropletId- the id of the dropletsize- of the droplet- Returns:
Action- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v1.0
-
resizeDroplet
Action resizeDroplet(Integer dropletId, String size, Boolean disk) throws DigitalOceanException, RequestUnsuccessfulException Method allows you to resize a specific droplet to a different size. This will affect the number of processors and memory allocated to the droplet and optionally disk size.- Parameters:
dropletId- the id of the dropletsize- of the dropletdisk- whether to resize disk of the droplet or or not- Returns:
Action- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v1.0
-
takeDropletSnapshot
Action takeDropletSnapshot(Integer dropletId) throws DigitalOceanException, RequestUnsuccessfulException 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. Please be aware this may cause a reboot.- Parameters:
dropletId- the id of the droplet- Returns:
Action- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v1.0
-
takeDropletSnapshot
Action takeDropletSnapshot(Integer dropletId, String snapshotName) throws DigitalOceanException, RequestUnsuccessfulException 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. Please be aware this may cause a reboot.- Parameters:
dropletId- the id of the dropletsnapshotName- the name the snapshot to be created- Returns:
Action- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v1.0
-
restoreDroplet
Action restoreDroplet(Integer dropletId, Integer imageId) throws DigitalOceanException, RequestUnsuccessfulException Method allows you to restore 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:
dropletId- the id of the dropletimageId- the id of the DigitalOcean public image or your private image- Returns:
Action- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v1.0
-
rebuildDroplet
Action rebuildDroplet(Integer dropletId, Integer imageId) throws DigitalOceanException, RequestUnsuccessfulException Method allows you to reinstall 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:
dropletId- the id of the dropletimageId- the id of the DigitalOcean public image or your private image- Returns:
Action- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v1.0
-
enableDropletBackups
Action enableDropletBackups(Integer dropletId) throws DigitalOceanException, RequestUnsuccessfulException Method enables automatic backups for your droplet's data.- Parameters:
dropletId- the id of the droplet- Returns:
Action- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.3
-
disableDropletBackups
Action disableDropletBackups(Integer dropletId) throws DigitalOceanException, RequestUnsuccessfulException Method disables automatic backups from running to backup your droplet's data.- Parameters:
dropletId- the id of the droplet- Returns:
Action- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v1.0
-
renameDroplet
Action renameDroplet(Integer dropletId, String name) throws DigitalOceanException, RequestUnsuccessfulException Method renames the droplet to the specified name.- Parameters:
dropletId- the id of the dropletname- the new name of droplet to be called- Returns:
Action- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v1.0
-
changeDropletKernel
Action changeDropletKernel(Integer dropletId, Integer kernelId) throws DigitalOceanException, RequestUnsuccessfulException Method changes a OS kernel for given droplet- Parameters:
dropletId- the id of the dropletkernelId- the kernel id to be changed for droplet- Returns:
Action- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.0
-
enableDropletIpv6
Action enableDropletIpv6(Integer dropletId) throws DigitalOceanException, RequestUnsuccessfulException Enabling IP v6 networking capability for droplet. It may be dependent on Data Center Features.- Parameters:
dropletId- the id of the droplet- Returns:
Action- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method
-
enableDropletPrivateNetworking
Action enableDropletPrivateNetworking(Integer dropletId) throws DigitalOceanException, RequestUnsuccessfulException Enabling private networking capability for droplet. It may be dependent on Data Center Features.- Parameters:
dropletId- the id of the droplet- Returns:
Action- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.0
-
getAccountInfo
Method returns account information for provided credentials- Returns:
- $
Account - Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method
-
getAvailableActions
Actions getAvailableActions(Integer pageNo, Integer perPage) throws DigitalOceanException, RequestUnsuccessfulException Method return all the action informations, regardless of categories.- Parameters:
pageNo- for paginationperPage- no. of items per page- Returns:
Actions- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.0
-
getActionInfo
To retrieve a specific action information by action ID- Parameters:
actionId- the id of action- Returns:
Action- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.0
-
getAvailableDropletActions
Actions getAvailableDropletActions(Integer dropletId, Integer pageNo, Integer perPage) throws DigitalOceanException, RequestUnsuccessfulException Method return all the action informations; specific to given Droplet Id- Parameters:
dropletId- the id of the dropletpageNo- for paginationperPage- no. of items per page- Returns:
Actions- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.0
-
getAvailableImageActions
Actions getAvailableImageActions(Integer imageId, Integer pageNo, Integer perPage) throws DigitalOceanException, RequestUnsuccessfulException Method return all the action informations; specific to given Image Id- Parameters:
imageId- the id of the ImagepageNo- for paginationperPage- no. of items per page- Returns:
Actions- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.0
-
getAvailableFloatingIPActions
Actions getAvailableFloatingIPActions(String ipAddress, Integer pageNo, Integer perPage) throws DigitalOceanException, RequestUnsuccessfulException Method retrives all actions that have been executed on a Floating IP address.- Parameters:
ipAddress- Floating IP addresspageNo- for paginationperPage- no. of items per page- Returns:
Actions- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.3
-
getFloatingIPActionInfo
Action getFloatingIPActionInfo(String ipAddress, Integer actionId) throws DigitalOceanException, RequestUnsuccessfulException Method to retrieve the status of a Floating IP action.- Parameters:
ipAddress- Floating IP addressactionId- the id of action- Returns:
Action- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.3
-
getAvailableImages
Images getAvailableImages(Integer pageNo, Integer perPage) throws DigitalOceanException, RequestUnsuccessfulException Method returns all the available images that can be accessed by your OAuth Token. You will have access to all public images by default, and any snapshots or backups that you have created in your own account.- Parameters:
pageNo- of request paginationperPage- no. of items per page- Returns:
Images- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v1.0
-
getAvailableImages
Images getAvailableImages(Integer pageNo, Integer perPage, ActionType type) throws DigitalOceanException, RequestUnsuccessfulException Method returns all the available images based ontype={distribution or application}that can be accessed by your OAuth Token.- Parameters:
pageNo- of request paginationperPage- no. of items per pagetype- of action- Returns:
Images- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.0
-
getUserImages
Images getUserImages(Integer pageNo, Integer perPage) throws DigitalOceanException, RequestUnsuccessfulException Method retrieves only the private images of a user- Parameters:
pageNo- of request paginationperPage- no. of items per page- Returns:
Images- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method
-
getImageInfo
Method retrieves the attributes of an image.- Parameters:
imageId- the image Id of the droplet/snapshot/backup images- Returns:
Image- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v1.0
-
getImageInfo
Method retrieves the attributes of an image.- Parameters:
slug- of the public image- Returns:
Image- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.0
-
createCustomImage
Method creates the custom image.Refer to https://developers.digitalocean.com/documentation/v2/#create-a-custom-image
Sample Payload:
{ "name": "ubuntu-18.04-minimal", "url": "http://cloud-images.ubuntu.com/minimal/releases/bionic/release/ubuntu-18.04-minimal-cloudimg-amd64.img", "distribution": "Ubuntu", "region": "nyc3", "description": "Cloud-optimized image w/ small footprint", "tags": [ "base-image", "prod" ] }- Parameters:
image- instance with custom image attributes- Returns:
Image- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.17
-
updateImage
Method updates the given details for an image.- Parameters:
image- object for update- Returns:
Image- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.0
-
deleteImage
Method allows you to deletes an image. There is no way to restore a deleted image so be careful and ensure your data is properly backed up.- Parameters:
imageId- of the droplet/snapshot/backup images- Returns:
Delete- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v1.0
-
transferImage
Action transferImage(Integer imageId, String regionSlug) throws DigitalOceanException, RequestUnsuccessfulException Method allows you to transfer an image to a specified region.- Parameters:
imageId- the Id of the droplet/snapshot/backup imagesregionSlug- is code name of the region aka DigitalOcean data centers- Returns:
Action- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v1.0
-
convertImage
Method allows you to convert image into snapshot- Parameters:
imageId- the Id of the droplet/snapshot/backup images- Returns:
Action- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.0
-
getAvailableRegions
Regions getAvailableRegions(Integer pageNo) throws DigitalOceanException, RequestUnsuccessfulException Method returns all the available regions within the DigitalOcean cloud.- Parameters:
pageNo- for pagination- Returns:
Regions- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v1.0
-
getAvailableSizes
Method returns all the available sizes that can be used to create a droplet.- Parameters:
pageNo- for pagination- Returns:
Sizes- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v1.0
-
getAvailableDomains
Domains getAvailableDomains(Integer pageNo) throws DigitalOceanException, RequestUnsuccessfulException Method returns all of your available domains from DNS control panel- Parameters:
pageNo- for pagination- Returns:
Domains- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v1.0
-
getDomainInfo
Method returns the specified domain attributes and zone file info.- Parameters:
domainName- the name of the domain- Returns:
Domain- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.0
-
createDomain
Method creates a new domain name with an A record for the specified [ip_address].- Parameters:
domain- object with name and IP address for creation- Returns:
Domain- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.0
-
deleteDomain
Method deletes the specified domain from DNS control panel- Parameters:
domainName- the name of the domain- Returns:
Delete- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v1.0
-
getDomainRecords
DomainRecords getDomainRecords(String domainName, Integer pageNo, Integer perPage) throws DigitalOceanException, RequestUnsuccessfulException Method returns all of your current domain records from DNS control panel for given domain.- Parameters:
domainName- of the domainpageNo- of request paginationperPage- no. of items per page- Returns:
DomainRecords- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v1.1
-
createDomainRecord
DomainRecord createDomainRecord(String domainName, DomainRecord domainRecord) throws DigitalOceanException, RequestUnsuccessfulException Method creates a new domain record name with an given domain record values- Parameters:
domainName- of the domaindomainRecord- the domain record values domain Id, record type, data, name, priority, port, weight- Returns:
DomainRecord- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v1.1
-
getDomainRecordInfo
DomainRecord getDomainRecordInfo(String domainName, Integer recordId) throws DigitalOceanException, RequestUnsuccessfulException Method returns the specified domain record.- Parameters:
domainName- of the domainrecordId- of the domain- Returns:
DomainRecord- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v1.1
-
updateDomainRecord
DomainRecord updateDomainRecord(String domainName, Integer recordId, DomainRecord domainRecord) throws DigitalOceanException, RequestUnsuccessfulException method edits an existing domain record of the given domain.- Parameters:
domainName- of the domainrecordId- of the domaindomainRecord- the domain record values domain Id, record type, data, name, priority, port, weight- Returns:
DomainRecord- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.0
-
deleteDomainRecord
Delete deleteDomainRecord(String domainName, Integer recordId) throws DigitalOceanException, RequestUnsuccessfulException Method deletes the specified domain record from domain.- Parameters:
domainName- of the domainrecordId- of the domain- Returns:
Delete- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v1.1
-
getAvailableKeys
Method lists all the available public SSH keys in your account that can be added to a droplet.- Parameters:
pageNo- for pagination- Returns:
Keys- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v1.2
-
getKeyInfo
Method shows a specific public SSH key information from your account that can be added to a droplet.- Parameters:
sshKeyId- the SSH key Id- Returns:
Key- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v1.2
-
getKeyInfo
Method shows a specific public SSH key information from your account that can be added to a droplet.- Parameters:
fingerprint- the SSH key fingerprint- Returns:
Key- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.0
-
createKey
Method allows you to add a new public SSH key to your account- Parameters:
newKey- theKeyobject with sshKeyName and sshPublicKey- Returns:
Key- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v1.2
-
updateKey
Key updateKey(Integer sshKeyId, String newSshKeyName) throws DigitalOceanException, RequestUnsuccessfulException Method allows you to modify an existing SSH key in your account.- Parameters:
sshKeyId- the SSH key IdnewSshKeyName- the new name to give the SSH key- Returns:
Key- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v1.2
-
updateKey
Key updateKey(String fingerprint, String newSshKeyName) throws DigitalOceanException, RequestUnsuccessfulException Method allows you to modify an existing SSH key in your account.- Parameters:
fingerprint- the SSH fingerprintnewSshKeyName- the new name to give the SSH key- Returns:
Key- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.0
-
deleteKey
Method will delete the SSH key from your account.- Parameters:
sshKeyId- the SSH key Id, you would like to delete- Returns:
Delete- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v1.2
-
deleteKey
Method will delete the SSH key from your account.- Parameters:
fingerprint- the SSH fingerprint- Returns:
Delete- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.0
-
getAvailableFloatingIPs
FloatingIPs getAvailableFloatingIPs(Integer pageNo, Integer perPage) throws DigitalOceanException, RequestUnsuccessfulException Method will list all of the Floating IPs available from your account.- Parameters:
pageNo- for paginationperPage- no. of items per page- Returns:
FloatingIPs- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.3
-
createFloatingIP
FloatingIP createFloatingIP(Integer dropletId) throws DigitalOceanException, RequestUnsuccessfulException Method creates a new Floating IP and assigns to the Droplet.- Parameters:
dropletId- the id of the droplet- Returns:
FloatingIP- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.3
-
createFloatingIP
FloatingIP createFloatingIP(String region) throws DigitalOceanException, RequestUnsuccessfulException Method creates a new Floating IP and its reserved to a Region- Parameters:
region- name of the DigitalOcean region- Returns:
FloatingIP- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.3
-
getFloatingIPInfo
FloatingIP getFloatingIPInfo(String ipAddress) throws DigitalOceanException, RequestUnsuccessfulException Method retrieves the information about given Floating IP- Parameters:
ipAddress- Floating IP address- Returns:
FloatingIP- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.3
-
deleteFloatingIP
Delete deleteFloatingIP(String ipAddress) throws DigitalOceanException, RequestUnsuccessfulException Method deletes the Floating IP and removes it from your account.- Parameters:
ipAddress- Floating IP address- Returns:
Delete- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.3
-
assignFloatingIP
Action assignFloatingIP(Integer dropletId, String ipAddress) throws DigitalOceanException, RequestUnsuccessfulException Method will assign Floating IP to a Droplet.- Parameters:
dropletId- the id of the dropletipAddress- Floating IP address- Returns:
Action- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.3
-
unassignFloatingIP
Action unassignFloatingIP(String ipAddress) throws DigitalOceanException, RequestUnsuccessfulException Method will unassign Floating IP from a Droplet. The Floating IP will be reserved in the region but not assigned to a Droplet.- Parameters:
ipAddress- Floating IP address- Returns:
Action- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.3
-
getAvailableTags
Tags getAvailableTags(Integer pageNo, Integer perPage) throws DigitalOceanException, RequestUnsuccessfulException Method will list all of the Tags available from your account.- Parameters:
pageNo- for paginationperPage- no. of items per page- Returns:
Tags- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.5
-
createTag
Method will create a Tag on DigitalOcean aacount.- Parameters:
name- Tag Name- Returns:
Tag- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.5
-
getTag
Method retrieves the Tag from DigitalOcean account.- Parameters:
name- Tag Name- Returns:
Tag- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.5
-
deleteTag
Method deletes the existing Tag from DigitalOcean account.- Parameters:
name- Tag Name- Returns:
Delete- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.5
-
tagResources
Response tagResources(String name, List<Resource> resources) throws DigitalOceanException, RequestUnsuccessfulException Method tags a tag to given list of resources on DigitalOcean account.- Parameters:
name- Tag Nameresources- list of resource byResourceobjects- Returns:
Response- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.5
-
untagResources
Response untagResources(String name, List<Resource> resources) throws DigitalOceanException, RequestUnsuccessfulException Method untags a tag from given list of resources on DigitalOcean account.- Parameters:
name- Tag Nameresources- list of resource byResourceobjects- Returns:
Response- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.5
-
getAvailableVolumes
Volumes getAvailableVolumes(String regionSlug) throws DigitalOceanException, RequestUnsuccessfulException Method will list all of the Volumes available from your account.- Parameters:
regionSlug- is code name of the region aka DigitalOcean data centers- Returns:
Volumes- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.7
-
createVolume
Method creates new volume with given details- Parameters:
volume- details to create new volume- Returns:
Volume- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.7
-
getVolumeInfo
Method shows specific volume information by identifier- Parameters:
volumeId- volume identifier- Returns:
Volume- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.7
-
getVolumeInfo
Volumes getVolumeInfo(String volumeName, String regionSlug) throws DigitalOceanException, RequestUnsuccessfulException Method shows volume information by name and region slug- Parameters:
volumeName- name of the volumeregionSlug- is code name of the region aka DigitalOcean data centers- Returns:
Volumes- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.7
-
deleteVolume
Method deletes volume by identifier- Parameters:
volumeId- volume identifier- Returns:
Delete- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.7
-
deleteVolume
Delete deleteVolume(String volumeName, String regionSlug) throws DigitalOceanException, RequestUnsuccessfulException Method deletes volume by name and region slug- Parameters:
volumeName- name of the volumeregionSlug- is code name of the region aka DigitalOcean data centers- Returns:
Delete- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.7
-
attachVolume
Action attachVolume(Integer dropletId, String volumeId, String regionSlug) throws DigitalOceanException, RequestUnsuccessfulException Method attaches the given volume into droplet by identifier- Parameters:
dropletId- droplet identifiervolumeId- volume identifierregionSlug- is code name of the region aka DigitalOcean data centers- Returns:
Action- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method
-
attachVolumeByName
Action attachVolumeByName(Integer dropletId, String volumeName, String regionSlug) throws DigitalOceanException, RequestUnsuccessfulException Method attaches the given volume into droplet by name- Parameters:
dropletId- droplet identifiervolumeName- name of the volumeregionSlug- is code name of the region aka DigitalOcean data centers- Returns:
Action- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.7
-
detachVolume
Action detachVolume(Integer dropletId, String volumeId, String regionSlug) throws DigitalOceanException, RequestUnsuccessfulException Method detaches volume from the droplet by identifier- Parameters:
dropletId- droplet identifiervolumeId- volume identifierregionSlug- is code name of the region aka DigitalOcean data centers- Returns:
Action- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.7
-
detachVolumeByName
Action detachVolumeByName(Integer dropletId, String volumeName, String regionSlug) throws DigitalOceanException, RequestUnsuccessfulException Method detaches volume from the droplet by volume name- Parameters:
dropletId- droplet identifiervolumeName- name of the volumeregionSlug- is code name of the region aka DigitalOcean data centers- Returns:
Action- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.7
-
resizeVolume
Action resizeVolume(String volumeId, String regionSlug, Double sizeGigabytes) throws DigitalOceanException, RequestUnsuccessfulException Method resizes volume by identifier- Parameters:
volumeId- volume identifierregionSlug- is code name of the region aka DigitalOcean data centerssizeGigabytes- size value in GB- Returns:
Action- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.7
-
getAvailableVolumeActions
Actions getAvailableVolumeActions(String volumeId) throws DigitalOceanException, RequestUnsuccessfulException Method will get all the available volume action by volume identifier- Parameters:
volumeId- volume identifier- Returns:
Actions- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.7
-
getVolumeAction
Action getVolumeAction(String volumeId, Integer actionId) throws DigitalOceanException, RequestUnsuccessfulException Method returns specific volume action by action and volume identifier- Parameters:
volumeId- volume identifieractionId- the id of action- Returns:
Action- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.7
-
getVolumeSnapshots
Snapshots getVolumeSnapshots(String volumeId, Integer pageNo, Integer perPage) throws DigitalOceanException, RequestUnsuccessfulException Method return all of the snapshots for given volume Id- Parameters:
volumeId- volume identifierpageNo- for paginationperPage- no. of items per page- Returns:
Snapshots- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.8
-
takeVolumeSnapshot
Snapshot takeVolumeSnapshot(String volumeId, String snapshotName) throws DigitalOceanException, RequestUnsuccessfulException Method take snapshot of given volume Id- Parameters:
volumeId- volume identifiersnapshotName- the name the snapshot to be created- Returns:
Snapshot- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.8
-
getAvailableSnapshots
Snapshots getAvailableSnapshots(Integer pageNo, Integer perPage) throws DigitalOceanException, RequestUnsuccessfulException Method return all of the snapshots available on your account- Parameters:
pageNo- for paginationperPage- no. of items per page- Returns:
Snapshots- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.8
-
getAllDropletSnapshots
Snapshots getAllDropletSnapshots(Integer pageNo, Integer perPage) throws DigitalOceanException, RequestUnsuccessfulException Method return all of the droplet snapshots available on your account- Parameters:
pageNo- for paginationperPage- no. of items per page- Returns:
Snapshots- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.8
-
getAllVolumeSnapshots
Snapshots getAllVolumeSnapshots(Integer pageNo, Integer perPage) throws DigitalOceanException, RequestUnsuccessfulException Method return all of the volume snapshots available on your account- Parameters:
pageNo- for paginationperPage- no. of items per page- Returns:
Snapshots- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.8
-
getSnaphotInfo
Snapshot getSnaphotInfo(String snapshotId) throws DigitalOceanException, RequestUnsuccessfulException Method returns specific snapshot info by id- Parameters:
snapshotId- for snapshot- Returns:
Snapshot- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.8
-
deleteSnapshot
Method deletes snapshot by id- Parameters:
snapshotId- for snapsho- Returns:
Delete- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.8
-
createLoadBalancer
LoadBalancer createLoadBalancer(LoadBalancer loadBalancer) throws DigitalOceanException, RequestUnsuccessfulException Method allows you to add a new load balancer to distribute traffic across multiple Droplets.The LoadBalancer object passed in param can have a list of dropletIds set as dropletIds attribute. In this case, given Droplets will be assigned to the Load Balancer.
You may also use a Droplet tag to assign a group of Droplets to Load Balancer in place of a list of Droplet IDs. In this case, set the tag attribute of the LoadBalancer object passed in param.
- Parameters:
loadBalancer- the instance of the loadBalancer class- Returns:
LoadBalancer- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.11
-
getLoadBalancerInfo
LoadBalancer getLoadBalancerInfo(String loadBalancerId) throws DigitalOceanException, RequestUnsuccessfulException Method returns complete information for given load balancer ID.- Parameters:
loadBalancerId- the id of the droplet- Returns:
LoadBalancer- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.11
-
getAvailableLoadBalancers
LoadBalancers getAvailableLoadBalancers(Integer pageNo, Integer perPage) throws DigitalOceanException, RequestUnsuccessfulException Method returns all active loadbalancers that are currently running in your account. All available API information is presented for each loadbalancer.- Parameters:
pageNo- for paginationperPage- no. of items per page- Returns:
LoadBalancers- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.11
-
updateLoadBalancer
LoadBalancer updateLoadBalancer(LoadBalancer loadBalancer) throws DigitalOceanException, RequestUnsuccessfulException Method allows you to update an existign load balancer. The LoadBalancer object passed in param should contain a full representation of the Load Balancer including existing attributes. It may contain one of the dropletIds or tag parameter as they are mutually exclusive. Note that any attribute that is not provided will be reset to its default value.- Parameters:
loadBalancer- the instance of the loadBalancer class- Returns:
LoadBalancer- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.11
-
addDropletsToLoadBalancer
Response addDropletsToLoadBalancer(String loadBalancerId, List<Integer> dropletIds) throws DigitalOceanException, RequestUnsuccessfulException Method allows you to assign a Droplet to a Load Balancer instance.- Parameters:
loadBalancerId- the id of the loadBalancerdropletIds- an array containing the IDs of the Droplets to be assigned to the Load Balancer instance.- Returns:
Response- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.11
-
removeDropletsFromLoadBalancer
Delete removeDropletsFromLoadBalancer(String loadBalancerId, List<Integer> dropletIds) throws DigitalOceanException, RequestUnsuccessfulException Method allows you to remove a Droplet from a Load Balancer instance.- Parameters:
loadBalancerId- the id of the loadBalancerdropletIds- an array containing the IDs of the Droplets to be removed from the Load Balancer instance.- Returns:
Delete- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.11
-
addForwardingRulesToLoadBalancer
Response addForwardingRulesToLoadBalancer(String loadBalancerId, List<ForwardingRules> forwardingRules) throws DigitalOceanException, RequestUnsuccessfulException Method allows you to add an additional forwarding rule to a Load Balancer instance.- Parameters:
loadBalancerId- the id of the loadBalancerforwardingRules- an array containing the Forwarding Rules to add to the Load Balancer instance.- Returns:
Response- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.11
-
removeForwardingRulesFromLoadBalancer
Delete removeForwardingRulesFromLoadBalancer(String loadBalancerId, List<ForwardingRules> forwardingRules) throws DigitalOceanException, RequestUnsuccessfulException Method allows you to remove forwarding rules from a Load Balancer instance.- Parameters:
loadBalancerId- the id of the loadBalancerforwardingRules- an array containing the Forwarding Rules to remove from the Load Balancer instance.- Returns:
Delete- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.11
-
deleteLoadBalancer
Delete deleteLoadBalancer(String loadBalancerId) throws DigitalOceanException, RequestUnsuccessfulException Method allows you to delete a Load Balancer instance, disassociating any Droplets assigned to it and removing it from your account.- Parameters:
loadBalancerId- the id of the loadBalancer- Returns:
Delete- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.11
-
getAvailableCertificates
Certificates getAvailableCertificates(Integer pageNo, Integer perPage) throws DigitalOceanException, RequestUnsuccessfulException Method returns all available Certificates from your account.- Parameters:
pageNo- for paginationperPage- no. of items per page- Returns:
LoadBalancers- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.12
-
createCertificate
Certificate createCertificate(Certificate certificate) throws DigitalOceanException, RequestUnsuccessfulException Method allows you to create a new certificate. See the required parameters section below for an explanation of the variables that are needed to create a new certificate.Create a instance of
Certificateclass and populated the certificate object appropriately. Required values are -{ "name": "web-cert-01", "private_key": "-----BEGIN PRIVATE KEY----- ... -----END PRIVATE KEY-----", "leaf_certificate": "-----BEGIN CERTIFICATE----- ... -----END CERTIFICATE-----", "certificate_chain": "-----BEGIN CERTIFICATE----- ... -----END CERTIFICATE-----" }- Parameters:
certificate- the instance of the Certificate class- Returns:
Certificate- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.12
-
createLetsEncryptCertificate
Certificate createLetsEncryptCertificate(Certificate certificate) throws DigitalOceanException, RequestUnsuccessfulException Method allows you to create a new Let's Encrypt certificate. See the required parameters section below for an explanation of the variables that are needed to create a new Let's Encrypt certificate.Create a instance of
Certificateclass and populated the certificate object appropriately. Required values are -{ "name": "le-cert-01", "type": "lets_encrypt", "dns_names": ["www.example.com","example.com"] }- Parameters:
certificate- the instance of the Certificate class- Returns:
Certificate- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.12
-
getCertificateInfo
Certificate getCertificateInfo(String certificateId) throws DigitalOceanException, RequestUnsuccessfulException Method returns the Certificate information for given certificate ID.- Parameters:
certificateId- the id of the certificate- Returns:
Certificate- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.12
-
deleteCertificate
Delete deleteCertificate(String certificateId) throws DigitalOceanException, RequestUnsuccessfulException Method allows you to delete a Certificate by Id from your account.- Parameters:
certificateId- the id of the certificate- Returns:
Delete- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.12
-
createFirewall
Firewall createFirewall(Firewall firewall) throws DigitalOceanException, RequestUnsuccessfulException Method allows you to add a new firewall to restrict network access to and from a Droplet.The Firewall object passed in param can have a list of dropletIds set as dropletIds attribute. In this case, given Droplets will use the Firewall rules.
You may also use a Droplet tag to assign a group of Droplets to use the Firewall in place of a list of Droplet IDs. In this case, set the tag attribute of the Firewall object passed in param.
- Parameters:
firewall- the instance of the firewall class- Returns:
Firewall- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.16
-
getFirewallInfo
Firewall getFirewallInfo(String firewallId) throws DigitalOceanException, RequestUnsuccessfulException Method returns complete information for given firewall ID.- Parameters:
firewallId- the id of the firewall- Returns:
Firewall- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.16
-
updateFirewall
Firewall updateFirewall(Firewall firewall) throws DigitalOceanException, RequestUnsuccessfulException Method allows you to update an existing fireawll. The Firewall object passed in param should contain a full representation of the Firewall including existing attributes. It may contain one of the dropletIds or tag parameter as they are mutually exclusive. Note that any attribute that is not provided will be reset to its default value.- Parameters:
firewall- the instance of the firewall class- Returns:
Firewall- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.16
-
deleteFirewall
Method allows you to delete a Firewall instance, disassociating any Droplets assigned to it and removing it from your account.- Parameters:
firewallId- the id of the firewall- Returns:
Delete- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.16
-
addDropletsToFirewall
Response addDropletsToFirewall(String firewallId, List<Integer> dropletIds) throws DigitalOceanException, RequestUnsuccessfulException - Parameters:
firewallId- the id of the firewall to add droplets todropletIds- the list of of droplet IDs to add to the firewall- Returns:
ResponseA generic HTTP status response- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.17
-
removeDropletsFromFirewall
Delete removeDropletsFromFirewall(String firewallId, List<Integer> dropletIds) throws DigitalOceanException, RequestUnsuccessfulException Method allows you to remove a Droplet from a Load Balancer instance.- Parameters:
firewallId- the id of the firewalldropletIds- the list of droplet IDs to be removed from the firewall instance.- Returns:
Delete- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.17
-
getAvailableFirewalls
Firewalls getAvailableFirewalls(Integer pageNo, Integer perPage) throws DigitalOceanException, RequestUnsuccessfulException Method returns all available firewalls that are currently running in your account. All available API information is presented for each firewall.- Parameters:
pageNo- for paginationperPage- no. of items per page- Returns:
Firewalls- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method- Since:
- v2.16
-
createProject
Method allows you to create a new project.- Parameters:
project- the project- Returns:
Project- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method
-
getAvailableProjects
Method allows you to get all the projects.- Returns:
Projects- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method
-
updateProject
-
patchProject
-
getProject
-
getDefaultProject
-
updateDefaultProject
Project updateDefaultProject(Project project) throws DigitalOceanException, RequestUnsuccessfulException -
patchDefaultProject
Project patchDefaultProject(Project project) throws DigitalOceanException, RequestUnsuccessfulException -
deleteProject
-