%PDF- %PDF-
Direktori : /lib/python2.7/site-packages/salt/modules/ |
Current File : //lib/python2.7/site-packages/salt/modules/kapacitor.pyc |
� ���^c @@ s� d Z d d l m Z m Z m Z d d l m Z d d l Z d d l Z d d l Z d d l m Z d d l Z e j e � Z d � Z e d � � Z d � Z d � Z d � Z d d d d d � Z d � Z d � Z d � Z d S( uJ Kapacitor execution module. :configuration: This module accepts connection configuration details either as parameters or as configuration settings in /etc/salt/minion on the relevant minions:: kapacitor.host: 'localhost' kapacitor.port: 9092 .. versionadded:: 2016.11.0 Also protocol and SSL settings could be configured:: kapacitor.unsafe_ssl: 'false' kapacitor.protocol: 'http' .. versionadded:: 2019.2.0 This data can also be passed into pillar. Options passed into opts will overwrite options passed into pillar. i ( t absolute_importt print_functiont unicode_literals( t sixN( t memoizec C@ s t j j j d � r d St S( Nu kapacitor( t saltt utilst patht whicht False( ( ( s: /usr/lib/python2.7/site-packages/salt/modules/kapacitor.pyt __virtual__( s c C@ s9 t d d � } | s5 t j t d d d � � } n | S( u$ Get the kapacitor version. u pkg.versionu kapacitoru config.optionu kapacitor.versionu latest( t __salt__R t string_types( t version( ( s: /usr/lib/python2.7/site-packages/salt/modules/kapacitor.pyR , s c C@ sL t d d d � } t d d d � } t d d d � } d j | | | � S( u Get the kapacitor URL. u config.optionu kapacitor.protocolu httpu kapacitor.hostu localhostu kapacitor.porti�# u {0}://{1}:{2}( R t format( t protocolt hostt port( ( s: /usr/lib/python2.7/site-packages/salt/modules/kapacitor.pyt _get_url7 s c C@ s� t � } t � d k r- d j | | � } n d j | | � } t j j j | d t �} | d d k rn d St j j j | d � } t � d k r� i | d d 6| d d 6| d d 6| d d 6Si | d d 6| d d 6| d d 6| d d k d 6S( u� Get a dict of data on a task. name Name of the task to get information about. CLI Example: .. code-block:: bash salt '*' kapacitor.get_task cpu u 0.13u {0}/task?name={1}u+ {0}/kapacitor/v1/tasks/{1}?skip-format=truet statusu statusi� u bodyu TICKscriptu scriptu Typeu typeu DBRPsu dbrpsu Enabledu enabledN( R R R R R t httpt queryt Truet Nonet jsont loads( t namet urlt task_urlt responset data( ( s: /usr/lib/python2.7/site-packages/salt/modules/kapacitor.pyt get_taskB s&