<s> from . utils import NamespacedClient , query_params , _make_path , SKIP_IN_PATH <EOL> from . . exceptions import NotFoundError <EOL> class IndicesClient ( NamespacedClient ) : <EOL> @ query_params ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT:text>' , '<STR_LIT>' ) <EOL> def analyze ( self , index = None , body = None , params = None ) : <EOL> """<STR_LIT>""" <EOL> _ , data = self . transport . perform_request ( '<STR_LIT:GET>' , _make_path ( index , '<STR_LIT>' ) , <EOL> params = params , body = body ) <EOL> return data <EOL> @ query_params ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' ) <EOL> def refresh ( self , index = None , params = None ) : <EOL> """<STR_LIT>""" <EOL> _ , data = self . transport . perform_request ( '<STR_LIT:POST>' , _make_path ( index , '<STR_LIT>' ) , <EOL> params = params ) <EOL> return data <EOL> @ query_params ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> def flush ( self , index = None , params = None ) : <EOL> """<STR_LIT>""" <EOL> _ , data = self . transport . perform_request ( '<STR_LIT:POST>' , _make_path ( index , '<STR_LIT>' ) , <EOL> params = params ) <EOL> return data <EOL> @ query_params ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> def create ( self , index , body = None , params = None ) : <EOL> """<STR_LIT>""" <EOL> if index in SKIP_IN_PATH : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> _ , data = self . transport . perform_request ( '<STR_LIT>' , _make_path ( index ) , <EOL> params = params , body = body ) <EOL> return data <EOL> @ query_params ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> def get ( self , index , feature = None , params = None ) : <EOL> """<STR_LIT>""" <EOL> if index in SKIP_IN_PATH : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> _ , data = self . transport . perform_request ( '<STR_LIT:GET>' , _make_path ( index , <EOL> feature ) , params = params ) <EOL> return data <EOL> @ query_params ( '<STR_LIT>' , '<STR_LIT>' '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' ) <EOL> def open ( self , index , params = None ) : <EOL> """<STR_LIT>""" <EOL> if index in SKIP_IN_PATH : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> _ , data = self . transport . perform_request ( '<STR_LIT:POST>' , _make_path ( index , '<STR_LIT>' ) , <EOL> params = params ) <EOL> return data <EOL> @ query_params ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' ) <EOL> def close ( self , index , params = None ) : <EOL> """<STR_LIT>""" <EOL> if index in SKIP_IN_PATH : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> _ , data = self . transport . perform_request ( '<STR_LIT:POST>' , _make_path ( index , '<STR_LIT>' ) , <EOL> params = params ) <EOL> return data <EOL> @ query_params ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> def delete ( self , index , params = None ) : <EOL> """<STR_LIT>""" <EOL> if index in SKIP_IN_PATH : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> _ , data = self . transport . perform_request ( '<STR_LIT>' , _make_path ( index ) , <EOL> params = params ) <EOL> return data <EOL> @ query_params ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> def exists ( self , index , params = None ) : <EOL> """<STR_LIT>""" <EOL> if index in SKIP_IN_PATH : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> try : <EOL> self . transport . perform_request ( '<STR_LIT>' , _make_path ( index ) , params = params ) <EOL> except NotFoundError : <EOL> return False <EOL> return True <EOL> @ query_params ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' ) <EOL> def exists_type ( self , index , doc_type , params = None ) : <EOL> """<STR_LIT>""" <EOL> for param in ( index , doc_type ) : <EOL> if param in SKIP_IN_PATH : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> try : <EOL> self . transport . perform_request ( '<STR_LIT>' , _make_path ( index , doc_type ) , params = params ) <EOL> except NotFoundError : <EOL> return False <EOL> return True <EOL> @ query_params ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> def put_mapping ( self , doc_type , body , index = None , params = None ) : <EOL> """<STR_LIT>""" <EOL> for param in ( doc_type , body ) : <EOL> if param in SKIP_IN_PATH : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> _ , data = self . transport . perform_request ( '<STR_LIT>' , _make_path ( index , '<STR_LIT>' , doc_type ) , <EOL> params = params , body = body ) <EOL> return data <EOL> @ query_params ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> def get_mapping ( self , index = None , doc_type = None , params = None ) : <EOL> """<STR_LIT>""" <EOL> _ , data = self . transport . perform_request ( '<STR_LIT:GET>' , _make_path ( index , '<STR_LIT>' , doc_type ) , <EOL> params = params ) <EOL> return data <EOL> @ query_params ( "<STR_LIT>" , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' ) <EOL> def get_field_mapping ( self , field , index = None , doc_type = None , params = None ) : <EOL> """<STR_LIT>""" <EOL> if field in SKIP_IN_PATH : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> _ , data = self . transport . perform_request ( '<STR_LIT:GET>' , _make_path ( index , '<STR_LIT>' , doc_type , '<STR_LIT>' , field ) , <EOL> params = params ) <EOL> return data <EOL> @ query_params ( '<STR_LIT>' ) <EOL> def delete_mapping ( self , index , doc_type , params = None ) : <EOL> """<STR_LIT>""" <EOL> for param in ( index , doc_type ) : <EOL> if param in SKIP_IN_PATH : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> _ , data = self . transport . perform_request ( '<STR_LIT>' , _make_path ( index , '<STR_LIT>' , doc_type ) , <EOL> params = params ) <EOL> return data <EOL> @ query_params ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> def put_alias ( self , name , index , body = None , params = None ) : <EOL> """<STR_LIT>""" <EOL> for param in ( index , name ) : <EOL> if param in SKIP_IN_PATH : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> _ , data = self . transport . perform_request ( '<STR_LIT>' , _make_path ( index , '<STR_LIT>' , name ) , <EOL> params = params , body = body ) <EOL> return data <EOL> @ query_params ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> def exists_alias ( self , name , index = None , params = None ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> self . transport . perform_request ( '<STR_LIT>' , _make_path ( index , '<STR_LIT>' , name ) , <EOL> params = params ) <EOL> except NotFoundError : <EOL> return False <EOL> return True <EOL> @ query_params ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> def get_alias ( self , index = None , name = None , params = None ) : <EOL> """<STR_LIT>""" <EOL> _ , data = self . transport . perform_request ( '<STR_LIT:GET>' , _make_path ( index , '<STR_LIT>' , name ) , <EOL> params = params ) <EOL> return data <EOL> @ query_params ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> def get_aliases ( self , index = None , name = None , params = None ) : <EOL> """<STR_LIT>""" <EOL> _ , data = self . transport . perform_request ( '<STR_LIT:GET>' , _make_path ( index , '<STR_LIT>' , name ) , <EOL> params = params ) <EOL> return data <EOL> @ query_params ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> def update_aliases ( self , body , params = None ) : <EOL> """<STR_LIT>""" <EOL> if body in SKIP_IN_PATH : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> _ , data = self . transport . perform_request ( '<STR_LIT:POST>' , '<STR_LIT>' , <EOL> params = params , body = body ) <EOL> return data <EOL> @ query_params ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> def delete_alias ( self , index , name , params = None ) : <EOL> """<STR_LIT>""" <EOL> for param in ( index , name ) : <EOL> if param in SKIP_IN_PATH : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> _ , data = self . transport . perform_request ( '<STR_LIT>' , _make_path ( index , '<STR_LIT>' , name ) , <EOL> params = params ) <EOL> return data <EOL> @ query_params ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> def put_template ( self , name , body , params = None ) : <EOL> """<STR_LIT>""" <EOL> for param in ( name , body ) : <EOL> if param in SKIP_IN_PATH : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> _ , data = self . transport . perform_request ( '<STR_LIT>' , _make_path ( '<STR_LIT>' , name ) , <EOL> params = params , body = body ) <EOL> return data <EOL> @ query_params ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> def exists_template ( self , name , params = None ) : <EOL> """<STR_LIT>""" <EOL> if name in SKIP_IN_PATH : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> try : <EOL> self . transport . perform_request ( '<STR_LIT>' , _make_path ( '<STR_LIT>' , name ) , <EOL> params = params ) <EOL> except NotFoundError : <EOL> return False <EOL> return True <EOL> @ query_params ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> def get_template ( self , name = None , params = None ) : <EOL> """<STR_LIT>""" <EOL> _ , data = self . transport . perform_request ( '<STR_LIT:GET>' , _make_path ( '<STR_LIT>' , name ) , <EOL> params = params ) <EOL> return data <EOL> @ query_params ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> def delete_template ( self , name , params = None ) : <EOL> """<STR_LIT>""" <EOL> if name in SKIP_IN_PATH : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> _ , data = self . transport . perform_request ( '<STR_LIT>' , _make_path ( '<STR_LIT>' , name ) , <EOL> params = params ) <EOL> return data <EOL> @ query_params ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' ) <EOL> def get_settings ( self , index = None , name = None , params = None ) : <EOL> """<STR_LIT>""" <EOL> _ , data = self . transport . perform_request ( '<STR_LIT:GET>' , _make_path ( index , '<STR_LIT>' , name ) , <EOL> params = params ) <EOL> return data <EOL> @ query_params ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' ) <EOL> def put_settings ( self , body , index = None , params = None ) : <EOL> """<STR_LIT>""" <EOL> if body in SKIP_IN_PATH : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> _ , data = self . transport . perform_request ( '<STR_LIT>' , _make_path ( index , '<STR_LIT>' ) , <EOL> params = params , body = body ) <EOL> return data <EOL> @ query_params ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> def put_warmer ( self , name , body , index = None , doc_type = None , params = None ) : <EOL> """<STR_LIT>""" <EOL> for param in ( name , body ) : <EOL> if param in SKIP_IN_PATH : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> if doc_type and not index : <EOL> index = '<STR_LIT>' <EOL> _ , data = self . transport . perform_request ( '<STR_LIT>' , _make_path ( index , doc_type , '<STR_LIT>' , name ) , <EOL> params = params , body = body ) <EOL> return data <EOL> @ query_params ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> def get_warmer ( self , index = None , doc_type = None , name = None , params = None ) : <EOL> """<STR_LIT>""" <EOL> _ , data = self . transport . perform_request ( '<STR_LIT:GET>' , _make_path ( index , doc_type , '<STR_LIT>' , name ) , params = params ) <EOL> return data <EOL> @ query_params ( '<STR_LIT>' ) <EOL> def delete_warmer ( self , index , name , params = None ) : <EOL> """<STR_LIT>""" <EOL> for param in ( index , name ) : <EOL> if param in SKIP_IN_PATH : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> _ , data = self . transport . perform_request ( '<STR_LIT>' , _make_path ( index , '<STR_LIT>' , name ) , <EOL> params = params ) <EOL> return data <EOL> @ query_params ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> def status ( self , index = None , params = None ) : <EOL> """<STR_LIT>""" <EOL> _ , data = self . transport . perform_request ( '<STR_LIT:GET>' , _make_path ( index , '<STR_LIT>' ) , <EOL> params = params ) <EOL> return data <EOL> @ query_params ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> def stats ( self , index = None , metric = None , params = None ) : <EOL> """<STR_LIT>""" <EOL> _ , data = self . transport . perform_request ( '<STR_LIT:GET>' , _make_path ( index , '<STR_LIT>' , metric ) , <EOL> params = params ) <EOL> return data <EOL> @ query_params ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' ) <EOL> def segments ( self , index = None , params = None ) : <EOL> """<STR_LIT>""" <EOL> _ , data = self . transport . perform_request ( '<STR_LIT:GET>' , _make_path ( index , '<STR_LIT>' ) , params = params ) <EOL> return data <EOL> @ query_params ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> def optimize ( self , index = None , params = None ) : <EOL> """<STR_LIT>""" <EOL> _ , data = self . transport . perform_request ( '<STR_LIT:POST>' , _make_path ( index , '<STR_LIT>' ) , params = params ) <EOL> return data <EOL> @ query_params ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT:q>' ) <EOL> def validate_query ( self , index = None , doc_type = None , body = None , params = None ) : <EOL> """<STR_LIT>""" <EOL> _ , data = self . transport . perform_request ( '<STR_LIT:GET>' , _make_path ( index , doc_type , '<STR_LIT>' , '<STR_LIT>' ) , <EOL> params = params , body = body ) <EOL> return data <EOL> @ query_params ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT:id>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> def clear_cache ( self , index = None , params = None ) : <EOL> """<STR_LIT>""" <EOL> _ , data = self . transport . perform_request ( '<STR_LIT:POST>' , _make_path ( index , '<STR_LIT>' , '<STR_LIT>' ) , <EOL> params = params ) <EOL> return data <EOL> @ query_params ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> def recovery ( self , index = None , params = None ) : <EOL> """<STR_LIT>""" <EOL> _ , data = self . transport . perform_request ( '<STR_LIT:GET>' , _make_path ( index , <EOL> '<STR_LIT>' ) , params = params ) <EOL> return data <EOL> @ query_params ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' ) <EOL> def upgrade ( self , index = None , params = None ) : <EOL> """<STR_LIT>""" <EOL> _ , data = self . transport . perform_request ( '<STR_LIT:POST>' , _make_path ( index , <EOL> '<STR_LIT>' ) , params = params ) <EOL> return data <EOL> @ query_params ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> def get_upgrade ( self , index = None , params = None ) : <EOL> """<STR_LIT>""" <EOL> _ , data = self . transport . perform_request ( '<STR_LIT:GET>' , _make_path ( index , <EOL> '<STR_LIT>' ) , params = params ) <EOL> return data <EOL> @ query_params ( ) <EOL> def flush_synced ( self , index = None , params = None ) : <EOL> """<STR_LIT>""" <EOL> _ , data = self . transport . perform_request ( '<STR_LIT:POST>' , _make_path ( index , <EOL> '<STR_LIT>' , '<STR_LIT>' ) , params = params ) <EOL> return data </s>
