Permalink
Browse files

Luke: added index_list

  • Loading branch information...
1 parent a83be49 commit c5fd7ab77d0ebf66293861deb15540f091fab769 @lukecampbell lukecampbell committed Apr 17, 2012
Showing with 12 additions and 0 deletions.
  1. +12 −0 elasticpy.py
View
@@ -325,6 +325,18 @@ def geo_map(self,index,itype,field):
url_request.get_method = lambda : 'PUT'
s = urllib2.urlopen(url_request).read()
return json.loads(s)
+
+
+ def index_list(self):
+ '''
+ Lists indices
+ '''
+
+ url = 'http://%s:%s/_status' % (self.host, self.port)
+ request = urllib2.Request(url,None)
+ request.add_header('Content-Type','json')
+ response = json.loads(urllib2.urlopen(request).read())
+ return response['indices'].keys()
class ElasticQuery(dict):

0 comments on commit c5fd7ab

Please sign in to comment.