Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/module_utils/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/module_utils/netapp_elementsw_module.pyo

�
�Udac@sYeZyddlZeZWnek
r5eZnXd�Zdefd��YZdS(i����NcCstS(N(t
HAS_SF_SDK(((sP/usr/lib/python2.7/site-packages/ansible/module_utils/netapp_elementsw_module.pyt
has_sf_sdk
stNaElementSWModulecBsPeZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	RS(cCs||_t�|_dS(N(telem_connecttdictt
parameters(tselftelem((sP/usr/lib/python2.7/site-packages/ansible/module_utils/netapp_elementsw_module.pyt__init__s	cCs[|jjd|g�}x<|jD]1}|j|kr"t|j�dkrS|Sq"q"WdS(s�
            Return volume details if volume exists for given volume_id

            :param volume_id: volume ID
            :type volume_id: int
            :return: Volume dict if found, None if not found
            :rtype: dict
        t
volume_idstN(Rtlist_volumestvolumest	volume_idtstrtdelete_timetNone(RR
tvolume_listtvolume((sP/usr/lib/python2.7/site-packages/ansible/module_utils/netapp_elementsw_module.pyt
get_volumes	cCs[|jjd|�}x?|jD]4}|j|krt|j�dkrS|jSqqWdS(s�
            Return volume id from the given (valid) account_id if found
            Return None if not found

            :param vol_name: Name of the volume
            :type vol_name: str
            :param account_id: Account ID
            :type account_id: int

            :return: Volume ID of the first matching volume if found. None if not found.
            :rtype: int
        t
account_idR
N(Rtlist_volumes_for_accountRtnameRRR
R(Rtvol_nameRRR((sP/usr/lib/python2.7/site-packages/ansible/module_utils/netapp_elementsw_module.pyt
get_volume_id's
cCs^|jjd|g�}x?|jD]4}|j|kr"t|j�dkrV|jSq"q"WdS(s�
            Return volume_id if volume exists for given volume_id

            :param volume_id: volume ID
            :type volume_id: int
            :return: Volume ID if found, None if not found
            :rtype: int
        R	R
N(RRRR
RRR(RR
RR((sP/usr/lib/python2.7/site-packages/ansible/module_utils/netapp_elementsw_module.pytvolume_id_exists<s	cCsht|�j�rRt|�}y|j|�r4|SWqRtjjk
rNqRXn|j||�}|S(s
            Return volume_id if exists, None if not found

            :param volume: Volume ID or Name
            :type volume: str
            :param account_id: Account ID (valid)
            :type account_id: int
            :return: Volume ID if found, None if not found
        (RtisdigittintRt	solidfiretcommontApiServerErrorR(RRRR
((sP/usr/lib/python2.7/site-packages/ansible/module_utils/netapp_elementsw_module.pyt
volume_existsLscCsk|jjd|�}xO|jD]D}t|�j�rP|jt|�krP|S|j|kr|SqWdS(s8
            Return snapshot details if found

            :param snapshot_id: Snapshot ID or Name
            :type snapshot_id: str
            :param volume_id: Account ID (valid)
            :type volume_id: int
            :return: Snapshot dict if found, None if not found
            :rtype: dict
        R
N(	Rtlist_snapshotst	snapshotsRRtsnapshot_idRRR(RR"R
t
snapshot_listtsnapshot((sP/usr/lib/python2.7/site-packages/ansible/module_utils/netapp_elementsw_module.pytget_snapshotcs	'cCs�|j�rdt|�}y/|jjd|�}|jj|krF|SWqdtjjk
r`qdXn|jj	d|�}|jjS(s
            Return account_id if account exists for given account id or name
            Raises an exception if account does not exist

            :param account: Account ID or Name
            :type account: str
            :return: Account ID if found, None if not found
        Rtusername(
RRRtget_account_by_idtaccountRRRRtget_account_by_name(RR(Rtresult((sP/usr/lib/python2.7/site-packages/ansible/module_utils/netapp_elementsw_module.pytaccount_existszs
cCsi}d|d<||d<|S(s�
            Return telemetry attributes for the current execution

            :param source: name of the module
            :type source: str
            :return: a dict containing telemetry attributes
        tansiblesconfig-mgmtsevent-source((Rtsourcet
attributes((sP/usr/lib/python2.7/site-packages/ansible/module_utils/netapp_elementsw_module.pytset_element_attributes�s

(
t__name__t
__module__RRRRRR%R+R/(((sP/usr/lib/python2.7/site-packages/ansible/module_utils/netapp_elementsw_module.pyRs							(	tFalseRtsolidfire.commonRtTruet	ExceptionRtobjectR(((sP/usr/lib/python2.7/site-packages/ansible/module_utils/netapp_elementsw_module.pyt<module>s


	

Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]