Anons79 Mini Shell

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

�
�Udac@`s+ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	idd6dd
6Z
ddlZddlm
Z
ddlmZddlmZddlmZddlmZdddeeddedddeed�
Zdefd��YZd�Zedkr'e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys�
---
module: netapp_e_snapshot_group
short_description: NetApp E-Series manage snapshot groups
description:
    - Create, update, delete snapshot groups for NetApp E-series storage arrays
version_added: '2.2'
author: Kevin Hulquest (@hulquest)
options:
    api_username:
        required: true
        description:
        - The username to authenticate with the SANtricity WebServices Proxy or embedded REST API.
    api_password:
        required: true
        description:
        - The password to authenticate with the SANtricity WebServices Proxy or embedded REST API.
    api_url:
        required: true
        description:
        - The url to the SANtricity WebServices Proxy or embedded REST API.
    validate_certs:
        required: false
        default: true
        description:
        - Should https certificates be validated?
        type: bool
    state:
        description:
            - Whether to ensure the group is present or absent.
        required: True
        choices:
            - present
            - absent
    name:
        description:
            - The name to give the snapshot group
        required: True
    base_volume_name:
        description:
            - The name of the base volume or thin volume to use as the base for the new snapshot group.
            - If a snapshot group with an identical C(name) already exists but with a different base volume
              an error will be returned.
        required: True
    repo_pct:
        description:
            - The size of the repository in relation to the size of the base volume
        required: False
        default: 20
    warning_threshold:
        description:
            - The repository utilization warning threshold, as a percentage of the repository volume capacity.
        required: False
        default: 80
    delete_limit:
        description:
            - The automatic deletion indicator.
            - If non-zero, the oldest snapshot image will be automatically deleted when creating a new snapshot image to keep the total number of
              snapshot images limited to the number specified.
            - This value is overridden by the consistency group setting if this snapshot group is associated with a consistency group.
        required: False
        default: 30
    full_policy:
        description:
            - The behavior on when the data repository becomes full.
            - This value is overridden by consistency group setting if this snapshot group is associated with a consistency group
        required: False
        default: purgepit
        choices:
            - purgepit
            - unknown
            - failbasewrites
            - __UNDEFINED
    storage_pool_name:
        required: True
        description:
            - The name of the storage pool on which to allocate the repository volume.
    rollback_priority:
        required: False
        description:
            - The importance of the rollback operation.
            - This value is overridden by consistency group setting if this snapshot group is associated with a consistency group
        choices:
            - highest
            - high
            - medium
            - low
            - lowest
            - __UNDEFINED
        default: medium
s
    - name: Configure Snapshot group
      netapp_e_snapshot_group:
        ssid: "{{ ssid }}"
        api_url: "{{ netapp_api_url }}"
        api_username: "{{ netapp_api_username }}"
        api_password: "{{ netapp_api_password }}"
        validate_certs: "{{ netapp_api_validate_certs }}"
        base_volume_name: SSGroup_test
        name=: OOSS_Group
        repo_pct: 20
        warning_threshold: 85
        delete_limit: 30
        full_policy: purgepit
        storage_pool_name: Disk_Pool_1
        rollback_priority: medium
s�
msg:
    description: Success message
    returned: success
    type: str
    sample: json facts for newly created snapshot group.
sapplication/jsonsContent-TypetAcceptN(tbasic_auth_argument_spec(t
AnsibleModule(t	to_native(topen_url(t	HTTPErrortGETi
cC`sy[td|d|d|d|d|d|d|d|d	|d
|	d|
d|d
|�
}Wntk
ry}|j}nXy.|j�}|r�tj|�}nd}Wn&tk
r�|
r�q�t|��nX|j�}|dkr|
rt||��n
||fSdS(Nturltdatatheaderstmethodt	use_proxytforcet
last_mod_timettimeouttvalidate_certsturl_usernameturl_passwordt
http_agenttforce_basic_authi�(	RR
tfptreadtjsontloadstNonet	Exceptiontgetcode(RRRRRRRRRRRRRt
ignore_errorstrterrtraw_datat	resp_code((sZ/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_snapshot_group.pytrequest�s($



t
SnapshotGroupcB`sheZd�Zed��Zed��Zed��Zed��Zd�Zd�Z	d�Z
RS(cC`s�t�}|jdtdddt�dtdddtdt�dtdddt�dtdtd	d
dg�dtdt�d
tdt�dtdddd�dtdddd�dtdddd�dtddd	dddg�dtddd	dddddg�d tdd�d!tdt��
td"|�|_t�|_|jjd|_|jjd|_	|jjd
|_
|jjd|_|jjd|_|jjd|_
|jjd|_|jjd |_|jjd|_|jjd|_|jjd|_|jjd|_|jjd#|_|jjd!|_|jjd$�s||jd$7_nt|_dS(%Ntapi_usernamettypetstrtrequiredtapi_passwordtno_logtapi_urltstatetchoicestpresenttabsenttbase_volume_nametnametrepo_pcttdefaultitinttwarning_thresholdiPtdelete_limititfull_policytpurgepittunknowntfailbasewritestrollback_prioritytmediumthighestthightlowtlowesttstorage_pool_nametssidt
argument_specRt/(R	tupdatetdicttTrueR
tmodulet	post_datatparamsR:R5R6R7R;R<R@RFR1RtusertpwdtcertsRGtendswithtFalsetchanged(tselfRH((sZ/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_snapshot_group.pyt__init__�sD		$cC`s�d|j}|j|}y.t|dtd|jd|j�\}}Wn=tk
r�}|jjddd|jt	|�f�nXx2|D]*}|d|j
kr�||_|d	Sq�W|jjdd
|j�dS(Ns storage-systems/%s/storage-poolsRRRtmsgs7Snapshot group module - Failed to fetch storage pools. sId [%s]. Error [%s].R6tids-No storage pool with the name: '%s' was found(
RGRR(tHEADERSRPRQR!RMt	fail_jsonRRFt	pool_dataR6(RVtpoolsRtrcRR%tpool((sZ/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_snapshot_group.pytpool_id�s

.
	c	
C`s>d|j}|j|}y7t|dtd|jd|jd|j�\}}Wn=tk
r�}|jj	ddd|jt
|�f�nXd	}xj|D]b}|d
|jkr�|d7}|dkr�|jj	dd|j�q|d
}||_q�q�Wy|SWn+t
k
r9|jj	dd|j�nXdS(Nsstorage-systems/%s/volumesRRRRRXs1Snapshot group module - Failed to fetch volumes. sId [%s]. Error [%s].iR6is]More than one volume with the name: %s was found, please ensure your volume has a unique nameRYs&No volume with the name: %s, was found(RGRR(RZRPRQRRR!RMR[RR5tvolumet	NameError(	RVtvolumesRR^RR%tqtyRatId((sZ/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_snapshot_group.pyt	volume_id�s*

!



c
C`s�|jd|j}y7t|dtd|jd|jd|j�\}}Wn=tk
r�}|jj	ddd|jt
|�f�nXx2|D]*}|d	|jkr�||_|d
Sq�WdS(Ns"storage-systems/%s/snapshot-groupsRRRRRXs!Failed to fetch snapshot groups. sId [%s]. Error [%s].R6RY(RRGR(RZRPRQRRR!RMR[RR6tssg_dataR (RVRR^RR%tssg((sZ/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_snapshot_group.pytsnapshot_group_ids!
	cC`sd|jd|jksX|jd|jksX|jd|jksX|jd|jkr\tStSdS(NtfullWarnThresholdtautoDeleteLimitt
repFullPolicytrollbackPriority(RgR:R;R<R@RLRT(RV((sZ/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_snapshot_group.pytssg_needs_updatescC`sLtd|jd|jd|jd|jd|jd|jd|j�|_d|j	}|j
|}yRt|d	tj
|j�d
ddtd
|jd|jd|j�\}|_WnCtk
r�}|jjddd|j|j	t|�f�nX|js|jd|_n|jr/|j�n|jjdt|j�dS(NtbaseMappableObjectIdR6trepositoryPercentagetwarningThresholdRkt
fullPolicyt
storagePoolIds"storage-systems/%s/snapshot-groupsRRtPOSTRRRRRXs!Failed to create snapshot group. s)Snapshot group [%s]. Id [%s]. Error [%s].RYRU(RKRfR6R7R:R;R<R`RNRGRR(RtdumpsRZRPRQRRRgR!RMR[RRiRnt
update_ssgt	exit_jsonRL(RVtsnapshotRR^R%((sZ/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_snapshot_group.pytcreate_snapshot_group"s.						

'+			
cC`s�td|jd|jd|jd|j�|_|jd|j|jf}yRt	|dt
j|j�ddd	td
|j
d|jd|j�\}|_WnCtk
r�}|jjd
dd|j|jt|�f�nXdS(NRqRkRrRms%storage-systems/%s/snapshot-groups/%sRRRtRRRRRXs!Failed to update snapshot group. s)Snapshot group [%s]. Id [%s]. Error [%s].(RKR:R;R<R@RNRRGRiR(RRuRZRPRQRRRgR!RMR[R6R(RVRR^R%((sZ/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_snapshot_group.pyRv?s			'+	cC`sR|jdkr�|jr�yTt|jd|j|jfdddtd|jd|jd|j�\}}WnCt	k
r�}|j
jd	d
d|j|jt
|�f�nX|j
jdtd	d
|j�qN|j
jdtd	d�n^|jrD|jr(|j�|j
jdt|j�qN|j
jdt|j�n
|j�dS(NR4s%storage-systems/%s/snapshot-groups/%sRtDELETERRRRRXs!Failed to delete snapshot group. s)Snapshot group [%s]. Id [%s]. Error [%s].RUsSnapshot group removedsSnapshot group absent(R1RiR(RRGRZRQRPRRR!RMR[R6RRwRLRgRTRnRvRy(RVR^trespR%((sZ/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_snapshot_group.pytapplyQs(		"		
(t__name__t
__module__RWtpropertyR`RfRiRnRyRvR|(((sZ/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_snapshot_group.pyR)�s	+
		cC`st�}|j�dS(N(R)R|(tvg((sZ/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_snapshot_group.pytmainls	t__main__(t
__future__RRRR+t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNRZRtansible.module_utils.apiR	tansible.module_utils.basicR
tansible.module_utils._textRtansible.module_utils.urlsRt+ansible.module_utils.six.moves.urllib.errorR
R RLRTR(tobjectR)R�R}(((sZ/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_snapshot_group.pyt<module>s.


]
�	

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