Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BlockStorageService

Hierarchy

  • BlockStorageService

Index

Constructors

constructor

Methods

createBlockStorage

  • Create a new Block Storage volume

    Example

    import { DigitalOcean } from 'digitalocean-deno';
    
    const client = new DigitalOcean('your-api-key');
    const request = {
      size_gigabytes: 10,
      name: 'example',
      description: 'Block store for examples',
      region: 'nyc1'
    };
    const volume = await client.blockStorage.createBlockStorage(request);

    Parameters

    Returns Promise<BlockStorage>

createSnapshotFromVolume

  • createSnapshotFromVolume(id: string, name: string): Promise<Snapshot>
  • Create a snapshot from a Block Storage volume

    Example

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

deleteBlockStorageById

  • deleteBlockStorageById(id: string): Promise<void>
  • Delete a Block Storage volume by ID

    Example

    import { DigitalOcean } from 'digitalocean-deno';
    
    const client = new DigitalOcean('your-api-key');
    await client.blockStorage.deleteBlockStorageById('volume-id');

    Parameters

    • id: string

    Returns Promise<void>

deleteBlockStorageByName

  • deleteBlockStorageByName(name: string, regionSlug: string): Promise<void>
  • Delete a Block Storage volume by name and region

    Example

    import { DigitalOcean } from 'digitalocean-deno';
    
    const client = new DigitalOcean('your-api-key');
    await client.blockStorage.deleteBlockStorageByName('volume-name', 'nyc1');

    Parameters

    • name: string
    • regionSlug: string

    Returns Promise<void>

getAllBlockStorage

  • List all of the Block Storage volumes available on your account

    Example

    import { DigitalOcean } from 'digitalocean-deno';
    
    const client = new DigitalOcean('your-api-key');
    const volumes = await client.blockStorage.getAllBlockStorage();

    Returns Promise<BlockStorage[]>

getBlockStorageById

  • Get a single Block Storage volume by ID

    Example

    import { DigitalOcean } from 'digitalocean-deno';
    
    const client = new DigitalOcean('your-api-key');
    const volume = await client.blockStorage.getBlockStorageById('volume-id');

    Parameters

    • id: string

    Returns Promise<BlockStorage>

getBlockStorageByName

  • getBlockStorageByName(name: string, regionSlug: string): Promise<BlockStorage[]>
  • Get Block Storage volumes by name and region

    Example

    import { DigitalOcean } from 'digitalocean-deno';
    
    const client = new DigitalOcean('your-api-key');
    const volume = await client.blockStorage
       .getBlockStorageByName('volume-name', 'nyc1');

    Parameters

    • name: string
    • regionSlug: string

    Returns Promise<BlockStorage[]>

getSnapshotsForVolume

  • getSnapshotsForVolume(id: string): Promise<Snapshot[]>
  • Get snapshots that have been created from a Block Storage volume

    Example

    import { DigitalOcean } from 'digitalocean-deno';
    
    const client = new DigitalOcean('your-api-key');
    const snapshots = await client.blockStorage
       .getSnapshotsForVolume('volume-id');

    Parameters

    • id: string

    Returns Promise<Snapshot[]>

Generated using TypeDoc