class Fog::Compute::Proxmox::Tasks
class Tasks Collection of node
Public Instance Methods
all()
click to toggle source
# File lib/fog/compute/proxmox/models/tasks.rb, line 40 def all search end
get(id)
click to toggle source
# File lib/fog/compute/proxmox/models/tasks.rb, line 54 def get(id) requires :node status_details = service.status_task(node.node, id) task_hash = status_details.merge(log: log(id)) task_data = task_hash.merge(node: node, upid: id) new(task_data) end
log(id)
click to toggle source
# File lib/fog/compute/proxmox/models/tasks.rb, line 44 def log(id) requires :node log = '' log_array = service.log_task(node.node, id, {}) log_array.each do |line_hash| log += line_hash['t'].to_s + "\n" end log end
new(attributes = {})
click to toggle source
Calls superclass method
# File lib/fog/compute/proxmox/models/tasks.rb, line 30 def new(attributes = {}) requires :node super({ node: node }.merge(attributes)) end
search(options = {})
click to toggle source
# File lib/fog/compute/proxmox/models/tasks.rb, line 35 def search(options = {}) requires :node load_response(service.list_tasks(node.node, options), 'tasks') end
wait_for(task_upid)
click to toggle source
# File lib/fog/compute/proxmox/models/tasks.rb, line 62 def wait_for(task_upid) task = get(task_upid) task.wait_for { finished? } task.succeeded? end