Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/module_utils/network/a10/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/module_utils/network/a10/a10.pyc

�
�Udac@s�ddlZddlmZidd6dd6Zidd6dd6dd6d	d
6dd6Zd
�Zd�Zdd�Zd�Z	d�Z
dddd�Zd�Zd�Z
d�ZdS(i����N(t	fetch_urlittcpitudpi	s	fast-httpithttpithttpscCsytdtdddt�dtdddddgdt�d	tdddd
dgdtdt�d
tdddt��S(Nthostttypetstrtrequiredtusernametaliasestusertadmintpasswordtpasstpwdtno_logtwrite_configtbooltdefault(tdicttTruetFalse(((sH/usr/lib/python2.7/site-packages/ansible/module_utils/network/a10/a10.pyta10_argument_spec0s
!'cCs-d|kr)|djd�dkr)tStS(Ntresponsetstatustfail(tgetRR(tresult((sH/usr/lib/python2.7/site-packages/ansible/module_utils/network/a10/a10.pyt
axapi_failure9s%cCst||d|�\}}|s2|ddkr_|jdd|d|jdd�f�nz�y|j�}tj|�}Wn|tk
r�d|j�kr�iidd6d	6}qiid
d6i|d6d6d	6}n!tk
r�|jdd�nXWd
|j	�X|S(sE
    Returns a datastructure based on the result of the API call
    tdataRi�tmsgs0failed to connect (status code %s), error was %ssno error givensstatus="ok"tOKRRterrs'could not read the result from the hostN(
Rt	fail_jsonRtreadtjsontloadst
ValueErrortlowert	Exceptiontclose(tmoduleturltposttrsptinfotraw_dataR((sH/usr/lib/python2.7/site-packages/ansible/module_utils/network/a10/a10.pyt
axapi_call?s-
%
cCs`d|||f}t||�}t|�rJ|jd|ddd�S|d}|d|S(Ns.%s&method=authenticate&username=%s&password=%sRRR!t
session_ids&session_id=(R0RR"(R*tbase_urlR	R
R+Rtsessid((sH/usr/lib/python2.7/site-packages/ansible/module_utils/network/a10/a10.pytaxapi_authenticateXs
cCs|}ii|d6|d6d6}t||dddtj|��}t|�rm|jd|dd	d�S|d
d}|S(NR	R
tcredentialstmethodtPOSTtbodyRRR!tauthresponset	signature(t
axapi_call_v3R$tdumpsRR"(R*R2R	R
R+tauth_payloadRR:((sH/usr/lib/python2.7/site-packages/ansible/module_utils/network/a10/a10.pytaxapi_authenticate_v3as$c
	CsM|r!idd6d|d6}n
idd6}t||d|d|d|�\}}|sl|dd	kr�|jd
d|d|jd
d�f�nz�y|j�}tj|�}	Wn|tk
rd
|j�kr�iidd6d6}	q:iidd6i|d
6d6d6}	n!tk
r9|jd
d�nXWd|j	�X|	S(sE
    Returns a datastructure based on the result of the API call
    sapplication/jsonscontent-typesA10 %st
AuthorizationR6RtheadersRi�Rs0failed to connect (status code %s), error was %ssno error givensstatus="ok"R RRR!s'could not read the result from the hostN(
RR"RR#R$R%R&R'R(R)(
R*R+R6R8R:R@R-R.R/R((sH/usr/lib/python2.7/site-packages/ansible/module_utils/network/a10/a10.pyR;ks$
'-
%
cCs|dkrdSdSdS(s�
    The axapi uses 0/1 integer values for flags, rather than strings
    or booleans, so convert the given flag to a 0 or 1. For now, params
    are specified as strings only so thats what we check.
    tenablediiN((tflag((sH/usr/lib/python2.7/site-packages/ansible/module_utils/network/a10/a10.pytaxapi_enabled_disabled�scCstj|j�d�S(N(tAXAPI_PORT_PROTOCOLSRR'tNone(tprotocol((sH/usr/lib/python2.7/site-packages/ansible/module_utils/network/a10/a10.pytaxapi_get_port_protocol�scCstj|j�d�S(N(tAXAPI_VPORT_PROTOCOLSRR'RE(RF((sH/usr/lib/python2.7/site-packages/ansible/module_utils/network/a10/a10.pytaxapi_get_vport_protocol�s(R$tansible.module_utils.urlsRRDRHRRRER0R4R>R;RCRGRI(((sH/usr/lib/python2.7/site-packages/ansible/module_utils/network/a10/a10.pyt<module>s&

						
		

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