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/proxmox/compute/models/task.rb, line 47 def initialize(new_attributes = {}) prepare_service_value(new_attributes) Fog::Proxmox::Attributes.set_attr_and_sym('node_id', attributes, new_attributes) Fog::Proxmox::Attributes.set_attr_and_sym('upid', attributes, new_attributes) requires :node_id, :upid super(new_attributes) end
Public Instance Methods
finished?()
click to toggle source
# File lib/fog/proxmox/compute/models/task.rb, line 59 def finished? status == 'stopped' end
reload()
click to toggle source
# File lib/fog/proxmox/compute/models/task.rb, line 71 def reload object = collection.get(upid) merge_attributes(object.attributes) end
running?()
click to toggle source
# File lib/fog/proxmox/compute/models/task.rb, line 63 def running? status == 'running' end
stop()
click to toggle source
# File lib/fog/proxmox/compute/models/task.rb, line 67 def stop service.stop_task(node_id, upid) end
succeeded?()
click to toggle source
# File lib/fog/proxmox/compute/models/task.rb, line 55 def succeeded? finished? && exitstatus == 'OK' end