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_amg.pyc

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
Z
ddlZddlm
Z
dd
lmZddlmZmZidd6dd6Zd�Zd�Zd�Zd�Zd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys�
---
module: netapp_e_amg
short_description: NetApp E-Series create, remove, and update asynchronous mirror groups
description:
    - Allows for the creation, removal and updating of Asynchronous Mirror Groups for NetApp E-series storage arrays
version_added: '2.2'
author: Kevin Hulquest (@hulquest)
extends_documentation_fragment:
    - netapp.eseries
options:
    name:
        description:
            - The name of the async array you wish to target, or create.
            - If C(state) is present and the name isn't found, it will attempt to create.
        required: yes
    secondaryArrayId:
        description:
            - The ID of the secondary array to be used in mirroring process
        required: yes
    syncIntervalMinutes:
        description:
            - The synchronization interval in minutes
        default: 10
    manualSync:
        description:
            - Setting this to true will cause other synchronization values to be ignored
        type: bool
        default: 'no'
    recoveryWarnThresholdMinutes:
        description:
            - Recovery point warning threshold (minutes). The user will be warned when the age of the last good failures point exceeds this value
        default: 20
    repoUtilizationWarnThreshold:
        description:
            - Recovery point warning threshold
        default: 80
    interfaceType:
        description:
            - The intended protocol to use if both Fibre and iSCSI are available.
        choices:
            - iscsi
            - fibre
    syncWarnThresholdMinutes:
        description:
            - The threshold (in minutes) for notifying the user that periodic synchronization has taken too long to complete.
        default: 10
    state:
        description:
            - A C(state) of present will either create or update the async mirror group.
            - A C(state) of absent will remove the async mirror group.
        choices: [ absent, present ]
        required: yes
s�
    - name: AMG removal
      na_eseries_amg:
        state: absent
        ssid: "{{ ssid }}"
        secondaryArrayId: "{{amg_secondaryArrayId}}"
        api_url: "{{ netapp_api_url }}"
        api_username: "{{ netapp_api_username }}"
        api_password: "{{ netapp_api_password }}"
        new_name: "{{amg_array_name}}"
        name: "{{amg_name}}"
      when: amg_create

    - name: AMG create
      netapp_e_amg:
        state: present
        ssid: "{{ ssid }}"
        secondaryArrayId: "{{amg_secondaryArrayId}}"
        api_url: "{{ netapp_api_url }}"
        api_username: "{{ netapp_api_username }}"
        api_password: "{{ netapp_api_password }}"
        new_name: "{{amg_array_name}}"
        name: "{{amg_name}}"
      when: amg_create
sW
msg:
    description: Successful creation
    returned: success
    type: str
    sample: '{"changed": true, "connectionType": "fc", "groupRef": "3700000060080E5000299C24000006E857AC7EEC", "groupState": "optimal", "id": "3700000060080E5000299C24000006E857AC7EEC", "label": "amg_made_by_ansible", "localRole": "primary", "mirrorChannelRemoteTarget": "9000000060080E5000299C24005B06E557AC7EEC", "orphanGroup": false, "recoveryPointAgeAlertThresholdMinutes": 20, "remoteRole": "secondary", "remoteTarget": {"nodeName": {"ioInterfaceType": "fc", "iscsiNodeName": null, "remoteNodeWWN": "20040080E5299F1C"}, "remoteRef": "9000000060080E5000299C24005B06E557AC7EEC", "scsiinitiatorTargetBaseProperties": {"ioInterfaceType": "fc", "iscsiinitiatorTargetBaseParameters": null}}, "remoteTargetId": "ansible2", "remoteTargetName": "Ansible2", "remoteTargetWwn": "60080E5000299F880000000056A25D56", "repositoryUtilizationWarnThreshold": 80, "roleChangeProgress": "none", "syncActivity": "idle", "syncCompletionTimeAlertThresholdMinutes": 10, "syncIntervalMinutes": 10, "worldWideName": "60080E5000299C24000006E857AC7EEC"}'
