]>
Commit | Line | Data |
---|---|---|
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 | ''' |
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 | |
d0249a4b | 35 | please visit its `GitHub repository <https://github.com/openzfs/zfs>`_. |
6abf9225 AG |
36 | |
37 | .. data:: MAXNAMELEN | |
38 | ||
39 | Maximum length of any ZFS name. | |
40 | ''' | |
9de8c0cd | 41 | from __future__ import absolute_import, division, print_function |
6abf9225 AG |
42 | |
43 | from ._constants import ( | |
44 | MAXNAMELEN, | |
85ce3f4f | 45 | ZCP_DEFAULT_INSTRLIMIT, |
46 | ZCP_DEFAULT_MEMLIMIT, | |
47 | WRAPPING_KEY_LEN, | |
48 | zfs_key_location, | |
49 | zfs_keyformat, | |
50 | zio_encrypt | |
6abf9225 AG |
51 | ) |
52 | ||
53 | from ._libzfs_core import ( | |
85ce3f4f | 54 | lzc_bookmark, |
55 | lzc_change_key, | |
56 | lzc_channel_program, | |
57 | lzc_channel_program_nosync, | |
6abf9225 | 58 | lzc_clone, |
85ce3f4f | 59 | lzc_create, |
60 | lzc_destroy_bookmarks, | |
6abf9225 | 61 | lzc_destroy_snaps, |
85ce3f4f | 62 | lzc_exists, |
6abf9225 | 63 | lzc_get_bookmarks, |
85ce3f4f | 64 | lzc_get_holds, |
6abf9225 | 65 | lzc_hold, |
85ce3f4f | 66 | lzc_load_key, |
c962fd6c | 67 | lzc_pool_checkpoint, |
68 | lzc_pool_checkpoint_discard, | |
85ce3f4f | 69 | lzc_promote, |
70 | lzc_receive, | |
71 | lzc_receive_one, | |
72 | lzc_receive_resumable, | |
73 | lzc_receive_with_cmdprops, | |
74 | lzc_receive_with_header, | |
e8cf3a4f | 75 | lzc_receive_with_heal, |
6abf9225 | 76 | lzc_release, |
85ce3f4f | 77 | lzc_reopen, |
78 | lzc_rollback, | |
79 | lzc_rollback_to, | |
6abf9225 | 80 | lzc_send, |
85ce3f4f | 81 | lzc_send_resume, |
6abf9225 | 82 | lzc_send_space, |
85ce3f4f | 83 | lzc_snaprange_space, |
84 | lzc_snapshot, | |
85 | lzc_sync, | |
86 | lzc_unload_key, | |
6abf9225 | 87 | is_supported, |
85ce3f4f | 88 | lzc_recv, |
89 | lzc_snap, | |
6abf9225 AG |
90 | lzc_rename, |
91 | lzc_destroy, | |
92 | lzc_inherit_prop, | |
6abf9225 | 93 | lzc_get_props, |
85ce3f4f | 94 | lzc_set_props, |
6abf9225 AG |
95 | lzc_list_children, |
96 | lzc_list_snaps, | |
97 | receive_header, | |
98 | ) | |
99 | ||
100 | __all__ = [ | |
101 | 'ctypes', | |
102 | 'exceptions', | |
103 | 'MAXNAMELEN', | |
85ce3f4f | 104 | 'ZCP_DEFAULT_INSTRLIMIT', |
105 | 'ZCP_DEFAULT_MEMLIMIT', | |
106 | 'WRAPPING_KEY_LEN', | |
107 | 'zfs_key_location', | |
108 | 'zfs_keyformat', | |
109 | 'zio_encrypt', | |
110 | 'lzc_bookmark', | |
111 | 'lzc_change_key', | |
112 | 'lzc_channel_program', | |
113 | 'lzc_channel_program_nosync', | |
6abf9225 | 114 | 'lzc_clone', |
85ce3f4f | 115 | 'lzc_create', |
116 | 'lzc_destroy_bookmarks', | |
6abf9225 | 117 | 'lzc_destroy_snaps', |
85ce3f4f | 118 | 'lzc_exists', |
6abf9225 | 119 | 'lzc_get_bookmarks', |
85ce3f4f | 120 | 'lzc_get_holds', |
6abf9225 | 121 | 'lzc_hold', |
85ce3f4f | 122 | 'lzc_load_key', |
c962fd6c | 123 | 'lzc_pool_checkpoint', |
124 | 'lzc_pool_checkpoint_discard', | |
85ce3f4f | 125 | 'lzc_promote', |
126 | 'lzc_receive', | |
127 | 'lzc_receive_one', | |
128 | 'lzc_receive_resumable', | |
129 | 'lzc_receive_with_cmdprops', | |
130 | 'lzc_receive_with_header', | |
e8cf3a4f | 131 | 'lzc_receive_with_heal', |
6abf9225 | 132 | 'lzc_release', |
85ce3f4f | 133 | 'lzc_reopen', |
134 | 'lzc_rollback', | |
135 | 'lzc_rollback_to', | |
6abf9225 | 136 | 'lzc_send', |
85ce3f4f | 137 | 'lzc_send_resume', |
6abf9225 | 138 | 'lzc_send_space', |
85ce3f4f | 139 | 'lzc_snaprange_space', |
140 | 'lzc_snapshot', | |
141 | 'lzc_sync', | |
142 | 'lzc_unload_key', | |
6abf9225 | 143 | 'is_supported', |
85ce3f4f | 144 | 'lzc_recv', |
145 | 'lzc_snap', | |
6abf9225 AG |
146 | 'lzc_rename', |
147 | 'lzc_destroy', | |
148 | 'lzc_inherit_prop', | |
6abf9225 | 149 | 'lzc_get_props', |
85ce3f4f | 150 | 'lzc_set_props', |
6abf9225 AG |
151 | 'lzc_list_children', |
152 | 'lzc_list_snaps', | |
153 | 'receive_header', | |
154 | ] | |
155 | ||
156 | # vim: softtabstop=4 tabstop=4 expandtab shiftwidth=4 |