Class: RenderRuby::JobResource

Inherits:
Resource
  • Object
show all
Defined in:
lib/render_ruby/resources/jobs.rb

Instance Attribute Summary

Attributes inherited from Resource

#client

Instance Method Summary collapse

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from RenderRuby::Resource

Instance Method Details

#create(service_id:, start_command:, **attributes) ⇒ Object



15
16
17
18
19
# File 'lib/render_ruby/resources/jobs.rb', line 15

def create(service_id:, start_command:, **attributes)
  attributes = attributes.merge(startCommand: start_command)

  Job.new post_request("services/#{service_id}/jobs", body: attributes).body
end

#list(service_id:, **params) ⇒ Object



5
6
7
8
9
# File 'lib/render_ruby/resources/jobs.rb', line 5

def list(service_id:, **params)
  response = get_request("services/#{service_id}/jobs", params: params)

  Collection.from_response(response, type: Job)
end

#retrieve(service_id:, job_id:) ⇒ Object



11
12
13
# File 'lib/render_ruby/resources/jobs.rb', line 11

def retrieve(service_id:, job_id:)
  Job.new get_request("services/#{service_id}/jobs/#{job_id}").body
end