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/purefa_connect.pyo

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	e
Zyddlm
Z
Wnek
r�eZnXddlZdd
lmZddlmZmZd�Zd�Zd�Zd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys
---
module: purefa_connect
version_added: '2.9'
short_description: Manage replication connections between two FlashArrays
description:
- Manage array connections to specified target array
author:
- Pure Storage Ansible Team (@sdodsley) <[email protected]>
options:
  state:
    description:
    - Create or delete array connection
    default: present
    type: str
    choices: [ absent, present ]
  target_url:
    description:
    - Management IP address of remote array.
    type: str
    required: true
  target_api:
    description:
    - API token for target array
    type: str
  connection:
    description: Type of connection between arrays.
    type: str
    choices: [ sync, async ]
    default: async
extends_documentation_fragment:
- purestorage.fa
s�
- name: Create an async connection to remote array
  purefa_connect:
    target_url: 10.10.10.20
    target_api:
    connection: async
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592

- name: Delete connection to remote array
  purefa_connect:
    state: absent
    target_url: 10.10.10.20
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592

t
(t
FlashArrayN(t
AnsibleModule(t
get_systemtpurefa_argument_speccC`sa|j�}xNtdt|��D]7}||d|jdkr"||dr"||Sq"WdS(Nitmanagement_addresst
target_urlt	connected(tlist_array_connectionstrangetlentparamstNone(tmoduletarraytconnected_arraysttarget((sV/usr/lib/python2.7/site-packages/ansible/modules/storage/purestorage/purefa_connect.pyt_check_connectedPscC`st}|jsk|j�d}y|j|d�Wqktk
rg|jddj|d|��qkXn|jd|�dS(sBreak connection between arrayst
array_nametmsgs"Failed to disconnect {0} from {1}.tchangedN(tTruet
check_modetgettdisconnect_arrayt	Exceptiont	fail_jsontformatt	exit_json(RRttarget_arrayRtsource_array((sV/usr/lib/python2.7/site-packages/ansible/modules/storage/purestorage/purefa_connect.pytbreak_connectionYs	
'cC`st}|js�|jd}didd6td6dd6tj�d6}ytt|jdd	|jd
d|�}|jdt�d}|j�d
}|j|jd||jdg�Wq�tk
r�|j	ddj
|��q�Xn|jd|�dS(s Create connection between arraysRs-%(base)s %(class)s/%(version)s (%(platform)s)tAnsibletbasetclassg333333�?tversiontplatformt	api_tokent
target_apit
user_agenttconnection_keyRt
connectionRs&Failed to connect to remote array {0}.RN(RRRt__name__R,R	Rt
connect_arrayR!R"R#R$(RRRtremote_arrayR/t
remote_systemR0((sV/usr/lib/python2.7/site-packages/ansible/modules/storage/purestorage/purefa_connect.pytcreate_connectiones$	

	(
 c
C`sTt�}|jtdtdddddddg�dtdddd	dd	d
g�dtdddt�d
tdd���ddd
gfg}t|d|dt�}ts�|jdd�n|jd}t|�}t	||�}|dkr|dkrt||�n+|dkr@|dk	r@t|||�n|j
dt�dS(NtstatettypetstrtdefaulttpresenttchoicestabsentR1tasynctsyncRtrequiredR.trequired_iftsupports_check_modeRs+purestorage sdk is required for this moduleR(RtupdatetdictRR
tHAS_PURESTORAGER"RRRRR6R'R$tFalse(t
argument_specRARR7RR%((sV/usr/lib/python2.7/site-packages/ansible/modules/storage/purestorage/purefa_connect.pytmain|s(	!!		
t__main__(t
__future__RRRR8t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNRREtpurestorageR	tImportErrorRFR,tansible.module_utils.basicR
tansible.module_utils.pureRRRR'R6RHR2(((sV/usr/lib/python2.7/site-packages/ansible/modules/storage/purestorage/purefa_connect.pyt<module>s*


"

					

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