Ejemplo n.º 1
0
 def __init__(self, user):
     """Constructor"""
     self.app = current_app
     if isinstance(user, User) and (
             isinstance(user.uid, str) or isinstance(user.uid, unicode)):
         self.__syspath = user.path
         self.__path = u"{path}/{uid}".format(
             path=self.__syspath,
             uid=user.uid
         )
         self.__user = user
         self.__idx_name = user.uid.lower()
         self.__es_service = EsService.get_instance()
         self.__bulk_insert_url = u'{uid}/node/_bulk'.format(
             uid=self.__idx_name)
         self.__settings_url = u'{uid}/_settings'.format(
             uid=self.__idx_name)
         self.__count_url = u'{uid}/node/_search?search_type=count'.format(
             uid=self.__idx_name)
     else:
         raise TypeError('argument must be of type User')
Ejemplo n.º 2
0
def index():
    """
    Show status
    """
    es_service = EsService()
    return jsonify(es_service.get_status())