Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/storage/purestorage/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/storage/purestorage/purefb_snap.pyc

�
�Udac@`s$ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZddlm
Z
mZdd
lmZeZyddlmZmZWnek
r�eZnXd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zedkr e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys;
---
module: purefb_snap
version_added: '2.6'
short_description: Manage filesystem snapshots on Pure Storage FlashBlades
description:
- Create or delete volumes and filesystem snapshots on Pure Storage FlashBlades.
author:
- Pure Storage Ansible Team (@sdodsley) <[email protected]>
options:
  name:
    description:
    - The name of the source filesystem.
    required: true
    type: str
  suffix:
    description:
    - Suffix of snapshot name.
    type: str
  state:
    description:
    - Define whether the filesystem snapshot should exist or not.
    choices: [ absent, present ]
    default: present
    type: str
  eradicate:
    description:
    - Define whether to eradicate the snapshot on delete or leave in trash.
    type: bool
    default: 'no'
extends_documentation_fragment:
- purestorage.fb
s�
- name: Create snapshot foo.ansible
  purefb_snap:
    name: foo
    suffix: ansible
    fb_url: 10.10.10.2
    fb_api_token: e31060a7-21fc-e277-6240-25983c6c4592
    state: present

- name: Delete snapshot named foo.snap
  purefb_snap:
    name: foo
    suffix: snap
    fb_url: 10.10.10.2
    fb_api_token: e31060a7-21fc-e277-6240-25983c6c4592
    state: absent

- name: Recover deleted snapshot foo.ansible
  purefb_snap:
    name: foo
    suffix: ansible
    fb_url: 10.10.10.2
    fb_api_token: e31060a7-21fc-e277-6240-25983c6c4592
    state: present

- name: Eradicate snapshot named foo.snap
  purefb_snap:
    name: foo
    suffix: snap
    eradicate: true
    fb_url: 10.10.10.2
    fb_api_token: e31060a7-21fc-e277-6240-25983c6c4592
    state: absent
t
(t
AnsibleModule(t	get_bladetpurefb_argument_spec(tdatetime(tFileSystemSnapshottSnapshotSuffixcC`sWg}|j|jd�y$|jjd|�}|jdSWntk
rRdSXdS(sReturn Filesystem or NonetnametnamesiN(tappendtparamstfile_systemstlist_file_systemstitemst	ExceptiontNone(tmoduletbladetfstres((sS/usr/lib/python2.7/site-packages/ansible/modules/storage/purestorage/purefb_snap.pytget_fsbs
cC`sayHd|jdd|jdd}|jjd|�}|jdSWntk
r\dSXdS(	sReturn Snapshot or Nonessource='Rs' and suffix='tsuffixs'tfilteriN(Rtfile_system_snapshotstlist_file_system_snapshotsRRR(RRtfiltR((sS/usr/lib/python2.7/site-packages/ansible/modules/storage/purestorage/purefb_snap.pytget_fssnapshotms$
cC`s�|jspg}|j|jd�y0|jjd|dt|jd��t}Wqptk
rlt}qpXn|j	d|�dS(sCreate SnapshotRtsourcesRtchangedN(
t
check_modeRRRtcreate_file_system_snapshotsRtTrueRtFalset	exit_json(RRtsourceR$((sS/usr/lib/python2.7/site-packages/ansible/modules/storage/purestorage/purefb_snap.pytcreate_snapshotws	&


cC`s�|jst|jdd|jd}tdt�}y#|jjd|d|�t}Wqttk
rpt}qtXn|jd|�dS(sRecover deleted SnapshotRt.Rt	destroyedt
attributesR$N(	R%RR
R(Rtupdate_file_system_snapshotsR'RR)(RRtsnapnametnew_attrR$((sS/usr/lib/python2.7/site-packages/ansible/modules/storage/purestorage/purefb_snap.pytrecover_snapshot�s	


cC`st}|jd|�dS(sUpdate SnapshotR$N(R(R)(RRR$((sS/usr/lib/python2.7/site-packages/ansible/modules/storage/purestorage/purefb_snap.pytupdate_snapshot�scC`s�|js�|jdd|jd}tdt�}yj|jjd|d|�t}|jdr�y|jjd|�t}Wq�tk
r�t}q�XnWq�tk
r�t}q�Xn|j	d|�dS(	s Delete SnapshotRR,RR-R.t	eradicateR$N(
R%RR
R'RR/tdelete_file_system_snapshotsRR(R)(RRR0R1R$((sS/usr/lib/python2.7/site-packages/ansible/modules/storage/purestorage/purefb_snap.pytdelete_snapshot�s	




cC`ss|js_|jdd|jd}y|jjd|�t}Wq_tk
r[t}q_Xn|jd|�dS(s Eradicate SnapshotRR,RR$N(R%RRR5R'RR(R)(RRR0R$((sS/usr/lib/python2.7/site-packages/ansible/modules/storage/purestorage/purefb_snap.pyteradicate_snapshot�s	


cC`s�t�}|jtdtdt�dtdd�dtdddd	�d
tddddd
g���t|dt�}ts�|jdd�n|jddkr�dt	t
j�t
ddddddd�j��}|j
dd�|jd<n|jd
}t|�}t||�}t||�}|dkrc|rc|jrc|rct||�nB|dkr�|r�|jr�|r�|jr�t||�n|dkr�|r�|jr�|r�|jr�t||�n�|dkr|r|jrt||�n�|dkr(|r(t||�n}|d
krT|rT|jrTt||�nQ|d
kr|r|jrt||�n&|d
kr�|r�|jdt�ndS(NRtrequiredRttypetstrR4tdefaulttfalsetbooltstatetpresenttchoicestabsenttsupports_check_modetmsgs)purity_fb sdk is required for this modulessnap-i�iiR,tR$(RtupdatetdictR'R	t
HAS_PURITY_FBt	fail_jsonRRR:Rtutcnowt
total_secondstreplaceR
RR"R-R+R3R2R6R7R)R((t
argument_specRRR>RRtsnap((sS/usr/lib/python2.7/site-packages/ansible/modules/storage/purestorage/purefb_snap.pytmain�sD			8
#,+t__main__N( t
__future__RRRR9t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.basicR	tansible.module_utils.pureR
RRR'RGt	purity_fbR
RtImportErrorR(RR"R+R2R3R6R7RNt__name__(((sS/usr/lib/python2.7/site-packages/ansible/modules/storage/purestorage/purefb_snap.pyt<module>s2


"#

		
	
	
				,

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