#NEWLINE# def create_alias( self , alias , indexes ) : #NEWLINE# #INDENT# 'Create an alias for one or more indexes.\n\n        Arguments:\n        alias -- the alias name\n        indexes -- a list of indexes that this alias spans over\n\n        ' #NEWLINE# query = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# query [ 'actions' ] = [ ] #NEWLINE# for index in indexes : #NEWLINE# #INDENT# query [ 'actions' ] . append ( { #NEWLINE# #INDENT# 'add' : { #NEWLINE# #INDENT# 'index' : index , #NEWLINE# 'alias' : alias , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# path = self . _make_path ( [ '_aliases' ] ) #NEWLINE# self . send_request ( 'POST' , query , body = query ) #NEWLINE# resp = json . loads ( self . last_response . text ) #NEWLINE# return self . check_result ( resp , 'ok' , True )