??????????????
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 173

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 174

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 175

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 176

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 177

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 178
ó àUdac@`s•ddlmZmZmZeZdZddlZddlZddl Z ddl m Z ddl mZddlmZddlmZmZmZddlmZmZdd lmZdd lmZdd lmZdd lmZdd l m!Z!ddl"m#Z#idd6dd6de d6Z$dZ%dZ&dZ'dZ(dZ)ddgZ*dZ+dZ,defd„ƒYZ-e.e.d„Z/d „Z0dS(!i(tabsolute_importtdivisiontprint_functionse --- author: Ansible Networking Team httpapi : ftd short_description: HttpApi Plugin for Cisco ASA Firepower device description: - This HttpApi plugin provides methods to connect to Cisco ASA firepower devices over a HTTP(S)-based api. version_added: "2.7" options: token_path: type: str description: - Specifies the api token path of the FTD device vars: - name: ansible_httpapi_ftd_token_path spec_path: type: str description: - Specifies the api spec path of the FTD device default: '/apispec/ngfw.json' vars: - name: ansible_httpapi_ftd_spec_path N(t __version__(tto_text(tAnsibleConnectionFailure(tFdmSwaggerParsertSpecProptFdmSwaggerValidator(t HTTPMethodtResponseParams(t HTTPError(t urlencode(t HttpApiBase(tencode_multipart_formdata(t RequestField(tConnectionErrorsapplication/jsons Content-TypetAcceptsFTD Ansible/%ss User-Agenti˜i‘t token_paths/api/fdm/{0}/fdm/tokens /api/versionstv2tv1s‚The API token path is incorrect. Please, check correctness of the `ansible_httpapi_ftd_token_path` variable in the inventory file.s’Ansible could not determine the API token path automatically. Please, specify the `ansible_httpapi_ftd_token_path` variable in the inventory file.tHttpApicB`s.eZd„Zd„Zd„Zd„Zd„Zd„Zdd„Z d„Z dddd„Z d „Z dd „Z d „Zd d „Zed„ƒZd„Zd„Zd„Zd„Zd„Zed„ƒZd„Zd„Zd„Zd„Zd„Zd„Zed„ƒZed„ƒZ RS(cC`sPtt|ƒj|ƒ||_d|_d|_d|_d|_t |_ dS(N( tsuperRt__init__t connectiontNonet access_tokent refresh_tokent _api_spect_api_validatortFalset_ignore_http_errors(tselfR((s?/usr/lib/python2.7/site-packages/ansible/plugins/httpapi/ftd.pyRUs     cC`sÆd„}d„}|jr-||jƒ}n*|rK|rK|||ƒ}n tdƒ‚|j|ƒ}y8|d|_|d|_id|jd6|j_Wn!tk rÁtd|ƒ‚nXdS( NcS`sidd6|d6|d6S(Ntpasswordt grant_typetusername((R#R!((s?/usr/lib/python2.7/site-packages/ansible/plugins/httpapi/ftd.pytrequest_token_payload_scS`sidd6|d6S(NRR"((R((s?/usr/lib/python2.7/site-packages/ansible/plugins/httpapi/ftd.pytrefresh_token_payloadfssHUsername and password are required for login in absence of refresh tokenRRs Bearer %st AuthorizationsPServer returned response without token info during connection authentication: %s(RRt_lookup_login_urlRRt_authtKeyErrorR(R R#R!R$R%tpayloadtresponse((s?/usr/lib/python2.7/site-packages/ansible/plugins/httpapi/ftd.pytlogin^s        cC`sÞ|jƒ}|r|g}n |jƒ}x•|D]}y|j||ƒ}WnTtk r£}|jjdd||fƒt|dƒr¾|jdkr¾‚q¾q1X|sº|j|ƒn|Sq1Wt|rÑt nt ƒ‚dS(s¿ Try to find correct login URL and get api token using this URL. :param payload: Token request payload :type payload: dict :return: token generation response tvvvvs:REST:request to %s failed because of connection error: %s t http_codeiN( t_get_api_token_patht_get_known_token_pathst_send_login_requestRRt queue_messagethasattrR.t_set_api_token_pathtINVALID_API_TOKEN_PATH_MSGtMISSING_API_TOKEN_PATH_MSG(R R*tpreconfigured_token_patht token_pathsturlR+te((s?/usr/lib/python2.7/site-packages/ansible/plugins/httpapi/ftd.pyR'}s      cC`s~|jtjd|ƒ|j|tj|ƒdtjdtƒ\}}|jtjd|jƒƒ|j|j |ƒƒ}|S(NR,tmethodtheadersslogin:status_code( t_displayR tPOSTt_send_auth_requesttjsontdumpst BASE_HEADERStgetcodet_response_to_jsont_get_response_value(R R*R9R+t response_data((s?/usr/lib/python2.7/site-packages/ansible/plugins/httpapi/ftd.pyR1s *cC`s¥idd6|jd6|jd6}|jƒ}|jtjd|ƒ|j|tj|ƒdtjdt ƒ\}}|jtjd|j ƒƒd|_d|_dS( Nt revoke_tokenR"Rttoken_to_revoketlogoutR;R<slogout:status_code( RRR/R=R R>R?R@RARBRCR(R t auth_payloadR9R+tdummy((s?/usr/lib/python2.7/site-packages/ansible/plugins/httpapi/ftd.pyRI§s   ! cK`sd}|j||d||S(Ns6Server returned an error during authentication requesttdata(t_send_service_request(R tpathRLtkwargsterror_msg_prefix((s?/usr/lib/python2.7/site-packages/ansible/plugins/httpapi/ftd.pyR?¸scK`sˆzwy#t|_|jj|||SWnMtk ru}|jt|jƒƒƒ}td||fd|j ƒ‚nXWdt |_XdS(Ns%s: %sR.( tTrueRRtsendR RDRtreadRtcodeR(R RNRPRLROR:t error_msg((s?/usr/lib/python2.7/site-packages/ansible/plugins/httpapi/ftd.pyRM¼s 'cC`sdS(N(R(R R+RF((s?/usr/lib/python2.7/site-packages/ansible/plugins/httpapi/ftd.pyt update_authÈsc C`sDt|||ƒ}|r'tj|ƒnd}y­|j|d|ƒ|r_|j|d|ƒn|jj||d|dtƒ\}} |j| ƒ} |j|d| ƒit t j 6|j ƒt j 6|j| ƒt j6SWnctk r?} t| jƒƒ} |j|d| ƒitt j 6| jt j 6|j| ƒt j6SXdS(NR9RLR;R<R+terror(tconstruct_url_pathR@RARR=RRRRBRERQR tSUCCESSRCt STATUS_CODERDtRESPONSER RRSRRT( R turl_patht http_methodt body_paramst path_paramst query_paramsR9RLR+RFtvalueR:RU((s?/usr/lib/python2.7/site-packages/ansible/plugins/httpapi/ftd.pyt send_requestÌs('   c C`s t|ƒ}|jtjd|ƒt|dƒÒ}td|jƒtjj |j ƒƒ}|j ƒt |gƒ\}}t tƒ}||dtopenRRStosRNtbasenametnametmake_multipartRtdictRBtlenRRRRERD( R t from_pathtto_urlR9tsrc_filetrftbodyt content_typeR<RKRFRa((s?/usr/lib/python2.7/site-packages/ansible/plugins/httpapi/ftd.pyt upload_fileés '   -c C`sÖt|d|ƒ}|jtjd|ƒ|jj|dddtjdtƒ\}}tj j |ƒr‘t |j ƒƒ}tj j ||ƒ}nt|dƒ}|j|jƒƒWdQX|jtjd|ƒdS(NR_tdownloadRLR;R<twbt downloaded(RXR=R tGETRRRRRBRgRNtisdirtextract_filename_from_headerstinfotjoinRftwritetgetvalue( R tfrom_urltto_pathR_R9R+RFtfilenamet output_file((s?/usr/lib/python2.7/site-packages/ansible/plugins/httpapi/ftd.pyt download_fileús-cC`sj|jtkp|jtk}|j rf|rfd|j_|j|jjdƒ|jjdƒƒt St S(Nt remote_userR!( RTtTOKEN_EXPIRATION_STATUS_CODEtUNAUTHORIZED_STATUS_CODERRRR(R,t get_optionRQR(R texctis_auth_related_code((s?/usr/lib/python2.7/site-packages/ansible/plugins/httpapi/ftd.pythandle_httperrors  (tcC`s-|jjdd||jj||fƒdS(NR-sREST:%s:%s:%s %s(RR2t_url(R R]ttitletmsg((s?/usr/lib/python2.7/site-packages/ansible/plugins/httpapi/ftd.pyR=scC`st|jƒƒS(N(RR}(RF((s?/usr/lib/python2.7/site-packages/ansible/plugins/httpapi/ftd.pyREscC`s |jdƒS(Nt spec_path(R†(R ((s?/usr/lib/python2.7/site-packages/ansible/plugins/httpapi/ftd.pyt_get_api_spec_pathscC`sJy|jƒ}Wntk r)t}nXg|D]}tj|ƒ^q1S(såGenerate list of token generation urls based on list of versions supported by device(if exposed via API) or default list of API versions. :returns: list of token generation urls :rtype: generator (t_get_supported_api_versionsRtDEFAULT_API_VERSIONStTOKEN_PATH_TEMPLATEtformat(R t api_versionstversion((s?/usr/lib/python2.7/site-packages/ansible/plugins/httpapi/ftd.pyR0s   c C`sltj}|jdtddd|dtƒ\}}|j|ƒ}|j|d|ƒ|j|ƒ}|dS(s‘ Fetch list of API versions supported by device. :return: list of API versions suitable for device :rtype: list RNRPs*Can't fetch list of supported api versionsR;R<R+tsupportedVersions(R RwRMtGET_API_VERSIONS_PATHRBRER=RD(R R]R+RFRatapi_versions_info((s?/usr/lib/python2.7/site-packages/ansible/plugins/httpapi/ftd.pyR)s  cC`s |jtƒS(N(R†tAPI_TOKEN_PATH_OPTION_NAME(R ((s?/usr/lib/python2.7/site-packages/ansible/plugins/httpapi/ftd.pyR/>scC`s|jt|ƒS(N(t set_optionR™(R R9((s?/usr/lib/python2.7/site-packages/ansible/plugins/httpapi/ftd.pyR4AscC`sRy|rtj|ƒSiSWn0ttjdtƒk rMtd|ƒ‚nXdS(NtJSONDecodeErrorsInvalid JSON response: %s(R@tloadstgetattrtdecodert ValueErrorR(t response_text((s?/usr/lib/python2.7/site-packages/ansible/plugins/httpapi/ftd.pyRDDscC`s|jtjj|dƒS(N(tapi_specRt OPERATIONStgetR(R toperation_name((s?/usr/lib/python2.7/site-packages/ansible/plugins/httpapi/ftd.pytget_operation_specLscC`s(|r |jtjj|dƒSdSdS(N(R¡RtMODEL_OPERATIONSR£R(R t model_name((s?/usr/lib/python2.7/site-packages/ansible/plugins/httpapi/ftd.pyt!get_operation_specs_by_model_nameOscC`s|jtjj|dƒS(N(R¡RtMODELSR£R(R R§((s?/usr/lib/python2.7/site-packages/ansible/plugins/httpapi/ftd.pytget_model_specUscC`s|jj||ƒS(N(t api_validatort validate_data(R R¤RL((s?/usr/lib/python2.7/site-packages/ansible/plugins/httpapi/ftd.pyR¬XscC`s|jj||ƒS(N(R«tvalidate_query_params(R R¤tparams((s?/usr/lib/python2.7/site-packages/ansible/plugins/httpapi/ftd.pyR­[scC`s|jj||ƒS(N(R«tvalidate_path_params(R R¤R®((s?/usr/lib/python2.7/site-packages/ansible/plugins/httpapi/ftd.pyR¯^scC`s|jdkr‰|jƒ}|jd|dtjƒ}|tjrbtƒj |tj ƒ|_q‰t d|tj |tj fƒ‚n|jS(NR\R]sCFailed to download API specification. Status code: %s. Response: %s( RRRRbR RwR RYRt parse_specR[RRZ(R t spec_path_urlR+((s?/usr/lib/python2.7/site-packages/ansible/plugins/httpapi/ftd.pyR¡as  !cC`s+|jdkr$t|jƒ|_n|jS(N(RRRR¡(R ((s?/usr/lib/python2.7/site-packages/ansible/plugins/httpapi/ftd.pyR«msN(!t__name__t __module__RR,R'R1RIR?RRMRVRbRsR‚R‰R=t staticmethodRERR0RR/R4RDR¥R¨RªR¬R­R¯tpropertyR¡R«(((s?/usr/lib/python2.7/site-packages/ansible/plugins/httpapi/ftd.pyRTs8                  cC`s?|}|r|j|}n|r;|dt|ƒ7}n|S(Nt?(R“R (RNR_R`R9((s?/usr/lib/python2.7/site-packages/ansible/plugins/httpapi/ftd.pyRXts cC`sDd}tj||jdƒƒ}|r4|jdƒStdƒ‚dS(Nsattachment; ?filename="?([^"]+)sContent-Dispositionis7No appropriate Content-Disposition header is specified.(tretmatchR£tgroupRŸ(t response_infotcontent_header_regexR¸((s?/usr/lib/python2.7/site-packages/ansible/plugins/httpapi/ftd.pyRy}s  (1t __future__RRRttypet __metaclass__t DOCUMENTATIONR@RgR·tansibleRtansible_versiontansible.module_utils.basicRtansible.errorsRt3ansible.module_utils.network.ftd.fdm_swagger_clientRRRt'ansible.module_utils.network.ftd.commonR R t+ansible.module_utils.six.moves.urllib.errorR t+ansible.module_utils.six.moves.urllib.parseR tansible.plugins.httpapiR turllib3Rturllib3.fieldsRtansible.module_utils.connectionRRBR„R…R™R’R—R‘R5R6RRRXRy(((s?/usr/lib/python2.7/site-packages/ansible/plugins/httpapi/ftd.pyts@    ÿ!