I am new to DigitalOcean.I would like to run basic java program to access DigitalOcean droplet. please let me know step by step procedure.
-
What is the need to access droplet through Java Code when they have already provide web interface or you can use different other tools ? – JavaBeigner Sep 09 '14 at 07:40
-
@askkuber because OP is a Programmer – Baby Sep 09 '14 at 07:42
-
i am new to this concept and don't know about any kind of tool. what kind of web interface may i use? i didn't get perfect tutorial for digitalocean java API? can u suggest me a link to know more about how can i access droplets using java API? – user3698866 Sep 09 '14 at 07:59
-
I think already answered – JavaBeigner Sep 09 '14 at 08:02
1 Answers
You can get information about your droplets using their official API. It is a simple REST api which you can call using Java's URL
class.
More about howto make HTTP GET using Java:
Using java.net.URLConnection to fire and handle HTTP requests
For simple retrieval of information about your account, Droplets etc. you should use the GET
method. The information you request will be returned to you as a JSON object. You can find numerous JSON libraries for Java (e.g. json.org/java).
API docs
Documentation of DigitalOcean API:
https://developers.digitalocean.com/
Documention section related to Droplets:
https://developers.digitalocean.com/#droplets
List of all Droplets:
https://developers.digitalocean.com/#list-all-droplets
Retrieve an existing Droplet by id:
https://developers.digitalocean.com/#retrieve-an-existing-droplet-by-id