DigitalOcean API v2.0 for Node.js
npm install do-api --save
Create a api token on digitalocean and save it under config/Default.json
{
"Token": "y0wCcq9UvKuSHm39q5FQqbT6K8oU7o1D2Fc723658ds1DHyXzkztt0sFQRG8JplK"
}
var api = require('do-api');
api.getAccount()
.then(function(account) {
...
})
.fail(function (error) {
...
});
For further details visit the original API Documentation on here
api.getAccount()
.then(function(account) {
...
});
api.getActions()
.then(function(actions) {
...
});
api.getAction(action_id)
.then(function(action) {
...
});
api.getDomains()
.then(function(domains) {
...
});
api.getDomain(name)
.then(function(domain) {
...
});
api.addDomain(name, ip_address)
.then(function(domain) {
...
});
api.deleteDomain(name)
.then(function() {
...
});
api.getDomainRecords(domain_name)
.then(function(records) {
...
});
api.getDomainRecord(record_id)
.then(function(record) {
...
});
api.addDomainRecord(domain_name, type, name, data, priority, port, weight)
.then(function(domain) {
...
});
api.updateDomainRecord(domain_name, record_id, type, name, data, priority, port, weight)
.then(function(domain) {
...
});
api.deleteDomainRecord(domain_name, record_id)
.then(function() {
...
});
api.getDroplets()
.then(function(droplets) {
...
});
api.getDroplet(domain_id)
.then(function(droplet) {
...
});
api.addDroplet(name, region, size, image, ssh_keys, backups, ipv6, user_data, private_networking)
.then(function(droplet) {
...
});
api.deleteDroplet(droplet_id)
.then(function() {
...
});
api.getDropletKernels(droplet_id)
.then(function(kernels) {
...
});
api.getDropletSnapshots(droplet_id)
.then(function(snapshots) {
...
});
api.getDropletBackups(droplet_id)
.then(function(backups) {
...
});
api.getDropletActions(droplet_id)
.then(function(actions) {
...
});
api.getDropletNeighbors(droplet_id)
.then(function(droplets) {
...
});
api.getNeighbors()
.then(function(neighbors) {
...
});
api.disableBackupOnDroplet(droplet_id)
.then(function(action) {
...
});
api.rebootDroplet(droplet_id)
.then(function(action) {
...
});
api.powerCycleDroplet(droplet_id)
.then(function(action) {
...
});
api.shutdownDroplet(droplet_id)
.then(function(action) {
...
});
api.powerOffDroplet(droplet_id)
.then(function(action) {
...
});
api.powerOnDroplet(droplet_id)
.then(function(action) {
...
});
api.restoreDroplet(droplet_id)
.then(function(action) {
...
});
api.passwordResetOnDroplet(droplet_id)
.then(function(action) {
...
});
api.resizeDroplet(droplet_id, size)
.then(function(action) {
...
});
api.rebuildDroplet(droplet_id, image)
.then(function(action) {
...
});
api.renameDroplet(droplet_id, name)
.then(function(action) {
...
});
api.changeKernelOnDroplet(droplet_id, kernel)
.then(function(action) {
...
});
api.enableIpv6OnDroplet(droplet_id)
.then(function(action) {
...
});
api.enablePrivateNetworkingOnDroplet(droplet_id)
.then(function(action) {
...
});
api.snapshotDroplet(droplet_id, name)
.then(function(action) {
...
});
api.upgradeDroplet(droplet_id)
.then(function(action) {
...
});
api.getDropletAction(droplet_id, action_id)
.then(function(action) {
...
});
api.getImages()
.then(function(images) {
...
});
api.getDistributionImages()
.then(function(images) {
...
});
api.getApplicationImages()
.then(function(images) {
...
});
api.getUserImages()
.then(function(images) {
...
});
api.getImage(image_id)
.then(function(image) {
...
});
api.getImageAction(image_id, action_id)
.then(function(action) {
...
});
api.updateImage(image_id, name)
.then(function(image) {
...
});
api.deleteImage(image_id)
.then(function() {
...
});
api.transferImage(image_id, region)
.then(function(action) {
...
});
api.getSSHKeys()
.then(function(keys) {
...
});
api.addSSHKey(name, public_key)
.then(function(key) {
...
});
api.getSSHKey(key_id)
.then(function(key) {
...
});
api.updateSSHKey(key_id, name)
.then(function(key) {
...
});
api.deleteSSHKey(key_id)
.then(function() {
...
});
api.getRegions()
.then(function(regions) {
...
});
api.getSizes()
.then(function(sizes) {
...
});