Module: Digdag::Client::Attempt

Included in:
Digdag::Client
Defined in:
lib/digdag_client/client/attempt.rb

Instance Method Summary collapse

Instance Method Details

#get_attemp_retries(id) ⇒ Object



32
33
34
# File 'lib/digdag_client/client/attempt.rb', line 32

def get_attemp_retries(id)
  get("attempts/#{id}/retries")
end

#get_attempt(id) ⇒ Object



24
25
26
# File 'lib/digdag_client/client/attempt.rb', line 24

def get_attempt(id)
  get("attempts/#{id}")
end

#get_attempts(params = {}) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/digdag_client/client/attempt.rb', line 6

def get_attempts(params={})

  options = {}
  if params[:include_retried] == 1
    options[:include_retried] = 1
  end

  if params[:project]
    options[:project] = params[:project]
  end

  if params[:workflow]
    options[:workflow] = params[:workflow]
  end

  get("attempts", options)["attempts"]
end

#get_tasks_of_attempt(id) ⇒ Object



28
29
30
# File 'lib/digdag_client/client/attempt.rb', line 28

def get_tasks_of_attempt(id)
  get("attempts/#{id}/tasks")["tasks"]
end

#kill_attempt(id) ⇒ Object



47
48
49
# File 'lib/digdag_client/client/attempt.rb', line 47

def kill_attempt(id)
  post("attempts/#{id}/kill")
end

#start_attempt(params = {}) ⇒ Object



36
37
38
39
40
41
42
43
44
45
# File 'lib/digdag_client/client/attempt.rb', line 36

def start_attempt(params={})
  options = {}
  options[:params] = params[:params]
  if params[:sessionTime].is_a?(Time)
    options[:sessionTime] = params[:sessionTime].iso8601
  end

  options[:workflowId] = params[:workflowId]
  put("attempts", options)
end