Class: SchwarmCli::Client::Tasks
Instance Method Summary
collapse
Methods inherited from Resource
#initialize
Instance Method Details
#archive(id) ⇒ Object
33
34
35
|
# File 'lib/schwarm_cli/client/tasks.rb', line 33
def archive(id)
post("/api/v2/tasks/#{id}/archive").body
end
|
#create(**attributes) ⇒ Object
16
17
18
|
# File 'lib/schwarm_cli/client/tasks.rb', line 16
def create(**attributes)
post("/api/v2/tasks", { task: attributes }).body
end
|
#destroy(id) ⇒ Object
24
25
26
27
|
# File 'lib/schwarm_cli/client/tasks.rb', line 24
def destroy(id)
delete("/api/v2/tasks/#{id}")
nil
end
|
#find(id) ⇒ Object
12
13
14
|
# File 'lib/schwarm_cli/client/tasks.rb', line 12
def find(id)
get("/api/v2/tasks/#{id}").body
end
|
#list(query: nil, **filters) ⇒ Object
6
7
8
9
10
|
# File 'lib/schwarm_cli/client/tasks.rb', line 6
def list(query: nil, **filters)
params = filters.compact
params[:q] = query if query
get("/api/v2/tasks", params).body
end
|
#pause(id) ⇒ Object
45
46
47
|
# File 'lib/schwarm_cli/client/tasks.rb', line 45
def pause(id)
post("/api/v2/tasks/#{id}/pause").body
end
|
#reset(id) ⇒ Object
41
42
43
|
# File 'lib/schwarm_cli/client/tasks.rb', line 41
def reset(id)
post("/api/v2/tasks/#{id}/reset").body
end
|
#retry(id) ⇒ Object
37
38
39
|
# File 'lib/schwarm_cli/client/tasks.rb', line 37
def retry(id)
post("/api/v2/tasks/#{id}/retry").body
end
|
#start(id) ⇒ Object
29
30
31
|
# File 'lib/schwarm_cli/client/tasks.rb', line 29
def start(id)
post("/api/v2/tasks/#{id}/start").body
end
|
#update(id, **attributes) ⇒ Object
20
21
22
|
# File 'lib/schwarm_cli/client/tasks.rb', line 20
def update(id, **attributes)
patch("/api/v2/tasks/#{id}", { task: attributes }).body
end
|