%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/trafficserver.pyo

�
���^c@@s|dZddlmZmZmZddlZddlZddlZddl	ZdZ
eje�Z
d�Zejjjd�Zejjjd�Zd�Zd	�Zd
�Zd�Zd�Zed
�Zd�Zd�Zd�Zed�Zd�Zd�Z d�Z!d�Z"d�Z#d�Z$d�Z%d�Z&d�Z'd�Z(d�Z)d�Z*d�Z+d�Z,dS( u�
Apache Traffic Server execution module.

.. versionadded:: 2015.8.0

``traffic_ctl`` is used to execute individual Traffic Server commands and to
script multiple commands in a shell.
i(tabsolute_importtunicode_literalstprint_functionNu
trafficservercC@s8tjjjd�s*tjjjd�r.tStdfS(Nutraffic_ctlutraffic_lineuZtrafficserver execution module not loaded: neither traffic_ctl nor traffic_line was found.(tsalttutilstpathtwhicht__virtualname__tFalse(((s>/usr/lib/python2.7/site-packages/salt/modules/trafficserver.pyt__virtual__s*utraffic_lineutraffic_ctlcG@stgt|�S(N(t_TRAFFICCTLtlist(targs((s>/usr/lib/python2.7/site-packages/salt/modules/trafficserver.pyt_traffic_ctl$scG@stgt|�S(N(t_TRAFFICLINER(R((s>/usr/lib/python2.7/site-packages/salt/modules/trafficserver.pyt
_traffic_line(scC@s.trtdd�}ntd�}t|�S(Nuserverustatusu--status(R
R
Rt_subprocess(tcmd((s>/usr/lib/python2.7/site-packages/salt/modules/trafficserver.pyt
_statuscmd,scC@s�tjddj|��yktj|dtj�}tjjj	|j
�d�j�}|j�}|ro|S|dkrt
StSWn!tk
r�}tj|�tSXdS(u5
    Function to standardize the subprocess call
    u
Running: "%s"u tstdoutiiN(tlogtdebugtjoint
subprocesstPopentPIPERRtstringutilst
to_unicodetcommunicatetstriptwaittTrueRtOSErrorterror(Rtproctrettretcodeterr((s>/usr/lib/python2.7/site-packages/salt/modules/trafficserver.pyR5s%
cC@s.trtdd�}ntd�}t|�S(u�
    Bounce all Traffic Server nodes in the cluster. Bouncing Traffic Server
    shuts down and immediately restarts Traffic Server, node-by-node.

    .. code-block:: bash

        salt '*' trafficserver.bounce_cluster
    uclusterurestartu-B(R
R
RR(R((s>/usr/lib/python2.7/site-packages/salt/modules/trafficserver.pytbounce_clusterKs
cC@sDtrtdd�}ntd�}|r:|dg}nt|�S(u$
    Bounce Traffic Server on the local node. Bouncing Traffic Server shuts down
    and immediately restarts the Traffic Server node.

    drain
        This option modifies the restart behavior such that traffic_server
        is not shut down until the number of active client connections
        drops to the number given by the
        proxy.config.restart.active_client_threshold configuration
        variable.

    .. code-block:: bash

        salt '*' trafficserver.bounce_local
        salt '*' trafficserver.bounce_local drain=True
    userverurestartu-bu--drain(R
R
RR(tdrainR((s>/usr/lib/python2.7/site-packages/salt/modules/trafficserver.pytbounce_local]scC@s1trtddd�}ntd�}t|�S(u�
    Clears accumulated statistics on all nodes in the cluster.

    .. code-block:: bash

        salt '*' trafficserver.clear_cluster
    umetricuclearu	--clusteru-C(R
R
RR(R((s>/usr/lib/python2.7/site-packages/salt/modules/trafficserver.pyt
clear_clusterys	cC@s.trtdd�}ntd�}t|�S(u
    Clears accumulated statistics on the local node.

    .. code-block:: bash

        salt '*' trafficserver.clear_node
    umetricuclearu-c(R
R
RR(R((s>/usr/lib/python2.7/site-packages/salt/modules/trafficserver.pyt
clear_node�s	cC@s1trtddd�}ntd�}t|�S(u�
    Restart the traffic_manager process and the traffic_server process on all
    the nodes in a cluster.

    .. code-block:: bash

        salt '*' trafficserver.restart_cluster
    uclusterurestartu	--manageru-M(R
R
RR(R((s>/usr/lib/python2.7/site-packages/salt/modules/trafficserver.pytrestart_cluster�s
cC@sGtrtddd�}ntd�}|r=|dg}nt|�S(u�
    Restart the traffic_manager and traffic_server processes on the local node.

    drain
        This option modifies the restart behavior such that
        ``traffic_server`` is not shut down until the number of
        active client connections drops to the number given by the
        ``proxy.config.restart.active_client_threshold`` configuration
        variable.

    .. code-block:: bash

        salt '*' trafficserver.restart_local
        salt '*' trafficserver.restart_local drain=True
    userverurestartu	--manageru-Lu--drain(R
R
RR(R'R((s>/usr/lib/python2.7/site-packages/salt/modules/trafficserver.pyt
restart_local�scC@s4trtdd|�}ntd|�}t|�S(u�
    Display the current values of all metrics whose names match the
    given regular expression.

    .. versionadded:: 2016.11.0

    .. code-block:: bash

        salt '*' trafficserver.match_metric regex
    umetricumatchu-m(R
R
R(tregexR((s>/usr/lib/python2.7/site-packages/salt/modules/trafficserver.pytmatch_metric�scC@s4trtdd|�}ntd|�}t|�S(u�
    Display the current values of all configuration variables whose
    names match the given regular expression.

    .. versionadded:: 2016.11.0

    .. code-block:: bash

        salt '*' trafficserver.match_config regex
    uconfigumatchu-m(R
R
RR(R-R((s>/usr/lib/python2.7/site-packages/salt/modules/trafficserver.pytmatch_config�scG@s~i}trtdd�}ntd�}y<x5|D]-}tjd|�t||g�||<q4WWntk
rynX|S(u�
    Read Traffic Server configuration variable definitions.

    .. versionadded:: 2016.11.0

    .. code-block:: bash

        salt '*' trafficserver.read_config proxy.config.http.keep_alive_post_out
    uconfigugetu-ruQuerying: %s(R
R
RRRRtKeyError(RR#Rtarg((s>/usr/lib/python2.7/site-packages/salt/modules/trafficserver.pytread_config�s

cG@s~i}trtdd�}ntd�}y<x5|D]-}tjd|�t||g�||<q4WWntk
rynX|S(u�
    Read Traffic Server one or more metrics.

    .. versionadded:: 2016.11.0

    .. code-block:: bash

        salt '*' trafficserver.read_metric proxy.process.http.tcp_hit_count_stat
    umetricugetu-ruQuerying: %s(R
R
RRRRR0(RR#RR1((s>/usr/lib/python2.7/site-packages/salt/modules/trafficserver.pytread_metric	s

cC@sPtrtdd||�}ntd|d|�}tjd||�t|�S(uA
    Set the value of a Traffic Server configuration variable.

    variable
        Name of a Traffic Server configuration variable.

    value
        The new value to set.

    .. versionadded:: 2016.11.0

    .. code-block:: bash

        salt '*' trafficserver.set_config proxy.config.http.keep_alive_post_out 0
    uconfigusetu-su-vuSetting %s to %s(R
R
RRRR(tvariabletvalueR((s>/usr/lib/python2.7/site-packages/salt/modules/trafficserver.pyt
set_config$s
cC@s5trtd�}ntdd�}t|�t�S(ux
    Shut down Traffic Server on the local node.

    .. code-block:: bash

        salt '*' trafficserver.shutdown
    u-Suserverustop(RRR
RR(R((s>/usr/lib/python2.7/site-packages/salt/modules/trafficserver.pytshutdown>s

cC@s5trtd�}ntdd�}t|�t�S(uq
    Start Traffic Server on the local node.

    .. code-block:: bash

        salt '*' trafficserver.start
    u-Uuserverustart(RRR
RR(R((s>/usr/lib/python2.7/site-packages/salt/modules/trafficserver.pytstartupRs

cC@s.trtdd�}ntd�}t|�S(uu
    Initiate a Traffic Server configuration file reread. Use this command to
    update the running configuration after any configuration file modification.

    The timestamp of the last reconfiguration event (in seconds since epoch) is
    published in the proxy.node.config.reconfigure_time metric.

    .. code-block:: bash

        salt '*' trafficserver.refresh
    uconfigureloadu-x(R
R
RR(R((s>/usr/lib/python2.7/site-packages/salt/modules/trafficserver.pytrefreshfs
cC@s1trtddd�}ntd�}t|�S(u�
    Reset performance statistics to zero across the cluster.

    .. code-block:: bash

        salt '*' trafficserver.zero_cluster
    umetricuclearu	--clusteru-Z(R
R
RR(R((s>/usr/lib/python2.7/site-packages/salt/modules/trafficserver.pytzero_cluster{scC@s.trtdd�}ntd�}t|�S(u�
    Reset performance statistics to zero on the local node.

    .. code-block:: bash

        salt '*' trafficserver.zero_cluster
    umetricuclearu-z(R
R
RR(R((s>/usr/lib/python2.7/site-packages/salt/modules/trafficserver.pyt	zero_node�scC@s4trtdd|�}ntd|�}t|�S(u�
    Mark a cache storage device as offline. The storage is identified by a path
    which must match exactly a path specified in storage.config. This removes
    the storage from the cache and redirects requests that would have used this
    storage to other storage. This has exactly the same effect as a disk
    failure for that storage. This does not persist across restarts of the
    traffic_server process.

    .. code-block:: bash

        salt '*' trafficserver.offline /path/to/cache
    ustorageuofflineu	--offline(R
R
RR(RR((s>/usr/lib/python2.7/site-packages/salt/modules/trafficserver.pytoffline�scC@s.trtdd�}ntd�}t|�S(u�
    List all alarm events that have not been acknowledged (cleared).

    .. code-block:: bash

        salt '*' trafficserver.alarms
    ualarmulistu--alarms(R
R
RR(R((s>/usr/lib/python2.7/site-packages/salt/modules/trafficserver.pytalarms�s	cC@s4trtdd|�}ntd|�}t|�S(uD
    Clear (acknowledge) an alarm event. The arguments are “all” for all current
    alarms, a specific alarm number (e.g. ‘‘1’‘), or an alarm string identifier
    (e.g. ‘’MGMT_ALARM_PROXY_CONFIG_ERROR’‘).

    .. code-block:: bash

        salt '*' trafficserver.clear_alarms [all | #event | name]
    ualarmuclearu--clear_alarms(R
R
RR(talarmR((s>/usr/lib/python2.7/site-packages/salt/modules/trafficserver.pytclear_alarms�scC@st�S(u�
    Show the current proxy server status, indicating if we’re running or not.

    .. code-block:: bash

        salt '*' trafficserver.status
    (R(((s>/usr/lib/python2.7/site-packages/salt/modules/trafficserver.pytstatus�s	(-t__doc__t
__future__RRRtloggingRtsalt.utils.pathRtsalt.utils.stringutilsRt	getLoggert__name__RR	RRRRR
R
RRRR&RR(R)R*R+R,R.R/R2R3R6R7R8R9R:R;R<R=R?R@(((s>/usr/lib/python2.7/site-packages/salt/modules/trafficserver.pyt<module>	sD																							

Zerion Mini Shell 1.0