DigitalOcean.dropletCreate()

Create a DigitalOcean droplet.

You can find documentation for this API here: https://developers.digitalocean.com/documentation/v2/ and raise issues here: github.com/NileFrater/machinepack-digitalocean.

Usage

Hover over inputs/exits for more info.

var DigitalOcean = require('machinepack-digitalocean');


// Create a DigitalOcean droplet.

DigitalOcean.dropletCreate({

token: 'FFDFdf8f8d',

name: 'My-New-Droplet',

region: 'NYC2',

size: '512mb',

image: 434348,

sshkeys: '10, 11, 12',

backups: false,

ipv6: 'false',

private_networking: 'false',

user_data: 'MetadataInfoHere',

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// OK.

success: function (result) {

 

},

});

Inputs

token required

Your DigitalOcean API token.

'FFDFdf8f8d'
name required

The hostname you wish to assign your new droplet.

'My-New-Droplet'
region required

The region name where you wish to spin up your new droplet.

'NYC2'
size required

The droplet size you wish to spin up (E.G 512mb.)

'512mb'
image required

The ID of the private image you wish to use as the base for your new droplet.

434348
sshkeys

The ID of the SSH keys you wish to apply to your droplet. These must be saved to your digitalocean account. Separate with a command to add multiple.

'10, 11, 12'
backups

A true/false indicating whether or not you wish to add auto-backups to your droplet

false
ipv6

A true/false indicating whether or not you wish to add IPV6 to your droplet

'false'
private_networking

A true/false indicating whether or not you wish to add private networking to your droplet

'false'
user_data

The userdata you wish to include with your droplet.

'MetadataInfoHere'

Exits

error

An unexpected error occurred.

success

OK.

{
  droplet: {
    id: 3164494,
    name: 'example.com',
    memory: 512,
    vcpus: 1,
    disk: 20,
    locked: true,
    status: 'new',
    kernel: {
      id: 2233,
      name: 'Ubuntu 14.04 x64 vmlinuz-3.13.0-37-generic',
      version: '3.13.0-37-generic'
    },
    created_at: '2014-11-14T16:36:31Z',
    features: [ 'virtio' ],
    backup_ids: [],
    snapshot_ids: [],
    image: {},
    size: {},
    size_slug: '512mb',
    networks: {},
    region: {}
  },
  links: {
    actions: [
      {
        id: 36805096,
        rel: 'create',
        href: 'https://api.digitalocean.com/v2/actions/36805096'
      }
    ]
  }
}