Class: Marathon::Leader
- Inherits:
-
Object
- Object
- Marathon::Leader
- Defined in:
- lib/marathon/leader.rb
Overview
This class represents a Marathon Leader. See mesosphere.github.io/marathon/docs/rest-api.html#get-/v2/leader for full list of API’s methods.
Class Method Summary collapse
-
.delete ⇒ Object
Causes the current leader to abdicate, triggering a new election.
-
.get ⇒ Object
Returns the current leader.
Class Method Details
.delete ⇒ Object
Causes the current leader to abdicate, triggering a new election. If no leader exists, raises NotFoundError.
14 15 16 17 |
# File 'lib/marathon/leader.rb', line 14 def delete json = Marathon.connection.delete('/v2/leader') json['message'] end |
.get ⇒ Object
Returns the current leader. If no leader exists, raises NotFoundError.
7 8 9 10 |
# File 'lib/marathon/leader.rb', line 7 def get json = Marathon.connection.get('/v2/leader') json['leader'] end |