2011-08-24 21:11:42 -04:00
|
|
|
require 'fog/vcloud/models/compute/task'
|
2011-05-23 21:17:16 -04:00
|
|
|
|
|
|
|
module Fog
|
|
|
|
module Vcloud
|
|
|
|
class Compute
|
|
|
|
class Tasks < Fog::Vcloud::Collection
|
|
|
|
model Fog::Vcloud::Compute::Task
|
|
|
|
|
|
|
|
attribute :href, :aliases => :Href
|
|
|
|
|
|
|
|
def all
|
2012-12-22 18:22:50 -05:00
|
|
|
self.href = service.default_vdc_href unless self.href
|
2011-05-23 21:17:16 -04:00
|
|
|
check_href!
|
2012-12-22 18:22:50 -05:00
|
|
|
if data = service.get_task_list(href).body[:Task]
|
2011-05-23 21:17:16 -04:00
|
|
|
load(data)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def get(uri)
|
2012-12-22 18:22:50 -05:00
|
|
|
service.get_task(uri)
|
2011-05-23 21:17:16 -04:00
|
|
|
rescue Fog::Errors::NotFound
|
|
|
|
nil
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|