Skip to content

TritonDataCenter/node-zfs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-zfs

This repository is part of the Joyent SmartDataCenter project (SDC). For contribution guidelines, issues, and general documentation, visit the main SDC project page.

node-zfs is a Node.js interface to ZFS tools

SYNOPSIS

// list datasets
zfs.list(function (err, fields, data) {
  // ...
});

// list snapshots
zfs.list_snapshots(function (err, fields, data) {
  // ...
});

// create a dataset
zfs.create('mydataset', function (err) {
  // ...
});

// destroy a dataset or snapshot
zfs.destroy('mydataset', function (err) {
  // ...
});

// recursively destroy a dataset
zfs.destroyAll('mydataset', function (err) {
  // ...
});

// rollback a snapshot
zfs.rollback('mydataset@backup', function (err) {
  // ...
});

// clone a dataset
zfs.clone('mydataset@backup', 'mynewdataset', function (err) {
  // ...
});

// set dataset properties
zfs.set('mydataset', { 'test:key1': 'value'
                     , 'test:key2': 'value' }, function (err) {
  // ...
});

// get dataset properties
zfs.get('mydataset', [ 'test:key1', 'test:key2' ],
  function (err, properties) {
    // ...
  });

DESCRIPTION

The node-zfs library provies a thin, evented wrapper around common ZFS commands. It also contains functionality to automatically generate pool layouts based on a disk inventory.

ENVIRONMENT

The library was developed on an OpenSolaris snv_111b system and has subsequently been used on SmartOS.

AUTHOR

Orlando Vazquez orlando@joyent.com Keith Wesolowski keith.wesolowski@joyent.com

SEE ALSO

zfs(1M), zpool(1M)