Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BlockStorageActionService

Hierarchy

  • BlockStorageActionService

Index

Constructors

constructor

Methods

attachVolumeToDroplet

  • Attach a Block Storage volume to a droplet

    Example

    import { DigitalOcean } from 'digitalocean-deno';
    
    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>

attachVolumeToDropletByName

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

    Example

    import { DigitalOcean } from 'digitalocean-deno';
    
    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>

detachVolumeFromDroplet

  • Detach a Block Storage volume from a droplet

    Example

    import { DigitalOcean } from 'digitalocean-deno';
    
    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>

detachVolumeFromDropletByName

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

    Example

    import { DigitalOcean } from 'digitalocean-deno';
    
    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>

getAllVolumeActions

  • getAllVolumeActions(volumeId: string, perPage?: undefined | number, page?: undefined | number): 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-deno';
    
    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: undefined | number
    • Optional page: undefined | number

    Returns Promise<Action[]>

getExistingVolumeAction

  • getExistingVolumeAction(volumeId: string, actionId: number): Promise<Action>
  • Get an existing volume action based on the provided ID

    Example

    import { DigitalOcean } from 'digitalocean-deno';
    
    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>

resizeVolume

  • Resize a Block Storage volume

    Example

    import { DigitalOcean } from 'digitalocean-deno';
    
    const client = new DigitalOcean('your-api-key');
    const request = {
      type: 'resize',
      size_gigabytes: 100,
      region: 'nyc1'
    }
    const action = await client.blockStorageActions
       .resizeVolume('volume-id', request);

    Parameters

    Returns Promise<Action>

Generated using TypeDoc