Class: ChronosEndpoint
- Inherits:
-
Object
- Object
- ChronosEndpoint
- Defined in:
- lib/panteras_api/chronos_endpoint.rb
Instance Method Summary collapse
- #all_apps ⇒ Object
-
#initialize(host, port = 4400) ⇒ ChronosEndpoint
constructor
A new instance of ChronosEndpoint.
- #my_task_ids(hostname, framework = 'chronos') ⇒ Object
Methods included from Utils
fully_qualified_hostname, hostname
Methods included from HTTPUtils
#construct_uri, #get_response_with_redirect, #to_j, #valid_url
Constructor Details
#initialize(host, port = 4400) ⇒ ChronosEndpoint
5 6 7 8 |
# File 'lib/panteras_api/chronos_endpoint.rb', line 5 def initialize(host, port=4400) @host = host @port = port end |
Instance Method Details
#all_apps ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/panteras_api/chronos_endpoint.rb', line 10 def all_apps begin to_j(get_response_with_redirect(@host, '/scheduler/jobs', @port)) rescue Errno::ECONNREFUSED => e to_j('[]') end end |
#my_task_ids(hostname, framework = 'chronos') ⇒ Object
18 19 20 |
# File 'lib/panteras_api/chronos_endpoint.rb', line 18 def my_task_ids(hostname, framework = 'chronos') all_apps.collect { |a| a[:name][0..-1] } end |