%PDF- %PDF-
Direktori : /lib/python2.7/site-packages/salt/states/ |
Current File : //lib/python2.7/site-packages/salt/states/elasticsearch.pyo |
� ���^c @@ s� d Z d d l m Z m Z m Z d d l Z d d l m Z d d l Z e j e � Z d � Z d d � Z d � Z d d � Z d � Z e d � Z d � Z d � Z d � Z d � Z d S( uC State module to manage Elasticsearch. .. versionadded:: 2017.7.0 i ( t absolute_importt print_functiont unicode_literalsN( t sixc C@ s0 i | d 6i d 6t d 6d d 6} y� t d d | � } | r� | | k r� t d r� d j | � | d <| | | d d <d | d <q� t d d | � | d <| d r� d j | � | d <| | | d d <q� d j | � | d <n d j | � | d <Wn0 t k r+} t | d <t j | � | d <n X| S( u^ Ensure that the named index is absent. name Name of the index to remove u nameu changesu resultu u commentu elasticsearch.index_gett indexu testu Index {0} will be removedu oldu elasticsearch.index_deleteu Successfully removed index {0}u. Failed to remove index {0} for unknown reasonsu Index {0} is already absentN( t Truet __salt__t __opts__t formatt Nonet Exceptiont FalseR t text_type( t namet retR t err( ( s= /usr/lib/python2.7/site-packages/salt/states/elasticsearch.pyt index_absent s$ " c C@ s> i | d 6i d 6t d 6d d 6} y� t d d | � } | s� t d ry d j | � | d <i | d 6| d <d | d <qt d d | d | � } | r� d j | � | d <i t d d | � | d 6| d <qt | d <d j | | � | d <n d j | � | d <Wn0 t k r9} t | d <t j | � | d <n X| S( uJ Ensure that the named index is present. name Name of the index to add definition Optional dict for creation parameters as per https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html **Example:** .. code-block:: yaml # Default settings mytestindex: elasticsearch_index.present # Extra settings mytestindex2: elasticsearch_index.present: - definition: settings: index: number_of_shards: 10 u nameu changesu resultu u commentu elasticsearch.index_existsR u testu, Index {0} does not exist and will be createdu newu elasticsearch.index_createt bodyu Successfully created index {0}u elasticsearch.index_getu Cannot create index {0}, {1}u Index {0} is already presentN( R R R R R R R R R ( R t definitionR t index_existst outputR ( ( s= /usr/lib/python2.7/site-packages/salt/states/elasticsearch.pyt index_present4 s&