digitalocean api使用方法

通过api调用管理digitalocean vps是非常有效的好办法,你可以在api基础上开发第三方工具,比如iPhone平台的digitalocean app就是第三方开发的。

如何使用api呢,打开digitalocean后台控制面板,左侧有个API按钮,第一次使用时,你需要生成自己的api key,每个digitalocean用户都有自己唯一的client ID

举例:显示某个用户所有的vps:

调用地址

https://api.digitalocean.com/droplets/?client_id=[your_client_id]&api_key=[your_api_key]

响应代码:
{
  "status": "OK",
  "droplets": [
    {
      "id": 100823,
      "name": "test222",
      "image_id": 420,
      "size_id":33,
      "region_id": 1,
      "backups_active": false,
      "ip_address": "127.0.0.1",
      "private_ip_address": null,
      "locked": false,
      "status": "active",
      "created_at": "2013-01-01T09:30:00Z"
    }
  ]
}

digitalocean全部api参数可在这里找到

https://developers.digitalocean.com

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts

Begin typing your search term above and press enter to search. Press ESC to cancel.