Class: LabClient::Job

Inherits:
Klass show all
Includes:
ClassHelpers
Defined in:
lib/labclient/jobs/job.rb

Overview

Inspect Helper

Instance Attribute Summary

Attributes inherited from Klass

#client, #response

Attributes inherited from LabStruct

#response

Instance Method Summary collapse

Methods included from ClassHelpers

#has?, #keys, #raw

Methods inherited from Klass

#api_methods, #collect_project_id, #collect_release_id, #collect_repository_id, date_time_attrs, #format_time?, #group_name, #help, #initialize, #klass, #quiet?, #success?, #to_json, #update_self, user_attrs, #valid_group_project_levels, #verbose

Methods included from Docs

#demo, #desc, #doc, docs, #example, #group_name, #help, json, #markdown, #navigation, #option, #result, #subtitle, #title

Methods included from CurlHelper

#curl

Methods included from Logger

#logger, logger, logger_setup

Methods inherited from LabStruct

#as_json, #client, #keys, #slice, #success?

Constructor Details

This class inherits a constructor from LabClient::Klass

Instance Method Details

#artifacts(file_path = nil, job_token = nil) ⇒ Object



20
21
22
23
# File 'lib/labclient/jobs/job.rb', line 20

def artifacts(file_path = nil, job_token = nil)
  project_id = collect_project_id
  client.jobs.artifacts(project_id, id, file_path, job_token)
end

#artifacts_path(artifacts_path, file_path = nil) ⇒ Object



25
26
27
28
# File 'lib/labclient/jobs/job.rb', line 25

def artifacts_path(artifacts_path, file_path = nil)
  project_id = collect_project_id
  client.jobs.artifacts_path(project_id, id, artifacts_path, file_path)
end

#cancelObject



35
36
37
38
# File 'lib/labclient/jobs/job.rb', line 35

def cancel
  project_id = collect_project_id
  client.jobs.cancel(project_id, id)
end

#deleteObject



55
56
57
58
# File 'lib/labclient/jobs/job.rb', line 55

def delete
  project_id = collect_project_id
  client.jobs.delete(project_id, id)
end

#eraseObject



45
46
47
48
# File 'lib/labclient/jobs/job.rb', line 45

def erase
  project_id = collect_project_id
  client.jobs.erase(project_id, id)
end

#inspectObject



7
8
9
# File 'lib/labclient/jobs/job.rb', line 7

def inspect
  "#<Job id: #{id}, status: #{status}, stage: #{stage}>"
end

#keepObject



50
51
52
53
# File 'lib/labclient/jobs/job.rb', line 50

def keep
  project_id = collect_project_id
  client.jobs.keep(project_id, id)
end

#pipelineObject



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

def pipeline
  Pipeline.new(@table[:pipeline], response, client)
end

#playObject



60
61
62
63
# File 'lib/labclient/jobs/job.rb', line 60

def play
  project_id = collect_project_id
  client.jobs.play(project_id, id)
end

#projectObject



11
12
13
14
# File 'lib/labclient/jobs/job.rb', line 11

def project
  project_id = collect_project_id
  client.projects.show(project_id)
end

#retryObject



40
41
42
43
# File 'lib/labclient/jobs/job.rb', line 40

def retry
  project_id = collect_project_id
  client.jobs.retry(project_id, id)
end

#traceObject



30
31
32
33
# File 'lib/labclient/jobs/job.rb', line 30

def trace
  project_id = collect_project_id
  client.jobs.trace(project_id, id)
end