Class: ChronosEndpoint

Inherits:
Object
  • Object
show all
Includes:
HTTPUtils, Utils
Defined in:
lib/panteras_api/chronos_endpoint.rb

Instance Method Summary collapse

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 = 8080) ⇒ ChronosEndpoint

Returns a new instance of ChronosEndpoint.



5
6
7
8
# File 'lib/panteras_api/chronos_endpoint.rb', line 5

def initialize(host, port=8080)
  @host = host
  @port = port
end

Instance Method Details

#all_appsObject



10
11
12
# File 'lib/panteras_api/chronos_endpoint.rb', line 10

def all_apps
  to_j(get_response_with_redirect(@host, '/scheduler/jobs', @port))
end

#my_task_ids(hostname, framework = 'chronos') ⇒ Object



14
15
16
# File 'lib/panteras_api/chronos_endpoint.rb', line 14

def my_task_ids(hostname, framework = 'chronos')
  all_apps.collect { |a| a[:name][0..-1] }
end