82.17. 例子
获取您的帐户信息
from("direct:getAccountInfo") .setHeader(DigitalOceanConstants.OPERATION, constant(DigitalOceanOperations.get)) .to("digitalocean:account?oAuthToken=XXXXXX")
创建一个 droplet
from("direct:createDroplet") .setHeader(DigitalOceanConstants.OPERATION, constant("create")) .setHeader(DigitalOceanHeaders.NAME, constant("myDroplet")) .setHeader(DigitalOceanHeaders.REGION, constant("fra1")) .setHeader(DigitalOceanHeaders.DROPLET_IMAGE, constant("ubuntu-14-04-x64")) .setHeader(DigitalOceanHeaders.DROPLET_SIZE, constant("512mb")) .to("digitalocean:droplet?oAuthToken=XXXXXX")
列出所有 droplets
from("direct:getDroplets") .setHeader(DigitalOceanConstants.OPERATION, constant("list")) .to("digitalocean:droplets?oAuthToken=XXXXXX")
检索 Droplet 的信息(dropletId = 34772987)
from("direct:getDroplet") .setHeader(DigitalOceanConstants.OPERATION, constant("get")) .setHeader(DigitalOceanConstants.ID, 34772987) .to("digitalocean:droplet?oAuthToken=XXXXXX")
Droplet 的关闭信息(dropletId = 34772987)
from("direct:shutdown") .setHeader(DigitalOceanConstants.ID, 34772987) .to("digitalocean:droplet?operation=shutdown&oAuthToken=XXXXXX")