OceanusAncora
A DigitalOcean API client for use with NodeJS.
Example
var oa = fs = ; var client = oa; clientdroplets;
Take a look in the examples
folder for more examples.
Install
Install using npm:
npm install oceanusancora
Command Line Options for scripts
Below is a list of options you may use when calling any scripts you may have written
-c --client_id X
-a --api_key X
--debug
--no-cookies
--timeout X(ms)
--proxy X
--encoding X
They are fairly self-explanatory no-cookies, timeout, proxy, encoding are all options to request. if using debug its reccomended you use --encoding utf8
or something similar as all you will see is a buffer otherwise in the response.
Because of these command line options you can try a few already from the examples section:
node examples/list_droplets.js -c <client_id> -a <api_key>
Methods
domains
// Listing Domains // Create New Domainnewname ip_address cb // Show A Domain // Destroy a Domain // Listing Records for a given Domain // Create a new Record for a given Domain // Show a Record for a given Domain // Destroy a Record for a given Domain // Edit a Record for a given Domain
droplets
// Listing Droplets // Add a new Dropletnewname size image region options cb// options = {ssh_key_ids : 'string(CSV)', private_networking : boolean, backups_enabled: boolean} // Show a Droplet // Reboot a Droplet // Power Cycle a Droplet // Shut Down a Droplet // Power Off a Droplet // Power On a Droplet // Reset root password on a Droplet // Resize a Droplet // Make a Snapshot of a Droplet // Restore a Droplet // Rebuild a Droplet // Rename a Droplet // Destroy a Droplet
events
// Listing Events
images
// Listing Images // Show an Image // Destroy an Image // Transfer an Image
regions
// Listing Regions
sizes
// Listing Sizes
ssh_keys
// Listing SSH_Keys // Add a new SSH Keynewname ssh_pub_key cb // Show a SSH Key // Edit a SSH Key // options = {name: 'string', ssh_pub_key: 'string'} // Destroy a SSH Key
Tests
npm test
todo: further client testing; nock reply data does not represent what DigitalOcean responds with in all cases, but is currently unused.
License
MIT.