Class DropletService

Hierarchy

  • DropletService

Constructors

Methods

  • Create multiple droplets with the same specs but different names

    Example

    import { DigitalOcean } from 'digitalocean-js';

    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);

    Parameters

    Returns Promise<Droplet[]>

  • Create a new droplet

    Example

    import { DigitalOcean } from 'digitalocean-js';

    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);

    Parameters

    Returns Promise<Droplet>

  • Delete a specific droplet by ID

    Example

    import { DigitalOcean } from 'digitalocean-js';

    const client = new DigitalOcean('your-api-key');
    await client.droplets.deleteDroplet('droplet-id');

    Parameters

    • dropletId: number

    Returns Promise<void>

  • Delete Droplets by a tag

    Example

    import { DigitalOcean } from 'digitalocean-js';

    const client = new DigitalOcean('your-api-key');
    await client.droplets.deleteDropletsByTag('tag');

    Parameters

    • tag: string

    Returns Promise<void>

  • Retrieve a list of all kernels available to a Droplet

    Example

    import { DigitalOcean } from 'digitalocean-js';

    const client = new DigitalOcean('your-api-key');
    const kernels = await client.droplets.getAvailableKernelsForDroplet('droplet-id');

    Parameters

    • dropletId: number

    Returns Promise<Kernel[]>

  • Retrieve any backups associated with a Droplet

    Example

    import { DigitalOcean } from 'digitalocean-js';

    const client = new DigitalOcean('your-api-key');
    const backups = await client.droplets.getBackupsForDroplet('droplet-id');

    Parameters

    • dropletId: number

    Returns Promise<Backup[]>

  • Retrieve all actions that have been executed on a Droplet

    Example

    import { DigitalOcean } from 'digitalocean-js';

    const client = new DigitalOcean('your-api-key');
    const actions = await client.droplets.getDropletActions('droplet-id');

    Parameters

    • dropletId: number

    Returns Promise<Action[]>

  • Retrieve a list of any Droplets that are running on the same physical hardware

    Example

    import { DigitalOcean } from 'digitalocean-js';

    const client = new DigitalOcean('your-api-key');
    const droplets = await client.droplets.getDropletNeighbors();

    Returns Promise<Droplet[][]>

  • Get all droplets on the account that has a given tag

    Example

    import { DigitalOcean } from 'digitalocean-js';

    const client = new DigitalOcean('your-api-key');
    const droplets = await client.droplets.getDropletsByTag('tag-name');

    Parameters

    • tag: string

    Returns Promise<Droplet[]>

  • Get a specific existing droplet by ID

    Example

    import { DigitalOcean } from 'digitalocean-js';

    const client = new DigitalOcean('your-api-key');
    const droplet = await client.droplets.getExistingDroplet('droplet-id');

    Parameters

    • dropletId: number

    Returns Promise<Droplet>

  • Retrieve a list of Droplets that are running on the same physical server

    Example

    import { DigitalOcean } from 'digitalocean-js';

    const client = new DigitalOcean('your-api-key');
    const droplets = await client.droplets.getNeighborsForDroplet('droplet-id');

    Parameters

    • dropletId: number

    Returns Promise<Droplet[]>

  • Retrieve the snapshots that have been created from a Droplet

    Example

    import { DigitalOcean } from 'digitalocean-js';

    const client = new DigitalOcean('your-api-key');
    const snapshots = await client.droplets.getSnapshotsForDroplet('droplet-id');

    Parameters

    • dropletId: number

    Returns Promise<Snapshot[]>

Generated using TypeDoc