Sindbad~EG File Manager
3
�.'ebB � @ 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� )�selfZuriZpasswordZtimeout�flagsr r � /usr/lib64/python3.6/_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 Zmsr
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_get1 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 r �plugin_unregister: 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 �job_idr
r r r �
job_statusF 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 r r �job_freeQ s zIPlugin.job_freec C s dS )zS
Returns the capabilities for the selected system, raises LsmError
Nr )r �systemr
r r r �capabilitiesZ 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 r �plugin_infoa 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 �
search_key�search_valuer
r r r �poolsk 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 r �systemsu 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
z
Not supportedN)r r �
NO_SUPPORT)r r r r
r r r �volumes� 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.
z
Not supportedN)r r r )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.
z
Not supportedN)r r r )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.
z
Not supportedN)r r r )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.
z
Not supportedN)r r r )r r"