Class: Marathon::MarathonInstance

Inherits:
Object
  • Object
show all
Defined in:
lib/marathon.rb

Overview

Represents an instance of Marathon

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url, options) ⇒ MarathonInstance

Returns a new instance of MarathonInstance.



39
40
41
# File 'lib/marathon.rb', line 39

def initialize(url, options)
  @connection = Connection.new(url, options)
end

Instance Attribute Details

#connectionObject (readonly)

Returns the value of attribute connection.



37
38
39
# File 'lib/marathon.rb', line 37

def connection
  @connection
end

Instance Method Details

#appsObject



61
62
63
# File 'lib/marathon.rb', line 61

def apps
  Marathon::Apps.new(self)
end

#deploymentsObject



69
70
71
# File 'lib/marathon.rb', line 69

def deployments
  Marathon::Deployments.new(self)
end

#event_subscriptionsObject



85
86
87
# File 'lib/marathon.rb', line 85

def event_subscriptions
  Marathon::EventSubscriptions.new(self)
end

#groupsObject



65
66
67
# File 'lib/marathon.rb', line 65

def groups
  Marathon::Groups.new(self)
end

#infoObject

Get information about the marathon server



53
54
55
# File 'lib/marathon.rb', line 53

def info
  connection.get('/v2/info')
end

#leadersObject



81
82
83
# File 'lib/marathon.rb', line 81

def leaders
  Marathon::Leader.new(self)
end

#metricsObject



57
58
59
# File 'lib/marathon.rb', line 57

def metrics
  connection.get('/metrics')
end

#pingObject



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

#queuesObject



77
78
79
# File 'lib/marathon.rb', line 77

def queues
  Marathon::Queues.new(self)
end

#tasksObject



73
74
75
# File 'lib/marathon.rb', line 73

def tasks
  Marathon::Tasks.new(self)
end