class Fog::Proxmox::Compute::Task
class Task model of a node
Public Class Methods
new(new_attributes = {})
click to toggle source
Calls superclass method
# File lib/fog/compute/proxmox/models/task.rb, line 47 def initialize(new_attributes = {}) prepare_service_value(new_attributes) attributes[:node_id] = new_attributes[:node_id] unless new_attributes[:node_id].nil? attributes[:upid] = new_attributes[:upid] unless new_attributes[:upid].nil? attributes[:upid] = new_attributes['upid'] unless new_attributes['upid'].nil? requires :node_id, :upid super(new_attributes) end
Public Instance Methods
finished?()
click to toggle source
# File lib/fog/compute/proxmox/models/task.rb, line 60 def finished? status == 'stopped' end
reload()
click to toggle source
# File lib/fog/compute/proxmox/models/task.rb, line 72 def reload object = collection.get(upid) merge_attributes(object.attributes) end
running?()
click to toggle source
# File lib/fog/compute/proxmox/models/task.rb, line 64 def running? status == 'running' end
stop()
click to toggle source
# File lib/fog/compute/proxmox/models/task.rb, line 68 def stop service.stop_task(node_id, upid) end
succeeded?()
click to toggle source
# File lib/fog/compute/proxmox/models/task.rb, line 56 def succeeded? finished? && exitstatus == 'OK' end