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.
Instance Method Summary collapse
-
#delete ⇒ Object
Causes the current leader to abdicate, triggering a new election.
-
#get ⇒ Object
Returns the current leader.
-
#initialize(marathon_instance = Marathon.singleton) ⇒ Leader
constructor
A new instance of Leader.
Constructor Details
Class Method Details
Instance Method Details
#delete ⇒ Object
Causes the current leader to abdicate, triggering a new election. If no leader exists, raises NotFoundError.
17 18 19 20 |
# File 'lib/marathon/leader.rb', line 17 def delete json = @connection.delete('/v2/leader') json['message'] end |
#get ⇒ Object
Returns the current leader. If no leader exists, raises NotFoundError.
10 11 12 13 |
# File 'lib/marathon/leader.rb', line 10 def get json = @connection.get('/v2/leader') json['leader'] end |