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

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

Instance Method Summary collapse

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