]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/contrib/openzfs/contrib/pyzfs/libzfs_core/__init__.py
Update OpenZFS to 2.0.0-rc3-gfc5966
[FreeBSD/FreeBSD.git] / sys / contrib / openzfs / contrib / pyzfs / libzfs_core / __init__.py
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
17 '''
18 Python wrappers for **libzfs_core** library.
19
20 *libzfs_core* is intended to be a stable, committed interface for programmatic
21 administration of ZFS.
22 This wrapper provides one-to-one wrappers for libzfs_core API functions,
23 but the signatures and types are more natural to Python.
24 nvlists are wrapped as dictionaries or lists depending on their usage.
25 Some parameters have default values depending on typical use for
26 increased convenience.
27 Output parameters are not used and return values are directly returned.
28 Enumerations and bit flags become strings and lists of strings in Python.
29 Errors are reported as exceptions rather than integer errno-style
30 error codes.  The wrapper takes care to provide one-to-many mapping
31 of the error codes to the exceptions by interpreting a context
32 in which the error code is produced.
33
34 To submit an issue or contribute to development of this package
35 please visit its `GitHub repository <https://github.com/openzfs/zfs>`_.
36
37 .. data:: MAXNAMELEN
38
39     Maximum length of any ZFS name.
40 '''
41 from __future__ import absolute_import, division, print_function
42
43 from ._constants import (
44     MAXNAMELEN,
45     ZCP_DEFAULT_INSTRLIMIT,
46     ZCP_DEFAULT_MEMLIMIT,
47     WRAPPING_KEY_LEN,
48     zfs_key_location,
49     zfs_keyformat,
50     zio_encrypt
51 )
52
53 from ._libzfs_core import (
54     lzc_bookmark,
55     lzc_change_key,
56     lzc_channel_program,
57     lzc_channel_program_nosync,
58     lzc_clone,
59     lzc_create,
60     lzc_destroy_bookmarks,
61     lzc_destroy_snaps,
62     lzc_exists,
63     lzc_get_bookmarks,
64     lzc_get_holds,
65     lzc_hold,
66     lzc_load_key,
67     lzc_pool_checkpoint,
68     lzc_pool_checkpoint_discard,
69     lzc_promote,
70     lzc_receive,
71     lzc_receive_one,
72     lzc_receive_resumable,
73     lzc_receive_with_cmdprops,
74     lzc_receive_with_header,
75     lzc_release,
76     lzc_reopen,
77     lzc_rollback,
78     lzc_rollback_to,
79     lzc_send,
80     lzc_send_resume,
81     lzc_send_space,
82     lzc_snaprange_space,
83     lzc_snapshot,
84     lzc_sync,
85     lzc_unload_key,
86     is_supported,
87     lzc_recv,
88     lzc_snap,
89     lzc_rename,
90     lzc_destroy,
91     lzc_inherit_prop,
92     lzc_get_props,
93     lzc_set_props,
94     lzc_list_children,
95     lzc_list_snaps,
96     receive_header,
97 )
98
99 __all__ = [
100     'ctypes',
101     'exceptions',
102     'MAXNAMELEN',
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',
113     'lzc_clone',
114     'lzc_create',
115     'lzc_destroy_bookmarks',
116     'lzc_destroy_snaps',
117     'lzc_exists',
118     'lzc_get_bookmarks',
119     'lzc_get_holds',
120     'lzc_hold',
121     'lzc_load_key',
122     'lzc_pool_checkpoint',
123     'lzc_pool_checkpoint_discard',
124     'lzc_promote',
125     'lzc_receive',
126     'lzc_receive_one',
127     'lzc_receive_resumable',
128     'lzc_receive_with_cmdprops',
129     'lzc_receive_with_header',
130     'lzc_release',
131     'lzc_reopen',
132     'lzc_rollback',
133     'lzc_rollback_to',
134     'lzc_send',
135     'lzc_send_resume',
136     'lzc_send_space',
137     'lzc_snaprange_space',
138     'lzc_snapshot',
139     'lzc_sync',
140     'lzc_unload_key',
141     'is_supported',
142     'lzc_recv',
143     'lzc_snap',
144     'lzc_rename',
145     'lzc_destroy',
146     'lzc_inherit_prop',
147     'lzc_get_props',
148     'lzc_set_props',
149     'lzc_list_children',
150     'lzc_list_snaps',
151     'receive_header',
152 ]
153
154 # vim: softtabstop=4 tabstop=4 expandtab shiftwidth=4