Class: Marathon::MarathonInstance
- Inherits:
-
Object
- Object
- Marathon::MarathonInstance
- Defined in:
- lib/marathon.rb
Overview
Represents an instance of Marathon
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
Instance Method Summary collapse
- #apps ⇒ Object
- #deployments ⇒ Object
- #event_subscriptions ⇒ Object
- #groups ⇒ Object
-
#info ⇒ Object
Get information about the marathon server.
-
#initialize(url, options) ⇒ MarathonInstance
constructor
A new instance of MarathonInstance.
- #leaders ⇒ Object
- #metrics ⇒ Object
- #ping ⇒ Object
- #queues ⇒ Object
- #tasks ⇒ Object
Constructor Details
#initialize(url, options) ⇒ MarathonInstance
Returns a new instance of MarathonInstance.
39 40 41 |
# File 'lib/marathon.rb', line 39 def initialize(url, ) @connection = Connection.new(url, ) end |
Instance Attribute Details
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
37 38 39 |
# File 'lib/marathon.rb', line 37 def connection @connection end |
Instance Method Details
#deployments ⇒ Object
69 70 71 |
# File 'lib/marathon.rb', line 69 def deployments Marathon::Deployments.new(self) end |
#event_subscriptions ⇒ Object
85 86 87 |
# File 'lib/marathon.rb', line 85 def event_subscriptions Marathon::EventSubscriptions.new(self) end |
#groups ⇒ Object
65 66 67 |
# File 'lib/marathon.rb', line 65 def groups Marathon::Groups.new(self) end |
#info ⇒ Object
Get information about the marathon server
53 54 55 |
# File 'lib/marathon.rb', line 53 def info connection.get('/v2/info') end |
#leaders ⇒ Object
81 82 83 |
# File 'lib/marathon.rb', line 81 def leaders Marathon::Leader.new(self) end |
#metrics ⇒ Object
57 58 59 |
# File 'lib/marathon.rb', line 57 def metrics connection.get('/metrics') end |
#ping ⇒ Object
43 44 45 46 47 48 49 50 |
# File 'lib/marathon.rb', line 43 def ping begin connection.get('/ping') rescue Marathon::Error::UnexpectedResponseError => err return err.response.body if err.response.code == 200 raise err end end |