%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python2.7/site-packages/salt/utils/
Upload File :
Create Path :
Current File : //lib/python2.7/site-packages/salt/utils/nxos_api.pyc

�
���^c@@s�dZddlmZmZmZddlZddlZddlZddl	m
Z
ddlmZyddl
mZWn!ek
r�ddlmZnXeje�Zddd	d
ddd
dgZd�Zdd�ZdS(u*
Util functions for the NXOS API modules.
i(tabsolute_importtprint_functiontunicode_literalsN(tsix(t
SaltException(tclean_kwargsu	transportuhostuusernameupassworduportutimeoutuverifyurpc_versioncK@st|�}i}x6tj|�D]%\}}|tkr"|||<q"q"Wd|krdd|d<nd|kr}d|d<nd|kr�|ddkr�dnd|d<n|jd	t�}t|t�r�||d
<n
||d<d|kr�d
|d<nd|krd|d<n|S(u�
    Prepare the connection with the remote network device, and clean up the key
    value pairs, removing the args used for the connection init.
    uhostu	localhostu	transportuhttpsuportuhttpiPi�uverifyu
verify_sslu	ca_bundleurpc_versionu2.0utimeouti<(RRt	iteritemstRPC_INIT_KWARGStgettTruet
isinstancetbool(tnxos_api_kwargstinit_kwargstkargtwargtverify((s7/usr/lib/python2.7/site-packages/salt/utils/nxos_api.pyt_prepare_connection"s(

#



uclicK@s�t|�}tjd�tj|�djd|dd|dd|d�}id	d
6}g}t|ttf�s�|g}nxYt|�D]K\}}|ji|dd6|d
6i|d6dd6d6|dd6�q�Wi|dd6}	t	j
jj|ddd|	dt
j|�d|dtdd|�}
d|
krUt|
d��n|
d}t|t�rz|g}nx(t|�D]\}}|||d<q�W|S( u
    Execute an arbitrary RPC request via the Nexus API.

    commands
        The commands to be executed.

    method: ``cli``
        The type of the response, i.e., raw text (``cli_ascii``) or structured
        document (``cli``). Defaults to ``cli`` (structured data).

    transport: ``https``
        Specifies the type of connection transport to use. Valid values for the
        connection are ``http``, and  ``https``.

    host: ``localhost``
        The IP address or DNS host name of the connection device.

    username: ``admin``
        The username to pass to the device to authenticate the NX-API connection.

    password
        The password to pass to the device to authenticate the NX-API connection.

    port
        The TCP port of the endpoint for the NX-API connection. If this keyword is
        not specified, the default value is automatically determined by the
        transport type (``80`` for ``http``, or ``443`` for ``https``).

    timeout: ``60``
        Time in seconds to wait for the device to respond. Default: 60 seconds.

    verify: ``True``
        Either a boolean, in which case it controls whether we verify the NX-API
        TLS certificate, or a string, in which case it must be a path to a CA bundle
        to use. Defaults to ``True``.
    uThese are the init args:u{transport}://{host}:{port}/inst	transportu	transportthostuhosttportuportuapplication/json-rpcucontent-typeurpc_versionujsonrpcumethoducmdiuversionuparamsuidutimeoutuhttp_request_timeouttmethoduPOSTtoptstdatatheader_dicttdecodetdecode_typeujsonuerrorudictucommand(RtlogterrortformatR
tlistttuplet	enumeratetappendtsalttutilsthttptquerytjsontdumpsR	Rtdict(tcommandsRtkwargst	init_argsturltheaderstpayloadtindextcommandRtresponset
response_list((s7/usr/lib/python2.7/site-packages/salt/utils/nxos_api.pytrpc?sL'

	



		
(t__doc__t
__future__RRRR&tloggingtsalt.utils.httpR"tsalt.extRtsalt.exceptionsRtsalt.utils.argsRtImportErrort
salt.utilst	getLoggert__name__RRRR3(((s7/usr/lib/python2.7/site-packages/salt/utils/nxos_api.pyt<module>s*
		

Zerion Mini Shell 1.0