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

Attributes inherited from LabStruct

#response, #table

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, #initialize, #key?, #keys, #method_missing, #respond_to_missing?, #slice, #success?, #to_h

Constructor Details

This class inherits a constructor from LabClient::Klass

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class LabClient::LabStruct

Instance Method Details

#artifacts_path(artifacts_path, file_path = nil) ⇒ Object



32
33
34
35
# File 'lib/labclient/jobs/job.rb', line 32

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



42
43
44
45
# File 'lib/labclient/jobs/job.rb', line 42

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

#deleteObject



62
63
64
65
# File 'lib/labclient/jobs/job.rb', line 62

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

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

File Write Response



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

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

#eraseObject



52
53
54
55
# File 'lib/labclient/jobs/job.rb', line 52

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



57
58
59
60
# File 'lib/labclient/jobs/job.rb', line 57

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



67
68
69
70
# File 'lib/labclient/jobs/job.rb', line 67

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



47
48
49
50
# File 'lib/labclient/jobs/job.rb', line 47

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

#show_artifacts(job_token = nil) ⇒ Object

LabFile Response



27
28
29
30
# File 'lib/labclient/jobs/job.rb', line 27

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

#traceObject



37
38
39
40
# File 'lib/labclient/jobs/job.rb', line 37

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