问题
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.
回答1:
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
来源:https://stackoverflow.com/questions/25739119/simple-program-to-access-digitalocean-droplet-information-in-java