Skip to content

Commit

Permalink
Merge pull request #24 from pradeepchhetri/get_info
Browse files Browse the repository at this point in the history
Added get_leader and delete_leader functions
  • Loading branch information
mbabineau committed Mar 14, 2015
2 parents 57f50f4 + e0813ed commit fc2cc84
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion marathon/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,24 @@ def get_info(self):
response = self._do_request('GET', '/v2/info')
return self._parse_response(response, MarathonInfo)

def get_leader(self):
"""Get the current marathon leader.
:returns: leader endpoint
:rtype: dict
"""
response = self._do_request('GET', '/v2/leader')
return response.json()

def delete_leader(self):
"""Causes the current leader to abdicate, triggers a new election.
:returns: message saying leader abdicated
:rtype: dict
"""
response = self._do_request('DELETE', '/v2/leader')
return response.json()

def ping(self):
"""Ping the Marathon server.
Expand All @@ -529,4 +547,4 @@ def get_metrics(self):
:rtype: dict
"""
response = self._do_request('GET', '/metrics')
return response.json()
return response.json()

0 comments on commit fc2cc84

Please sign in to comment.