Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Luke: added index_list

  • Loading branch information...
commit c5fd7ab77d0ebf66293861deb15540f091fab769 1 parent a83be49
@lukecampbell lukecampbell authored
Showing with 12 additions and 0 deletions.
  1. +12 −0 elasticpy.py
View
12 elasticpy.py
@@ -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):
Please sign in to comment.
Something went wrong with that request. Please try again.