Class BlockStorageService

Hierarchy

  • BlockStorageService

Constructors

Methods

  • Create a snapshot from a Block Storage volume

    Example

    import { DigitalOcean } from 'digitalocean-js';

    const client = new DigitalOcean('your-api-key');
    const snapshot = await client.blockStorage
    .createSnapshotFromVolume('volume-id', 'my-new-snapshot');

    Parameters

    • id: string
    • name: string

    Returns Promise<Snapshot>

  • Delete a Block Storage volume by ID

    Example

    import { DigitalOcean } from 'digitalocean-js';

    const client = new DigitalOcean('your-api-key');
    await client.blockStorage.deleteBlockStorageById('volume-id');

    Parameters

    • id: string

    Returns Promise<void>

  • Delete a Block Storage volume by name and region

    Example

    import { DigitalOcean } from 'digitalocean-js';

    const client = new DigitalOcean('your-api-key');
    await client.blockStorage.deleteBlockStorageByName('volume-name', 'nyc1');

    Parameters

    • name: string
    • regionSlug: string

    Returns Promise<void>

  • Get Block Storage volumes by name and region

    Example

    import { DigitalOcean } from 'digitalocean-js';

    const client = new DigitalOcean('your-api-key');
    const volume = await client.blockStorage
    .getBlockStorageByName('volume-name', 'nyc1');

    Parameters

    • name: string
    • regionSlug: string

    Returns Promise<BlockStorage[]>

  • Get snapshots that have been created from a Block Storage volume

    Example

    import { DigitalOcean } from 'digitalocean-js';

    const client = new DigitalOcean('your-api-key');
    const snapshots = await client.blockStorage
    .getSnapshotsForVolume('volume-id');

    Parameters

    • id: string

    Returns Promise<Snapshot[]>

Generated using TypeDoc