관리-도구
편집 파일: _iplugin.cpython-39.opt-1.pyc
a ����V��dGC����������������������@���s~���d�dl�mZ�d�dl�mZ�d�dlmZmZ�d�dlm Z �G�dd��de ee ��ZG�dd��de�ZG�d d ��d e�Z G�dd��de �Zd S�)�����)�ABCMeta)�abstractmethod)�LsmError�ErrorNumber)�with_metaclassc�������������������@���s����e�Zd�ZdZeddd��Zeddd��Zeddd��Zedd d ��Zeddd��Z edd d��Z eddd��Zeddd��Zed dd��Z ed!dd��ZdS�)"�IPluginzU Plug-in interface that all plug-ins must implement for basic operation. r���c�����������������C���s���dS�)z� Method first called to setup the plug-in (except for plugin_info) This would be the place to make a connection to the array. Returns None on success, else LsmError exception N��)�selfZuri�password�timeout�flagsr���r����2/usr/lib64/python3.9/site-packages/lsm/_iplugin.py�plugin_register���s���� zIPlugin.plugin_registerc�����������������C���s���dS�)zs Sets any time-outs for the plug-in (ms) Returns None on success, else LsmError exception Nr���)r ����msr���r���r���r ����time_out_set���s����zIPlugin.time_out_setc�����������������C���s���dS�)ze Retrieves the current time-out Returns time-out in ms, else raise LsmError Nr����r ���r���r���r���r ����time_out_get'���s����zIPlugin.time_out_getc�����������������C���s���dS�)aZ�� Called when the client wants to finish up or the socket goes eof. Plug-in should clean up all resources. Note: In the case where the socket goes EOF and the plugin_unregister runs into errors the exception(s) will not be delivered to the client! Returns None on success, else LsmError exception Nr���r���r���r���r ����plugin_unregister0���s���� zIPlugin.plugin_unregisterc�����������������C���s���dS�)z� Returns the stats of the given job. Returns a tuple ( status (enumeration), percent_complete, completed item). else LsmError exception. Nr����r ���Zjob_idr���r���r���r ���� job_status<���s���� zIPlugin.job_statusc�����������������C���s���dS�)zl Frees resources for a given job. Returns None on success, else raises an LsmError Nr���r���r���r���r ����job_freeG���s����zIPlugin.job_freec�����������������C���s���dS�)zS Returns the capabilities for the selected system, raises LsmError Nr����r ����systemr���r���r���r ����capabilitiesP���s����zIPlugin.capabilitiesc�����������������C���s���dS�)z� Returns the description and version for plug-in, raises LsmError Note: Make sure plugin can handle this call before plugin_register is called. Nr���r���r���r���r ����plugin_infoW���s����zIPlugin.plugin_infoNc�����������������C���s���dS�)z� Returns an array of pool objects. Pools are used in both block and file system interfaces, thus the reason they are in the base class. Raises LsmError on error Nr����r ���Z search_keyZsearch_valuer���r���r���r ����poolsa���s����z IPlugin.poolsc�����������������C���s���dS�)a �� Returns an array of system objects. System information is used to distinguish resources from on storage array to another when the plug=in supports the ability to have more than one array managed by it Raises LsmError on error Nr���r���r���r���r ����systemsk���s���� zIPlugin.systems)r���)r���)r���)r���)r���)r���)r���)r���)NNr���)r���)�__name__� __module__�__qualname__�__doc__�_abstractmethodr���r���r���r���r���r���r���r���r���r���r���r���r���r ���r��� ���s*��� r���c�������������������@���s����e�Zd�Zd/dd�Zd0dd�Zd1dd�Zd2d d �Zd3dd�Zd4d d�Zd5dd�Z d6dd�Z d7dd�Zdd��Zd8dd�Z d9dd�Zd:dd�Zd;dd�Zd<dd �Zd=d!d"�Zd>d#d$�Zd?d%d&�Zd@d'd(�ZdAd)d*�ZdBd+d,�ZdCd-d.�ZdS�)D�IStorageAreaNetworkNr���c�����������������C���s���t�tjd��dS�)zV Returns an array of volume objects Raises LsmError on error � Not supportedN�r���r���Z NO_SUPPORTr���r���r���r ����volumesy���s����zIStorageAreaNetwork.volumesc�����������������C���s���t�tjd��dS�)z� Creates a volume, given a pool, volume name, size and provisioning Returns a tuple (job_id, new volume) Note: Tuple return values are mutually exclusive, when one is None the other must be valid. r$���Nr%���)r ����poolZvolume_name� size_bytesZprovisioningr���r���r���r ���� volume_create����s���� z!IStorageAreaNetwork.volume_createc�����������������C���s���t�tjd��dS�)zq Deletes a volume. Returns Job id or None if completed, else raises LsmError on errors. r$���Nr%����r ����volumer���r���r���r ���� volume_delete����s����z!IStorageAreaNetwork.volume_deletec�����������������C���s���t�tjd��dS�)z� Re-sizes a volume. Returns a tuple (job_id, re-sized_volume) Note: Tuple return values are mutually exclusive, when one is None the other must be valid. r$���Nr%���)r ���r+����new_size_bytesr���r���r���r ���� volume_resize����s����z!IStorageAreaNetwork.volume_resizec�����������������C���s���t�tjd��dS�)aB�� Replicates a volume from the specified pool. In this library, to replicate means to create a new volume which is a copy of the source. Returns a tuple (job_id, replicated volume) Note: Tuple return values are mutually exclusive, when one is None the other must be valid. r$���Nr%���)r ���r'����rep_type� volume_src�namer���r���r���r ����volume_replicate����s���� z$IStorageAreaNetwork.volume_replicatec�����������������C���s���t�tjd��dS�)a@�� Returns the number of bytes per block for volume_replicate_range call. Callers of volume_replicate_range need to use this when calculating start and block lengths. Note: bytes per block may not match volume blocksize. Returns bytes per block, Raises LsmError on error r$���Nr%���r���r���r���r ����!volume_replicate_range_block_size����s���� z5IStorageAreaNetwork.volume_replicate_range_block_sizec�����������������C���s���t�tjd��dS�)a+�� Replicates a portion of a volume to itself or another volume. The src, dest and number of blocks values change with vendor, call volume_replicate_range_block_size to get block unit size. Returns Job id or None if completed, else raises LsmError on errors. r$���Nr%���)r ���r/���r0���Zvolume_destZrangesr���r���r���r ����volume_replicate_range����s���� z*IStorageAreaNetwork.volume_replicate_rangec�����������������C���s���t�tjd��dS�)zx Makes a volume available to the host Returns None on success, else raises LsmError on errors. r$���Nr%���r*���r���r���r ���� volume_enable����s����z!IStorageAreaNetwork.volume_enablec�����������������C���s���t�tjd��dS�)zz Makes a volume unavailable to the host Returns None on success, else raises LsmError on errors. r$���Nr%���r*���r���r���r ����volume_disable����s����z"IStorageAreaNetwork.volume_disablec�����������������C���s���t�tjd��dS�)a`�� Register a user/password for the specified initiator for CHAP authentication. in_user & in_password are for inbound CHAP, out_user & out_password are for outbound CHAP. Note: Setting in_user, in_password or out_user, out_password to None will disable authentication. Raises LsmError on error r$���Nr%���)r ����init_idZin_userZin_passwordZout_userZout_passwordr���r���r���r ����iscsi_chap_auth����s����z#IStorageAreaNetwork.iscsi_chap_authc�����������������C���s���t�tjd��dS�)z~ Allows an access group to access a volume. Returns None on success, else raises LsmError on errors. r$���Nr%����r ����access_groupr+���r���r���r���r ����volume_mask����s����zIStorageAreaNetwork.volume_maskc�����������������C���s���t�tjd��dS�)z� Revokes access for an access group for a volume Returns None on success, else raises LsmError on errors. r$���Nr%���r9���r���r���r ���� volume_unmask����s����z!IStorageAreaNetwork.volume_unmaskc�����������������C���s���t�tjd��dS��zM Returns a list of access groups, raises LsmError on errors. r$���Nr%���r���r���r���r ���� access_groups����s����z!IStorageAreaNetwork.access_groupsc�����������������C���s���t�tjd��dS�r=���r%���)r ���r1���r7���� init_typer���r���r���r���r ����access_group_create����s����z'IStorageAreaNetwork.access_group_createc�����������������C���s���t�tjd��dS�)zC Deletes an access group, Raises LsmError on error r$���Nr%����r ���r:���r���r���r���r ����access_group_delete��s����z'IStorageAreaNetwork.access_group_deletec�����������������C���s���t�tjd��dS�)zP Adds an initiator to an access group, Raises LsmError on error r$���Nr%����r ���r:���r7���r?���r���r���r���r ����access_group_initiator_add��s����z.IStorageAreaNetwork.access_group_initiator_addc�����������������C���s���t�tjd��dS�)zU Deletes an initiator from an access group, Raises LsmError on error r$���Nr%���rC���r���r���r ����access_group_initiator_delete��s����z1IStorageAreaNetwork.access_group_initiator_deletec�����������������C���s���t�tjd��dS�)zo Returns the list of volumes that access group has access to. Raises LsmError on error r$���Nr%���rA���r���r���r ����"volumes_accessible_by_access_group��s����z6IStorageAreaNetwork.volumes_accessible_by_access_groupc�����������������C���s���t�tjd��dS�)zw Returns the list of access groups that have access to the specified, Raises LsmError on error r$���Nr%���r*���r���r���r ����access_groups_granted_to_volume#��s����z3IStorageAreaNetwork.access_groups_granted_to_volumec�����������������C���s���t�tjd��dS�)z� Returns True if this volume has other volumes which are dependant on it. Implies that this volume cannot be deleted or possibly modified because it would affect its children. r$���Nr%���r*���r���r���r ����volume_child_dependency*��s����z+IStorageAreaNetwork.volume_child_dependencyc�����������������C���s���t�tjd��dS�)a��� If this volume has child dependency, this method call will fully replicate the blocks removing the relationship between them. This should return None (success) if volume_child_dependency would return False. Note: This operation could take a very long time depending on the size of the volume and the number of child dependencies. Returns None if complete else job id, raises LsmError on errors. r$���Nr%���r*���r���r���r ����volume_child_dependency_rm2��s����z.IStorageAreaNetwork.volume_child_dependency_rmc�����������������C���s���t�tjd��d�S�)Nr$���r%���r���r���r���r ����target_ports@��s����z IStorageAreaNetwork.target_ports)NNr���)r���)r���)r���)r���)r���)r���)r���)r���)r���)r���)NNr���)r���)r���)r���)r���)r���)r���)r���)r���)NNr���)r���r���r ���r&���r)���r,���r.���r2���r3���r4���r5���r6���r8���r;���r<���r>���r@���rB���rD���rE���rF���rG���rH���rI���rJ���r���r���r���r ���r#���w���s4��� �� �� �� �� r#���c�������������������@���s����e�Zd�ZdZddd�Zddd�Zddd �Zd d d�Zd!dd �Zd"dd�Z d#dd�Z d$dd�Zd%dd�Zd&dd�Z d'dd�Zd(dd�ZdS�))�INetworkAttachedStoragezT Class the represents Network attached storage (Common NFS/CIFS operations) Nr���c�����������������C���s���dS�)zf Returns a list of file systems on the controller. Raises LsmError on errors. Nr���r���r���r���r ����fsI��s����zINetworkAttachedStorage.fsc�����������������C���s���t�tjd��dS�)z� WARNING: Destructive Deletes a file system and everything it contains Returns None on success, else job id r$���Nr%����r ���rL���r���r���r���r ���� fs_deleteP��s����z!INetworkAttachedStorage.fs_deletec�����������������C���s���t�tjd��dS�)z� Re-size a file system Returns a tuple (job_id, re-sized file system) Note: Tuple return values are mutually exclusive, when one is None the other must be valid. r$���Nr%���)r ���rL���r-���r���r���r���r ���� fs_resizeY��s����z!INetworkAttachedStorage.fs_resizec�����������������C���s���t�tjd��dS�)aO�� Creates a file system given a pool, name and size. Note: size is limited to 2**64 bytes so max size of a single volume at this time is 16 Exabytes Returns a tuple (job_id, file system) Note: Tuple return values are mutually exclusive, when one is None the other must be valid. r$���Nr%���)r ���r'���r1���r(���r���r���r���r ���� fs_createc��s���� z!INetworkAttachedStorage.fs_createc�����������������C���s���t�tjd��dS�)a#�� Creates a thin, point in time read/writable copy of src to dest. Optionally uses snapshot as backing of src_fs Returns a tuple (job_id, file system) Note: Tuple return values are mutually exclusive, when one is None the other must be valid. r$���Nr%���)r ���Zsrc_fsZdest_fs_name�snapshotr���r���r���r ����fs_cloneo��s���� z INetworkAttachedStorage.fs_clonec�����������������C���s���t�tjd��dS�)z� Creates a thinly provisioned clone of src to dest. Note: Source and Destination are required to be on same filesystem Returns Job id or None if completed, else raises LsmError on errors. r$���Nr%���)r ���rL���Z src_file_nameZdest_file_namerQ���r���r���r���r ���� fs_file_clonez��s����z%INetworkAttachedStorage.fs_file_clonec�����������������C���s���t�tjd��dS�)zl Returns a list of snapshots for the supplied file system, Raises LsmError on error r$���Nr%���rM���r���r���r ����fs_snapshots���s����z$INetworkAttachedStorage.fs_snapshotsc�����������������C���s���t�tjd��dS�)a{�� Snapshot is a point in time read-only copy Create a snapshot on the chosen file system Returns a tuple (job_id, snap shot created) Note: Tuple return values are mutually exclusive, when one is None the other must be valid. Note: Snapshot name may not match what was passed in (depends on array implementation) r$���Nr%���)r ���rL���Z snapshot_namer���r���r���r ����fs_snapshot_create���s���� z*INetworkAttachedStorage.fs_snapshot_createc�����������������C���s���t�tjd��dS�)z� Frees the re-sources for the given snapshot on the supplied filesystem. Returns Job id or None if completed, else raises LsmError on errors. r$���Nr%���)r ���rL���rQ���r���r���r���r ����fs_snapshot_delete���s����z*INetworkAttachedStorage.fs_snapshot_deleteFc�����������������C���s���t�tjd��dS�)a<�� WARNING: Destructive! Reverts a file-system or just the specified files from the snapshot. If a list of files is supplied but the array cannot restore just them then the operation will fail with an LsmError raised. If files == None and all_files = True then all files on the file-system are restored. Restore_file if not None must be the same length as files with each index in each list referring to the associated file. Returns None on success, else job id, LsmError exception on error r$���Nr%���)r ���rL���rQ����filesZ restore_filesZ all_filesr���r���r���r ����fs_snapshot_restore���s����z+INetworkAttachedStorage.fs_snapshot_restorec�����������������C���s���t�tjd��dS�)a&�� Returns True if the specified filesystem or specified file on this file system has child dependencies. This implies that this filesystem or specified file on this file system cannot be deleted or possibly modified because it would affect its children. r$���Nr%����r ���rL���rW���r���r���r���r ����fs_child_dependency���s����z+INetworkAttachedStorage.fs_child_dependencyc�����������������C���s���t�tjd��dS�)a��� If this filesystem or specified file on this filesystem has child dependency this method will fully replicate the blocks removing the relationship between them. This should return None(success) if fs_child_dependency would return False. Note: This operation could take a very long time depending on the size of the filesystem and the number of child dependencies. Returns Job id or None if completed, else raises LsmError on errors. r$���Nr%���rY���r���r���r ����fs_child_dependency_rm���s����z.INetworkAttachedStorage.fs_child_dependency_rm)NNr���)r���)r���)r���)Nr���)Nr���)r���)r���)r���)Fr���)r���)r���)r���r���r ���r!���rL���rN���rO���rP���rR���rS���rT���rU���rV���rX���rZ���r[���r���r���r���r ���rK���D��s"��� ��� ��� rK���c�������������������@���s4���e�Zd�Zddd�Zddd�Zd dd�Zdd d �ZdS�)�INfsr���c�����������������C���s���t�tjd��dS�)zP Returns the types of authentication that are available for NFS r$���Nr%���r���r���r���r ����export_auth���s����zINfs.export_authNc�����������������C���s���t�tjd��dS�)zL Get a list of all exported file systems on the controller. r$���Nr%���r���r���r���r ����exports���s����zINfs.exportsc�����������������C���s���t�tjd��dS�)zA Exports a filesystem as specified in the export r$���Nr%���)r ���Zfs_idZexport_pathZ root_listZrw_listZro_listZanon_uidZanon_gidZ auth_type�optionsr���r���r���r ���� export_fs���s����zINfs.export_fsc�����������������C���s���t�tjd��dS�)z. Removes the specified export r$���Nr%���)r ���Zexportr���r���r���r ���� export_remove���s����zINfs.export_remove)r���)NNr���)r���)r���)r���r���r ���r]���r^���r`���ra���r���r���r���r ���r\������s ��� �� r\���N)�abcr���Z_ABCMetar���r"���Zlsmr���r���Zsixr����objectr���r#���rK���r\���r���r���r���r ����<module>���s���j�N