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



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

def cancel
  service.post_cancel_task(id)
end

#non_running?Boolean

Returns:

  • (Boolean)


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

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

#ready?Boolean

Returns:

  • (Boolean)


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

def ready?
  status == 'success'
end

#success?Boolean

Returns:

  • (Boolean)


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

def success?
  status == 'success'
end