This discussion is archived
1 Reply Latest reply: Dec 31, 2012 2:29 PM by Dave Miner RSS

python zfs

807736 Newbie
Currently Being Moderated
hello all,
i see that zfs pkg contains python related modules:

usr/lib/python2.6/vendor-packages/zfs
usr/lib/python2.6/vendor-packages/zfs/__init__.py
usr/lib/python2.6/vendor-packages/zfs/__init__.pyc
usr/lib/python2.6/vendor-packages/zfs/allow.py
usr/lib/python2.6/vendor-packages/zfs/allow.pyc
usr/lib/python2.6/vendor-packages/zfs/dataset.py
...
usr/lib/zfs/pyzfs.py
...


Is it possible to use it in a custom python script? i can't find the related docs?

i tried:
# python
Python 2.6.4 (r264:75706, Oct 17 2011, 16:55:05) [C] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
import zfs
dir(zfs)
['__builtins__', '__doc__', '__file__', '__name__', '__package__', '__path__']
from zfs import help
zfs.help
<module 'zfs.help' from '/usr/lib/python2.6/vendor-packages/zfs/help.py'>
dir(zfs.help)
['__builtins__', '__doc__', '__file__', '__name__', '__package__', 'do_help', 'zfs']

i just want something to do zfs send/recv

thanks in advance for help,

gerard
  • 1. Re: python zfs
    Dave Miner Explorer
    Currently Being Moderated
    The Python modules you've found are a Solaris-private implementation detail that is not usable by customers. We've begun to provide API access to some aspects of the system via rad(1M), but ZFS is not yet available via those interfaces. We'd recommend just calling the zfs send & recv commands from your Python program at present.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points