Create a new droplet
import { DigitalOcean } from 'digitalocean-deno';
const client = new DigitalOcean('your-api-key');
const request = {
name: 'example.com',
region: 'nyc3',
size: 's-1vcpu-1gb',
image: 'ubuntu-16-04-x64',
ssh_keys: null,
backups: false,
ipv6: true,
user_data: null,
private_networking: null,
volumes: null,
tags: [
'web'
]
};
const droplet = await client.droplets.createNewDroplet(request);
Delete a specific droplet by ID
import { DigitalOcean } from 'digitalocean-deno';
const client = new DigitalOcean('your-api-key');
await client.droplets.deleteDroplet('droplet-id');
Delete Droplets by a tag
import { DigitalOcean } from 'digitalocean-deno';
const client = new DigitalOcean('your-api-key');
await client.droplets.deleteDropletsByTag('tag');
Retrieve a list of Droplets that are running on the same physical server
import { DigitalOcean } from 'digitalocean-deno';
const client = new DigitalOcean('your-api-key');
const droplets = await client.droplets.getNeighborsForDroplet('droplet-id');
Retrieve the snapshots that have been created from a Droplet
import { DigitalOcean } from 'digitalocean-deno';
const client = new DigitalOcean('your-api-key');
const snapshots = await client.droplets.getSnapshotsForDroplet('droplet-id');
Generated using TypeDoc
Create multiple droplets with the same specs but different names
Example
import { DigitalOcean } from 'digitalocean-deno'; const client = new DigitalOcean('your-api-key'); const request = { names: [ 'sub-01.example.com', 'sub-02.example.com' ], region: 'nyc3', size: 's-1vcpu-1gb', image: 'ubuntu-16-04-x64', ssh_keys: null, backups: false, ipv6: true, user_data: null, private_networking: null, tags: [ 'web' ] }; const droplets = await client.droplets.createMultipleDroplets(request);