Class: SchwarmCli::Client::Tasks
Instance Method Summary
collapse
Methods inherited from Resource
#initialize
Instance Method Details
#archive(id) ⇒ Object
32
33
34
|
# File 'lib/schwarm_cli/client/tasks.rb', line 32
def archive(id)
post("/api/v2/tasks/#{id}/archive").body
end
|
#create(**attributes) ⇒ Object
15
16
17
|
# File 'lib/schwarm_cli/client/tasks.rb', line 15
def create(**attributes)
post("/api/v2/tasks", { task: attributes }).body
end
|
#destroy(id) ⇒ Object
23
24
25
26
|
# File 'lib/schwarm_cli/client/tasks.rb', line 23
def destroy(id)
delete("/api/v2/tasks/#{id}")
nil
end
|
#find(id) ⇒ Object
11
12
13
|
# File 'lib/schwarm_cli/client/tasks.rb', line 11
def find(id)
get("/api/v2/tasks/#{id}").body
end
|
#list(status: nil, repository_id: nil, page: nil, per_page: nil, query: nil) ⇒ Object
6
7
8
9
|
# File 'lib/schwarm_cli/client/tasks.rb', line 6
def list(status: nil, repository_id: nil, page: nil, per_page: nil, query: nil)
params = { status:, repository_id:, page:, per_page:, q: query }.compact
get("/api/v2/tasks", params).body
end
|
#pause(id) ⇒ Object
44
45
46
|
# File 'lib/schwarm_cli/client/tasks.rb', line 44
def pause(id)
post("/api/v2/tasks/#{id}/pause").body
end
|
#reset(id) ⇒ Object
40
41
42
|
# File 'lib/schwarm_cli/client/tasks.rb', line 40
def reset(id)
post("/api/v2/tasks/#{id}/reset").body
end
|
#retry(id) ⇒ Object
36
37
38
|
# File 'lib/schwarm_cli/client/tasks.rb', line 36
def retry(id)
post("/api/v2/tasks/#{id}/retry").body
end
|
#start(id) ⇒ Object
28
29
30
|
# File 'lib/schwarm_cli/client/tasks.rb', line 28
def start(id)
post("/api/v2/tasks/#{id}/start").body
end
|
#update(id, **attributes) ⇒ Object
19
20
21
|
# File 'lib/schwarm_cli/client/tasks.rb', line 19
def update(id, **attributes)
patch("/api/v2/tasks/#{id}", { task: attributes }).body
end
|