Class: Orchestrator_api::Jobs

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

Instance Method Summary collapse

Constructor Details

#initialize(http, api_url_base) ⇒ Jobs

Returns a new instance of Jobs.



3
4
5
6
# File 'lib/orchestrator_api/jobs.rb', line 3

def initialize(http, api_url_base)
  @https = http
  @api_url_base = api_url_base
end

Instance Method Details

#all(limit = nil) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/orchestrator_api/jobs.rb', line 8

def all(limit=nil)
  url = "#{@api_url_base}/jobs"
  if limit
    url << "?limit=#{limit}"
  end

  @https.get(url)
end

#details(id) ⇒ Object



17
18
19
# File 'lib/orchestrator_api/jobs.rb', line 17

def details(id)
  @https.get("#{@api_url_base}/jobs/#{id}")
end

#events(id, start = nil) ⇒ Object



29
30
31
32
33
34
35
36
# File 'lib/orchestrator_api/jobs.rb', line 29

def events(id, start = nil)
  url = "#{@api_url_base}/jobs/#{id}/events"
  if start
    url << "?start=#{start}"
  end

  @https.get(url)
end

#nodes(id) ⇒ Object



21
22
23
# File 'lib/orchestrator_api/jobs.rb', line 21

def nodes(id)
  @https.get("#{@api_url_base}/jobs/#{id}/nodes")
end

#report(id) ⇒ Object



25
26
27
# File 'lib/orchestrator_api/jobs.rb', line 25

def report(id)
  @https.get("#{@api_url_base}/jobs/#{id}/report")
end