%PDF- %PDF-
| Direktori : /proc/self/root/proc/self/root/usr/lib/python2.7/site-packages/salt/states/ |
| Current File : //proc/self/root/proc/self/root/usr/lib/python2.7/site-packages/salt/states/elasticsearch_index.pyc |
�
���^c @@ sf d Z d d l m Z m Z m Z d d l Z d d l m Z e j e � Z
d � Z d d � Z
d S( u�
State module to manage Elasticsearch indices
.. versionadded:: 2015.8.0
.. deprecated:: 2017.7.0 Use elasticsearch state instead
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( ( sC /usr/lib/python2.7/site-packages/salt/states/elasticsearch_index.pyt 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( u�
.. versionadded:: 2015.8.0
.. versionchanged:: 2017.3.0
Marked ``definition`` as optional.
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 ( ( sC /usr/lib/python2.7/site-packages/salt/states/elasticsearch_index.pyt present4 s&