N(t
AnsibleModule(t	to_native(trequestteseries_host_argument_specsapplication/jsonsContent-TypetAcceptc`scddddg}t�fd�|D��}t}t}	d}
d}d}�jd�}
d|}||}y(t|d|d	|d
t�\}}Wn9tk
r�}|jddt|�d
t	j
��nXxh|D]`}|d|
kr�t}|}|d}td|dd|dd|dd|d�}
q�q�W|
|krSt}	n||	||fS(NtsyncIntervalMinutestsyncWarnThresholdMinutestrecoveryWarnThresholdMinutestrepoUtilizationWarnThresholdc3`s$|]}|�j|�fVqdS(N(tget(t.0tx(tbody(sO/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_amg.pys	<genexpr>xstnames storage-systems/%s/async-mirrorsturl_usernameturl_passwordtheaderstmsgs"Error finding a match. Message: %st	exceptiontlabeltgroupReft'syncCompletionTimeAlertThresholdMinutest%recoveryPointAgeAlertThresholdMinutest"repositoryUtilizationWarnThreshold(tdicttFalsetNoneRR
tHEADERSt	Exceptiont	exit_jsonR	t	tracebackt
format_exctTrue(tmoduletssidtapi_urltapi_pwdtapi_usrRtcompare_keyst
desired_statetlabel_existstmatches_spect
current_statetasync_idtapi_datatdesired_nametendpointturltrctdatatetasync_group((RsO/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_amg.pyt	has_matchus8

(*




	cC`s�d|}||}tj|�}y4t|d|ddd|d|dt�\}	}
Wn9tk
r�}|jdd	t|�d
tj��nX|
S(Ns storage-systems/%s/async-mirrorsR9tmethodtPOSTRRRRs8Exception while creating aysnc mirror group. Message: %sR(	tjsontdumpsR
R#R$R%R	R&R'(R)R*R+R,R-RR6R7t	post_dataR8R9R:((sO/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_amg.pytcreate_async�s

!c`s�d||f}||}	ddddg}
t�fd�|
D��}|r[||d<ntj|�}y4t|	d|d	d
dtd|d
|�\}
}Wn9tk
r�}|jddt|�dtj	��nX|S(Ns#storage-systems/%s/async-mirrors/%sR
RRRc3`s$|]}|�j|�fVqdS(N(R(RR(R(sO/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_amg.pys	<genexpr>�stnew_nameR9R=R>RRRRs8Exception while updating async mirror group. Message: %sR(
R R?R@R
R#R$R%R	R&R'(R)R*R+tpwdtuserRRCR3R6R7R.R/RAR8R9R:((RsO/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_amg.pytupdate_async�s

c
C`s�d||f}||}y.t|ddd|d|dt�\}}	Wn9tk
r�}
|jddt|
�d	tj��nXdS(
Ns#storage-systems/%s/async-mirrors/%sR=tDELETERRRRs8Exception while removing async mirror group. Message: %sR(R
R#R$R%R	R&R'(R)R*R+RDRER3R6R7R8R9R:((sO/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_amg.pyt
remove_amg�s
cC`s�t�}|jtdtdtdd�dtdtdd�dtdtdd�dtdtdd	dd
�dtdtdtdd�d
tdtdddd
�dtdtdddd
�dtdtdddgdd�dtdtdddg�dtdtdd	dd
��
�td|�}|j}|jd�}|jd�}|jd�}|jd�}|jd�}|jd�}|jd�s�|d7}nt	||||||�\}	}
}}|dkr�|	r|
r|j
dtd d!|�q�|	rT|
rTt||||||||�}
|j
dtd d"d#||
�q�|	s�t||||||�}
|j
dt|
�q�nk|dkr�|	r�t
||||||�|j
dtd d$d#|�q�|j
dtd d%|d�ndS(&NRtrequiredttypetstrRCtsecondaryArrayIdR
tdefaulti
tintt
manualSynctboolRiRiPt
interfaceTypetchoicestfibretiscsitstatetpresenttabsentRt
argument_specR*R+tapi_usernametapi_passwordt/tchangedRsDesired state metsAsync mirror group updatedR3sAsync mirror group removed.s%Async Mirror group: %s already absent(RtupdateR R(R!RtparamstpoptendswithR<R%RFRBRH(RXR)tpR*R+RERDRCRUtname_existstspec_matchesR4R3tresults((sO/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_amg.pytmain�sT	!	
'
	

t__main__(t
__future__RRRRJt
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNR?R&tansible.module_utils.basicRtansible.module_utils._textR	tansible.module_utils.netappR
RR#R<RBRFRHRet__name__(((sO/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_amg.pyt<module>s,


8
	#	
		
	6

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