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