]> git.proxmox.com Git - mirror_zfs.git/blame - contrib/pyzfs/libzfs_core/__init__.py
pyzfs: add missing libzfs_core functions
[mirror_zfs.git] / contrib / pyzfs / libzfs_core / __init__.py
CommitLineData
85ce3f4f 1#
2# Copyright 2015 ClusterHQ
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
6abf9225
AG
17'''
18Python wrappers for **libzfs_core** library.
19
20*libzfs_core* is intended to be a stable, committed interface for programmatic
21administration of ZFS.
22This wrapper provides one-to-one wrappers for libzfs_core API functions,
23but the signatures and types are more natural to Python.
24nvlists are wrapped as dictionaries or lists depending on their usage.
25Some parameters have default values depending on typical use for
26increased convenience.
27Output parameters are not used and return values are directly returned.
28Enumerations and bit flags become strings and lists of strings in Python.
29Errors are reported as exceptions rather than integer errno-style
30error codes. The wrapper takes care to provide one-to-many mapping
31of the error codes to the exceptions by interpreting a context
32in which the error code is produced.
33
34To submit an issue or contribute to development of this package
85ce3f4f 35please visit its `GitHub repository <https://github.com/zfsonlinux/zfs>`_.
6abf9225
AG
36
37.. data:: MAXNAMELEN
38
39 Maximum length of any ZFS name.
40'''
41
42from ._constants import (
43 MAXNAMELEN,
85ce3f4f 44 ZCP_DEFAULT_INSTRLIMIT,
45 ZCP_DEFAULT_MEMLIMIT,
46 WRAPPING_KEY_LEN,
47 zfs_key_location,
48 zfs_keyformat,
49 zio_encrypt
6abf9225
AG
50)
51
52from ._libzfs_core import (
85ce3f4f 53 lzc_bookmark,
54 lzc_change_key,
55 lzc_channel_program,
56 lzc_channel_program_nosync,
6abf9225 57 lzc_clone,
85ce3f4f 58 lzc_create,
59 lzc_destroy_bookmarks,
6abf9225 60 lzc_destroy_snaps,
85ce3f4f 61 lzc_exists,
6abf9225 62 lzc_get_bookmarks,
85ce3f4f 63 lzc_get_holds,
6abf9225 64 lzc_hold,
85ce3f4f 65 lzc_load_key,
c962fd6c 66 lzc_pool_checkpoint,
67 lzc_pool_checkpoint_discard,
85ce3f4f 68 lzc_promote,
69 lzc_receive,
70 lzc_receive_one,
71 lzc_receive_resumable,
72 lzc_receive_with_cmdprops,
73 lzc_receive_with_header,
6abf9225 74 lzc_release,
c962fd6c 75 lzc_remap,
85ce3f4f 76 lzc_reopen,
77 lzc_rollback,
78 lzc_rollback_to,
6abf9225 79 lzc_send,
85ce3f4f 80 lzc_send_resume,
6abf9225 81 lzc_send_space,
85ce3f4f 82 lzc_snaprange_space,
83 lzc_snapshot,
84 lzc_sync,
85 lzc_unload_key,
6abf9225 86 is_supported,
85ce3f4f 87 lzc_recv,
88 lzc_snap,
6abf9225
AG
89 lzc_rename,
90 lzc_destroy,
91 lzc_inherit_prop,
6abf9225 92 lzc_get_props,
85ce3f4f 93 lzc_set_props,
6abf9225
AG
94 lzc_list_children,
95 lzc_list_snaps,
96 receive_header,
97)
98
99__all__ = [
100 'ctypes',
101 'exceptions',
102 'MAXNAMELEN',
85ce3f4f 103 'ZCP_DEFAULT_INSTRLIMIT',
104 'ZCP_DEFAULT_MEMLIMIT',
105 'WRAPPING_KEY_LEN',
106 'zfs_key_location',
107 'zfs_keyformat',
108 'zio_encrypt',
109 'lzc_bookmark',
110 'lzc_change_key',
111 'lzc_channel_program',
112 'lzc_channel_program_nosync',
6abf9225 113 'lzc_clone',
85ce3f4f 114 'lzc_create',
115 'lzc_destroy_bookmarks',
6abf9225 116 'lzc_destroy_snaps',
85ce3f4f 117 'lzc_exists',
6abf9225 118 'lzc_get_bookmarks',
85ce3f4f 119 'lzc_get_holds',
6abf9225 120 'lzc_hold',
85ce3f4f 121 'lzc_load_key',
c962fd6c 122 'lzc_pool_checkpoint',
123 'lzc_pool_checkpoint_discard',
85ce3f4f 124 'lzc_promote',
125 'lzc_receive',
126 'lzc_receive_one',
127 'lzc_receive_resumable',
128 'lzc_receive_with_cmdprops',
129 'lzc_receive_with_header',
6abf9225 130 'lzc_release',
c962fd6c 131 'lzc_remap',
85ce3f4f 132 'lzc_reopen',
133 'lzc_rollback',
134 'lzc_rollback_to',
6abf9225 135 'lzc_send',
85ce3f4f 136 'lzc_send_resume',
6abf9225 137 'lzc_send_space',
85ce3f4f 138 'lzc_snaprange_space',
139 'lzc_snapshot',
140 'lzc_sync',
141 'lzc_unload_key',
6abf9225 142 'is_supported',
85ce3f4f 143 'lzc_recv',
144 'lzc_snap',
6abf9225
AG
145 'lzc_rename',
146 'lzc_destroy',
147 'lzc_inherit_prop',
6abf9225 148 'lzc_get_props',
85ce3f4f 149 'lzc_set_props',
6abf9225
AG
150 'lzc_list_children',
151 'lzc_list_snaps',
152 'receive_header',
153]
154
155# vim: softtabstop=4 tabstop=4 expandtab shiftwidth=4