%PDF- %PDF-
Mini Shell

Mini Shell

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

�
���^c@@stdZddlmZmZmZddlZddlZddlZd�Z	dddedd�Zd�Z
dS(	u�
Kapacitor state module.

:configuration: This module accepts connection configuration details either as
    parameters or as configuration settings in /etc/salt/minion on the relevant
    minions::

        kapacitor.unsafe_ssl: 'false'
        kapacitor.protocol: 'http'
        kapacitor.host: 'localhost'
        kapacitor.port: 9092

    This data can also be passed into pillar. Options passed into opts will
    overwrite options passed into pillar.

.. versionadded:: 2016.11.0
i(tabsolute_importtprint_functiontunicode_literalsNcC@sdtkrdStS(Nukapacitor.versionu	kapacitor(t__salt__tFalse(((s9/usr/lib/python2.7/site-packages/salt/states/kapacitor.pyt__virtual__sustreamudefaultcC@s�g}g}i|d6id6td6dd6}	td|�}
|
rN|
dnd}|scg}n|r�|r�dj||�}|j|�ngd	�|D�D]"}i|d
d6|dd
6^q�}
|jd�r�td|t�}n|}tjjj	|d��.}tjj
j|j��j
dd�}WdQX|
ol||kol||
dkol|
d|
k}|r�|jd�nctdr�d|	d<|jd�n�td||d|d|d|d|�}|d|	d<|	ds3|jd�|jd �r|j|d �nd!j|�|	d<|	S||kr~d!jtj|j�|j���|	dd"<|jd#�n|
s�|
d|kr�||	dd<|jd$�n|
s�|
d|
kr�|
|	dd<|jd%�n|r�|
r|
d&r|jd'�q�tdr2d|	d<|jd(�n|td)|�}|d|	d<|	ds�|jd*�|jd �r�|j|d �nd!j|�|	d<|	S|jd+�itd,6td-6|	dd&<n�|
r�|
d&r�|jd.�n�tdrd|	d<|jd/�n|td0|�}|d|	d<|	ds�|jd1�|jd �rj|j|d �nd!j|�|	d<|	S|jd2�itd,6td-6|	dd&<d!j|�|	d<|	S(3u2
    Ensure that a task is present and up-to-date in Kapacitor.

    name
        Name of the task.

    tick_script
        Path to the TICK script for the task. Can be a salt:// source.

    task_type
        Task type. Defaults to 'stream'

    dbrps
        A list of databases and retention policies in "dbname"."rpname" format
        to fetch data from. For backward compatibility, the value of
        'database' and 'retention_policy' will be merged as part of dbrps.

        .. versionadded:: 2019.2.0

    database
        Which database to fetch data from. Defaults to None, which will use the
        default database in InfluxDB.

    retention_policy
        Which retention policy to fetch data from. Defaults to 'default'.

    enable
        Whether to enable the task or not. Defaults to True.
    unameuchangesuresultuucommentukapacitor.get_taskuscriptu{0}.{1}cs@s|]}|jd�VqdS(u.N(tsplit(t.0tdbrp((s9/usr/lib/python2.7/site-packages/salt/states/kapacitor.pys	<genexpr>Osiudbiurpusalt://u
cp.cache_fileuru	u    Nutypeudbrpsu!Task script is already up-to-dateutestuTask would have been updatedukapacitor.define_taskt	task_typetdatabasetretention_policytdbrpsusuccessuCould not define taskustderru
uTICKscript diffuTask script updateduTask type updateduTask dbrps updateduenableduTask is already enableduTask would have been enabledukapacitor.enable_taskuCould not enable taskuTask was enableduoldunewuTask is already disableduTask would have been disabledukapacitor.disable_taskuCould not disable taskuTask was disabled(tTrueRtformattappendt
startswitht__env__tsalttutilstfilestfopentstringutilst
to_unicodetreadtreplacet__opts__tNonetgettjointdifflibtunified_difft
splitlinesR(tnamettick_scriptR	R
RtenableRtcommentstchangestretttaskt
old_scriptRt
task_dbrpstscript_pathtfilet
new_scriptt
is_up_to_datetresult((s9/usr/lib/python2.7/site-packages/salt/states/kapacitor.pyttask_present s�$"	9-

	

	









cC@s�i|d6id6td6dd6}td|�}|r�tdrYd|d<d|d<njtd	|�}|d
|d<|ds�d|d<|jd�r�|dcd
|d7<n|Sd|d<d|d|<n
d|d<|S(uZ
    Ensure that a task is absent from Kapacitor.

    name
        Name of the task.
    unameuchangesuresultuucommentukapacitor.get_taskutestuTask would have been deletedukapacitor.delete_taskusuccessuCould not disable taskustderru
uTask was deletedudeleteduTask does not existN(R
RRRR(R!R&R'R.((s9/usr/lib/python2.7/site-packages/salt/states/kapacitor.pyttask_absent�s""






(t__doc__t
__future__RRRRtsalt.utils.filesRtsalt.utils.stringutilsRRR
R/R0(((s9/usr/lib/python2.7/site-packages/salt/states/kapacitor.pyt<module>s	�

Zerion Mini Shell 1.0