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



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

def cancel
  service.post_cancel_task(id)
end

#non_running?Boolean

Returns:

  • (Boolean)


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

def non_running?
  if @service.show_progress? && (@last_progress ||= 0) < 100
    if status == 'running'
      Formatador.redisplay_progressbar(progress, 100, :label => operation_name, :started_at => start_time)
      @last_progress = progress
    elsif status == 'success'
      Formatador.redisplay_progressbar(100, 100, :label => operation_name, :started_at => start_time)
      @last_progress = 100
    end
  end
  status != 'running'
end

#ready?Boolean

Returns:

  • (Boolean)


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

def ready?
  status == 'success'
end

#success?Boolean

Returns:

  • (Boolean)


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

def success?
  status == 'success'
end