Skip to content

Commit

Permalink
Merge pull request aparo#259 from fridgei/master
Browse files Browse the repository at this point in the history
added shutdown support
  • Loading branch information
aparo committed Feb 6, 2013
2 parents 4820944 + f448539 commit 9921870
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions pyes/managers.py
Expand Up @@ -440,6 +440,28 @@ def __init__(self, conn):

#TODO: node shutdown, update settings

def shutdown(self, all_nodes=False, master=False, local=False, nodes=[],
delay=None):
if all_nodes:
patn = make_path('_shutdown')
elif master:
path = make_path("_cluster", "nodes", "_master", "_shutdown")
elif nodes:
path = make_path("_cluster", "nodes", ",".join(nodes), "_shutdown")
elif local:
path = make_path("_cluster", "nodes", "_local", "_shutdown")
if delay:
try:
int(delay)
path += "?%s"%delay
except ValueError:
raise ValueError("%s is not a valid delay time"%delay)
except TypeError:
raise TypeError("%s is not of type int or string"%delay)
return self.conn._send_request('GET', path)



def health(self, indices=None, level="cluster", wait_for_status=None,
wait_for_relocating_shards=None, timeout=30):
"""
Expand Down

0 comments on commit 9921870

Please sign in to comment.