Class: RenderAPI::Clients::Jobs

Inherits:
Base
  • Object
show all
Defined in:
lib/render_api/clients/jobs.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from RenderAPI::Clients::Base

Instance Method Details

#create(service_id, start_command:, plan_id: nil) ⇒ Object



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

def create(service_id, start_command:, plan_id: nil)
  body = { startCommand: start_command }
  body[:plan_id] = plan_id unless plan_id.nil?

  endpoint.post(
    "/services/#{service_id}/jobs", body: body
  )
end

#find(service_id, job_id) ⇒ Object



17
18
19
20
21
# File 'lib/render_api/clients/jobs.rb', line 17

def find(service_id, job_id)
  endpoint.get(
    "/services/#{service_id}/jobs/#{job_id}"
  )
end

#list(service_id) ⇒ Object



23
24
25
26
27
# File 'lib/render_api/clients/jobs.rb', line 23

def list(service_id, ...)
  endpoint.get(
    "/services/#{service_id}/jobs", params: list_parameters(...)
  )
end