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 48
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 60
def finished?
  status == 'stopped'
end
reload() click to toggle source
# File lib/fog/proxmox/compute/models/task.rb, line 72
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 64
def running?
  status == 'running'
end
stop() click to toggle source
# File lib/fog/proxmox/compute/models/task.rb, line 68
def stop
  service.stop_task(node_id, upid)
end
succeeded?() click to toggle source
# File lib/fog/proxmox/compute/models/task.rb, line 56
def succeeded?
  finished? && exitstatus == 'OK'
end