%PDF- %PDF-
Direktori : /usr/lib/python2.7/site-packages/salt/states/ |
Current File : //usr/lib/python2.7/site-packages/salt/states/splunk_search.pyo |
� ���^c @@ sG d Z d d l m Z m Z m Z d � Z d d � Z d d � Z d S( u Splunk Search State Module .. versionadded:: 2015.5.0 This state is used to ensure presence of splunk searches. .. code-block:: yaml server-warning-message: splunk_search.present: - name: This is the splunk search name - search: index=main sourcetype= i ( t absolute_importt unicode_literalst print_functionc C@ s d t k r d St S( uH Only load if the splunk_search module is available in __salt__ u splunk_search.getu splunk_search( t __salt__t False( ( ( s= /usr/lib/python2.7/site-packages/salt/states/splunk_search.pyt __virtual__ s u splunkc K@ s� i | d 6i d 6d d 6d d 6} t d | d | �} | rt d r_ d j | � | d <| St d | d | | �} | s� t | d <d | d <q�| \ } } t | j � } i } x$ | D] } | j | d � | | <q� Wt | d <| | d d <| | d d <| | d d <n� t d r5d j | � | d <| St d | d | | �} | r}t | d <t | d d <| | d d <n t | d <d j | � | d <| S( u1 Ensure a search is present .. code-block:: yaml API Error Search: splunk_search.present: search: index=main sourcetype=blah template: alert_5min The following parameters are required: name This is the name of the search in splunk u nameu changesu resultu u commentu splunk_search.gett profileu testu Would update {0}u splunk_search.updateu No changesu diffu oldu newu Would create {0}u splunk_search.createu Failed to create {0}N( t NoneR t __opts__t formatt Truet dictt contentt getR ( t nameR t kwargst rett targett resultt newvaluest diffst old_contentt old_changest x( ( s= /usr/lib/python2.7/site-packages/salt/states/splunk_search.pyt present sH c C@ s� i | d 6i d 6t d 6d j | � d 6} t d | d | �} | r� t d r� i } | | d <d j | � | d <d | d <| St d | d | �} | r� d j | � | d <q� d j | � | d <t | d <n | S( u� Ensure a search is absent .. code-block:: yaml API Error Search: splunk_search.absent The following parameters are required: name This is the name of the search in splunk u nameu changesu resultu {0} is absent.u commentu splunk_search.getR u testu Would delete {0}u splunk_search.deleteu {0} was deletedu Failed to delete {0}N( R R R R R R ( R R R R R ( ( s= /usr/lib/python2.7/site-packages/salt/states/splunk_search.pyt absentZ s&