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_sync.pyo

�
�Udac@`sddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
Z
ddlmZdd
l
mZddlmZddlmZdddeeddedddeed�
Zdefd��YZd�Zedkre�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys�	
---
module: netapp_e_amg_sync
short_description: NetApp E-Series conduct synchronization actions on asynchronous mirror groups.
description:
    - Allows for the initialization, suspension and resumption of an asynchronous mirror group's synchronization 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
    ssid:
        description:
            - The ID of the storage array containing the AMG you wish to target
    name:
        description:
            - The name of the async mirror group you wish to target
        required: yes
    state:
        description:
            - The synchronization action you'd like to take.
            - If C(running) then it will begin syncing if there is no active sync or will resume a suspended sync. If there is already a sync in
              progress, it will return with an OK status.
            - If C(suspended) it will suspend any ongoing sync action, but return OK if there is no active sync or if the sync is already suspended
        choices:
            - running
            - suspended
        required: yes
    delete_recovery_point:
        description:
            - Indicates whether the failures point can be deleted on the secondary if necessary to achieve the synchronization.
            - If true, and if the amount of unsynchronized data exceeds the CoW repository capacity on the secondary for any member volume, the last
              failures point will be deleted and synchronization will continue.
            - If false, the synchronization will be suspended if the amount of unsynchronized data exceeds the CoW Repository capacity on the secondary
              and the failures point will be preserved.
            - "NOTE: This only has impact for newly launched syncs."
        type: bool
        default: no
s
    - name: start AMG async
      netapp_e_amg_sync:
        name: "{{ amg_sync_name }}"
        state: running
        ssid: "{{ ssid }}"
        api_url: "{{ netapp_api_url }}"
        api_username: "{{ netapp_api_username }}"
        api_password: "{{ netapp_api_password }}"
s4
json:
    description: The object attributes of the AMG.
    returned: success
    type: str
    example:
        {
            "changed": false,
            "connectionType": "fc",
            "groupRef": "3700000060080E5000299C24000006EF57ACAC70",
            "groupState": "optimal",
            "id": "3700000060080E5000299C24000006EF57ACAC70",
            "label": "made_with_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": "60080E5000299C24000006EF57ACAC70"
    }
N(tbasic_auth_argument_spec(t
AnsibleModule(t	HTTPError(topen_urltGETi
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�(	RR
tfptreadtjsontloadstNonet	Exceptiontgetcode(R
RRRRRRRRRRRRt
ignore_errorstrtetraw_datat	resp_code((sT/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_amg_sync.pytrequest�s($



tAMGsynccB`s;eZd�Zd�Zed��Zd�Zd�ZRS(cC`s�t�}|jtdtdddt�dtdddtdt�dtdddt�dtdtdd�d	tdtdd�d
tdtddddd
g�dtdtdddt���td|�|_|jj}|d|_|d	|_	|d
|_
|d|_y+|d|_|d|_
|d|_Wn$tk
rg|jjdd�nX|d|_idd6dd6|_|j�\|_|_dS(Ntapi_usernamettypetstrtrequiredtapi_passwordtno_logtapi_urltnametssidtstatetchoicestrunningt	suspendedtdelete_recovery_pointtbooltdefaultt
argument_spectmsgsHYou must pass in api_usernameand api_password and api_url to the module.Rsapplication/jsontAcceptsContent-Type(RtupdatetdicttTruetFalseR	tmoduletparamsR/R0R1R5tusertpwdR
tKeyErrort	fail_jsontcertstpost_headerstget_amgtamg_idtamg_obj(tselfR8targs((sT/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_amg_sync.pyt__init__�s4	!








c
`s��jd�j}t|d�jd�jd�jd�j�\}}y@t�fd�|�dd}t�fd	�|�d}Wn4tk
r��j	j
d
d�j�jf�nX||fS(Ns!/storage-systems/%s/async-mirrorsRRRRc`s|d�jkS(Ntlabel(R/(td(RJ(sT/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_amg_sync.pyt<lambda>�sitidc`s|d�jkS(NRM(R/(RN(RJ(sT/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_amg_sync.pyRO�sR9sCThere is no async mirror group  %s associated with storage array %s(R
R0R&RARBRERFtfiltert
IndexErrorR?RDR/(RJtendpointtrctamg_objsRHRI((RJsT/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_amg_sync.pyRG�s$  
cC`s|j�\}}|dS(NtsyncActivity(RG(RJRHRI((sT/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_amg_sync.pyt
current_state�scC`st�}|jdkr^|jdkrU|jrL|jtd|j��nd}qdd}nd}|jd|j|j|f}t|dd	d
|j	d|j
d|jd
tj
|�d|jdt�\}}t|�jd�s
|jjdt|d��n|S(NR3tidletdeleteRecoveryPointIfNecessarytsynctresumetsuspends'/storage-systems/%s/async-mirrors/%s/%sRtPOSTRRRRRR!t2R9terrorMessage(R<R1RWR5R;R
R0RHR&RARBRERtdumpsRFR=R*t
startswithR?RD(RJt	post_bodytsuffixRSRTtresp((sT/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_amg_sync.pytrun_sync_action�s				 !! cC`s�tddgddddgddd	g�}|j||jkr�|j|dkrw|jjd
dd|j�q�|j�|_n|j�\}}|jjd
t	|�dS(NR3tactiveR4t
userSuspendedtinternallySuspendedtpausedterrtunkownt
_UNDEFINEDR9s@The sync is a state of '%s', this requires manual intervention. s Please investigate and try againtchanged(
R<RWR1R?RDReRIRGt	exit_jsonR>(RJt	state_maptrettamg((sT/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_amg_sync.pytapply�s	(t__name__t
__module__RLRGtpropertyRWReRr(((sT/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_amg_sync.pyR'�s
	 		cC`st�}|j�dS(N(R'Rr(RZ((sT/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_amg_sync.pytmain�s	t__main__(t
__future__RRRR)t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNRtansible.module_utils.apiRtansible.module_utils.basicR	t+ansible.module_utils.six.moves.urllib.errorR
tansible.module_utils.urlsRRR=R>R&tobjectR'RvRs(((sT/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_amg_sync.pyt<module>s&


9
)_	

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