Class: OrchestratorClient::Jobs

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

Instance Method Summary collapse

Constructor Details

#initialize(http) ⇒ Jobs

Returns a new instance of Jobs.



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

def initialize(http)
  @https = http
end

Instance Method Details

#all(limit = nil) ⇒ Object



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

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

  @https.get(url)
end

#details(id) ⇒ Object



16
17
18
# File 'lib/orchestrator_client/jobs.rb', line 16

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

#events(id, start = nil) ⇒ Object



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

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

  @https.get(url)
end

#nodes(id) ⇒ Object



20
21
22
# File 'lib/orchestrator_client/jobs.rb', line 20

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

#report(id) ⇒ Object



24
25
26
# File 'lib/orchestrator_client/jobs.rb', line 24

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