%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python2.7/site-packages/salt/modules/
Upload File :
Create Path :
Current File : //usr/lib/python2.7/site-packages/salt/modules/napalm_ntp.pyc

�
���^c@@s�dZddlmZmZmZddlZeje�Zddl	Z
ddl	mZdZdgZ
dZd�Zed	��Zed
��Zedd��Zed��Zed
��Zed��Zed��ZdS(u�
NAPALM NTP
==========

Manages NTP on network devices.

:codeauthor: Mircea Ulinic <mircea@cloudflare.com> & Jerome Fleury <jf@cloudflare.com>
:maturity:   new
:depends:    napalm
:platform:   unix

Dependencies
------------
- :mod:`NAPALM proxy minion <salt.proxy.napalm>`
- :mod:`NET basic features <salt.modules.napalm_network>`

.. seealso::
    :mod:`NTP peers management state <salt.states.netntp>`

.. versionadded:: 2016.11.0
i(tabsolute_importtunicode_literalstprint_functionN(tproxy_napalm_wrapuntpunapalmu
napalm_ntpcC@stjjjttt�S(u_
    NAPALM library must be installed for this module to work and run in a (proxy) minion.
    (tsalttutilstnapalmtvirtualt__opts__t__virtualname__t__file__(((s;/usr/lib/python2.7/site-packages/salt/modules/napalm_ntp.pyt__virtual__/scK@sZtjjjtdi�}|jd�s.|St|jdi�j��}||d<|S(u~
    Returns a list the NTP peers configured on the network device.

    :return: configured NTP peers as list.

    CLI Example:

    .. code-block:: bash

        salt '*' ntp.peers

    Example output:

    .. code-block:: python

        [
            '192.168.0.1',
            '172.17.17.1',
            '172.17.17.2',
            '2400:cb00:6:1024::c71b:840a'
        ]

    u
get_ntp_peersuresultuout(RRRtcallt
napalm_devicetgettlisttkeys(tkwargst	ntp_peerstntp_peers_list((s;/usr/lib/python2.7/site-packages/salt/modules/napalm_ntp.pytpeers>s	
cK@sZtjjjtdi�}|jd�s.|St|jdi�j��}||d<|S(uP
    Returns a list of the configured NTP servers on the device.

    CLI Example:

    .. code-block:: bash

        salt '*' ntp.servers

    Example output:

    .. code-block:: python

        [
            '192.168.0.1',
            '172.17.17.1',
            '172.17.17.2',
            '2400:cb00:6:1024::c71b:840a'
        ]
    uget_ntp_serversuresultuout(RRRRR
RRR(Rtntp_serverstntp_servers_list((s;/usr/lib/python2.7/site-packages/salt/modules/napalm_ntp.pytserversjs	
cK@s�tjjjtdi�}|jd�s.|S|jd�}|rwg|D]$}|jdd�|krJ|^qJ}n|ji|d6�|S(u
    Returns a dictionary containing synchronization details of the NTP peers.

    :param peer: Returns only the details of a specific NTP peer.
    :return: a list of dictionaries, with the following keys:

        * remote
        * referenceid
        * synchronized
        * stratum
        * type
        * when
        * hostpoll
        * reachability
        * delay
        * offset
        * jitter

    CLI Example:

    .. code-block:: bash

        salt '*' ntp.stats

    Example output:

    .. code-block:: python

        [
            {
                'remote'        : '188.114.101.4',
                'referenceid'   : '188.114.100.1',
                'synchronized'  : True,
                'stratum'       : 4,
                'type'          : '-',
                'when'          : '107',
                'hostpoll'      : 256,
                'reachability'  : 377,
                'delay'         : 164.228,
                'offset'        : -13.866,
                'jitter'        : 2.695
            }
        ]
    u
get_ntp_statsuresultuouturemoteu(RRRRR
Rtupdate(tpeerRtproxy_outputRtntp_peer((s;/usr/lib/python2.7/site-packages/salt/modules/napalm_ntp.pytstats�s0	4	c
O@sJ|jdt�}|jdt�}tddd|d|d|dt�S(	uy
    Configures a list of NTP peers on the device.

    :param peers: list of IP Addresses/Domain Names
    :param test (bool): discard loaded config. By default ``test`` is False
        (will not dicard the changes)
    :commit commit (bool): commit loaded config. By default ``commit`` is True
        (will commit the changes). Useful when the user does not want to commit
        after each change, but after a couple.

    By default this function will commit the config changes (if any). To load without committing, use the `commit`
    option. For dry run use the `test` argument.

    CLI Example:

    .. code-block:: bash

        salt '*' ntp.set_peers 192.168.0.1 172.17.17.1 time.apple.com
        salt '*' ntp.set_peers 172.17.17.1 test=True  # only displays the diff
        salt '*' ntp.set_peers 192.168.0.1 commit=False  # preserves the changes, but does not commit
    utestucommitunet.load_templateu
set_ntp_peersRttesttcommittinherit_napalm_device(tpoptFalsetTruet__salt__R
(RtoptionsRR((s;/usr/lib/python2.7/site-packages/salt/modules/napalm_ntp.pyt	set_peers�s
c
O@sJ|jdt�}|jdt�}tddd|d|d|dt�S(	u�
    Configures a list of NTP servers on the device.

    :param servers: list of IP Addresses/Domain Names
    :param test (bool): discard loaded config. By default ``test`` is False
        (will not dicard the changes)
    :commit commit (bool): commit loaded config. By default ``commit`` is True
        (will commit the changes). Useful when the user does not want to commit
        after each change, but after a couple.

    By default this function will commit the config changes (if any). To load without committing, use the `commit`
    option. For dry run use the `test` argument.

    CLI Example:

    .. code-block:: bash

        salt '*' ntp.set_servers 192.168.0.1 172.17.17.1 time.apple.com
        salt '*' ntp.set_servers 172.17.17.1 test=True  # only displays the diff
        salt '*' ntp.set_servers 192.168.0.1 commit=False  # preserves the changes, but does not commit
    utestucommitunet.load_templateuset_ntp_serversRRRR(R R!R"R#R
(RR$RR((s;/usr/lib/python2.7/site-packages/salt/modules/napalm_ntp.pytset_servers�s
c
O@sJ|jdt�}|jdt�}tddd|d|d|dt�S(	u�
    Removes NTP peers configured on the device.

    :param peers: list of IP Addresses/Domain Names to be removed as NTP peers
    :param test (bool): discard loaded config. By default ``test`` is False
        (will not dicard the changes)
    :param commit (bool): commit loaded config. By default ``commit`` is True
        (will commit the changes). Useful when the user does not want to commit
        after each change, but after a couple.

    By default this function will commit the config changes (if any). To load
    without committing, use the ``commit`` option. For a dry run, use the
    ``test`` argument.

    CLI Example:

    .. code-block:: bash

        salt '*' ntp.delete_peers 8.8.8.8 time.apple.com
        salt '*' ntp.delete_peers 172.17.17.1 test=True  # only displays the diff
        salt '*' ntp.delete_peers 192.168.0.1 commit=False  # preserves the changes, but does not commit
    utestucommitunet.load_templateudelete_ntp_peersRRRR(R R!R"R#R
(RR$RR((s;/usr/lib/python2.7/site-packages/salt/modules/napalm_ntp.pytdelete_peerss
c
O@sJ|jdt�}|jdt�}tddd|d|d|dt�S(	u�
    Removes NTP servers configured on the device.

    :param servers: list of IP Addresses/Domain Names to be removed as NTP
        servers
    :param test (bool): discard loaded config. By default ``test`` is False
        (will not dicard the changes)
    :param commit (bool): commit loaded config. By default ``commit`` is True
        (will commit the changes). Useful when the user does not want to commit
        after each change, but after a couple.

    By default this function will commit the config changes (if any). To load
    without committing, use the ``commit`` option. For dry run use the ``test``
    argument.

    CLI Example:

    .. code-block:: bash

        salt '*' ntp.delete_servers 8.8.8.8 time.apple.com
        salt '*' ntp.delete_servers 172.17.17.1 test=True  # only displays the diff
        salt '*' ntp.delete_servers 192.168.0.1 commit=False  # preserves the changes, but does not commit
    utestucommitunet.load_templateudelete_ntp_serversRRRR(R R!R"R#R
(RR$RR((s;/usr/lib/python2.7/site-packages/salt/modules/napalm_ntp.pytdelete_serversBs
(u
napalm_ntp(t__doc__t
__future__RRRtloggingt	getLoggerR
tlogtsalt.utils.napalmRRR	t__proxyenabled__t__virtual_aliases__RRRtNoneRR%R&R'R((((s;/usr/lib/python2.7/site-packages/salt/modules/napalm_ntp.pyt<module>s"		,)E#"$

Zerion Mini Shell 1.0