Class: Fog::Compute::VcloudDirector::Task

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/vcloud_director/models/compute/task.rb

Instance Attribute Summary

Attributes inherited from Model

#collection, #service

Instance Method Summary collapse

Methods inherited from Model

#initialize, #inspect, #reload, #symbolize_keys, #to_json, #wait_for

Methods included from Attributes::ClassMethods

#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes

Methods included from Fog::Core::DeprecatedConnectionAccessors

#connection, #connection=, #prepare_service_value

Methods included from Attributes::InstanceMethods

#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #persisted?, #requires, #requires_one

Constructor Details

This class inherits a constructor from Fog::Model

Instance Method Details

#cancelObject



50
51
52
# File 'lib/fog/vcloud_director/models/compute/task.rb', line 50

def cancel
  service.post_task_cancel(id)
end

#non_running?Boolean

Returns:

  • (Boolean)


37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/fog/vcloud_director/models/compute/task.rb', line 37

def non_running?
  if status == 'running'
    if progress.to_i == 0
      printf '.'
    else
      print " #{progress} %\r"
    end
  else
    puts "  #{status}"
  end
  status != 'running'
end

#ready?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/fog/vcloud_director/models/compute/task.rb', line 29

def ready?
  status == 'success'
end

#success?Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/fog/vcloud_director/models/compute/task.rb', line 33

def success?
  status == 'success'
end