Class BlockStorageActionService

Hierarchy

  • BlockStorageActionService

Constructors

Methods

  • Attach a Block Storage volume to a droplet

    Example

    import { DigitalOcean } from 'digitalocean-js';

    const client = new DigitalOcean('your-api-key');
    const request = {
    type: 'attach',
    droplet_id: 11612190,
    region: 'nyc1'
    }
    const action = await client.blockStorageActions
    .attachVolumeToDroplet('volume-id', request);

    Parameters

    Returns Promise<Action>

  • Attach a Block Storage volume to a droplet using the volume name

    Example

    import { DigitalOcean } from 'digitalocean-js';

    const client = new DigitalOcean('your-api-key');
    const request = {
    type: 'attach',
    volume_name: 'example',
    region: 'nyc1',
    droplet_id: 116121901
    }
    const action = await client.blockStorageActions
    .attachVolumeToDropletByName(request);

    Parameters

    Returns Promise<Action>

  • Detach a Block Storage volume from a droplet

    Example

    import { DigitalOcean } from 'digitalocean-js';

    const client = new DigitalOcean('your-api-key');
    const request = {
    type: 'detach',
    droplet_id: 11612190,
    region: 'nyc1'
    }
    const action = await client.blockStorageActions
    .detachVolumeFromDroplet('volume-id', request);

    Parameters

    Returns Promise<Action>

  • Detach a Block Storage volume from a droplet using the volume name

    Example

    import { DigitalOcean } from 'digitalocean-js';

    const client = new DigitalOcean('your-api-key');
    const request = {
    type: 'detach',
    volume_name: 'example',
    region: 'nyc1',
    droplet_id: 116121901
    }
    const action = await client.blockStorageActions
    .detachVolumeFromDropletByName(request);

    Parameters

    Returns Promise<Action>

  • List all actions that have been executed on the specified volume. Limited to 25 actions per page unless otherwise specified.

    Example

    import { DigitalOcean } from 'digitalocean-js';

    const client = new DigitalOcean('your-api-key');
    const actions = await client.blockStorageActions.getAllVolumeActions('volume-id');
    // Paginate actions, 10 per page, starting on page 1
    actions = await client.blockStorageActions
    .getAllVolumeActions('volume-id', 10, 1);

    Parameters

    • volumeId: string
    • Optional perPage: number
    • Optional page: number

    Returns Promise<Action[]>

  • Get an existing volume action based on the provided ID

    Example

    import { DigitalOcean } from 'digitalocean-js';

    const client = new DigitalOcean('your-api-key');
    const action = await client.blockStorageActions
    .getExistingVolumeAction('volume-id', 'action-id');

    Parameters

    • volumeId: string
    • actionId: number

    Returns Promise<Action>

Generated using TypeDoc