Class DigitalOceanClient
- All Implemented Interfaces:
Constants,DigitalOcean
- Author:
- Jeevanandam M. (jeeva@myjeeva.com)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringDigitalOcean API Host isapi.digitalocean.comprotected StringDigitalOcean API version.protected StringOAuth Authorization Token for Accessing DigitalOcean APIprotected org.apache.http.impl.client.CloseableHttpClientHttp clientFields inherited from interface com.myjeeva.digitalocean.common.Constants
DATE_FORMAT, DEFAULT_PAGE_SIZE, FORM_URLENCODED_CONTENT_TYPE, HDR_AUTHORIZATION, HDR_CONTENT_TYPE, HDR_RATE_LIMIT, HDR_RATE_REMAINING, HDR_RATE_RESET, HDR_USER_AGENT, HTTPS_SCHEME, JSON_CONTENT_TYPE, LINKS_ELEMENT_NAME, META_ELEMENT_NAME, NO_CONTENT_JSON_STRUCT, PARAM_PAGE_NO, PARAM_PER_PAGE, RATE_LIMIT_ELEMENT_NAME, RATE_LIMIT_JSON_STRUCT, START_PAGE_NO, URL_PATH_SEPARATOR, USER_AGENT, UTF_8 -
Constructor Summary
ConstructorsConstructorDescriptionDigitalOceanClient(String authToken) DigitalOcean Client ConstructorDigitalOceanClient(String apiVersion, String authToken) DigitalOcean Client ConstructorDigitalOceanClient(String apiVersion, String authToken, org.apache.http.impl.client.CloseableHttpClient httpClient) DigitalOcean Client Constructor -
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 IPorg.apache.http.client.HttpClientgetImageInfo(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) perform(ApiRequest request) 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.voidsetApiVersion(String apiVersion) voidsetAuthToken(String authToken) voidsetHttpClient(org.apache.http.impl.client.CloseableHttpClient httpClient) 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)
-
Field Details
-
httpClient
protected org.apache.http.impl.client.CloseableHttpClient httpClientHttp client -
authToken
OAuth Authorization Token for Accessing DigitalOcean API -
apiVersion
DigitalOcean API version. defaults to v2 from constructor -
apiHost
DigitalOcean API Host isapi.digitalocean.com
-
-
Constructor Details
-
DigitalOceanClient
DigitalOcean Client Constructor- Parameters:
authToken- aStringobject
-
DigitalOceanClient
DigitalOcean Client Constructor -
DigitalOceanClient
public DigitalOceanClient(String apiVersion, String authToken, org.apache.http.impl.client.CloseableHttpClient httpClient) DigitalOcean Client Constructor
-
-
Method Details
-
getHttpClient
public org.apache.http.client.HttpClient getHttpClient()- Returns:
- the httpClient
-
setHttpClient
public void setHttpClient(org.apache.http.impl.client.CloseableHttpClient httpClient) - Parameters:
httpClient- the httpClient to set
-
getAuthToken
- Returns:
- the authToken
-
setAuthToken
- Parameters:
authToken- the authToken to set
-
getApiVersion
- Returns:
- the apiVersion
-
setApiVersion
- Parameters:
apiVersion- the apiVersion to set
-
getAvailableDroplets
public Droplets getAvailableDroplets(Integer pageNo, Integer perPage) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod returns all active droplets that are currently running in your account. All available API information is presented for each droplet.- Specified by:
getAvailableDropletsin interfaceDigitalOcean- 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
-
getDropletKernels
public Kernels getDropletKernels(Integer dropletId, Integer pageNo, Integer perPage) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod returns all available kernels for given droplet ID- Specified by:
getDropletKernelsin interfaceDigitalOcean- 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
-
getDropletSnapshots
public Snapshots getDropletSnapshots(Integer dropletId, Integer pageNo, Integer perPage) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod returns all available snapshots for given droplet ID- Specified by:
getDropletSnapshotsin interfaceDigitalOcean- 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
-
getDropletBackups
public Backups getDropletBackups(Integer dropletId, Integer pageNo, Integer perPage) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod returns all available snapshots for given droplet ID- Specified by:
getDropletBackupsin interfaceDigitalOcean- 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
-
getDropletInfo
public Droplet getDropletInfo(Integer dropletId) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod returns complete information for given droplet ID- Specified by:
getDropletInfoin interfaceDigitalOcean- 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
-
createDroplet
public Droplet createDroplet(Droplet droplet) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod 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 }- Specified by:
createDropletin interfaceDigitalOcean- 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
-
createDroplets
public Droplets createDroplets(Droplet droplet) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod 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 }- Specified by:
createDropletsin interfaceDigitalOcean- 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
-
deleteDroplet
public Delete deleteDroplet(Integer dropletId) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod destroys one of your droplet; this is irreversible.- Specified by:
deleteDropletin interfaceDigitalOcean- 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
-
deleteDropletByTagName
public Delete deleteDropletByTagName(String tagName) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod destroys one or more of your droplet by given tag name; this is irreversible.- Specified by:
deleteDropletByTagNamein interfaceDigitalOcean- 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
-
getDropletNeighbors
public Droplets getDropletNeighbors(Integer dropletId, Integer pageNo) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanFor 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).- Specified by:
getDropletNeighborsin interfaceDigitalOcean- 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
-
getAllDropletNeighbors
public Neighbors getAllDropletNeighbors(Integer pageNo) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanFor 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).- Specified by:
getAllDropletNeighborsin interfaceDigitalOcean- 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
-
getAvailableDropletsByTagName
public Droplets getAvailableDropletsByTagName(String tagName, Integer pageNo, Integer perPage) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanTo 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.
- Specified by:
getAvailableDropletsByTagNamein interfaceDigitalOcean- 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
-
rebootDroplet
public Action rebootDroplet(Integer dropletId) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod allows you to reboot a droplet. This is the preferred method to use if a server is not responding.- Specified by:
rebootDropletin interfaceDigitalOcean- 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
-
powerCycleDroplet
public Action powerCycleDroplet(Integer dropletId) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod allows you to power cycle a droplet. This will turn off the droplet and then turn it back on.- Specified by:
powerCycleDropletin interfaceDigitalOcean- 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
-
shutdownDroplet
public Action shutdownDroplet(Integer dropletId) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod allows you to shutdown a running droplet.- Specified by:
shutdownDropletin interfaceDigitalOcean- 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
-
powerOffDroplet
public Action powerOffDroplet(Integer dropletId) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod allows you to poweroff a running droplet.- Specified by:
powerOffDropletin interfaceDigitalOcean- 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
-
powerOnDroplet
public Action powerOnDroplet(Integer dropletId) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod allows you to poweron a powered off droplet.- Specified by:
powerOnDropletin interfaceDigitalOcean- 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
-
resetDropletPassword
public Action resetDropletPassword(Integer dropletId) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod will reset the root password for a droplet. Please be aware that this will reboot the droplet to allow resetting the password.- Specified by:
resetDropletPasswordin interfaceDigitalOcean- 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
-
resizeDroplet
public Action resizeDroplet(Integer dropletId, String size) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod allows you to resize a specific droplet to a different size. This will affect the number of processors and memory allocated to the droplet.- Specified by:
resizeDropletin interfaceDigitalOcean- 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
-
resizeDroplet
public Action resizeDroplet(Integer dropletId, String size, Boolean disk) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod 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.- Specified by:
resizeDropletin interfaceDigitalOcean- 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
-
takeDropletSnapshot
public Action takeDropletSnapshot(Integer dropletId) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod 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.- Specified by:
takeDropletSnapshotin interfaceDigitalOcean- 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
-
takeDropletSnapshot
public Action takeDropletSnapshot(Integer dropletId, String snapshotName) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod 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.- Specified by:
takeDropletSnapshotin interfaceDigitalOcean- 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
-
restoreDroplet
public Action restoreDroplet(Integer dropletId, Integer imageId) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod 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.- Specified by:
restoreDropletin interfaceDigitalOcean- 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
-
rebuildDroplet
public Action rebuildDroplet(Integer dropletId, Integer imageId) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod 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.- Specified by:
rebuildDropletin interfaceDigitalOcean- 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
-
enableDropletBackups
public Action enableDropletBackups(Integer dropletId) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod enables automatic backups for your droplet's data.- Specified by:
enableDropletBackupsin interfaceDigitalOcean- 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
-
disableDropletBackups
public Action disableDropletBackups(Integer dropletId) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod disables automatic backups from running to backup your droplet's data.- Specified by:
disableDropletBackupsin interfaceDigitalOcean- 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
-
renameDroplet
public Action renameDroplet(Integer dropletId, String name) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod renames the droplet to the specified name.- Specified by:
renameDropletin interfaceDigitalOcean- 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
-
changeDropletKernel
public Action changeDropletKernel(Integer dropletId, Integer kernelId) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod changes a OS kernel for given droplet- Specified by:
changeDropletKernelin interfaceDigitalOcean- 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
-
enableDropletIpv6
public Action enableDropletIpv6(Integer dropletId) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanEnabling IP v6 networking capability for droplet. It may be dependent on Data Center Features.- Specified by:
enableDropletIpv6in interfaceDigitalOcean- 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
public Action enableDropletPrivateNetworking(Integer dropletId) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanEnabling private networking capability for droplet. It may be dependent on Data Center Features.- Specified by:
enableDropletPrivateNetworkingin interfaceDigitalOcean- 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
-
getAccountInfo
Description copied from interface:DigitalOceanMethod returns account information for provided credentials- Specified by:
getAccountInfoin interfaceDigitalOcean- Returns:
- $
Account - Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method
-
getAvailableActions
public Actions getAvailableActions(Integer pageNo, Integer perPage) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod return all the action informations, regardless of categories.- Specified by:
getAvailableActionsin interfaceDigitalOcean- 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
-
getActionInfo
public Action getActionInfo(Integer actionId) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanTo retrieve a specific action information by action ID- Specified by:
getActionInfoin interfaceDigitalOcean- 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
-
getAvailableDropletActions
public Actions getAvailableDropletActions(Integer dropletId, Integer pageNo, Integer perPage) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod return all the action informations; specific to given Droplet Id- Specified by:
getAvailableDropletActionsin interfaceDigitalOcean- 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
-
getAvailableImageActions
public Actions getAvailableImageActions(Integer imageId, Integer pageNo, Integer perPage) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod return all the action informations; specific to given Image Id- Specified by:
getAvailableImageActionsin interfaceDigitalOcean- 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
-
getAvailableFloatingIPActions
public Actions getAvailableFloatingIPActions(String ipAddress, Integer pageNo, Integer perPage) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod retrives all actions that have been executed on a Floating IP address.- Specified by:
getAvailableFloatingIPActionsin interfaceDigitalOcean- 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
-
getFloatingIPActionInfo
public Action getFloatingIPActionInfo(String ipAddress, Integer actionId) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod to retrieve the status of a Floating IP action.- Specified by:
getFloatingIPActionInfoin interfaceDigitalOcean- 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
-
getAvailableVolumeActions
public Actions getAvailableVolumeActions(String volumeId) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod will get all the available volume action by volume identifier- Specified by:
getAvailableVolumeActionsin interfaceDigitalOcean- 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
-
getVolumeAction
public Action getVolumeAction(String volumeId, Integer actionId) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod returns specific volume action by action and volume identifier- Specified by:
getVolumeActionin interfaceDigitalOcean- 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
-
getAvailableImages
public Images getAvailableImages(Integer pageNo, Integer perPage) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod 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.- Specified by:
getAvailableImagesin interfaceDigitalOcean- 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
-
getAvailableImages
public Images getAvailableImages(Integer pageNo, Integer perPage, ActionType type) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod returns all the available images based ontype={distribution or application}that can be accessed by your OAuth Token.- Specified by:
getAvailableImagesin interfaceDigitalOcean- 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
-
getUserImages
public Images getUserImages(Integer pageNo, Integer perPage) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod retrieves only the private images of a user- Specified by:
getUserImagesin interfaceDigitalOcean- 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
public Image getImageInfo(Integer imageId) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod retrieves the attributes of an image.- Specified by:
getImageInfoin interfaceDigitalOcean- 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
-
getImageInfo
Description copied from interface:DigitalOceanMethod retrieves the attributes of an image.- Specified by:
getImageInfoin interfaceDigitalOcean- 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
-
createCustomImage
public Image createCustomImage(Image image) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod 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" ] }- Specified by:
createCustomImagein interfaceDigitalOcean- 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
-
updateImage
Description copied from interface:DigitalOceanMethod updates the given details for an image.- Specified by:
updateImagein interfaceDigitalOcean- 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
-
deleteImage
public Delete deleteImage(Integer imageId) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod 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.- Specified by:
deleteImagein interfaceDigitalOcean- 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
-
transferImage
public Action transferImage(Integer imageId, String regionSlug) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod allows you to transfer an image to a specified region.- Specified by:
transferImagein interfaceDigitalOcean- 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
-
convertImage
public Action convertImage(Integer imageId) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod allows you to convert image into snapshot- Specified by:
convertImagein interfaceDigitalOcean- 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
-
getAvailableRegions
public Regions getAvailableRegions(Integer pageNo) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod returns all the available regions within the DigitalOcean cloud.- Specified by:
getAvailableRegionsin interfaceDigitalOcean- 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
-
getAvailableSizes
public Sizes getAvailableSizes(Integer pageNo) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod returns all the available sizes that can be used to create a droplet.- Specified by:
getAvailableSizesin interfaceDigitalOcean- 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
-
getAvailableDomains
public Domains getAvailableDomains(Integer pageNo) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod returns all of your available domains from DNS control panel- Specified by:
getAvailableDomainsin interfaceDigitalOcean- 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
-
getDomainInfo
public Domain getDomainInfo(String domainName) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod returns the specified domain attributes and zone file info.- Specified by:
getDomainInfoin interfaceDigitalOcean- 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
-
createDomain
public Domain createDomain(Domain domain) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod creates a new domain name with an A record for the specified [ip_address].- Specified by:
createDomainin interfaceDigitalOcean- 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
-
deleteDomain
public Delete deleteDomain(String domainName) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod deletes the specified domain from DNS control panel- Specified by:
deleteDomainin interfaceDigitalOcean- 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
-
getDomainRecords
public DomainRecords getDomainRecords(String domainName, Integer pageNo, Integer perPage) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod returns all of your current domain records from DNS control panel for given domain.- Specified by:
getDomainRecordsin interfaceDigitalOcean- 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
-
getDomainRecordInfo
public DomainRecord getDomainRecordInfo(String domainName, Integer recordId) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod returns the specified domain record.- Specified by:
getDomainRecordInfoin interfaceDigitalOcean- 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
-
createDomainRecord
public DomainRecord createDomainRecord(String domainName, DomainRecord domainRecord) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod creates a new domain record name with an given domain record values- Specified by:
createDomainRecordin interfaceDigitalOcean- 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
-
updateDomainRecord
public DomainRecord updateDomainRecord(String domainName, Integer recordId, DomainRecord domainRecord) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanmethod edits an existing domain record of the given domain.- Specified by:
updateDomainRecordin interfaceDigitalOcean- 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
-
deleteDomainRecord
public Delete deleteDomainRecord(String domainName, Integer recordId) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod deletes the specified domain record from domain.- Specified by:
deleteDomainRecordin interfaceDigitalOcean- 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
-
getAvailableKeys
public Keys getAvailableKeys(Integer pageNo) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod lists all the available public SSH keys in your account that can be added to a droplet.- Specified by:
getAvailableKeysin interfaceDigitalOcean- 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
-
getKeyInfo
Description copied from interface:DigitalOceanMethod shows a specific public SSH key information from your account that can be added to a droplet.- Specified by:
getKeyInfoin interfaceDigitalOcean- 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
-
getKeyInfo
public Key getKeyInfo(String fingerprint) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod shows a specific public SSH key information from your account that can be added to a droplet.- Specified by:
getKeyInfoin interfaceDigitalOcean- 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
-
createKey
Description copied from interface:DigitalOceanMethod allows you to add a new public SSH key to your account- Specified by:
createKeyin interfaceDigitalOcean- 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
-
updateKey
public Key updateKey(Integer sshKeyId, String newSshKeyName) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod allows you to modify an existing SSH key in your account.- Specified by:
updateKeyin interfaceDigitalOcean- 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
-
updateKey
public Key updateKey(String fingerprint, String newSshKeyName) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod allows you to modify an existing SSH key in your account.- Specified by:
updateKeyin interfaceDigitalOcean- 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
-
deleteKey
public Delete deleteKey(Integer sshKeyId) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod will delete the SSH key from your account.- Specified by:
deleteKeyin interfaceDigitalOcean- 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
-
deleteKey
public Delete deleteKey(String fingerprint) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod will delete the SSH key from your account.- Specified by:
deleteKeyin interfaceDigitalOcean- 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
-
getAvailableFloatingIPs
public FloatingIPs getAvailableFloatingIPs(Integer pageNo, Integer perPage) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod will list all of the Floating IPs available from your account.- Specified by:
getAvailableFloatingIPsin interfaceDigitalOcean- 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
-
createFloatingIP
public FloatingIP createFloatingIP(Integer dropletId) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod creates a new Floating IP and assigns to the Droplet.- Specified by:
createFloatingIPin interfaceDigitalOcean- 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
-
createFloatingIP
public FloatingIP createFloatingIP(String region) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod creates a new Floating IP and its reserved to a Region- Specified by:
createFloatingIPin interfaceDigitalOcean- 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
-
getFloatingIPInfo
public FloatingIP getFloatingIPInfo(String ipAddress) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod retrieves the information about given Floating IP- Specified by:
getFloatingIPInfoin interfaceDigitalOcean- 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
-
deleteFloatingIP
public Delete deleteFloatingIP(String ipAddress) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod deletes the Floating IP and removes it from your account.- Specified by:
deleteFloatingIPin interfaceDigitalOcean- 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
-
assignFloatingIP
public Action assignFloatingIP(Integer dropletId, String ipAddress) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod will assign Floating IP to a Droplet.- Specified by:
assignFloatingIPin interfaceDigitalOcean- 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
-
unassignFloatingIP
public Action unassignFloatingIP(String ipAddress) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod will unassign Floating IP from a Droplet. The Floating IP will be reserved in the region but not assigned to a Droplet.- Specified by:
unassignFloatingIPin interfaceDigitalOcean- 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
-
getAvailableTags
public Tags getAvailableTags(Integer pageNo, Integer perPage) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod will list all of the Tags available from your account.- Specified by:
getAvailableTagsin interfaceDigitalOcean- 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
-
createTag
Description copied from interface:DigitalOceanMethod will create a Tag on DigitalOcean aacount.- Specified by:
createTagin interfaceDigitalOcean- 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
-
getTag
Description copied from interface:DigitalOceanMethod retrieves the Tag from DigitalOcean account.- Specified by:
getTagin interfaceDigitalOcean- 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
-
deleteTag
Description copied from interface:DigitalOceanMethod deletes the existing Tag from DigitalOcean account.- Specified by:
deleteTagin interfaceDigitalOcean- 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
-
tagResources
public Response tagResources(String name, List<Resource> resources) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod tags a tag to given list of resources on DigitalOcean account.- Specified by:
tagResourcesin interfaceDigitalOcean- 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
-
untagResources
public Response untagResources(String name, List<Resource> resources) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod untags a tag from given list of resources on DigitalOcean account.- Specified by:
untagResourcesin interfaceDigitalOcean- 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
-
getAvailableVolumes
public Volumes getAvailableVolumes(String regionSlug) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod will list all of the Volumes available from your account.- Specified by:
getAvailableVolumesin interfaceDigitalOcean- 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
-
createVolume
public Volume createVolume(Volume volume) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod creates new volume with given details- Specified by:
createVolumein interfaceDigitalOcean- 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
-
getVolumeInfo
public Volume getVolumeInfo(String volumeId) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod shows specific volume information by identifier- Specified by:
getVolumeInfoin interfaceDigitalOcean- 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
-
getVolumeInfo
public Volumes getVolumeInfo(String volumeName, String regionSlug) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod shows volume information by name and region slug- Specified by:
getVolumeInfoin interfaceDigitalOcean- 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
-
deleteVolume
public Delete deleteVolume(String volumeId) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod deletes volume by identifier- Specified by:
deleteVolumein interfaceDigitalOcean- 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
-
deleteVolume
public Delete deleteVolume(String volumeName, String regionSlug) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod deletes volume by name and region slug- Specified by:
deleteVolumein interfaceDigitalOcean- 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
-
attachVolume
public Action attachVolume(Integer dropletId, String volumeId, String regionSlug) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod attaches the given volume into droplet by identifier- Specified by:
attachVolumein interfaceDigitalOcean- 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
public Action attachVolumeByName(Integer dropletId, String volumeName, String regionSlug) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod attaches the given volume into droplet by name- Specified by:
attachVolumeByNamein interfaceDigitalOcean- 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
-
detachVolume
public Action detachVolume(Integer dropletId, String volumeId, String regionSlug) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod detaches volume from the droplet by identifier- Specified by:
detachVolumein interfaceDigitalOcean- 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
-
detachVolumeByName
public Action detachVolumeByName(Integer dropletId, String volumeName, String regionSlug) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod detaches volume from the droplet by volume name- Specified by:
detachVolumeByNamein interfaceDigitalOcean- 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
-
resizeVolume
public Action resizeVolume(String volumeId, String regionSlug, Double sizeGigabytes) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod resizes volume by identifier- Specified by:
resizeVolumein interfaceDigitalOcean- 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
-
getVolumeSnapshots
public Snapshots getVolumeSnapshots(String volumeId, Integer pageNo, Integer perPage) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod return all of the snapshots for given volume Id- Specified by:
getVolumeSnapshotsin interfaceDigitalOcean- 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
-
takeVolumeSnapshot
public Snapshot takeVolumeSnapshot(String volumeId, String snapshotName) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod take snapshot of given volume Id- Specified by:
takeVolumeSnapshotin interfaceDigitalOcean- 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
-
getAvailableSnapshots
public Snapshots getAvailableSnapshots(Integer pageNo, Integer perPage) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod return all of the snapshots available on your account- Specified by:
getAvailableSnapshotsin interfaceDigitalOcean- 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
-
getAllDropletSnapshots
public Snapshots getAllDropletSnapshots(Integer pageNo, Integer perPage) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod return all of the droplet snapshots available on your account- Specified by:
getAllDropletSnapshotsin interfaceDigitalOcean- 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
-
getAllVolumeSnapshots
public Snapshots getAllVolumeSnapshots(Integer pageNo, Integer perPage) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod return all of the volume snapshots available on your account- Specified by:
getAllVolumeSnapshotsin interfaceDigitalOcean- 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
-
getSnaphotInfo
public Snapshot getSnaphotInfo(String snapshotId) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod returns specific snapshot info by id- Specified by:
getSnaphotInfoin interfaceDigitalOcean- 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
-
deleteSnapshot
public Delete deleteSnapshot(String snapshotId) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod deletes snapshot by id- Specified by:
deleteSnapshotin interfaceDigitalOcean- 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
-
createLoadBalancer
public LoadBalancer createLoadBalancer(LoadBalancer loadBalancer) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod 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.
- Specified by:
createLoadBalancerin interfaceDigitalOcean- 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
-
getLoadBalancerInfo
public LoadBalancer getLoadBalancerInfo(String loadBalancerId) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod returns complete information for given load balancer ID.- Specified by:
getLoadBalancerInfoin interfaceDigitalOcean- 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
-
getAvailableLoadBalancers
public LoadBalancers getAvailableLoadBalancers(Integer pageNo, Integer perPage) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod returns all active loadbalancers that are currently running in your account. All available API information is presented for each loadbalancer.- Specified by:
getAvailableLoadBalancersin interfaceDigitalOcean- 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
-
updateLoadBalancer
public LoadBalancer updateLoadBalancer(LoadBalancer loadBalancer) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod 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.- Specified by:
updateLoadBalancerin interfaceDigitalOcean- 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
-
addDropletsToLoadBalancer
public Response addDropletsToLoadBalancer(String loadBalancerId, List<Integer> dropletIds) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod allows you to assign a Droplet to a Load Balancer instance.- Specified by:
addDropletsToLoadBalancerin interfaceDigitalOcean- 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
-
removeDropletsFromLoadBalancer
public Delete removeDropletsFromLoadBalancer(String loadBalancerId, List<Integer> dropletIds) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod allows you to remove a Droplet from a Load Balancer instance.- Specified by:
removeDropletsFromLoadBalancerin interfaceDigitalOcean- 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
-
addForwardingRulesToLoadBalancer
public Response addForwardingRulesToLoadBalancer(String loadBalancerId, List<ForwardingRules> forwardingRules) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod allows you to add an additional forwarding rule to a Load Balancer instance.- Specified by:
addForwardingRulesToLoadBalancerin interfaceDigitalOcean- 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
-
removeForwardingRulesFromLoadBalancer
public Delete removeForwardingRulesFromLoadBalancer(String loadBalancerId, List<ForwardingRules> forwardingRules) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod allows you to remove forwarding rules from a Load Balancer instance.- Specified by:
removeForwardingRulesFromLoadBalancerin interfaceDigitalOcean- 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
-
deleteLoadBalancer
public Delete deleteLoadBalancer(String loadBalancerId) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod allows you to delete a Load Balancer instance, disassociating any Droplets assigned to it and removing it from your account.- Specified by:
deleteLoadBalancerin interfaceDigitalOcean- 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
-
getAvailableCertificates
public Certificates getAvailableCertificates(Integer pageNo, Integer perPage) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod returns all available Certificates from your account.- Specified by:
getAvailableCertificatesin interfaceDigitalOcean- 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
-
createCertificate
public Certificate createCertificate(Certificate certificate) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod 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-----" }- Specified by:
createCertificatein interfaceDigitalOcean- 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
-
createLetsEncryptCertificate
public Certificate createLetsEncryptCertificate(Certificate certificate) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod 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"] }- Specified by:
createLetsEncryptCertificatein interfaceDigitalOcean- 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
-
getCertificateInfo
public Certificate getCertificateInfo(String certificateId) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod returns the Certificate information for given certificate ID.- Specified by:
getCertificateInfoin interfaceDigitalOcean- 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
-
deleteCertificate
public Delete deleteCertificate(String certificateId) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod allows you to delete a Certificate by Id from your account.- Specified by:
deleteCertificatein interfaceDigitalOcean- 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
-
createFirewall
public Firewall createFirewall(Firewall firewall) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod 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.
- Specified by:
createFirewallin interfaceDigitalOcean- 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
-
getFirewallInfo
public Firewall getFirewallInfo(String firewallId) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod returns complete information for given firewall ID.- Specified by:
getFirewallInfoin interfaceDigitalOcean- 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
-
updateFirewall
public Firewall updateFirewall(Firewall firewall) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod 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.- Specified by:
updateFirewallin interfaceDigitalOcean- 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
-
deleteFirewall
public Delete deleteFirewall(String firewallId) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod allows you to delete a Firewall instance, disassociating any Droplets assigned to it and removing it from your account.- Specified by:
deleteFirewallin interfaceDigitalOcean- 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
-
addDropletsToFirewall
public Response addDropletsToFirewall(String firewallId, List<Integer> dropletIds) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOcean- Specified by:
addDropletsToFirewallin interfaceDigitalOcean- 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
-
removeDropletsFromFirewall
public Delete removeDropletsFromFirewall(String firewallId, List<Integer> dropletIds) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod allows you to remove a Droplet from a Load Balancer instance.- Specified by:
removeDropletsFromFirewallin interfaceDigitalOcean- 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
-
getAvailableFirewalls
public Firewalls getAvailableFirewalls(Integer pageNo, Integer perPage) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod returns all available firewalls that are currently running in your account. All available API information is presented for each firewall.- Specified by:
getAvailableFirewallsin interfaceDigitalOcean- 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
-
createProject
public Project createProject(Project project) throws DigitalOceanException, RequestUnsuccessfulException Description copied from interface:DigitalOceanMethod allows you to create a new project.- Specified by:
createProjectin interfaceDigitalOcean- 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
Description copied from interface:DigitalOceanMethod allows you to get all the projects.- Specified by:
getAvailableProjectsin interfaceDigitalOcean- Returns:
Projects- Throws:
DigitalOceanException- if request had interruption [HTTP status code >= 400 && < 510]RequestUnsuccessfulException- if any RESTful request unsuccessful from wrapper method
-
updateProject
public Project updateProject(Project project) throws DigitalOceanException, RequestUnsuccessfulException - Specified by:
updateProjectin interfaceDigitalOcean- Throws:
DigitalOceanExceptionRequestUnsuccessfulException
-
patchProject
public Project patchProject(Project project) throws DigitalOceanException, RequestUnsuccessfulException - Specified by:
patchProjectin interfaceDigitalOcean- Throws:
DigitalOceanExceptionRequestUnsuccessfulException
-
getProject
public Project getProject(String projectId) throws DigitalOceanException, RequestUnsuccessfulException - Specified by:
getProjectin interfaceDigitalOcean- Throws:
DigitalOceanExceptionRequestUnsuccessfulException
-
getDefaultProject
- Specified by:
getDefaultProjectin interfaceDigitalOcean- Throws:
DigitalOceanExceptionRequestUnsuccessfulException
-
updateDefaultProject
public Project updateDefaultProject(Project project) throws DigitalOceanException, RequestUnsuccessfulException - Specified by:
updateDefaultProjectin interfaceDigitalOcean- Throws:
DigitalOceanExceptionRequestUnsuccessfulException
-
patchDefaultProject
public Project patchDefaultProject(Project project) throws DigitalOceanException, RequestUnsuccessfulException - Specified by:
patchDefaultProjectin interfaceDigitalOcean- Throws:
DigitalOceanExceptionRequestUnsuccessfulException
-
deleteProject
public Delete deleteProject(String projectId) throws DigitalOceanException, RequestUnsuccessfulException - Specified by:
deleteProjectin interfaceDigitalOcean- Throws:
DigitalOceanExceptionRequestUnsuccessfulException
-
perform
public ApiResponse perform(ApiRequest request) throws DigitalOceanException, RequestUnsuccessfulException
-